Browse Source

合并代码

fujunwen 4 years ago
parent
commit
531b814e57
100 changed files with 37547 additions and 649 deletions
  1. 3 0
      .gitignore
  2. 58 50
      package.json
  3. 70 1
      public/index.html
  4. 6 4
      public/systemConf.js
  5. 135 93
      src/App.vue
  6. 11 3
      src/api/coreDeviceReport.js
  7. 34 0
      src/api/homePage.js
  8. 9 23
      src/api/httputils.js
  9. 22 53
      src/api/legendLibrary.js
  10. 1 1
      src/api/login.js
  11. 1 1
      src/api/overview.js
  12. 8 0
      src/api/room.js
  13. 39 0
      src/assets/CHN.geo2.json
  14. 31986 0
      src/assets/china.json
  15. 1594 0
      src/assets/cityData/济南区域.json
  16. 1447 0
      src/assets/cityData/青岛区域.json
  17. 3 3
      src/assets/css/rotation.css
  18. 3 3
      src/assets/css/rotation.less
  19. BIN
      src/assets/images/icons/1001.png
  20. BIN
      src/assets/images/icons/1002.png
  21. BIN
      src/assets/images/icons/1003.png
  22. BIN
      src/assets/images/icons/1004.png
  23. BIN
      src/assets/images/icons/1005.png
  24. BIN
      src/assets/images/icons/1006.png
  25. BIN
      src/assets/images/icons/1007.png
  26. BIN
      src/assets/images/icons/audit.png
  27. BIN
      src/assets/images/icons/contract.png
  28. BIN
      src/assets/images/icons/edit_blue_b.png
  29. BIN
      src/assets/images/icons/edit_red_b.png
  30. BIN
      src/assets/images/icons/edit_yellow_b.png
  31. BIN
      src/assets/images/icons/fix_blue_b.png
  32. BIN
      src/assets/images/icons/fix_red_b.png
  33. BIN
      src/assets/images/icons/fix_yellow_b.png
  34. BIN
      src/assets/images/icons/hydrant.png
  35. BIN
      src/assets/images/icons/ratio.png
  36. BIN
      src/assets/images/icons/right.png
  37. BIN
      src/assets/images/icons/search_blue_b.png
  38. BIN
      src/assets/images/icons/search_red_b.png
  39. BIN
      src/assets/images/icons/search_yellow_b.png
  40. BIN
      src/assets/images/warning.png
  41. BIN
      src/assets/images/图标/1001.png
  42. BIN
      src/assets/images/图标/1002.png
  43. BIN
      src/assets/images/图标/1003.png
  44. BIN
      src/assets/images/图标/1004.png
  45. BIN
      src/assets/images/图标/1005.png
  46. BIN
      src/assets/images/图标/1006.png
  47. BIN
      src/assets/images/图标/1007.png
  48. BIN
      src/assets/images/图标/供电系统_n.png
  49. BIN
      src/assets/images/图标/土建系统_n.png
  50. BIN
      src/assets/images/图标/土建系统_s.png
  51. BIN
      src/assets/images/图标/弱点系统_n.png
  52. BIN
      src/assets/images/图标/提示.png
  53. BIN
      src/assets/images/图标/暖通系统_n.png
  54. BIN
      src/assets/images/图标/消防系统_n.png
  55. BIN
      src/assets/images/图标/燃气系统_n.png
  56. BIN
      src/assets/images/图标/电梯系统_n.png
  57. BIN
      src/assets/images/图标/给排水系统_n.png
  58. BIN
      src/assets/imgs/bg2.png
  59. BIN
      src/assets/imgs/bjj.png
  60. BIN
      src/assets/imgs/dlsb.png
  61. BIN
      src/assets/imgs/go-back.png
  62. 97 0
      src/components/404.vue
  63. 3 10
      src/components/Editor/src/editor.vue
  64. 195 65
      src/components/Legend/src/legend.vue
  65. 31 21
      src/components/editLengend.vue
  66. 2 16
      src/components/floorList.vue
  67. 44 71
      src/components/floorListOther.vue
  68. 9 3
      src/components/floorMap/canvasFun.vue
  69. 102 30
      src/components/floorMap/index.vue
  70. 85 10
      src/components/legendremarks.vue
  71. 451 50
      src/components/mapClass/EditScence.js
  72. 514 56
      src/components/mapClass/EditScence.ts
  73. 10 8
      src/components/menuList.vue
  74. 29 17
      src/components/viewLengend.vue
  75. 21 5
      src/lib/FloorScene.js
  76. 25 3
      src/lib/GraphView.js
  77. 28 5
      src/lib/GraphView.ts
  78. 86 0
      src/lib/items/HighlightItem.js
  79. 93 0
      src/lib/items/HighlightItem.ts
  80. 2 1
      src/lib/items/SFHFQZoneLegendItem.js
  81. 28 4
      src/lib/items/SFHFQZoneLegendItem.ts
  82. 19 1
      src/lib/items/SImageLegendItem.js
  83. 23 6
      src/lib/items/SImageLegendItem.ts
  84. 1 0
      src/lib/items/SImageMarkerItem.js
  85. 1 0
      src/lib/items/SImageMarkerItem.ts
  86. 41 0
      src/lib/items/SLineMarkerItem.js
  87. 43 0
      src/lib/items/SLineMarkerItem.ts
  88. 2 1
      src/lib/items/SSCPZZoneLegendItem.js
  89. 28 4
      src/lib/items/SSCPZZoneLegendItem.ts
  90. 1 0
      src/lib/items/STextMarkerItem.js
  91. 2 0
      src/lib/items/STextMarkerItem.ts
  92. 1 0
      src/lib/items/SZoneLegendItem.js
  93. 28 3
      src/lib/items/SZoneLegendItem.ts
  94. 17 9
      src/lib/parsers/STopologyParser.js
  95. 15 8
      src/lib/parsers/STopologyParser.ts
  96. 3 2
      src/lib/types/Legend.ts
  97. 1 1
      src/lib/types/Relation.ts
  98. 32 3
      src/main.js
  99. 4 1
      src/main.ts
  100. 0 0
      src/router/index.js

+ 3 - 0
.gitignore

@@ -1,6 +1,9 @@
 .DS_Store
 node_modules
 package-lock.json
+/src/assets/geoData
+/src/assets/regionData
+/src/assets/provinceData
 /dist
 # 忽略提交打包后的wandaBmGuide目录
 /wandaBmGuide 

+ 58 - 50
package.json

@@ -1,52 +1,60 @@
 {
-    "name": "wandaspecificationofsanming",
-    "version": "0.1.0",
-    "private": true,
-    "scripts": {
-        "serve": "vue-cli-service serve --open",
-        "build": "vue-cli-service build",
-        "lint": "vue-cli-service lint"
-    },
-    "dependencies": {
-        "ant-design-vue": "^1.4.10",
-        "axios": "^0.19.2",
-        "core-js": "^3.4.4",
-        "element-ui": "^2.13.2",
-        "lodash": "^4.17.15",
-        "meri-design": "^1.3.2",
-        "moment": "^2.24.0",
-        "quill": "^1.3.7",
-        "vue": "^2.6.10",
-        "vue-cookie": "^1.1.4",
-        "vue-pdf": "^4.1.0",
-        "vue-quill-editor": "^3.0.6",
-        "vue-router": "^3.1.3",
-        "vuex": "^3.4.0"
-    },
-    "devDependencies": {
-        "@typescript-eslint/eslint-plugin": "^2.26.0",
-        "@typescript-eslint/parser": "^2.26.0",
-        "@vue/cli-plugin-babel": "^4.1.0",
-        "@vue/cli-plugin-eslint": "^4.1.0",
-        "@vue/cli-plugin-router": "^4.1.0",
-        "@vue/cli-plugin-typescript": "^4.3.0",
-        "@vue/cli-plugin-vuex": "^4.1.0",
-        "@vue/cli-service": "^4.1.0",
-        "@vue/eslint-config-typescript": "^5.0.2",
-        "babel-eslint": "^10.0.3",
-        "babel-plugin-component": "^1.1.1",
-        "eslint": "^5.16.0",
-        "eslint-plugin-vue": "^5.0.0",
-        "fengmap": "^2.5.3",
-        "less": "^3.0.4",
-        "less-loader": "^5.0.0",
-        "polybooljs": "^1.2.0",
-        "style-resources-loader": "^1.3.3",
-        "stylus": "^0.54.7",
-        "stylus-loader": "^3.0.2",
-        "typescript": "~3.8.3",
-        "vue-property-decorator": "^8.4.2",
-        "vue-svg-loader": "^0.15.0",
-        "vue-template-compiler": "^2.6.10"
-    }
+  "name": "wandaspecificationofsanming",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "vue-cli-service serve --open",
+    "build": "vue-cli-service build",
+    "lint": "vue-cli-service lint"
+  },
+  "dependencies": {
+    "@mapbox/geojson-merge": "^1.1.1",
+    "@saga-web/base": "2.1.19",
+    "@saga-web/big": "1.0.40",
+    "@saga-web/draw": "2.1.94",
+    "@saga-web/feng-map": "1.0.11",
+    "@saga-web/graph": "2.1.82",
+    "ant-design-vue": "^1.4.10",
+    "axios": "^0.19.2",
+    "core-js": "^3.4.4",
+    "element-ui": "^2.13.2",
+    "leaflet": "^1.6.0",
+    "leaflet-contextmenu": "^1.4.0",
+    "meri-design": "^1.2.8",
+    "moment": "^2.24.0",
+    "quill": "^1.3.7",
+    "vue": "^2.6.10",
+    "vue-cookie": "^1.1.4",
+    "vue-pdf": "^4.1.0",
+    "vue-quill-editor": "^3.0.6",
+    "vue-router": "^3.1.3",
+    "vuex": "^3.4.0"
+  },
+  "devDependencies": {
+    "@typescript-eslint/eslint-plugin": "^2.26.0",
+    "@typescript-eslint/parser": "^2.26.0",
+    "@vue/cli-plugin-babel": "^4.1.0",
+    "@vue/cli-plugin-eslint": "^4.1.0",
+    "@vue/cli-plugin-router": "^4.1.0",
+    "@vue/cli-plugin-typescript": "^4.3.0",
+    "@vue/cli-plugin-vuex": "^4.1.0",
+    "@vue/cli-service": "^4.1.0",
+    "@vue/eslint-config-typescript": "^5.0.2",
+    "babel-eslint": "^10.0.3",
+    "babel-plugin-component": "^1.1.1",
+    "eslint": "^5.16.0",
+    "eslint-plugin-vue": "^5.0.0",
+    "fengmap": "^2.5.3",
+    "less": "^3.0.4",
+    "less-loader": "^5.0.0",
+    "lodash": "^4.17.19",
+    "polybooljs": "^1.2.0",
+    "style-resources-loader": "^1.3.3",
+    "stylus": "^0.54.7",
+    "stylus-loader": "^3.0.2",
+    "typescript": "~3.8.3",
+    "vue-property-decorator": "^8.4.2",
+    "vue-svg-loader": "^0.15.0",
+    "vue-template-compiler": "^2.6.10"
+  }
 }

+ 70 - 1
public/index.html

@@ -1,3 +1,4 @@
+ 
 <!DOCTYPE html>
 <html lang="en">
 
@@ -8,6 +9,74 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <script src="<%= BASE_URL %>systemConf.js"></script>
     <title>万达广场管理说明书</title>
+    <style>
+        .map-p-label{
+            background-color:transparent!important;
+            border:none!important;
+            box-shadow:none!important;
+        }
+        .leaflet-container{
+            background: #f7f9fa!important;
+        }
+        
+        .leaflet-popup-content-wrapper{
+            padding: 0px!important;
+            border-radius: 0px!important;
+            box-shadow: none!important;
+        }
+        .leaflet-popup-content-wrapper .leaflet-popup-content {
+            margin: 0!important;
+            min-width: 250px;
+            background: rgba(255, 255, 255, 0.5);
+            
+        }
+        .leaflet-mypopup-content {
+            padding: 8px 12px!important;
+        }
+        .leaflet-mypopup-content .title{
+            margin-bottom: 12px;
+        }
+        .leaflet-mypopup-content .title span{
+            font-size: 14px;
+            font-weight: bold;
+        }
+        .leaflet-mypopup-content .line {
+            margin-bottom: 12px;
+        }
+        .leaflet-mypopup-content .line span{
+            margin-right: 10px;
+        }
+        .leaflet-mypopup-content .line span:nth-of-type(1){
+            font-size: 12px;
+            color: #8D9399;
+        }
+        .leaflet-mypopup-content .line span:nth-of-type(2){
+            font-size: 16px;
+            color: #1F2429;
+        }
+        .leaflet-mypopup-content .line span:nth-of-type(3) i{
+            display: inline-block;
+            width: 16px;
+            height: 16px;
+            border-radius: 8px;
+            color: #F54E45;
+        }
+        .leaflet-mypopup-content .line span:nth-of-type(3) em{
+            font-size: 12px;
+            color: #F54E45;
+        }
+    </style>
+    <script>
+        var remHandle = function () {
+            var html = document.documentElement;
+            var width = html.clientWidth;
+            html.style.fontSize = width / 192 + 'px'; 
+        }
+        remHandle();
+        window.onresize = function () {
+            remHandle();
+        }
+    </script>
 </head>
 
 <body>
@@ -17,7 +86,7 @@
         </noscript>
     <script src="http://localhost/g.js" type="text/JavaScript"></script>
     <div id="app"></div>
-    <!-- built files will be auto injected -->
+ 
 </body>
 
 </html>

+ 6 - 4
public/systemConf.js

@@ -21,12 +21,14 @@
  */
 var __systemConf = {
     // 系统编码
-    systemCode: 'wandaBmGuide',
+    systemCode: "wandaBmGuide",
     conf: {
         // 阿里云
-        editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
-        // wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
-        wandaBmGuideUrl: 'http://192.168.200.100:8090/wandaBmGuide/', //管理书地址
+        // editerUrl: "http://60.205.177.43:80/wandaEditer/", // 编辑器地址
+        // wandaBmGuideUrl: "http://60.205.177.43:80/wandaBmGuide/", //管理书地址
+        // http://glsms.wanda-dev.cn/ 测试服
+        editerUrl: "http://glsms.wanda-dev.cn/wandaEditer/", // 编辑器地址
+        wandaBmGuideUrl: "http://glsms.wanda-dev.cn/wandaBmGuide/", //管理书地址
     },
 }
 window.__systemConf = __systemConf

+ 135 - 93
src/App.vue

@@ -1,13 +1,13 @@
 <template>
-  <div id="app">
-    <div :id="`fengMap${id}`" class="fengMap"></div>
-    <router-view />
-  </div>
+    <div id='app'>
+        <div :id='`fengMap${id}`' class='fengMap'></div>
+        <router-view />
+    </div>
 </template>
 <script>
