Эх сурвалжийг харах

Merge branch 'dev_lsk_b12' into develop

allen 4 сар өмнө
parent
commit
f65c4dfe61

+ 15 - 12
src/views/demo/data/AmplifyForm.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="amplify-main">
-    <ProForm :items-options="items" :model="model"></ProForm>
+    <ProForm ref="proFormRef" :items-options="items"></ProForm>
     <el-button type="primary" v-if="showSelectBatchButton" style="margin-left: 50px" @click="showDataSelectionDialog()">选择批次</el-button>
 
     <el-dialog v-model="dataDialogVisible" title="选择数据批次" style="width: 70vw">
@@ -37,14 +37,15 @@ import { reactive, ref, computed, onMounted, defineEmits } from 'vue'
 import ProForm from '@/components/ProForm/index.vue'
 import { batchListDataApi } from '@/api/modules/demo/data'
 import { getDictsApi } from '@/api/modules/system/dictData'
+import ProFrom from '@/components/ProForm/index.vue'
 
 const emit = defineEmits(['updateData', 'updateModel', 'updateParams'])
-
+const proFormRef = ref<InstanceType<typeof ProFrom> | null>(null)
 // 数据
-let model = {
-  taskName: 'sss',
+const model = ref({
+  taskName: '',
   transfer: null
-}
+})
 
 const dataDialogVisible = ref(false)
 let batchDataList = ref(reactive([] as any[]))
@@ -54,12 +55,14 @@ let tempDeselectedBatchDataList = ref(reactive([] as any[]))
 let parameList = ref(reactive([] as any[]))
 let queryBatchData = ref(reactive([] as any[]))
 
-const props = defineProps({ showSelectBatchButton: Boolean })
+const props = defineProps({ showSelectBatchButton: Boolean, dataList: Array, useData: Boolean })
 
 onMounted(() => {
-  batchListDataApi().then(res => {
-    queryBatchData.value = reactive(res.data)
-  })
+  !props.useData &&
+    batchListDataApi().then(res => {
+      queryBatchData.value = reactive(res.data)
+    })
+  props.useData && (queryBatchData.value = props.dataList) // && console.log('load data', props.dataList)
 
   getDictsApi('expand_data_params').then(res => {
     parameList.value = reactive(JSON.parse(res.data[0].remark))
@@ -75,9 +78,9 @@ onMounted(() => {
           placeholder: '请输入' + item.name
         }
       })
-      model[`${item.agName}`] = item.defaultValue
+      // model.value[`${item.agName}`] = item.defaultValue
     })
-    emit('updateModel', model)
+    emit('updateModel', proFormRef.value.formModel)
     // Emit parameList 给父组件
     emit('updateParams', parameList.value)
   })
