|
@@ -19,6 +19,10 @@
|
|
|
</template>
|
|
|
<!-- 表格操作 -->
|
|
|
<template #operation="scope">
|
|
|
+ <el-button type="primary" link icon="View" v-if="scope.row.algorithmModelId != null" @click="openModelDialog(scope.row)">
|
|
|
+ <!--@click="openStartDialog(scope.row)" -->
|
|
|
+ 模型
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
link
|
|
@@ -27,6 +31,7 @@
|
|
|
v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '4'"
|
|
|
@click="startToInfrared(scope.row)"
|
|
|
>
|
|
|
+ <!--@click="openStartDialog(scope.row)" -->
|
|
|
开始
|
|
|
</el-button>
|
|
|
<el-popconfirm title="确定终止此任务吗?" @confirm="stopToInfrared(scope.row)" v-if="scope.row.status == '1'">
|
|
@@ -64,7 +69,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="tsx" name="ToInfrared">
|
|
|
-import { ref, reactive } from 'vue'
|
|
|
+import { ref, reactive, onMounted } from 'vue'
|
|
|
import { useHandleData } from '@/hooks/useHandleData'
|
|
|
import { useDownload } from '@/hooks/useDownload'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
@@ -82,10 +87,33 @@ import {
|
|
|
exportToInfraredApi,
|
|
|
startToInfraredApi,
|
|
|
stopToInfraredApi,
|
|
|
- dowloadToInfraredApi
|
|
|
+ dowloadToInfraredApi,
|
|
|
+ getToInfraredApi
|
|
|
} from '@/api/modules/demo/toInfrared'
|
|
|
+import { enumAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
|
|
|
+import { getAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
|
|
|
+import { enumAlgorithmConfigTrackApi } from '@/api/modules/demo/AlgorithmConfigTrack'
|
|
|
import statusEnums from '@/utils/status'
|
|
|
|
|
|
+const openModelDialog = async row => {
|
|
|
+ const algorithmModelId = row.algorithmModelId
|
|
|
+ const result: any = await getAlgorithmModelTrackApi(algorithmModelId)
|
|
|
+
|
|
|
+ // console.log(result.data)
|
|
|
+
|
|
|
+ setItemsOptionsModel()
|
|
|
+ const params = {
|
|
|
+ title: '模型',
|
|
|
+ width: 580,
|
|
|
+ isEdit: false,
|
|
|
+ itemsOptions: itemsOptions,
|
|
|
+ model: result.data,
|
|
|
+ api: updateToInfraredApi,
|
|
|
+ getTableList: proTable.value?.getTableList
|
|
|
+ }
|
|
|
+ formDialogRef.value?.openDialog(params)
|
|
|
+}
|
|
|
+
|
|
|
const startToInfrared = async (params: any) => {
|
|
|
const res: any = await startToInfraredApi(params.id)
|
|
|
if (res.code === 200) {
|
|
@@ -109,6 +137,25 @@ const dowloadToInfrared = async (params: any) => {
|
|
|
await useDownload(dowloadToInfraredApi, params.name, params.id, true, '.zip')
|
|
|
}
|
|
|
|
|
|
+const openStartDialog = async (row: any) => {
|
|
|
+ let res = { data: {} }
|
|
|
+ if (row?.id) {
|
|
|
+ res = await getToInfraredApi(row?.id || null)
|
|
|
+ }
|
|
|
+ // 重置表单
|
|
|
+ setItemsOptions2()
|
|
|
+ const params = {
|
|
|
+ title: '开始任务',
|
|
|
+ width: 580,
|
|
|
+ isEdit: true,
|
|
|
+ itemsOptions: itemsOptions,
|
|
|
+ model: res.data,
|
|
|
+ api: startToInfraredApi,
|
|
|
+ getTableList: proTable.value?.getTableList
|
|
|
+ }
|
|
|
+ formDialogRef.value?.openDialog(params)
|
|
|
+}
|
|
|
+
|
|
|
// ProTable 实例
|
|
|
const proTable = ref<ProTableInstance>()
|
|
|
|
|
@@ -187,6 +234,14 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
enum: statusEnums,
|
|
|
width: 150
|
|
|
},
|
|
|
+ // {
|
|
|
+ // prop: 'algorithmModelId',
|
|
|
+ // label: '模型',
|
|
|
+ // search: {
|
|
|
+ // el: 'input'
|
|
|
+ // },
|
|
|
+ // width: 150
|
|
|
+ // },
|
|
|
{
|
|
|
prop: 'startTime',
|
|
|
label: '开始时间',
|
|
@@ -245,6 +300,54 @@ const setItemsOptions = () => {
|
|
|
placeholder: '请上传图片集'
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '选择模型',
|
|
|
+ prop: 'algorithmModelId',
|
|
|
+ rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ elTagName: 'select',
|
|
|
+ placeholder: '请选择模型',
|
|
|
+ enum: enumsAlgorithmModelTrack
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remarks',
|
|
|
+ rules: [],
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入备注'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+const enumsAlgorithmModelTrack = ref<any>([])
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ enumsAlgorithmModelTrack.value = (await enumAlgorithmModelTrackApi()).data
|
|
|
+})
|
|
|
+
|
|
|
+const setItemsOptions2 = () => {
|
|
|
+ itemsOptions = [
|
|
|
+ {
|
|
|
+ label: '任务名称',
|
|
|
+ prop: 'name',
|
|
|
+ rules: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ disabled: true,
|
|
|
+ placeholder: '请输入任务名称'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '选择模型',
|
|
|
+ prop: 'algorithmModel',
|
|
|
+ rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ elTagName: 'select',
|
|
|
+ placeholder: '请选择模型',
|
|
|
+ enum: enumsAlgorithmModelTrack
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
label: '备注',
|
|
|
prop: 'remarks',
|
|
@@ -255,4 +358,115 @@ const setItemsOptions = () => {
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
+
|
|
|
+const enumsAlgorithmConfigTrack = ref<any>([])
|
|
|
+onMounted(async () => {
|
|
|
+ const result = await enumAlgorithmConfigTrackApi()
|
|
|
+ // console.log(result)
|
|
|
+ // console.log(result['data'])
|
|
|
+ enumsAlgorithmConfigTrack.value = result['data']
|
|
|
+ return result['data']
|
|
|
+})
|
|
|
+
|
|
|
+const setItemsOptionsModel = () => {
|
|
|
+ itemsOptions = [
|
|
|
+ {
|
|
|
+ label: '算法ID',
|
|
|
+ prop: 'algorithmId',
|
|
|
+ rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ disabled: true,
|
|
|
+ elTagName: 'select',
|
|
|
+ placeholder: '请输入算法',
|
|
|
+ enum: enumsAlgorithmConfigTrack
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '算法类型',
|
|
|
+ prop: 'algorithmType',
|
|
|
+ rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ disabled: true,
|
|
|
+ elTagName: 'select',
|
|
|
+ placeholder: '请输入算法',
|
|
|
+ enum: enumsAlgorithmConfigTrack
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '算法参数',
|
|
|
+ prop: 'parameterConfig',
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入模型名称'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '模型ID',
|
|
|
+ prop: 'id',
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入模型名称'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '模型名称',
|
|
|
+ prop: 'modelName',
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入模型名称'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '模型保存路径',
|
|
|
+ prop: 'modelAddress',
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入模型名称'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // label: '模型',
|
|
|
+ // prop: 'modelInputOssId',
|
|
|
+ // rules: [{ required: true, message: '模型文件不能为空', trigger: 'blur' }],
|
|
|
+ // compOptions: {
|
|
|
+ // elTagName: 'file-upload',
|
|
|
+ // fileSize: 4096,
|
|
|
+ // fileType: ['pt'],
|
|
|
+ // placeholder: '请上传模型文件'
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: '训练样本数',
|
|
|
+ // prop: 'sampleNumber',
|
|
|
+ // rules: [{ required: true, message: '训练样本数不能为空', trigger: 'blur' }],
|
|
|
+ // compOptions: {
|
|
|
+ // placeholder: '请输入训练样本数'
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: '训练循环次数',
|
|
|
+ // prop: 'cycleEpoch',
|
|
|
+ // rules: [{ required: true, message: '训练循环次数不能为空', trigger: 'blur' }],
|
|
|
+ // compOptions: {
|
|
|
+ // placeholder: '请输入训练循环次数'
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remarks',
|
|
|
+ rules: [{ required: false, message: '备注不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入备注'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // {
|
|
|
+ // label: '系统',
|
|
|
+ // prop: 'system',
|
|
|
+ // rules: [{ required: true, message: '系统不能为空', trigger: 'blur' }],
|
|
|
+ // compOptions: {
|
|
|
+ // placeholder: '请输入系统'
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ ]
|
|
|
+}
|
|
|
</script>
|