diff --git a/business-css/frontend/src/api/business/algorithm/index.ts b/business-css/frontend/src/api/business/algorithm/index.ts index f793a95..b38fcad 100644 --- a/business-css/frontend/src/api/business/algorithm/index.ts +++ b/business-css/frontend/src/api/business/algorithm/index.ts @@ -48,3 +48,14 @@ export function deleteBatchAlgorithms (queryParams:any){ data: queryParams }); } + + +export function algorithmsType(type:any){ + return request({ + url: '/algorithms/type/'+type , + method: 'get' + }); +} + + + diff --git a/business-css/frontend/src/views/business/algorithmManagement/modelTrainTask/index.vue b/business-css/frontend/src/views/business/algorithmManagement/modelTrainTask/index.vue index b661bae..66fd5b7 100644 --- a/business-css/frontend/src/views/business/algorithmManagement/modelTrainTask/index.vue +++ b/business-css/frontend/src/views/business/algorithmManagement/modelTrainTask/index.vue @@ -9,7 +9,7 @@ import { onMounted, ref, nextTick,reactive } from "vue"; import { ElForm, ElMessage, ElMessageBox,FormRules } from "element-plus"; import { addAlgorithms,deleteAlgorithms,trainAlgorithmsPage,trainPublish} from "@/api/algorithml"; -import { searchAlgorithmsPage } from "@/api/business/algorithm"; +import { searchAlgorithmsPage,algorithmsType } from "@/api/business/algorithm"; import { getDictItemById } from '@/api/dict'; import Page from '@/components/Pagination/page.vue' const apiUrl = import.meta.env.VITE_APP_BASE_API; // 基础路径 @@ -75,6 +75,21 @@ function getAlgorithmList() { // 获取算法列表 }); } +function selectAlgorithmType(type:any) { // 选择算法类型 + debugger + getAlgorithmType(type) +} +const algorithmsTypeData:any =ref([]) +function getAlgorithmType(type:any) { // 获取算法类型 + algorithmsTypeData.value = [] + algorithmsType(type).then((result:any) => { + if(result !=null && result.defaultHyperParams !=null){ + algorithmsTypeData.value = JSON.parse(result.defaultHyperParams); + } + + }).catch((err:any) => { + }); +} const menuData:any = ref([]); // 查询字典项 function menuInit() { // 获取算法类型字典项 @@ -141,6 +156,7 @@ function addClick() { defaultHyperParams: "", }; trainParamsData.value = [] + algorithmsTypeData.value = [] fileList.value = [] isSwitch.value = false; dialogVisibles.value = true; @@ -163,13 +179,12 @@ function confirmClick(formEl: any) { const data = new FormData() - if(trainParamsData.value.length != 0){ + if(algorithmsTypeData.value.length != 0){ let template:any = {} - trainParamsData.value.forEach((element:any) => { - template[element.key] = element.value + algorithmsTypeData.value.forEach((element:any) => { + template[element.key] = element.default }); info.value.trainParams = JSON.stringify(template) - } @@ -444,7 +459,7 @@ function confirmsClick(){ - + @@ -455,16 +470,36 @@ function confirmsClick(){ - - + + + + + + + + + + + + + + + + + + + + + + + + - +