|
@@ -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
|
|
@@ -64,7 +68,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="tsx" name="TrackSequence">
|
|
|
-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'
|
|
@@ -86,6 +90,36 @@ import {
|
|
|
dowloadTrackSequenceApi
|
|
|
} from '@/api/modules/demo/trackSequence'
|
|
|
import statusEnums from '@/utils/status'
|
|
|
+import { enumAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
|
|
|
+import { getAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
|
|
|
+import { enumAlgorithmConfigTrackApi } from '@/api/modules/demo/AlgorithmConfigTrack'
|
|
|
+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 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: updateTrackSequenceApi,
|
|
|
+ getTableList: proTable.value?.getTableList
|
|
|
+ }
|
|
|
+ formDialogRef.value?.openDialog(params)
|
|
|
+}
|
|
|
|
|
|
const startTrackSequence = async (params: any) => {
|
|
|
const res: any = await startTrackSequenceApi(params.id)
|
|
@@ -189,6 +223,11 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
enum: statusEnums,
|
|
|
width: 150
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'algorithmModelId',
|
|
|
+ label: '模型id',
|
|
|
+ width: 120
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'startTime',
|
|
|
label: '开始时间',
|
|
@@ -225,6 +264,12 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
{ prop: 'operation', label: '操作', width: 230, fixed: 'right' }
|
|
|
])
|
|
|
|
|
|
+const enumsAlgorithmModelTrack = ref<any>([])
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ enumsAlgorithmModelTrack.value = (await enumAlgorithmModelTrackApi()).data
|
|
|
+})
|
|
|
+
|
|
|
// 表单配置项
|
|
|
let itemsOptions: ProForm.ItemsOptions[] = []
|
|
|
const setItemsOptions = () => {
|
|
@@ -248,6 +293,16 @@ const setItemsOptions = () => {
|
|
|
placeholder: '请上传图片集'
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '选择模型',
|
|
|
+ prop: 'algorithmModelId',
|
|
|
+ rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ elTagName: 'select',
|
|
|
+ placeholder: '请选择模型',
|
|
|
+ enum: enumsAlgorithmModelTrack
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
label: '备注',
|
|
|
prop: 'remarks',
|
|
@@ -258,4 +313,71 @@ const setItemsOptions = () => {
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
+
|
|
|
+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: 'remarks',
|
|
|
+ rules: [{ required: false, message: '备注不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入备注'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
</script>
|