Quellcode durchsuchen

增加查看公司链接和地球视角查看

louhangfei vor 2 Jahren
Ursprung
Commit
52b8f0c9e6

+ 12 - 11
src/views/system-config/scene-manage/SceneManage.vue

@@ -23,14 +23,17 @@
         style="height: 800px"
       >
         <template #tableTitle>
-          <el-button type="primary" @click="companyAdd">
-            <template #icon>
-              <el-icon>
-                <Plus />
-              </el-icon>
-            </template>
-            添加
-          </el-button>
+          <div>
+            <el-button type="primary" @click="companyAdd" style="margin-right: 40px">
+              <template #icon>
+                <el-icon>
+                  <Plus />
+                </el-icon>
+              </template>
+              添加
+            </el-button>
+            <a href="/skyeye-world" target="_blank">地球视角查看</a>
+          </div>
         </template>
         <template #empty>
           <div class="empty-content flex flex-col items-center">
@@ -91,7 +94,7 @@
     findItemLevel,
     removeParent,
     flattenCodes,
-  } from './use-method';
+  } from './use-method.tsx';
   import {
     ComAddDatas,
     delCompany,
@@ -246,8 +249,6 @@
         principal: '',
       };
       showDrawer.value = DrawerType.workspace;
-    } else {
-      return;
     }
   };
 

+ 25 - 0
src/views/system-config/scene-manage/use-method.ts

@@ -5,11 +5,36 @@ import {
   LabelModuleListType,
 } from '@/api/scene/sceneOperate';
 import { WorkShopTempleteType } from '@/api/scene/secene-templet';
+// skyeyev3pc/#/company?companyId=117&labelId=2
 
 export const colomns = [
   { label: '场景名称', prop: 'name', width: 300 },
   { label: '场景标签', prop: 'labelName', width: 300 },
   { label: '代码', prop: 'code' },
+  {
+    label: '预览',
+    prop: 'preview',
+    render: ({ row, column }) => {
+      console.log('record row', row);
+      console.log('record', column);
+      if (!row.parent && row.labelList[0]?.id) {
+        return (
+          <a
+            href={`/skyeyev3pc/#/company?companyId=${row.id}&labelId=${row.labelList[0]?.id}`}
+            target="_blank"
+          >
+            公司预览
+          </a>
+        );
+      } else if (row.parent && !row.parent.parent) {
+        return (
+          <a href={`/skyeyev3pc/#/shop?id=${row.id}`} target="_blank">
+            车间预览
+          </a>
+        );
+      }
+    },
+  },
 ];
 
 interface DataSourceUser

+ 1 - 0
tsconfig.json

@@ -16,6 +16,7 @@
     "noUnusedLocals": true,
     "noUnusedParameters": true,
     "experimentalDecorators": true,
+    "allowImportingTsExtensions": true,
     "lib": [
       "dom",
       "esnext"