فهرست منبع

feat: add model task subTask subtaskDetail

allen 1 سال پیش
والد
کامیت
e5a443c2f6

+ 86 - 0
src/api/interface/ag/config.ts

@@ -0,0 +1,86 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface ConfigVO extends BaseEntity {
+  /**
+   * 类型
+   */
+  type: string
+
+  /**
+   * 分系统
+   */
+  subsystem: string
+
+  /**
+   * 算法名称
+   */
+  algorithmName: string
+
+  /**
+   * 算法地址
+   */
+  algorithmAddress: string
+}
+
+export interface ConfigForm {
+  /**
+   * 类型
+   */
+  type?: string
+
+  /**
+   * 父id
+   */
+  parentId?: string | number
+
+  /**
+   * 分系统
+   */
+  subsystem?: string
+
+  /**
+   * 算法名称
+   */
+  algorithmName?: string
+
+  /**
+   * 算法地址
+   */
+  algorithmAddress?: string
+
+  /**
+   * 参数配置
+   */
+  parameterConfig?: string
+
+  /**
+   * 备注
+   */
+  remarks?: string
+}
+
+export interface ConfigQuery extends PageQuery {
+  /**
+   * 类型
+   */
+  type?: string
+
+  /**
+   * 分系统
+   */
+  subsystem?: string
+
+  /**
+   * 算法名称
+   */
+  algorithmName?: string
+
+  /**
+   * 算法地址
+   */
+  algorithmAddress?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 101 - 0
src/api/interface/ag/model.ts

@@ -0,0 +1,101 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface ModelVO extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id: string | number
+
+  /**
+   * 算法
+   */
+  algorithmId: string | number
+
+  /**
+   * 模型名称
+   */
+  modelName: string
+
+  /**
+   * 训练样本数
+   */
+  sampleNumber: number
+
+  /**
+   * 训练循环次数
+   */
+  cycleEpoch: number
+
+  /**
+   * 备注
+   */
+  remarks: string
+}
+
+export interface ModelForm {
+  /**
+   * 主键ID
+   */
+  id?: string | number
+
+  /**
+   * 算法
+   */
+  algorithmId?: string | number
+
+  /**
+   * 模型名称
+   */
+  modelName?: string
+
+  /**
+   * 模型
+   */
+  modelAddress?: string
+
+  /**
+   * 训练样本数
+   */
+  sampleNumber?: number
+
+  /**
+   * 训练循环次数
+   */
+  cycleEpoch?: number
+
+  /**
+   * 备注
+   */
+  remarks?: string
+}
+
+export interface ModelQuery extends PageQuery {
+  /**
+   * 算法
+   */
+  algorithmId?: string | number
+
+  /**
+   * 模型名称
+   */
+  modelName?: string
+
+  /**
+   * 训练样本数
+   */
+  sampleNumber?: number
+
+  /**
+   * 训练循环次数
+   */
+  cycleEpoch?: number
+
+  /**
+   * 备注
+   */
+  remarks?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 101 - 0
src/api/interface/task/subtask.ts

@@ -0,0 +1,101 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface SubtaskVO extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id: string | number
+
+  /**
+   * 任务名称
+   */
+  name: string
+
+  /**
+   * 任务状态
+   */
+  status: string
+
+  /**
+   * 调用算法时所用的参数
+   */
+  parameters: string
+
+  /**
+   * 开始时间
+   */
+  startTime: string
+
+  /**
+   * 结束时间
+   */
+  endTime: string
+
+  /**
+   * 耗时
+   */
+  costSecond: number
+}
+
+export interface SubtaskForm {
+  /**
+   * 主键ID
+   */
+  id?: string | number
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务状态
+   */
+  status?: string
+
+  /**
+   * 调用算法时所用的参数
+   */
+  parameters?: string
+
+  /**
+   * 开始时间
+   */
+  startTime?: string
+
+  /**
+   * 结束时间
+   */
+  endTime?: string
+
+  /**
+   * 耗时
+   */
+  costSecond?: number
+
+  /**
+   * 日志
+   */
+  log?: string
+
+  /**
+   * 是否包含详情
+   */
+  hasDetails?: number
+}
+
+export interface SubtaskQuery extends PageQuery {
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务状态
+   */
+  status?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 96 - 0
src/api/interface/task/subtaskDetail.ts

@@ -0,0 +1,96 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface SubtaskDetailVO extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id: string | number
+
+  /**
+   * 任务名称
+   */
+  name: string
+
+  /**
+   * 任务状态
+   */
+  status: string
+
+  /**
+   * 调用算法时所用的参数
+   */
+  parameters: string
+
+  /**
+   * 开始时间
+   */
+  startTime: string
+
+  /**
+   * 结束时间
+   */
+  endTime: string
+
+  /**
+   * 耗时
+   */
+  costSecond: number
+}
+
+export interface SubtaskDetailForm {
+  /**
+   * 主键ID
+   */
+  id?: string | number
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务状态
+   */
+  status?: string
+
+  /**
+   * 调用算法时所用的参数
+   */
+  parameters?: string
+
+  /**
+   * 开始时间
+   */
+  startTime?: string
+
+  /**
+   * 结束时间
+   */
+  endTime?: string
+
+  /**
+   * 耗时
+   */
+  costSecond?: number
+
+  /**
+   * 日志
+   */
+  log?: string
+}
+
+export interface SubtaskDetailQuery extends PageQuery {
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务状态
+   */
+  status?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 101 - 0
src/api/interface/task/task.ts

@@ -0,0 +1,101 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface TaskVO extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id: string | number
+
+  /**
+   * 任务名称
+   */
+  name: string
+
+  /**
+   * 任务状态
+   */
+  status: string
+
+  /**
+   * 开始时间
+   */
+  startTime: string
+
+  /**
+   * 结束时间
+   */
+  endTime: string
+
+  /**
+   * 耗时
+   */
+  costSecond: number
+}
+
+export interface TaskForm {
+  /**
+   * 主键ID
+   */
+  id?: string | number
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务状态
+   */
+  status?: string
+
+  /**
+   * 开始时间
+   */
+  startTime?: string
+
+  /**
+   * 结束时间
+   */
+  endTime?: string
+
+  /**
+   * 耗时
+   */
+  costSecond?: number
+
+  /**
+   * 日志
+   */
+  log?: string
+}
+
+export interface TaskQuery extends PageQuery {
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务状态
+   */
+  status?: string
+
+  /**
+   * 开始时间
+   */
+  startTime?: string
+
+  /**
+   * 结束时间
+   */
+  endTime?: string
+
+  /**
+   * 耗时
+   */
+  costSecond?: number
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 70 - 0
src/api/modules/ag/config.ts

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { ConfigVO, ConfigForm, ConfigQuery } from '@/api/interface/ag/config'
+/**
+ * @name 查询算法配置列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listConfigApi = (query: ConfigQuery) => {
+  return http.get<ConfigVO[]>('/ag/config/list', query, { loading: true })
+}
+
+/**
+ * @name 查询算法配置详细
+ * @param id id
+ * @returns returns
+ */
+export const getConfigApi = (id: string | number) => {
+  return http.get<ConfigVO>(`/ag/config/${id}`)
+}
+
+/**
+ * @name 新增算法配置
+ * @param data data
+ * @returns returns
+ */
+export const addConfigApi = (data: ConfigForm) => {
+  return http.post<any>('/ag/config', data, { loading: false })
+}
+
+/**
+ * @name 修改算法配置
+ * @param data data
+ * @returns returns
+ */
+export const updateConfigApi = (data: ConfigForm) => {
+  return http.put<any>('/ag/config', data, { loading: false })
+}
+
+/**
+ * @name 删除算法配置
+ * @param id id
+ * @returns returns
+ */
+export const delConfigApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/ag/config/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/ag/config/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importConfigDataApi = (data: any) => {
+  return http.post('/ag/config/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportConfigApi = (data: any) => {
+  return http.downloadPost('/ag/config/export', data)
+}

+ 70 - 0
src/api/modules/ag/model.ts

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { ModelVO, ModelForm, ModelQuery } from '@/api/interface/ag/model'
+/**
+ * @name 查询算法模型配置列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listModelApi = (query: ModelQuery) => {
+  return http.get<ModelVO[]>('/ag/model/list', query, { loading: true })
+}
+
+/**
+ * @name 查询算法模型配置详细
+ * @param id id
+ * @returns returns
+ */
+export const getModelApi = (id: string | number) => {
+  return http.get<ModelVO>(`/ag/model/${id}`)
+}
+
+/**
+ * @name 新增算法模型配置
+ * @param data data
+ * @returns returns
+ */
+export const addModelApi = (data: ModelForm) => {
+  return http.post<any>('/ag/model', data, { loading: false })
+}
+
+/**
+ * @name 修改算法模型配置
+ * @param data data
+ * @returns returns
+ */
+export const updateModelApi = (data: ModelForm) => {
+  return http.put<any>('/ag/model', data, { loading: false })
+}
+
+/**
+ * @name 删除算法模型配置
+ * @param id id
+ * @returns returns
+ */
+export const delModelApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/ag/model/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/ag/model/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importModelDataApi = (data: any) => {
+  return http.post('/ag/model/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportModelApi = (data: any) => {
+  return http.downloadPost('/ag/model/export', data)
+}

+ 0 - 70
src/api/modules/biz/agMange.ts

@@ -1,70 +0,0 @@
-import http from '@/api'
-
-/**
- * @name 查询算法配置列表
- * @param query 参数
- * @returns 返回列表
- */
-export const listAgMangeApi = (query: any) => {
-  return http.get<any>('/biz/agMange/list', query, { loading: true })
-}
-
-/**
- * @name 查询算法配置详细
- * @param id id
- * @returns returns
- */
-export const getAgMangeApi = (id: any) => {
-  return http.get<any>(`/biz/agMange/${id}`)
-}
-
-/**
- * @name 新增算法配置
- * @param data data
- * @returns returns
- */
-export const addAgMangeApi = (data: any) => {
-  return http.post<any>('/biz/agMange', data, { loading: false })
-}
-
-/**
- * @name 修改算法配置
- * @param data data
- * @returns returns
- */
-export const updateAgMangeApi = (data: any) => {
-  return http.put<any>('/biz/agMange', data, { loading: false })
-}
-
-/**
- * @name 删除算法配置
- * @param id id
- * @returns returns
- */
-export const delAgMangeApi = (id: any) => {
-  return http.delete<any>(`/biz/agMange/${id}`)
-}
-
-/**
- * @name 下载模板
- * @returns returns
- */
-export const importTemplateApi = () => {
-  return http.downloadPost('/biz/agMange/importTemplate', {})
-}
-
-/**
- * @name 导入数据
- * @returns returns
- */
-export const importAgMangeDataApi = (data: any) => {
-  return http.post('/biz/agMange/importData', data)
-}
-
-/**
- * @name 导出数据
- * @returns returns
- */
-export const exportAgMangeApi = (data: any) => {
-  return http.downloadPost('/biz/agMange/export', data)
-}

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

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

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

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

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

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { TaskVO, TaskForm, TaskQuery } from '@/api/interface/task/task'
+/**
+ * @name 查询算法任务列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listTaskApi = (query: TaskQuery) => {
+  return http.get<TaskVO[]>('/task/task/list', query, { loading: true })
+}
+
+/**
+ * @name 查询算法任务详细
+ * @param id id
+ * @returns returns
+ */
+export const getTaskApi = (id: string | number) => {
+  return http.get<TaskVO>(`/task/task/${id}`)
+}
+
+/**
+ * @name 新增算法任务
+ * @param data data
+ * @returns returns
+ */
+export const addTaskApi = (data: TaskForm) => {
+  return http.post<any>('/task/task', data, { loading: false })
+}
+
+/**
+ * @name 修改算法任务
+ * @param data data
+ * @returns returns
+ */
+export const updateTaskApi = (data: TaskForm) => {
+  return http.put<any>('/task/task', data, { loading: false })
+}
+
+/**
+ * @name 删除算法任务
+ * @param id id
+ * @returns returns
+ */
+export const delTaskApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/task/task/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/task/task/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importTaskDataApi = (data: any) => {
+  return http.post('/task/task/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportTaskApi = (data: any) => {
+  return http.downloadPost('/task/task/export', data)
+}

+ 224 - 0
src/views/ag/config/index.vue

@@ -0,0 +1,224 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listConfigApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['ag:config:add']" icon="CirclePlus" @click="openDialog(1, '算法配置新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['ag:config:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['ag:config:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['ag:config: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="['ag:config:query']" @click="openDialog(3, '算法配置查看', scope.row)"> 查看 </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['ag:config:edit']" @click="openDialog(2, '算法配置编辑', scope.row)"> 编辑 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['ag:config:remove']" @click="deleteConfig(scope.row)"> 删除 </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" />
+    <ImportExcel ref="dialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="Config">
+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 {
+  listConfigApi,
+  delConfigApi,
+  addConfigApi,
+  updateConfigApi,
+  importTemplateApi,
+  importConfigDataApi,
+  exportConfigApi,
+  getConfigApi
+} from '@/api/modules/ag/config'
+import { getDictsApi } from '@/api/modules/system/dictData'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+
+// 删除算法配置信息
+const deleteConfig = async (params: any) => {
+  await useHandleData(delConfigApi, params.id, '删除【' + params.id + '】算法配置')
+  proTable.value?.getTableList()
+}
+
+// 批量删除算法配置信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delConfigApi, ids, '删除所选算法配置信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+// 导出算法配置列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出算法配置数据?', '温馨提示', { type: 'warning' }).then(() =>
+    useDownload(exportConfigApi, '算法配置列表', proTable.value?.searchParam)
+  )
+}
+
+// 批量添加算法配置
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '算法配置',
+    tempApi: importTemplateApi,
+    importApi: importConfigDataApi,
+    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 getConfigApi(row?.id || null)
+  }
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    itemsOptions: itemsOptions,
+    model: type == 1 ? {} : res.data,
+    api: type == 1 ? addConfigApi : updateConfigApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  // { prop: 'id', label: '主键ID' },
+  {
+    prop: 'type',
+    label: '类型',
+    tag: true,
+    enum: () => getDictsApi('biz_ag_type'),
+    search: {
+      el: 'tree-select'
+    },
+    fieldNames: { label: 'dictLabel', value: 'dictValue' }
+  },
+  {
+    prop: 'subsystem',
+    label: '分系统',
+    tag: true,
+    enum: () => getDictsApi('biz_sub_config'),
+    search: {
+      el: 'tree-select'
+    },
+    fieldNames: { label: 'dictLabel', value: 'dictValue' }
+  },
+  {
+    prop: 'algorithmName',
+    label: '算法名称',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'algorithmAddress',
+    label: '算法地址',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions: ProForm.ItemsOptions[] = []
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '类型',
+      prop: 'type',
+      rules: [{ required: true, message: '类型不能为空', trigger: 'change' }],
+      options: {
+        labelKey: 'dictLabel',
+        valueKey: 'dictValue'
+      },
+      compOptions: {
+        elTagName: 'radio-group',
+        labelKey: 'dictLabel',
+        valueKey: 'dictValue',
+        enum: () => getDictsApi('biz_ag_type'),
+        placeholder: '请选择类型'
+      }
+    },
+    {
+      label: '父id',
+      prop: 'parentId',
+      compOptions: {
+        placeholder: '请输入父id'
+      }
+    },
+    {
+      label: '分系统',
+      prop: 'subsystem',
+      compOptions: {
+        elTagName: 'select',
+        labelKey: 'dictLabel',
+        valueKey: 'dictValue',
+        enum: () => getDictsApi('biz_sub_config'),
+        placeholder: '请选择分系统'
+      }
+    },
+    {
+      label: '算法名称',
+      prop: 'algorithmName',
+      rules: [{ required: true, message: '算法名称不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入算法名称'
+      }
+    },
+    {
+      label: '算法地址',
+      prop: 'algorithmAddress',
+      rules: [{ required: true, message: '算法地址不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入算法地址'
+      }
+    },
+    {
+      label: '参数配置',
+      prop: 'parameterConfig',
+      compOptions: {
+        type: 'textarea',
+        clearable: true,
+        placeholder: '请输入内容',
+        rows: 8
+      }
+    },
+    {
+      label: '备注',
+      prop: 'remarks',
+      compOptions: {
+        placeholder: '请输入备注'
+      }
+    }
+  ]
+}
+</script>

+ 199 - 0
src/views/ag/model/index.vue

@@ -0,0 +1,199 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listModelApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['ag:model:add']" icon="CirclePlus" @click="openDialog(1, '算法模型配置新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['ag:model:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['ag:model:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['ag:model: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="['ag:model:query']" @click="openDialog(3, '算法模型配置查看', scope.row)">
+          查看
+        </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['ag:model:edit']" @click="openDialog(2, '算法模型配置编辑', scope.row)">
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['ag:model:remove']" @click="deleteModel(scope.row)"> 删除 </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" />
+    <ImportExcel ref="dialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="Model">
+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 {
+  listModelApi,
+  delModelApi,
+  addModelApi,
+  updateModelApi,
+  importTemplateApi,
+  importModelDataApi,
+  exportModelApi,
+  getModelApi
+} from '@/api/modules/ag/model'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+
+// 删除算法模型配置信息
+const deleteModel = async (params: any) => {
+  await useHandleData(delModelApi, params.id, '删除【' + params.id + '】算法模型配置')
+  proTable.value?.getTableList()
+}
+
+// 批量删除算法模型配置信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delModelApi, ids, '删除所选算法模型配置信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+// 导出算法模型配置列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出算法模型配置数据?', '温馨提示', { type: 'warning' }).then(() =>
+    useDownload(exportModelApi, '算法模型配置列表', proTable.value?.searchParam)
+  )
+}
+
+// 批量添加算法模型配置
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '算法模型配置',
+    tempApi: importTemplateApi,
+    importApi: importModelDataApi,
+    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 getModelApi(row?.id || null)
+  }
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    itemsOptions: itemsOptions,
+    model: type == 1 ? {} : res.data,
+    api: type == 1 ? addModelApi : updateModelApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  // { prop: 'id', label: '主键ID' },
+  {
+    prop: 'algorithmId',
+    label: '算法',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'modelName',
+    label: '模型名称',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'sampleNumber',
+    label: '训练样本数',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'cycleEpoch',
+    label: '训练循环次数',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions: ProForm.ItemsOptions[] = []
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '算法',
+      prop: 'algorithmId',
+      rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入算法'
+      }
+    },
+    {
+      label: '模型名称',
+      prop: 'modelName',
+      rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入模型名称'
+      }
+    },
+    {
+      label: '模型',
+      prop: 'modelAddress',
+      rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入模型'
+      }
+    },
+    {
+      label: '训练样本数',
+      prop: 'sampleNumber',
+      compOptions: {
+        placeholder: '请输入训练样本数'
+      }
+    },
+    {
+      label: '训练循环次数',
+      prop: 'cycleEpoch',
+      compOptions: {
+        placeholder: '请输入训练循环次数'
+      }
+    },
+    {
+      label: '备注',
+      prop: 'remarks',
+      compOptions: {
+        placeholder: '请输入备注'
+      }
+    }
+  ]
+}
+</script>

