فهرست منبع

Merge branch 'develop' of http://47.108.150.237:10000/www/taais-web into develop

WANGKANG 9 ماه پیش
والد
کامیت
65f890849e

+ 143 - 0
src/api/interface/task/taskConfiguration.ts

@@ -0,0 +1,143 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface TaskConfigurationVO extends BaseEntity {
+    /**
+    * 主键ID
+    */
+        id: string | number;
+
+    /**
+    * 算法任务名称
+    */
+        name: string;
+
+    /**
+    * 训练算法地址
+    */
+        trainUrl: string;
+
+    /**
+    * 训练超参配置
+    */
+        trainParams: string;
+
+    /**
+    * 验证算法地址
+    */
+        verifyUrl: string;
+
+    /**
+    * 验证超参配置
+    */
+        verifyParams: string;
+
+    /**
+    * 测试算法地址
+    */
+        testUrl: string;
+
+    /**
+    * 测试超参配置
+    */
+        testParams: string;
+
+    /**
+    * 备注
+    */
+        remark: string;
+
+    }
+
+    export interface TaskConfigurationForm {
+        /**
+        * 主键ID
+        */
+        id?: string | number;
+
+        /**
+        * 算法任务名称
+        */
+        name?: string;
+
+        /**
+        * 训练算法地址
+        */
+        trainUrl?: string;
+
+        /**
+        * 训练超参配置
+        */
+        trainParams?: string;
+
+        /**
+        * 验证算法地址
+        */
+        verifyUrl?: string;
+
+        /**
+        * 验证超参配置
+        */
+        verifyParams?: string;
+
+        /**
+        * 测试算法地址
+        */
+        testUrl?: string;
+
+        /**
+        * 测试超参配置
+        */
+        testParams?: string;
+
+        /**
+        * 备注
+        */
+        remark?: string;
+
+        /**
+        * 乐观锁
+        */
+        version?: number;
+
+    }
+
+    export interface TaskConfigurationQuery extends PageQuery {
+        /**
+        * 算法任务名称
+        */
+        name?: string;
+
+        /**
+        * 训练算法地址
+        */
+        trainUrl?: string;
+
+        /**
+        * 训练超参配置
+        */
+        trainParams?: string;
+
+        /**
+        * 验证算法地址
+        */
+        verifyUrl?: string;
+
+        /**
+        * 验证超参配置
+        */
+        verifyParams?: string;
+
+        /**
+        * 测试算法地址
+        */
+        testUrl?: string;
+
+        /**
+        * 测试超参配置
+        */
+        testParams?: string;
+
+    /**
+    * 日期范围参数
+    */
+    params?: any;
+    }

+ 8 - 0
src/api/modules/demo/data.ts

@@ -1,4 +1,12 @@
 import http from '@/api'
