tangning 4 mesi fa
parent
commit
a3f62b726e
2 ha cambiato i file con 52 aggiunte e 18 eliminazioni
  1. 11 0
      src/api/operate/index.ts
  2. 41 18
      src/views/productOperation/cameraScene.vue

+ 11 - 0
src/api/operate/index.ts

@@ -92,6 +92,7 @@ enum Api {
   userShareAdd = '/service/manage/jy/userShare/add',
   sceneList = '/service/manage/jy/userShare/sceneList',
   getCaseByNum = '/service/manage/case/getCaseByNum',
+  getSceneBuildLog = '/service/manage/scene/getSceneBuildLog/',
 }
 
 /**
@@ -700,3 +701,13 @@ export const buildSceneObj = (params) =>
       ignoreCancelToken: true,
     },
   });
+
+export const getSceneBuildLog = (num) =>
+  defHttp.get<Result>({
+    url: Api.getSceneBuildLog + num,
+    params: {},
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

+ 41 - 18
src/views/productOperation/cameraScene.vue

@@ -61,6 +61,11 @@
             <span v-else-if="record.sceneName">{{ record.sceneName }}</span>
             <span v-else>-</span>
           </template>
+          
+          <template #status="{ record }">
+            <a v-if="record.status==-1" @click="hanleDowm(record.num)">计算失败</a>
+            <span v-else>{{record.payStatus == -2 ? '封存' : record.statusString}}</span>
+          </template>
           <template #action="{ record }">
             <TableAction
               v-if="!record.isShare"
@@ -217,6 +222,7 @@
     sceneDetail,
     sceneCount,
     getCaseByNum,
+    getSceneBuildLog,
   } from '/@/api/operate';
   import { message } from 'ant-design-vue';
   import { usePermissionStore } from '/@/store/modules/permission';
@@ -285,25 +291,26 @@
         {
           title: '状态',
           dataIndex: 'status',
+          slots: { customRender: 'status' },
           width: 80,
-          customRender: ({ record }) => {
-            let str;
-            switch (record.status - 0) {
-              case 0:
-                str = '计算中';
-                break;
-              case 1:
-                str = '计算成功';
-                break;
-              case -2:
-                str = '计算成功';
-                break;
-              case -1:
-                str = '计算失败';
-                break;
-            }
-            return record.payStatus == -2 ? '封存' : str;
-          },
+          // customRender: ({ record }) => {
+          //   let str;
+          //   switch (record.status - 0) {
+          //     case 0:
+          //       str = '计算中';
+          //       break;
+          //     case 1:
+          //       str = '计算成功';
+          //       break;
+          //     case -2:
+          //       str = '计算成功';
+          //       break;
+          //     case -1:
+          //       str = '计算失败';
+          //       break;
+          //   }
+          //   return record.payStatus == -2 ? '封存' : str;
+          // },
         },
         {
 
@@ -658,6 +665,11 @@
       function handleEdit(record: Recordable) {
         window.open(record.thumbEdit + '&&token=' + token.value);
       }
+      function hanleDowm(num) {
+        getSceneBuildLog(num).then(res =>{
+          window.open(res);
+        })
+      }
       async function handleGenerate(record: Recordable) {
         console.log('record', record);
         let data = await sceneDetail({ id: record.id });
@@ -703,6 +715,15 @@
         let myType = tableType.value;
         return getCheckPerm(val) || getCheckPerm(`${val}-${myType}`);
       }
+      function getStatus(val) {
+        let obj = {
+          0 : '计算中',
+          1 : '计算成功',
+          '-2' : '计算成功',
+          '-1' : '计算失败',
+        }
+        return obj[val]
+      }
       function handlegotoEdit(record: Recordable) {
         let url = record.webSite.replace('smg', 'epg');
         if (!record.editAuthTime || (record.editAuthTime && dayjs() < dayjs(record.editAuthTime))) {
@@ -770,6 +791,8 @@
         handlePowers,
         userInfo,
         qrCodeUrl,
+        getStatus,
+        hanleDowm
       };
     },
   });