+ 0 - 277
src/views/biz/agMange/index.vue

@@ -1,277 +0,0 @@
-<template>
-  <div class="table-box">
-    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listAgMangeApi">
-      <!-- 表格 header 按钮 -->
-      <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['biz:agMange:add']" :icon="CirclePlus" @click="openDialog(1, '算法配置新增')"> 新增 </el-button>
-        <el-button type="primary" v-auth="['biz:agMange:import']" :icon="Upload" plain @click="batchAdd"> 导入 </el-button>
-        <el-button type="primary" v-auth="['biz:agMange:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
-        <el-button
-          type="danger"
-          v-auth="['biz:agMange: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="['biz:agMange:query']" @click="openDialog(3, '算法配置查看', scope.row)">
-          查看
-        </el-button>
-        <el-button type="primary" link :icon="EditPen" v-auth="['biz:agMange:edit']" @click="openDialog(2, '算法配置编辑', scope.row)">
-          编辑
-        </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['biz:agMange:remove']" @click="deleteAgMange(scope.row)"> 删除 </el-button>
-      </template>
-    </ProTable>
-    <FormDialog ref="formDialogRef" />
-    <ImportExcel ref="dialogRef" />
-  </div>
-</template>
-
-<script setup lang="tsx" name="AgMange">
-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 { Delete, EditPen, Download, Upload, View, CirclePlus } from '@element-plus/icons-vue'
-import {
-  listAgMangeApi,
-  delAgMangeApi,
-  addAgMangeApi,
-  updateAgMangeApi,
-  importTemplateApi,
-  importAgMangeDataApi,
-  exportAgMangeApi,
-  getAgMangeApi
-} from '@/api/modules/biz/agMange'
-
-// ProTable 实例
-const proTable = ref<ProTableInstance>()
-
-// 删除算法配置信息
-const deleteAgMange = async (params: any) => {
-  await useHandleData(delAgMangeApi, params.id, `删除【params.id】算法配置`)
-  proTable.value?.getTableList()
-}
-
-// 批量删除算法配置信息
-const batchDelete = async (ids: string[]) => {
-  await useHandleData(delAgMangeApi, ids, '删除所选算法配置信息')
-  proTable.value?.clearSelection()
-  proTable.value?.getTableList()
-}
-
-// 导出算法配置列表
-const downloadFile = async () => {
-  ElMessageBox.confirm('确认导出算法配置数据?', '温馨提示', { type: 'warning' }).then(() =>
-    useDownload(exportAgMangeApi, '算法配置列表', proTable.value?.searchParam)
-  )
-}
-
-// 批量添加算法配置
-const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
-const batchAdd = () => {
-  const params = {
-    title: '算法配置',
-    tempApi: importTemplateApi,
-    importApi: importAgMangeDataApi,
-    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 getAgMangeApi(row?.id || null)
-  }
-  // 重置表单
-  setFormItems()
-  const params = {
-    title,
-    width: 580,
-    isEdit: type !== 3,
-    fieldList: formItems,
-    model: type == 1 ? {} : res.data,
-    api: type == 1 ? addAgMangeApi : updateAgMangeApi,
-    getTableList: proTable.value?.getTableList
-  }
-  formDialogRef.value?.openDialog(params)
-}
-
-// 表格配置项
-const columns = reactive<ColumnProps<any>[]>([
-  { type: 'selection', fixed: 'left', width: 70 },
-  { prop: 'id', label: '主键ID' },
-  {
-    prop: 'subsystem',
-    label: '分系统',
-    search: {
-      el: 'input'
-    },
-    width: 120
-  },
-  {
-    prop: 'algorithmName',
-    label: '算法名称',
-    search: {
-      el: 'input'
-    },
-    width: 120
-  },
-  {
-    prop: 'algorithmAddress',
-    label: '算法地址',
-    search: {
-      el: 'input'
-    },
-    width: 120
-  },
-  {
-    prop: 'parameterConfig',
-    label: '参数配置',
-    search: {
-      el: 'input'
-    },
-    width: 120
-  },
-  {
-    prop: 'createdBy',
-    label: '创建人',
-    search: {
-      el: 'input'
-    },
-    width: 120
-  },
-  {
-    prop: 'createdAt',
-    label: '创建时间',
-    search: {
-      el: 'date-picker',
-      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
-    },
-    width: 120
-  },
-  {
-    prop: 'updatedBy',
-    label: '更新人',
-    search: {
-      el: 'input'
-    },
-    width: 120
-  },
-  {
-    prop: 'updatedAt',
-    label: '更新时间',
-    search: {
-      el: 'date-picker',
-      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
-    },
-    width: 120
-  },
-  {
-    prop: 'remarks',
-    label: '备注',
-    search: {
-      el: 'input'
-    },
-    width: 120
-  },
-  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
-])
-// 表单配置项
-let formItems: ProForm.ItemsOptions[] = []
-const setFormItems = () => {
-  formItems = [
-    {
-      label: '分系统',
-      prop: 'subsystem',
-      rules: [{ required: true, message: '分系统不能为空', trigger: 'blur' }],
-      compOptions: {
-        placeholder: '请输入分系统'
-      }
-    },
-    {
-      label: '算法名称',
-      prop: 'algorithmName',
-      rules: [{ required: true, message: '算法名称不能为空', trigger: 'blur' }],
-      compOptions: {
-        placeholder: '请输入算法名称'
-      }
-    },
-    {
-      label: '算法地址',
-      prop: 'algorithmAddress',
-      rules: [{ required: true, message: '算法地址不能为空', trigger: 'blur' }],
-      compOptions: {
-        placeholder: '请输入算法地址'
-      }
-    },
-    {
-      label: '参数配置',
-      prop: 'parameterConfig',
-      rules: [{ required: true, message: '参数配置不能为空', trigger: 'blur' }],
-      compOptions: {
-        type: 'textarea',
-        clearable: true,
-        placeholder: '请输入内容'
-      }
-    },
-    {
-      label: '创建人',
-      prop: 'createdBy',
-      rules: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
-      compOptions: {
-        placeholder: '请输入创建人'
-      }
-    },
-    {
-      label: '创建时间',
-      prop: 'createdAt',
-      rules: [{ required: true, message: '创建时间不能为空', trigger: 'change' }],
-      compOptions: {
-        elTagName: 'date-picker',
-        type: 'date',
-        placeholder: '请选择创建时间'
-      }
-    },
-    {
-      label: '更新人',
-      prop: 'updatedBy',
-      rules: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
-      compOptions: {
-        placeholder: '请输入更新人'
-      }
-    },
-    {
-      label: '更新时间',
-      prop: 'updatedAt',
-      rules: [{ required: true, message: '更新时间不能为空', trigger: 'change' }],
-      compOptions: {
-        elTagName: 'date-picker',
-        type: 'date',
-        placeholder: '请选择更新时间'
-      }
-    },
-    {
-      label: '备注',
-      prop: 'remarks',
-      rules: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
-      compOptions: {
-        placeholder: '请输入备注'
-      }
-    }
-  ]
-}
-</script>

