|
@@ -3,7 +3,9 @@
|
|
|
<ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listToInfraredApi">
|
|
|
<!-- 表格 header 按钮 -->
|
|
|
<template #tableHeader="scope">
|
|
|
- <el-button type="primary" v-auth="['demo:toInfrared:add']" icon="CirclePlus" @click="openDialog(1, '可见光转红外新增')"> 新增 </el-button>
|
|
|
+ <el-button type="primary" v-auth="['demo:toInfrared:add']" icon="CirclePlus" @click="openDialog(1, '可见光转红外新增')">
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
<!-- <el-button type="primary" v-auth="['demo:toInfrared:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
|
|
|
<el-button type="primary" v-auth="['demo:toInfrared:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button> -->
|
|
|
<el-button
|
|
@@ -36,7 +38,7 @@
|
|
|
</el-button>
|
|
|
<el-popconfirm title="确定终止此任务吗?" @confirm="stopToInfrared(scope.row)" v-if="scope.row.status == '1'">
|
|
|
<template #reference>
|
|
|
- <el-button type="primary" link icon="Delete"> 终止 </el-button>
|
|
|
+ <el-button type="primary" link icon="Delete"> 终止</el-button>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
<el-button
|
|
@@ -63,20 +65,20 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</ProTable>
|
|
|
- <FormDialog ref="formDialogRef" />
|
|
|
- <ImportExcel ref="dialogRef" />
|
|
|
+ <FormDialog ref="formDialogRef"/>
|
|
|
+ <ImportExcel ref="dialogRef"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="tsx" name="ToInfrared">
|
|
|
-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 {
|
|
|
listToInfraredApi,
|
|
|
delToInfraredApi,
|
|
@@ -90,17 +92,17 @@ import {
|
|
|
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 {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'
|
|
|
+import {AlgorithmType, SubSystem} from "@/views/demo/utils";
|
|
|
|
|
|
const openModelDialog = async row => {
|
|
|
const algorithmModelId = row.algorithmModelId
|
|
|
const result: any = await getAlgorithmModelTrackApi(algorithmModelId)
|
|
|
|
|
|
// console.log(result.data)
|
|
|
-
|
|
|
setItemsOptionsModel()
|
|
|
const params = {
|
|
|
title: '模型',
|
|
@@ -138,7 +140,7 @@ const dowloadToInfrared = async (params: any) => {
|
|
|
}
|
|
|
|
|
|
const openStartDialog = async (row: any) => {
|
|
|
- let res = { data: {} }
|
|
|
+ let res = {data: {}}
|
|
|
if (row?.id) {
|
|
|
res = await getToInfraredApi(row?.id || null)
|
|
|
}
|
|
@@ -174,7 +176,7 @@ const batchDelete = async (ids: string[]) => {
|
|
|
|
|
|
// 导出可见光转红外列表
|
|
|
const downloadFile = async () => {
|
|
|
- ElMessageBox.confirm('确认导出可见光转红外数据?', '温馨提示', { type: 'warning' }).then(() =>
|
|
|
+ ElMessageBox.confirm('确认导出可见光转红外数据?', '温馨提示', {type: 'warning'}).then(() =>
|
|
|
useDownload(exportToInfraredApi, '可见光转红外列表', proTable.value?.searchParam)
|
|
|
)
|
|
|
}
|
|
@@ -194,7 +196,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 getToInfraredApi(row?.id || null)
|
|
|
}
|
|
@@ -214,8 +216,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: '任务名称',
|
|
@@ -275,7 +277,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
},
|
|
|
width: 120
|
|
|
},
|
|
|
- { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
|
|
|
+ {prop: 'operation', label: '操作', width: 230, fixed: 'right'}
|
|
|
])
|
|
|
// 表单配置项
|
|
|
let itemsOptions: ProForm.ItemsOptions[] = []
|
|
@@ -284,7 +286,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '任务名称',
|
|
|
prop: 'name',
|
|
|
- rules: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
|
|
+ rules: [{required: true, message: '任务名称不能为空', trigger: 'blur'}],
|
|
|
compOptions: {
|
|
|
placeholder: '请输入任务名称'
|
|
|
}
|
|
@@ -292,7 +294,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '上传图片集',
|
|
|
prop: 'inputOssId',
|
|
|
- rules: [{ required: true, message: '图片集不能为空', trigger: 'blur' }],
|
|
|
+ rules: [{required: true, message: '图片集不能为空', trigger: 'blur'}],
|
|
|
compOptions: {
|
|
|
elTagName: 'file-upload',
|
|
|
fileSize: 4096,
|
|
@@ -303,7 +305,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '选择模型',
|
|
|
prop: 'algorithmModelId',
|
|
|
- rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
|
|
|
+ rules: [{required: true, message: '模型不能为空', trigger: 'blur'}],
|
|
|
compOptions: {
|
|
|
elTagName: 'select',
|
|
|
placeholder: '请选择模型',
|
|
@@ -324,7 +326,15 @@ const setItemsOptions = () => {
|
|
|
const enumsAlgorithmModelTrack = ref<any>([])
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- enumsAlgorithmModelTrack.value = (await enumAlgorithmModelTrackApi()).data
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
const setItemsOptions2 = () => {
|
|
@@ -332,7 +342,7 @@ const setItemsOptions2 = () => {
|
|
|
{
|
|
|
label: '任务名称',
|
|
|
prop: 'name',
|
|
|
- rules: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
|
|
+ rules: [{required: true, message: '任务名称不能为空', trigger: 'blur'}],
|
|
|
compOptions: {
|
|
|
disabled: true,
|
|
|
placeholder: '请输入任务名称'
|
|
@@ -341,7 +351,7 @@ const setItemsOptions2 = () => {
|
|
|
{
|
|
|
label: '选择模型',
|
|
|
prop: 'algorithmModel',
|
|
|
- rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
|
|
|
+ rules: [{required: true, message: '模型不能为空', trigger: 'blur'}],
|
|
|
compOptions: {
|
|
|
elTagName: 'select',
|
|
|
placeholder: '请选择模型',
|
|
@@ -362,9 +372,75 @@ const setItemsOptions2 = () => {
|
|
|
const enumsAlgorithmConfigTrack = ref<any>([])
|
|
|
onMounted(async () => {
|
|
|
const result = await enumAlgorithmConfigTrackApi()
|
|
|
- // console.log(result)
|
|
|
- // console.log(result['data'])
|
|
|
enumsAlgorithmConfigTrack.value = result['data']
|
|
|
+ for (const item of enumsAlgorithmConfigTrack.value) {
|
|
|
+ item['label'] = item['label'] + '-' + SubSystem[item['subsystem']] + '-' + AlgorithmType[item['type']];
|
|
|
+ }
|
|
|
return result['data']
|
|
|
})
|
|
|
+
|
|
|
+const setItemsOptionsModel = () => {
|
|
|
+ itemsOptions = [
|
|
|
+ {
|
|
|
+ label: '算法ID',
|
|
|
+ prop: 'algorithmId',
|
|
|
+ rules: [{required: true, message: '算法不能为空', trigger: 'blur'}],
|
|
|
+ compOptions: {
|
|
|
+ disabled: true,
|
|
|
+ placeholder: '请输入算法',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 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>
|