Parcourir la source

feat: 模型配置添加新的参数algorithmParameters

WANGKANG il y a 6 mois
Parent
commit
3540c449ea
1 fichiers modifiés avec 59 ajouts et 35 suppressions
  1. 59 35
      src/views/demo/AlgorithmModelTrack/index.vue

+ 59 - 35
src/views/demo/AlgorithmModelTrack/index.vue

@@ -70,7 +70,7 @@ import {
 } from '@/api/modules/demo/AlgorithmModelTrack'
 
 import { enumAlgorithmConfigTrackApi } from '@/api/modules/demo/AlgorithmConfigTrack'
-import { AlgorithmType, SubSystem, enumsModelStatus, enumsAlgorithmType, enumsSubSystem } from '@/views/demo/utils'
+import { AlgorithmType, SubSystem, enumsModelStatus, enumsAlgorithmType, enumsSubSystem, AlgorithmType2 } from '@/views/demo/utils'
 
 // ProTable 实例
 const proTable = ref<ProTableInstance>()
@@ -148,16 +148,16 @@ const columns = reactive<ColumnProps<any>[]>([
     },
     minWidth: 200
   },
-  {
-    prop: 'type',
-    label: '类型',
-    tag: true,
-    enum: enumsAlgorithmType,
-    search: {
-      el: 'select'
-    },
-    width: 120
-  },
+  // {
+  //   prop: 'type',
+  //   label: '类型',
+  //   tag: true,
+  //   enum: enumsAlgorithmType,
+  //   search: {
+  //     el: 'select'
+  //   },
+  //   width: 120
+  // },
   //   {
   //     prop: 'parentId',
   //     label: '父id',
@@ -176,16 +176,16 @@ const columns = reactive<ColumnProps<any>[]>([
     },
     width: 120
   },
-  {
-    prop: 'modelStatus',
-    label: '模型状态',
-    tag: true,
-    enum: enumsModelStatus,
-    search: {
-      el: 'select'
-    },
-    width: 120
-  },
+  // {
+  //   prop: 'modelStatus',
+  //   label: '模型状态',
+  //   tag: true,
+  //   enum: enumsModelStatus,
+  //   search: {
+  //     el: 'select'
+  //   },
+  //   width: 120
+  // },
   //   {
   //     prop: 'sampleNumber',
   //     label: '训练样本数',
@@ -204,11 +204,19 @@ const columns = reactive<ColumnProps<any>[]>([
   //   },
   {
     prop: 'modelAddress',
-    label: '模型',
+    label: '模型地址',
     search: {
       el: 'input'
     },
-    width: 120
+    width: 240
+  },
+  {
+    prop: 'algorithmParameters',
+    label: '算法参数',
+    search: {
+      el: 'input'
+    },
+    width: 200
   },
   {
     prop: 'remarks',
@@ -228,6 +236,7 @@ const columns = reactive<ColumnProps<any>[]>([
   //   },
   { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
 ])
+
 // 表单配置项
 let itemsOptions: ProForm.ItemsOptions[] = []
 
@@ -235,21 +244,16 @@ const enumsAlgorithmConfigTrack = ref<any>([])
 
 onMounted(async () => {
   const result: any = await enumAlgorithmConfigTrackApi()
-  // console.log(result)
-  // console.log(result['data'])
+  const tmp = []
   for (let item of result['data']) {
-    // console.log(item)
-    // console.log(item['type'])
-    // console.log(item['subsystem'])
-    // console.log(AlgorithmType[item['type']])
-    // console.log(SubSystem[item['subsystem']])
-    // console.log(AlgorithmType)
-    // console.log(SubSystem)
-    // console.log('-------------------')
-    item['label'] = item['label'] + '-' + SubSystem[item['subsystem']] + '-' + AlgorithmType[item['type']]
+    if (item['type'] == AlgorithmType2['预测/推理']) {
+      const tmpItem = { ...item }
+      tmpItem['label'] = item['label'] + '-' + SubSystem[item['subsystem']] + '-' + AlgorithmType[item['type']]
+      tmp.push(tmpItem)
+    }
   }
 
-  enumsAlgorithmConfigTrack.value = result['data']
+  enumsAlgorithmConfigTrack.value = tmp
   return result['data']
 })
 
@@ -273,6 +277,16 @@ const setItemsOptions = () => {
         placeholder: '请输入模型名称'
       }
     },
+    // {
+    //   label: '分系统',
+    //   prop: 'subSystem',
+    //   rules: [{required: true, message: '分系统不能为空', trigger: 'blur'}],
+    //   compOptions: {
+    //     elTagName: 'select',
+    //     placeholder: '请选择分系统',
+    //     enum: enumsSubSystem,
+    //   }
+    // },
     {
       label: '模型',
       prop: 'modelInputOssId',
@@ -300,6 +314,16 @@ const setItemsOptions = () => {
     //     placeholder: '请输入训练循环次数'
     //   }
     // },
+    {
+      label: '算法参数',
+      prop: 'algorithmParameters',
+      rules: [{ required: false, message: '算法参数不能为空', trigger: 'blur' }],
+      compOptions: {
+        type: 'textarea',
+        clearable: true,
+        placeholder: '请输入算法参数'
+      }
+    },
     {
       label: '备注',
       prop: 'remarks',