+ 227 - 0
src/views/task/subtask/index.vue

@@ -0,0 +1,227 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listSubtaskApi">
+      <!-- 表格 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="danger"
+          v-auth="['task:subtask: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:subtask:query']" @click="openDialog(3, '算法子任务查看', scope.row)">
+          查看
+        </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['task:subtask: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>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" />
+    <ImportExcel ref="dialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="Subtask">
+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 {
+  listSubtaskApi,
+  delSubtaskApi,
+  addSubtaskApi,
+  updateSubtaskApi,
+  importTemplateApi,
+  importSubtaskDataApi,
+  exportSubtaskApi,
+  getSubtaskApi
+} from '@/api/modules/task/subtask'
+import { getDictsApi } from '@/api/modules/system/dictData'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+
+// 删除算法子任务信息
+const deleteSubtask = async (params: any) => {
+  await useHandleData(delSubtaskApi, params.id, '删除【' + params.id + '】算法子任务')
+  proTable.value?.getTableList()
+}
+
+// 批量删除算法子任务信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delSubtaskApi, ids, '删除所选算法子任务信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+// 导出算法子任务列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出算法子任务数据?', '温馨提示', { type: 'warning' }).then(() =>
+    useDownload(exportSubtaskApi, '算法子任务列表', proTable.value?.searchParam)
+  )
+}
+
+// 批量添加算法子任务
+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 formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getSubtaskApi(row?.id || null)
+  }
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    itemsOptions: itemsOptions,
+    model: type == 1 ? {} : res.data,
+    api: type == 1 ? addSubtaskApi : updateSubtaskApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  {
+    prop: 'name',
+    label: '任务名称',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'status',
+    label: '任务状态',
+    tag: true,
+    enum: () => getDictsApi('biz_task_status'),
+    search: {
+      el: 'tree-select'
+    },
+    fieldNames: { label: 'dictLabel', value: 'dictValue' },
+    width: 120
+  },
+  {
+    prop: 'startTime',
+    label: '开始时间',
+    width: 200
+  },
+  {
+    prop: 'endTime',
+    label: '结束时间',
+    width: 200
+  },
+  {
+    prop: 'costSecond',
+    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: 'status',
+      rules: [{ required: true, message: '任务状态不能为空', trigger: 'change' }],
+      compOptions: {
+        elTagName: 'select',
+        labelKey: 'dictLabel',
+        valueKey: 'dictValue',
+        enum: () => getDictsApi('biz_task_status'),
+        placeholder: '请选择任务状态'
+      }
+    },
+    {
+      label: '调用算法时所用的参数',
+      prop: 'parameters',
+      compOptions: {
+        type: 'textarea',
+        clearable: true,
+        placeholder: '请输入内容'
+      }
+    },
+    {
+      label: '开始时间',
+      prop: 'startTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择开始时间'
+      }
+    },
+    {
+      label: '结束时间',
+      prop: 'endTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择结束时间'
+      }
+    },
+    {
+      label: '耗时',
+      prop: 'costSecond',
+      compOptions: {
+        placeholder: '请输入耗时'
+      }
+    },
+    {
+      label: '日志',
+      prop: 'log',
+      compOptions: {
+        type: 'textarea',
+        clearable: true,
+        placeholder: '请输入内容'
+      }
+    },
+    {
+      label: '是否包含详情',
+      prop: 'hasDetails',
+      compOptions: {
+        placeholder: '请输入是否包含详情'
+      }
+    }
+  ]
+}
+</script>