-import { mapGetters, mapActions, mapMutations } from "vuex";
-import { SFengParser } from "@saga-web/feng-map";
-window.fengmapData = null;
+import { mapGetters, mapActions, mapMutations } from 'vuex'
+import { SFengParser } from '@saga-web/feng-map'
+window.fengmapData = null
 export default {
   data() {
     return {
@@ -26,7 +26,7 @@ export default {
     // 页面加载完成后,移除session里的存储的信息
     window.addEventListener("load", this.load);
     // 请求该项目下的楼层数据
-    this.getFengMap();
+    // this.getFengMap();
   },
   computed: {
     ...mapGetters(["plazaId", "fmapID", "haveFengMap"])
@@ -39,42 +39,50 @@ export default {
       const state = this.$store.state;
       sessionStorage.setItem("state", JSON.stringify(state));
     },
-    load() {
-      sessionStorage.clear();
+    mounted() {
+        // 监听页面刷新事件
+        window.addEventListener('unload', this.unload)
+        // 页面加载完成后,移除session里的存储的信息
+        window.addEventListener('load', this.load)
+        // 请求该项目下的楼层数据
+        this.getFengMap()
     },
-    getFengMap() {
-      if (!this.fmapID) {
-        this.getfmapID().then(() => {
-          this.getMap();
-        });
-        return;
-      }
-      this.getMap();
+    computed: {
+        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap'])
     },
-    getMap() {
-      if (!window.fengmapData) {
-        window.fengmapData = new SFengParser(
-          `fengMap${this.id}`,
-          `${this.mapServerURL}/fmap/${this.fmapID}`,
-          this.key,
-          this.appName,
-          null
-        );
-        window.fengmapData.loadMap(this.fmapID, () => {
-          // 获取主题数据
-          window.fengmapData
-            .loadTheme(
-              `${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`
-            )
-            .then(res => {
-              console.log("获取rf成功", res);
-               this.SETHAVEFENGMAP()
-            });
-        });
-      }
+    methods: {
+        ...mapActions(['getfmapID']),
+        ...mapMutations(['SETHAVEFENGMAP']),
+        unload() {
+            // const { userInfo, projectId, menuStatus,manualAutoMode } = this.$store.state;
+            const state = this.$store.state
+            sessionStorage.setItem('state', JSON.stringify(state))
+        },
+        load() {
+            sessionStorage.clear()
+        },
+        getFengMap() {
+            if (!this.fmapID) {
+                this.getfmapID().then(() => {
+                    this.getMap()
+                })
+                return
+            }
+            this.getMap()
+        },
+        getMap() {
+            if (!window.fengmapData) {
+                window.fengmapData = new SFengParser(`fengMap${this.id}`, `${this.mapServerURL}/fmap/${this.fmapID}`, this.key, this.appName, null, this.mapthemeUrl)
+                window.fengmapData.loadMap(this.fmapID, () => {
+                    // 获取主题数据
+                    window.fengmapData.loadTheme(`${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`).then(res => {
+                        this.SETHAVEFENGMAP()
+                    })
+                })
+            }
+        }
     }
-  },
-};
+}
 </script>
 <style lang="less">
 body,
@@ -102,8 +110,8 @@ input,
 textarea,
 th,
 td {
-  margin: 0;
-  padding: 0;
+    margin: 0;
+    padding: 0;
 }
 
 body,
@@ -111,7 +119,7 @@ button,
 input,
 select,
 textarea {
-  font: 12px/1.5 Arial, "Microsoft YaHei", "\65b0\5b8b\4f53";
+    font: 12px/1.5 Arial, 'Microsoft YaHei', '\65b0\5b8b\4f53';
 }
 
 h1,
@@ -120,7 +128,7 @@ h3,
 h4,
 h5,
 h6 {
-  font-size: 100%;
+    font-size: 100%;
 }
 
 address,
@@ -130,115 +138,148 @@ var,
 em,
 i,
 u {
-  font-style: normal;
+    font-style: normal;
 }
 
 ol,
 ul {
-  list-style: none;
+    list-style: none;
 }
 
 a {
-  text-decoration: none;
+    text-decoration: none;
 }
 
 a:hover {
-  text-decoration: underline;
+    text-decoration: underline;
 }
 
 img {
-  border: none;
-  vertical-align: middle;
+    border: none;
+    vertical-align: middle;
 }
 
 :focus {
-  outline: 0;
+    outline: 0;
 }
 
 button,
 input,
 select,
 textarea {
-  font-size: 100%;
+    font-size: 100%;
 }
 
 table {
-  border-collapse: collapse;
-  border-spacing: 0;
+    border-collapse: collapse;
+    border-spacing: 0;
 }
 
 /* 滚动条样式 */
 
 body ::-webkit-scrollbar {
-  width: 5px;
-  height: 8px;
+    width: 5px;
+    height: 8px;
 }
 
 body ::-webkit-scrollbar-track {
-  background-color: rgba(0, 0, 0, 0);
-  border-radius: 3px;
+    background-color: rgba(0, 0, 0, 0);
+    border-radius: 3px;
 }
 
 body ::-webkit-scrollbar-thumb {
-  border-radius: 3px;
-  background: #e6e6e6;
-  border: 1px solid #e6e6e6;
+    border-radius: 3px;
+    background: #e6e6e6;
+    border: 1px solid #e6e6e6;
 }
 
 body ::-webkit-scrollbar-thumb:vertical:hover {
-  background: #e6e6e6;
-  border: 1px solid #e6e6e6;
+    background: #e6e6e6;
+    border: 1px solid #e6e6e6;
 }
 
+#app {
+    //meri-design组件select的字体颜色
+    /deep/ .p-select-fakePlaceholder {
+        span {
+            span {
+                color: #606266 !important;
+                font-size: 13px;
+                font-weight: normal;
+            }
+        }
+    }
+    //element 分页组件背景色
+    /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
+        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+    }
+    //element button
+    /deep/ .el-button--primary,
+    .p-button-primary {
+        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+    }
+}
 .clearfix::after {
-  content: ".";
-  display: block;
-  height: 0;
-  clear: both;
-  visibility: hidden;
+    content: '.';
+    display: block;
+    height: 0;
+    clear: both;
+    visibility: hidden;
 }
 .clearfix {
-  zoom: 1;
+    zoom: 1;
 }
 
 .left {
-  float: left;
+    float: left;
 }
 
 .right {
-  float: right;
+    float: right;
 }
 html,
 body {
-  width: 100%;
-  height: 100%;
-  // min-width: 1920px;
-  //   background: url('./assets/images/back.jpg') no-repeat;
+    width: 100%;
+    height: 100%;
+    // min-width: 1920px;
+    //   background: url('./assets/images/back.jpg') no-repeat;
 }
 #app {
-  height: 100%;
-  width: 100%;
-  position: relative;
-  .fengMap {
-    position: fixed;
-    width: 100px;
-    height: 100px;
-    z-index: -1;
-    opacity: 0
-  }
+    height: 100%;
+    width: 100%;
+    position: relative;
+    .fengMap {
+        position: fixed;
+        width: 100px;
+        height: 100px;
+        z-index: -1;
+        opacity: 0;
+    }
 }
 // element表头背景颜色修改
 .core-device-report,
-.specification-update-record{
-  .el-table thead th{
-    background-color: #F8F9FA;
-  }
-  .el-pagination.is-background .el-pager li:not(.disabled).active{
-    background: linear-gradient(180deg,rgba(54,156,247,1) 0%,rgba(2,91,170,1) 100%);
-  }
+.specification-update-record {
+    .el-table thead th {
+        background-color: #f8f9fa;
+    }
+    .el-pagination.is-background .el-pager li:not(.disabled).active {
+        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+    }
 }
 // 说明书更新记录 element 时间控件样式重写
 .specification-update-record,
+<<<<<<< HEAD
+.core-device-report {
+    .el-input__inner {
+        height: 32px;
+        line-height: 32px;
+    }
+    .el-date-editor .el-range__icon,
+    .el-date-editor .el-range-separator {
+        line-height: 26px;
+        width: 8%;
+    }
+=======
 .core-device-report{
   .el-input__inner{
     height: 32px;
@@ -252,5 +293,6 @@ body {
   .el-date-editor .el-range__close-icon{
     line-height: 26px;
   }
+>>>>>>> develop-cd
 }
 </style>

+ 11 - 3
src/api/coreDeviceReport.js

@@ -1,5 +1,13 @@
+/*
+ * @Author: your name
+ * @Date: 2020-07-03 19:04:47
+ * @LastEditTime: 2020-07-09 19:58:31
+ * @LastEditors: your name
+ * @Description: In User Settings Edit
+ * @FilePath: \wanda-bm-guide\src\api\coreDeviceReport.js
+ */ 
 // 核心设备报表 接口
-import httputils from "@/api/httputils";
+import httputils from '@/api/httputils'
 
 /**
  * 系统列表
@@ -19,7 +27,7 @@ export function queryEquipmentList(url, getParams) {
  * 表数据
  */
 export function queryTableData(url, postParams) {
-  return httputils.postJson(url, postParams);
+    return httputils.postJson(url, postParams)
 }
 
 /**
@@ -38,4 +46,4 @@ export function queryHistoryTableData(url, getParams) {
  */
 export function queryDetailData(url, getParams) {
   return  httputils.getJson(url, getParams);
-}
+}

+ 34 - 0
src/api/homePage.js

@@ -0,0 +1,34 @@
+import httputils from "@/api/httputils"
+
+// 查询首页系统卡片
+export function getCardList({ getParams }) {
+    return httputils.getJson(`/data/home/querySystemCard`, getParams)
+}
+
+ // 综合事项记录
+export function getQueryList({ getParams }) {
+    return httputils.getJson(`/data/v_glsms_zhsxjl/query`, getParams)
+}
+
+// 说明书变更记录
+export function getChangeList({ getParams }) {
+    return httputils.getJson(`/data/rpt_change_record/query`, getParams)
+}
+
+
+
+// ==================== 集团首页接口 =======================
+// 查询项目信息统计数量
+export function getPlazaInfoCount({ getParams }) {
+    return httputils.getJson(`/data/home/queryPlazaInfoCount`, getParams)
+}
+
+// 查询首页系统卡片
+export function querySystemCard({ getParams }) {
+    return httputils.getJson(`/data/home/querySystemCard`, getParams)
+}
+
+// 查询集团首页事项状态统计
+export function queryEventStatus({ getParams }) {
+    return httputils.getJson(`/data/home/queryEventStatus`, getParams)
+}

+ 9 - 23
src/api/httputils.js

@@ -20,17 +20,18 @@ const axiosservice = axios.create({
 axiosservice.interceptors.request.use(
     (config) => {
         config.withCredentials = true // 允许携带token ,这个是解决跨域产生的相关问题
-        let token = store.getters['token']
-        if (token) {
+        let token = store.getters['ssoToken']
+        let isPreview = store.getters["isPreview"]
+        if (config.url.indexOf('mapapp') < 0) {
             config.headers = {
-                'sso-token': token,
-                'isPreview': false //默认false,当预览开启的时候是true
+                "sso-token": token,
+                isPreview: isPreview, //默认false,当预览开启的时候是true
             }
         }
         // if (config.url.indexOf('/data') > -1 && config.url !== '/data/data/auth/check') {
         if (config.url.indexOf('/data') > -1) {
             config.headers = {
-                'sso-token': 'admin:lengqiang',
+                'sso-token': 'admin:xiejialin1',
             }
         }
         return config
@@ -43,7 +44,6 @@ axiosservice.interceptors.request.use(
 axiosservice.interceptors.response.use(
     function(res) {
         //在这里对返回的数据进行处理
-        //// //console.log('axios interceptors res = ', res.status, res)
         let resp = res.data
         if (resp.result === 'unauthc') {
             store.commit('logined', false)
@@ -53,23 +53,15 @@ axiosservice.interceptors.response.use(
                 type: 'error',
             })
                 .then((resp) => {
-                    //// //console.log('--------------------------- confirm', resp)
-                    //router.push('/login')
                     window.location.reload()
                 })
-                .catch((error) => {
-                    //// //console.log('--------------------------- cancel', error)
-                    // //console.log("")
-                })
+                .catch((error) => {})
         } else if (resp.result == 'unauthorization') {
             MessageBox.alert('无权操作', { title: '警告', type: 'error' })
         }
-        //// //console.log('axios interceptors resp2 = ', resp.success, resp.errorCode, resp.errorMessage, res)
         return res
     },
     function(err) {
-        //Do something with response error
-        // //console.log("axios interceptors err = ", err)
         return Promise.reject(err)
     }
 )
@@ -164,27 +156,21 @@ export default {
             .then((resp) => {
                 let headers = resp.headers
                 let contentType = headers['content-type']
-
-                // //console.log("响应头信息", headers)
                 if (!resp.data) {
                     console.error('响应异常:', resp)
                     return false
                 } else {
-                    // //console.log("下载文件:", resp)
+                    //console.log("下载文件:", resp)
                     const blob = new Blob([resp.data], { type: contentType })
-
                     const contentDisposition = resp.headers['content-disposition']
                     let fileName = 'unknown'
                     if (contentDisposition) {
                         fileName = window.decodeURI(resp.headers['content-disposition'].split('=')[1])
                     }
-                    // //console.log("文件名称:", fileName)
                     downFile(blob, fileName)
                 }
             })
-            .catch(function(error) {
-                // //console.log(error)
-            })
+            .catch(function(error) {})
     },
     axios: axiosservice,
 }

+ 22 - 53
src/api/legendLibrary.js

@@ -1,14 +1,10 @@
-import httputils from "@/api/httputils"
+import httputils from '@/api/httputils'
 // 图例库-查询
-export function queryLegend({
-    postParams
-}) {
+export function queryLegend({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graphElement/query`, postParams)
 }
 // 图例库-新增
-export function createLegend({
-    postParams
-}) {
+export function createLegend({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graphElement/create`, postParams)
 }
 // 图例库-新增
@@ -18,87 +14,62 @@ export function createLegend({
 //     return httputils.postJson(`/serve/topology-wanda/graphElement/create`, postParams)
 // }
 //图例库-更新
-export function updateLegend({
-    postParams
-}) {
+export function updateLegend({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graphElement/update`, postParams)
 }
 //图例库-作废
-export function deleteLegend({
-    postParams
-}) {
+export function deleteLegend({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graphElement/deleteByFlag`, postParams)
 }
 //图例库-系统tree查询
-export function getLegendTree({
-    getParams
-}) {
+export function getLegendTree({ getParams }) {
     return httputils.getJson(`/serve/topology-wanda/graphCategory/queryByGroup`, getParams)
 }
 
 //图例库-系统tree相关表格查询
-export function queryRelation({
-    data,
-    postParams
-}) {
+export function queryRelation({ data, postParams }) {
     return httputils.fetchJson(`/serve/topology-wanda/graphRelation/query`, data, postParams)
 }
 //图例库-更新关系图
-export function updateRelation({
-    postParams
-}) {
+export function updateRelation({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
 }
 //图例库-系统tree相关表格删除
-export function deleteRelation({
-    postParams
-}) {
+export function deleteRelation({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graphRelation/delete`, postParams)
 }
 //图例库-上传图片
-export function uploadImg({
-    postParams
-}) {
+export function uploadImg({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/Picture/create`, postParams)
 }
 //图例库-穿梭框的搜索
-export function getTransfer({
-    getParams
-}) {
+export function getTransfer({ getParams }) {
     return httputils.getJson(`/serve/topology-wanda/graphElement/search`, getParams)
 }
 //图例库typeId
-export function queryTypeId({
-    postParams
-}) {
+export function queryTypeId({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graphElement/type/query`, postParams)
 }
 // 搜索图铺位可视化类型信息
-export function getVisualization({
-    getParams
-}) {
+export function getVisualization({ getParams }) {
     return httputils.getJson(`/serve/topology-wanda/graphElement/type/search`, getParams)
 }
 // 图例分层展示
-export function groupByCategory({
-    getParams
-}) {
+export function groupByCategory({ getParams }) {
     // return httputils.getJson(`/serve/topology-wanda/graphRelation/groupByCategory`, getParams)
     return httputils.getJson(`/serve/topology-wanda/graphElement/groupByInfoSystem`, getParams)
 }
 // 图例搜索
-export function graphElementSearch({
-    postParams
-}) {
+export function graphElementSearch({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graphElement/search`, postParams)
 }
 // 更新图例关系信息
-export function graphElementUpdate({
-    postParams
-}) {
-    return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
+// export function graphElementUpdate({
+//     postParams
+// }) {
+//     return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
 
-}
+// }
 
 // 业下设备分类和位置分类树形结构
 export function queryDeviceAndPOsition({
@@ -108,8 +79,6 @@ export function queryDeviceAndPOsition({
 }
 
 //图形查询
-export function queryPics({
-    postParams
-}) {
+export function queryPics({ postParams }) {
     return httputils.postJson(`/serve/topology-wanda/graph/query`, postParams)
-}
+}

+ 1 - 1
src/api/login.js

@@ -1,5 +1,5 @@
 // 登录校验接口
-import httputils from "@/api/httputils"
+import httputils from '@/api/httputils'
 
 export function login(params) {
     return httputils.getJson(`/data/auth/check`, params)

+ 1 - 1
src/api/overview.js

@@ -1,4 +1,4 @@
-import httputils from "@/api/httputils"
+import httputils from '@/api/httputils'
 // 查询广场概况
 export function queryFact({ getParams }) {
     return httputils.getJson(`/data/plaza/fact`, getParams)

+ 8 - 0
src/api/room.js

@@ -1,3 +1,11 @@
+/*
+ * @Author: your name
+ * @Date: 2020-06-28 13:41:05
+ * @LastEditTime: 2020-07-06 11:43:33
+ * @LastEditors: your name
+ * @Description: In User Settings Edit
+ * @FilePath: \wanda-bm-guide\src\api\room.js
+ */ 
 import httputils from '@/api/httputils'
 
 // 机房-机房布置图

File diff suppressed because it is too large
+ 39 - 0
src/assets/CHN.geo2.json


File diff suppressed because it is too large
+ 31986 - 0
src/assets/china.json


File diff suppressed because it is too large
+ 1594 - 0
src/assets/cityData/济南区域.json


File diff suppressed because it is too large
+ 1447 - 0
src/assets/cityData/青岛区域.json


+ 3 - 3
src/assets/css/rotation.css

@@ -50,7 +50,7 @@
   margin-right: 6px;
 }
 .overview .view-box {
-  height: calc(100% - 45px);
+  height: calc(100% - 32px);
   display: flex;
   justify-content: space-between;
 }
@@ -90,7 +90,7 @@
   height: 16px;
   position: absolute;
   top: 8px;
-  right: 10px;
+  right: 8px;
   cursor: pointer;
 }
 .overview .view-box .view-left .lb-bottom {
@@ -220,7 +220,7 @@
   height: 16px;
   position: absolute;
   top: 8px;
-  right: 10px;
+  right: 8px;
   cursor: pointer;
 }
 .overview .view-box .view-right .view-right-box .lb-right-bottom {

+ 3 - 3
src/assets/css/rotation.less

@@ -50,7 +50,7 @@
         }
     }
     .view-box {
-        height: calc(100% - 45px);
+        height: calc(100% - 32px);
         display: flex;
         justify-content: space-between;
         .view-left {
@@ -91,7 +91,7 @@
                     height: 16px;
                     position: absolute;
                     top: 8px;
-                    right: 10px;
+                    right: 8px;
                     cursor: pointer;
                 }
             }
@@ -221,7 +221,7 @@
                         height: 16px;
                         position: absolute;
                         top: 8px;
-                        right: 10px;
+                        right: 8px;
                         cursor: pointer;
                     }
                 }

BIN
src/assets/images/icons/1001.png


BIN
src/assets/images/icons/1002.png


BIN
src/assets/images/icons/1003.png


BIN
src/assets/images/icons/1004.png


BIN
src/assets/images/icons/1005.png


BIN
src/assets/images/icons/1006.png


BIN
src/assets/images/icons/1007.png


BIN
src/assets/images/icons/audit.png


BIN
src/assets/images/icons/contract.png


BIN
src/assets/images/icons/edit_blue_b.png


BIN
src/assets/images/icons/edit_red_b.png


BIN
src/assets/images/icons/edit_yellow_b.png


BIN
src/assets/images/icons/fix_blue_b.png


BIN
src/assets/images/icons/fix_red_b.png


BIN
src/assets/images/icons/fix_yellow_b.png


BIN
src/assets/images/icons/hydrant.png


BIN
src/assets/images/icons/ratio.png


BIN
src/assets/images/icons/right.png


BIN
src/assets/images/icons/search_blue_b.png


BIN
src/assets/images/icons/search_red_b.png


BIN
src/assets/images/icons/search_yellow_b.png


BIN
src/assets/images/warning.png


BIN
src/assets/images/图标/1001.png


BIN
src/assets/images/图标/1002.png


BIN
src/assets/images/图标/1003.png


BIN
src/assets/images/图标/1004.png


BIN
src/assets/images/图标/1005.png


BIN
src/assets/images/图标/1006.png


BIN
src/assets/images/图标/1007.png


BIN
src/assets/images/图标/供电系统_n.png


BIN
src/assets/images/图标/土建系统_n.png


BIN
src/assets/images/图标/土建系统_s.png


BIN
src/assets/images/图标/弱点系统_n.png


BIN
src/assets/images/图标/提示.png


BIN
src/assets/images/图标/暖通系统_n.png


BIN
src/assets/images/图标/消防系统_n.png


BIN
src/assets/images/图标/燃气系统_n.png


BIN
src/assets/images/图标/电梯系统_n.png


BIN
src/assets/images/图标/给排水系统_n.png


BIN
src/assets/imgs/bg2.png


BIN
src/assets/imgs/bjj.png


BIN
src/assets/imgs/dlsb.png


BIN
src/assets/imgs/go-back.png


+ 97 - 0
src/components/404.vue

@@ -0,0 +1,97 @@
+<template>
+    <div class='notfond'>
+        <div class='not-img'>
+            <img src='@/assets/imgs/dlsb.png' alt />
+        </div>
+        <div class='not-text' v-if='permissions && permissions.includes("GLSMS_VIEW")'>
+            <span>您的权限不足……</span>
+            <span>建议您联系管理员开通管理说明书相关权限</span>
+        </div>
+        <div class='not-text' v-else>
+            <span>您的访问出错了!</span>
+            <span>建议您稍后再试,或直接联系管理员解决</span>
+        </div>
+        <div class='not-button' @click='goLogin'>
+            <span>关闭页面</span>
+        </div>
+    </div>
+</template>
+<script>
+import { mapGetters } from 'vuex'
+export default {
+    data() {
+        return {}
+    },
+    computed: {
+        ...mapGetters(['permissions'])
+    },
+    mounted() {},
+    methods: {
+        goLogin() {
+            let ssoServer = 'http://oauth.wanda-dev.cn'
+            this.$store.commit('SETSSOTOKEN', null)
+            let systemcode = 'CAD156',
+                signal = new Date().getTime(),
+                version = '1.0.0'
+            window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
+            window.open(`${window.location.href}`, true)
+        }
+    }
+}
+</script>
+<style lang="less" scoped>
+.notfond {
+    width: 100%;
+    height: 100%;
+    background: rgba(255, 255, 255, 1);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    .not-img {
+        width: 120px;
+        height: 120px;
+        img {
+            width: 100%;
+            height: 100%;
+        }
+    }
+    .not-text {
+        margin-top: 8px;
+        span {
+            display: block;
+            text-align: center;
+        }
+        span:nth-of-type(1) {
+            font-size: 16px;
+            font-family: MicrosoftYaHei;
+            color: rgba(31, 36, 41, 1);
+            line-height: 21px;
+        }
+        span:nth-of-type(2) {
+            margin-top: 4px;
+            font-size: 14px;
+            font-family: MicrosoftYaHei;
+            color: rgba(100, 108, 115, 1);
+            line-height: 19px;
+        }
+    }
+    .not-button {
+        margin-top: 32px;
+        width: 80px;
+        height: 32px;
+        background: rgba(255, 255, 255, 1);
+        border: 1px solid rgba(195, 199, 203, 1);
+        border-radius: 4px;
+        cursor: pointer;
+        span {
+            display: block;
+            font-size: 14px;
+            font-family: MicrosoftYaHei;
+            color: rgba(31, 35, 41, 1);
+            line-height: 32px;
+            text-align: center;
+        }
+    }
+}
+</style>

+ 3 - 10
src/components/Editor/src/editor.vue

@@ -52,17 +52,10 @@ export default {
         this.content = this.text
     },
     methods: {
-        onEditorReady(editor) {
-            console.log(editor)
-        },
-        onEditorBlur(val) {
-            console.log(val)
-        },
-        onEditorFocus(val) {
-            console.log(val)
-        },
+        onEditorReady(editor) {},
+        onEditorBlur(val) {},
+        onEditorFocus(val) {},
         onEditorChange(val) {
-            console.log(val.html)
             val.quill.deleteText(200, 6)
             if (this.content === '') {
                 this.valLen = 0

+ 195 - 65
src/components/Legend/src/legend.vue

@@ -11,26 +11,10 @@
             <el-collapse-transition v-if='(type==1 || floors.length>0)&& isMessage'>
                 <div class='legend-tab' v-if='show'>
                     <div class='legend-table2' v-if='systemName=="土建系统"'>
-                        <lengend-view
-                            v-if='viewTable.length>=0'
-                            :loading='loading'
-                            :viewTable='viewTable'
-                            @changeSwitch='handleSwich'
-                            :remarksText='remarksText'
-                            ref='viewLengend'
-                            :systemName='systemName'
-                        ></lengend-view>
+                        <lengend-view @changeSwitch='handleSwich' :remarksText='remarksText' ref='viewLengend' :systemName='systemName'></lengend-view>
                     </div>
                     <div class='legend-table' v-else>
-                        <lengend-view
-                            v-if='viewTable.length>=0'
-                            :loading='loading'
-                            :viewTable='viewTable'
-                            @changeSwitch='handleSwich'
-                            :remarksText='remarksText'
-                            ref='viewLengend'
-                            :systemName='systemName'
-                        ></lengend-view>
+                        <lengend-view @changeSwitch='handleSwich' :remarksText='remarksText' ref='viewLengend' :systemName='systemName'></lengend-view>
                     </div>
                 </div>
             </el-collapse-transition>
@@ -51,13 +35,13 @@
         </div>
 
         <!-- 单独展示新增分布图 -->
-        <div class='edit_map1' v-if='floors.length==0' @click='addFloor'>
-            <el-tooltip effect='dark' content='新增分布图' placement='left'>
+        <el-tooltip effect='dark' v-if='floors.length==0' content='新增分布图' placement='left'>
+            <div class='edit_map1' @click='addFloor'>
                 <!-- <p class='tltk' style='margin-left: -5px;'> -->
-                <img src='@/assets/imgs/xzfbt.png' alt />
+                <img src='@/assets/imgs/bjj.png' alt />
                 <!-- </p> -->
-            </el-tooltip>
-        </div>
+            </div>
+        </el-tooltip>
 
         <div class='edit_map' v-else>
             <!-- 备注编辑器 -->
@@ -71,23 +55,33 @@
                 </p>
             </el-tooltip>
             <!-- 新增分布图 -->
-            <el-tooltip effect='dark' content='新增分布图' placement='left' v-if='floorSelect.length!=floors.length'>
+            <el-tooltip effect='dark' content='新增分布图' placement='left' v-if='floorSelect.length!=floors.length && !isMessage && type==0'>
                 <p class='tltk' style='margin-left: -5px;' @click='addFloor'>
-                    <img src='@/assets/imgs/xzfbt.png' alt />
+                    <img src='@/assets/imgs/bjj.png' alt />
                 </p>
             </el-tooltip>
             <!-- 编辑分布图 -->
+
+            <!-- 有修改权限 -->
             <el-tooltip v-if='editPmt' class='bjpmt' effect='dark' :content='editTips' placement='left'>
-                <span class='edit-icon' @click='goToEditer'>
+                <span class='edit-icon corner-con' @click='goToEditer'>
                     <img src='@/assets/imgs/bjs.png' alt />
+                    <!-- 角标 -->
+                    <!-- <span v-if='draftNum' class='corner' :style='{lineHeight : draftNum > 99 ?"10px":"18px"}'>{{draftNum > 99 ? '...' : draftNum}}</span> -->
+                    <span v-if='draftNum' class='corner'></span>
                 </span>
             </el-tooltip>
-            <span v-else class='edit-icon2'>
+
+            <!-- 无修改权限 -->
+            <span v-else class='edit-icon2 corner-con'>
                 <img src='@/assets/imgs/bjs.png' alt />
+                <!-- 角标 -->
+                <!-- <span v-if='draftNum' class='corner' :style='{lineHeight : draftNum > 99 ?"10px":"18px"}'>{{draftNum > 99 ? '...' : draftNum}}</span> -->
+                <span v-if='draftNum' class='corner'></span>
             </span>
         </div>
         <div class='select-floor' v-if='isFloor'>
-            <p class='p1'>请选择需要创建“消防泵房引出管路分布图”的楼层</p>
+            <p class='p1'>{{`请选择需要创建"${categoryId=='FZQZL'?'分水器支路分布图':'消防泵房引出管路分布图'}"的楼层`}}</p>
             <p class='p2'>
                 <Select width='240' tipPlace='top' v-model='floor' caption='楼层:' size='mini' :selectdata='floorSelectAble' :placeholder='"请选择"'></Select>
             </p>
@@ -105,7 +99,8 @@ import lengendView from '@/components/viewLengend'
 import legendRemarks from '@/components/legendremarks'
 import lengendEdit from '@/components/editLengend'
 import { mapGetters } from 'vuex'
-import { queryStatis, updateStatis, queryRead } from '@/api/public.js'
+import bus from '@/utils/bus.js'
+import { queryStatis, updateStatis, queryRead, queryDraftNum } from '@/api/public.js'
 
 export default {
     name: 'Legend',
@@ -113,8 +108,8 @@ export default {
         return {
             remarksText: '', //查询出来的备注
             text1:
-                '<p>1.主要设备房包括:冷源机房,热源机房,开闭站,配变电所(室),发电机房,消防水泵房,消防高位水箱间,生活水泵房,慧云机房,垃圾房</p>',
-            // text2: '<p>2.图例后×的数字,代表此位置的数量</p>',
+                '<p>主要设备房包括:冷源机房,热源机房,开闭站,配变电所(室),发电机房,消防水泵房,消防高位水箱间,生活水泵房,慧云机房,垃圾房</p>',
+            text2: '<p>图例后×的数字,代表此位置的数量</p>',
             text2: '',
             show: true,
             show2: false,
@@ -134,7 +129,10 @@ export default {
             floor: '', //传的楼层
             floorName: '',
             planNum: '', //主要设备房
-            typeNum: ''
+            typeNum: '',
+            draftNum: null, //草稿箱数量, 编辑器修改icon右上角显示
+            interval: 10 * 60 * 1000, //定时器时长,默认 10分钟
+            timer: null //保存定时器
         }
     },
     computed: {
@@ -165,7 +163,50 @@ export default {
         }
     },
     components: { lengendView, legendRemarks, lengendEdit },
+    watch: {
+        // 监听 vuex 中currentFloor的变化,切换楼层后,调用接口查询,显示右下角小红点
+        '$store.state.currentFloor': {
+            handler(newV, oldV) {
+                if (newV.gname !== oldV.gname) {
+                    clearInterval(this.timer)
+                    this.getDraftNum()
+                    this.timer = setInterval(() => {
+                        this.getDraftNum()
+                    }, this.interval)
+                }
+            },
+            deep: true
+        }
+    },
     methods: {
+        /**
+         * @name getDraftNum
+         * @description 查询草稿箱数量
+         */
+        async getDraftNum() {
+            let res = null,
+                // floorId = this.$cookie.get('floorMapId'),
+                floorId = this.$store.state.currentFloor.gname,
+                data = {
+                    Distinct: true,
+                    Filters: `projectId='${this.plazaId}';isPub=false;floorId='${floorId}'`,
+                    PageNumber: 1,
+                    PageSize: 500,
+                    Projection: ['floorId']
+                }
+            try {
+                // 调用接口
+                res = await queryDraftNum(data)
+            } catch (error) {
+                console.error(error)
+            }
+            if (!res) {
+                this.draftNum = null
+                return false
+            }
+            // 草稿箱总条数使用 res.Total, 不使用 Content数组的长度
+            this.draftNum = res.Total || null
+        },
         formatFloor() {
             this.floorSelectAble = []
             this.floorSelectAble = this.floorSelect.filter(item => {
@@ -176,7 +217,7 @@ export default {
         testClick(data) {},
         // 编辑备注
         legendClik() {
-            this.$refs.EditdMarks.showModal(this.remarksText)
+            this.$refs.EditdMarks.showModal()
         },
         // 查询备注
         queryMarks() {
@@ -184,29 +225,29 @@ export default {
                 categoryId: this.categoryId ? this.categoryId : this.$cookie.get('categoryId'),
                 projectId: this.$store.state.plazaId,
                 BuildingID: '1',
+                Pub: true,
                 FloorID: this.$cookie.get('floorNow')
             }
             let data = {}
             queryRead({ data, postParams }).then(res => {
+                let remarksText = ''
                 if (res.data.Data && res.data.Data[0].Note) {
-                    let note = res.data.Data[0].Note
-                    if (this.planNum > 0) {
-                        this.remarksText = `${this.text1}${note}`
-                    }
-                    if (this.typeNum > 1) {
-                        this.remarksText = `${this.text2}${note}`
-                    }
-                    if (note.search(this.text1) != -1 && note.search(this.text2) != -1) {
-                        this.remarksText = `${note}`
-                    } else if (note.search(this.text1) != -1) {
-                        this.remarksText = `${this.text2}${note}`
-                    } else if (note.search(this.text2) != -1) {
-                        this.remarksText = `${this.text1}${note}`
+                    let Res = res.data ? res.data.Data[0].Note : ''
+                    if (Res) {
+                        // 返回有备注
+                        remarksText = Res
                     } else {
-                        this.remarksText = `${this.text1}${this.text2}${note}`
+                        if (this.planNum > 0 && this.typeNum > 1) {
+                            remarksText = `${this.text1}${this.text2}${Res}`
+                        } else if (this.planNum > 0) {
+                            remarksText = `${this.text1}${Res}`
+                        } else if (this.typeNum > 1) {
+                            remarksText = `${this.text2}${Res}`
+                        } else {
+                            remarksText = ''
+                        }
                     }
-                } else {
-                    this.remarksText = `${this.text1}${this.text2}`
+                    this.$store.commit('SETREMARKSTEXT', remarksText)
                 }
             })
         },
@@ -245,7 +286,8 @@ export default {
             const { conf } = window.__systemConf,
                 { editerUrl } = conf
             let floorName = this.floorName ? this.floorName : this.$cookie.get('floorNow')
-            let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&FloorName=${floorName}&fmapID=${this.fmapID}`
+            let seq = this.$cookie.get('currentFloorId')
+            let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&FloorName=${floorName}&fmapID=${this.fmapID}&seq=${seq}`
             let url = editerUrl + 'editer?' + encodeURIComponent(data)
             window.open(url, true)
         },
@@ -259,6 +301,7 @@ export default {
             this.editSwitch = val
             this.queryEditNum(!this.editSwitch)
         },
+        queryViewMethods() {},
         // 查询图例
         queryView(flag) {
             let postParams = {}
@@ -269,14 +312,18 @@ export default {
             }
             queryStatis({ data, postParams }).then(res => {
                 this.loading = false
-                //console.log('图例', res)
-                this.viewTable = res.data.Data ? res.data.Data : []
-                if (this.viewTable.length > 0) {
-                    this.viewTable.forEach(el => {
-                        console.log(el)
+                let viewTable = []
+                viewTable = res.data.Data ? res.data.Data : []
+                this.$store.commit('SETLEGENDTABLE', viewTable)
+
+                if (viewTable.length > 0) {
+                    viewTable.forEach(el => {
                         if (el.Name == '主要设备房') {
                             this.planNum = el.Num
                         }
+                        if (el.type == 'Image') {
+                            this.typeNum = el.Num
+                        }
                     })
                 }
                 this.$nextTick(() => {
@@ -285,7 +332,6 @@ export default {
                     }
                 })
             })
-            this.queryMarks()
         },
         // 查询编辑状态图例
         queryEditNum(flag) {
@@ -312,13 +358,15 @@ export default {
                 if (res.Result == 'success') {
                     //console.log('更新图例', res)
                     this.$message({
-                        message: '编辑图例成功',
+                        message: '操作成功',
                         type: 'success'
                     })
                     this.queryEditNum(this.editSwitch)
+                    this.show2 = false
+                    this.show = true
                 } else {
                     this.$message({
-                        message: '编辑图例失败',
+                        message: '操作失败',
                         type: 'error'
                     })
                 }
@@ -332,7 +380,9 @@ export default {
                 this.queryEdit(val)
                 this.isShow2()
             } else {
-                this.isShow2()
+                this.show2 = false
+                // this.isShow2()
+                // this.queryEditNum(true)
             }
         },
         addFloor() {
@@ -347,12 +397,50 @@ export default {
         determine() {
             this.isFloor = false
             this.goToEditer()
+        },
+        queryRemarksMethods() {},
+        init() {
+            // 图例
+            bus.$on('queryViewMethods', () => {
+                this.queryView(false)
+            })
+            // 备注
+            bus.$on('queryRemarksMethods', res => {
+                let remarksText = ''
+                if (res) {
+                    // 返回有备注
+                    remarksText = res
+                } else {
+                    if (this.planNum > 0 && this.typeNum > 1) {
+                        remarksText = `${this.text1}${this.text2}${res}`
+                    } else if (this.planNum > 0) {
+                        remarksText = `${this.text1}${res}`
+                    } else if (this.typeNum > 1) {
+                        remarksText = `${this.text2}${res}`
+                    } else {
+                        remarksText = ''
+                    }
+                }
+                this.$store.commit('SETREMARKSTEXT', remarksText)
+            })
         }
     },
-    mounted() {}
+    mounted() {
+        this.init()
+        // 定时查询草稿箱数量
+        this.getDraftNum() //首次查询
+        this.timer = setInterval(() => {
+            this.getDraftNum()
+        }, this.interval)
+        // 页面销毁前,清除定时器
+        this.$once('hook:beforeDestroy', () => {
+            clearInterval(this.timer)
+        })
+    }
 }
 </script>
 <style lang="less" scoped>
+@red: rgb(255, 0, 0); //红色
 .legend-container {
     position: relative;
     top: -15px;
@@ -386,7 +474,7 @@ export default {
     .legend-tab {
         position: absolute;
         top: 0;
-        right: 44px;
+        right: 47px;
         .legend-table {
             padding: 16px;
             height: 546px;
@@ -445,9 +533,34 @@ export default {
             margin-top: -4px;
         }
     }
+
     .edit-icon {
         cursor: pointer;
     }
+    /** 右下角修改,角标样式 */
+    .corner-con {
+        position: relative;
+        .corner {
+            position: absolute;
+            // right: -8px;
+            // top: 0;
+            // display: inline-block;
+            // width: 18px;
+            // height: 18px;
+            right: 3px;
+            top: 3px;
+            display: inline-block;
+            width: 8px;
+            height: 8px;
+            background: @red;
+            border-radius: 90px;
+            font-size: 12px;
+            text-align: center;
+            line-height: 18px;
+            color: #fff;
+        }
+    }
+
     .bjtk {
         width: 40px;
         height: 40px;
@@ -470,6 +583,7 @@ export default {
         margin-bottom: 10px;
         display: none;
         cursor: pointer;
+        border: 1px solid #eee;
     }
 }
 .edit_map:hover .tltk {
@@ -483,6 +597,17 @@ export default {
     bottom: 28px;
     right: 30px;
     z-index: 1;
+    width: 48px;
+    height: 48px;
+    background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+    box-shadow: 0px 2px 8px 0px rgba(31, 36, 41, 0.2);
+    border-radius: 90px;
+    text-align: center;
+    img {
+        display: block;
+        margin-top: 12px;
+        margin-left: 12px;
+    }
     .select-floor {
         width: 288px;
         height: 220px;
@@ -501,9 +626,9 @@ export default {
     border-radius: 2px;
     border: 1px solid rgba(228, 229, 231, 1);
     position: fixed;
-    bottom: 40px;
-    right: 70px;
-    padding: 24px;
+    bottom: 26px;
+    right: 84px;
+    padding: 24px 24px 20px 24px;
     .p1 {
         font-size: 14px;
         font-family: MicrosoftYaHei;
@@ -549,7 +674,12 @@ export default {
     }
     .el-table td,
     .el-table th {
-        padding: 6px 0;
+        padding: 3px 0;
+    }
+    .el-checkbox__input.is-checked .el-checkbox__inner,
+    .el-checkbox__input.is-indeterminate .el-checkbox__inner {
+        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+        border-radius: 2px;
     }
 }
 </style>

+ 31 - 21
src/components/editLengend.vue

@@ -25,7 +25,12 @@
                             <template slot-scope='{row}'>
                                 <div v-if='row.IsModify'>
                                     <div v-if='row.Num!=row.RealNum ' class='redData'>
-                                        <el-tooltip class='item' effect='dark' :content='`当前图例 ${row.Name} 与平面图中的不一致,平面图中为xx`' placement='top'>
+                                        <el-tooltip
+                                            class='item'
+                                            effect='dark'
+                                            :content='`当前图例 ${row.Name} 与平面图中的不一致,平面图中为${row.RealNum}`'
+                                            placement='top'
+                                        >
                                             <el-input @change='changeTable(row)' v-model='row.Num' size='mini'></el-input>
                                         </el-tooltip>
                                     </div>
@@ -54,7 +59,7 @@
                         <el-table-column prop label='单位'>
                             <template slot-scope='{row}'>{{row.Unit||'--'}}</template>
                         </el-table-column>
-                        <el-table-column prop label='图例'>
+                        <el-table-column prop label='图例' align='center'>
                             <template slot-scope='{row}'>
                                 <div v-if='row.Url' class='Url-img'>
                                     <img :src='`/serve/topology-wanda/Picture/query/${row.Url}`' alt />
@@ -104,7 +109,7 @@
             </div>
             <div class='legendFoot'>
                 <el-button size='mini' @click='cancel'>取消</el-button>
-                <el-button size='mini' v-if='editNum.length<=0' disabled type='primary'>保存</el-button>
+                <el-button size='mini' v-if='editNum.length==0' type='primary' disabled style='opacity: 0.5'>保存</el-button>
                 <el-button size='mini' v-else @click='save' type='primary'>保存</el-button>
             </div>
         </div>
@@ -142,21 +147,23 @@ export default {
             this.$emit('handleSwich2', val)
         },
         save() {
-            this.$confirm('图例中的数据发生变化, 是否需要保存?', {
-                confirmButtonText: '保存',
-                cancelButtonText: '放弃修改',
-                type: 'warning'
-            })
-                .then(() => {
-                    this.$emit('saveNum', this.editNum)
-                })
-                .catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已放弃修改'
-                    })
-                    this.$emit('saveNum')
-                })
+            this.$emit('saveNum', this.editNum)
+            // this.$confirm('图例中的数据发生变化, 是否需要保存?', {
+            //     confirmButtonText: '保存',
+            //     cancelButtonText: '放弃修改',
+            //     type: 'warning'
+            // })
+            //     .then(() => {
+            //         this.$emit('saveNum', this.editNum)
+            //     })
+            //     .catch(() => {
+            //         this.$message({
+            //             type: 'info',
+            //             message: '已放弃修改'
+            //         })
+            //         this.editNum = []
+            //         this.$emit('saveNum', this.editNum)
+            //     })
         },
         init() {
             this.tbData1 = []
@@ -192,7 +199,7 @@ export default {
     .legend-tab2 {
         position: absolute;
         top: -44px;
-        right: 44px;
+        right: 47px;
         width: 385px;
         // width: 420px;
         height: 535px;
@@ -229,9 +236,12 @@ export default {
         width: 20px;
         height: 22px;
         line-height: 20px;
+        margin: 0 auto;
         img {
-            width: 100%;
-            height: 100%;
+            display: block;
+            max-width: 100%;
+            max-height: 100%;
+            margin: 0 auto;
         }
     }
     .legendFoot {

+ 2 - 16
src/components/floorList.vue

@@ -44,6 +44,7 @@
     </div>
 </template>
 <script>
+import store from '../store'
 export default {
     data() {
         return {
@@ -76,15 +77,6 @@ export default {
     mounted() {
         this.init()
     },
-    watch: {
-        // 监听floorsArr的变化
-        // '$store.state.floorsArr': {
-        //     handler(newV, oldV) {
-        //         newV && this.init()
-        //     },
-        //     deep: true
-        // }
-    },
     methods: {
         mousedown() {
             this.startTime = new Date()
@@ -171,6 +163,7 @@ export default {
                 this.$cookie.set('currentFloorId', currentFloor.seq, 3)
                 this.floorId = this.$cookie.get('floorNow') || currentFloor.code
                 this.floorMapIdName = this.$cookie.get('floorMapId') || currentFloor.gname
+                store.commit('SETCURRENTFLOOR', currentFloor)
                 this.$emit('emitFloor', currentFloor)
             }
         },
@@ -231,19 +224,12 @@ export default {
         padding: 6px 4px;
         text-align: center;
         .floor-out {
-            // max-height: 260px;
             overflow: hidden;
-            // overflow-y: auto;
             position: relative;
-            // &::-webkit-scrollbar {
-            //     display: none;
-            // }
 
             .floor-center {
                 transition: all linear 0.8s;
                 .floor-item {
-                    // border: 1px solid blue;
-                    // width: 36px;
                     line-height: 28px;
                     height: 28px;
                     cursor: pointer;

+ 44 - 71
src/components/floorListOther.vue

@@ -6,19 +6,21 @@
 <template>
     <div class='floor-box'>
         <div class='floor-list'>
-            <div v-if='floorsArr.length>5'>
-                <i
-                    class='el-icon-caret-top icon-top'
+            <div class='icon-top' v-if='floorsArr.length>8'>
+                <img
                     :class='{disabled:currentFloorId == floorsArr[0].seq }'
                     v-if='showT'
                     @click='changeFloor(1)'
                     @mousedown='mousedown'
                     @mouseup='mouseup'
-                ></i>
-                <i class='el-icon-caret-top icon-top' :class='{disabled:currentFloorId == floorsArr[0].seq }' v-else style='color:#ccc'></i>
+                    src='@/assets/imgs/iconBlackTop.png'
+                    alt
+                />
+                <img :class='{disabled:currentFloorId == floorsArr[0].seq }' v-else src='@/assets/imgs/iconLightTop.png' alt />
             </div>
             <div class='floor-out'>
-                <div class='floor-center' :style='{ marginTop : marginTop }'>
+                <!-- :style='{ marginTop : marginTop }' -->
+                <div class='floor-center'>
                     <div
                         class='floor-item'
                         :class='item.seq == currentFloorId?"isActive":""'
@@ -28,19 +30,15 @@
                     >{{item.code}}</div>
                 </div>
             </div>
-            <div v-if='floorsArr.length>5'>
-                <i
-                    class='el-icon-caret-bottom icon-bottom'
+            <div class='icon-bottom' v-if='floorsArr.length>8'>
+                <img
                     :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }'
                     v-if='showB'
                     @click='changeFloor(-1)'
-                ></i>
-                <i
-                    class='el-icon-caret-bottom icon-bottom'
-                    :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }'
-                    v-else
-                    style='color:#ccc'
-                ></i>
+                    src='@/assets/imgs/iconBlackBottom.png'
+                    alt
+                />
+                <img :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }' v-else src='@/assets/imgs/iconLightBottom.png' alt />
             </div>
         </div>
     </div>
@@ -70,38 +68,14 @@ export default {
     props: {
         floorsArr: {
             type: Array
-            /*  default: () => {
-                return [
-                    { name: '第6层', code: 'F6', gname: 'f6', gcode: '6F', seq: 600 },
-                    { name: '第5层', code: 'F5', gname: 'f5', gcode: '5F', seq: 500 },
-                    { name: '第4层', code: 'F4', gname: 'f4', gcode: '4F', seq: 400 },
-                    { name: '第3层', code: 'F3', gname: 'f3', gcode: '3F', seq: 300 },
-                    { name: '第2层', code: 'F2', gname: 'f2', gcode: '2F', seq: 200 },
-                    { name: '第1层', code: 'F1', gname: 'f1', gcode: '1F', seq: 100 },
-                    { name: '地下1层', code: 'B1', gname: 'b1', gcode: 'B1', seq: -100 },
-                    { name: '地下2层', code: 'B2', gname: 'b2', gcode: 'B2', seq: -200 },
-                    { name: '地下3层', code: 'B3', gname: 'b3', gcode: 'B3', seq: -300 },
-                    { name: '地下4层', code: 'B4', gname: 'b4', gcode: 'B4', seq: -400 }
-                ]
-            } */
         }
     },
     mounted() {
         this.init()
     },
-    watch: {
-        // 监听floorsArr的变化
-        // '$store.state.floorsArr': {
-        //     handler(newV, oldV) {
-        //         newV && this.init()
-        //     },
-        //     deep: true
-        // }
-    },
     methods: {
         mousedown() {
             this.startTime = new Date()
-            console.log()
         },
         mouseup() {
             this.endTime = new Date()
@@ -239,57 +213,56 @@ export default {
         box-shadow: 0px 2px 15px 0px rgba(31, 36, 41, 0.08);
         border-radius: 2px;
         position: relative;
-        padding: 28px 4px;
+        padding: 6px 4px;
         text-align: center;
         .floor-out {
             overflow: hidden;
-            // overflow-y: auto;
             position: relative;
-            // &::-webkit-scrollbar {
-            //     display: none;
-            // }
-
             .floor-center {
                 transition: all linear 0.8s;
                 .floor-item {
-                    width: 36px;
-                    height: 32px;
+                    line-height: 28px;
+                    height: 28px;
                     cursor: pointer;
+                    position: relative;
+                    &::after {
+                        position: absolute;
+                        left: 50%;
+                        margin-left: -20%;
+                        bottom: -6px;
+                        content: '';
+                        width: 14px;
+                        height: 1px;
+                        background: rgba(195, 199, 203, 1);
+                        border: 0px solid rgba(228, 229, 231, 1);
+                    }
+                    & + .floor-item {
+                        margin-top: 10px;
+                    }
                 }
             }
         }
 
         .icon-top {
-            text-align: center;
-            font-size: 18px;
-            margin: 0 auto;
-            display: flex;
-            justify-content: center;
-            position: absolute;
-            top: 0;
-            right: 0;
-            width: 100%;
-            cursor: pointer;
-            line-height: 26px;
+            height: 18px;
+            img {
+                width: 18px;
+                height: 100%;
+                margin-top: -10px;
+            }
         }
         .icon-bottom {
-            text-align: center;
-            font-size: 18px;
-            margin: 0 auto;
-            display: flex;
-            justify-content: center;
-            position: absolute;
-            bottom: 0;
-            right: 0;
-            width: 100%;
-            cursor: pointer;
-            line-height: 26px;
+            height: 18px;
+            img {
+                width: 18px;
+                height: 100%;
+                margin-top: -10px;
+            }
         }
         .isActive {
             border-radius: 4px;
             color: #025baa;
             background: #e1f2ff;
-            line-height: 32px;
         }
     }
     .disabled {

+ 9 - 3
src/components/floorMap/canvasFun.vue

@@ -15,10 +15,10 @@
             <div class='small-block' @click='showText'>
                 <i>
                     <el-tooltip v-if='isShow' effect='dark' content='隐藏店铺名称' placement='top'>
-                        <img src='../../assets/imgs/er.png' alt />
+                        <img src='../../assets/imgs/yl.png' alt />
                     </el-tooltip>
                     <el-tooltip v-else effect='dark' content='显示店铺名称' placement='top'>
-                        <img src='../../assets/imgs/yl.png' alt />
+                        <img src='../../assets/imgs/er.png' alt />
                     </el-tooltip>
                 </i>
             </div>
@@ -102,7 +102,8 @@ export default {
             this.isShow = !this.isShow
             this.$emit('showText', this.isShow)
         }
-    }
+    },
+    mounted() {}
 }
 </script>
 <style lang="less" scoped>
@@ -150,6 +151,7 @@ export default {
     .el-slider__button {
         width: 13px;
         height: 13px;
+        border: 2px solid #025baa;
     }
     .el-slider__runway {
         height: 3px;
@@ -166,5 +168,9 @@ export default {
         border-top-left-radius: 1px;
         border-bottom-left-radius: 1px;
     }
+    .action-box .el-slider__runway {
+        background-color: #e8e8e8 !important;
+        background: #e8e8e8 !important;
+    }
 }
 </style>

+ 102 - 30
src/components/floorMap/index.vue

@@ -12,12 +12,13 @@
 </template>
 <script>
 import { SFengParser } from '@saga-web/feng-map'
-import { SFloorParser } from '@saga-web/big'
+import { SFloorParser, ItemOrder } from '@saga-web/big'
 import { FloorView } from '@/lib/FloorView'
 import { FloorScene } from '@/lib/FloorScene'
 import RoomBox from '@/views/room/index'
 import canvasFun from '@/components/floorMap/canvasFun'
 import { readGroup, queryStatis } from '@/api/public'
+import { queryShops } from '@/api/equipmentList.js'
 import { STopologyParser } from '@/lib/parsers/STopologyParser'
 import { mapGetters, mapActions } from 'vuex'
 import { SImageItem } from '@saga-web/graph/lib'
@@ -39,7 +40,8 @@ export default {
             canvasID: 'canvas',
             floorid: '', //楼层id
             topologyParser: null, // 解析器数据
-            fParser: null // 底图解析器
+            fParser: null, // 底图解析器
+            wellMap: {} // 电井控制商铺映射
         }
     },
     props: {
@@ -61,14 +63,15 @@ export default {
     },
     components: { RoomBox, canvasFun },
     computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap'])
+        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap', 'bunkObj'])
     },
     methods: {
         ...mapActions(['getfmapID']),
         init(floorid) {
-            this.loading = true
+            // this.loading = true
             this.floorid = floorid
             this.mapSize()
+            this.$refs.canvasFun.isShow = false
             setTimeout(() => {
                 if (this.haveFengMap) {
                     this.clearGraphy()
@@ -104,8 +107,12 @@ export default {
                         this.fParser = new SFloorParser(null)
                         this.fParser.parseData(res)
                         this.fParser.spaceList.forEach(t => {
-                            //   t.selectable = true;
                             this.scene.addItem(t)
+                            if (t.data.Name && this.bunkObj[t.data.Name]) {
+                                t.name = this.bunkObj[t.data.Name].detailtype
+                            } else {
+                                t.name = ''
+                            }
                         })
                         this.fParser.wallList.forEach(t => this.scene.addItem(t))
                         this.fParser.virtualWallList.forEach(t => this.scene.addItem(t))
@@ -135,18 +142,25 @@ export default {
                 if (!(data.Data && data.Data.length)) {
                     return false
                 }
+                // 请求回来的备注
+                if (data.Data && data.Data[0].Note) {
+                    let note = data.Data[0].Note
+                    bus.$emit('queryRemarksMethods', note)
+                } else {
+                    bus.$emit('queryRemarksMethods', '')
+                }
+                //土建系统的图例展示
                 if (this.$cookie.get('categoryId') == 'SCPZ') {
                     let scpzTable = []
                     scpzTable = data.Data[0].Elements.Nodes || []
                     this.$store.commit('SETSCPZTABLE', scpzTable)
                 }
-                //
-                //
-
                 // 放到后边 $cookie graphId
                 this.$cookie.set('graphId', data.Data[0].ID, 3)
                 if (this.$cookie.get('graphId')) {
-                    this.queryView()
+                    // 得到graphId 就请求图例
+                    // 除土建系统之外的图例展示 包括楼层功能
+                    bus.$emit('queryViewMethods')
                 }
                 this.topologyParser = new STopologyParser(null)
                 this.topologyParser.parseData(data.Data[0].Elements)
@@ -178,22 +192,6 @@ export default {
                 this.view.fitSceneToView()
             })
         },
-        // 查询图例
-        queryView() {
-            let postParams = {}
-            let data = {
-                graphId: this.$cookie.get('graphId'),
-                projectId: this.plazaId,
-                flag: false
-            }
-            queryStatis({ data, postParams }).then(res => {
-                this.loading = false
-                console.log('图例图例图例图例', res)
-                let viewTable = []
-                viewTable = res.data.Data ? res.data.Data : []
-                this.$store.commit('SETLEGENDTABLE', viewTable)
-            })
-        },
         clearGraphy() {
             if (this.view) {
                 this.view.scene = null
@@ -202,9 +200,81 @@ export default {
             this.view = new FloorView(`canvas${this.id}`)
         },
         listChange(item, ev) {
-            let name = ev[0][0].data.Name
-            if (name.slice(name.length - 2, name.length) == '机房') {
-                this.$refs.boxRoom.open({ name: name, type: this.type })
+            if (ev[0].length) {
+                let selectItem1 = ev[0][0],
+                    name = selectItem1.data.Name,
+                    location = selectItem1.data.AttachObjectIds[0] ? selectItem1.data.AttachObjectIds[0].id : ''
+                if (name.slice(name.length - 2, name.length) == '机房') {
+                    if (location) {
+                        this.$refs.boxRoom.open({ name: name, type: this.type, location: location })
+                    } else {
+                        this.$message('未添加位置类型')
+                    }
+                }
+                // 选中电井设置电井关联的商铺高亮
+                this.setHightLight(ev[0])
+            } else {
+                this.clearHightLight()
+            }
+        },
+        // 选中电井关联的商铺高亮
+        setHightLight(arr) {
+            this.clearHightLight()
+            arr.forEach(item => {
+                let location = item.data.AttachObjectIds[0] ? item.data.AttachObjectIds[0].id : ''
+                // 添加了位置类型并且选中的类型为电井类型
+                if (
+                    (item.data.GraphElementId == '100050' ||
+                        item.data.GraphElementId == '100055' ||
+                        item.data.GraphElementId == '100056' ||
+                        item.data.GraphElementId == '100057') &&
+                    location
+                ) {
+                    if (this.wellMap.hasOwnProperty(location)) {
+                        this.wellMap[location].forEach(item => {
+                            item.highLightFlag = true
+                            item.zOrder = 30
+                        })
+                    } else {
+                        let getParams = {
+                            plazaId: this.plazaId,
+                            floor: this.floorid,
+                            keyword: `${location}:wellnum;`
+                        }
+                        queryShops({ getParams }).then(res => {
+                            let shopsnumList = []
+                            let shopsnumItemList = []
+                            if (res.data && res.data.length) {
+                                for (let floor in res.data[0]) {
+                                    if (res.data[0][floor].length) {
+                                        res.data[0][floor].forEach(v => {
+                                            shopsnumList = shopsnumList.concat(v.shopsnumList.split(','))
+                                        })
+                                    }
+                                }
+                            }
+                            if (shopsnumList.length) {
+                                this.fParser.spaceList.forEach(item => {
+                                    if (shopsnumList.findIndex(name => name == item.data.Name) != -1) {
+                                        item.highLightFlag = true
+                                        item.zOrder = 30
+                                        shopsnumItemList.push(item)
+                                    }
+                                })
+                                this.wellMap[location] = shopsnumItemList
+                            }
+                        })
+                    }
+                }
+            })
+        },
+        // 清除电井关联商铺的高亮状态
+        clearHightLight() {
+            for (let key in this.wellMap) {
+                this.wellMap[key].forEach(item => {
+                    item.highLightFlag = false
+                    item.zOrder = ItemOrder.spaceOrder
+                })
             }
         },
         // 适配底图到窗口
@@ -232,6 +302,7 @@ export default {
             let scale = this.view.scale
             this.view.scaleByPoint(val / scale, this.canvasWidth / 2, this.canvasHeight / 2)
         },
+        // 小眼睛控制显示铺位名称
         showText(val) {
             // this.topologyParser.zoneLegendList.forEach(t => {
             //     t.showText = val
@@ -246,7 +317,8 @@ export default {
                 BuildingID: '1',
                 FloorID: FloorID,
                 categoryId: this.categoryId ? this.categoryId : this.$cookie.get('categoryId'),
-                projectId: this.urlMsg.ProjectID
+                projectId: this.urlMsg.ProjectID,
+                Pub: true
             }
             return readGroup(data)
         },
@@ -339,4 +411,4 @@ export default {
         width: 100%;
     }
 }
-</style>
+</style>

+ 85 - 10
src/components/legendremarks.vue

@@ -5,10 +5,11 @@
 */
 <template>
     <div class='editModel'>
-        <a-modal v-model='visible' :title='title' @ok='handleOk' ok-text='保存' cancel-text='取消' :maskClosable='false' :width='648'>
+        <a-modal v-model='visible' :title='title' :closable='false' :maskClosable='false' :width='648' :footer='null'>
+            <div class='edit-x' @click='handlCancel'>X</div>
             <div class='edit_container' style='width:600px;height:156px'>
                 <quill-editor
-                    v-model='remarksText'
+                    v-model='remarksTexts'
                     :options='editorOption'
                     @blur='onEditorBlur($event)'
                     @focus='onEditorFocus($event)'
@@ -17,17 +18,22 @@
                 ></quill-editor>
                 <p class='p1'>{{valLen||remarksText.length}}/200</p>
             </div>
+            <div class='edit-foot'>
+                <span @click='handlCancel'>取消</span>
+                <span @click='handleOk'>保存</span>
+            </div>
         </a-modal>
     </div>
 </template>
 <script>
 import { updateRead } from '@/api/public.js'
+import { mapGetters } from 'vuex'
 export default {
     name: 'EditdMarks',
     data() {
         return {
             valLen: 0, //输入字数限制
-            remarksText: '', //展示的备注
+            remarksTexts: '', //展示的备注
             editorOption: {
                 modules: {
                     toolbar: [['bold', 'underline'], [{ color: [] }]]
@@ -39,11 +45,36 @@ export default {
             visible: false
         }
     },
+    computed: {
+        ...mapGetters(['remarksText'])
+    },
     methods: {
+        // 点击取消
+        handlCancel() {
+            if (this.remarksTexts != this.remarksText) {
+                this.$confirm('是否保存编辑后的备注?', '提示', {
+                    confirmButtonText: '保存',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                })
+                    .then(() => {
+                        this.handleOk()
+                    })
+                    .catch(() => {
+                        this.$message({
+                            type: 'info',
+                            message: '已取消保存'
+                        })
+                        this.visible = false
+                    })
+            } else {
+                this.visible = false
+            }
+        },
         // val为传过来的备注
-        showModal(val) {
+        showModal() {
             this.visible = true
-            this.remarksText = val
+            this.remarksTexts = this.remarksText
         },
         // 更新底图备注
         markUpdate(val) {
@@ -55,7 +86,7 @@ export default {
                 }
             }
             updateRead(params).then(res => {
-                console.log('更新备注', res)
+                // console.log('更新备注', res)
                 this.$message({
                     showClose: true,
                     message: '更新成功',
@@ -67,20 +98,20 @@ export default {
         },
         // 点击保存
         handleOk() {
-            this.markUpdate(this.remarksText)
+            this.markUpdate(this.remarksTexts)
         },
         onEditorReady(editor) {},
         onEditorBlur(val) {},
         onEditorFocus(val) {},
         onEditorChange(val) {
             val.quill.deleteText(200, 6)
-            if (this.remarksText === '') {
+            if (this.remarksTexts === '') {
                 this.valLen = 0
             } else {
                 this.valLen = val.quill.getLength() - 1
             }
             if (val.html) {
-                this.remarksText = val.html
+                this.remarksTexts = val.html
             }
         }
     },
@@ -105,8 +136,19 @@ export default {
 }
 </style>
 <style lang="less" scoped>
+.editModel {
+}
+.edit-x {
+    position: absolute;
+    width: 9px;
+    height: 10px;
+    color: #000000;
+    right: 20px;
+    top: 20px;
+    cursor: pointer;
+}
 .edit_container {
-    margin: 10px 0 0;
+    margin: 0px;
     .p1 {
         position: absolute;
         bottom: 65px;
@@ -114,7 +156,40 @@ export default {
         margin-bottom: 0;
     }
 }
+.edit-foot {
+    height: 30px;
+    width: 100%;
+    margin-top: 20px;
+    display: flex;
+    justify-content: flex-end;
+    padding-top: 10px;
+    span {
+        height: 32px;
+        line-height: 32px;
+        border-radius: 2px;
+        width: 65px;
+        text-align: center;
+        font-size: 14px;
+        font-family: PingFangSC-Regular, PingFang SC;
+        font-weight: 400;
+        cursor: pointer;
+    }
+    span:nth-of-type(1) {
+        background: rgba(255, 255, 255, 1);
+        border: 1px solid rgba(0, 0, 0, 0.15);
+        margin-right: 8px;
+        color: rgba(0, 0, 0, 0.65);
+    }
+    span:nth-of-type(2) {
+        color: rgba(255, 255, 255, 1);
+        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+    }
+}
 .quill-editor {
     height: 130px;
 }
+// 修改保存按钮背景色
+/deep/ .ant-btn-primary {
+    background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+}
 </style>

+ 451 - 50
src/components/mapClass/EditScence.js

@@ -21,6 +21,12 @@ export class EditScence extends SGraphScene {
         this.undoStack = new SUndoStack();
         /** 命令 1 绘制直线 */
         this.cmd = 'choice';
+        /** 绘制区域时 是否为点选   */
+        this.isSelecting = false;
+        /** 是否开启吸附  */
+        this.isAbsorbing = false;
+        /** 吸附展示item    */
+        this.highLight = null;
         /** 当前选中焦点Item */
         this.focusItem = null;
         /**图例节点 */
@@ -29,10 +35,19 @@ export class EditScence extends SGraphScene {
         this.Markers = [];
         /**  管线对象 */
         this.Relations = [];
+        this._isEditStatus = true; // 是否可编辑
         /** 绘制图例样式 */
         this._legend = null;
+        /** fid=>item映射,由解析器存入   */
+        this.fidToItem = {};
         // // 选择绑定选额item事件
         this.selectContainer.connect("listChange", this, this.listChange);
+        ItemColor.spaceColor = new SColor("#A4ABB22B");
+        ItemColor.wallColor = new SColor("#A7AEB3FF");
+        ItemColor.columnColor = new SColor("#A7AEB3FF");
+        ItemColor.virtualWallColor = new SColor("#A7AEB3FF");
+        ItemColor.selectColor = new SColor("#84A0BB2B");
+        ItemColor.spaceBorderColor = new SColor("#A7AEB3FF");
     }
     /** 获取当前状态 */
     get getCmd() {
@@ -55,6 +70,12 @@ export class EditScence extends SGraphScene {
         }
     }
     ;
+    set isEditStatus(bol) {
+        this._isEditStatus = bol;
+    }
+    get isEditStatus() {
+        return this._isEditStatus;
+    }
     get getlegend() {
         return this._legend;
     }
@@ -93,6 +114,10 @@ export class EditScence extends SGraphScene {
         else if (obj.itemList[0] instanceof TipelineItem) {
             itemType = 'Line';
         }
+        else if (obj.itemList[0] instanceof SSpaceItem) { // 点选
+            this.clickToAddArea(obj.itemList[0]);
+            return;
+        }
         else {
             itemType = '';
         }
@@ -113,6 +138,13 @@ export class EditScence extends SGraphScene {
      * 增加线段item
      */
     addLine(event) {
+        const clickItem = this.clickIsItem(event);
+        if (clickItem) {
+            let centerPoint = clickItem.boundingRect().center();
+            const p = clickItem.mapToScene(centerPoint.x, centerPoint.y);
+            event.x = p.x;
+            event.y = p.y;
+        }
         const data = {
             /** ID */
             ID: uuid(),
@@ -124,7 +156,9 @@ export class EditScence extends SGraphScene {
             Pos: { X: 0, Y: 0 },
             /** 由应用自己定义  */
             Properties: {
-                Line: [{ X: event.x, Y: event.y }]
+                IconUrl: require("../../assets/images/t-line-hover.png"),
+                Line: [{ X: event.x, Y: event.y }],
+                LineWidth: 2
             }
         };
         const item = new SLineMarkerItem(null, data);
@@ -132,9 +166,11 @@ export class EditScence extends SGraphScene {
         item.zOrder = ItemOrder.lineOrder;
         item.selectable = true;
         this.addItem(item);
+        this.Markers.push(item);
         item.connect("finishCreated", this, this.finishCreated);
         this.grabItem = item;
-        this.Markers.push(item);
+        this.focusItem = item;
+        this.scenceUpdate(this);
         // this.undoStack.push(new SGraphAddCommand(this, item));
         // item.connect("onMove", this, this.onItemMove.bind(this));
         return true;
@@ -160,17 +196,22 @@ export class EditScence extends SGraphScene {
      * 增加管道 lenged
      */
     addTipelineItem(event) {
+        var _a;
+        const anc = this.clickIsAnchor(event);
+        if (anc) {
+            const p = anc.mapToScene(0, 0);
+            anc.isConnected = true;
+            event.x = p.x;
+            event.y = p.y;
+        }
         const LegendData = {
             ID: uuid(),
             Name: this._legend.Name,
-            GraphElementType: this._legend.Type,
-            Num: 1,
             GraphElementId: this._legend.Id,
-            AttachObjectIds: [],
-            Type: "Line",
             PointList: [{ X: event.x, Y: event.y }],
-            LineType: 0,
+            LineType: "Line",
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 LineDash: this._legend.LineDash,
                 LineWidth: this._legend.LineWidth,
                 Color: this._legend.Color,
@@ -187,6 +228,14 @@ export class EditScence extends SGraphScene {
         // this.undoStack.push(new SGraphAddCommand(this, item));
         this.grabItem = item;
         this.focusItem = item;
+        // 起始锚点
+        item.startAnchor = anc;
+        if (anc) {
+            (_a = anc.parent) === null || _a === void 0 ? void 0 : _a.connect('changePos', item, item.changePos);
+            item.anchor1ID = anc.id;
+            item.node1Id = anc.parent.id;
+        }
+        this.scenceUpdate(this);
         return true;
     }
     /**
@@ -206,6 +255,7 @@ export class EditScence extends SGraphScene {
             OutLine: [{ X: event.x, Y: event.y }],
             SubType: SubType,
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 StrokeColor: this._legend.Color,
                 FillColor: this._legend.FillColor,
                 LineDash: this._legend.LineDash,
@@ -231,10 +281,66 @@ export class EditScence extends SGraphScene {
         Polylines.zOrder = ItemOrder.polygonOrder;
         // Polylines.moveable = true;
         this.addItem(Polylines);
+        this.Nodes.push(Polylines);
         Polylines.connect("finishCreated", this, this.finishCreated);
         this.grabItem = Polylines;
         this.focusItem = Polylines;
-        this.Nodes.push(Polylines);
+        this.scenceUpdate(this);
+    }
+    /**
+     * 点选创建区域
+    */
+    clickToAddArea(item) {
+        if (this.cmd != 'Zone') {
+            return;
+        }
+        if (this.isSelecting && this._legend) {
+            //@ts-ignore
+            item.isExtracted = true;
+            const SubType = this._legend.SubType ? this._legend.SubType : '';
+            const LegendData = {
+                ID: uuid(),
+                Name: this._legend.Name,
+                GraphElementType: this._legend.Type,
+                Num: 1,
+                GraphElementId: this._legend.Id,
+                AttachObjectIds: [],
+                Type: "Zone",
+                Pos: { X: item.x, Y: item.y },
+                OutLine: item.pointArr[0],
+                SubType: SubType,
+                Properties: {
+                    IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
+                    StrokeColor: this._legend.Color,
+                    FillColor: this._legend.FillColor,
+                    LineDash: this._legend.LineDash,
+                    LineWidth: this._legend.LineWidth,
+                    font: 12,
+                    color: '',
+                    FID: item.data.SourceId,
+                    TextPos: { X: item.data.Location.Points[0].X, Y: -item.data.Location.Points[0].Y }
+                },
+            };
+            let Polylines = null;
+            if (SubType == "SCPZ") {
+                Polylines = new SSCPZZoneLegendItem(null, LegendData);
+            }
+            else if (SubType == "FHFQ") {
+                Polylines = new SFHFQZoneLegendItem(null, LegendData);
+            }
+            else {
+                Polylines = new SZoneLegendItem(null, LegendData);
+            }
+            Polylines.selectable = true;
+            //设置状态
+            Polylines.status = SItemStatus.Normal;
+            this.addItem(Polylines);
+            this.Nodes.push(Polylines);
+            Polylines.connect("finishCreated", this, this.finishCreated);
+            this.finishCreated(Polylines);
+            this.focusItem = Polylines;
+            this.scenceUpdate(this);
+        }
     }
     /**
      * 增加图片Item mark
@@ -252,6 +358,7 @@ export class EditScence extends SGraphScene {
             Pos: { X: event.x, Y: event.y },
             /** 由应用自己定义  */
             Properties: {
+                IconUrl: require(`../../assets/images/t-img-hover.png`),
                 Url: '',
             }
         };
@@ -260,10 +367,11 @@ export class EditScence extends SGraphScene {
         item.selectable = true;
         item.moveable = true;
         this.addItem(item);
+        this.Markers.push(item);
         this.grabItem == null;
         this.focusItem = item;
         this.cmd = 'choice';
-        this.Markers.push(item);
+        this.scenceUpdate(this);
     }
     /**
      * 增加文字item
@@ -280,9 +388,10 @@ export class EditScence extends SGraphScene {
             Pos: { X: event.x, Y: event.y },
             /** 由应用自己定义  */
             Properties: {
+                IconUrl: require(`../../assets/images/t-text-hover.png`),
                 Text: '请在右侧属性栏输入文字!',
                 Color: '',
-                Font: 0,
+                Font: 12,
                 BackgroundColor: ''
             }
         };
@@ -292,14 +401,17 @@ export class EditScence extends SGraphScene {
         item.moveable = true;
         item.zOrder = ItemOrder.textOrder;
         this.addItem(item);
-        this.grabItem == null;
-        this.cmd = 'choice';
         this.Markers.push(item);
+        this.grabItem = item;
+        this.focusItem = item;
+        this.cmd = 'choice';
+        this.scenceUpdate(this);
     }
     /**
      * 增加图标lenged图标
      */
     addIconItem(event) {
+        //获取信息工程化相关参数
         const LegendData = {
             ID: uuid(),
             Name: this._legend.Name,
@@ -312,23 +424,26 @@ export class EditScence extends SGraphScene {
             Rolate: { X: 0, Y: 0, Z: 0 },
             Size: { Width: 0, Height: 0 },
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Url: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Num: 1,
-                sWidth: 0,
-                sHeight: 0,
-                font: 0,
-                color: '' //字体颜色
+                sWidth: 24,
+                sHeight: 24,
+                font: 12,
+                color: '',
+                GraphCategoryId: this._legend.GraphCategoryId
             },
         };
         const item = new SImageLegendItem(null, LegendData);
-        this.grabItem == null;
         this.cmd = 'choice';
         item.selectable = true;
         item.moveable = true;
         item.zOrder = ItemOrder.markOrder;
-        // item.moveTo(event.x, event.y);
         this.addItem(item);
         this.Nodes.push(item);
+        this.grabItem = item;
+        this.focusItem = item;
+        this.scenceUpdate(this);
     }
     /**
      * 更改item对应属性
@@ -343,6 +458,7 @@ export class EditScence extends SGraphScene {
         if (this.focusItem) {
             const old = this.focusItem.text;
             this.focusItem.text = str;
+            this.scenceUpdate(this);
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "text", old, str));
         }
     }
@@ -379,7 +495,7 @@ export class EditScence extends SGraphScene {
     updatedFontColor(color) {
         if (this.focusItem) {
             let old = this.focusItem.color;
-            this.focusItem.color = color;
+            this.focusItem.color = new SColor(color);
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", old, color));
         }
     }
@@ -394,7 +510,7 @@ export class EditScence extends SGraphScene {
             }
             else {
                 // let old = this.focusItem.strokeColor;
-                this.focusItem.strokeColor = color;
+                this.focusItem.strokeColor = new SColor(color);
             }
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", old, color));
         }
@@ -451,7 +567,7 @@ export class EditScence extends SGraphScene {
      */
     updatedbackColor(color) {
         if (this.focusItem) {
-            this.focusItem.backgroundColor = color;
+            this.focusItem.backgroundColor = new SColor(color);
         }
     }
     /**
@@ -477,7 +593,7 @@ export class EditScence extends SGraphScene {
                 borderStyle = SLineStyle.Dotted;
             }
             else if (val == 'solid') {
-                borderStyle = SLineStyle.Soild;
+                borderStyle = SLineStyle.Solid;
             }
             this.focusItem.lineStyle = borderStyle;
         }
@@ -489,6 +605,7 @@ export class EditScence extends SGraphScene {
     upadataLengedName(val) {
         if (this.focusItem && this.focusItem.data) {
             this.focusItem.text = val;
+            this.scenceUpdate(this);
         }
     }
     /**
@@ -510,12 +627,21 @@ export class EditScence extends SGraphScene {
         }
     }
     /**
-   * 更改图例说明数量
-   * @param num number item数量 (只对icon设备类)
+   * 更改图例说
+   * @param num number
    */
-    upadatitemExplain(itemExplain) {
+    upadatitemExplain(ItemExplain) {
+        if (this.focusItem) {
+            this.focusItem.data.Properties.ItemExplain = ItemExplain;
+        }
+    }
+    /**
+     * 更新工程信息化的相关数据
+     * @param AttachObjectIds Array
+     */
+    upadatAttachObjectIds(AttachObjectIds) {
         if (this.focusItem) {
-            this.focusItem.itemExplain = itemExplain;
+            this.focusItem.data.AttachObjectIds = AttachObjectIds;
         }
     }
     /**
@@ -523,34 +649,51 @@ export class EditScence extends SGraphScene {
      */
     deleiteItem() {
         if (this.focusItem) {
-            this.removeItem(this.focusItem);
-            let a = -1;
-            this.Nodes.forEach((item, index) => {
-                if (item.id == this.focusItem.id) {
-                    a = index;
+            if ((this.focusItem instanceof SZoneLegendItem ||
+                this.focusItem instanceof SSCPZZoneLegendItem ||
+                this.focusItem instanceof SFHFQZoneLegendItem ||
+                this.focusItem instanceof TipelineItem) &&
+                this.focusItem.curIndex != -1) {
+                this.focusItem.deletePoint(this.focusItem.curIndex);
+            }
+            else {
+                this.removeItem(this.focusItem);
+                let a = -1;
+                this.Nodes.forEach((item, index) => {
+                    if (item.id == this.focusItem.id) {
+                        a = index;
+                    }
+                });
+                if (a > -1) {
+                    this.Nodes.splice(a, 1);
                 }
-            });
-            this.Nodes.splice(a, 1);
-            let b = -1;
-            this.Markers.forEach((item, index) => {
-                if (item.id == this.focusItem.id) {
-                    b = index;
+                let b = -1;
+                this.Markers.forEach((item, index) => {
+                    if (item.id == this.focusItem.id) {
+                        b = index;
+                    }
+                });
+                if (b > -1) {
+                    this.Markers.splice(b, 1);
                 }
-            });
-            this.Markers.splice(b, 1);
-            let c = -1;
-            this.Relations.forEach((item, index) => {
-                if (item.id == this.focusItem.id) {
-                    c = index;
+                let c = -1;
+                this.Relations.forEach((item, index) => {
+                    if (item.id == this.focusItem.id) {
+                        c = index;
+                    }
+                });
+                if (c > -1) {
+                    this.Relations.splice(c, 1);
                 }
-            });
-            this.Relations.splice(c, 1);
-            this.focusItem = null;
-        }
-        if (this.view) {
-            this.view.update();
+                this.focusItem = null;
+                if (this.view) {
+                    this.view.update();
+                }
+                this.scenceUpdate(this);
+            }
         }
     }
+    scenceUpdate(scence) { }
     /**
      * 对齐指定item
      * @param v
@@ -613,7 +756,21 @@ export class EditScence extends SGraphScene {
     ////////////////////////
     //  以下为鼠标键盘操作事件
     onMouseDown(event) {
+        if (!this.isEditStatus) {
+            return super.onMouseDown(event);
+        }
+        // 判断是否开启吸附,并且有吸附的点
+        if (this.isAbsorbing &&
+            this.highLight &&
+            this.highLight.visible) {
+            event.x = this.highLight.point.x;
+            event.y = this.highLight.point.y;
+        }
         if (this.grabItem) {
+            if (this.grabItem instanceof TipelineItem) {
+                this.setTipeEndanchor(event);
+                return true;
+            }
             return this.grabItem.onMouseDown(event);
         }
         switch (this.cmd) {
@@ -627,7 +784,13 @@ export class EditScence extends SGraphScene {
                 this.addImgItem(event);
                 break;
             case 'Zone':
-                this.addPolygonItem(event);
+                if (!this.isSelecting) {
+                    this.addPolygonItem(event);
+                }
+                else {
+                    // 点选创建区域
+                    return super.onMouseDown(event);
+                }
                 break;
             case 'Image':
                 this.addIconItem(event);
@@ -639,6 +802,20 @@ export class EditScence extends SGraphScene {
                 return super.onMouseDown(event);
         }
     }
+    onMouseMove(event) {
+        if (!this.isEditStatus) {
+            return super.onMouseMove(event);
+        }
+        if (this.isAbsorbing) {
+            if (!this.highLight) {
+                this.highLight = new HighlightItem(null);
+                this.addItem(this.highLight);
+            }
+            this.highLight.visible = false;
+            this.absorbSpace(event);
+        }
+        return super.onMouseMove(event);
+    }
     /**
      * 键盘事件
      *
@@ -646,12 +823,236 @@ export class EditScence extends SGraphScene {
      * @return	boolean
      */
     onKeyDown(event) {
+        if (!this.isEditStatus) {
+            return super.onKeyDown(event);
+        }
         if (this.grabItem) {
             this.grabItem.onKeyDown(event);
+            if (event.code == "Escape") {
+                const item = this.grabItem;
+                this.grabItem = null;
+                this.removeItem(item);
+                if (this.view) {
+                    this.view.update();
+                }
+                this.setCmd = 'choice';
+            }
         }
         // if (event.key == "Enter") {
         //     this.cmd = 0
         // }
         return false;
     }
+    /**
+     * 鼠标双击事件
+     *
+     * @param	event         事件参数
+     * @return	boolean
+     */
+    onDoubleClick(event) {
+        if (!this.isEditStatus) {
+            return true;
+        }
+        else {
+            return super.onDoubleClick(event);
+        }
+    } // Function onDoubleClick()
+    /**
+     * 设置结束锚点
+     *
+    */
+    setTipeEndanchor(event) {
+        var _a;
+        if (this.grabItem instanceof TipelineItem) {
+            if (this.grabItem.status == SItemStatus.Create) {
+                const anc = this.clickIsAnchor(event);
+                if (anc) {
+                    const p = anc.mapToScene(0, 0);
+                    anc.isConnected = true;
+                    event.x = p.x;
+                    event.y = p.y;
+                    if (this.grabItem.pointList.length) {
+                        this.grabItem.endAnchor = anc;
+                        (_a = anc.parent) === null || _a === void 0 ? void 0 : _a.connect('changePos', this.grabItem, this.grabItem.changePos);
+                    }
+                    this.grabItem.anchor2ID = anc.id;
+                    this.grabItem.node2Id = anc.parent.id;
+                    this.grabItem.onMouseDown(event);
+                    this.grabItem.status = SItemStatus.Normal;
+                    this.finishCreated(this.grabItem);
+                    return;
+                }
+            }
+            this.grabItem.onMouseDown(event);
+        }
+    }
+    /**
+     *  划线时点击位置是否是锚点
+     *
+     *  @param  event   事件
+     *  @param  len     限制距离
+     *  @return 点击的锚点
+     * */
+    clickIsAnchor(event) {
+        let minAnchor = null;
+        let len = -1;
+        this.Nodes.forEach(image => {
+            if (image.anchorList && image.anchorList.length) {
+                image.anchorList.forEach(anchor => {
+                    let anchorPoint = anchor.mapToScene(0, 0);
+                    let dis = SMathUtil.pointDistance(event.x, event.y, anchorPoint.x, anchorPoint.y);
+                    if (len < 0) {
+                        len = anchor.sceneDis;
+                    }
+                    if (dis < len) {
+                        minAnchor = anchor;
+                        len = dis;
+                    }
+                });
+            }
+        });
+        console.log('-----------------------');
+        console.log(minAnchor);
+        console.log('-----------------------');
+        return minAnchor;
+    }
+    /**
+     *  划线时点击位置是在文本,图片,,区域内
+     *
+     *  @param  event   事件
+     *  @return 点击的item
+     * */
+    clickIsItem(event) {
+        let minIten = null;
+        let len = -1;
+        let itemList = this.Nodes.concat(this.Markers);
+        itemList.forEach(item => {
+            if (item instanceof STextMarkerItem ||
+                item instanceof SImageMarkerItem ||
+                item instanceof SZoneLegendItem ||
+                item instanceof SFHFQZoneLegendItem ||
+                item instanceof SSCPZZoneLegendItem) {
+                let scenePoint = item.mapFromScene(event.x, event.y);
+                if (item.contains(scenePoint.x, scenePoint.y)) {
+                    let dis = SMathUtil.pointDistance(scenePoint.x, scenePoint.y, item.boundingRect().center().x, item.boundingRect().center().y);
+                    if (len < 0) {
+                        minIten = item;
+                        len = dis;
+                    }
+                    if (dis < len) {
+                        minIten = item;
+                        len = dis;
+                    }
+                }
+            }
+        });
+        console.log('-----------------------');
+        console.log(minIten);
+        console.log('-----------------------');
+        return minIten;
+    }
+    /**
+      *  点是否在吸附区域内
+      *
+      *  @param  p       要判断的点
+      *  @param  minX    空间区域
+      *  @param  minY    空间区域
+      *  @param  maxX    空间区域
+      *  @param  maxY    空间区域
+      */
+    static isPointInAbsorbArea(p, minX, maxX, minY, maxY) {
+        let rect = new SRect(minX - 1000, minY - 1000, maxX - minX + 2000, maxY - minY + 2000);
+        return rect.contains(p.x, p.y);
+    } // Function isPointInAbsorbArea()
+    /**
+     *  吸附空间
+     *
+     *  @param  event   鼠标事件对象
+     *  @return boolean 是否找到吸附的对象
+     */
+    absorbSpace(event) {
+        if (!this.highLight) {
+            return false;
+        }
+        let absorbLen = 1000;
+        if (this.view) {
+            absorbLen = 10 / this.view.scale;
+        }
+        let P = this.absorbSpacePoint(event, absorbLen);
+        if (P.Point) {
+            this.highLight.distance = P.MinDis;
+            this.highLight.point = new SPoint(P.Point.X, -P.Point.Y);
+            this.highLight.visible = true;
+            return true;
+        }
+        else {
+            let L = this.absorbSpaceLine(event, absorbLen);
+            if (L.Line && L.Point) {
+                this.highLight.distance = L.MinDis;
+                this.highLight.point = L.Point;
+                this.highLight.line = L.Line;
+                this.highLight.visible = true;
+                return true;
+            }
+            return false;
+        }
+    } // Function absorbSpace()
+    /**
+     *  吸附空间点
+     *
+     *  @param  event       鼠标事件对象
+     *  @param  absorbLen   吸附距离
+     *  @return MinDis      吸附的点
+     */
+    absorbSpacePoint(event, absorbLen) {
+        let minPointDis = Number.MAX_SAFE_INTEGER;
+        let Point;
+        this.spaceList.map((space) => {
+            if (EditScence.isPointInAbsorbArea(new SPoint(event.x, event.y), space.minX, space.maxX, space.minY, space.maxY)) {
+                space.data.OutLine.forEach((item) => {
+                    let minDis = SMathUtil.getMinDisPoint(new SPoint(event.x, event.y), item);
+                    if (minDis &&
+                        minDis.MinDis < absorbLen &&
+                        minDis.MinDis < minPointDis) {
+                        minPointDis = minDis.MinDis;
+                        Point = minDis.Point;
+                    }
+                });
+            }
+        });
+        return {
+            MinDis: minPointDis,
+            Point: Point
+        };
+    } // Function absorbSpacePoint()
+    /**
+     *  吸附空间线
+     *
+     *  @param  event       鼠标事件对象
+     *  @param  absorbLen   吸附距离
+     *  @return PointToLine 吸附的线
+     */
+    absorbSpaceLine(event, absorbLen) {
+        let minPointDis = Number.MAX_SAFE_INTEGER;
+        let Point, Line;
+        this.spaceList.forEach((space) => {
+            if (EditScence.isPointInAbsorbArea(new SPoint(event.x, event.y), space.minX, space.maxX, space.minY, space.maxY)) {
+                space.data.OutLine.forEach((item) => {
+                    let minDisLine = SMathUtil.getMinDisLine(new SPoint(event.x, event.y), item);
+                    if (minDisLine &&
+                        minDisLine.MinDis < absorbLen &&
+                        minDisLine.MinDis < minPointDis) {
+                        minPointDis = minDisLine.MinDis;
+                        Point = minDisLine.Point;
+                        Line = minDisLine.Line;
+                    }
+                });
+            }
+        });
+        return {
+            MinDis: minPointDis,
+            Point: Point,
+            Line: Line
+        };
+    } // Function absorbSpaceLine()
 }

+ 514 - 56
src/components/mapClass/EditScence.ts

@@ -45,6 +45,13 @@ export class EditScence extends SGraphScene {
             this.view.update();
         }
     };
+    /** 绘制区域时 是否为点选   */
+    isSelecting: boolean = false;
+
+    /** 是否开启吸附  */
+    isAbsorbing: boolean = false;
+    /** 吸附展示item    */
+    highLight: HighlightItem | null = null;
 
     /** 当前选中焦点Item */
     focusItem: SGraphItem | null = null;
@@ -55,10 +62,23 @@ export class EditScence extends SGraphScene {
     Markers: any = [];
     /**  管线对象 */
     Relations: any = [];
+    _isEditStatus: Boolean = true; // 是否可编辑
+    set isEditStatus(bol: Boolean): void {
+        this._isEditStatus = bol;
+    }
+    get isEditStatus(): Boolean {
+        return this._isEditStatus
+    }
     constructor() {
         super();
         // // 选择绑定选额item事件
         this.selectContainer.connect("listChange", this, this.listChange);
+        ItemColor.spaceColor = new SColor("#A4ABB22B")
+        ItemColor.wallColor = new SColor("#A7AEB3FF")
+        ItemColor.columnColor = new SColor("#A7AEB3FF")
+        ItemColor.virtualWallColor = new SColor("#A7AEB3FF")
+        ItemColor.selectColor = new SColor("#84A0BB2B")
+        ItemColor.spaceBorderColor = new SColor("#A7AEB3FF")
     }
     /** 绘制图例样式 */
     _legend: any | null = null;
@@ -69,6 +89,9 @@ export class EditScence extends SGraphScene {
         this._legend = obj;
         console.log('aaaaaa', obj)
     }
+    /** fid=>item映射,由解析器存入   */
+    fidToItem = {}
+
     /**
      * 监听变化
      * @param obj 变化后的对象
@@ -92,6 +115,9 @@ export class EditScence extends SGraphScene {
             itemType = 'Image'
         } else if (obj.itemList[0] instanceof TipelineItem) {
             itemType = 'Line'
+        } else if (obj.itemList[0] instanceof SSpaceItem) { // 点选
+            this.clickToAddArea(obj.itemList[0]);
+            return
         } else {
             itemType = ''
         };
@@ -113,6 +139,13 @@ export class EditScence extends SGraphScene {
      * 增加线段item
      */
     addLine(event: SMouseEvent): boolean {
+        const clickItem = this.clickIsItem(event);
+        if (clickItem) {
+            let centerPoint = clickItem.boundingRect().center();
+            const p = clickItem.mapToScene(centerPoint.x, centerPoint.y);
+            event.x = p.x;
+            event.y = p.y;
+        }
         const data = {
             /** ID */
             ID: uuid(),
@@ -124,7 +157,9 @@ export class EditScence extends SGraphScene {
             Pos: { X: 0, Y: 0 },
             /** 由应用自己定义  */
             Properties: {
-                Line: [{ X: event.x, Y: event.y }]
+                IconUrl: require("../../assets/images/t-line-hover.png"),
+                Line: [{ X: event.x, Y: event.y }],
+                LineWidth: 2
             }
         }
         const item = new SLineMarkerItem(null, data);
@@ -132,9 +167,11 @@ export class EditScence extends SGraphScene {
         item.zOrder = ItemOrder.lineOrder;
         item.selectable = true;
         this.addItem(item);
+        this.Markers.push(item);
         item.connect("finishCreated", this, this.finishCreated);
         this.grabItem = item;
-        this.Markers.push(item)
+        this.focusItem = item;
+        this.scenceUpdate(this);
         // this.undoStack.push(new SGraphAddCommand(this, item));
         // item.connect("onMove", this, this.onItemMove.bind(this));
         return true
@@ -162,17 +199,21 @@ export class EditScence extends SGraphScene {
      * 增加管道 lenged
      */
     addTipelineItem(event: SMouseEvent): boolean {
+        const anc = this.clickIsAnchor(event);
+        if (anc) {
+            const p = anc.mapToScene(0, 0)
+            anc.isConnected = true;
+            event.x = p.x;
+            event.y = p.y;
+        }
         const LegendData: Relation = {
             ID: uuid(),
             Name: this._legend.Name,
-            GraphElementType: this._legend.Type,
-            Num: 1,
             GraphElementId: this._legend.Id,
-            AttachObjectIds: [],
-            Type: "Line",
             PointList: [{ X: event.x, Y: event.y }],
-            LineType: 0,
+            LineType: "Line",
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 LineDash: this._legend.LineDash,
                 LineWidth: this._legend.LineWidth,
                 Color: this._legend.Color,
@@ -190,6 +231,14 @@ export class EditScence extends SGraphScene {
         // this.undoStack.push(new SGraphAddCommand(this, item));
         this.grabItem = item;
         this.focusItem = item;
+        // 起始锚点
+        item.startAnchor = anc;
+        if (anc) {
+            anc.parent ?.connect('changePos', item, item.changePos)
+            item.anchor1ID = anc.id;
+            item.node1Id = anc.parent.id;
+        }
+        this.scenceUpdate(this);
         return true
     }
 
@@ -197,8 +246,7 @@ export class EditScence extends SGraphScene {
      * 增加多边形item lenged
      */
     addPolygonItem(event: SMouseEvent): void {
-
-        const SubType = this._legend.SubType ? this._legend.SubType : ''
+        const SubType = this._legend.SubType ? this._legend.SubType : '';
         const LegendData: Legend = {
             ID: uuid(),
             Name: this._legend.Name,
@@ -211,6 +259,7 @@ export class EditScence extends SGraphScene {
             OutLine: [{ X: event.x, Y: event.y }],
             SubType: SubType,
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 StrokeColor: this._legend.Color,
                 FillColor: this._legend.FillColor,
                 LineDash: this._legend.LineDash,
@@ -234,10 +283,65 @@ export class EditScence extends SGraphScene {
         Polylines.zOrder = ItemOrder.polygonOrder;
         // Polylines.moveable = true;
         this.addItem(Polylines);
+        this.Nodes.push(Polylines);
         Polylines.connect("finishCreated", this, this.finishCreated);
         this.grabItem = Polylines;
         this.focusItem = Polylines;
-        this.Nodes.push(Polylines);
+        this.scenceUpdate(this);
+    }
+
+    /**
+     * 点选创建区域
+    */
+    clickToAddArea(item: SSpaceItem): void {
+        if (this.cmd != 'Zone') {
+            return
+        }
+        if (this.isSelecting && this._legend) {
+            //@ts-ignore
+            item.isExtracted = true
+            const SubType = this._legend.SubType ? this._legend.SubType : '';
+            const LegendData: Legend = {
+                ID: uuid(),
+                Name: this._legend.Name,
+                GraphElementType: this._legend.Type,
+                Num: 1,
+                GraphElementId: this._legend.Id,
+                AttachObjectIds: [],
+                Type: "Zone",
+                Pos: { X: item.x, Y: item.y },
+                OutLine: item.pointArr[0],
+                SubType: SubType,
+                Properties: {
+                    IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
+                    StrokeColor: this._legend.Color,
+                    FillColor: this._legend.FillColor,
+                    LineDash: this._legend.LineDash,
+                    LineWidth: this._legend.LineWidth,
+                    font: 12,
+                    color: '',
+                    FID: item.data.SourceId,
+                    TextPos: { X: item.data.Location.Points[0].X, Y: -item.data.Location.Points[0].Y }
+                },
+            }
+            let Polylines = null;
+            if (SubType == "SCPZ") {
+                Polylines = new SSCPZZoneLegendItem(null, LegendData);
+            } else if (SubType == "FHFQ") {
+                Polylines = new SFHFQZoneLegendItem(null, LegendData);
+            } else {
+                Polylines = new SZoneLegendItem(null, LegendData);
+            }
+            Polylines.selectable = true;
+            //设置状态
+            Polylines.status = SItemStatus.Normal;
+            this.addItem(Polylines);
+            this.Nodes.push(Polylines);
+            Polylines.connect("finishCreated", this, this.finishCreated);
+            this.finishCreated(Polylines)
+            this.focusItem = Polylines;
+            this.scenceUpdate(this);
+        }
     }
 
     /**
@@ -256,6 +360,7 @@ export class EditScence extends SGraphScene {
             Pos: { X: event.x, Y: event.y },
             /** 由应用自己定义  */
             Properties: {
+                IconUrl: require(`../../assets/images/t-img-hover.png`),
                 Url: '',
             }
         }
@@ -264,10 +369,11 @@ export class EditScence extends SGraphScene {
         item.selectable = true;
         item.moveable = true;
         this.addItem(item);
+        this.Markers.push(item);
         this.grabItem == null;
         this.focusItem = item;
         this.cmd = 'choice';
-        this.Markers.push(item)
+        this.scenceUpdate(this);
     }
 
     /**
@@ -285,9 +391,10 @@ export class EditScence extends SGraphScene {
             Pos: { X: event.x, Y: event.y },
             /** 由应用自己定义  */
             Properties: {
+                IconUrl: require(`../../assets/images/t-text-hover.png`),
                 Text: '请在右侧属性栏输入文字!',
                 Color: '',
-                Font: 0,
+                Font: 12,
                 BackgroundColor: ''
             }
         }
@@ -297,15 +404,18 @@ export class EditScence extends SGraphScene {
         item.moveable = true;
         item.zOrder = ItemOrder.textOrder;
         this.addItem(item);
-        this.grabItem == null
+        this.Markers.push(item);
+        this.grabItem = item;
+        this.focusItem = item;
         this.cmd = 'choice';
-        this.Markers.push(item)
+        this.scenceUpdate(this);
     }
 
     /**
      * 增加图标lenged图标
      */
     addIconItem(event: SMouseEvent): void {
+        //获取信息工程化相关参数
         const LegendData: Legend = {
             ID: uuid(),
             Name: this._legend.Name,
@@ -318,23 +428,26 @@ export class EditScence extends SGraphScene {
             Rolate: { X: 0, Y: 0, Z: 0 },
             Size: { Width: 0, Height: 0 },         // 大小
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Url: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Num: 1, // 此num与信息工程化得num无关
-                sWidth: 0,  //icon 的宽
-                sHeight: 0,   //icon 的高
-                font: 0,    //font
-                color: ''  //字体颜色
+                sWidth: 24,  //icon 的宽
+                sHeight: 24,   //icon 的高
+                font: 12,    //font
+                color: '',  //字体颜色
+                GraphCategoryId: this._legend.GraphCategoryId
             },
         }
         const item = new SImageLegendItem(null, LegendData);
-        this.grabItem == null
         this.cmd = 'choice';
         item.selectable = true;
         item.moveable = true;
         item.zOrder = ItemOrder.markOrder;
-        // item.moveTo(event.x, event.y);
         this.addItem(item);
         this.Nodes.push(item);
+        this.grabItem = item;
+        this.focusItem = item;
+        this.scenceUpdate(this);
     }
 
     /**
@@ -352,6 +465,7 @@ export class EditScence extends SGraphScene {
         if (this.focusItem) {
             const old = this.focusItem.text;
             this.focusItem.text = str;
+            this.scenceUpdate(this);
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "text", old, str));
         }
     }
@@ -392,7 +506,7 @@ export class EditScence extends SGraphScene {
     updatedFontColor(color: string): void {
         if (this.focusItem) {
             let old = this.focusItem.color;
-            this.focusItem.color = color;
+            this.focusItem.color = new SColor(color);
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", old, color));
         }
     }
@@ -404,10 +518,10 @@ export class EditScence extends SGraphScene {
     updatedBorderColor(color: string): void {
         if (this.focusItem) {
             if (this.focusItem instanceof SZoneLegendItem || this.focusItem instanceof SSCPZZoneLegendItem || this.focusItem instanceof SFHFQZoneLegendItem) {
-                this.focusItem.strokeColor = new SColor(color)
+                this.focusItem.strokeColor = new SColor(color);
             } else {
                 // let old = this.focusItem.strokeColor;
-                this.focusItem.strokeColor = color;
+                this.focusItem.strokeColor = new SColor(color);
             }
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", old, color));
         }
@@ -469,7 +583,7 @@ export class EditScence extends SGraphScene {
      */
     updatedbackColor(color: string): void {
         if (this.focusItem) {
-            this.focusItem.backgroundColor = color;
+            this.focusItem.backgroundColor = new SColor(color);
         }
     }
 
@@ -495,7 +609,7 @@ export class EditScence extends SGraphScene {
             } else if (val == 'dotted') {
                 borderStyle = SLineStyle.Dotted
             } else if (val == 'solid') {
-                borderStyle = SLineStyle.Soild
+                borderStyle = SLineStyle.Solid
             }
             this.focusItem.lineStyle = borderStyle;
         }
@@ -507,7 +621,8 @@ export class EditScence extends SGraphScene {
      */
     upadataLengedName(val: string): void {
         if (this.focusItem && this.focusItem.data) {
-            this.focusItem.text = val
+            this.focusItem.text = val;
+            this.scenceUpdate(this);
         }
     }
 
@@ -517,7 +632,7 @@ export class EditScence extends SGraphScene {
      */
     upadatImageNum(num: number): void {
         if (this.focusItem && this.focusItem.num) {
-            this.focusItem.num = num
+            this.focusItem.num = num;
         }
     }
 
@@ -527,16 +642,26 @@ export class EditScence extends SGraphScene {
      */
     upadatfillColor(fillColor: string): void {
         if (this.focusItem && this.focusItem.fillColor) {
-            this.focusItem.fillColor = new SColor(fillColor)
+            this.focusItem.fillColor = new SColor(fillColor);
         }
     }
     /**
-   * 更改图例说明数量
-   * @param num number item数量 (只对icon设备类)
+   * 更改图例说
+   * @param num number
    */
-    upadatitemExplain(itemExplain: string): void {
+    upadatitemExplain(ItemExplain: string): void {
+        if (this.focusItem) {
+            this.focusItem.data.Properties.ItemExplain = ItemExplain;
+        }
+    }
+
+    /**
+     * 更新工程信息化的相关数据
+     * @param AttachObjectIds Array
+     */
+    upadatAttachObjectIds(AttachObjectIds: []): void {
         if (this.focusItem) {
-            this.focusItem.itemExplain = itemExplain
+            this.focusItem.data.AttachObjectIds = AttachObjectIds;
         }
     }
 
@@ -545,34 +670,51 @@ export class EditScence extends SGraphScene {
      */
     deleiteItem(): void {
         if (this.focusItem) {
-            this.removeItem(this.focusItem);
-            let a = -1
-            this.Nodes.forEach((item: any, index: number) => {
-                if (item.id == this.focusItem.id) {
-                    a = index
+            if ((this.focusItem instanceof SZoneLegendItem ||
+                this.focusItem instanceof SSCPZZoneLegendItem ||
+                this.focusItem instanceof SFHFQZoneLegendItem ||
+                this.focusItem instanceof TipelineItem) &&
+                this.focusItem.curIndex != -1
+            ) {
+                this.focusItem.deletePoint(this.focusItem.curIndex);
+            } else {
+                this.removeItem(this.focusItem);
+                let a = -1
+                this.Nodes.forEach((item: any, index: number) => {
+                    if (item.id == this.focusItem.id) {
+                        a = index
+                    }
+                });
+                if (a > -1) {
+                    this.Nodes.splice(a, 1);
                 }
-            });
-            this.Nodes.splice(a, 1);
-            let b = -1;
-            this.Markers.forEach((item: any, index: number) => {
-                if (item.id == this.focusItem.id) {
-                    b = index
+                let b = -1;
+                this.Markers.forEach((item: any, index: number) => {
+                    if (item.id == this.focusItem.id) {
+                        b = index
+                    }
+                });
+                if (b > -1) {
+                    this.Markers.splice(b, 1);
                 }
-            });
-            this.Markers.splice(b, 1);
-            let c = -1;
-            this.Relations.forEach((item: any, index: number) => {
-                if (item.id == this.focusItem.id) {
-                    c = index
+                let c = -1;
+                this.Relations.forEach((item: any, index: number) => {
+                    if (item.id == this.focusItem.id) {
+                        c = index
+                    }
+                });
+                if (c > -1) {
+                    this.Relations.splice(c, 1);
                 }
-            });
-            this.Relations.splice(c, 1);
-            this.focusItem = null;
-        }
-        if (this.view) {
-            this.view.update();
+                this.focusItem = null;
+                if (this.view) {
+                    this.view.update();
+                }
+                this.scenceUpdate(this);
+            }
         }
     }
+    scenceUpdate(scence: any) { }
 
     /**
      * 对齐指定item
@@ -640,7 +782,23 @@ export class EditScence extends SGraphScene {
     ////////////////////////
     //  以下为鼠标键盘操作事件
     onMouseDown(event: SMouseEvent): any {
+        if (!this.isEditStatus) {
+            return super.onMouseDown(event);
+        }
+        // 判断是否开启吸附,并且有吸附的点
+        if (
+            this.isAbsorbing &&
+            this.highLight &&
+            this.highLight.visible
+        ) {
+            event.x = this.highLight.point.x;
+            event.y = this.highLight.point.y;
+        }
         if (this.grabItem) {
+            if (this.grabItem instanceof TipelineItem) {
+                this.setTipeEndanchor(event)
+                return true;
+            }
             return this.grabItem.onMouseDown(event);
         }
         switch (this.cmd) {
@@ -654,7 +812,12 @@ export class EditScence extends SGraphScene {
                 this.addImgItem(event)
                 break;
             case 'Zone':
-                this.addPolygonItem(event);
+                if (!this.isSelecting) {
+                    this.addPolygonItem(event);
+                } else {
+                    // 点选创建区域
+                    return super.onMouseDown(event)
+                }
                 break;
             case 'Image':
                 this.addIconItem(event);
@@ -667,6 +830,21 @@ export class EditScence extends SGraphScene {
         }
     }
 
+    onMouseMove(event: SMouseEvent): boolean {
+        if (!this.isEditStatus) {
+            return super.onMouseMove(event);
+        }
+        if (this.isAbsorbing) {
+            if (!this.highLight) {
+                this.highLight = new HighlightItem(null);
+                this.addItem(this.highLight);
+            }
+            this.highLight.visible = false;
+            this.absorbSpace(event);
+        }
+        return super.onMouseMove(event)
+    }
+
     /**
      * 键盘事件
      *
@@ -674,12 +852,292 @@ export class EditScence extends SGraphScene {
      * @return	boolean
      */
     onKeyDown(event: KeyboardEvent): any {
+        if (!this.isEditStatus) {
+            return super.onKeyDown(event);
+        }
         if (this.grabItem) {
             this.grabItem.onKeyDown(event);
+            if (event.code == "Escape") {
+                const item = this.grabItem;
+                this.grabItem = null
+                this.removeItem(item);
+                if (this.view) {
+                    this.view.update()
+                }
+                this.setCmd = 'choice'
+            }
         }
         // if (event.key == "Enter") {
         //     this.cmd = 0
         // }
         return false
     }
+
+
+    /**
+     * 鼠标双击事件
+     *
+     * @param	event         事件参数
+     * @return	boolean
+     */
+    onDoubleClick(event: SMouseEvent): boolean {
+        if (!this.isEditStatus) {
+            return true
+        }else{
+           return super.onDoubleClick(event);
+        }
+
+    } // Function onDoubleClick()
+
+    /**
+     * 设置结束锚点
+     *
+    */
+    setTipeEndanchor(event: SMouseEvent): void {
+        if (this.grabItem instanceof TipelineItem) {
+            if (this.grabItem.status == SItemStatus.Create) {
+                const anc = this.clickIsAnchor(event);
+                if (anc) {
+                    const p = anc.mapToScene(0, 0)
+                    anc.isConnected = true;
+                    event.x = p.x;
+                    event.y = p.y;
+                    if (this.grabItem.pointList.length) {
+                        this.grabItem.endAnchor = anc;
+                        anc.parent ?.connect('changePos', this.grabItem, this.grabItem.changePos)
+                    }
+                    this.grabItem.anchor2ID = anc.id
+                    this.grabItem.node2Id = anc.parent.id
+                    this.grabItem.onMouseDown(event)
+                    this.grabItem.status = SItemStatus.Normal;
+                    this.finishCreated(this.grabItem)
+                    return
+                }
+            }
+            this.grabItem.onMouseDown(event)
+        }
+    }
+
+    /**
+     *  划线时点击位置是否是锚点
+     *
+     *  @param  event   事件
+     *  @param  len     限制距离
+     *  @return 点击的锚点
+     * */
+    clickIsAnchor(event: SMouseEvent): SAnchorItem | null {
+        let minAnchor = null;
+        let len: number = -1;
+        this.Nodes.forEach(image => {
+            if (image.anchorList && image.anchorList.length) {
+                image.anchorList.forEach(anchor => {
+                    let anchorPoint = anchor.mapToScene(0, 0);
+                    let dis = SMathUtil.pointDistance(
+                        event.x,
+                        event.y,
+                        anchorPoint.x,
+                        anchorPoint.y
+                    );
+                    if (len < 0) {
+                        len = anchor.sceneDis;
+                    }
+                    if (dis < len) {
+                        minAnchor = anchor;
+                        len = dis;
+                    }
+                })
+            }
+        })
+        console.log('-----------------------')
+        console.log(minAnchor)
+        console.log('-----------------------')
+        return minAnchor;
+    }
+
+    /**
+     *  划线时点击位置是在文本,图片,,区域内
+     *
+     *  @param  event   事件
+     *  @return 点击的item
+     * */
+    clickIsItem(event: SMouseEvent): SGraphItem | null {
+        let minIten = null;
+        let len: number = -1;
+        let itemList = this.Nodes.concat(this.Markers);
+        itemList.forEach(item => {
+            if (
+                item instanceof STextMarkerItem ||
+                item instanceof SImageMarkerItem ||
+                item instanceof SZoneLegendItem ||
+                item instanceof SFHFQZoneLegendItem ||
+                item instanceof SSCPZZoneLegendItem
+            ) {
+                let scenePoint = item.mapFromScene(event.x, event.y);
+                if (item.contains(scenePoint.x, scenePoint.y)) {
+                    let dis = SMathUtil.pointDistance(
+                        scenePoint.x,
+                        scenePoint.y,
+                        item.boundingRect().center().x,
+                        item.boundingRect().center().y
+                    );
+                    if (len < 0) {
+                        minIten = item;
+                        len = dis;
+                    }
+                    if (dis < len) {
+                        minIten = item;
+                        len = dis;
+                    }
+                }
+            }
+        })
+        console.log('-----------------------')
+        console.log(minIten)
+        console.log('-----------------------')
+        return minIten;
+    }
+
+    /**
+      *  点是否在吸附区域内
+      *
+      *  @param  p       要判断的点
+      *  @param  minX    空间区域
+      *  @param  minY    空间区域
+      *  @param  maxX    空间区域
+      *  @param  maxY    空间区域
+      */
+    static isPointInAbsorbArea(
+        p: SPoint,
+        minX: number,
+        maxX: number,
+        minY: number,
+        maxY: number
+    ): boolean {
+        let rect = new SRect(
+            minX - 1000,
+            minY - 1000,
+            maxX - minX + 2000,
+            maxY - minY + 2000
+        );
+        return rect.contains(p.x, p.y);
+    } // Function isPointInAbsorbArea()
+
+    /**
+     *  吸附空间
+     *
+     *  @param  event   鼠标事件对象
+     *  @return boolean 是否找到吸附的对象
+     */
+    absorbSpace(event: SMouseEvent): boolean {
+        if (!this.highLight) {
+            return false;
+        }
+        let absorbLen = 1000;
+        if (this.view) {
+            absorbLen = 10 / this.view.scale;
+        }
+        let P = this.absorbSpacePoint(event, absorbLen);
+        if (P.Point) {
+            this.highLight.distance = P.MinDis;
+            this.highLight.point = new SPoint(P.Point.X, -P.Point.Y);
+            this.highLight.visible = true;
+            return true;
+        } else {
+            let L = this.absorbSpaceLine(event, absorbLen);
+            if (L.Line && L.Point) {
+                this.highLight.distance = L.MinDis;
+                this.highLight.point = L.Point;
+                this.highLight.line = L.Line;
+                this.highLight.visible = true;
+                return true;
+            }
+            return false;
+        }
+    } // Function absorbSpace()
+
+    /**
+     *  吸附空间点
+     *
+     *  @param  event       鼠标事件对象
+     *  @param  absorbLen   吸附距离
+     *  @return MinDis      吸附的点
+     */
+    absorbSpacePoint(event: SMouseEvent, absorbLen: number): MinDis {
+        let minPointDis = Number.MAX_SAFE_INTEGER;
+        let Point;
+        this.spaceList.map((space): void => {
+            if (
+                EditScence.isPointInAbsorbArea(
+                    new SPoint(event.x, event.y),
+                    space.minX,
+                    space.maxX,
+                    space.minY,
+                    space.maxY
+                )
+            ) {
+                space.data.OutLine.forEach((item): void => {
+                    let minDis = SMathUtil.getMinDisPoint(
+                        new SPoint(event.x, event.y),
+                        item
+                    );
+                    if (
+                        minDis &&
+                        minDis.MinDis < absorbLen &&
+                        minDis.MinDis < minPointDis
+                    ) {
+                        minPointDis = minDis.MinDis;
+                        Point = minDis.Point;
+                    }
+                });
+            }
+        });
+        return {
+            MinDis: minPointDis,
+            Point: Point
+        };
+    } // Function absorbSpacePoint()
+
+    /**
+     *  吸附空间线
+     *
+     *  @param  event       鼠标事件对象
+     *  @param  absorbLen   吸附距离
+     *  @return PointToLine 吸附的线
+     */
+    absorbSpaceLine(event: SMouseEvent, absorbLen: number): PointToLine {
+        let minPointDis = Number.MAX_SAFE_INTEGER;
+        let Point, Line;
+        this.spaceList.forEach((space): void => {
+            if (
+                EditScence.isPointInAbsorbArea(
+                    new SPoint(event.x, event.y),
+                    space.minX,
+                    space.maxX,
+                    space.minY,
+                    space.maxY
+                )
+            ) {
+                space.data.OutLine.forEach((item): void => {
+                    let minDisLine = SMathUtil.getMinDisLine(
+                        new SPoint(event.x, event.y),
+                        item
+                    );
+                    if (
+                        minDisLine &&
+                        minDisLine.MinDis < absorbLen &&
+                        minDisLine.MinDis < minPointDis
+                    ) {
+                        minPointDis = minDisLine.MinDis;
+                        Point = minDisLine.Point;
+                        Line = minDisLine.Line;
+                    }
+                });
+            }
+        });
+        return {
+            MinDis: minPointDis,
+            Point: Point,
+            Line: Line
+        };
+    } // Function absorbSpaceLine()
 }

+ 10 - 8
src/components/menuList.vue

@@ -5,7 +5,8 @@
             <div class='downright'></div>
             <div class='home-box'>
                 <img src='@/assets/imgs/logo.png' alt />
-                <span>{{plazas.length>0?formatter(plazaId,plazas):'--'}}</span>
+                <span>大连高新万达广场</span>
+                <!-- <span v-if='plazas'>{{plazas.length>0?formatter(plazaId,plazas):'--'}}</span> -->
             </div>
         </div>
         <div>
@@ -46,7 +47,7 @@ export default {
         return {
             state: '',
             list: [
-                { name: '首页', state: false, route: 'first' },
+                { name: '首页', state: false, route: 'homepage' },
                 { name: '项目概况', state: false, route: 'overview' },
                 { name: '楼层功能', state: false, route: 'floorFunc' }, //楼层功能
                 { name: '设备设施', state: false, route: 'equipment' }, //设备设施
@@ -61,7 +62,7 @@ export default {
             timer: null, //保存定时器
             // 路由词典
             dict: {
-                first: 1,
+                homepage: 1,
                 overview: 2,
                 floorFunc: 3,
                 equipment: 4,
@@ -101,14 +102,14 @@ export default {
             let res = null,
                 data = {
                     Distinct: true,
-                    Filters: `projectId=${this.plazaId};isPub=false`,
+                    Filters: `projectId='${this.plazaId}';isPub=false`,
                     PageNumber: 1,
                     PageSize: 500,
                     Projection: ['floorId']
                 }
             try {
                 // 调用接口
-                res = await queryDraftNum(data)
+                // res = await queryDraftNum(data)
             } catch (error) {
                 console.error(error)
             }
@@ -123,7 +124,7 @@ export default {
         toDrafts() {
             const { conf } = window.__systemConf,
                 { editerUrl } = conf
-            let data = `projectId=${this.plazaId}&fmapID=${this.fmapID}`
+            let data = `projectId=${this.plazaId}&fmapID=${this.fmapID}&token=${this.$store.state.ssoToken}`
             let url = editerUrl + 'drafts?' + encodeURIComponent(data)
             window.open(url, true)
         },
@@ -188,7 +189,7 @@ export default {
     font-size: 16px;
     background: rgba(255, 255, 255, 1);
     box-shadow: 0px 2px 10px 0px rgba(31, 35, 41, 0.1);
-    overflow: hidden;
+    // overflow: hidden;
     .home {
         width: 265px;
         height: 48px;
@@ -243,7 +244,7 @@ export default {
             float: left;
             width: 80px;
             height: 48px;
-            margin: 0 10px;
+            margin: 0 12px;
             cursor: pointer;
             transition: all 0.2s;
         }
@@ -251,6 +252,7 @@ export default {
             color: #025baa;
             font-weight: bolder;
             border-bottom: 2px solid #025baa;
+            padding: 0 8px;
             background: linear-gradient(180deg, rgba(2, 91, 170, 0) 0%, rgba(2, 91, 170, 0.2) 100%);
         }
     }

+ 29 - 17
src/components/viewLengend.vue

@@ -4,7 +4,7 @@
 *@info:图例展示状态
 */
 <template>
-    <div class='view'>
+    <div class='views'>
         <div v-if='systemName=="土建系统"'>
             <el-table
                 ref='dataTable'
@@ -18,7 +18,7 @@
                         <span>{{(row.Properties && row.Properties.ItemExplain)?row.Properties.ItemExplain:'--'}}</span>
                     </template>
                 </el-table-column>
-                <el-table-column prop label='图例' width='60'>
+                <el-table-column prop label='图例' width='60' align='center'>
                     <template slot-scope='{row}'>
                         <div class='scpz-img' :style='`background:${row.Properties.FillColor};border:1px solid ${row.Properties.StrokeColor}`'></div>
                     </template>
@@ -28,14 +28,14 @@
         <div v-else>
             <el-table
                 ref='dataTable'
-                v-if='legendTable.length>=0||viewTable.length>=0'
-                :data='legendTable ||viewTable'
+                v-if='legendTable.length>=0'
+                :data='legendTable'
                 tooltip-effect='dark'
                 style='width:100%;'
                 @selection-change='handleSelectionChange'
                 :header-cell-style='{background:"rgba(2,91,170,0.1)",fontFamily:"PingFangSC-Medium,PingFang SC;",color:"rgba(0,0,0,0.85);",fontSize:"12px"}'
             >
-                <el-table-column type='selection' width='45'></el-table-column>
+                <el-table-column type='selection' width='45' align='center'></el-table-column>
                 <el-table-column prop='Name' :show-overflow-tooltip='true' label='项目' width='100'>
                     <template slot-scope='{row}'>{{row.Name||'--'}}</template>
                 </el-table-column>
@@ -48,7 +48,7 @@
                 <el-table-column prop='Unit' label='单位' width='70'>
                     <template slot-scope='{row}'>{{row.Unit||'--'}}</template>
                 </el-table-column>
-                <el-table-column prop='Url' label='图例' width='55'>
+                <el-table-column prop='Url' label='图例' width='55' align='center'>
                     <template slot-scope='{row}'>
                         <div v-if='row.Url' class='Url-img'>
                             <img :src='`/serve/topology-wanda/Picture/query/${row.Url}`' alt />
@@ -63,7 +63,7 @@
             </div>
             <div class='remark' v-if='remarksText'>
                 <span class='remark-title'>注:</span>
-                <div v-html='remarksText' class='remark-text'></div>
+                <div :key='key' v-html='remarksText' class='remark-text'></div>
             </div>
         </div>
     </div>
@@ -72,11 +72,12 @@
 import bus from '@/utils/bus.js'
 import { mapGetters } from 'vuex'
 export default {
-    props: ['viewTable', 'loading', 'remarksText', 'systemName'],
+    props: ['loading', 'systemName'],
     data() {
         return {
             swich: true,
-            multipleSelection: []
+            multipleSelection: [],
+            key: 0
         }
     },
     methods: {
@@ -91,21 +92,29 @@ export default {
             this.$emit('changeSwitch', val)
         },
         setSelected() {
-            this.viewTable.forEach(t => {
+            this.legendTable.forEach(t => {
                 this.$refs.dataTable.toggleRowSelection(t, true)
             })
         }
     },
     computed: {
-        ...mapGetters(['scpzTable', 'legendTable'])
+        ...mapGetters(['scpzTable', 'legendTable', 'remarksText'])
     },
-    mounted() {
-        console.log(this.legendTable)
+    mounted() {},
+    watch: {
+        '$store.state.remarksText': {
+            handler(oVal, nVal) {
+                if (oVal != nVal) {
+                    this.key++
+                }
+            },
+            deep: true
+        }
     }
 }
 </script>
 <style lang="less" scoped>
-.view {
+.views {
     .swich {
         display: flex;
         justify-content: flex-end;
@@ -142,15 +151,18 @@ export default {
         width: 20px;
         height: 22px;
         line-height: 20px;
+        margin: 0 auto;
         img {
-            width: 100%;
-            height: 100%;
+            display: block;
+            max-width: 100%;
+            max-height: 100%;
+            margin: 0 auto;
         }
     }
 }
 </style>
 <style lang="less">
-.view {
+.views {
     .el-input--mini .el-input__inner {
         width: 50px;
     }

+ 21 - 5
src/lib/FloorScene.js

@@ -1,8 +1,15 @@
-import { SGraphScene } from "@saga-web/graph/lib"
-import { ItemColor } from "@saga-web/big";
-import { SColor } from '@saga-web/draw/lib';
+import { SMouseEvent } from "@saga-web/base";
+import {
+  SGraphScene
+} from "@saga-web/graph/lib"
+import {
+  ItemColor
+} from "@saga-web/big";
+import {
+  SColor
+} from '@saga-web/draw/lib';
 export class FloorScene extends SGraphScene {
-  constructor(){
+  constructor() {
     super()
     ItemColor.spaceColor = new SColor("#A4ABB22B")
     ItemColor.wallColor = new SColor("#A7AEB3FF")
@@ -11,4 +18,13 @@ export class FloorScene extends SGraphScene {
     ItemColor.selectColor = new SColor("#84A0BB2B")
     ItemColor.spaceBorderColor = new SColor("#A7AEB3FF")
   }
-}
+
+  onDoubleClick() {
+    return true
+  } // Function onDoubleClick()
+
+  onKeyDown() {
+    return true
+  }
+
+}

+ 25 - 3
src/lib/GraphView.js

@@ -2,7 +2,7 @@ import { SCanvasView, SColor } from "@saga-web/draw/lib";
 export class GraphView extends SCanvasView {
     constructor(id) {
         super(id);
-        // 0 :line 1:area
+        // 0 :line 1:area 2:img
         this._type = 0;
         // 线条颜色
         this._strokecolor = "";
@@ -12,6 +12,8 @@ export class GraphView extends SCanvasView {
         this._lineType = "";
         //线条粗细
         this._lineWidth = 1;
+        /** 图片地址 */
+        this._url = "";
     }
     get type() {
         return this._type;
@@ -48,6 +50,20 @@ export class GraphView extends SCanvasView {
         this._lineWidth = v;
         this.update();
     }
+    get url() {
+        return this._url;
+    }
+    set url(v) {
+        this._url = v;
+        this.img = new Image();
+        this.img.src = v;
+        this.img.onload = () => {
+            this.update();
+        };
+        this.img.onerror = (e) => {
+            this.update();
+        };
+    }
     onDraw(canvas) {
         canvas.clearRect(0, 0, this.width, this.height);
         canvas.pen.lineWidth = this.lineWidth;
@@ -60,10 +76,16 @@ export class GraphView extends SCanvasView {
         canvas.pen.color = new SColor(this.strokecolor);
         canvas.brush.color = new SColor(this.bgcolor);
         if (this.type == 0) {
-            canvas.drawLine(80, 57, 120, 57);
+            canvas.drawLine(0, 14, 28, 14);
         }
         else if (this.type == 1) {
-            canvas.drawRect(50, 28, 100, 57);
+            canvas.drawRect(0, 0, 28, 28);
+        }
+        else if (this.type == 2) {
+            if (this.img) {
+                console.log(this.img);
+                canvas.drawImage(this.img, 0, 0, 28, 28);
+            }
         }
     }
 }

+ 28 - 5
src/lib/GraphView.ts

@@ -1,7 +1,7 @@
 import { SCanvasView, SColor, SPainter } from "@saga-web/draw/lib"
 
 export class GraphView extends SCanvasView {
-    // 0 :line 1:area
+    // 0 :line 1:area 2:img
     _type: number = 0;
     get type(): number {
         return this._type
@@ -41,7 +41,6 @@ export class GraphView extends SCanvasView {
     }
 
     //线条粗细
-
     private _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth
@@ -51,6 +50,26 @@ export class GraphView extends SCanvasView {
         this.update()
     }
 
+    /** 图片dom */
+    img: CanvasImageSource | undefined;
+
+    /** 图片地址 */
+    private _url: string = "";
+    get url(): string {
+        return this._url;
+    }
+    set url(v: string) {
+        this._url = v;
+        this.img = new Image();
+        this.img.src = v;
+        this.img.onload = (): void => {
+            this.update();
+        };
+        this.img.onerror = (e): void => {
+            this.update();
+        };
+    }
+
     constructor(id: string) {
         super(id)
     }
@@ -67,10 +86,14 @@ export class GraphView extends SCanvasView {
         canvas.pen.color = new SColor(this.strokecolor);
         canvas.brush.color = new SColor(this.bgcolor);
         if (this.type == 0) {
-            canvas.drawLine(80, 57, 120, 57);
+            canvas.drawLine(0, 14, 28, 14);
         } else if (this.type == 1) {
-
-            canvas.drawRect(50, 28, 100, 57);
+            canvas.drawRect(0, 0, 28, 28);
+        } else if (this.type == 2) {
+            if (this.img) {
+                console.log(this.img)
+                canvas.drawImage(this.img, 0, 0, 28, 28)
+            }
         }
     }
 }

+ 86 - 0
src/lib/items/HighlightItem.js

@@ -0,0 +1,86 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SColor, SLine, SPoint, SRect } from "@saga-web/draw/lib";
+import { ItemOrder, ItemColor } from '@saga-web/big/lib';
+/**
+ * 吸附时高亮对象
+ *
+ * @author  郝建龙
+ */
+export class HighlightItem extends SGraphItem {
+    /**
+     * 构造函数
+     *
+     * @param   parent  指向父对象
+     */
+    constructor(parent) {
+        super(parent);
+        /** 对象与鼠标位置距离   */
+        this.distance = 0;
+        /** 对象类型   */
+        this.type = 1;
+        /** 点对象数据-当吸附的为线时,此点为垂线与线段的交点   */
+        this._point = new SPoint();
+        /** 点对象数据   */
+        this._line = new SLine();
+        this.visible = false;
+        this.zOrder = ItemOrder.highLightOrder;
+    } // Constructor
+    get point() {
+        return this._point;
+    } // Get point
+    set point(v) {
+        this._point = v;
+        this.type = 1;
+        this.update();
+    } // Set point
+    get line() {
+        return this._line;
+    } // Get line
+    set line(v) {
+        this._line = v;
+        this.type = 2;
+        this.update();
+    } // Set line
+    /**
+     * Item对象边界区域
+     *
+     * @return	SRect
+     */
+    boundingRect() {
+        return new SRect(this.point.x, this.point.y, 10, 10);
+    } // Function boundingRect()
+    /**
+     * Item绘制操作
+     *
+     * @param   painter painter对象
+     */
+    onDraw(painter) {
+        if (this.type == 2) {
+            painter.pen.color = ItemColor.highLightLineColor;
+            painter.pen.lineWidth = painter.toPx(6);
+            painter.drawLine(this.line);
+        }
+        painter.pen.color = SColor.Transparent;
+        painter.brush.color = ItemColor.highLightPointColor;
+        painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));
+    } // Function onDraw()
+} // Class HighlightItem

+ 93 - 0
src/lib/items/HighlightItem.ts

@@ -0,0 +1,93 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SColor, SLine, SPainter, SPoint, SRect } from "@saga-web/draw/lib";
+import { ItemOrder, ItemColor } from '@saga-web/big/lib';
+
+/**
+ * 吸附时高亮对象
+ *
+ * @author  郝建龙
+ */
+export class HighlightItem extends SGraphItem {
+    /** 对象与鼠标位置距离   */
+    distance: number = 0;
+    /** 对象类型   */
+    private type: number = 1;
+
+    /** 点对象数据-当吸附的为线时,此点为垂线与线段的交点   */
+    _point: SPoint = new SPoint();
+    get point(): SPoint {
+        return this._point;
+    } // Get point
+    set point(v: SPoint) {
+        this._point = v;
+        this.type = 1;
+        this.update();
+    } // Set point
+
+    /** 点对象数据   */
+    _line: SLine = new SLine();
+    get line(): SLine {
+        return this._line;
+    } // Get line
+    set line(v: SLine) {
+        this._line = v;
+        this.type = 2;
+        this.update();
+    } // Set line
+
+    /**
+     * 构造函数
+     *
+     * @param   parent  指向父对象
+     */
+    constructor(parent: SGraphItem | null) {
+        super(parent);
+        this.visible = false;
+        this.zOrder = ItemOrder.highLightOrder;
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return	SRect
+     */
+    boundingRect(): SRect {
+        return new SRect(this.point.x, this.point.y, 10, 10);
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter painter对象
+     */
+    onDraw(painter: SPainter): void {
+        if (this.type == 2) {
+            painter.pen.color = ItemColor.highLightLineColor;
+            painter.pen.lineWidth = painter.toPx(6);
+            painter.drawLine(this.line);
+        }
+        painter.pen.color = SColor.Transparent;
+        painter.brush.color = ItemColor.highLightPointColor;
+        painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));
+    } // Function onDraw()
+} // Class HighlightItem

+ 2 - 1
src/lib/items/SFHFQZoneLegendItem.js

@@ -1,7 +1,7 @@
 import { SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until";
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
-import { hexify } from "../../components/mapClass/until";
 /**
  *图例节点Item(区域类型 --防火分区)
  *
@@ -22,6 +22,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this._showText = true;
         /** 是否蒙版遮罩  */
         this._maskFlag = false;
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 28 - 4
src/lib/items/SFHFQZoneLegendItem.ts

@@ -3,8 +3,8 @@ import { SGraphItem } from "@saga-web/graph/lib";
 import { Legend } from '../types/Legend';
 import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until"
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
-import { hexify } from "../../components/mapClass/until";
 /**
  *图例节点Item(区域类型 --防火分区)
  *
@@ -105,6 +105,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;
@@ -142,9 +143,19 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
             }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
+            switch (data.Properties.LineDash) {
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
+                default:
+                    this.lineStyle = SLineStyle.Solid;
+            }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
         this.connect("finishCreated", this, () => {
@@ -165,6 +176,19 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this.data.Properties.FillColor = this.fillColor.value;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineWidth = this.lineWidth;
+        switch (this.lineStyle) {
+            case SLineStyle.Solid:
+                this.data.Properties.LineDash = "solid";
+                break;
+            case SLineStyle.Dotted:
+                this.data.Properties.LineDash = "dotted";
+                break;
+            case SLineStyle.Dashed:
+                this.data.Properties.LineDash = "dashed";
+                break;
+            default:
+                this.data.Properties.LineDash = "solid";
+        }
         this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,

+ 19 - 1
src/lib/items/SImageLegendItem.js

@@ -14,9 +14,10 @@ export class SImageLegendItem extends SIconTextItem {
      * @param data      图例节点对象数据
      */
     constructor(parent, data) {
-        super(parent);
+        super(parent, data.AnchorList);
         /** 图例数量 */
         this._num = 1;
+        this.isTransform = false;
         this.zOrder = ItemOrder.markOrder;
         this.data = data;
         this.id = data.ID;
@@ -35,6 +36,12 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
+        if (data.Properties.ImgPos) {
+            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
+        }
+        if (data.Properties.TextPos) {
+            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
+        }
         if (data.Properties && data.Properties.sWidth) {
             this.sWidth = data.Properties.sWidth;
         }
@@ -69,10 +76,21 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Size = { Width: this.width, Height: this.height };
         this.data.Name = this.name;
         this.data.Properties.Url = this.img.url;
+        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
+        this.data.Properties.ImgPos = { X: this.img.x, Y: this.img.y };
         this.data.Properties.sWidth = this.sWidth;
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;
         this.data.Properties.color = this.color.value;
+        this.data.AnchorList = this.anchorList.map(t => {
+            return {
+                ID: t.id,
+                Pos: {
+                    X: t.x,
+                    Y: t.y
+                }
+            };
+        });
         return this.data;
     }
 } // Class SImageLegendItem

+ 23 - 6
src/lib/items/SImageLegendItem.ts

@@ -26,7 +26,7 @@ export class SImageLegendItem extends SIconTextItem {
             this.data.Num = 1;
         }
         this.data.Properties.Num = this._num;
-        this.text = `${this.data.Name}${this.data.Num > 1?` × ${this.data.Num}`:''}`;
+        this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`;
         this.update();
     }
 
@@ -37,7 +37,8 @@ export class SImageLegendItem extends SIconTextItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent);
+        super(parent, data.AnchorList);
+        this.isTransform = false;
         this.zOrder = ItemOrder.markOrder;
         this.data = data;
         this.id = data.ID;
@@ -51,11 +52,17 @@ export class SImageLegendItem extends SIconTextItem {
             this.height = data.Size.Height;
         }
         if (data.Num) {
-            this.text = `${data.Name}${data.Num > 1?` × ${data.Num}`:''}`;
+            this.text = `${data.Name}${data.Num > 1 ? ` × ${data.Num}` : ''}`;
         }
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
+        if (data.Properties.ImgPos) {
+            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
+        }
+        if (data.Properties.TextPos) {
+            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
+        }
         if (data.Properties && data.Properties.sWidth) {
             this.sWidth = data.Properties.sWidth;
         }
@@ -71,15 +78,25 @@ export class SImageLegendItem extends SIconTextItem {
     }
 
     toData(): Legend {
-        this.data.Pos = {X: this.x, Y: this.y};
-        this.data.Size = {Width: this.width, Height: this.height};
+        this.data.Pos = { X: this.x, Y: this.y };
+        this.data.Size = { Width: this.width, Height: this.height };
         this.data.Name = this.name;
         this.data.Properties.Url = this.img.url;
+        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
+        this.data.Properties.ImgPos = { X: this.img.x, Y: this.img.y };
         this.data.Properties.sWidth = this.sWidth;
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;
         this.data.Properties.color = this.color.value;
-
+        this.data.AnchorList = this.anchorList.map(t => {
+            return {
+                ID: t.id,
+                Pos: {
+                    X: t.x,
+                    Y: t.y
+                }
+            }
+        })
         return this.data;
     }
 } // Class SImageLegendItem

+ 1 - 0
src/lib/items/SImageMarkerItem.js

@@ -15,6 +15,7 @@ export class SImageMarkerItem extends SImageItem {
     constructor(parent, data) {
         super(parent);
         this.zOrder = ItemOrder.imageOrder;
+        this.isTransform = false;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

+ 1 - 0
src/lib/items/SImageMarkerItem.ts

@@ -22,6 +22,7 @@ export class SImageMarkerItem extends SImageItem {
     constructor(parent: SGraphItem | null, data: Marker) {
         super(parent);
         this.zOrder = ItemOrder.imageOrder;
+        this.isTransform = false;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

+ 41 - 0
src/lib/items/SLineMarkerItem.js

@@ -15,6 +15,10 @@ export class SLineMarkerItem extends SLineItem {
      */
     constructor(parent, data) {
         super(parent);
+        /** 起始锚点  */
+        this.startItem = null;
+        /** 结束锚点  */
+        this.endItem = null;
         /** 是否蒙版遮罩  */
         this._maskFlag = false;
         this.zOrder = ItemOrder.lineOrder;
@@ -39,6 +43,20 @@ export class SLineMarkerItem extends SLineItem {
             this.strokeColor = new SColor(data.Properties.StrokeColor);
         }
     } // Constructor
+    /** 是否完成绘制  */
+    get status() {
+        return this._status;
+    }
+    set status(v) {
+        this._status = v;
+        if (v == SItemStatus.Edit) {
+            this.zOrder = ItemOrder.markOrder;
+        }
+        else {
+            this.zOrder = ItemOrder.lineOrder;
+        }
+        this.update();
+    }
     get maskFlag() {
         return this._maskFlag;
     }
@@ -49,6 +67,23 @@ export class SLineMarkerItem extends SLineItem {
         this._maskFlag = v;
         this.update();
     }
+    /** 接收事件作出修改  */
+    changePos() {
+        if (this.startItem) {
+            // 判断删除equip后,不移动
+            if (this.startItem.parent) {
+                let scenePoint = this.startItem.boundingRect().center();
+                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
+            }
+        }
+        if (this.endItem) {
+            // 删除equip后
+            if (this.endItem.parent) {
+                let scenePoint = this.endItem.boundingRect().center();
+                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
+            }
+        }
+    }
     toData() {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Properties.Line = this.line.map(pos => {
@@ -60,6 +95,12 @@ export class SLineMarkerItem extends SLineItem {
         this.data.Properties.LineWidth = this.lineWidth;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineStyle = this.lineStyle;
+        if (this.startItem && this.startItem.parent) {
+            this.data.Properties.StartItemId = this.startItem.id;
+        }
+        if (this.endItem && this.endItem.parent) {
+            this.data.Properties.EndItemId = this.endItem.id;
+        }
         return this.data;
     }
     onDraw(painter) {

+ 43 - 0
src/lib/items/SLineMarkerItem.ts

@@ -10,9 +10,28 @@ import { Marker } from '../types/Marker';
  * * @author  张宇(taohuzy@163.com)
  */
 export class SLineMarkerItem extends SLineItem {
+     /** 起始锚点  */
+    startItem: SGraphItem | null = null;
+    /** 结束锚点  */
+    endItem: SGraphItem | null = null;
+
     /** 标识对象数据 */
     data: Marker;
 
+    /** 是否完成绘制  */
+    get status(): SItemStatus {
+        return this._status;
+    }
+    set status(v: SItemStatus) {
+        this._status = v;
+        if (v == SItemStatus.Edit) {
+            this.zOrder = ItemOrder.markOrder;
+        } else {
+            this.zOrder = ItemOrder.lineOrder;
+        }
+        this.update();
+    }
+
     /** 是否蒙版遮罩  */
     _maskFlag: boolean = false;
     get maskFlag(): boolean {
@@ -57,6 +76,24 @@ export class SLineMarkerItem extends SLineItem {
         }
     } // Constructor
 
+    /** 接收事件作出修改  */
+    changePos() {
+        if (this.startItem) {
+            // 判断删除equip后,不移动
+            if (this.startItem.parent) {
+                let scenePoint: SPoint = this.startItem.boundingRect().center();
+                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
+            }
+        }
+        if (this.endItem) {
+            // 删除equip后
+            if (this.endItem.parent) {
+                let scenePoint: SPoint = this.endItem.boundingRect().center();
+                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
+            }
+        }
+    }
+
     toData(): Marker {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Properties.Line = this.line.map(pos => {
@@ -68,6 +105,12 @@ export class SLineMarkerItem extends SLineItem {
         this.data.Properties.LineWidth = this.lineWidth;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineStyle = this.lineStyle;
+        if (this.startItem && this.startItem.parent) {
+            this.data.Properties.StartItemId = this.startItem.id;
+        }
+        if (this.endItem && this.endItem.parent) {
+            this.data.Properties.EndItemId = this.endItem.id;
+        }
         return this.data;
     }
 

+ 2 - 1
src/lib/items/SSCPZZoneLegendItem.js

@@ -1,7 +1,7 @@
 import { SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until";
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
-import { hexify } from "../../components/mapClass/until";
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *
@@ -22,6 +22,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this._showText = true;
         /** 是否蒙版遮罩  */
         this._maskFlag = false;
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 28 - 4
src/lib/items/SSCPZZoneLegendItem.ts

@@ -3,8 +3,8 @@ import { SGraphItem } from "@saga-web/graph/lib";
 import { Legend } from '../types/Legend';
 import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until"
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
-import { hexify } from "../../components/mapClass/until";
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *
@@ -113,6 +113,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;
@@ -150,9 +151,19 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
             }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
+            switch (data.Properties.LineDash) {
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
+                default:
+                    this.lineStyle = SLineStyle.Solid;
+            }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
         this.connect("finishCreated", this, () => {
@@ -173,6 +184,19 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this.data.Properties.FillColor = this.fillColor.value;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineWidth = this.lineWidth;
+        switch (this.lineStyle) {
+            case SLineStyle.Solid:
+                this.data.Properties.LineDash = "solid";
+                break;
+            case SLineStyle.Dotted:
+                this.data.Properties.LineDash = "dotted";
+                break;
+            case SLineStyle.Dashed:
+                this.data.Properties.LineDash = "dashed";
+                break;
+            default:
+                this.data.Properties.LineDash = "solid";
+        }
         this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,

+ 1 - 0
src/lib/items/STextMarkerItem.js

@@ -16,6 +16,7 @@ export class STextMarkerItem extends STextItem {
     constructor(parent, data) {
         super(parent);
         this.zOrder = ItemOrder.textOrder;
+        this.isTransform = false;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

+ 2 - 0
src/lib/items/STextMarkerItem.ts

@@ -20,7 +20,9 @@ export class STextMarkerItem extends STextItem {
      */
     constructor(parent: SGraphItem | null, data: Marker) {
         super(parent);
+        this.isTransform = false;
         this.zOrder = ItemOrder.textOrder;
+        this.isTransform = false;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

+ 1 - 0
src/lib/items/SZoneLegendItem.js

@@ -22,6 +22,7 @@ export class SZoneLegendItem extends SPolygonItem {
         this._showText = true;
         /** 是否蒙版遮罩  */
         this._maskFlag = false;
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 28 - 3
src/lib/items/SZoneLegendItem.ts

@@ -5,6 +5,7 @@ import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
 import { hexify } from "@/components/mapClass/until"
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { SMouseEvent } from "@saga-web/base/lib";
 /**
  * 图例节点Item(区域类型)
  *
@@ -105,6 +106,7 @@ export class SZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;
@@ -143,9 +145,19 @@ export class SZoneLegendItem extends SPolygonItem {
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
             }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
+            switch (data.Properties.LineDash) {
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
+                default:
+                    this.lineStyle = SLineStyle.Solid;
+            }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
         this.connect("finishCreated", this, () => {
@@ -166,6 +178,19 @@ export class SZoneLegendItem extends SPolygonItem {
         this.data.Properties.FillColor = this.fillColor.value;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineWidth = this.lineWidth;
+        switch (this.lineStyle) {
+            case SLineStyle.Solid:
+                this.data.Properties.LineDash = "solid";
+                break;
+            case SLineStyle.Dotted:
+                this.data.Properties.LineDash = "dotted";
+                break;
+            case SLineStyle.Dashed:
+                this.data.Properties.LineDash = "dashed";
+                break;
+            default:
+                this.data.Properties.LineDash = "solid";
+        }
         this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,

+ 17 - 9
src/lib/parsers/STopologyParser.js

@@ -6,7 +6,8 @@ import { SImageMarkerItem } from '../items/SImageMarkerItem';
 import { SLineMarkerItem } from '../items/SLineMarkerItem';
 import { STextMarkerItem } from '../items/STextMarkerItem';
 import { TipelineItem } from '../items/TipelineItem';
-import { ItemOrder } from "@saga-web/big";
+import { SSCPZZoneLegendItem } from '../items/SSCPZZoneLegendItem';
+import { SFHFQZoneLegendItem } from '../items/SFHFQZoneLegendItem';
 /**
  * 拓扑图信息解析器
  *
@@ -64,10 +65,21 @@ export class STopologyParser extends SParser {
             this.noneLegendList.push(item);
         }
         else if (t.GraphElementType == "Zone") {
-            let item = new SZoneLegendItem(null, t);
-            item.selectable = true;
-            item.zOrder == ItemOrder.polygonOrder;
-            this.zoneLegendList.push(item);
+            if (t.SubType == "SCPZ") {
+                let item = new SSCPZZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
+            else if (t.SubType == "FHFQ") {
+                let item = new SFHFQZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
+            else {
+                let item = new SZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
         }
         else if (t.GraphElementType == 'Image') {
             let item = new SImageLegendItem(null, t);
@@ -85,18 +97,15 @@ export class STopologyParser extends SParser {
             let item = new SImageMarkerItem(null, t);
             this.imageMarkerList.push(item);
             item.selectable = true;
-            item.zOrder = ItemOrder.imageOrder;
         }
         else if (t.Type == "Line") {
             let item = new SLineMarkerItem(null, t);
             item.selectable = true;
-            item.zOrder = ItemOrder.lineOrder;
             this.lineMarkerList.push(item);
         }
         else if (t.Type == "Text") {
             let item = new STextMarkerItem(null, t);
             item.selectable = true;
-            item.zOrder = ItemOrder.lineOrder;
             this.textMarkerList.push(item);
         }
     } // Function addMarker()
@@ -108,7 +117,6 @@ export class STopologyParser extends SParser {
     addRelation(t) {
         let item = new TipelineItem(null, t);
         item.selectable = true;
-        item.zOrder == ItemOrder.polylineOrder;
         this.relationList.push(item);
     } // Function addRelation()
 } // class STopologyParser

+ 15 - 8
src/lib/parsers/STopologyParser.ts

@@ -15,6 +15,8 @@ import { STextMarkerItem } from '../items/STextMarkerItem';
 import { TipelineItem } from '../items/TipelineItem';
 import { ItemOrder } from "@saga-web/big";
 import { SItemStatus } from "@saga-web/big";
+import { SSCPZZoneLegendItem } from '../items/SSCPZZoneLegendItem';
+import { SFHFQZoneLegendItem } from '../items/SFHFQZoneLegendItem';
 /**
  * 拓扑图信息解析器
  *
@@ -72,10 +74,19 @@ export class STopologyParser extends SParser {
             let item = new SNoneLegendItem(null, t);
             this.noneLegendList.push(item);
         } else if (t.GraphElementType == "Zone") {
-            let item = new SZoneLegendItem(null, t);
-            item.selectable = true;
-            item.zOrder == ItemOrder.polygonOrder;
-            this.zoneLegendList.push(item);
+            if (t.SubType == "SCPZ") {
+                let item = new SSCPZZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            } else if (t.SubType == "FHFQ") {
+                let item = new SFHFQZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            } else {
+                let item = new SZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
         } else if (t.GraphElementType == 'Image') {
             let item = new SImageLegendItem(null, t);
             item.selectable = true;
@@ -93,16 +104,13 @@ export class STopologyParser extends SParser {
             let item = new SImageMarkerItem(null, t);
             this.imageMarkerList.push(item);
             item.selectable = true;
-            item.zOrder = ItemOrder.imageOrder;
         } else if (t.Type == "Line") {
             let item = new SLineMarkerItem(null, t);
             item.selectable = true;
-            item.zOrder = ItemOrder.lineOrder;
             this.lineMarkerList.push(item);
         } else if (t.Type == "Text") {
             let item = new STextMarkerItem(null, t);
             item.selectable = true;
-            item.zOrder = ItemOrder.lineOrder;
             this.textMarkerList.push(item);
         }
     } // Function addMarker()
@@ -115,7 +123,6 @@ export class STopologyParser extends SParser {
     private addRelation(t: Relation): void {
         let item = new TipelineItem(null, t);
         item.selectable = true;
-        item.zOrder == ItemOrder.polylineOrder;
         this.relationList.push(item);
     } // Function addRelation()
 } // class STopologyParser

+ 3 - 2
src/lib/types/Legend.ts

@@ -23,6 +23,7 @@ import { Anchor } from "./Anchor";
 import { SGraphElementType } from "./../enums/SGraphElementType";
 import { Point } from "@saga-web/big/lib/types/Point";
 import { Size } from "@saga-web/big/lib/types/Size";
+import { SPoint } from '@saga-web/draw/lib';
 
 /**
  * 图例节点接口
@@ -37,7 +38,7 @@ export interface Legend {
     /** 返回工程信息化对象 ID 列表 */
     AttachObjectIds?: string[];
     /** 图标,区域类型  */
-    GraphElementType: SGraphElementType;
+    GraphElementType: string;
     /** 对应的图例ID  */
     GraphElementId: string;
     /** 图例数量  */
@@ -55,7 +56,7 @@ export interface Legend {
     /** 锚点List  */
     AnchorList?: Anchor[];
     /** 轮廓线  */
-    OutLine?: Point[];
+    OutLine?: Point[] | SPoint[];
     /** 由应用自己定义  */
     Properties?: any;
      /** zone 区分防火分区和石材铺装  */

+ 1 - 1
src/lib/types/Relation.ts

@@ -47,7 +47,7 @@ export interface Relation {
     /** 方向(0:无向,1:节点1到节点2,2:节点2到节点1) */
     Dir?: SRelationDir;
     /** 线类型(0:直线,1:水平/垂直线,2:曲线) */
-    LineType: SLineType;
+    LineType: string;
     /** 线的顶点坐标 */
     PointList: Point[];
     /** 线的绘图样式 */

+ 32 - 3
src/main.js

@@ -35,6 +35,7 @@ import cookies from 'vue-cookie';
 Vue.use(cookies);
 import Pui from 'meri-design';
 import 'meri-design/dist/index.css';
+import "leaflet/dist/leaflet.css";
 Vue.use(Pui);
 //////////模拟传入参数
 const username = 'lengqiang';
@@ -45,10 +46,38 @@ router.beforeEach((to, from, next) => __awaiter(void 0, void 0, void 0, function
         yield store.dispatch('getUserInfo', username);
         yield store.dispatch('getFloors');
     }
-    next();
-}));
+import Vue from 'vue'
+import App from './App.vue'
+import router from './router'
+import store from './store'
+Vue.config.productionTip = false
+import design from 'ant-design-vue'
+import 'ant-design-vue/dist/antd.css'
+Vue.use(design)
+import ElementUI from 'element-ui'
+import 'element-ui/lib/theme-chalk/index.css'
+Vue.use(ElementUI)
+import VueQuillEditor from 'vue-quill-editor'
+import 'quill/dist/quill.core.css'
+import 'quill/dist/quill.snow.css'
+import 'quill/dist/quill.bubble.css'
+Vue.use(VueQuillEditor)
+import WdEditor from '@/components/Editor'
+Vue.use(WdEditor)
+import Rotation from '@/components/Rotation'
+Vue.use(Rotation)
+import PicLarge from '@/components/PicLarge'
+Vue.use(PicLarge)
+import Legend from '@/components/Legend'
+Vue.use(Legend)
+import cookies from 'vue-cookie'
+Vue.use(cookies)
+import Pui from 'meri-design'
+import 'meri-design/dist/index.css'
+Vue.use(Pui)
+
 new Vue({
     router,
     store,
     render: (h) => h(App),
-}).$mount('#app');
+}).$mount('#app')

+ 4 - 1
src/main.ts

@@ -1,7 +1,8 @@
+ 
 import Vue from 'vue'
-import App from './App.vue'
 import router from './router'
 import store from './store'
+import App from './App.vue'
 Vue.config.productionTip = false
 
 import design from 'ant-design-vue'
@@ -27,12 +28,14 @@ import cookies from 'vue-cookie'
 Vue.use(cookies)
 import Pui from 'meri-design'
 import 'meri-design/dist/index.css'
+import "leaflet/dist/leaflet.css";
 Vue.use(Pui)
 
 //////////模拟传入参数
 const username = 'lengqiang'
 /////////////////
 // 在跳入路由之前要请求获取权限信息
+console.log(store.state.isrequestAuth)
 router.beforeEach(async (to, from, next) => {
     if (!store.state.isrequestAuth) {
         await store.dispatch('getUserInfo', username)

+ 0 - 0
src/router/index.js


Some files were not shown because too many files changed in this diff