Browse Source

Merge branch 'dev' of git.sagacloud.cn:web/persagy-plan-editer into dev

zhangyu 4 years ago
parent
commit
f092b890dc
2 changed files with 24 additions and 5 deletions
  1. 21 1
      src/store/index.ts
  2. 3 4
      src/views/editer.vue

+ 21 - 1
src/store/index.ts

@@ -109,10 +109,30 @@ export default new Vuex.Store({
                 color: "#1F2429",
                 size: 12,
                 url: "tognyong2020102700.svg",
-                formula: JSON.stringify(['设备实例']),
+                formula: JSON.stringify(["设备实例"]),
             };
             state.styleMap = data;
         },
+        // 初始化 equipItemMap, equipItemNum
+        INITEQUIPMAP(state, data) {
+            if (data && Object.keys(data).length) {
+                state.equipItemMap = data;
+                state.equipItemNum = Object.keys(data).length;
+            } else {
+                state.equipItemMap = {};
+                state.equipItemNum = 0;
+            }
+        },
+        // 初始化 zoneIteMap, zoneIteMap
+        INITZONEMAP(state, data) {
+            if (data && Object.keys(data).length) {
+                state.zoneIteMap = data;
+                state.zoneItemNum = Object.keys(data).length;
+            } else {
+                state.zoneIteMap = {};
+                state.zoneItemNum = 0;
+            }
+        },
         // 添加样式信息
         ADDSTYLE(state, data) {
             // @ts-ignore

+ 3 - 4
src/views/editer.vue

@@ -5,9 +5,6 @@
                 <div class="project-name">{{ name }}</div>
                 <div class="project-type">/ {{ floorLocalName }}({{ folderName }})</div>
                 <div class="project-save">自动保存成功- v {{ version }}</div>
-                <!-- TODO:  -->
-                <!-- <img src="../assets/images/aaa.svg" /> -->
-
             </div>
             <div class="right">
                 <el-tooltip class="item" effect="dark" content="下载" placement="bottom">
@@ -37,7 +34,7 @@ export default {
         };
     },
     methods: {
-        ...mapMutations(["SETPROJECT"]),
+        ...mapMutations(["SETPROJECT", "INITEQUIPMAP"]),
         // 保存图片
         saveTopo() {
             bus.$emit("saveTopo");
@@ -68,6 +65,8 @@ export default {
         ]),
     },
     created() {
+        window.vm = this;
+        this.INITEQUIPMAP();
         this.SETPROJECT(this.$route.query);
     },
 };