瀏覽代碼

feat: 可见光转红外添加模型列表

WANGKANG 8 月之前
父節點
當前提交
9ea6ab1331
共有 2 個文件被更改,包括 82 次插入2 次删除
  1. 4 0
      src/api/modules/demo/toInfrared.ts
  2. 78 2
      src/views/demo/toInfrared/index.vue

+ 4 - 0
src/api/modules/demo/toInfrared.ts

@@ -88,3 +88,7 @@ export const dowloadToInfraredApi = (id: string | number): Promise<any> => {
 export const getLogToInfraredApi = (id: string | number) => {
   return http.get('/demo/toInfrared/log/' + id, {}, { loading: false })
 }
+
+export const showToInfraredModelApi = (id: string | number) => {
+  return http.get('/demo/toInfrared/model/' + id, {}, { loading: false })
+}

+ 78 - 2
src/views/demo/toInfrared/index.vue

@@ -59,6 +59,16 @@
         >
           下载
         </el-button>
+        <el-button
+          type="primary"
+          link
+          icon="View"
+          v-auth="['demo:ToInfrared:download']"
+          v-if="scope.row.status == '2'"
+          @click="showToInfraredModel(scope.row.id)"
+        >
+          模型
+        </el-button>
         <el-button
           type="primary"
           link
@@ -87,11 +97,38 @@
     <ImportExcel ref="dialogRef" />
     <PreviewImages :visible="dialogVisible" :urls="imageUrls" @close="dialogVisible = false" />
     <ViewLog ref="viewLogRef" :get-log-api="getLogToInfraredApi" />
+    <el-dialog v-model="showModelDialogVisible" title="模型列表" width="900">
+      <el-scrollbar ref="scrollbarRef" id="scrollbarRef1" height="500px">
+        <template v-for="model in model_list" :key="model">
+          <el-card style="width: 100%; margin-bottom: 10px">
+            <el-form label-width="130px" label-position="left">
+              <el-form-item label="Model Name">
+                {{ model.name }}
+              </el-form-item>
+              <el-form-item label="Model Path">
+                {{ model.path }}
+              </el-form-item>
+              <el-form-item label="Model Size">
+                {{ model.size }}
+              </el-form-item>
+              <el-form-item label="操作">
+                <el-link :href="model.url" type="primary" icon="Download" :underline="false" target="_blank" style="margin-right: 20px"
+                  >下载
+                </el-link>
+                <el-button type="success" link @click="1"
+                  ><el-icon><Plus /></el-icon>添加模型</el-button
+                >
+              </el-form-item>
+            </el-form>
+          </el-card>
+        </template>
+      </el-scrollbar>
+    </el-dialog>
   </div>
 </template>
 
 <script setup lang="tsx" name="ToInfrared">
-import { ref, reactive, onMounted } from 'vue'
+import { ref, reactive, onMounted, Ref } from 'vue'
 import { useHandleData } from '@/hooks/useHandleData'
 import { useDownload } from '@/hooks/useDownload'
 import { ElMessage, ElMessageBox } from 'element-plus'
@@ -111,7 +148,8 @@ import {
   stopToInfraredApi,
   dowloadToInfraredApi,
   getToInfraredApi,
-  getLogToInfraredApi
+  getLogToInfraredApi,
+  showToInfraredModelApi
 } from '@/api/modules/demo/toInfrared'
 
 import { getImagesApi, listDataSeqApi } from '@/api/modules/demo/DataSeq'
@@ -126,6 +164,44 @@ import { Row } from 'element-plus/es/components/table-v2/src/components'
 
 import ViewLog from '@/views/demo/components/ViewLog.vue'
 
+const showModelDialogVisible = ref(false)
+const model_list: Ref<any> = ref([
+  // {
+  //   id: 1,
+  //   name: '1',
+  //   path: '/home/11',
+  //   size: '123123MB',
+  //   url: 'http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip'
+  // },
+  // {
+  //   id: 2,
+  //   name: '1',
+  //   path: '/home/11',
+  //   size: '123123MB',
+  //   url: 'http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip'
+  // },
+  // {
+  //   id: 3,
+  //   name: '1',
+  //   path: '/home/11',
+  //   size: '123123MB',
+  //   url: 'http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip'
+  // },
+  // {
+  //   id: 4,
+  //   name: '1',
+  //   path: '/home/11',
+  //   size: '123123MB',
+  //   url: 'http://localhost:9090/profile/upload/2024/10/27/1_1729404909511_20241027153840A001.zip'
+  // }
+])
+
+const showToInfraredModel = async (id: any) => {
+  const res: any = await showToInfraredModelApi(id)
+  model_list.value = res.data
+  showModelDialogVisible.value = true
+}
+
 const viewLogRef = ref()
 
 const dialogVisible = ref(false)