Browse Source

fix: 排序、创建页面bug

Rmengdi 9 months ago
parent
commit
84268cdff7

+ 16 - 5
src/views/taais/homePage/createTask.vue

@@ -850,22 +850,25 @@ let addReasoningAgloIndex = 1
 const proFormRef = ref<InstanceType<typeof ProForm> | null>(null)
 // 增加训练算法
 const onAdd = pageNum => {
-  let arrayName, agloIndex, type
+  let arrayName, agloIndex, type, name
   switch (pageNum) {
     case 5:
       arrayName = 'train'
       agloIndex = addTrainAgloIndex
       type = 1
+      name = '训练'
       break
     case 9:
       arrayName = 'test'
       agloIndex = addTestAgloIndex
       type = 2
+      name = '验证'
       break
     case 13:
       arrayName = 'reasoning'
       agloIndex = addReasoningAgloIndex
       type = 3
+      name = '测试'
       break
     default:
       break
@@ -880,10 +883,10 @@ const onAdd = pageNum => {
       }
       getAlgorithmApi(type, subSystem).then(res1 => {
         formItems.value[0].items.push({
-          label: '选择训练算法',
+          label: `选择${name}算法`,
           prop: `${arrayName}Aglo${agloIndex}`,
           span: 14,
-          rules: [{ required: true, message: '请选择训练算法' }],
+          rules: [{ required: true, message: `请选择${name}算法` }],
           show: () => {
             return pageIndex.value === pageNum ? true : false
           },
@@ -897,11 +900,19 @@ const onAdd = pageNum => {
               if (!formItem[`${arrayName}`][`${agloIndex}`]['algorithmId']) {
                 formItem[`${arrayName}`][`${agloIndex}`]['algorithmId'] = agloId
                 getModelApi(agloId).then(res2 => {
+                  if (type === 2 || type === 3) {
+                    res2.data.unshift({
+                      algorithmId: null,
+                      id: 1,
+                      modelAddress: null,
+                      modelName: '基于训练生成的模型'
+                    })
+                  }
                   formItems.value[0].items.push({
-                    label: '选择训练模型',
+                    label: `选择${name}模型`,
                     prop: `${arrayName}Model${agloIndex}`,
                     span: 14,
-                    rules: [{ required: true, message: '请选择训练模型' }],
+                    rules: [{ required: true, message: `请选择${name}模型` }],
                     show: () => {
                       return pageIndex.value === pageNum ? true : false
                     },

+ 2 - 2
src/views/task/bizProcess/index.vue

@@ -152,7 +152,7 @@ const refreshList = () => {
       pageSize: 100,
       subTaskId
     }).then(res => {
-      bizProcessList.value = res.data['list']
+      bizProcessList.value = res.data['list'].sort((a, b) => b.index - a.index)
     })
   }, 0)
 }
@@ -575,7 +575,7 @@ const setItemsOptions = () => {
   overflow: scroll scroll;
   .headerRow {
     height: 50px;
-    font-size: 1.5rem;
+    font-size: 1.2rem;
     line-height: 50px;
     text-align: center;
   }

+ 12 - 21
src/views/task/subtask/index.vue

@@ -3,8 +3,8 @@
     <ProTable ref="proTable" :is-show-search="false" :columns="columns" row-key="id" :data="subTaskList">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['task:subtask:add']" icon="CirclePlus" @click="openDialog(1, '算法子任务新增')"> 新增 </el-button>
-        <el-button type="primary" v-auth="['task:subtask:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <!-- <el-button type="primary" v-auth="['task:subtask:add']" icon="CirclePlus" @click="openDialog(1, '算法子任务新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['task:subtask:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button> -->
         <el-button type="primary" v-auth="['task:subtask:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
@@ -41,16 +41,7 @@ import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
 import { useRoute, useRouter } from 'vue-router'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import {
-  listSubtaskApi,
-  delSubtaskApi,
-  addSubtaskApi,
-  updateSubtaskApi,
-  importTemplateApi,
-  importSubtaskDataApi,
-  exportSubtaskApi,
-  getSubtaskApi
-} from '@/api/modules/task/subtask'
+import { listSubtaskApi, delSubtaskApi, addSubtaskApi, updateSubtaskApi, exportSubtaskApi, getSubtaskApi } from '@/api/modules/task/subtask'
 import { getDictsApi } from '@/api/modules/system/dictData'
 const router = useRouter()
 const route = useRoute()
@@ -105,15 +96,15 @@ const downloadFile = async () => {
 
 // 批量添加算法子任务
 const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
-const batchAdd = () => {
-  const params = {
-    title: '算法子任务',
-    tempApi: importTemplateApi,
-    importApi: importSubtaskDataApi,
-    getTableList: proTable.value?.getTableList
-  }
-  dialogRef.value?.acceptParams(params)
-}
+// const batchAdd = () => {
+//   const params = {
+//     title: '算法子任务',
+//     tempApi: importTemplateApi,
+//     importApi: importSubtaskDataApi,
+//     getTableList: proTable.value?.getTableList
+//   }
+//   dialogRef.value?.acceptParams(params)
+// }
 
 const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
 // 打开弹框的功能