@@ -149,7 +152,7 @@ let items: ProForm.ItemsOptions[] = reactive([
     compOptions: {
       elTagName: 'input',
       clearable: true,
-      placeholder: '请输入用户名'
+      placeholder: '请输入任务名称'
     }
   },
   {

+ 89 - 72
src/views/demo/videoStable/index.vue

@@ -96,6 +96,7 @@ import useWebSocketStore from '@/stores/modules/websocket'
 import { resetHeart } from '@/utils/websocket'
 import ViewLog from '@/views/demo/components/ViewLog.vue'
 import PreviewCompareImages from '@/views/demo/components/PreviewCompareImages.vue'
+import { getOneAlgorithmConfigApi, listAlgorithmConfigApi } from '@/api/modules/demo/algorithmConfig'
 
 const previewCompareImagesRef = ref()
 const previewCompare = async row => {
@@ -181,7 +182,7 @@ const openDialog = async (type: number, title: string, row?: any) => {
     res = await getVideoStableApi(row?.id || null)
   }
   // 重置表单
-  setItemsOptions()
+  await setItemsOptions()
   const params = {
     title,
     width: 580,
@@ -338,7 +339,7 @@ const columns = reactive<ColumnProps<any>[]>([
 ])
 // 表单配置项
 let itemsOptions: ProForm.ItemsOptions[] = []
-const setItemsOptions = () => {
+const setItemsOptions = async () => {
   itemsOptions = [
     {
       label: '任务名称',
@@ -359,76 +360,76 @@ const setItemsOptions = () => {
         placeholder: '请上传图片集压缩包'
       }
     },
-    {
-      label: '网格大小',
-      prop: 'block_size',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认50'
-      }
-    },
-    {
-      label: '扩散半径',
-      prop: 'radius',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认500'
-      }
-    },
-    {
-      label: '缓冲区大小',
-      prop: 'buffer_size',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认200'
-      }
-    },
-    {
-      label: '角点质量',
-      prop: 'cornerquality',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认0.2'
-      }
-    },
-    {
-      label: '角点最小距离',
-      prop: 'cornerminDistance',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认5'
-      }
-    },
-    {
-      label: '光流层级',
-      prop: 'lklevel',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认3'
-      }
-    },
-    {
-      label: '光流窗口大小',
-      prop: 'lkwinSiz',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认15'
-      }
-    },
+    // {
+    //   label: '网格大小',
+    //   prop: 'block_size',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认50'
+    //   }
+    // },
+    // {
+    //   label: '扩散半径',
+    //   prop: 'radius',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认500'
+    //   }
+    // },
+    // {
+    //   label: '缓冲区大小',
+    //   prop: 'buffer_size',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认200'
+    //   }
+    // },
+    // {
+    //   label: '角点质量',
+    //   prop: 'cornerquality',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认0.2'
+    //   }
+    // },
+    // {
+    //   label: '角点最小距离',
+    //   prop: 'cornerminDistance',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认5'
+    //   }
+    // },
+    // {
+    //   label: '光流层级',
+    //   prop: 'lklevel',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认3'
+    //   }
+    // },
+    // {
+    //   label: '光流窗口大小',
+    //   prop: 'lkwinSiz',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认15'
+    //   }
+    // },
     {
       label: '备注',
       prop: 'remarks',
@@ -444,6 +445,22 @@ const setItemsOptions = () => {
       }
     }
   ]
+
+  const res = await getOneAlgorithmConfigApi({ algorithmName: '电子稳相' })
+  const config = JSON.parse(res.data.parameters)
+  config.forEach(item => {
+    itemsOptions.push({
+      label: item.name,
+      prop: item.agName,
+      rules: [],
+      compOptions: {
+        type: 'input',
+        clearable: true,
+        placeholder: item.defaultValue
+      },
+      tooltip: item.prompt
+    })
+  })
 }
 </script>
 

+ 8 - 3
src/views/taais/homePage/task/index.vue

@@ -110,7 +110,9 @@
           @update-data="updateBatchData"
           @update-model="updateModelData"
           @update-params="updateParamsList"
-          :show-select-batch-button="false"
+          :show-select-batch-button="true"
+          :use-data="true"
+          :data-list="selectedBatchDataList"
         />
       </el-container>
       <el-container style="height: 10px"></el-container>
@@ -202,11 +204,13 @@ const updateBatchData = data => {
 
 const updateModelData = data => {
   model.value = data
+  console.log('model', model.value)
 }
 
 // 监听 parameList 更新
 const updateParamsList = data => {
   parameList.value = data
+  console.log('params', parameList.value)
 }
 
 // 提交逻辑
@@ -219,8 +223,9 @@ const getTrainAugmentationParams = () => {
   })
 
   return {
-    batchNum,
+    batchNum: batchNum,
     taskName: model.value.taskName,
+    augmentationType: model.value.augmentationType,
     otherParams: parameList.value
   }
 }
@@ -276,7 +281,6 @@ const valid = data => {
 }
 
 const submit = () => {
-  console.log('submit data, formdata is: ', formData)
   const params = {
     taskName: formData.taskName,
     taskType: formData.taskType,
@@ -287,6 +291,7 @@ const submit = () => {
     hasTrainAugmentation: formData.expandData,
     trainAugmentationParams: getTrainAugmentationParams()
   }
+  console.log('submit data', params)
   let result = valid(params)
   // console.log(result)
   if (result.code !== 200) {