From 26a8fb860e290fa14efecfc54eb7fdfc2845ad3e Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Tue, 7 Apr 2026 16:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=AD=E7=BB=83bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modelTrainTask/index.vue | 62 ++++++++----------- 1 file changed, 26 insertions(+), 36 deletions(-) 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 915e63a..0ab8ea9 100644 --- a/business-css/frontend/src/views/business/algorithmManagement/modelTrainTask/index.vue +++ b/business-css/frontend/src/views/business/algorithmManagement/modelTrainTask/index.vue @@ -130,18 +130,7 @@ const input = ref(""); //新建训练任务 const title = ref(""); const info: any = ref({ - name: "", - description: "", - version: "", - principle: "", - status:1, - algorithmType: "", - inputParams: "", - outputParams: "", - inferBaseUrl: "", - trainBaseUrl: "", - supportedDeviceTypes: "", - defaultHyperParams: "", + version: "" }); const dialogVisibles = ref(false); @@ -149,24 +138,12 @@ const modelVisible= ref(false); function addClick() { title.value = "新增训练任务"; info.value = { - name: "", - description: "", - version: "", - principle: "", - status:'', - algorithmType: "", - inputParams: "", - outputParams: "", - inferBaseUrl: "", - trainBaseUrl: "", - supportedDeviceTypes: "", - defaultHyperParams: "", + version: "" }; - input_cols.value = [] - target_col.value = "" - fileFlow.value = null - + input_cols.value = [] // 特征列 + target_col.value = "" // 目标列 + fileFlow.value = null // 数据集 trainParamsData.value = [] algorithmsTypeData.value = [] fileList.value = [] @@ -207,22 +184,31 @@ function confirmClick(formEl: any) { }); info.value.trainParams = JSON.stringify(template) } - + let infoTemp = JSON.parse(JSON.stringify(info.value)) let feature_map_config = { input_cols: input_cols.value, target_col: target_col.value, } + infoTemp.dataset_path = dataset_path.value infoTemp.feature_map_config = JSON.stringify(feature_map_config) - data.append('task', JSON.stringify(feature_map_config)) + data.append('task', JSON.stringify(infoTemp)) dialogVisibles.value = false addAlgorithms(data).then((res: any) => { dialogVisibles.value = false; - ElMessage({ - message: "新增成功", - type: "success", - }) - gettableData(); + if(res.code == '0'){ + ElMessage({ + message: "新增成功", + type: "success", + }) + gettableData(); + }else{ + ElMessage({ + message: res.msg, + type: "error", + }) + } + }).catch(() => { dialogVisibles.value = false; isSwitch.value = false; @@ -474,12 +460,14 @@ const objectSpanMethod = ({ } } const fileFlow:any = ref(null) +const dataset_path = ref('') function handlePreview(file: any){ // loadingtext.value = "正在导入数据,请耐心等待!" loading.value = true fileFlow.value = file input_cols.value = [] - target_col.value = "" + target_col.value = '' + dataset_path.value = '' } const upload:any = ref(null) @@ -488,9 +476,11 @@ function handlesSuccess(file: any) { columnsData.value = [] input_cols.value = [] target_col.value = '' + dataset_path.value = '' loading.value = false if(file !== false && file.code == '0'){ columnsData.value = file.data.columns + dataset_path.value = file.data.path ElMessage({ message: "导入成功!", type: "success",