Переглянути джерело

feat: sql update new clomun task_type

unknown 8 місяців тому
батько
коміт
dd87e2a67c

+ 1 - 0
src/api/interface/demo/dataAugmentation.ts

@@ -133,6 +133,7 @@ export interface DataAugmentationQuery extends PageQuery {
   /**
    * 任务状态 0未开始 1进行中 2已结束
    */
+  taskType?: string
   status?: string
 
   /**

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

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

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

@@ -72,7 +72,7 @@
 </template>
 
 <script setup lang="tsx" name="DataAugmentation">
-import { ref, reactive } from 'vue'
+import { ref, reactive, onMounted } from 'vue'
 import { useHandleData } from '@/hooks/useHandleData'
 import { useDownload } from '@/hooks/useDownload'
 import { ElMessageBox, ElMessage } from 'element-plus'
@@ -94,7 +94,7 @@ import {
   getCompareImageApi,
   getCompareImageCountApi
 } from '@/api/modules/demo/dataAugmentation'
-
+import { listDataApi } from '@/api/modules/system/dictData'
 const dialogVisible = ref(false)
 const taskId = ref('')
 const imageIdx = ref(0)
@@ -110,7 +110,39 @@ const dialogTitle = ref('')
 const fileCount = ref(0)
 const imageFps = ref(0)
 const intervalChangeFps: any = ref()
+const taskType = ref([])
+const taskTypeEnums: EnumProps[] = []
 
+const getTaskType = async () => {
+  const res: any = await listDataApi({
+    dictName: '',
+    dictType: 'biz_data_augmentation',
+    dictLabel: '任务类型',
+    pageNum: 0,
+    pageSize: 1000
+  })
+  if (res.data.list.length != 0) {
+    taskType.value = res.data.list.map(item => ({
+      label: item.dictValue,
+      value: item.dictValue
+    }))
+    res.data.list.forEach(item => {
+      taskTypeEnums.push({
+        label: item.dictValue,
+        value: item.dictValue,
+        disabled: false,
+        tagType: 'default'
+      })
+    })
+  } else {
+    ElMessage.error('task_type为空,请在数据字典中设置具体的任务类型!')
+  }
+
+  // console.log(taskType.value)
+}
+onMounted(() => {
+  getTaskType()
+})
 const changeFps = () => {
   console.log('changeFps')
   if (intervalChangeFps.value) {
@@ -151,6 +183,7 @@ const loadImageData = async (taskId: string, imageIdx: number) => {
   imageBase64List.value.origin = res.origin
   imageBase64List.value.stable = res.stable
 }
+
 const compareDataAugmentation = async (params: any) => {
   taskId.value = params.id
   imageIdx.value = 0
@@ -299,6 +332,16 @@ const columns = reactive<ColumnProps<any>[]>([
     },
     width: 150
   },
+  {
+    prop: 'taskType',
+    label: '任务类型',
+    search: {
+      el: 'select'
+    },
+    width: 100,
+    tag: true,
+    enum: taskTypeEnums
+  },
   {
     prop: 'status',
     label: '任务状态',
@@ -384,6 +427,16 @@ const setItemsOptions = () => {
         placeholder: '请输入任务名称'
       }
     },
+    {
+      label: '任务类型',
+      prop: 'taskType',
+      rules: [{ required: true, message: '任务类型不能为空', trigger: 'change' }],
+      compOptions: {
+        elTagName: 'select', // 指定使用 el-select 组件
+        placeholder: '请选择任务类型',
+        enum: taskType
+      }
+    },
     {
       label: '图片集压缩包',
       prop: 'inputOssId',