index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. <!--
  2. @Date: 2024-10-29
  3. @Author: ©WANGKANG
  4. @Email: 1686617586@qq.com
  5. -->
  6. <template>
  7. <div class="table-box">
  8. <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listToInfraredApi">
  9. <!-- 表格 header 按钮 -->
  10. <template #tableHeader="scope">
  11. <el-button type="primary" v-auth="['demo:toInfrared:add']" icon="CirclePlus" @click="openDialog(1, '可见光转红外新增')"> 新增 </el-button>
  12. <!-- <el-button type="primary" v-auth="['demo:toInfrared:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
  13. <el-button type="primary" v-auth="['demo:toInfrared:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button> -->
  14. <el-button
  15. type="danger"
  16. v-auth="['demo:toInfrared:remove']"
  17. icon="Delete"
  18. plain
  19. :disabled="!scope.isSelected"
  20. @click="batchDelete(scope.selectedListIds)"
  21. >
  22. 批量删除
  23. </el-button>
  24. </template>
  25. <!-- 表格操作 -->
  26. <template #operation="scope">
  27. <el-button type="primary" link icon="View" v-if="scope.row.algorithmModelId != null" @click="openModelDialog(scope.row)">
  28. <!--@click="openStartDialog(scope.row)" -->
  29. 详情
  30. </el-button>
  31. <el-button
  32. type="primary"
  33. link
  34. icon="View"
  35. v-auth="['demo:ToInfrared:start']"
  36. v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '4'"
  37. @click="startToInfrared(scope.row)"
  38. >
  39. <!--@click="openStartDialog(scope.row)" -->
  40. 开始
  41. </el-button>
  42. <el-popconfirm title="确定终止此任务吗?" @confirm="stopToInfrared(scope.row)" v-if="scope.row.status == '1'">
  43. <template #reference>
  44. <el-button type="primary" link icon="Delete"> 终止</el-button>
  45. </template>
  46. </el-popconfirm>
  47. <el-button
  48. type="primary"
  49. link
  50. icon="View"
  51. v-auth="['demo:DataSeq:query']"
  52. v-if="scope.row.status == '2' && scope.row.type == AlgorithmType2['预测/推理']"
  53. @click="preview(scope.row)"
  54. >
  55. 预览
  56. </el-button>
  57. <el-button
  58. type="primary"
  59. link
  60. icon="View"
  61. v-auth="['demo:DataSeq:query']"
  62. v-if="scope.row.status == '2' && scope.row.type == AlgorithmType2['预测/推理']"
  63. @click="showStatisticResultRef.get_statistics_result(scope.row.id)"
  64. >
  65. 结果
  66. </el-button>
  67. <el-button
  68. type="primary"
  69. link
  70. icon="View"
  71. v-auth="['demo:ToInfrared:download']"
  72. v-if="scope.row.status == '2'"
  73. @click="dowloadToInfrared(scope.row)"
  74. >
  75. 下载
  76. </el-button>
  77. <el-button
  78. type="primary"
  79. link
  80. icon="View"
  81. v-auth="['demo:ToInfrared:download']"
  82. v-if="scope.row.status == '2' && scope.row.type == AlgorithmType2['训练']"
  83. @click="showToInfraredModel(scope.row.id)"
  84. >
  85. 模型
  86. </el-button>
  87. <el-button
  88. type="primary"
  89. link
  90. icon="View"
  91. v-auth="['demo:toInfrared:query']"
  92. @click="viewLogRef.handleOpen(scope.row.id)"
  93. v-if="scope.row.status != '0'"
  94. >
  95. 日志
  96. </el-button>
  97. <!-- <el-button type="primary" link icon="View" v-auth="['demo:toInfrared:query']" @click="openDialog(3, '查看', scope.row)"> 查看 </el-button> -->
  98. <!-- <el-button type="primary" link icon="EditPen"v-auth="['demo:toInfrared:edit']" @click="openDialog(2, '编辑', scope.row)"> 编辑 </el-button> -->
  99. <el-button
  100. type="primary"
  101. link
  102. icon="Delete"
  103. v-auth="['demo:toInfrared:remove']"
  104. @click="deleteToInfrared(scope.row)"
  105. :disabled="scope.row.status == '1'"
  106. >
  107. 删除
  108. </el-button>
  109. </template>
  110. </ProTable>
  111. <FormDialog ref="formDialogRef" />
  112. <ImportExcel ref="dialogRef" />
  113. <PreviewCompareImages ref="previewImagesRef" />
  114. <ViewLog ref="viewLogRef" :get-log-api="getLogToInfraredApi" />
  115. <ShowStatisticResult ref="showStatisticResultRef" :api="getStatisticsResultToInfraredApi" />
  116. <el-dialog v-model="showModelDialogVisible" title="模型列表" width="900">
  117. <el-scrollbar ref="scrollbarRef" id="scrollbarRef1" height="500px">
  118. <template v-for="model in model_list" :key="model">
  119. <el-card style="width: 100%; margin-bottom: 10px">
  120. <el-form label-width="130px" label-position="left">
  121. <el-form-item label="Model Name">
  122. {{ model.name }}
  123. </el-form-item>
  124. <el-form-item label="Model Path">
  125. {{ model.path }}
  126. </el-form-item>
  127. <el-form-item label="Model Size">
  128. {{ model.size }}
  129. </el-form-item>
  130. <el-form-item label="操作">
  131. <el-link :href="model.url" type="primary" icon="Download" :underline="false" target="_blank" style="margin-right: 20px"
  132. >下载
  133. </el-link>
  134. <el-button type="success" link @click="addToInfraredModel(model.path)"
  135. ><el-icon> <Plus /> </el-icon>添加模型</el-button
  136. >
  137. </el-form-item>
  138. </el-form>
  139. </el-card>
  140. </template>
  141. </el-scrollbar>
  142. </el-dialog>
  143. </div>
  144. </template>
  145. <script setup lang="tsx" name="ToInfrared">
  146. import { ref, reactive, onMounted, Ref, nextTick } from 'vue'
  147. import { useHandleData } from '@/hooks/useHandleData'
  148. import { useDownload } from '@/hooks/useDownload'
  149. import { ElMessage, ElMessageBox } from 'element-plus'
  150. import ProTable from '@/components/ProTable/index.vue'
  151. import ImportExcel from '@/components/ImportExcel/index.vue'
  152. import FormDialog from '@/components/FormDialog/index.vue'
  153. import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
  154. import {
  155. listToInfraredApi,
  156. delToInfraredApi,
  157. addToInfraredApi,
  158. updateToInfraredApi,
  159. importTemplateApi,
  160. importToInfraredDataApi,
  161. exportToInfraredApi,
  162. startToInfraredApi,
  163. stopToInfraredApi,
  164. dowloadToInfraredApi,
  165. getToInfraredApi,
  166. getLogToInfraredApi,
  167. showToInfraredModelApi,
  168. previewPredictResultToInfraredModelApi,
  169. getStatisticsResultToInfraredApi
  170. } from '@/api/modules/demo/toInfrared'
  171. import { getImagesApi, listDataSeqApi } from '@/api/modules/demo/DataSeq'
  172. import { enumAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
  173. import { getAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
  174. import { enumAlgorithmConfigTrackApi } from '@/api/modules/demo/AlgorithmConfigTrack'
  175. import statusEnums from '@/utils/status'
  176. import { AlgorithmType, SubSystem, SubSystem__, enumsAlgorithmType, enumsSubSystem, AlgorithmType2 } from '@/views/demo/utils'
  177. import PreviewCompareImages from '@/views/demo/components/PreviewCompareImages.vue'
  178. import { addAlgorithmModelTrackApi } from '@/api/modules/demo/AlgorithmModelTrack'
  179. import ViewLog from '@/views/demo/components/ViewLog.vue'
  180. import useWebSocketStore from '@/stores/modules/websocket'
  181. import { resetHeart } from '@/utils/websocket'
  182. import ShowStatisticResult from '@/views/demo/components/ShowStatisticResult.vue'
  183. const showStatisticResultRef = ref()
  184. onMounted(() => {
  185. const websocketStore = useWebSocketStore()
  186. websocketStore.websocket.onmessage = (e: any) => {
  187. if (e.data.indexOf('heartbeat') > 0) {
  188. resetHeart()
  189. }
  190. if (e.data.indexOf('ping') > 0) {
  191. return
  192. }
  193. // console.log(e)
  194. proTable.value?.getTableList(true)
  195. }
  196. })
  197. const previewImagesRef = ref()
  198. const dialogVisible = ref(false)
  199. const imageUrls = ref([])
  200. const preview = async row => {
  201. previewImagesRef.value?.handleOpen(previewPredictResultToInfraredModelApi, row.id)
  202. }
  203. const enumsAlgorithmConfigTrack = ref<any>([])
  204. onMounted(async () => {
  205. const result = await enumAlgorithmConfigTrackApi()
  206. enumsAlgorithmConfigTrack.value = []
  207. const tmp_data: any = result['data']
  208. for (const item of tmp_data) {
  209. if (item.subsystem === SubSystem__['可见光转红外'] && item.type === AlgorithmType2['预测/推理']) {
  210. item['label'] = item['label'] + '-' + SubSystem[item['subsystem']] + '-' + AlgorithmType[item['type']]
  211. enumsAlgorithmConfigTrack.value.push(item)
  212. }
  213. }
  214. })
  215. const setItemsOptions222 = () => {
  216. itemsOptions = [
  217. {
  218. label: '算法',
  219. prop: 'algorithmId',
  220. rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
  221. compOptions: {
  222. elTagName: 'select',
  223. placeholder: '请输入算法',
  224. enum: enumsAlgorithmConfigTrack
  225. }
  226. },
  227. {
  228. label: '子系统',
  229. prop: 'subSystem',
  230. rules: [{ required: true, message: '子系统不能为空', trigger: 'blur' }],
  231. compOptions: {
  232. disabled: true,
  233. elTagName: 'select',
  234. placeholder: '请输入子系统',
  235. enum: enumsSubSystem
  236. }
  237. },
  238. {
  239. label: '模型名称',
  240. prop: 'modelName',
  241. rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
  242. compOptions: {
  243. placeholder: '请输入模型名称'
  244. }
  245. },
  246. {
  247. label: '模型路径',
  248. prop: 'modelPath',
  249. rules: [{ required: false, message: '模型文件不能为空', trigger: 'blur' }],
  250. compOptions: {
  251. placeholder: '请输入模型名称',
  252. disabled: true
  253. }
  254. },
  255. {
  256. label: '备注',
  257. prop: 'remarks',
  258. rules: [{ required: false, message: '备注不能为空', trigger: 'blur' }],
  259. compOptions: {
  260. placeholder: '请输入备注'
  261. }
  262. }
  263. ]
  264. }
  265. const addToInfraredModel = async (modelPath: string) => {
  266. let res = { data: { modelPath, subSystem: SubSystem__['可见光转红外'], type: AlgorithmType2['预测/推理'] } }
  267. // 重置表单
  268. setItemsOptions222()
  269. const params = {
  270. title: '添加模型',
  271. width: 580,
  272. isEdit: true,
  273. itemsOptions: itemsOptions,
  274. model: res.data,
  275. api: addAlgorithmModelTrackApi,
  276. getTableList: proTable.value?.getTableList,
  277. closedEvent: async () => {
  278. await updateWnumsAlgorithmModelTrack()
  279. }
  280. }
  281. formDialogRef.value?.openDialog(params)
  282. }
  283. const showModelDialogVisible = ref(false)
  284. const model_list: Ref<any> = ref([
  285. // {
  286. // id: 1,
  287. // name: '1',
  288. // path: '/home/11',
  289. // size: '123123MB',
  290. // url: 'http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip'
  291. // },
  292. // {
  293. // id: 2,
  294. // name: '1',
  295. // path: '/home/11',
  296. // size: '123123MB',
  297. // url: 'http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip'
  298. // },
  299. // {
  300. // id: 3,
  301. // name: '1',
  302. // path: '/home/11',
  303. // size: '123123MB',
  304. // url: 'http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip'
  305. // },
  306. // {
  307. // id: 4,
  308. // name: '1',
  309. // path: '/home/11',
  310. // size: '123123MB',
  311. // url: 'http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip'
  312. // }
  313. ])
  314. const showToInfraredModel = async (id: any) => {
  315. const res: any = await showToInfraredModelApi(id)
  316. model_list.value = res.data
  317. showModelDialogVisible.value = true
  318. }
  319. const viewLogRef = ref()
  320. const openModelDialog = async row => {
  321. const algorithmModelId = row.algorithmModelId
  322. const result: any = await getAlgorithmModelTrackApi(algorithmModelId)
  323. // console.log(result.data)
  324. setItemsOptionsModel()
  325. const params = {
  326. title: '模型',
  327. width: 580,
  328. isEdit: false,
  329. itemsOptions: itemsOptions,
  330. model: result.data,
  331. api: updateToInfraredApi,
  332. getTableList: proTable.value?.getTableList
  333. }
  334. formDialogRef.value?.openDialog(params)
  335. }
  336. const startToInfrared = async (params: any) => {
  337. const res: any = await startToInfraredApi(params.id)
  338. if (res.code === 200) {
  339. ElMessage.success('任务已开始,请等待完成!')
  340. } else {
  341. ElMessage.error('任务开始失败,请检查!')
  342. }
  343. proTable.value?.getTableList()
  344. }
  345. const stopToInfrared = async (params: any) => {
  346. const res: any = await stopToInfraredApi(params.id)
  347. if (res.code === 200) {
  348. ElMessage.success('终止任务成功!')
  349. } else {
  350. ElMessage.error('终止任务失败,请检查!')
  351. }
  352. proTable.value?.getTableList()
  353. }
  354. const dowloadToInfrared = async (params: any) => {
  355. if (params.type == AlgorithmType2['训练']) {
  356. await useDownload(dowloadToInfraredApi, params.name, params.id, true, '.pt')
  357. } else if (params.type == AlgorithmType2['预测/推理']) {
  358. await useDownload(dowloadToInfraredApi, params.name, params.id, true, '.zip')
  359. }
  360. }
  361. const openStartDialog = async (row: any) => {
  362. let res = { data: {} }
  363. if (row?.id) {
  364. res = await getToInfraredApi(row?.id || null)
  365. }
  366. // 重置表单
  367. setItemsOptions2()
  368. const params = {
  369. title: '开始任务',
  370. width: 580,
  371. isEdit: true,
  372. itemsOptions: itemsOptions,
  373. model: res.data,
  374. api: startToInfraredApi,
  375. getTableList: proTable.value?.getTableList
  376. }
  377. formDialogRef.value?.openDialog(params)
  378. }
  379. // ProTable 实例
  380. const proTable = ref<ProTableInstance>()
  381. // 删除可见光转红外信息
  382. const deleteToInfrared = async (params: any) => {
  383. await useHandleData(delToInfraredApi, params.id, '删除【' + params.id + '】可见光转红外')
  384. proTable.value?.getTableList()
  385. }
  386. // 批量删除可见光转红外信息
  387. const batchDelete = async (ids: string[]) => {
  388. await useHandleData(delToInfraredApi, ids, '删除所选可见光转红外信息')
  389. proTable.value?.clearSelection()
  390. proTable.value?.getTableList()
  391. }
  392. // 导出可见光转红外列表
  393. const downloadFile = async () => {
  394. ElMessageBox.confirm('确认导出可见光转红外数据?', '温馨提示', { type: 'warning' }).then(() =>
  395. useDownload(exportToInfraredApi, '可见光转红外列表', proTable.value?.searchParam)
  396. )
  397. }
  398. // 批量添加可见光转红外
  399. const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
  400. const batchAdd = () => {
  401. const params = {
  402. title: '可见光转红外',
  403. tempApi: importTemplateApi,
  404. importApi: importToInfraredDataApi,
  405. getTableList: proTable.value?.getTableList
  406. }
  407. dialogRef.value?.acceptParams(params)
  408. }
  409. const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
  410. // 打开弹框的功能
  411. const openDialog = async (type: number, title: string, row?: any) => {
  412. let res = { data: {} }
  413. if (row?.id) {
  414. res = await getToInfraredApi(row?.id || null)
  415. }
  416. // 重置表单
  417. setItemsOptions()
  418. const params = {
  419. title,
  420. width: 580,
  421. isEdit: type !== 3,
  422. itemsOptions: itemsOptions,
  423. model: type == 1 ? {} : res.data,
  424. api: type == 1 ? addToInfraredApi : updateToInfraredApi,
  425. getTableList: proTable.value?.getTableList,
  426. closedEvent: () => {}
  427. }
  428. formDialogRef.value?.openDialog(params)
  429. }
  430. // 表格配置项
  431. const columns = reactive<ColumnProps<any>[]>([
  432. { type: 'selection', fixed: 'left', width: 70 },
  433. { prop: 'id', label: '主键ID', width: 180 },
  434. {
  435. prop: 'name',
  436. label: '任务名称',
  437. search: {
  438. el: 'input'
  439. },
  440. width: 150
  441. },
  442. {
  443. prop: 'status',
  444. label: '任务状态',
  445. search: {
  446. el: 'select'
  447. },
  448. tag: true,
  449. enum: statusEnums,
  450. width: 150
  451. },
  452. {
  453. prop: 'type',
  454. label: '类型',
  455. tag: true,
  456. enum: enumsAlgorithmType,
  457. width: 120
  458. },
  459. {
  460. prop: 'subsystem',
  461. label: '分系统',
  462. tag: true,
  463. enum: enumsSubSystem,
  464. width: 200
  465. },
  466. {
  467. prop: 'algorithmName',
  468. label: '算法名称',
  469. width: 200
  470. },
  471. {
  472. prop: 'modelName',
  473. label: '模型名称',
  474. width: 200
  475. },
  476. // {
  477. // prop: 'algorithmModelId',
  478. // label: '模型',
  479. // search: {
  480. // el: 'input'
  481. // },
  482. // width: 150
  483. // },
  484. {
  485. prop: 'startTime',
  486. label: '开始时间',
  487. width: 180
  488. },
  489. {
  490. prop: 'endTime',
  491. label: '结束时间',
  492. width: 180
  493. },
  494. {
  495. prop: 'costSecond',
  496. label: '耗时',
  497. width: 120
  498. },
  499. {
  500. prop: 'log',
  501. label: '日志',
  502. width: 120
  503. },
  504. {
  505. prop: 'outputPath',
  506. label: '输出路径',
  507. width: 120
  508. },
  509. {
  510. prop: 'remarks',
  511. label: '备注',
  512. search: {
  513. el: 'input'
  514. },
  515. width: 120
  516. },
  517. { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
  518. ])
  519. // 表单配置项
  520. let itemsOptions: ProForm.ItemsOptions[] = []
  521. const setItemsOptions = () => {
  522. itemsOptions = [
  523. {
  524. label: '任务名称',
  525. prop: 'name',
  526. rules: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
  527. compOptions: {
  528. placeholder: '请输入任务名称'
  529. }
  530. },
  531. {
  532. label: '选择数据集',
  533. prop: 'inputOssId',
  534. rules: [{ required: false, message: '数据集不能为空', trigger: 'blur' }],
  535. compOptions: {
  536. elTagName: 'select',
  537. placeholder: '请选择或者上传数据集',
  538. enum: getImageDataList,
  539. clearable: true
  540. }
  541. },
  542. {
  543. label: '上传数据集',
  544. prop: 'inputOssId',
  545. rules: [{ required: false, message: '数据集不能为空', trigger: 'blur' }],
  546. compOptions: {
  547. elTagName: 'file-upload',
  548. fileSize: 4096,
  549. fileType: ['zip'],
  550. placeholder: '请上传数据集'
  551. }
  552. },
  553. {
  554. label: '选择模型',
  555. prop: 'algorithmModelId',
  556. rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
  557. compOptions: {
  558. elTagName: 'select',
  559. placeholder: '请选择模型',
  560. enum: enumsAlgorithmModelTrack
  561. }
  562. },
  563. {
  564. label: '备注',
  565. prop: 'remarks',
  566. rules: [],
  567. compOptions: {
  568. placeholder: '请输入备注'
  569. }
  570. }
  571. ]
  572. }
  573. const getImageDataList = ref<any>([])
  574. onMounted(async () => {
  575. const qyery = {
  576. subsystem: SubSystem__['可见光转红外'],
  577. pageNum: 1,
  578. pageSize: 25
  579. }
  580. const result: any = await listDataSeqApi(qyery)
  581. const data = result['data']['list']
  582. for (const item of data) {
  583. getImageDataList.value.push({
  584. value: item['inputOssId'],
  585. label: item['name']
  586. })
  587. }
  588. })
  589. const enumsAlgorithmModelTrack = ref<any>([])
  590. const updateWnumsAlgorithmModelTrack = async () => {
  591. const result: any = await enumAlgorithmModelTrackApi()
  592. // console.log(result.data);
  593. enumsAlgorithmModelTrack.value = []
  594. for (const item of result.data) {
  595. if (SubSystem[item['subsystem']] === '可见光转红外') {
  596. item['label'] = item['label'] + '-' + SubSystem[item['subsystem']] + '-' + AlgorithmType[item['type']] + '-' + item['algorithmName']
  597. enumsAlgorithmModelTrack.value.push(item)
  598. }
  599. }
  600. }
  601. onMounted(async () => {
  602. updateWnumsAlgorithmModelTrack()
  603. })
  604. const setItemsOptions2 = () => {
  605. itemsOptions = [
  606. {
  607. label: '任务名称',
  608. prop: 'name',
  609. rules: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
  610. compOptions: {
  611. disabled: true,
  612. placeholder: '请输入任务名称'
  613. }
  614. },
  615. {
  616. label: '选择模型',
  617. prop: 'algorithmModel',
  618. rules: [{ required: true, message: '模型不能为空', trigger: 'blur' }],
  619. compOptions: {
  620. elTagName: 'select',
  621. placeholder: '请选择模型',
  622. enum: enumsAlgorithmModelTrack
  623. }
  624. },
  625. {
  626. label: '备注',
  627. prop: 'remarks',
  628. rules: [],
  629. compOptions: {
  630. placeholder: '请输入备注'
  631. }
  632. }
  633. ]
  634. }
  635. const setItemsOptionsModel = () => {
  636. itemsOptions = [
  637. {
  638. label: '算法ID',
  639. prop: 'algorithmId',
  640. rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
  641. compOptions: {
  642. disabled: true,
  643. placeholder: '请输入算法'
  644. }
  645. },
  646. {
  647. label: '算法类型',
  648. prop: 'algorithmType',
  649. rules: [{ required: true, message: '算法不能为空', trigger: 'blur' }],
  650. compOptions: {
  651. disabled: true,
  652. elTagName: 'select',
  653. placeholder: '请输入算法',
  654. enum: enumsAlgorithmConfigTrack
  655. }
  656. },
  657. {
  658. label: '算法参数',
  659. prop: 'parameterConfig',
  660. rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
  661. compOptions: {
  662. placeholder: '请输入模型名称'
  663. }
  664. },
  665. {
  666. label: '模型ID',
  667. prop: 'id',
  668. rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
  669. compOptions: {
  670. placeholder: '请输入模型名称'
  671. }
  672. },
  673. {
  674. label: '模型名称',
  675. prop: 'modelName',
  676. rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
  677. compOptions: {
  678. placeholder: '请输入模型名称'
  679. }
  680. },
  681. {
  682. label: '模型保存路径',
  683. prop: 'modelAddress',
  684. rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
  685. compOptions: {
  686. placeholder: '请输入模型名称'
  687. }
  688. },
  689. {
  690. label: '备注',
  691. prop: 'remarks',
  692. rules: [{ required: false, message: '备注不能为空', trigger: 'blur' }],
  693. compOptions: {
  694. placeholder: '请输入备注'
  695. }
  696. }
  697. ]
  698. }
  699. </script>