|
@@ -3,9 +3,7 @@
|
|
|
<ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listTrackSequenceApi">
|
|
|
<!-- 表格 header 按钮 -->
|
|
|
<template #tableHeader="scope">
|
|
|
- <el-button type="primary" v-auth="['demo:trackSequence:add']" icon="CirclePlus"
|
|
|
- @click="openDialog(1, '注视轨迹序列新增')"> 新增
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" v-auth="['demo:trackSequence:add']" icon="CirclePlus" @click="openDialog(1, '注视轨迹序列新增')"> 新增 </el-button>
|
|
|
<!-- <el-button type="primary" v-auth="['demo:trackSequence:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
|
|
|
<el-button type="primary" v-auth="['demo:trackSequence:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button> -->
|
|
|
<el-button
|
|
@@ -64,20 +62,20 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</ProTable>
|
|
|
- <FormDialog ref="formDialogRef"/>
|
|
|
- <ImportExcel ref="dialogRef"/>
|
|
|
+ <FormDialog ref="formDialogRef" />
|
|
|
+ <ImportExcel ref="dialogRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="tsx" name="TrackSequence">
|
|
|
-import {ref, reactive, onMounted} from 'vue'
|
|
|
-import {useHandleData} from '@/hooks/useHandleData'
|
|
|
-import {useDownload} from '@/hooks/useDownload'
|
|
|
-import {ElMessage, ElMessageBox} from 'element-plus'
|
|
|
+import { ref, reactive, onMounted } from 'vue'
|
|
|
+import { useHandleData } from '@/hooks/useHandleData'
|
|
|
+import { useDownload } from '@/hooks/useDownload'
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import ProTable from '@/components/ProTable/index.vue'
|
|
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
|
|
import FormDialog from '@/components/FormDialog/index.vue'
|
|
|
-import {ProTableInstance, ColumnProps} from '@/components/ProTable/interface'
|
|
|
+import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
|
|
import {
|
|
|
listTrackSequenceApi,
|
|
|
delTrackSequenceApi,
|
|
@@ -91,11 +89,13 @@ import {
|
|
|
stopTrackSequenceApi,
|
|
|
dowloadTrackSequenceApi
|
|
|
} from '@/api/modules/demo/trackSequence'
|
|
|
+import { enumAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
|
|
|
+import { getAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
|
|
|
+import { enumAlgorithmConfigTrackApi } from '@/api/modules/demo/AlgorithmConfigTrack'
|
|
|
+
|
|
|
+import { listDataSeqApi } from '@/api/modules/demo/DataSeq'
|
|
|
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'
|
|
|
-import {AlgorithmType, SubSystem} from "@/views/demo/utils";
|
|
|
+import { AlgorithmType, SubSystem, SubSystem__, enumsAlgorithmType, enumsSubSystem } from '@/views/demo/utils'
|
|
|
|
|
|
const enumsAlgorithmConfigTrack = ref<any>([])
|
|
|
onMounted(async () => {
|
|
@@ -167,7 +167,7 @@ const batchDelete = async (ids: string[]) => {
|
|
|
|
|
|
// 导出注视轨迹序列列表
|
|
|
const downloadFile = async () => {
|
|
|
- ElMessageBox.confirm('确认导出注视轨迹序列数据?', '温馨提示', {type: 'warning'}).then(() =>
|
|
|
+ ElMessageBox.confirm('确认导出注视轨迹序列数据?', '温馨提示', { type: 'warning' }).then(() =>
|
|
|
useDownload(exportTrackSequenceApi, '注视轨迹序列列表', proTable.value?.searchParam)
|
|
|
)
|
|
|
}
|
|
@@ -187,7 +187,7 @@ const batchAdd = () => {
|
|
|
const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
|
|
|
// 打开弹框的功能
|
|
|
const openDialog = async (type: number, title: string, row?: any) => {
|
|
|
- let res = {data: {}}
|
|
|
+ let res = { data: {} }
|
|
|
if (row?.id) {
|
|
|
res = await getTrackSequenceApi(row?.id || null)
|
|
|
}
|
|
@@ -207,8 +207,8 @@ const openDialog = async (type: number, title: string, row?: any) => {
|
|
|
|
|
|
// 表格配置项
|
|
|
const columns = reactive<ColumnProps<any>[]>([
|
|
|
- {type: 'selection', fixed: 'left', width: 70},
|
|
|
- {prop: 'id', label: '主键ID', width: 180},
|
|
|
+ { type: 'selection', fixed: 'left', width: 70 },
|
|
|
+ { prop: 'id', label: '主键ID', width: 180 },
|
|
|
{
|
|
|
prop: 'name',
|
|
|
label: '任务名称',
|
|
@@ -228,10 +228,37 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
width: 150
|
|
|
},
|
|
|
{
|
|
|
- prop: 'algorithmModelId',
|
|
|
- label: '模型id',
|
|
|
+ prop: 'type',
|
|
|
+ label: '类型',
|
|
|
+ tag: true,
|
|
|
+ enum: enumsAlgorithmType,
|
|
|
width: 120
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'subsystem',
|
|
|
+ label: '分系统',
|
|
|
+ tag: true,
|
|
|
+ enum: enumsSubSystem,
|
|
|
+ width: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'algorithmName',
|
|
|
+ label: '算法名称',
|
|
|
+ width: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'modelName',
|
|
|
+ label: '模型名称',
|
|
|
+ width: 200
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // prop: 'algorithmModelId',
|
|
|
+ // label: '模型',
|
|
|
+ // search: {
|
|
|
+ // el: 'input'
|
|
|
+ // },
|
|
|
+ // width: 150
|
|
|
+ // },
|
|
|
{
|
|
|
prop: 'startTime',
|
|
|
label: '开始时间',
|
|
@@ -265,24 +292,9 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
},
|
|
|
width: 120
|
|
|
},
|
|
|
- {prop: 'operation', label: '操作', width: 230, fixed: 'right'}
|
|
|
+ { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
|
|
|
])
|
|
|
|
|
|
-const enumsAlgorithmModelTrack = ref<any>([])
|
|
|
-
|
|
|
-onMounted(async () => {
|
|
|
- const result: any = await enumAlgorithmModelTrackApi();
|
|
|
- // console.log(result.data);
|
|
|
- enumsAlgorithmModelTrack.value = []
|
|
|
-
|
|
|
- for (const item of result.data) {
|
|
|
- if (SubSystem[item['subsystem']] === "注释轨迹序列") {
|
|
|
- item['label'] = item['label'] + '-' + SubSystem[item['subsystem']] + '-' + AlgorithmType[item['type']] + "-" + item['algorithmName'];
|
|
|
- enumsAlgorithmModelTrack.value.push(item)
|
|
|
- }
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
// 表单配置项
|
|
|
let itemsOptions: ProForm.ItemsOptions[] = []
|
|
|
const setItemsOptions = () => {
|
|
@@ -290,15 +302,26 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '任务名称',
|
|
|
prop: 'name',
|
|
|
- rules: [{required: true, message: '任务名称不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
placeholder: '请输入任务名称'
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '选择图片集',
|
|
|
+ prop: 'inputOssId',
|
|
|
+ rules: [{ required: false, message: '图片集不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ elTagName: 'select',
|
|
|
+ placeholder: '请选择或者上传图片集',
|
|
|
+ enum: getImageDataList,
|
|
|
+ clearable: true
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
label: '上传图片集',
|
|
|
prop: 'inputOssId',
|
|
|
- rules: [{required: true, message: '图片集不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: false, message: '图片集不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
elTagName: 'file-upload',
|
|
|
fileSize: 4096,
|
|
@@ -309,7 +332,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '选择模型',
|
|
|
prop: 'algorithmModelId',
|
|
|
- rules: [{required: true, message: '模型不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
elTagName: 'select',
|
|
|
placeholder: '请选择模型',
|
|
@@ -332,16 +355,16 @@ const setItemsOptionsModel = () => {
|
|
|
{
|
|
|
label: '算法ID',
|
|
|
prop: 'algorithmId',
|
|
|
- rules: [{required: true, message: '算法不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
disabled: true,
|
|
|
- placeholder: '请输入算法',
|
|
|
+ placeholder: '请输入算法'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
label: '算法类型',
|
|
|
prop: 'algorithmType',
|
|
|
- rules: [{required: true, message: '算法不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
disabled: true,
|
|
|
elTagName: 'select',
|
|
@@ -352,7 +375,7 @@ const setItemsOptionsModel = () => {
|
|
|
{
|
|
|
label: '算法参数',
|
|
|
prop: 'parameterConfig',
|
|
|
- rules: [{required: true, message: '模型名称不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
placeholder: '请输入模型名称'
|
|
|
}
|
|
@@ -360,7 +383,7 @@ const setItemsOptionsModel = () => {
|
|
|
{
|
|
|
label: '模型ID',
|
|
|
prop: 'id',
|
|
|
- rules: [{required: true, message: '模型名称不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
placeholder: '请输入模型名称'
|
|
|
}
|
|
@@ -368,7 +391,7 @@ const setItemsOptionsModel = () => {
|
|
|
{
|
|
|
label: '模型名称',
|
|
|
prop: 'modelName',
|
|
|
- rules: [{required: true, message: '模型名称不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
placeholder: '请输入模型名称'
|
|
|
}
|
|
@@ -376,7 +399,7 @@ const setItemsOptionsModel = () => {
|
|
|
{
|
|
|
label: '模型保存路径',
|
|
|
prop: 'modelAddress',
|
|
|
- rules: [{required: true, message: '模型名称不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
placeholder: '请输入模型名称'
|
|
|
}
|
|
@@ -384,11 +407,43 @@ const setItemsOptionsModel = () => {
|
|
|
{
|
|
|
label: '备注',
|
|
|
prop: 'remarks',
|
|
|
- rules: [{required: false, message: '备注不能为空', trigger: 'blur'}],
|
|
|
+ rules: [{ required: false, message: '备注不能为空', trigger: 'blur' }],
|
|
|
compOptions: {
|
|
|
placeholder: '请输入备注'
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
+
|
|
|
+const getImageDataList = ref<any>([])
|
|
|
+onMounted(async () => {
|
|
|
+ const qyery = {
|
|
|
+ subsystem: SubSystem__['注释轨迹序列'],
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 25
|
|
|
+ }
|
|
|
+ const result: any = await listDataSeqApi(qyery)
|
|
|
+ const data = result['data']['list']
|
|
|
+ for (const item of data) {
|
|
|
+ getImageDataList.value.push({
|
|
|
+ value: item['inputOssId'],
|
|
|
+ label: item['name']
|
|
|
+ })
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const enumsAlgorithmModelTrack = ref<any>([])
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ const result: any = await enumAlgorithmModelTrackApi()
|
|
|
+ // console.log(result.data);
|
|
|
+ enumsAlgorithmModelTrack.value = []
|
|
|
+
|
|
|
+ for (const item of result.data) {
|
|
|
+ if (SubSystem[item['subsystem']] === '注释轨迹序列') {
|
|
|
+ item['label'] = item['label'] + '-' + SubSystem[item['subsystem']] + '-' + AlgorithmType[item['type']] + '-' + item['algorithmName']
|
|
|
+ enumsAlgorithmModelTrack.value.push(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|
|
|
</script>
|