+/**
+ * @name 查询batchList
+ * @returns 返回列表
+ */
+export const batchListDataApi = () => {
+  return http.get<any[]>('/demo/data/batchList', {}, { loading: true })
+}
+
 /**
  * @name 查询数据管理列表
  * @param query 参数

+ 93 - 0
src/api/modules/task/bizProcessNew.ts

@@ -0,0 +1,93 @@
+import http from '@/api'
+/**
+ * @name 查询算法业务处理列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listBizProcessApi = (query: any) => {
+  return http.get<any[]>('/identification/identificationSubtaskDetails/list', query, { loading: false })
+}
+
+/**
+ * @name 查询算法业务处理详细
+ * @param id id
+ * @returns returns
+ */
+export const getBizProcessApi = (id: string | number) => {
+  return http.get<any>(`/identification/identificationSubtaskDetails/${id}`)
+}
+
+/**
+ * @name 新增算法业务处理
+ * @param data data
+ * @returns returns
+ */
+export const addBizProcessApi = (data: any) => {
+  return http.post<any>('/identification/identificationSubtaskDetails', data, { loading: false })
+}
+
+/**
+ * @name 修改算法业务处理
+ * @param data data
+ * @returns returns
+ */
+export const updateBizProcessApi = (data: any) => {
+  return http.put<any>('/identification/identificationSubtaskDetails', data, { loading: false })
+}
+
+/**
+ * @name 删除算法业务处理
+ * @param id id
+ * @returns returns
+ */
+export const delBizProcessApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/identification/identificationSubtaskDetails/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/identification/identificationSubtaskDetails/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importBizProcessDataApi = (data: any) => {
+  return http.post('/identification/identificationSubtaskDetails/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportBizProcessApi = (data: any) => {
+  return http.downloadPost('/identification/identificationSubtaskDetails/export', data)
+}
+
+/**
+ * @name 查看训练结果
+ * @returns returns
+ */
+export const getTrainResultApi = (subtaskId: string | number) => {
+  return http.get(`/identification/identificationSubtaskDetails/getTrainResult/${subtaskId}`)
+}
+
+/**
+ * @name 查看验证结果
+ * @returns returns
+ */
+export const getVerifyResultApi = (subtaskId: string | number) => {
+  return http.get(`/identification/identificationSubtaskDetails/getVerifyResult/${subtaskId}`)
+}
+
+/**
+ * @name 查看测试结果
+ * @returns returns
+ */
+export const getTestResultApi = (subtaskId: string | number) => {
+  return http.get(`/identification/identificationSubtaskDetails/getTestResult/${subtaskId}`)
+}

+ 69 - 0
src/api/modules/task/subtaskDetailNew.ts

@@ -0,0 +1,69 @@
+import http from '@/api'
+/**
+ * @name 查询算法子任务详情列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listSubtaskDetailApi = (query: any) => {
+  return http.get<any[]>('/identification/identificationSubtaskDetails/list', query, { loading: true })
+}
+
+/**
+ * @name 查询算法子任务详情详细
+ * @param id id
+ * @returns returns
+ */
+export const getSubtaskDetailApi = (id: string | number) => {
+  return http.get<any>(`/identification/identificationSubtaskDetails/${id}`)
+}
+
+/**
+ * @name 新增算法子任务详情
+ * @param data data
+ * @returns returns
+ */
+export const addSubtaskDetailApi = (data: any) => {
+  return http.post<any>('/identification/identificationSubtaskDetails', data, { loading: false })
+}
+
+/**
+ * @name 修改算法子任务详情
+ * @param data data
+ * @returns returns
+ */
+export const updateSubtaskDetailApi = (data: any) => {
+  return http.put<any>('/identification/identificationSubtaskDetails', data, { loading: false })
+}
+
+/**
+ * @name 删除算法子任务详情
+ * @param id id
+ * @returns returns
+ */
+export const delSubtaskDetailApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/identification/identificationSubtaskDetails/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/identification/identificationSubtaskDetails/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importSubtaskDetailDataApi = (data: any) => {
+  return http.post('/identification/identificationSubtaskDetails/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportSubtaskDetailApi = (data: any) => {
+  return http.downloadPost('/identification/identificationSubtaskDetails/export', data)
+}

+ 69 - 0
src/api/modules/task/subtaskNew.ts

@@ -0,0 +1,69 @@
+import http from '@/api'
+/**
+ * @name 查询算法子任务列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listSubtaskApi = (query) => {
+  return http.get<any[]>('/identification/identificationSubtask/list', query, { loading: false })
+}
+
+/**
+ * @name 查询算法子任务详细
+ * @param id id
+ * @returns returns
+ */
+export const getSubtaskApi = (id: string | number) => {
+  return http.get<any>(`/identification/identificationSubtask/${id}`)
+}
+
+/**
+ * @name 新增算法子任务
+ * @param data data
+ * @returns returns
+ */
+export const addSubtaskApi = (data: any) => {
+  return http.post<any>('/identification/identificationSubtask', data, { loading: false })
+}
+
+/**
+ * @name 修改算法子任务
+ * @param data data
+ * @returns returns
+ */
+export const updateSubtaskApi = (data: any) => {
+  return http.put<any>('/identification/identificationSubtask', data, { loading: false })
+}
+
+/**
+ * @name 删除算法子任务
+ * @param id id
+ * @returns returns
+ */
+export const delSubtaskApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/identification/identificationSubtask/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/identification/identificationSubtask/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importSubtaskDataApi = (data: any) => {
+  return http.post('/identification/identificationSubtask/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportSubtaskApi = (data: any) => {
+  return http.downloadPost('/identification/identificationSubtask/export', data)
+}

+ 23 - 0
src/api/modules/task/task.ts

@@ -1,5 +1,15 @@
 import http from '@/api'
 import { TaskVO, TaskForm, TaskQuery } from '@/api/interface/task/task'
+
+/**
+ * @name 新增算法任务
+ * @param data data
+ * @returns returns
+ */
+export const createTaskApi = (data: any) => {
+  return http.post<any>('/identification/identificationTask/create', data, { loading: false })
+}
+
 /**
  * @name 查询算法任务列表
  * @param query 参数
@@ -9,6 +19,15 @@ export const listTaskApi = (query: TaskQuery) => {
   return http.get<TaskVO[]>('/task/task/list', query, { loading: true })
 }
 
+/**
+ * @name 查询算法任务列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listITaskNewApi = (query: TaskQuery) => {
+  return http.get<TaskVO[]>('/identification/identificationTask/list', query, { loading: true })
+}
+
 /**
  * @name 查询所有算法
  * @returns 返回列表
@@ -26,6 +45,10 @@ export const getTaskApi = (id: string | number) => {
   return http.get<TaskVO>(`/task/task/${id}`)
 }
 
+export const getITaskNewApi = (id: string | number) => {
+  return http.get<any>(`/identification/identificationTask/${id}`)
+}
+
 /**
  * @name 新增算法任务
  * @param data data

+ 70 - 0
src/api/modules/task/taskConfiguration.ts

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { TaskConfigurationVO, TaskConfigurationForm, TaskConfigurationQuery  } from '@/api/interface/task/taskConfiguration'
+/**
+ * @name 查询算法任务列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listTaskConfigurationApi = (query: TaskConfigurationQuery) => {
+    return http.get<TaskConfigurationVO[]>('/task/taskConfiguration/list', query, { loading: true })
+}
+
+/**
+ * @name 查询算法任务详细
+ * @param id id
+ * @returns returns
+ */
+export const getTaskConfigurationApi = (id: string | number) => {
+    return http.get<TaskConfigurationVO>(`/task/taskConfiguration/${id}`)
+}
+
+/**
+ * @name 新增算法任务
+ * @param data data
+ * @returns returns
+ */
+export const addTaskConfigurationApi = (data: TaskConfigurationForm) => {
+    return http.post<any>('/task/taskConfiguration', data, { loading: false })
+}
+
+/**
+ * @name 修改算法任务
+ * @param data data
+ * @returns returns
+ */
+export const updateTaskConfigurationApi = (data: TaskConfigurationForm) => {
+    return http.put<any>('/task/taskConfiguration', data, { loading: false })
+}
+
+/**
+ * @name 删除算法任务
+ * @param id id
+ * @returns returns
+ */
+export const delTaskConfigurationApi = (id: string | number | Array<string | number>) => {
+    return http.delete<any>(`/task/taskConfiguration/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+    return http.downloadPost('/task/taskConfiguration/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importTaskConfigurationDataApi = (data: any) => {
+    return http.post('/task/taskConfiguration/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportTaskConfigurationApi = (data: any) => {
+    return http.downloadPost('/task/taskConfiguration/export', data)
+}

+ 15 - 0
src/routers/modules/routerData.json

@@ -30,6 +30,21 @@
         "activeMenu": "/index"
       }
     },
+    {
+      "path": "/createTaskNew",
+      "name": "createTask",
+      "component": "taais/homePage/task/index",
+      "hidden": true,
+      "meta": {
+        "icon": "HomeFilled",
+        "title": "创建任务",
+        "link": "",
+        "full": false,
+        "affix": false,
+        "noCache": false,
+        "activeMenu": "/index"
+      }
+    },
     {
       "path": "/logPage/:flag",
       "name": "logPage",

+ 16 - 8
src/views/taais/homePage/index.vue

@@ -2,14 +2,15 @@
   <div class="home-container">
     <dv-border-box1 ref="borderRef" style="width: 100%; height: 100%; margin: 0 auto">
       <div class="table-box">
-        <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listTaskApi" :tool-button="false">
+        <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listITaskNewApi" :tool-button="false">
           <template #tableHeader="">
-            <el-button type="primary" v-auth="['system:user:add']" :icon="CirclePlus" @click="createTask()"> 创建任务 </el-button>
+<!--            <el-button type="primary" v-auth="['system:user:add']" :icon="CirclePlus" @click="createTask()"> 创建任务 </el-button>-->
+            <el-button type="primary" v-auth="['system:user:add']" :icon="CirclePlus" @click="createTaskNew()"> 创建任务 </el-button>
           </template>
           <!-- 表格操作 -->
           <template #operation="scope">
             <el-button type="primary" link icon="View" v-auth="['task:task:query']" @click="viewDetails(scope.row)"> 查看详情 </el-button>
-            <el-button type="primary" link :icon="View" @click="openDialog(3, '任务查看', scope.row)">查看</el-button>
+<!--            <el-button type="primary" link :icon="View" @click="openDialog(3, '任务查看', scope.row)">查看</el-button>-->
           </template>
         </ProTable>
         <!-- <ProTable
@@ -42,7 +43,8 @@ import { useRouter } from 'vue-router'
 import { ColumnProps, ProTableInstance } from '@/components/ProTable/interface'
 import { addUserApi, updateUserApi, deptTreeSelectApi } from '@/api/modules/system/user'
 // import { getTaskApi } from '@/api/modules/taais/task'
-import { listTaskApi, getTaskApi } from '@/api/modules/task/task'
+// import { listTaskApi, getTaskApi } from '@/api/modules/task/task'
+import { listITaskNewApi, getITaskNewApi } from '@/api/modules/task/task'
 import { getDictsApi } from '@/api/modules/system/dictData'
 // import taskDataList from '@/assets/mock/taskData.json'
 // import { getDictsApi } from '@/api/modules/system/dictData'
@@ -65,13 +67,15 @@ const getTreeFilter = async () => {
 }
 // 查看详情
 const viewDetails = row => {
+  console.log(row)
   router.push({ path: `/task/subtask/`, query: { id: row.id } })
 }
 // 批量添加用户
 const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
 // 打开弹框的功能
 const openDialog = async (type: number, title: string, row?: any) => {
-  let res = getTaskApi(row?.taskId || null)
+  console.log(row)
+  let res = getITaskNewApi(row?.id || null)
   // 表单项配置
   const fieldList: Form.FieldItem[] = [
     {
@@ -95,9 +99,13 @@ const openDialog = async (type: number, title: string, row?: any) => {
   formDialogRef.value?.openDialog(params)
 }
 const router = useRouter()
-// 增加任务
-const createTask = () => {
-  router.push(`/createTask`)
+// // 增加任务
+// const createTask = () => {
+//   router.push(`/createTask`)
+// }
+
+const createTaskNew = () => {
+  router.push(`/createTaskNew`)
 }
 // 表格配置项
 const columns = reactive<ColumnProps<User.ResUserList>[]>([

+ 667 - 0
src/views/taais/homePage/task/index.vue

@@ -0,0 +1,667 @@
+<template>
+  <div class="createTask-bigBox">
+    <dv-border-box1 ref="borderRef" style="width: 80%; height: calc(100% - 20px); margin: 0 auto">
+      <el-container style="height: 30px"></el-container>
+      <el-container>
+        <span class="span_class">任务名称</span>
+        <el-input
+          style="width: 300px"
+          type="text"
+          placeholder="请输入任务名称"
+          v-model="formData.taskName"
+        >
+        </el-input>
+      </el-container>
+
+      <el-container style="height: 10px"></el-container>
+      <el-container>
+        <span class="span_class">任务类型</span>
+        <el-radio v-model="formData.taskType" label="1">单数据多算法任务</el-radio>
+        <el-radio v-model="formData.taskType" label="2">多数据单算法任务</el-radio>
+      </el-container>
+
+      <el-container style="height: 10px"></el-container>
+      <el-container>
+        <span class="span_class">算法任务</span>
+        <el-checkbox-group v-model="formData.tasks">
+          <el-checkbox label="1">训练</el-checkbox>
+          <el-checkbox label="2">测试</el-checkbox>
+        </el-checkbox-group>
+      </el-container>
+
+      <el-container style="height: 10px"></el-container>
+      <el-container>
+        <span class="span_class">选择算法</span>
+        <el-container style="display: flex; flex-direction: column">
+          <el-container v-for="(item, index) in formData.algorithms" :key="index" style="margin-top: 5px">
+            <el-select style="width: 200px" v-model="formData.algoIdx[index]" placeholder="请选择" @change="onModelSelect(index)">
+              <el-option
+                v-for="(item1,index) in algorithms"
+                :key="item1.id"
+                :label="item1.name"
+                :value="index"
+              >
+              </el-option>
+            </el-select>
+            <el-button style="margin-left: 20px" @click="showSuperParameterConfig(item, index)">
+              超参配置
+            </el-button>
+            <el-button @click="showAddModelDialog">
+              导入模型
+            </el-button>
+            <el-button v-show="formData.algorithms.length>1" @click="removeItem(index)">
+              删除算法
+            </el-button>
+            <el-button v-show="formData.taskType === '1' && index + 1 === formData.algorithms.length" @click="appendNewItem">
+              添加算法
+            </el-button>
+          </el-container>
+        </el-container>
+      </el-container>
+
+      <el-container style="height: 10px"></el-container>
+      <el-container>
+        <span class="span_class">选择训练数据</span>
+        <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="color: red; font-size: 15px">未完成</span>
+            <span v-else class="span_class" style="color: greenyellow; font-size: 15px">已选择</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" style="margin-left: 20px" @click="appendNewDataItem(true)">
+              添加数据
+            </el-button>
+          </el-container>
+        </el-container>
+      </el-container>
+
+      <el-container style="height: 10px"></el-container>
+      <el-container>
+        <span class="span_class">选择测试数据</span>
+        <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="color: red; font-size: 15px">未完成</span>
+            <span v-else class="span_class" style="color: greenyellow; font-size: 15px">已选择</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" style="margin-left: 20px" @click="appendNewDataItem(false)">
+              添加数据
+            </el-button>
+          </el-container>
+        </el-container>
+      </el-container>
+
+      <el-container style="height: 10px"></el-container>
+      <el-container>
+        <span class="span_class">是否训练扩增</span>
+        <el-checkbox v-model="formData.expandData">扩增</el-checkbox>
+        <el-button v-show="formData.expandData" style="margin-left: 20px" @click="showExpandDataSuperParameterConfig">
+          超参配置
+        </el-button>
+      </el-container>
+
+      <el-form-item style="margin-left: 30px; margin-top: 20px">
+        <el-button type="primary" @click="submit">
+          提交
+        </el-button>
+
+        <el-button @click="cancel">
+          取消
+        </el-button>
+      </el-form-item>
+    </dv-border-box1>
+
+    <FormDialog ref="formDialogRef" />
+
+    <el-dialog
+      v-model="expandDataDialogVisible"
+      title="数据扩增超参配置"
+    >
+<!--      <span style="font-size: 16px; color: darkorange; font-weight: bold"> 数据扩增超参 </span>-->
+      <el-container v-for="(item, index) in expandDataConfig" :key="index" style="margin-top: 5px">
+        <span class="span_class"> {{ item.name }}</span>
+        <el-input
+          style="width: 300px"
+          type="text"
+          :placeholder="'请输入'+item.name"
+          v-model="item.defaultValue"
+        >
+        </el-input>
+      </el-container>
+      <el-container style="height: 10px"></el-container>
+
+      <span class="dialog-footer" >
+        <el-button type="primary" @click="submitExpandDataConfigDialog">确 定</el-button>
+        <el-button @click="expandDataDialogVisible = false">取 消</el-button>
+      </span>
+    </el-dialog>
+
+    <el-dialog
+      v-model="dialogVisible"
+      :title="superParameterFormData.title"
+    >
+      <span style="font-size: 16px; color: darkorange; font-weight: bold"> 训练超参 </span>
+      <el-container v-for="(item, index) in superParameterFormData.trainParams" :key="index">
+        <span class="span_class"> {{ item.name }}</span>
+        <el-input
+          style="width: 300px"
+          type="text"
+          :placeholder="'请输入'+item.name"
+          v-model="item.defaultValue"
+        >
+        </el-input>
+      </el-container>
+      <el-container style="height: 10px"></el-container>
+
+      <span style="font-size: 16px; color: darkorange; font-weight: bold"> 验证超参 </span>
+      <el-container v-for="(item, index) in superParameterFormData.verifyParams" :key="index">
+        <span class="span_class"> {{ item.name }}</span>
+        <el-input
+          style="width: 300px"
+          type="text"
+          :placeholder="'请输入'+item.name"
+          v-model="item.defaultValue"
+        >
+        </el-input>
+      </el-container>
+      <el-container style="height: 10px"></el-container>
+
+      <span style="font-size: 16px; color: darkorange; font-weight: bold"> 测试超参 </span>
+      <el-container v-for="(item, index) in superParameterFormData.testParams" :key="index">
+        <span class="span_class"> {{ item.name }}</span>
+        <el-input
+          style="width: 300px"
+          type="text"
+          :placeholder="'请输入'+item.name"
+          v-model="item.defaultValue"
+        >
+        </el-input>
+      </el-container>
+      <el-container style="height: 10px"></el-container>
+
+      <span class="dialog-footer" >
+        <el-button type="primary" @click="submitConfigDialog">确 定</el-button>
+        <el-button @click="dialogVisible = false">取 消</el-button>
+      </span>
+    </el-dialog>
+
+    <el-dialog
+      v-model="dataDialogVisible"
+      title="选择数据批次"
+      style="width: 70vw"
+    >
+      <el-container>
+        <el-table
+          :data="batchDataList"
+          tooltip-effect="dark"
+          style="width: 100%"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column
+            type="selection"
+            width="55"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="batchNum"
+            label="所有批次"
+            width="120"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="batchSize"
+            label="数量"
+            width="80"
+          >
+          </el-table-column>
+        </el-table>
+
+        <el-container style="margin-left: 10px; margin-right: 10px; display: flex; flex-direction: column; justify-content: center">
+          <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>
+        </el-container>
+
+        <el-table
+          :data="selectedBatchDataList"
+          tooltip-effect="dark"
+          style="width: 100%"
+          @selection-change="handleDeselectionChange"
+        >
+          <el-table-column
+            type="selection"
+            width="55"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="batchNum"
+            label="已选批次"
+            width="120"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="batchSize"
+            label="数量"
+            width="80"
+          >
+          </el-table-column>
+        </el-table>
+      </el-container>
+
+      <el-container style="height: 10px"></el-container>
+      <span class="dialog-footer" >
+        <el-button type="primary" @click="submitDataDialog">确 定</el-button>
+        <el-button @click="dataDialogVisible = false">取 消</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup lang="ts">
+import {reactive, ref, onMounted, computed} from "vue";
+import {addModelApi} from "@/api/modules/ag/model";
+import {createTaskApi, getAlgorithmOptionApi} from "@/api/modules/task/task";
+import FormDialog from "@/components/FormDialog/index.vue";
+import { useRouter } from 'vue-router'
+import {listTaskConfigurationApi} from "@/api/modules/task/taskConfiguration";
+import {batchListDataApi} from "@/api/modules/demo/data";
+import {listDataApi} from "@/api/modules/system/dictData";
+import {ElMessage} from "element-plus";
+const valid = data => {
+  let ret = {
+    code: 400,
+    message: 'OK'
+  }
+  if (!data.taskName || data.taskName.length === 0) {
+    ret.message = '任务名称不能为空'
+    return ret
+  }
+  if (!data.taskItemList || data.taskItemList.length === 0) {
+    ret.message = '请选择算法任务'
+    return ret
+  }
+  data.algTaskList.forEach(obj => {
+    if (!obj || !obj.id) {
+      ret.message = '请选择算法模型'
+    }
+  })
+  if (ret.message !== 'OK') {
+    return ret
+  }
+  if (data.taskItemList.includes('1')) {
+    data.trainBatchNumList.forEach(obj => {
+      if (!obj) {
+        ret.message = '请选择训练数据集'
+      }
+    })
+    if (ret.message !== 'OK') {
+      return ret
+    }
+  }
+  if (data.taskItemList.includes('2')) {
+    data.testBatchNumList.forEach(obj => {
+      if (!obj) {
+        ret.message = '请选择测试数据集'
+      }
+    })
+    if (ret.message !== 'OK') {
+      return ret
+    }
+  }
+  if (data.hasTrainAugmentation) {
+    if (!data.trainAugmentationParams || data.trainAugmentationParams.length === 0) {
+      ret.message = '请配置扩增参数'
+      return ret
+    }
+  }
+  ret.code = 200
+  return ret
+}
+
+const submit = () => {
+  const params = {
+    taskName: formData.taskName,
+    taskType: formData.taskType,
+    taskItemList: formData.tasks,
+    algTaskList: formData.algorithms,
+    trainBatchNumList: formData.data,
+    testBatchNumList: formData.testData,
+    hasTrainAugmentation: formData.expandData,
+    trainAugmentationParams: formData.expandConfig
+  }
+  let result = valid(params)
+  // console.log(result)
+  if (result.code !== 200) {
+    ElMessage.error(result.message)
+    return
+  }
+
+  params.algTaskList.forEach(obj => {
+    obj.algorithmId = obj.id;
+    // if (!obj.trainParams) {
+    //   return
+    // }
+    obj.params = JSON.stringify(JSON.parse(obj.trainParams)) + ";;;" +
+      JSON.stringify(JSON.parse(obj.verifyParams)) + ";;;" +
+      JSON.stringify(JSON.parse(obj.testParams))
+  })
+  // console.log('submit', params)
+
+  createTaskApi(params)
+    .then(res => {
+      // console.log(res)
+      if (res.code !== 200) {
+        ElMessage.error(res.msg)
+      } else {
+        router.push(`/index`)
+      }
+    })
+    .catch(err => {
+      console.log(err)
+    })
+}
+
+const loadExpandDataParams = () => {
+  listDataApi({
+    dictType: 'expand_data_params',
+    pageNum: 1,
+    pageSize: 10000
+  })
+    .then(res => {
+      // console.log(res)
+      expandDataConfig.value = reactive([])
+      res.data.list.forEach(obj => {
+        expandDataConfig.value.push({
+          name: obj.dictLabel,
+          defaultValue: obj.dictValue
+        })
+      })
+      expandDataDialogVisible.value = true
+    })
+    .catch(err => {
+      console.log(err)
+    })
+}
+
+const showExpandDataSuperParameterConfig = () => {
+  loadExpandDataParams()
+}
+// 数据扩增超参修改保存
+const submitExpandDataConfigDialog = () => {
+  // console.log(expandDataConfig)
+  formData.expandConfig = JSON.stringify(expandDataConfig.value)
+  expandDataDialogVisible.value = false
+}
+
+const expandDataDialogVisible = ref(false)
+
+let expandDataConfig = ref(reactive([
+  // {
+  //   name: 'config1',
+  //   defaultValue: 'a'
+  // }
+]))
+
+const submitConfigDialog = () => {
+  dialogVisible.value = false
+  formData.algorithms[superParameterFormData.index].trainParams = JSON.stringify(superParameterFormData.trainParams)
+  formData.algorithms[superParameterFormData.index].verifyParams = JSON.stringify(superParameterFormData.verifyParams)
+  formData.algorithms[superParameterFormData.index].testParams = JSON.stringify(superParameterFormData.testParams)
+}
+// 选择批次的数据结果
+const submitDataDialog = () => {
+  // console.log(selectedBatchDataList.value)
+  let val = ''
+  for (let i = 0; i < selectedBatchDataList.value.length; i++) {
+    val += selectedBatchDataList.value[i].batchNum + ','
+  }
+  if (bIsTrainData.value) {
+    formData.data[selectDataIndex] = val.substring(0, val.length - 1)
+  } else {
+    formData.testData[selectDataIndex] = val.substring(0, val.length - 1)
+  }
+  dataDialogVisible.value = false
+}
+const canSelect = computed(() => {
+  // console.log(tempSelectedBatchDataList)
+  return tempSelectedBatchDataList.value.length > 0
+})
+const canDeselect = computed(() => {
+  return tempDeselectedBatchDataList.value.length > 0
+})
+
+onMounted(() => {
+  listTaskConfigurationApi({ pageNum: 1, pageSize: 10000 })
+    .then(res => {
+      // console.log(res)
+      algorithms = reactive(res.data.list)
+    })
+  batchListDataApi()
+    .then(res => {
+      // console.log(res)
+      queryBatchData.value = reactive(res.data)
+    })
+})
+let queryBatchData = ref(reactive([]))
+const handleSelectionChange = data => {
+  tempSelectedBatchDataList.value = reactive(data)
+  // console.log(data)
+}
+const handleDeselectionChange = data => {
+  tempDeselectedBatchDataList.value = reactive(data)
+  // console.log(data)
+}
+const clickSelectData = () => {
+  let set = new Set
+  for (let i = 0; i < tempSelectedBatchDataList.value.length; i++) {
+    set.add(tempSelectedBatchDataList.value[i].batchNum)
+    selectedBatchDataList.value.push(tempSelectedBatchDataList.value[i])
+  }
+  let newArray = []
+  for (let i = 0; i < batchDataList.value.length; i++) {
+    if (!set.has(batchDataList.value[i].batchNum)) {
+      newArray.push(batchDataList.value[i])
+    }
+  }
+  batchDataList.value = reactive(newArray)
+  // console.log(batchDataList)
+}
+const clickDeselectData = () => {
+  let set = new Set
+  for (let i = 0; i < tempDeselectedBatchDataList.value.length; i++) {
+    set.add(tempDeselectedBatchDataList.value[i].batchNum)
+    batchDataList.value.push(tempDeselectedBatchDataList.value[i])
+  }
+  let newArray = []
+  for (let i = 0; i < selectedBatchDataList.value.length; i++) {
+    if (!set.has(selectedBatchDataList.value[i].batchNum)) {
+      newArray.push(selectedBatchDataList.value[i])
+    }
+  }
+  selectedBatchDataList.value = reactive(newArray)
+}
+const router = useRouter()
+let bIsTrainData = ref(false)
+let dialogVisible = ref(false)
+let batchDataList = ref(reactive([]))
+let selectedBatchDataList = ref(reactive([]))
+let tempSelectedBatchDataList = ref(reactive([]))
+let tempDeselectedBatchDataList = ref(reactive([]))
+
+const formData = reactive({
+  taskName: null,
+  taskType: '1',
+  tasks: [],
+  algorithms: [
+    {}
+  ],
+  algoIdx: [
+    null
+  ],
+  // 训练数据
+  data: [
+    null
+  ],
+  // 测试数据
+  testData: [
+    null
+  ],
+  expandData: false,
+  expandConfig: ''
+})
+let selectDataIndex = null
+const dataDialogVisible = ref(false)
+const showDataSelectionDialog = (index, isTrainData) => {
+  bIsTrainData.value = isTrainData
+  batchDataList.value = queryBatchData.value
+  selectedBatchDataList.value = reactive([])
+  tempSelectedBatchDataList.value = reactive([])
+  tempDeselectedBatchDataList.value = reactive([])
+  selectDataIndex = index
+  dataDialogVisible.value = true
+}
+
+let superParameterFormData = reactive({})
+
+const showSuperParameterConfig = (item, index) => {
+  superParameterFormData = reactive({
+    index: index,
+    trainParams: JSON.parse(item.trainParams),
+    testParams: JSON.parse(item.testParams),
+    verifyParams: JSON.parse(item.verifyParams),
+    title: '超参配置'
+  })
+  // console.log(superParameterFormData)
+  dialogVisible.value = true
+}
+
+let algorithms = reactive([])
+
+const onModelSelect = (index) => {
+  formData.algorithms[index] = algorithms[formData.algoIdx[index]]
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+
+const showAddModelDialog = () => {
+  getAlgorithmOptionApi().then(res => {
+    let allAgloData = {
+      value: res.data
+    }
+    const params = {
+      title: '算法模型配置',
+      width: 580,
+      isEdit: true,
+      itemsOptions: [
+        {
+          label: '算法',
+          prop: 'algorithmId',
+          rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
+          compOptions: {
+            elTagName: 'select',
+            labelKey: 'name',
+            valueKey: 'id',
+            enum: allAgloData.value,
+            placeholder: '请选择算法'
+          }
+        },
+        {
+          label: '模型名称',
+          prop: 'modelName',
+          rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
+          compOptions: {
+            placeholder: '请输入模型名称'
+          }
+        },
+        {
+          label: '模型',
+          prop: 'modelAddress',
+          rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
+          compOptions: {
+            elTagName: 'slot'
+          }
+        },
+        {
+          label: '训练样本数',
+          prop: 'sampleNumber',
+          compOptions: {
+            placeholder: '请输入训练样本数'
+          }
+        },
+        {
+          label: '训练循环次数',
+          prop: 'cycleEpoch',
+          compOptions: {
+            placeholder: '请输入训练循环次数'
+          }
+        },
+        {
+          label: '备注',
+          prop: 'remarks',
+          compOptions: {
+            placeholder: '请输入备注'
+          }
+        }
+      ],
+      model: {},
+      api: addModelApi
+    }
+
+    formDialogRef.value?.openDialog(params)
+  })
+}
+
+const appendNewItem = () => {
+  formData.algorithms.push({})
+  formData.algoIdx.push(null)
+}
+const appendNewDataItem = isTrainData => {
+  if (isTrainData) {
+    formData.data.push([])
+  } else {
+    formData.testData.push([])
+  }
+}
+const removeItem = idx => {
+  formData.algorithms.splice(idx, 1)
+  formData.algoIdx.splice(idx, 1)
+}
+const removeDataItem = (idx, isTrainData) => {
+  if (isTrainData) {
+    formData.data.splice(idx, 1)
+  } else {
+    formData.testData.splice(idx, 1)
+  }
+}
+const cancel = () => {
+  // console.log('cancel')
+  router.push(`/index`)
+}
+
+</script>
+
+<style scoped>
+.createTask-bigBox {
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  background-image: url('../../../assets/taaisImg/53bg.png');
+  background-repeat: no-repeat;
+  background-size: 100% 100%;
+}
+.span_class {
+  width: 120px;
+  font-size: 13px;
+  display: flex;
+  align-self: center;
+  justify-content: center
+}
+</style>

+ 119 - 14
src/views/task/bizProcess/index.vue

@@ -3,12 +3,12 @@
     <ProTable ref="proTable" :columns="columns" row-key="id" :data="bizProcessList">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <!-- <el-button type="primary" v-auth="['task:bizProcess:add']" icon="CirclePlus" @click="openDialog(1, '算法业务处理新增')"> 新增 </el-button>
-        <el-button type="primary" v-auth="['task:bizProcess:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button> -->
-        <el-button type="primary" v-auth="['task:bizProcess:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <!-- <el-button type="primary" v-auth="['identification:identificationSubtaskDetails:add']" icon="CirclePlus" @click="openDialog(1, '算法业务处理新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['identification:identificationSubtaskDetails:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button> -->
+        <el-button type="primary" v-auth="['identification:identificationSubtaskDetails:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
-          v-auth="['task:bizProcess:remove']"
+          v-auth="['identification:identificationSubtaskDetails:remove']"
           icon="Delete"
           plain
           :disabled="!scope.isSelected"
@@ -16,18 +16,27 @@
         >
           批量删除
         </el-button>
-        <el-button type="primary" v-auth="['task:bizProcess:add']" icon="View" @click="contrastResults()"> 对比结果 </el-button>
+        <el-button type="primary" icon="View" @click="showCompareResult"> 对比结果 </el-button>
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link icon="View" v-auth="['task:bizProcess:query']" @click="openDialog(3, '算法业务处理查看', scope.row)">
-          查看
+        <el-button type="primary" link icon="View" v-auth="['identification:identificationSubtaskDetails:query']" @click="openDialog(3, '算法业务处理查看', scope.row)">
+          查看详情
         </el-button>
-        <el-button type="primary" link icon="EditPen" v-auth="['task:bizProcess:edit']" @click="openDialog(2, '算法业务处理编辑', scope.row)">
-          编辑
+
+        <el-button type="primary" link icon="finished" @click="showResult(scope.row)">
+          执行结果
+        </el-button>
+
+        <el-button type="primary" link icon="Refresh" @click="reRunTask(scope.row)">
+          重新执行
         </el-button>
-        <el-button type="primary" link icon="Delete" v-auth="['task:bizProcess:remove']" @click="deleteBizProcess(scope.row)"> 删除 </el-button>
-        <el-button type="primary" link icon="View" v-auth="['task:bizProcess:query']" @click="viewLog(scope.row)"> 查看日志 </el-button>
+
+<!--        <el-button type="primary" link icon="EditPen" v-auth="['identification:identificationSubtaskDetails:edit']" @click="openDialog(2, '算法业务处理编辑', scope.row)">-->
+<!--          编辑-->
+<!--        </el-button>-->
+<!--        <el-button type="primary" link icon="Delete" v-auth="['identification:identificationSubtaskDetails:remove']" @click="deleteBizProcess(scope.row)"> 删除 </el-button>-->
+        <el-button type="primary" link icon="document" v-auth="['identification:identificationSubtaskDetails:query']" @click="viewLog(scope.row)"> 查看日志 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -98,6 +107,83 @@
         </el-row>
       </div>
     </el-dialog>
+
+    <el-dialog
+      v-model="resultDialogVisible"
+      title="执行结果"
+    >
+<!--      style="width: 70vw"-->
+      <el-card :body-style="{ padding: '0px' }">
+        <div style="padding: 14px;">
+          <span>P_curve</span>
+        </div>
+        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/P_curve.png'"></el-image>
+      </el-card>
+
+      <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+        <div style="padding: 14px;">
+          <span>R_curve</span>
+        </div>
+        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/R_curve.png'"></el-image>
+      </el-card>
+
+      <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+        <div style="padding: 14px;">
+          <span>PR_curve</span>
+        </div>
+        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/PR_curve.png'"></el-image>
+      </el-card>
+
+      <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+        <div style="padding: 14px;">
+          <span>F1_curve</span>
+        </div>
+        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/F1_curve.png'"></el-image>
+      </el-card>
+
+    </el-dialog>
+
+    <el-dialog
+      v-model="compareDialogVisible"
+      title="执行结果对比"
+    >
+      <!--      style="width: 70vw"-->
+      <el-container style="display: flex; flex-direction: row">
+        <el-container v-for="(item, index) in listData" :key="index" style="display: flex; flex-direction: column">
+<!--          <el-button @click="console.log(item)">test</el-button>-->
+          <span style="font-size: 18px"> {{ item.name }} </span>
+          <el-card :body-style="{ padding: '0px' }" style="margin-top: 3px">
+            <div style="padding: 14px;">
+              <span>P_curve</span>
+            </div>
+            <el-image :src="PATH_PREFIX + item.resultPath + '/P_curve.png'"></el-image>
+          </el-card>
+
+          <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+            <div style="padding: 14px;">
+              <span>R_curve</span>
+            </div>
+            <el-image :src="PATH_PREFIX + item.resultPath + '/R_curve.png'"></el-image>
+          </el-card>
+
+          <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+            <div style="padding: 14px;">
+              <span>PR_curve</span>
+            </div>
+            <el-image :src="PATH_PREFIX + item.resultPath + '/PR_curve.png'"></el-image>
+          </el-card>
+
+          <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+            <div style="padding: 14px;">
+              <span>F1_curve</span>
+            </div>
+            <el-image :src="PATH_PREFIX + item.resultPath + '/F1_curve.png'"></el-image>
+          </el-card>
+        </el-container>
+      </el-container>
+
+
+    </el-dialog>
   </div>
 </template>
 
@@ -120,13 +206,31 @@ import {
   getTrainResultApi,
   getVerifyResultApi,
   getTestResultApi
-} from '@/api/modules/task/bizProcess'
+} from '@/api/modules/task/bizProcessNew'
 // getTrainResultApi,getVerifyResultApi,getTestResultApi
 import { getSubtaskApi } from '@/api/modules/task/subtask'
 import { getDictsApi } from '@/api/modules/system/dictData'
 import { useRoute } from 'vue-router'
 import ImagePreview from '@/components/ImagePreview/index.vue'
+import http from "@/api";
 const route = useRoute()
+const PATH_PREFIX = 'api/profile/task'
+let resultDialogVisible = ref(false)
+let refSelectData = ref(reactive({}))
+const reRunTask = row => {
+  http.post<any>('/identification/identificationSubtaskDetails/execute', {taskId: row.id}, { loading: false })
+}
+let compareDialogVisible = ref(false)
+let listData = ref(reactive([]))
+const showCompareResult = () => {
+  console.log(listData.value)
+  compareDialogVisible.value = true
+}
+const showResult = row => {
+  refSelectData.value = reactive(row)
+  resultDialogVisible.value = true
+  console.log(row)
+}
 const subTaskId = route.query.id as string
 // ProTable 实例
 const proTable = ref<ProTableInstance>()
@@ -150,9 +254,10 @@ const refreshList = () => {
     listBizProcessApi({
       pageNum: 1,
       pageSize: 100,
-      subTaskId
+      subtaskId: subTaskId
     }).then(res => {
       bizProcessList.value = res.data['list'].sort((a, b) => b.index - a.index)
+      listData.value = reactive(res.data['list'].sort((a, b) => b.index - a.index))
     })
   }, 0)
 }
@@ -257,7 +362,7 @@ const viewLog = row => {
   //   ElMessage.warning('算法状态为待处理,暂无日志')
   //   return
   // }
-  const url = `/api/profile${row.log}`
+  const url = `/api/profile/task` + row.resultPath + '/log/log.log'
   logShow(url)
   dialogVisible.value = true
   timer2.value = setInterval(() => {

+ 8 - 8
src/views/task/subtask/index.vue

@@ -3,12 +3,12 @@
     <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:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <!-- <el-button type="primary" v-auth="['identification:identificationTask:add']" icon="CirclePlus" @click="openDialog(1, '算法子任务新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['identification:identificationTask:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button> -->
+        <el-button type="primary" v-auth="['identification:identificationTask:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
-          v-auth="['task:subtask:remove']"
+          v-auth="['identification:identificationTask:remove']"
           icon="Delete"
           plain
           :disabled="!scope.isSelected"
@@ -19,11 +19,11 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link icon="View" v-auth="['task:subtask:query']" @click="viewDetails(scope.row)"> 查看详情 </el-button>
-        <el-button type="primary" link icon="EditPen" v-auth="['task:subtask:edit']" @click="openDialog(2, '算法子任务编辑', scope.row)">
+        <el-button type="primary" link icon="View" v-auth="['identification:identificationTask:query']" @click="viewDetails(scope.row)"> 查看详情 </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['identification:identificationTask:edit']" @click="openDialog(2, '算法子任务编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link icon="Delete" v-auth="['task:subtask:remove']" @click="deleteSubtask(scope.row)"> 删除 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['identification:identificationTask:remove']" @click="deleteSubtask(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -41,7 +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, exportSubtaskApi, getSubtaskApi } from '@/api/modules/task/subtask'
+import { listSubtaskApi, delSubtaskApi, addSubtaskApi, updateSubtaskApi, exportSubtaskApi, getSubtaskApi } from '@/api/modules/task/subtaskNew'
 import { getDictsApi } from '@/api/modules/system/dictData'
 const router = useRouter()
 const route = useRoute()

+ 8 - 8
src/views/task/subtaskDetail/index.vue

@@ -3,14 +3,14 @@
     <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listSubtaskDetailApi">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['task:subtaskDetail:add']" icon="CirclePlus" @click="openDialog(1, '算法子任务详情新增')">
+        <el-button type="primary" v-auth="['identification:identificationSubtaskDetails:add']" icon="CirclePlus" @click="openDialog(1, '算法子任务详情新增')">
           新增
         </el-button>
-        <el-button type="primary" v-auth="['task:subtaskDetail:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
-        <el-button type="primary" v-auth="['task:subtaskDetail:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button type="primary" v-auth="['identification:identificationSubtaskDetails:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['identification:identificationSubtaskDetails:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
-          v-auth="['task:subtaskDetail:remove']"
+          v-auth="['identification:identificationSubtaskDetails:remove']"
           icon="Delete"
           plain
           :disabled="!scope.isSelected"
@@ -21,13 +21,13 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link icon="View" v-auth="['task:subtaskDetail:query']" @click="openDialog(3, '算法子任务详情查看', scope.row)">
+        <el-button type="primary" link icon="View" v-auth="['identification:identificationSubtaskDetails:query']" @click="openDialog(3, '算法子任务详情查看', scope.row)">
           查看
         </el-button>
-        <el-button type="primary" link icon="EditPen" v-auth="['task:subtaskDetail:edit']" @click="openDialog(2, '算法子任务详情编辑', scope.row)">
+        <el-button type="primary" link icon="EditPen" v-auth="['identification:identificationSubtaskDetails:edit']" @click="openDialog(2, '算法子任务详情编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link icon="Delete" v-auth="['task:subtaskDetail:remove']" @click="deleteSubtaskDetail(scope.row)"> 删除 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['identification:identificationSubtaskDetails:remove']" @click="deleteSubtaskDetail(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -53,7 +53,7 @@ import {
   importSubtaskDetailDataApi,
   exportSubtaskDetailApi,
   getSubtaskDetailApi
-} from '@/api/modules/task/subtaskDetail'
+} from '@/api/modules/task/subtaskDetailNew'
 import { getDictsApi } from '@/api/modules/system/dictData'
 
 // ProTable 实例

+ 275 - 0
src/views/task/taskConfiguration/index.vue

@@ -0,0 +1,275 @@
+<template>
+    <div class="table-box">
+        <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listTaskConfigurationApi" >
+            <!-- 表格 header 按钮 -->
+            <template #tableHeader="scope">
+                <el-button type="primary" v-auth="['task:taskConfiguration:add']" icon="CirclePlus" @click="openDialog(1, '算法任务新增')">
+                    新增
+                </el-button>
+                <el-button type="primary" v-auth="['task:taskConfiguration:import']" icon="Upload" plain @click="batchAdd">
+                    导入
+                </el-button>
+                <el-button type="primary" v-auth="['task:taskConfiguration:export']" icon="Download" plain @click="downloadFile">
+                    导出
+                </el-button>
+                <el-button
+                    type="danger"
+                    v-auth="['task:taskConfiguration:remove']"
+                    icon="Delete"
+                    plain
+                    :disabled="!scope.isSelected"
+                    @click="batchDelete(scope.selectedListIds)"
+                >
+                    批量删除
+                </el-button>
+            </template>
+            <!-- 表格操作 -->
+            <template #operation="scope">
+                <el-button
+                    type="primary"
+                    link
+                    icon="View"
+                    v-auth="['task:taskConfiguration:query']"
+                    @click="openDialog(3, '算法任务查看', scope.row)"
+                >
+                    查看
+                </el-button>
+                <el-button
+                    type="primary"
+                    link
+                    icon="EditPen"
+                    v-auth="['task:taskConfiguration:edit']"
+                    @click="openDialog(2, '算法任务编辑', scope.row)"
+                >
+                    编辑
+                </el-button>
+                <el-button type="primary" link icon="Delete" v-auth="['task:taskConfiguration:remove']" @click="deleteTaskConfiguration(scope.row)">
+                    删除
+                </el-button>
+            </template>
+        </ProTable>
+        <FormDialog ref="formDialogRef" />
+        <ImportExcel ref="dialogRef" />
+    </div>
+</template>
+
+<script setup lang="tsx" name="TaskConfiguration">
+    import { ref, reactive } from 'vue'
+    import { useHandleData } from '@/hooks/useHandleData'
+    import { useDownload } from '@/hooks/useDownload'
+    import { ElMessageBox } from 'element-plus'
+    import ProTable from '@/components/ProTable/index.vue'
+    import ImportExcel from '@/components/ImportExcel/index.vue'
+    import FormDialog from '@/components/FormDialog/index.vue'
+    import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
+    import {
+        listTaskConfigurationApi,
+        delTaskConfigurationApi,
+        addTaskConfigurationApi,
+        updateTaskConfigurationApi,
+        importTemplateApi,
+        importTaskConfigurationDataApi,
+        exportTaskConfigurationApi,
+        getTaskConfigurationApi
+    } from '@/api/modules/task/taskConfiguration'
+
+    // ProTable 实例
+    const proTable = ref<ProTableInstance>()
+
+    // 删除算法任务信息
+    const deleteTaskConfiguration = async (params: any) => {
+        await useHandleData(delTaskConfigurationApi, params.id, '删除【' + params.id + '】算法任务')
+        proTable.value?.getTableList()
+    }
+
+    // 批量删除算法任务信息
+    const batchDelete = async (ids: string[]) => {
+        await useHandleData(delTaskConfigurationApi, ids, '删除所选算法任务信息')
+        proTable.value?.clearSelection()
+        proTable.value?.getTableList()
+    }
+
+    // 导出算法任务列表
+    const downloadFile = async () => {
+        ElMessageBox.confirm('确认导出算法任务数据?', '温馨提示', { type: 'warning' }).then(() =>
+            useDownload(exportTaskConfigurationApi, '算法任务列表', proTable.value?.searchParam)
+        )
+    }
+
+    // 批量添加算法任务
+    const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+    const batchAdd = () => {
+        const params = {
+            title: '算法任务',
+            tempApi: importTemplateApi,
+            importApi: importTaskConfigurationDataApi,
+            getTableList: proTable.value?.getTableList
+        }
+        dialogRef.value?.acceptParams(params)
+    }
+
+    const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+    // 打开弹框的功能
+    const openDialog = async (type: number, title: string, row?: any) => {
+        let res = { data: {} }
+        if (row?.id) {
+            res = await getTaskConfigurationApi(row?.id || null)
+        }
+        // 重置表单
+        setItemsOptions()
+        const params = {
+            title,
+            width: 580,
+            isEdit: type !== 3,
+            itemsOptions: itemsOptions,
+            model: type == 1 ? {} : res.data,
+            api: type == 1 ? addTaskConfigurationApi : updateTaskConfigurationApi,
+            getTableList: proTable.value?.getTableList
+        }
+        formDialogRef.value?.openDialog(params)
+    }
+
+    // 表格配置项
+    const columns = reactive<ColumnProps<any>[]>([
+        { type: 'selection', fixed: 'left', width: 70 },
+                { prop: 'id', label: '主键ID' },
+                {
+                    prop: 'name',
+                    label: '算法任务名称',
+                        search: {
+                            el: 'input'
+                        },
+                    width: 120
+                },
+                {
+                    prop: 'trainUrl',
+                    label: '训练算法地址',
+                        search: {
+                            el: 'input'
+                        },
+                    width: 120
+                },
+                {
+                    prop: 'trainParams',
+                    label: '训练超参配置',
+                        search: {
+                            el: 'input'
+                        },
+                    width: 120
+                },
+                {
+                    prop: 'verifyUrl',
+                    label: '验证算法地址',
+                        search: {
+                            el: 'input'
+                        },
+                    width: 120
+                },
+                {
+                    prop: 'verifyParams',
+                    label: '验证超参配置',
+                        search: {
+                            el: 'input'
+                        },
+                    width: 120
+                },
+                {
+                    prop: 'testUrl',
+                    label: '测试算法地址',
+                        search: {
+                            el: 'input'
+                        },
+                    width: 120
+                },
+                {
+                    prop: 'testParams',
+                    label: '测试超参配置',
+                        search: {
+                            el: 'input'
+                        },
+                    width: 120
+                },
+                {
+                    prop: 'remark',
+                    label: '备注',
+                    width: 120
+                },
+        { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+    ])
+    // 表单配置项
+    let itemsOptions: ProForm.ItemsOptions[] = []
+    const setItemsOptions = () => {
+        itemsOptions = [
+                            {
+                                label: '算法任务名称',
+                                prop: 'name',
+                                    rules: [{required: true, message: '算法任务名称不能为空', trigger: 'blur'}],
+                                compOptions: {
+                                    placeholder: '请输入算法任务名称'
+                                }
+                            },
+                            {
+                                label: '训练算法地址',
+                                prop: 'trainUrl',
+                                    rules: [{required: true, message: '训练算法地址不能为空', trigger: 'blur'}],
+                                compOptions: {
+                                    placeholder: '请输入训练算法地址'
+                                }
+                            },
+                            {
+                                label: '训练超参配置',
+                                prop: 'trainParams',
+                                    rules: [{required: true, message: '训练超参配置不能为空', trigger: 'blur'}],
+                                compOptions: {
+                                    type: 'textarea',
+                                    clearable: true,
+                                    placeholder: '请输入内容'
+                                }
+                            },
+                            {
+                                label: '验证算法地址',
+                                prop: 'verifyUrl',
+                                    rules: [{required: true, message: '验证算法地址不能为空', trigger: 'blur'}],
+                                compOptions: {
+                                    placeholder: '请输入验证算法地址'
+                                }
+                            },
+                            {
+                                label: '验证超参配置',
+                                prop: 'verifyParams',
+                                    rules: [{required: true, message: '验证超参配置不能为空', trigger: 'blur'}],
+                                compOptions: {
+                                    type: 'textarea',
+                                    clearable: true,
+                                    placeholder: '请输入内容'
+                                }
+                            },
+                            {
+                                label: '测试算法地址',
+                                prop: 'testUrl',
+                                    rules: [{required: true, message: '测试算法地址不能为空', trigger: 'blur'}],
+                                compOptions: {
+                                    placeholder: '请输入测试算法地址'
+                                }
+                            },
+                            {
+                                label: '测试超参配置',
+                                prop: 'testParams',
+                                    rules: [{required: true, message: '测试超参配置不能为空', trigger: 'blur'}],
+                                compOptions: {
+                                    type: 'textarea',
+                                    clearable: true,
+                                    placeholder: '请输入内容'
+                                }
+                            },
+                            {
+                                label: '备注',
+                                prop: 'remark',
+                                    rules: [{required: true, message: '备注不能为空', trigger: 'blur'}],
+                                compOptions: {
+                                    placeholder: '请输入备注'
+                                }
+                            },
+        ]
+    }
+</script>