ajax 8 месяцев назад
Родитель
Сommit
a7186f9959
1 измененных файлов с 12 добавлено и 18 удалено
  1. 12 18
      src/views/taais/homePage/task/index.vue

+ 12 - 18
src/views/taais/homePage/task/index.vue

@@ -49,8 +49,8 @@
         <el-container style="display: flex; flex-direction: column">
           <el-container v-for="(item, index) in formData.data" :key="index" style="margin-top: 5px">
             <el-button v-show="formData.data" @click="showDataSelectionDialog(index, true)"> 选择批次 </el-button>
-            <span v-if="!item || item.length === 0" class="span_class" style=" font-size: 15px;color: red">未完成</span>
-            <span v-else class="span_class" style=" font-size: 15px;color: greenyellow">已选择</span>
+            <span v-if="!item || item.length === 0" class="span_class" style="font-size: 15px; color: red">未完成</span>
+            <span v-else class="span_class" style="font-size: 15px; color: greenyellow">已选择</span>
             <el-button v-show="formData.data.length > 1" style="margin-left: 20px" @click="removeDataItem(index, true)"> 删除数据 </el-button>
             <el-button
               v-show="formData.taskType === '2' && index + 1 === formData.data.length"
@@ -69,8 +69,8 @@
         <el-container style="display: flex; flex-direction: column">
           <el-container v-for="(item, index) in formData.testData" :key="index" style="margin-top: 5px">
             <el-button v-show="formData.testData" @click="showDataSelectionDialog(index, false)"> 选择批次 </el-button>
-            <span v-if="!item || item.length === 0" class="span_class" style=" font-size: 15px;color: red">未完成</span>
-            <span v-else class="span_class" style=" font-size: 15px;color: greenyellow">已选择</span>
+            <span v-if="!item || item.length === 0" class="span_class" style="font-size: 15px; color: red">未完成</span>
+            <span v-else class="span_class" style="font-size: 15px; color: greenyellow">已选择</span>
             <el-button v-show="formData.testData.length > 1" style="margin-left: 20px" @click="removeDataItem(index, false)"> 删除数据 </el-button>
             <el-button
               v-show="formData.taskType === '2' && index + 1 === formData.testData.length"
@@ -90,7 +90,7 @@
         <el-button v-show="formData.expandData" style="margin-left: 20px" @click="showExpandDataSuperParameterConfig"> 超参配置 </el-button>
       </el-container>
 
-      <el-form-item style=" margin-top: 20px;margin-left: 30px">
+      <el-form-item style="margin-top: 20px; margin-left: 30px">
         <el-button type="primary" @click="submit"> 提交 </el-button>
 
         <el-button @click="cancel"> 取消 </el-button>
@@ -149,7 +149,7 @@
           <el-table-column prop="batchSize" label="数量" width="80"> </el-table-column>
         </el-table>
 
-        <el-container style=" display: flex; flex-direction: column; justify-content: center; margin-right: 10px;margin-left: 10px">
+        <el-container style="display: flex; flex-direction: column; justify-content: center; margin-right: 10px; margin-left: 10px">
           <el-button type="primary" :disabled="!canSelect" @click="clickSelectData"> {{ '=>' }} </el-button>
           <el-container style="height: 10px"></el-container>
           <el-button type="primary" :disabled="!canDeselect" @click="clickDeselectData"> {{ '<=' }} </el-button>
@@ -271,12 +271,7 @@ const submit = () => {
       o3.push(__trained)
     }
 
-    obj.params =
-      JSON.stringify(o1) +
-      ';;;' +
-      JSON.stringify(o2) +
-      ';;;' +
-      JSON.stringify(o3)
+    obj.params = JSON.stringify(o1) + ';;;' + JSON.stringify(o2) + ';;;' + JSON.stringify(o3)
     __idx++
   })
   // console.log('submit', params)
@@ -439,7 +434,7 @@ const formData = reactive({
   // 测试数据
   testData: [null],
   expandData: false,
-  expandConfig: ''
+  expandConfig: null
 })
 let selectDataIndex = null
 const dataDialogVisible = ref(false)
@@ -500,18 +495,17 @@ const onAlgorithmModelSelect = index => {
 
 const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
 
-
 let UPDATE_INDEX = ref({ id: null, idx: null })
 const showAddModelDialog = (item, index) => {
   let _id = null
   try {
     _id = item.id
   } catch (e) {
-    ElMessage.error("请先选择算法模型")
+    ElMessage.error('请先选择算法模型')
     return
   }
   if (!_id || _id.length === 0) {
-    ElMessage.error("请先选择算法模型")
+    ElMessage.error('请先选择算法模型')
     return
   }
   UPDATE_INDEX.value = {
@@ -564,10 +558,10 @@ const showAddModelDialog = (item, index) => {
 // 获取算法模型绑定列表
 const updateModelList = (id, index) => {
   // 获取算法列表?
-  queryModelList({id: id}).then(res => {
+  queryModelList({ id: id }).then(res => {
     console.log('algorithm task model get: ', res)
     if (res.code === 200) {
-      formData.algoModelList[index] = [ {id: null, modelName: '未选择'} , ...res.data]
+      formData.algoModelList[index] = [{ id: null, modelName: '未选择' }, ...res.data]
     }
   })
 }