+ 222 - 0
src/views/task/subtaskDetail/index.vue

@@ -0,0 +1,222 @@
+<template>
+  <div class="table-box">
+    <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>
+        <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="danger"
+          v-auth="['task:subtaskDetail: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:subtaskDetail: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>
+        <el-button type="primary" link icon="Delete" v-auth="['task:subtaskDetail:remove']" @click="deleteSubtaskDetail(scope.row)"> 删除 </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" />
+    <ImportExcel ref="dialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="SubtaskDetail">
+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 {
+  listSubtaskDetailApi,
+  delSubtaskDetailApi,
+  addSubtaskDetailApi,
+  updateSubtaskDetailApi,
+  importTemplateApi,
+  importSubtaskDetailDataApi,
+  exportSubtaskDetailApi,
+  getSubtaskDetailApi
+} from '@/api/modules/task/subtaskDetail'
+import { getDictsApi } from '@/api/modules/system/dictData'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+
+// 删除算法子任务详情信息
+const deleteSubtaskDetail = async (params: any) => {
+  await useHandleData(delSubtaskDetailApi, params.id, '删除【' + params.id + '】算法子任务详情')
+  proTable.value?.getTableList()
+}
+
+// 批量删除算法子任务详情信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delSubtaskDetailApi, ids, '删除所选算法子任务详情信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+// 导出算法子任务详情列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出算法子任务详情数据?', '温馨提示', { type: 'warning' }).then(() =>
+    useDownload(exportSubtaskDetailApi, '算法子任务详情列表', proTable.value?.searchParam)
+  )
+}
+
+// 批量添加算法子任务详情
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '算法子任务详情',
+    tempApi: importTemplateApi,
+    importApi: importSubtaskDetailDataApi,
+    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 getSubtaskDetailApi(row?.id || null)
+  }
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    itemsOptions: itemsOptions,
+    model: type == 1 ? {} : res.data,
+    api: type == 1 ? addSubtaskDetailApi : updateSubtaskDetailApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  {
+    prop: 'name',
+    label: '任务名称',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'status',
+    label: '任务状态',
+    tag: true,
+    enum: () => getDictsApi('biz_task_status'),
+    search: {
+      el: 'tree-select'
+    },
+    fieldNames: { label: 'dictLabel', value: 'dictValue' },
+    width: 120
+  },
+  {
+    prop: 'startTime',
+    label: '开始时间',
+    width: 120
+  },
+  {
+    prop: 'endTime',
+    label: '结束时间',
+    width: 200
+  },
+  {
+    prop: 'costSecond',
+    label: '耗时',
+    width: 200
+  },
+  { 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: 'status',
+      rules: [{ required: true, message: '任务状态不能为空', trigger: 'change' }],
+      compOptions: {
+        elTagName: 'select',
+        labelKey: 'dictLabel',
+        valueKey: 'dictValue',
+        enum: () => getDictsApi('biz_task_status'),
+        placeholder: '请选择任务状态'
+      }
+    },
+    {
+      label: '调用算法时所用的参数',
+      prop: 'parameters',
+      compOptions: {
+        type: 'textarea',
+        clearable: true,
+        placeholder: '请输入内容'
+      }
+    },
+    {
+      label: '开始时间',
+      prop: 'startTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择开始时间'
+      }
+    },
+    {
+      label: '结束时间',
+      prop: 'endTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择结束时间'
+      }
+    },
+    {
+      label: '耗时',
+      prop: 'costSecond',
+      compOptions: {
+        placeholder: '请输入耗时'
+      }
+    },
+    {
+      label: '日志',
+      prop: 'log',
+      compOptions: {
+        type: 'textarea',
+        clearable: true,
+        placeholder: '请输入内容'
+      }
+    }
+  ]
+}
+</script>

