|
@@ -43,7 +43,7 @@
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
</ProTable>
|
|
</ProTable>
|
|
- <FormDialog ref="formDialogRef" />
|
|
|
|
|
|
+ <DataAugmentationFormDialog ref="formDialogRef" />
|
|
<ImportExcel ref="dialogRef" />
|
|
<ImportExcel ref="dialogRef" />
|
|
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="80%">
|
|
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="80%">
|
|
<div class="image-dialog" v-if="imageIdx >= 0 && cacheImages[imageIdx]">
|
|
<div class="image-dialog" v-if="imageIdx >= 0 && cacheImages[imageIdx]">
|
|
@@ -73,7 +73,7 @@ import { useDownload } from '@/hooks/useDownload'
|
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
|
import ProTable from '@/components/ProTable/index.vue'
|
|
import ProTable from '@/components/ProTable/index.vue'
|
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
|
-import FormDialog from '@/components/FormDialog/index.vue'
|
|
|
|
|
|
+import DataAugmentationFormDialog from '@/components/DataAugmentationFormDialog/index.vue'
|
|
import { ProTableInstance, ColumnProps, EnumProps } from '@/components/ProTable/interface'
|
|
import { ProTableInstance, ColumnProps, EnumProps } from '@/components/ProTable/interface'
|
|
import {
|
|
import {
|
|
listDataAugmentationApi,
|
|
listDataAugmentationApi,
|
|
@@ -92,6 +92,7 @@ import {
|
|
} from '@/api/modules/demo/dataAugmentation'
|
|
} from '@/api/modules/demo/dataAugmentation'
|
|
import { listDataApi } from '@/api/modules/system/dictData'
|
|
import { listDataApi } from '@/api/modules/system/dictData'
|
|
import { S } from 'vite/dist/node/types.d-aGj9QkWt'
|
|
import { S } from 'vite/dist/node/types.d-aGj9QkWt'
|
|
|
|
+import { servicesVersion } from 'typescript'
|
|
const dialogVisible = ref(false)
|
|
const dialogVisible = ref(false)
|
|
const taskId = ref('')
|
|
const taskId = ref('')
|
|
const imageIdx = ref(0)
|
|
const imageIdx = ref(0)
|
|
@@ -283,18 +284,18 @@ const batchAdd = () => {
|
|
dialogRef.value?.acceptParams(params)
|
|
dialogRef.value?.acceptParams(params)
|
|
}
|
|
}
|
|
|
|
|
|
-const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
|
|
|
|
|
|
+const formDialogRef = ref<InstanceType<typeof DataAugmentationFormDialog> | null>(null)
|
|
// 打开弹框的功能
|
|
// 打开弹框的功能
|
|
const openDialog = async (type: number, title: string, row?: any) => {
|
|
const openDialog = async (type: number, title: string, row?: any) => {
|
|
- hyperparameter.value = ''
|
|
|
|
|
|
+ // hyperparameter.value = ''
|
|
let res = { data: {} }
|
|
let res = { data: {} }
|
|
if (row?.id) {
|
|
if (row?.id) {
|
|
res = await getDataAugmentationApi(row?.id || null)
|
|
res = await getDataAugmentationApi(row?.id || null)
|
|
- hyperparameter.value = res.data?.hyperparameterConfiguration
|
|
|
|
|
|
+ // hyperparameter.value = res.data?.hyperparameterConfiguration
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // console.log(itemsOptions[1].compOptions?.value)
|
|
// 重置表单
|
|
// 重置表单
|
|
- setItemsOptions()
|
|
|
|
|
|
+ // setItemsOptions()
|
|
const params = {
|
|
const params = {
|
|
title,
|
|
title,
|
|
width: 580,
|
|
width: 580,
|
|
@@ -306,6 +307,7 @@ const openDialog = async (type: number, title: string, row?: any) => {
|
|
}
|
|
}
|
|
formDialogRef.value?.openDialog(params)
|
|
formDialogRef.value?.openDialog(params)
|
|
}
|
|
}
|
|
|
|
+
|
|
const statusEnums: EnumProps[] = [
|
|
const statusEnums: EnumProps[] = [
|
|
{
|
|
{
|
|
label: '未开始',
|
|
label: '未开始',
|
|
@@ -374,25 +376,11 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
{
|
|
{
|
|
prop: 'startTime',
|
|
prop: 'startTime',
|
|
label: '开始时间',
|
|
label: '开始时间',
|
|
- // search: {
|
|
|
|
- // el: 'date-picker',
|
|
|
|
- // props: {
|
|
|
|
- // type: 'datetimerange',
|
|
|
|
- // valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
width: 180
|
|
width: 180
|
|
},
|
|
},
|
|
{
|
|
{
|
|
prop: 'endTime',
|
|
prop: 'endTime',
|
|
label: '结束时间',
|
|
label: '结束时间',
|
|
- // search: {
|
|
|
|
- // el: 'date-picker',
|
|
|
|
- // props: {
|
|
|
|
- // type: 'datetimerange',
|
|
|
|
- // valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
width: 180
|
|
width: 180
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -435,81 +423,90 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
}
|
|
}
|
|
])
|
|
])
|
|
// 表单配置项
|
|
// 表单配置项
|
|
-let itemsOptions: ProForm.ItemsOptions[] = []
|
|
|
|
-const model = ref({})
|
|
|
|
-const setItemsOptions = () => {
|
|
|
|
- itemsOptions = [
|
|
|
|
- {
|
|
|
|
- label: '任务名称',
|
|
|
|
- prop: 'name',
|
|
|
|
- rules: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
|
|
|
- compOptions: {
|
|
|
|
- placeholder: '请输入任务名称'
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '任务类型',
|
|
|
|
- prop: 'taskType',
|
|
|
|
- rules: [{ required: true, message: '任务类型不能为空', trigger: 'change' }],
|
|
|
|
- compOptions: {
|
|
|
|
- elTagName: 'select', // 指定使用 el-select 组件
|
|
|
|
- placeholder: '请选择任务类型',
|
|
|
|
- enum: taskType,
|
|
|
|
- onChange: (value: string) => {
|
|
|
|
- hyperparameterConfiguration.forEach(obj => {
|
|
|
|
- if (value in obj) {
|
|
|
|
- hyperparameter.value = obj[value]
|
|
|
|
- // console.log(obj)
|
|
|
|
- model.value['hyperparameterConfiguration'] = obj[value]
|
|
|
|
- // itemsOptions[3]['compOptions']['value'] = obj[value]
|
|
|
|
- //itemsOptions[3].compOptions.onChange(obj[value])
|
|
|
|
- // let change = itemsOptions[3]['compOptions']['onChange']
|
|
|
|
- // change(obj[value])
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '图片集压缩包',
|
|
|
|
- prop: 'inputOssId',
|
|
|
|
- rules: [{ required: true, message: '数据压缩包不能为空', trigger: 'change' }],
|
|
|
|
- compOptions: {
|
|
|
|
- elTagName: 'file-upload',
|
|
|
|
- fileSize: 4096,
|
|
|
|
- fileType: ['zip'],
|
|
|
|
- placeholder: '请上传图片集压缩包'
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '超参配置',
|
|
|
|
- prop: 'hyperparameterConfiguration',
|
|
|
|
- // rules: [{ required: true, message: '超参配置不能为空', trigger: 'blur' }],
|
|
|
|
- rules: [{ required: false, trigger: 'blur' }],
|
|
|
|
- compOptions: {
|
|
|
|
- type: 'input',
|
|
|
|
- clearable: true,
|
|
|
|
- // placeholder: hyperparameter
|
|
|
|
- value: hyperparameter,
|
|
|
|
- onChange: (value: string) => {
|
|
|
|
- hyperparameter.value = value
|
|
|
|
- }
|
|
|
|
|
|
+let itemsOptions: ProForm.ItemsOptions[] = [
|
|
|
|
+ {
|
|
|
|
+ label: '任务名称',
|
|
|
|
+ prop: 'name',
|
|
|
|
+ rules: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
|
|
|
+ compOptions: {
|
|
|
|
+ placeholder: '请输入任务名称'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '任务类型',
|
|
|
|
+ prop: 'taskType',
|
|
|
|
+ rules: [{ required: true, message: '任务类型不能为空', trigger: 'change' }],
|
|
|
|
+ compOptions: {
|
|
|
|
+ elTagName: 'select', // 指定使用 el-select 组件
|
|
|
|
+ placeholder: '请选择任务类型',
|
|
|
|
+ enum: taskType,
|
|
|
|
+ onChange: (value: string) => {
|
|
|
|
+ model.value['taskType'] = value
|
|
|
|
+ hyperparameterConfiguration.forEach(obj => {
|
|
|
|
+ if (value in obj) {
|
|
|
|
+ // console.log(obj[value])
|
|
|
|
+ addParams(obj[value])
|
|
|
|
+ openDialog(1, '任务新增')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '备注',
|
|
|
|
- prop: 'remarks',
|
|
|
|
- rules: [
|
|
|
|
- {
|
|
|
|
- required: false,
|
|
|
|
- trigger: 'blur'
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- compOptions: {
|
|
|
|
- placeholder: '请输入备注'
|
|
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '图片集压缩包',
|
|
|
|
+ prop: 'inputOssId',
|
|
|
|
+ rules: [{ required: true, message: '数据压缩包不能为空', trigger: 'change' }],
|
|
|
|
+ compOptions: {
|
|
|
|
+ elTagName: 'file-upload',
|
|
|
|
+ fileSize: 4096,
|
|
|
|
+ fileType: ['zip'],
|
|
|
|
+ placeholder: '请上传图片集压缩包'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '备注',
|
|
|
|
+ prop: 'remarks',
|
|
|
|
+ rules: [
|
|
|
|
+ {
|
|
|
|
+ required: false,
|
|
|
|
+ trigger: 'blur'
|
|
}
|
|
}
|
|
|
|
+ ],
|
|
|
|
+ compOptions: {
|
|
|
|
+ placeholder: '请输入备注'
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+ }
|
|
|
|
+]
|
|
|
|
+const model = ref({})
|
|
|
|
+const setItemsOptions = () => {
|
|
|
|
+ if (itemsOptions.length > 4) {
|
|
|
|
+ itemsOptions.splice(4) // 如果里面有新增参数,删除,重新添加
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+const addParams = params => {
|
|
|
|
+ setItemsOptions()
|
|
|
|
+ if (params == 'null') {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let validJsonString = params.replace(/'/g, '"')
|
|
|
|
+ try {
|
|
|
|
+ const obj: { [key: string]: number } = JSON.parse(validJsonString)
|
|
|
|
+ Object.keys(obj).forEach(key => {
|
|
|
|
+ // model.value[key] = obj[key]
|
|
|
|
+ itemsOptions.push({
|
|
|
|
+ label: key,
|
|
|
|
+ prop: key,
|
|
|
|
+ rules: [{ required: true, trigger: 'blur' }],
|
|
|
|
+ compOptions: {
|
|
|
|
+ type: 'input',
|
|
|
|
+ clearable: true,
|
|
|
|
+ placeholder: obj[key]
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error('解析 JSON 字符串时出错:', error)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|