Răsfoiți Sursa

feat: default param show

unknown 8 luni în urmă
părinte
comite
b98786c97a

+ 1 - 1
src/components/ProTable/index.vue

@@ -213,7 +213,7 @@ const flatColumnsFunc = (columns: ColumnProps[], flatArr: ColumnProps[] = []) =>
 
 // 过滤需要搜索的配置项 && 排序
 const searchColumns = computed(() => {
-  console.log(flatColumns.value)
+  //console.log(flatColumns.value)
   return flatColumns.value?.filter(item => item.search?.el || item.search?.render).sort((a, b) => a.search!.order! - b.search!.order!)
 })
 

+ 31 - 2
src/views/demo/dataAugmentation/index.vue

@@ -113,6 +113,8 @@ const intervalChangeFps: any = ref()
 const taskType = ref([])
 const taskTypeEnums: EnumProps[] = []
 
+const hyperparameterConfiguration = []
+const hyperparameter = ref('')
 const getTaskType = async () => {
   const res: any = await listDataApi({
     dictName: '',
@@ -134,6 +136,24 @@ const getTaskType = async () => {
         tagType: 'default'
       })
     })
+    for (let i = 0; i < taskType.value.length; i++) {
+      let dictValue = taskType.value[i].value
+      const res: any = await listDataApi({
+        dictName: '',
+        dictType: 'biz_data_augmentation',
+        dictLabel: dictValue + '超参配置',
+        pageNum: 0,
+        pageSize: 1000
+      })
+      if (res.data.list.length != 0) {
+        //console.log(res.data.list[0].dictValue)
+        let obj = {}
+        obj[dictValue] = res.data.list[0].dictValue
+        hyperparameterConfiguration.push(obj)
+      } else {
+        ElMessage.error('${dictValue}未在数据字典中设置超参!')
+      }
+    }
   } else {
     ElMessage.error('task_type为空,请在数据字典中设置具体的任务类型!')
   }
@@ -434,7 +454,14 @@ const setItemsOptions = () => {
       compOptions: {
         elTagName: 'select', // 指定使用 el-select 组件
         placeholder: '请选择任务类型',
-        enum: taskType
+        enum: taskType,
+        onChange: (value: string) => {
+          hyperparameterConfiguration.forEach(obj => {
+            if (value in obj) {
+              hyperparameter.value = obj[value]
+            }
+          })
+        }
       }
     },
     {
@@ -465,7 +492,9 @@ const setItemsOptions = () => {
       compOptions: {
         type: 'input',
         clearable: true,
-        placeholder: ''
+        // placeholder: hyperparameter,
+        value: hyperparameter
+        //value: hyperparameterConfiguration[itemsOptions.taskType]
       }
     },
     {