YaolongHan 4 роки тому
батько
коміт
a9f1e3f889
2 змінених файлів з 47 додано та 122 видалено
  1. 0 4
      src/components/baseEditer.vue
  2. 47 118
      src/views/drafts.vue

+ 0 - 4
src/components/baseEditer.vue

@@ -372,10 +372,6 @@ export default {
       obj[arr[0]] = arr[1];
     });
     this.urlMsg = obj;
-    /**
- * obj:
-
- */
   }
 };
 </script>

+ 47 - 118
src/views/drafts.vue

@@ -3,9 +3,8 @@
     <div class="tit">草稿箱</div>
     <div class="conent">
       <div class="left-nav">
-<!--        <Tree :data="treeData" @change="change"></Tree>-->
+        <!--        <Tree :data="treeData" @change="change"></Tree>-->
         <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
-
       </div>
       <div class="conent-right">
         <div class="conent-tit">
@@ -58,7 +57,12 @@ import { SFloorParser } from "@saga-web/big";
 import { FloorView } from "./../lib/FloorView";
 import { EditScence } from "@/components/mapClass/EditScence";
 import bus from "@/bus";
-import { saveGroup, readGroup,queryDraftGroup,queryStatistic } from "@/api/editer.js";
+import {
+  saveGroup,
+  readGroup,
+  queryDraftGroup,
+  queryStatistic
+} from "@/api/editer.js";
 import { STopologyParser } from "./../lib/parsers/STopologyParser";
 import { uuid } from "@/components/mapClass/until";
 import { SImageItem } from "@saga-web/graph/lib";
@@ -108,9 +112,10 @@ export default {
       key: "23f30a832a862c58637a4aadbf50a566",
       appName: "万达可视化系统",
       defaultProps: {
-        children: 'Category',
-        label: 'Name'
-      }
+        children: "Category",
+        label: "Gcode"
+      },
+      projectId: "" //项目id
     };
   },
   methods: {
@@ -196,117 +201,41 @@ export default {
         }
       }
     },
-    getTreeData(){
-      queryDraftGroup({projectId:'1000423'}).then(res=>{
+    getTreeData() {
+      queryDraftGroup({ projectId: this.projectId }).then(res => {
         console.log(res);
-      })
-      let res = {
-                "Data": [
-                  {
-                    "Category": [
-                      {
-                        "Code": "F6",
-                        "Gcode": "6F",
-                        "Gname": "f6",
-                        "Name": "第6层"
-                      }
-                    ],
-                    "Id": "LCGN",
-                    "Name": "楼层功能"
-                  },
-                  {
-                    "Category": [
-                      {
-                        "Category": [
-                          {
-                            "Code": "F1",
-                            "Gcode": "1F",
-                            "Gname": "f1",
-                            "Name": "第1层"
-                          }
-                        ],
-                        "Id": "GDXT",
-                        "Name": "供电系统"
-                      },
-                      {
-                        "Category": [],
-                        "Id": "NTXT",
-                        "Name": "暖通系统"
-                      },
-                      {
-                        "Category": [],
-                        "Id": "XFXT",
-                        "Name": "消防系统"
-                      },
-                      {
-                        "Category": [],
-                        "Id": "RDXT",
-                        "Name": "弱电系统"
-                      },
-                      {
-                        "Category": [],
-                        "Id": "JPSXT",
-                        "Name": "给排水系统"
-                      },
-                      {
-                        "Category": [],
-                        "Id": "DTXT",
-                        "Name": "电梯系统"
-                      },
-                      {
-                        "Category": [],
-                        "Id": "RQXT",
-                        "Name": "燃气系统"
-                      }
-                    ],
-                    "Id": "LCFB",
-                    "Name": "楼层分布"
-                  },
-                  {
-                    "Category": [],
-                    "Id": "SCPZ",
-                    "Name": "石材铺装(土建装饰)"
-                  },
-                  {
-                    "Category": [
-                      {
-                        "Category": [],
-                        "Id": "FZQZL",
-                        "Name": "分支器支路分布图(暖通系统)"
-                      },
-                      {
-                        "Category": [],
-                        "Id": "XFBFYCFL",
-                        "Name": "消防泵房引出管路分布图(消防系统)"
-                      }
-                    ],
-                    "Id": "XTYLT",
-                    "Name": "系统原理图"
-                  }
-                ],
-                "Message": "",
-                "Result": "success"
-              };
-      this.treeData = res.Data;
+        if (res.Result == "success") {
+          this.treeData = res.Data;
+        } else {
+          this.treeData = [];
+        }
+      });
     },
-    getLegend(){
-      queryStatistic({}).then(res=>{
-
-      })
+    getLegend() {
+      queryStatistic({}).then(res => {});
     }
   },
   mounted() {
-    this.getTreeData();
-    // this.canvasWidth = this.$refs.graphy.offsetWidth;
-    // this.canvasHeight = this.$refs.graphy.offsetHeight - 10;
-    this.urlMsg = {
-      categoryId: "SCPZ",
-      projectId: "1000423",
-      BuildingID: "1",
-      FloorID: "f1",
-      fmapID: "1000423_120"
-    };
+    // // this.canvasWidth = this.$refs.graphy.offsetWidth;
+    // // this.canvasHeight = this.$refs.graphy.offsetHeight - 10;
+
+    const href = window.location.href;
+    let params = href.split("?")[1];
+    if (!params) {
+      // 参数有问题
+      return false;
+    }
+    params = decodeURIComponent(params);
+    const paramsArr = params.split("&");
+    const obj = {};
+    paramsArr.map(item => {
+      const arr = item.split("=");
+      obj[arr[0]] = arr[1];
+    });
+    console.log('obj',obj)
+    this.projectId = obj.projectId ?obj.projectId : '1000423';
     this.init();
+    this.getTreeData();
   }
 };
 </script>
@@ -337,14 +266,14 @@ export default {
       height: 100%;
       overflow-y: scroll;
       padding: 0 12px;
-      /deep/ .el-tree{
-        background: #F7F9FA;
-        .el-tree-node__content{
+      /deep/ .el-tree {
+        background: #f7f9fa;
+        .el-tree-node__content {
           height: 38px;
         }
-        /deep/.el-tree-node:focus >.el-tree-node__content {
-          background-color: #E1F2FF!important;
-          color: #0091FF!important;
+        /deep/.el-tree-node:focus > .el-tree-node__content {
+          background-color: #e1f2ff !important;
+          color: #0091ff !important;
         }
       }
     }
@@ -378,7 +307,7 @@ export default {
         .map {
           flex: 1;
           position: relative;
-        height: 100%;
+          height: 100%;
           /*height: calc(100% - 61px);*/
           /*background: red;*/
           .legend-btn {