Browse Source

联调完成面包屑

YaolongHan 4 years ago
parent
commit
927d2e0612

+ 1 - 1
src/components/editview/baseTopoEditer.vue

@@ -209,7 +209,7 @@ export default {
     // 读图成功回调
     getDataSuc(res) {
       if (res.result == "failure") return;
-      this.SETCATEGROY(res.content.categoryId);
+      this.SETCATEGROY(res.content);
       this.topoContent = res.content;
       const parse = new PTopoParser();
       parse.parseData(res.content.elements);

+ 2 - 1
src/components/editview/topoEditer.vue

@@ -26,9 +26,10 @@ export default {
   data() {
     return {
       view: null,
-      scene: null
+      scene: null,
     };
   },
+
 };
 </script>
 <style lang="less">

+ 5 - 1
src/store/index.ts

@@ -12,6 +12,8 @@ export default new Vuex.Store({
     isPub: 0,     // 用于读图 区分读取 已发布 or 未发布
     projectId: 'Pj1101050029',  // projectId
     categoryId: '',   //类型id 用于读图
+    tupoName: '',  //拓扑图名称
+    version: "", //版本号
     equipmentList: []  //图上所有设备数组
   },
   mutations: {
@@ -35,7 +37,9 @@ export default new Vuex.Store({
     },
     // 设置类型id
     SETCATEGROY(state, val) {
-      state.categoryId = val
+      state.categoryId = val.categoryId;
+      state.tupoName = val.name;  //拓扑图名称
+      state.version = val.version; //版本号
     },
     // 设置设备 list
     SETEQUIPLIST(state, val) {

+ 16 - 7
src/views/editer.vue

@@ -2,9 +2,9 @@
   <div class="editer">
     <div class="top-bar">
       <div class="left">
-        <div class="project-name">项目名称***</div>
-        <div class="project-type">/ 项目分类</div>
-        <div class="project-save">自动保存成功-V2.2</div>
+        <div class="project-name">{{ tupoName }}</div>
+        <div class="project-type">/ {{ categoryName }}</div>
+        <div class="project-save">自动保存成功- v {{ version }}</div>
       </div>
       <div class="right">
         <img @click="saveTopoImg" src="./../assets/images/download.png" alt />
@@ -18,10 +18,13 @@
 <script>
 import topoEditer from "@/components/editview/topoEditer.vue";
 import bus from "@/bus/bus";
+import { mapState } from "vuex";
 export default {
   components: { topoEditer },
   data() {
-    return {};
+    return {
+      categoryName: "", //项目分类
+    };
   },
   methods: {
     // 保存图片
@@ -33,9 +36,15 @@ export default {
       bus.$emit("issueTopo");
     },
     // 下载图片
-    saveTopoImg(){
-      bus.$emit("saveTopoImg")
-    }
+    saveTopoImg() {
+      bus.$emit("saveTopoImg");
+    },
+  },
+  computed: {
+    ...mapState(["tupoName", "version"]),
+  },
+  mounted() {
+    this.categoryName = decodeURI(this.$route.query.categoryName);
   },
 };
 </script>