Sfoglia il codice sorgente

feat 添加配置文件,方便在阿里云测试环境,更改设备图片

yunxing 4 anni fa
parent
commit
622db596d9

+ 18 - 14
public/index.html

@@ -1,17 +1,21 @@
 <!DOCTYPE html>
 <html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= htmlWebpackPlugin.options.title %></title>
-  </head>
-  <body>
-    <noscript>
-      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
+    <head>
+        <meta charset="utf-8" />
+        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+        <meta name="viewport" content="width=device-width,initial-scale=1.0" />
+        <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
+        <title><%= htmlWebpackPlugin.options.title %></title>
+        <script src="<%= BASE_URL %>systemConf.js"></script>
+    </head>
+    <body>
+        <noscript>
+            <strong
+                >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to
+                continue.</strong
+            >
+        </noscript>
+        <div id="app"></div>
+        <!-- built files will be auto injected -->
+    </body>
 </html>

+ 22 - 0
public/systemConf.js

@@ -0,0 +1,22 @@
+/**
+ * @author yunxing
+ * @description 项目配置文件
+ */
+var __systemConf = {
+    // 系统编码
+    systemCode: "wandaTopological",
+    conf: {},
+    imgKey: [
+        // 开发环境
+        "8bec0771df4c459bb6e692a7eee18d22",
+        "d0a5e641e789480e84c8c4f60fbe1c80",
+        "270abb1b84d5416fa059b68d1f51ac33",
+        "ece9f93ffc754035bcec2e8f27d66a59",
+        // 阿里云
+        // "f55f6b82120349fb9e6ed73d6358904d",
+        // "2e1f990306b4464292e1c855cf2ac1f6",
+        // "094ac0cea076454d9eb76fada8dcc3be",
+        // "7785fb244b5945b9b4173a485e712eff",
+    ],
+};
+window.__systemConf = __systemConf;

+ 3 - 2
src/components/baseEditer.vue

@@ -416,6 +416,7 @@ export default {
                 // console.log("addEquip");
                 const parserData = new SEquipmentParser(null);
                 //
+                let imgKey = window.__systemConf.imgKey;
                 let Nodes = [
                     {
                         ID: "123123", // ID
@@ -454,7 +455,7 @@ export default {
                             StatusImage: [
                                 {
                                     Status: "Running", // 运行
-                                    ImageKey: "8bec0771df4c459bb6e692a7eee18d22"
+                                    ImageKey: imgKey[0]
                                 },
                                 {
                                     Status: "Stop", // 停止
@@ -496,7 +497,7 @@ export default {
                             StatusImage: [
                                 {
                                     Status: "Running", // 运行
-                                    ImageKey: "d0a5e641e789480e84c8c4f60fbe1c80"
+                                    ImageKey: imgKey[1]
                                 }
                             ]
                         } // 由应用自己定义

+ 5 - 3
src/components/mapClass/EditScence.ts

@@ -1421,6 +1421,8 @@ export class EditScence extends SGraphScene {
         //  4aa6051e025d4193a776a5b2d2604ed8 //冷却塔1
         //  ece9f93ffc754035bcec2e8f27d66a59 //冷却塔2
         */
+        // @ts-ignore
+        let imgKey = window.__systemConf.imgKey;
         let data = {
             ID: uuid(), // ID
             Name: "3#冷冻泵", // 名称
@@ -1457,15 +1459,15 @@ export class EditScence extends SGraphScene {
                 StatusImage: [
                     {
                         Status: "Running", // 运行
-                        ImageKey: "14d978b7edd346f088d6cfb53ada4070",
+                        ImageKey: imgKey[0],
                     },
                     {
                         Status: "Stop", // 停止
-                        ImageKey: "4aa6051e025d4193a776a5b2d2604ed8",
+                        ImageKey: imgKey[1] || "",
                     },
                     {
                         Status: "Selected", // 选择
-                        ImageKey: "ece9f93ffc754035bcec2e8f27d66a59",
+                        ImageKey: imgKey[2] || "",
                     },
                     {
                         Status: "Warning", // 报警