+ 221 - 0
src/views/task/task/index.vue

@@ -0,0 +1,221 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listTaskApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['task:task:add']" icon="CirclePlus" @click="openDialog(1, '算法任务新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['task:task:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['task:task:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['task:task: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:task:query']" @click="openDialog(3, '算法任务查看', scope.row)"> 查看 </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['task:task:edit']" @click="openDialog(2, '算法任务编辑', scope.row)"> 编辑 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['task:task:remove']" @click="deleteTask(scope.row)"> 删除 </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" />
+    <ImportExcel ref="dialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="Task">
+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 {
+  listTaskApi,
+  delTaskApi,
+  addTaskApi,
+  updateTaskApi,
+  importTemplateApi,
+  importTaskDataApi,
+  exportTaskApi,
+  getTaskApi
+} from '@/api/modules/task/task'
+import { getDictsApi } from '@/api/modules/system/dictData'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+
+// 删除算法任务信息
+const deleteTask = async (params: any) => {
+  await useHandleData(delTaskApi, params.id, '删除【' + params.id + '】算法任务')
+  proTable.value?.getTableList()
+}
+
+// 批量删除算法任务信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delTaskApi, ids, '删除所选算法任务信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+// 导出算法任务列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出算法任务数据?', '温馨提示', { type: 'warning' }).then(() =>
+    useDownload(exportTaskApi, '算法任务列表', proTable.value?.searchParam)
+  )
+}
+
+// 批量添加算法任务
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '算法任务',
+    tempApi: importTemplateApi,
+    importApi: importTaskDataApi,
+    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 getTaskApi(row?.id || null)
+  }
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    itemsOptions: itemsOptions,
+    model: type == 1 ? {} : res.data,
+    api: type == 1 ? addTaskApi : updateTaskApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  {
+    prop: 'name',
+    label: '任务名称',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'status',
+    label: '任务状态',
+    tag: true,
+    enum: () => getDictsApi('biz_task_status'),
+    search: {
+      el: 'tree-select'
+    },
+    fieldNames: { label: 'dictLabel', value: 'dictValue' },
+    width: 120
+  },
+  {
+    prop: 'startTime',
+    label: '开始时间',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 200
+  },
+  {
+    prop: 'endTime',
+    label: '结束时间',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 200
+  },
+  {
+    prop: 'costSecond',
+    label: '耗时',
+    search: {
+      el: 'input'
+    },
+    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: 'status',
+      options: {
+        labelKey: 'dictLabel',
+        valueKey: 'dictValue'
+      },
+      compOptions: {
+        elTagName: 'select',
+        labelKey: 'dictLabel',
+        valueKey: 'dictValue',
+        enum: () => getDictsApi('biz_task_status'),
+        placeholder: '请选择任务状态'
+      }
+    },
+    {
+      label: '开始时间',
+      prop: 'startTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择开始时间'
+      }
+    },
+    {
+      label: '结束时间',
+      prop: 'endTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择结束时间'
+      }
+    },
+    {
+      label: '耗时',
+      prop: 'costSecond',
+      compOptions: {
+        placeholder: '请输入耗时'
+      }
+    },
+    {
+      label: '日志',
+      prop: 'log',
+      compOptions: {
+        type: 'textarea',
+        clearable: true,
+        placeholder: '请输入内容'
+      }
+    }
+  ]
+}
+</script>