fujunwen il y a 4 ans
Parent
commit
7fcdb991e3
100 fichiers modifiés avec 109200 ajouts et 33367 suppressions
  1. 0 3
      .gitignore
  2. 59 59
      package.json
  3. 3 8
      public/index.html
  4. 6 4
      public/systemConf.js
  5. 16 12
      src/App.vue
  6. 1 9
      src/api/coreDeviceReport.js
  7. 0 1
      src/api/equipmentList.js
  8. 0 14
      src/api/ganttChart.js
  9. 8 7
      src/api/httputils.js
  10. 1 10
      src/api/specificationUpdateRecord.js
  11. 1 31986
      src/assets/china.json
  12. 6869 0
      src/assets/geoData/ChinaBorder.json
  13. 1 0
      src/assets/geoData/china.json
  14. BIN
      src/assets/imgs/analysis/picture.png
  15. BIN
      src/assets/imgs/analysis/report_pdf.png
  16. BIN
      src/assets/imgs/analysis/report_word.png
  17. BIN
      src/assets/provinceData.rar
  18. 1944 0
      src/assets/provinceData/anhui.json
  19. 1413 0
      src/assets/provinceData/beijing.json
  20. 1931 0
      src/assets/provinceData/chongqing.json
  21. 2581 0
      src/assets/provinceData/fujian.json
  22. 2119 0
      src/assets/provinceData/gansu.json
  23. 2854 0
      src/assets/provinceData/guangdong.json
  24. 2213 0
      src/assets/provinceData/guangxi.json
  25. 2279 0
      src/assets/provinceData/guizhou.json
  26. 1722 0
      src/assets/provinceData/hebei.json
  27. 2225 0
      src/assets/provinceData/heilongjiang.json
  28. 2097 0
      src/assets/provinceData/henan.json
  29. 2211 0
      src/assets/provinceData/hubei.json
  30. 2126 0
      src/assets/provinceData/hunan.json
  31. 1468 0
      src/assets/provinceData/jiangsu.json
  32. 1798 0
      src/assets/provinceData/jiangxi.json
  33. 2745 0
      src/assets/provinceData/jilin.json
  34. 2587 0
      src/assets/provinceData/liaoning.json
  35. 1756 0
      src/assets/provinceData/neimenggu.json
  36. 1220 0
      src/assets/provinceData/ningxia.json
  37. 1956 0
      src/assets/provinceData/qinghai.json
  38. 2261 0
      src/assets/provinceData/shandong.json
  39. 982 0
      src/assets/provinceData/shanghai.json
  40. 1264 0
      src/assets/provinceData/shanxi1.json
  41. 813 0
      src/assets/provinceData/shanxi2.json
  42. 2039 0
      src/assets/provinceData/sichuan.json
  43. 1249 0
      src/assets/provinceData/tianjin.json
  44. 1250 0
      src/assets/provinceData/xinjiang.json
  45. 2315 0
      src/assets/provinceData/xizang.json
  46. 1814 0
      src/assets/provinceData/yunnan.json
  47. 3074 0
      src/assets/provinceData/zhejiang.json
  48. 5100 0
      src/assets/regionData/dongbei.json
  49. 5011 0
      src/assets/regionData/dongnan.json
  50. 2938 0
      src/assets/regionData/huabei.json
  51. 1932 0
      src/assets/regionData/huadong.json
  52. 4164 0
      src/assets/regionData/huanan.json
  53. 3453 0
      src/assets/regionData/huazhong.json
  54. 6384 0
      src/assets/regionData/other.json
  55. 4626 0
      src/assets/regionData/xibei.json
  56. 3573 0
      src/assets/regionData/xinan.json
  57. 4588 0
      src/assets/regionData/zhongnan.json
  58. 0 21
      src/assets/svg/menu.svg
  59. 0 16
      src/assets/svg/picture.svg
  60. 0 20
      src/assets/svg/plan_time.svg
  61. 0 18
      src/assets/svg/real_time.svg
  62. 0 19
      src/assets/svg/report.svg
  63. 0 18
      src/assets/svg/task.svg
  64. 83 34
      src/components/Legend/src/legend.vue
  65. 39 3
      src/components/Rotation/src/rotation.vue
  66. 91 51
      src/components/editLengend.vue
  67. 13 0
      src/components/floorList.vue
  68. 28 25
      src/components/floorMap/index.vue
  69. 3 3
      src/components/menuList.vue
  70. 5 4
      src/components/viewLengend.vue
  71. 1 1
      src/lib/items/SFHFQZoneLegendItem.js
  72. 1 1
      src/lib/items/SFHFQZoneLegendItem.ts
  73. 11 0
      src/lib/items/SImageLegendItem.js
  74. 58 48
      src/lib/items/SImageLegendItem.ts
  75. 1 1
      src/lib/items/SSCPZZoneLegendItem.js
  76. 1 1
      src/lib/items/SSCPZZoneLegendItem.ts
  77. 1 0
      src/lib/items/TipelineItem.js
  78. 1 0
      src/lib/items/TipelineItem.ts
  79. 5 21
      src/main.ts
  80. 22 20
      src/router/index.js
  81. 37 17
      src/store/index.js
  82. 60 153
      src/utils/ganttChart/GanttChart.js
  83. 568 0
      src/utils/ganttChart/GanttChart_day.js
  84. 574 0
      src/utils/ganttChart/GanttChart_month.js
  85. 0 438
      src/utils/ganttChart/GanttChart_old.js
  86. 66 47
      src/views/analysis/CoreDeviceReport.vue
  87. 326 174
      src/views/analysis/GanttChart.vue
  88. 9 44
      src/views/analysis/SpecificationUpdateRecord.vue
  89. 0 8
      src/views/analysis/index.vue
  90. 8 6
      src/views/equipment/eqDialog.vue
  91. 17 5
      src/views/equipment/index.vue
  92. 25 10
      src/views/equipment/table/djspTable.vue
  93. 13 2
      src/views/equipment/table/eqListTable.vue
  94. 13 1
      src/views/equipment/table/standTable.vue
  95. 1 0
      src/views/equipment/table/wbTable.vue
  96. 6 3
      src/views/equipment/table/wxTable.vue
  97. 30 12
      src/views/homepage/index.vue
  98. 13 9
      src/views/legendLibrary/addForm.vue
  99. 30 0
      src/views/legendLibrary/addLegend.vue
  100. 0 0
      src/views/legendLibrary/index.vue

+ 0 - 3
.gitignore

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

+ 59 - 59
package.json

@@ -1,61 +1,61 @@
 {
-  "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",
-    "lodash": "^4.17.19",
-    "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"
-  }
+    "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.22",
+        "@saga-web/big": "1.0.73",
+        "@saga-web/draw": "2.1.100",
+        "@saga-web/feng-map": "1.0.20",
+        "@saga-web/graph": "2.1.105",
+        "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",
+        "lodash": "^4.17.19",
+        "meri-design": "^1.3.4",
+        "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"
+    }
 }

+ 3 - 8
public/index.html

@@ -1,7 +1,5 @@
- 
 <!DOCTYPE html>
 <html lang="en">
-
 <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -16,15 +14,12 @@
             border:none!important;
             box-shadow:none!important;
         }
-        .my-leaflet-div-icon{
-            width: auto!important;
-            white-space: nowrap;
-            word-break: normal;
-        }
         .leaflet-container{
             background: #f7f9fa!important;
         }
-        
+        .my-leaflet-div-icon{
+            white-space: nowrap;
+        }
         .leaflet-popup-content-wrapper{
             padding: 0px!important;
             border-radius: 0px!important;

+ 6 - 4
public/systemConf.js

@@ -24,11 +24,13 @@ var __systemConf = {
     systemCode: 'wandaBmGuide',
     conf: {
         // 阿里云
-        editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
-        wandaBmGuideUrl: 'http://60.205.177.43:80/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/', //管理书地址
+        editerUrl: 'http://glsms.wanda-dev.cn/wandaEditer/', // 编辑器地址
+        wandaBmGuideUrl: 'http://glsms.wanda-dev.cn/wandaBmGuide/', //管理书地址
+        // editerUrl: 'http://localhost:8091/wandaEditer/', // 编辑器地址
+        // wandaBmGuideUrl: 'http://localhost:8090/wandaBmGuide/', //管理书地址
     },
 }
 window.__systemConf = __systemConf

+ 16 - 12
src/App.vue

@@ -278,18 +278,15 @@ body {
 // 说明书更新记录 element 时间控件样式重写
 .specification-update-record,
 .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%;
-  }
-  .el-date-editor .el-range__close-icon {
-    line-height: 26px;
-  }
+    .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%;
+    }
 }
 .el-dialog__header{
   border-bottom: 1px solid rgba(239,240,241,1);
@@ -297,4 +294,11 @@ body {
 .gantt-chart .el-dialog__title{
   font-weight: 500;
 }
+.img-detail-container{
+    .el-dialog__body {
+        padding-top: 0;
+        padding-bottom: 0;
+        padding-right: 0;
+    }
+}
 </style>

+ 1 - 9
src/api/coreDeviceReport.js

@@ -1,15 +1,7 @@
-/*
- * @Author: your name
- * @Date: 2020-07-03 19:04:47
- * @LastEditTime: 2020-07-12 11:15:12
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: \wanda-bm-guide\src\api\coreDeviceReport.js
- */
-
 // 核心设备报表 接口
 import httputils from '@/api/httputils'
  
+ 
 /**
  * 系统列表
  */

+ 0 - 1
src/api/equipmentList.js

@@ -1,4 +1,3 @@
- 
 import httputils from "@/api/httputils"
 
 // 设备设施-主要设备清单

+ 0 - 14
src/api/ganttChart.js

@@ -1,19 +1,5 @@
 import httputils from "@/api/httputils";
 
-/**
- * 获取甘特图数据
- * @param {*} url 
- * @param {*} getParams 
- */
 export function queryGanttChart(url, getParams) {
   return httputils.getJson(url, getParams);
-}
-
-/**
- * 获取甘特图任务数据
- * @param {*} url 
- * @param {*} getParams 
- */
-export function queryGanttDetail(url, getParams) {
-  return httputils.getJson(url, getParams);
 }

+ 8 - 7
src/api/httputils.js

@@ -22,16 +22,17 @@ axiosservice.interceptors.request.use(
         config.withCredentials = true // 允许携带token ,这个是解决跨域产生的相关问题
         let token = store.getters['ssoToken']
         let isPreview = store.getters['isPreview']
-        if (config.url.indexOf('mapapp') < 0) {
-            config.headers = {
-                'sso-token': token,
-                isPreview: isPreview, //默认false,当预览开启的时候是true
-            }
-        }
+        // if (config.url.indexOf('mapapp') < 0) {
+        //     config.headers = {
+        //         '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:xiejialin1',
+                'sso-token': token,
+                isPreview: isPreview, //默认false,当预览开启的时候是true
             }
         }
         return config

+ 1 - 10
src/api/specificationUpdateRecord.js

@@ -1,15 +1,6 @@
 // 说明说更新记录 接口
 import httputils from "@/api/httputils";
 
-export function queryEventypes(url, param) {
-  return httputils.postJson(url, param);
-}
-
-/**
- * 获取表数据
- * @param {*} url 
- * @param {*} param 
- */
 export function getSpecificaltionData(url, param) {
   return httputils.getJson(url, param);
-}
+}

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 31986
src/assets/china.json


Fichier diff supprimé car celui-ci est trop grand
+ 6869 - 0
src/assets/geoData/ChinaBorder.json


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
src/assets/geoData/china.json


BIN
src/assets/imgs/analysis/picture.png


BIN
src/assets/imgs/analysis/report_pdf.png


BIN
src/assets/imgs/analysis/report_word.png


BIN
src/assets/provinceData.rar


Fichier diff supprimé car celui-ci est trop grand
+ 1944 - 0
src/assets/provinceData/anhui.json


Fichier diff supprimé car celui-ci est trop grand
+ 1413 - 0
src/assets/provinceData/beijing.json


Fichier diff supprimé car celui-ci est trop grand
+ 1931 - 0
src/assets/provinceData/chongqing.json


Fichier diff supprimé car celui-ci est trop grand
+ 2581 - 0
src/assets/provinceData/fujian.json


Fichier diff supprimé car celui-ci est trop grand
+ 2119 - 0
src/assets/provinceData/gansu.json


Fichier diff supprimé car celui-ci est trop grand
+ 2854 - 0
src/assets/provinceData/guangdong.json


Fichier diff supprimé car celui-ci est trop grand
+ 2213 - 0
src/assets/provinceData/guangxi.json


Fichier diff supprimé car celui-ci est trop grand
+ 2279 - 0
src/assets/provinceData/guizhou.json


Fichier diff supprimé car celui-ci est trop grand
+ 1722 - 0
src/assets/provinceData/hebei.json


Fichier diff supprimé car celui-ci est trop grand
+ 2225 - 0
src/assets/provinceData/heilongjiang.json


Fichier diff supprimé car celui-ci est trop grand
+ 2097 - 0
src/assets/provinceData/henan.json


Fichier diff supprimé car celui-ci est trop grand
+ 2211 - 0
src/assets/provinceData/hubei.json


Fichier diff supprimé car celui-ci est trop grand
+ 2126 - 0
src/assets/provinceData/hunan.json


Fichier diff supprimé car celui-ci est trop grand
+ 1468 - 0
src/assets/provinceData/jiangsu.json


Fichier diff supprimé car celui-ci est trop grand
+ 1798 - 0
src/assets/provinceData/jiangxi.json


Fichier diff supprimé car celui-ci est trop grand
+ 2745 - 0
src/assets/provinceData/jilin.json


Fichier diff supprimé car celui-ci est trop grand
+ 2587 - 0
src/assets/provinceData/liaoning.json


Fichier diff supprimé car celui-ci est trop grand
+ 1756 - 0
src/assets/provinceData/neimenggu.json


Fichier diff supprimé car celui-ci est trop grand
+ 1220 - 0
src/assets/provinceData/ningxia.json


Fichier diff supprimé car celui-ci est trop grand
+ 1956 - 0
src/assets/provinceData/qinghai.json


Fichier diff supprimé car celui-ci est trop grand
+ 2261 - 0
src/assets/provinceData/shandong.json


+ 982 - 0
src/assets/provinceData/shanghai.json

@@ -0,0 +1,982 @@
+{
+    "type": "FeatureCollection",
+    "features": [
+        {
+            "type": "Feature",
+            "properties": {
+                "adcode": "210000",
+                "name": "上海",
+                "center": [123.429096, 41.796767],
+                "centroid": [122.605788, 41.300296],
+                "childrenNum": 14,
+                "level": "province",
+                "parent": {
+                    "adcode": 100000
+                },
+                "subFeatureIndex": 5,
+                "acroutes": [100000],
+                "adchar": null
+            },
+            "geometry": {
+                "type": "MultiPolygon",
+        "coordinates": [
+            [
+                [
+                    [121.300857, 31.496747],
+                    [121.300496, 31.494537],
+                    [121.298563, 31.493713],
+                    [121.298605, 31.491515],
+                    [121.293488, 31.489807],
+                    [121.29061, 31.491694],
+                    [121.289387, 31.489031],
+                    [121.285355, 31.490679],
+                    [121.283686, 31.489795],
+                    [121.279696, 31.490404],
+                    [121.280321, 31.488672],
+                    [121.276442, 31.486654],
+                    [121.27622, 31.485376],
+                    [121.272049, 31.484337],
+                    [121.268879, 31.487466],
+                    [121.267322, 31.486224],
+                    [121.267433, 31.483357],
+                    [121.265153, 31.48313],
+                    [121.261732, 31.480777],
+                    [121.261454, 31.478854],
+                    [121.254794, 31.477635],
+                    [121.255643, 31.483632],
+                    [121.253627, 31.483082],
+                    [121.253362, 31.479809],
+                    [121.251221, 31.479606],
+                    [121.249692, 31.477623],
+                    [121.247064, 31.477062],
+                    [121.245813, 31.479881],
+                    [121.248176, 31.481876],
+                    [121.244409, 31.481183],
+                    [121.243797, 31.487311],
+                    [121.241141, 31.490906],
+                    [121.240877, 31.493701],
+                    [121.237234, 31.491957],
+                    [121.234746, 31.492686],
+                    [121.235413, 31.488099],
+                    [121.232994, 31.487896],
+                    [121.22867, 31.482127],
+                    [121.230839, 31.481111],
+                    [121.230352, 31.477432],
+                    [121.226209, 31.477683],
+                    [121.225361, 31.476022],
+                    [121.220731, 31.47607],
+                    [121.219062, 31.475222],
+                    [121.21364, 31.475939],
+                    [121.21503, 31.477528],
+                    [121.214377, 31.479128],
+                    [121.206368, 31.474995],
+                    [121.203421, 31.472331],
+                    [121.202906, 31.469356],
+                    [121.195051, 31.467827],
+                    [121.186055, 31.460814],
+                    [121.185457, 31.457468],
+                    [121.186055, 31.454362],
+                    [121.180814, 31.451458],
+                    [121.174974, 31.449295],
+                    [121.16983, 31.450024],
+                    [121.16773, 31.448315],
+                    [121.166048, 31.450168],
+                    [121.163045, 31.448865],
+                    [121.160917, 31.449678],
+                    [121.147348, 31.44393],
+                    [121.146569, 31.439006],
+                    [121.14782, 31.436186],
+                    [121.152492, 31.433604],
+                    [121.158484, 31.432254],
+                    [121.162711, 31.432218],
+                    [121.16253, 31.429565],
+                    [121.16431, 31.427222],
+                    [121.162002, 31.427951],
+                    [121.161362, 31.425776],
+                    [121.155273, 31.42574],
+                    [121.151157, 31.421796],
+                    [121.146249, 31.421078],
+                    [121.146208, 31.419704],
+                    [121.149266, 31.41913],
+                    [121.148905, 31.415867],
+                    [121.153493, 31.413679],
+                    [121.155523, 31.413835],
+                    [121.154508, 31.411575],
+                    [121.15886, 31.410117],
+                    [121.157887, 31.407893],
+                    [121.153104, 31.405837],
+                    [121.153896, 31.403685],
+                    [121.15049, 31.402215],
+                    [121.149586, 31.399381],
+                    [121.152742, 31.398174],
+                    [121.147653, 31.397325],
+                    [121.149475, 31.394503],
+                    [121.14383, 31.392327],
+                    [121.147097, 31.3899],
+                    [121.148988, 31.38691],
+                    [121.148432, 31.385404],
+                    [121.141425, 31.38355],
+                    [121.141049, 31.384531],
+                    [121.137518, 31.382785],
+                    [121.138408, 31.381147],
+                    [121.131762, 31.378815],
+                    [121.131247, 31.379664],
+                    [121.124268, 31.376722],
+                    [121.12328, 31.37848],
+                    [121.118206, 31.375837],
+                    [121.113757, 31.37445],
+                    [121.11523, 31.371137],
+                    [121.119082, 31.370563],
+                    [121.120208, 31.368674],
+                    [121.113173, 31.36688],
+                    [121.112853, 31.365133],
+                    [121.10928, 31.364703],
+                    [121.10889, 31.366509],
+                    [121.106958, 31.366593],
+                    [121.106749, 31.364535],
+                    [121.108251, 31.360457],
+                    [121.107361, 31.354763],
+                    [121.108418, 31.354034],
+                    [121.10832, 31.350649],
+                    [121.111157, 31.351534],
+                    [121.111838, 31.350517],
+                    [121.117246, 31.351689],
+                    [121.120194, 31.347562],
+                    [121.11733, 31.34712],
+                    [121.117969, 31.343447],
+                    [121.123948, 31.342753],
+                    [121.130441, 31.344213],
+                    [121.130816, 31.341509],
+                    [121.130121, 31.334702],
+                    [121.13115, 31.332106],
+                    [121.132582, 31.331962],
+                    [121.133305, 31.325585],
+                    [121.131539, 31.325441],
+                    [121.131637, 31.32324],
+                    [121.127257, 31.319315],
+                    [121.127076, 31.316934],
+                    [121.128633, 31.314265],
+                    [121.127966, 31.311884],
+                    [121.129773, 31.308306],
+                    [121.129134, 31.307528],
+                    [121.129954, 31.302597],
+                    [121.133778, 31.30207],
+                    [121.139645, 31.302992],
+                    [121.13895, 31.305625],
+                    [121.143774, 31.309706],
+                    [121.146903, 31.305936],
+                    [121.150782, 31.299018],
+                    [121.148933, 31.298875],
+                    [121.152714, 31.294075],
+                    [121.151282, 31.291933],
+                    [121.153145, 31.28997],
+                    [121.154967, 31.290209],
+                    [121.156399, 31.287408],
+                    [121.159305, 31.28766],
+                    [121.161293, 31.283985],
+                    [121.159402, 31.281579],
+                    [121.155537, 31.280765],
+                    [121.155481, 31.278442],
+                    [121.153743, 31.276646],
+                    [121.150392, 31.275437],
+                    [121.142996, 31.275473],
+                    [121.142885, 31.277664],
+                    [121.140535, 31.276491],
+                    [121.137601, 31.277592],
+                    [121.138032, 31.278753],
+                    [121.131678, 31.281363],
+                    [121.131053, 31.280106],
+                    [121.117719, 31.285684],
+                    [121.114994, 31.285265],
+                    [121.111115, 31.281746],
+                    [121.106666, 31.276706],
+                    [121.103829, 31.27533],
+                    [121.105442, 31.273654],
+                    [121.09881, 31.276251],
+                    [121.095404, 31.287001],
+                    [121.093096, 31.28821],
+                    [121.090134, 31.291909],
+                    [121.086909, 31.291717],
+                    [121.087326, 31.290664],
+                    [121.084698, 31.2876],
+                    [121.081361, 31.277257],
+                    [121.084545, 31.275713],
+                    [121.082154, 31.271535],
+                    [121.080416, 31.270158],
+                    [121.072741, 31.26914],
+                    [121.068695, 31.268098],
+                    [121.063245, 31.267907],
+                    [121.061952, 31.257945],
+                    [121.060979, 31.246486],
+                    [121.057669, 31.246749],
+                    [121.061646, 31.24524],
+                    [121.064343, 31.246138],
+                    [121.063565, 31.242222],
+                    [121.063898, 31.238438],
+                    [121.061243, 31.237827],
+                    [121.062605, 31.234689],
+                    [121.06458, 31.232965],
+                    [121.067388, 31.232929],
+                    [121.06718, 31.230917],
+                    [121.064649, 31.230785],
+                    [121.064719, 31.227275],
+                    [121.0628, 31.226964],
+                    [121.062633, 31.224664],
+                    [121.065608, 31.211871],
+                    [121.067805, 31.201005],
+                    [121.069209, 31.196524],
+                    [121.066609, 31.197183],
+                    [121.06679, 31.194966],
+                    [121.069599, 31.195314],
+                    [121.070113, 31.193612],
+                    [121.072185, 31.193169],
+                    [121.07256, 31.191527],
+                    [121.070614, 31.1913],
+                    [121.07035, 31.188735],
+                    [121.071684, 31.185955],
+                    [121.068751, 31.184889],
+                    [121.069474, 31.182888],
+                    [121.074993, 31.184386],
+                    [121.075591, 31.182852],
+                    [121.071225, 31.181462],
+                    [121.071406, 31.179472],
+                    [121.074229, 31.176225],
+                    [121.075424, 31.173444],
+                    [121.072532, 31.172701],
+                    [121.072379, 31.169609],
+                    [121.075466, 31.170316],
+                    [121.077371, 31.16454],
+                    [121.07313, 31.163257],
+                    [121.0737, 31.161711],
+                    [121.076787, 31.162622],
+                    [121.07605, 31.160536],
+                    [121.077023, 31.158451],
+                    [121.073839, 31.157072],
+                    [121.072046, 31.153512],
+                    [121.067777, 31.152289],
+                    [121.069126, 31.148705],
+                    [121.06572, 31.148597],
+                    [121.066067, 31.150947],
+                    [121.064135, 31.150839],
+                    [121.062564, 31.153129],
+                    [121.057378, 31.152781],
+                    [121.055834, 31.150659],
+                    [121.050273, 31.150719],
+                    [121.049133, 31.154615],
+                    [121.04542, 31.154028],
+                    [121.045254, 31.151582],
+                    [121.041472, 31.14982],
+                    [121.041541, 31.146931],
+                    [121.044781, 31.145528],
+                    [121.041819, 31.138899],
+                    [121.038649, 31.136909],
+                    [121.036258, 31.137376],
+                    [121.036119, 31.140325],
+                    [121.033088, 31.142208],
+                    [121.028778, 31.141249],
+                    [121.028375, 31.143874],
+                    [121.02672, 31.143766],
+                    [121.025677, 31.140769],
+                    [121.022271, 31.140457],
+                    [121.022813, 31.138311],
+                    [121.018489, 31.134103],
+                    [121.007269, 31.13342],
+                    [120.991252, 31.13318],
+                    [120.983911, 31.131705],
+                    [120.952642, 31.138251],
+                    [120.93034, 31.141404],
+                    [120.916923, 31.136189],
+                    [120.905397, 31.134211],
+                    [120.89921, 31.136057],
+                    [120.881289, 31.134727],
+                    [120.876422, 31.131489],
+                    [120.872349, 31.127161],
+                    [120.871014, 31.123804],
+                    [120.870597, 31.119715],
+                    [120.865967, 31.11475],
+                    [120.862241, 31.112508],
+                    [120.860225, 31.10933],
+                    [120.857917, 31.108526],
+                    [120.856804, 31.102829],
+                    [120.859766, 31.100287],
+                    [120.863993, 31.100299],
+                    [120.865744, 31.097624],
+                    [120.869582, 31.097216],
+                    [120.869818, 31.098943],
+                    [120.872543, 31.098884],
+                    [120.873169, 31.100323],
+                    [120.876631, 31.099939],
+                    [120.876005, 31.097864],
+                    [120.878967, 31.09838],
+                    [120.878077, 31.095753],
+                    [120.887476, 31.094074],
+                    [120.891021, 31.094302],
+                    [120.891216, 31.09718],
+                    [120.892842, 31.096533],
+                    [120.892175, 31.094194],
+                    [120.895415, 31.090703],
+                    [120.896694, 31.086649],
+                    [120.899294, 31.086937],
+                    [120.902116, 31.085653],
+                    [120.901671, 31.084094],
+                    [120.90473, 31.080495],
+                    [120.904619, 31.078528],
+                    [120.899614, 31.07836],
+                    [120.898863, 31.070514],
+                    [120.895915, 31.063075],
+                    [120.894622, 31.058659],
+                    [120.894567, 31.053896],
+                    [120.895442, 31.050332],
+                    [120.897208, 31.04822],
+                    [120.897027, 31.04558],
+                    [120.899739, 31.039603],
+                    [120.901977, 31.037647],
+                    [120.901338, 31.0255],
+                    [120.900559, 31.020423],
+                    [120.901365, 31.017494],
+                    [120.910055, 31.016942],
+                    [120.909944, 31.012644],
+                    [120.911014, 31.010555],
+                    [120.918105, 31.012788],
+                    [120.926155, 31.010423],
+                    [120.92699, 31.012068],
+                    [120.931383, 31.01178],
+                    [120.933789, 31.010027],
+                    [120.938085, 31.009007],
+                    [120.940087, 31.010027],
+                    [120.935749, 31.015381],
+                    [120.936305, 31.01711],
+                    [120.949972, 31.017638],
+                    [120.951168, 31.024012],
+                    [120.948735, 31.025068],
+                    [120.949124, 31.029953],
+                    [120.951085, 31.029077],
+                    [120.952197, 31.030254],
+                    [120.958301, 31.028573],
+                    [120.960483, 31.021659],
+                    [120.964293, 31.020771],
+                    [120.964849, 31.019751],
+                    [120.963209, 31.016594],
+                    [120.970202, 31.016149],
+                    [120.982993, 31.016089],
+                    [120.983855, 31.014445],
+                    [120.989514, 31.014397],
+                    [120.989987, 31.010495],
+                    [120.991933, 31.008154],
+                    [120.991057, 31.00747],
+                    [120.992086, 31.003424],
+                    [120.992045, 30.997109],
+                    [120.989834, 30.996664],
+                    [120.990515, 30.994551],
+                    [120.994839, 30.99526],
+                    [120.994603, 30.991922],
+                    [120.997133, 30.989232],
+                    [120.999344, 30.980106],
+                    [121.000832, 30.980466],
+                    [121.002361, 30.97762],
+                    [121.000567, 30.977007],
+                    [121.000512, 30.973933],
+                    [120.99737, 30.972444],
+                    [120.993143, 30.972119],
+                    [120.991433, 30.968372],
+                    [120.993699, 30.964024],
+                    [120.992601, 30.962835],
+                    [120.994756, 30.958703],
+                    [120.991683, 30.958211],
+                    [120.992531, 30.955028],
+                    [120.994797, 30.954824],
+                    [120.995368, 30.950367],
+                    [120.99673, 30.950307],
+                    [120.996813, 30.944625],
+                    [120.995673, 30.944336],
+                    [120.997481, 30.941141],
+                    [121.000818, 30.937729],
+                    [121.000025, 30.934701],
+                    [120.999622, 30.91395],
+                    [120.998982, 30.909527],
+                    [121.004572, 30.909299],
+                    [121.004516, 30.906955],
+                    [121.00257, 30.904852],
+                    [120.998704, 30.905946],
+                    [120.998635, 30.903386],
+                    [120.995715, 30.903723],
+                    [120.992809, 30.90216],
+                    [120.992656, 30.899732],
+                    [120.99046, 30.89579],
+                    [120.992907, 30.893915],
+                    [120.993824, 30.88966],
+                    [121.005017, 30.888794],
+                    [121.00852, 30.888121],
+                    [121.008298, 30.882964],
+                    [121.011092, 30.882219],
+                    [121.017474, 30.882724],
+                    [121.0186, 30.880716],
+                    [121.021465, 30.878793],
+                    [121.019421, 30.876665],
+                    [121.021896, 30.875162],
+                    [121.019796, 30.873996],
+                    [121.020463, 30.87188],
+                    [121.01778, 30.873359],
+                    [121.014819, 30.871027],
+                    [121.01778, 30.86938],
+                    [121.013971, 30.86439],
+                    [121.016265, 30.862851],
+                    [121.015403, 30.86053],
+                    [121.010981, 30.856033],
+                    [121.015013, 30.853604],
+                    [121.013359, 30.851692],
+                    [121.010133, 30.853135],
+                    [121.008006, 30.850574],
+                    [121.006463, 30.850454],
+                    [121.003974, 30.846101],
+                    [121.000985, 30.845632],
+                    [120.9999, 30.843335],
+                    [120.997759, 30.84408],
+                    [120.995659, 30.838572],
+                    [120.992865, 30.838392],
+                    [120.989987, 30.834724],
+                    [120.989125, 30.832318],
+                    [120.992462, 30.831572],
+                    [120.989153, 30.828698],
+                    [120.992754, 30.825691],
+                    [120.990918, 30.822708],
+                    [120.994603, 30.821493],
+                    [121.00054, 30.829431],
+                    [121.003446, 30.826304],
+                    [121.006935, 30.830779],
+                    [121.010898, 30.834615],
+                    [121.014402, 30.835818],
+                    [121.014874, 30.833954],
+                    [121.030057, 30.828553],
+                    [121.036647, 30.818449],
+                    [121.037912, 30.81389],
+                    [121.044976, 30.815526],
+                    [121.043752, 30.820013],
+                    [121.03908, 30.818582],
+                    [121.03769, 30.820266],
+                    [121.039192, 30.820867],
+                    [121.040276, 30.82438],
+                    [121.04175, 30.825378],
+                    [121.039956, 30.827218],
+                    [121.043516, 30.828157],
+                    [121.045101, 30.825907],
+                    [121.048896, 30.825186],
+                    [121.046755, 30.831091],
+                    [121.056335, 30.835602],
+                    [121.062049, 30.83779],
+                    [121.060228, 30.842793],
+                    [121.061674, 30.843383],
+                    [121.06052, 30.845187],
+                    [121.066999, 30.84877],
+                    [121.080471, 30.848746],
+                    [121.097712, 30.857103],
+                    [121.097684, 30.854927],
+                    [121.102272, 30.850261],
+                    [121.104789, 30.849335],
+                    [121.110906, 30.851416],
+                    [121.113159, 30.854049],
+                    [121.114744, 30.851476],
+                    [121.120055, 30.849119],
+                    [121.121153, 30.850165],
+                    [121.123545, 30.847267],
+                    [121.12025, 30.843299],
+                    [121.119832, 30.83773],
+                    [121.117747, 30.835301],
+                    [121.120639, 30.836335],
+                    [121.127688, 30.83565],
+                    [121.129982, 30.834892],
+                    [121.131609, 30.83601],
+                    [121.134612, 30.833028],
+                    [121.132916, 30.831608],
+                    [121.134264, 30.828505],
+                    [121.136239, 30.827868],
+                    [121.13742, 30.829985],
+                    [121.13742, 30.825029],
+                    [121.132373, 30.819279],
+                    [121.130218, 30.815574],
+                    [121.128202, 30.810221],
+                    [121.126047, 30.79304],
+                    [121.126576, 30.788998],
+                    [121.125255, 30.788179],
+                    [121.120041, 30.788552],
+                    [121.117219, 30.786073],
+                    [121.12342, 30.77895],
+                    [121.127521, 30.778673],
+                    [121.131817, 30.777313],
+                    [121.13603, 30.777337],
+                    [121.1387, 30.77842],
+                    [121.140618, 30.776928],
+                    [121.144122, 30.779479],
+                    [121.152687, 30.778974],
+                    [121.155815, 30.777205],
+                    [121.160681, 30.776579],
+                    [121.160737, 30.773221],
+                    [121.163434, 30.775279],
+                    [121.168968, 30.775953],
+                    [121.170789, 30.777084],
+                    [121.170984, 30.774677],
+                    [121.174668, 30.772018],
+                    [121.179965, 30.774376],
+                    [121.183441, 30.775038],
+                    [121.185791, 30.776651],
+                    [121.186361, 30.779034],
+                    [121.189517, 30.778974],
+                    [121.190963, 30.781092],
+                    [121.191839, 30.778853],
+                    [121.196956, 30.773354],
+                    [121.20032, 30.773618],
+                    [121.199166, 30.780755],
+                    [121.200098, 30.783294],
+                    [121.205534, 30.785905],
+                    [121.213723, 30.785929],
+                    [121.217992, 30.784954],
+                    [121.2234, 30.775977],
+                    [121.224624, 30.776976],
+                    [121.226209, 30.775087],
+                    [121.226918, 30.770826],
+                    [121.229115, 30.767974],
+                    [121.230686, 30.763737],
+                    [121.232298, 30.755817],
+                    [121.23729, 30.752651],
+                    [121.243102, 30.750533],
+                    [121.244756, 30.749185],
+                    [121.256393, 30.743948],
+                    [121.261343, 30.738217],
+                    [121.266835, 30.733498],
+                    [121.26817, 30.734931],
+                    [121.271451, 30.73227],
+                    [121.269755, 30.730729],
+                    [121.271451, 30.726948],
+                    [121.270339, 30.725864],
+                    [121.272035, 30.723252],
+                    [121.270102, 30.72047],
+                    [121.270339, 30.716894],
+                    [121.267057, 30.715039],
+                    [121.268448, 30.712149],
+                    [121.265862, 30.709488],
+                    [121.266668, 30.706296],
+                    [121.268031, 30.706103],
+                    [121.268656, 30.702129],
+                    [121.270672, 30.701563],
+                    [121.270422, 30.69807],
+                    [121.271604, 30.69689],
+                    [121.274649, 30.6774],
+                    [121.291041, 30.678328],
+                    [121.326718, 30.67593],
+                    [121.346642, 30.675593],
+                    [121.35433, 30.676991],
+                    [121.361894, 30.67952],
+                    [121.406997, 30.718086],
+                    [121.426365, 30.730283],
+                    [121.478767, 30.756347],
+                    [121.517197, 30.775387],
+                    [121.552832, 30.789395],
+                    [121.601327, 30.805084],
+                    [121.648419, 30.8162],
+                    [121.68119, 30.818401],
+                    [121.727071, 30.817716],
+                    [121.77914, 30.817222],
+                    [121.793767, 30.816862],
+                    [121.904467, 30.814155],
+                    [121.915284, 30.812892],
+                    [121.9246, 30.8066],
+                    [121.943689, 30.777096],
+                    [121.969703, 30.789202],
+                    [121.955466, 30.817138],
+                    [121.954326, 30.821409],
+                    [121.954715, 30.825811],
+                    [121.970732, 30.839077],
+                    [121.985372, 30.850694],
+                    [121.993951, 30.863055],
+                    [121.996982, 30.874898],
+                    [121.998497, 30.899961],
+                    [121.996231, 30.935458],
+                    [121.990934, 30.968432],
+                    [121.977558, 31.016101],
+                    [121.962682, 31.047284],
+                    [121.94679, 31.065883],
+                    [121.889465, 31.121705],
+                    [121.884029, 31.130638],
+                    [121.853358, 31.155346],
+                    [121.809812, 31.196907],
+                    [121.743742, 31.283207],
+                    [121.729101, 31.298288],
+                    [121.722511, 31.303518],
+                    [121.712431, 31.309407],
+                    [121.689448, 31.322462],
+                    [121.610559, 31.368195],
+                    [121.603038, 31.372656],
+                    [121.593708, 31.376411],
+                    [121.559811, 31.38361],
+                    [121.538011, 31.388489],
+                    [121.521229, 31.39479],
+                    [121.507353, 31.405933],
+                    [121.509425, 31.408288],
+                    [121.516585, 31.405287],
+                    [121.517239, 31.406303],
+                    [121.510801, 31.409973],
+                    [121.502362, 31.413404],
+                    [121.501319, 31.411982],
+                    [121.507228, 31.409722],
+                    [121.505991, 31.407021],
+                    [121.49427, 31.417851],
+                    [121.481339, 31.427294],
+                    [121.463696, 31.438277],
+                    [121.446024, 31.450717],
+                    [121.434276, 31.458496],
+                    [121.41869, 31.470682],
+                    [121.409694, 31.476321],
+                    [121.404328, 31.479212],
+                    [121.403966, 31.481494],
+                    [121.406288, 31.485388],
+                    [121.405426, 31.487215],
+                    [121.376298, 31.501106],
+                    [121.362255, 31.50679],
+                    [121.357751, 31.508259],
+                    [121.343499, 31.512057],
+                    [121.335838, 31.508295],
+                    [121.329512, 31.504247],
+                    [121.327218, 31.504247],
+                    [121.323131, 31.502288],
+                    [121.323701, 31.499649],
+                    [121.319905, 31.49972],
+                    [121.32003, 31.502993],
+                    [121.321879, 31.503399],
+                    [121.320169, 31.505883],
+                    [121.316652, 31.505775],
+                    [121.315345, 31.501273],
+                    [121.311938, 31.502909],
+                    [121.310353, 31.505919],
+                    [121.305529, 31.505333],
+                    [121.305876, 31.503435],
+                    [121.302595, 31.502599],
+                    [121.299926, 31.499756],
+                    [121.300857, 31.496747]
+                ]
+            ],
+            [
+                [
+                    [121.943244, 31.215465],
+                    [121.941826, 31.207678],
+                    [121.942619, 31.198465],
+                    [121.944843, 31.186878],
+                    [121.948027, 31.176405],
+                    [121.952629, 31.1672],
+                    [121.959637, 31.159278],
+                    [121.965685, 31.15754],
+                    [121.970773, 31.157552],
+                    [121.975862, 31.158834],
+                    [121.99573, 31.1608],
+                    [121.999554, 31.165079],
+                    [122.010593, 31.188004],
+                    [122.012011, 31.192043],
+                    [122.012609, 31.210002],
+                    [122.011038, 31.217405],
+                    [122.008563, 31.220987],
+                    [121.989655, 31.224521],
+                    [121.980659, 31.22809],
+                    [121.969188, 31.230282],
+                    [121.957259, 31.230414],
+                    [121.951044, 31.228821],
+                    [121.946595, 31.224365],
+                    [121.943244, 31.215465]
+                ]
+            ],
+            [
+                [
+                    [121.882625, 31.240857],
+                    [121.880873, 31.23633],
+                    [121.882541, 31.225611],
+                    [121.885155, 31.22052],
+                    [121.889271, 31.214997],
+                    [121.901645, 31.20146],
+                    [121.908777, 31.195266],
+                    [121.913852, 31.19384],
+                    [121.918788, 31.194319],
+                    [121.922445, 31.196859],
+                    [121.925448, 31.205438],
+                    [121.927519, 31.224017],
+                    [121.926727, 31.229731],
+                    [121.923557, 31.233863],
+                    [121.915451, 31.236558],
+                    [121.897363, 31.242115],
+                    [121.88991, 31.242594],
+                    [121.882625, 31.240857]
+                ]
+            ],
+            [
+                [
+                    [121.426671, 30.682183],
+                    [121.426796, 30.680315],
+                    [121.428589, 30.681749],
+                    [121.426671, 30.682183]
+                ]
+            ],
+            [
+                [
+                    [121.422458, 30.691482],
+                    [121.419469, 30.691626],
+                    [121.419482, 30.689856],
+                    [121.425364, 30.687374],
+                    [121.428909, 30.689109],
+                    [121.426615, 30.691277],
+                    [121.422458, 30.691482]
+                ]
+            ],
+            [
+                [
+                    [121.406775, 30.704995],
+                    [121.406622, 30.703093],
+                    [121.409291, 30.704514],
+                    [121.406775, 30.704995]
+                ]
+            ],
+            [
+                [
+                    [121.975181, 31.617034],
+                    [121.887616, 31.63638],
+                    [121.817806, 31.652025],
+                    [121.715267, 31.673842],
+                    [121.642649, 31.697454],
+                    [121.633278, 31.696167],
+                    [121.627341, 31.697776],
+                    [121.611755, 31.704283],
+                    [121.602746, 31.70694],
+                    [121.60091, 31.707],
+                    [121.599659, 31.703115],
+                    [121.593249, 31.705379],
+                    [121.592262, 31.706487],
+                    [121.578539, 31.710527],
+                    [121.565025, 31.716711],
+                    [121.551386, 31.727386],
+                    [121.549509, 31.726969],
+                    [121.540124, 31.733307],
+                    [121.539429, 31.735499],
+                    [121.528361, 31.738347],
+                    [121.526693, 31.740217],
+                    [121.514986, 31.742873],
+                    [121.51304, 31.743695],
+                    [121.498566, 31.75326],
+                    [121.487749, 31.753415],
+                    [121.476807, 31.756142],
+                    [121.464141, 31.757142],
+                    [121.455576, 31.759346],
+                    [121.449751, 31.761668],
+                    [121.445385, 31.7643],
+                    [121.431481, 31.769266],
+                    [121.425781, 31.774267],
+                    [121.420915, 31.779602],
+                    [121.410904, 31.79558],
+                    [121.416312, 31.79764],
+                    [121.411488, 31.806341],
+                    [121.405468, 31.809841],
+                    [121.399142, 31.817483],
+                    [121.395388, 31.821291],
+                    [121.385043, 31.833525],
+                    [121.376381, 31.838571],
+                    [121.369291, 31.843283],
+                    [121.323061, 31.868529],
+                    [121.315859, 31.871479],
+                    [121.310367, 31.872502],
+                    [121.3019, 31.872716],
+                    [121.291166, 31.870992],
+                    [121.281336, 31.869041],
+                    [121.265584, 31.864128],
+                    [121.252111, 31.857727],
+                    [121.242073, 31.853397],
+                    [121.225305, 31.847043],
+                    [121.200334, 31.835144],
+                    [121.181509, 31.820411],
+                    [121.149225, 31.787294],
+                    [121.118498, 31.759084],
+                    [121.142064, 31.755308],
+                    [121.145332, 31.753927],
+                    [121.179868, 31.720774],
+                    [121.289109, 31.616283],
+                    [121.345585, 31.571685],
+                    [121.37221, 31.55321],
+                    [121.395457, 31.585444],
+                    [121.403521, 31.590002],
+                    [121.414797, 31.591076],
+                    [121.43422, 31.590336],
+                    [121.471176, 31.57443],
+                    [121.547673, 31.531125],
+                    [121.608794, 31.50691],
+                    [121.617678, 31.503673],
+                    [121.625784, 31.501775],
+                    [121.638645, 31.49972],
+                    [121.670609, 31.494214],
+                    [121.682858, 31.491061],
+                    [121.72988, 31.471973],
+                    [121.763443, 31.458233],
+                    [121.819183, 31.438206],
+                    [121.834212, 31.433975],
+                    [121.845377, 31.431895],
+                    [121.857807, 31.430043],
+                    [121.87299, 31.429338],
+                    [121.882096, 31.428656],
+                    [121.89055, 31.428788],
+                    [121.901144, 31.430126],
+                    [121.918051, 31.434692],
+                    [121.934304, 31.442364],
+                    [121.967284, 31.456656],
+                    [121.981813, 31.4641],
+                    [121.991698, 31.476763],
+                    [121.995716, 31.493104],
+                    [121.993867, 31.51189],
+                    [121.98825, 31.529597],
+                    [121.975181, 31.617034]
+                ]
+            ],
+            [
+                [
+                    [121.778862, 31.310196],
+                    [121.782004, 31.310328],
+                    [121.7879, 31.312003],
+                    [121.790986, 31.314313],
+                    [121.794073, 31.319542],
+                    [121.795866, 31.329976],
+                    [121.796478, 31.33542],
+                    [121.796005, 31.345624],
+                    [121.793002, 31.355074],
+                    [121.792377, 31.363304],
+                    [121.790875, 31.367059],
+                    [121.787886, 31.37164],
+                    [121.780572, 31.380154],
+                    [121.774135, 31.386982],
+                    [121.76938, 31.390749],
+                    [121.760857, 31.395185],
+                    [121.753725, 31.400362],
+                    [121.742185, 31.407212],
+                    [121.737485, 31.408814],
+                    [121.729296, 31.410356],
+                    [121.723707, 31.412364],
+                    [121.708316, 31.419728],
+                    [121.697193, 31.423995],
+                    [121.688294, 31.425883],
+                    [121.673835, 31.427748],
+                    [121.621752, 31.444145],
+                    [121.606319, 31.449403],
+                    [121.599812, 31.450681],
+                    [121.585561, 31.454672],
+                    [121.58303, 31.456262],
+                    [121.575828, 31.463813],
+                    [121.572811, 31.469452],
+                    [121.567347, 31.4835],
+                    [121.562356, 31.486367],
+                    [121.549926, 31.489747],
+                    [121.521132, 31.493976],
+                    [121.516933, 31.494298],
+                    [121.513457, 31.493355],
+                    [121.509355, 31.489795],
+                    [121.509105, 31.485352],
+                    [121.510134, 31.482581],
+                    [121.516849, 31.477313],
+                    [121.529515, 31.471172],
+                    [121.537413, 31.466704],
+                    [121.54328, 31.462403],
+                    [121.549773, 31.457062],
+                    [121.558463, 31.448793],
+                    [121.572255, 31.436066],
+                    [121.590371, 31.427545],
+                    [121.601425, 31.421855],
+                    [121.641036, 31.401115],
+                    [121.686682, 31.376591],
+                    [121.727933, 31.354799],
+                    [121.740766, 31.346486],
+                    [121.744659, 31.343675],
+                    [121.751166, 31.337801],
+                    [121.76076, 31.320344],
+                    [121.76425, 31.315306],
+                    [121.770951, 31.31168],
+                    [121.778862, 31.310196]
+                ]
+            ],
+            [
+                [
+                    [122.242018, 31.419082],
+                    [122.243562, 31.417839],
+                    [122.247149, 31.419333],
+                    [122.245369, 31.421318],
+                    [122.242018, 31.419082]
+                ]
+            ],
+            [
+                [
+                    [121.801775, 31.356976],
+                    [121.802693, 31.342789],
+                    [121.803152, 31.332106],
+                    [121.80375, 31.328445],
+                    [121.806642, 31.324173],
+                    [121.81319, 31.316228],
+                    [121.822617, 31.307372],
+                    [121.832043, 31.301711],
+                    [121.833601, 31.299653],
+                    [121.840566, 31.29544],
+                    [121.852885, 31.292364],
+                    [121.856681, 31.292818],
+                    [121.860782, 31.294949],
+                    [121.865968, 31.294937],
+                    [121.88959, 31.292028],
+                    [121.900755, 31.291167],
+                    [121.932261, 31.283147],
+                    [121.975779, 31.279998],
+                    [122.016447, 31.282285],
+                    [122.072005, 31.266829],
+                    [122.087285, 31.257538],
+                    [122.097769, 31.255658],
+                    [122.105207, 31.262136],
+                    [122.122684, 31.307205],
+                    [122.121975, 31.315438],
+                    [122.116678, 31.321229],
+                    [122.078012, 31.323527],
+                    [122.04107, 31.323814],
+                    [122.001556, 31.329246],
+                    [121.951726, 31.337274],
+                    [121.913074, 31.350445],
+                    [121.870376, 31.366007],
+                    [121.858516, 31.369379],
+                    [121.852885, 31.371376],
+                    [121.845586, 31.374582],
+                    [121.831752, 31.375526],
+                    [121.828401, 31.376447],
+                    [121.824744, 31.378588],
+                    [121.817445, 31.380585],
+                    [121.803458, 31.381219],
+                    [121.796756, 31.381075],
+                    [121.793864, 31.380477],
+                    [121.792808, 31.377571],
+                    [121.797674, 31.369642],
+                    [121.800566, 31.363997],
+                    [121.801775, 31.356976]
+                ]
+            ],
+            [
+                [
+                    [121.627049, 31.444993],
+                    [121.631512, 31.445101],
+                    [121.634001, 31.445937],
+                    [121.636295, 31.449881],
+                    [121.635044, 31.452988],
+                    [121.631609, 31.456823],
+                    [121.625172, 31.462212],
+                    [121.61366, 31.471339],
+                    [121.608571, 31.474446],
+                    [121.602134, 31.476835],
+                    [121.595293, 31.478292],
+                    [121.586896, 31.479535],
+                    [121.577149, 31.479343],
+                    [121.575814, 31.478197],
+                    [121.57612, 31.474768],
+                    [121.577886, 31.472486],
+                    [121.58627, 31.464076],
+                    [121.594153, 31.458568],
+                    [121.613855, 31.447885],
+                    [121.616872, 31.446643],
+                    [121.627049, 31.444993]
+                ]
+            ]
+        ]
+    }
+    }]
+}

Fichier diff supprimé car celui-ci est trop grand
+ 1264 - 0
src/assets/provinceData/shanxi1.json


+ 813 - 0
src/assets/provinceData/shanxi2.json

@@ -0,0 +1,813 @@
+{
+    "type": "FeatureCollection",
+    "features": [
+        {
+            "type": "Feature",
+            "properties": {
+                "adcode": "210000",
+                "name": "山西",
+                "center": [123.429096, 41.796767],
+                "centroid": [122.605788, 41.300296],
+                "childrenNum": 14,
+                "level": "province",
+                "parent": {
+                    "adcode": 100000
+                },
+                "subFeatureIndex": 5,
+                "acroutes": [100000],
+                "adchar": null
+            },
+            "geometry": {
+                "type": "MultiPolygon",
+        "coordinates": [
+            [
+            [
+                [112.624319, 40.236839],
+                [112.564175, 40.257939],
+                [112.511539, 40.26917],
+                [112.456168, 40.300059],
+                [112.418156, 40.295249],
+                [112.345558, 40.256453],
+                [112.310322, 40.256394],
+                [112.290535, 40.223403],
+                [112.299994, 40.211868],
+                [112.285501, 40.198189],
+                [112.232778, 40.169633],
+                [112.223274, 40.128801],
+                [112.209909, 40.10772],
+                [112.183916, 40.084787],
+                [112.181833, 40.061487],
+                [112.142388, 40.027329],
+                [112.13358, 40.001684],
+                [112.094786, 39.955498],
+                [112.077081, 39.920868],
+                [112.042539, 39.886161],
+                [112.035119, 39.854366],
+                [112.005872, 39.820821],
+                [111.97619, 39.79809],
+                [111.967468, 39.782652],
+                [111.970896, 39.766014],
+                [111.964518, 39.72524],
+                [111.968857, 39.710385],
+                [111.95636, 39.687737],
+                [111.923944, 39.665742],
+                [111.937874, 39.644638],
+                [111.93028, 39.611411],
+                [111.902031, 39.61717],
+                [111.878902, 39.605892],
+                [111.842538, 39.620109],
+                [111.787645, 39.589691],
+                [111.722684, 39.606012],
+                [111.707844, 39.621429],
+                [111.646528, 39.644278],
+                [111.61663, 39.633305],
+                [111.589596, 39.644938],
+                [111.568637, 39.643559],
+                [111.557615, 39.654231],
+                [111.501941, 39.663104],
+                [111.461541, 39.646377],
+                [111.438108, 39.643019],
+                [111.442751, 39.630186],
+                [111.46293, 39.624488],
+                [111.451951, 39.608112],
+                [111.443359, 39.620169],
+                [111.428952, 39.613691],
+                [111.438803, 39.601452],
+                [111.433205, 39.561841],
+                [111.422487, 39.542148],
+                [111.433986, 39.523409],
+                [111.426479, 39.503404],
+                [111.38864, 39.492167],
+                [111.364165, 39.467284],
+                [111.364079, 39.446361],
+                [111.352449, 39.426754],
+                [111.337218, 39.42092],
+                [111.289268, 39.41719],
+                [111.265184, 39.424589],
+                [111.242837, 39.419115],
+                [111.212287, 39.425612],
+                [111.172192, 39.423386],
+                [111.145331, 39.409429],
+                [111.119598, 39.377233],
+                [111.125587, 39.366458],
+                [111.155051, 39.368264],
+                [111.155398, 39.338699],
+                [111.167505, 39.337253],
+                [111.183648, 39.350924],
+                [111.195017, 39.344962],
+                [111.179438, 39.326773],
+                [111.187987, 39.314303],
+                [111.213806, 39.301288],
+                [111.24748, 39.302313],
+                [111.227171, 39.284354],
+                [111.213546, 39.257165],
+                [111.219013, 39.245648],
+                [111.163079, 39.152473],
+                [111.174144, 39.13514],
+                [111.162515, 39.108437],
+                [111.147327, 39.100521],
+                [111.138345, 39.064314],
+                [111.09417, 39.030205],
+                [111.038235, 39.020102],
+                [110.9984, 38.9985],
+                [110.983299, 38.980342],
+                [111.009899, 38.932626],
+                [111.015714, 38.896211],
+                [111.012329, 38.87833],
+                [110.996013, 38.868024],
+                [111.010116, 38.841584],
+                [110.99649, 38.825085],
+                [110.979133, 38.787705],
+                [110.956308, 38.776717],
+                [110.96503, 38.755709],
+                [110.945286, 38.729471],
+                [110.915388, 38.704256],
+                [110.916212, 38.673987],
+                [110.896425, 38.657814],
+                [110.880803, 38.626916],
+                [110.896641, 38.588276],
+                [110.919901, 38.582067],
+                [110.909443, 38.563194],
+                [110.907664, 38.521107],
+                [110.871039, 38.510201],
+                [110.87425, 38.453693],
+                [110.840707, 38.439971],
+                [110.825042, 38.449424],
+                [110.796836, 38.453449],
+                [110.777613, 38.440886],
+                [110.758953, 38.400436],
+                [110.750318, 38.369489],
+                [110.70163, 38.353309],
+                [110.668607, 38.313666],
+                [110.638839, 38.304745],
+                [110.601304, 38.308167],
+                [110.577481, 38.297228],
+                [110.567977, 38.245752],
+                [110.56724, 38.217553],
+                [110.558214, 38.210517],
+                [110.523933, 38.210517],
+                [110.507877, 38.184937],
+                [110.510611, 38.147223],
+                [110.521199, 38.124438],
+                [110.501889, 38.098092],
+                [110.508788, 38.061927],
+                [110.501411, 38.038993],
+                [110.508138, 38.012862],
+                [110.527057, 37.988133],
+                [110.518161, 37.976409],
+                [110.522501, 37.954922],
+                [110.547626, 37.940307],
+                [110.587982, 37.926611],
+                [110.607249, 37.8962],
+                [110.650599, 37.840013],
+                [110.660753, 37.808028],
+                [110.680367, 37.790061],
+                [110.735738, 37.770366],
+                [110.755699, 37.755037],
+                [110.750708, 37.736133],
+                [110.716644, 37.728681],
+                [110.703496, 37.718642],
+                [110.706577, 37.705335],
+                [110.739079, 37.689439],
+                [110.775399, 37.680873],
+                [110.796142, 37.66306],
+                [110.793321, 37.650791],
+                [110.763683, 37.63957],
+                [110.772275, 37.59269],
+                [110.794927, 37.566154],
+                [110.771103, 37.538373],
+                [110.771277, 37.520155],
+                [110.759517, 37.503477],
+                [110.758346, 37.471161],
+                [110.74498, 37.450763],
+                [110.648169, 37.438151],
+                [110.629683, 37.383659],
+                [110.641486, 37.360081],
+                [110.695034, 37.34962],
+                [110.693949, 37.325907],
+                [110.678718, 37.317918],
+                [110.690044, 37.287071],
+                [110.661925, 37.281991],
+                [110.65138, 37.256583],
+                [110.584554, 37.180681],
+                [110.540292, 37.144626],
+                [110.535562, 37.115136],
+                [110.498634, 37.089797],
+                [110.460491, 37.044749],
+                [110.425993, 37.040833],
+                [110.424084, 37.023924],
+                [110.450337, 37.016463],
+                [110.441224, 37.006141],
+                [110.412845, 37.019261],
+                [110.383207, 37.02181],
+                [110.377132, 37.010245],
+                [110.405555, 36.991464],
+                [110.424257, 36.963719],
+                [110.410545, 36.899481],
+                [110.402213, 36.886589],
+                [110.376047, 36.882291],
+                [110.377696, 36.873197],
+                [110.41406, 36.865721],
+                [110.424518, 36.855566],
+                [110.419528, 36.835001],
+                [110.407247, 36.824904],
+                [110.422912, 36.819169],
+                [110.419571, 36.798345],
+                [110.403298, 36.772963],
+                [110.388501, 36.764916],
+                [110.413192, 36.763107],
+                [110.43068, 36.752438],
+                [110.416664, 36.731908],
+                [110.42122, 36.721548],
+                [110.439966, 36.737151],
+                [110.451812, 36.726541],
+                [110.436755, 36.711248],
+                [110.438143, 36.685962],
+                [110.420048, 36.683963],
+                [110.402951, 36.697263],
+                [110.394446, 36.676844],
+                [110.422348, 36.661791],
+                [110.44743, 36.621115],
+                [110.471513, 36.595736],
+                [110.496812, 36.582231],
+                [110.489869, 36.550709],
+                [110.501281, 36.536132],
+                [110.503408, 36.48819],
+                [110.473075, 36.448487],
+                [110.492125, 36.423177],
+                [110.487005, 36.393847],
+                [110.469257, 36.369961],
+                [110.45997, 36.327877],
+                [110.473553, 36.310497],
+                [110.473943, 36.248161],
+                [110.454156, 36.223666],
+                [110.459493, 36.194575],
+                [110.447083, 36.164341],
+                [110.450467, 36.132272],
+                [110.470428, 36.09459],
+                [110.467955, 36.074641],
+                [110.492212, 36.034665],
+                [110.499676, 36.008086],
+                [110.49295, 35.995928],
+                [110.514256, 35.975701],
+                [110.515514, 35.959252],
+                [110.503234, 35.94324],
+                [110.516686, 35.921739],
+                [110.511696, 35.879729],
+                [110.551227, 35.875376],
+                [110.55075, 35.838076],
+                [110.56264, 35.826775],
+                [110.571275, 35.800695],
+                [110.563812, 35.787684],
+                [110.574009, 35.769805],
+                [110.57722, 35.73688],
+                [110.577611, 35.701476],
+                [110.592278, 35.682313],
+                [110.592365, 35.663272],
+                [110.604385, 35.657514],
+                [110.609332, 35.632138],
+                [110.603821, 35.601183],
+                [110.59384, 35.593078],
+                [110.549795, 35.505075],
+                [110.538817, 35.463606],
+                [110.51968, 35.437534],
+                [110.477588, 35.413865],
+                [110.450033, 35.327763],
+                [110.399002, 35.278574],
+                [110.383554, 35.24443],
+                [110.364721, 35.140255],
+                [110.333131, 35.045063],
+                [110.325667, 35.01503],
+                [110.287047, 34.967056],
+                [110.272119, 34.942867],
+                [110.259622, 34.936611],
+                [110.250986, 34.892552],
+                [110.258624, 34.875688],
+                [110.233716, 34.837412],
+                [110.232761, 34.803146],
+                [110.25103, 34.776926],
+                [110.259188, 34.738028],
+                [110.246821, 34.705194],
+                [110.231416, 34.701225],
+                [110.236623, 34.670426],
+                [110.269082, 34.629491],
+                [110.295508, 34.611036],
+                [110.350792, 34.606613],
+                [110.407724, 34.589242],
+                [110.48848, 34.610779],
+                [110.533176, 34.583472],
+                [110.547365, 34.583601],
+                [110.610981, 34.607318],
+                [110.65355, 34.608023],
+                [110.706403, 34.603985],
+                [110.749146, 34.652235],
+                [110.780043, 34.648648],
+                [110.812414, 34.624686],
+                [110.883493, 34.642434],
+                [110.912871, 34.684578],
+                [110.915735, 34.723245],
+                [110.935522, 34.730541],
+                [110.964032, 34.706411],
+                [110.976312, 34.706475],
+                [111.035371, 34.740908],
+                [111.066398, 34.751594],
+                [111.11821, 34.756584],
+                [111.148499, 34.807494],
+                [111.160736, 34.814591],
+                [111.177789, 34.803978],
+                [111.209423, 34.800972],
+                [111.223483, 34.789462],
+                [111.239842, 34.793555],
+                [111.255247, 34.819578],
+                [111.294128, 34.807686],
+                [111.340299, 34.83134],
+                [111.355357, 34.82303],
+                [111.395583, 34.814975],
+                [111.439367, 34.838179],
+                [111.464622, 34.826929],
+                [111.502635, 34.829933],
+                [111.527803, 34.85013],
+                [111.554447, 34.852239],
+                [111.570806, 34.843292],
+                [111.589422, 34.861887],
+                [111.591852, 34.881629],
+                [111.617672, 34.894787],
+                [111.621577, 34.916308],
+                [111.647006, 34.938654],
+                [111.681547, 34.95225],
+                [111.669614, 34.988176],
+                [111.687102, 34.988495],
+                [111.711749, 35.003613],
+                [111.739348, 35.004251],
+                [111.749111, 35.016433],
+                [111.768595, 35.015349],
+                [111.781353, 35.030016],
+                [111.809515, 35.036839],
+                [111.810426, 35.063295],
+                [111.818411, 35.068457],
+                [111.868748, 35.075723],
+                [111.885584, 35.069987],
+                [111.900078, 35.079865],
+                [111.91839, 35.071516],
+                [111.928371, 35.082032],
+                [111.963129, 35.079291],
+                [111.977926, 35.067183],
+                [112.02119, 35.068011],
+                [112.038938, 35.045509],
+                [112.062153, 35.055773],
+                [112.056252, 35.098471],
+                [112.067231, 35.136243],
+                [112.063325, 35.159802],
+                [112.041498, 35.189782],
+                [112.042062, 35.200281],
+                [112.078686, 35.219369],
+                [112.079641, 35.242395],
+                [112.058812, 35.279909],
+                [112.093918, 35.27921],
+                [112.217243, 35.253269],
+                [112.216678, 35.240232],
+                [112.242715, 35.234826],
+                [112.282811, 35.242013],
+                [112.304421, 35.25187],
+                [112.288538, 35.217524],
+                [112.367298, 35.220196],
+                [112.390731, 35.238833],
+                [112.42397, 35.23807],
+                [112.457731, 35.226366],
+                [112.489799, 35.229928],
+                [112.513492, 35.218542],
+                [112.540526, 35.222931],
+                [112.567864, 35.211734],
+                [112.575024, 35.22115],
+                [112.618982, 35.220068],
+                [112.637207, 35.225666],
+                [112.618331, 35.254032],
+                [112.636686, 35.264206],
+                [112.63916, 35.247864],
+                [112.65144, 35.259246],
+                [112.654998, 35.244239],
+                [112.682684, 35.233745],
+                [112.707418, 35.216951],
+                [112.703079, 35.201554],
+                [112.712669, 35.186981],
+                [112.720306, 35.206453],
+                [112.735364, 35.210398],
+                [112.767258, 35.204099],
+                [112.798241, 35.238642],
+                [112.822194, 35.258102],
+                [112.86906, 35.243794],
+                [112.907073, 35.245829],
+                [112.929637, 35.256894],
+                [112.93606, 35.284422],
+                [112.964699, 35.29313],
+                [112.982795, 35.287283],
+                [112.99156, 35.302346],
+                [112.985311, 35.338118],
+                [112.999545, 35.362316],
+                [113.0202, 35.356029],
+                [113.038252, 35.360602],
+                [113.067109, 35.353552],
+                [113.084076, 35.340531],
+                [113.107595, 35.340785],
+                [113.126558, 35.33221],
+                [113.148906, 35.351202],
+                [113.154634, 35.380858],
+                [113.170603, 35.38727],
+                [113.169518, 35.410883],
+                [113.185226, 35.409042],
+                [113.190043, 35.44908],
+                [113.230052, 35.453267],
+                [113.265375, 35.434615],
+                [113.304385, 35.427001],
+                [113.297356, 35.438549],
+                [113.306425, 35.460815],
+                [113.294665, 35.467284],
+                [113.312327, 35.481236],
+                [113.325909, 35.46925],
+                [113.34817, 35.468362],
+                [113.370778, 35.480094],
+                [113.39178, 35.50685],
+                [113.416645, 35.516168],
+                [113.43921, 35.507547],
+                [113.485424, 35.520731],
+                [113.5066, 35.516485],
+                [113.498529, 35.532392],
+                [113.50673, 35.565971],
+                [113.541966, 35.596181],
+                [113.556677, 35.619795],
+                [113.547998, 35.657577],
+                [113.560061, 35.660425],
+                [113.578547, 35.633531],
+                [113.624848, 35.632012],
+                [113.624978, 35.652389],
+                [113.614911, 35.683008],
+                [113.593127, 35.69142],
+                [113.60198, 35.706408],
+                [113.586792, 35.744022],
+                [113.599116, 35.775112],
+                [113.583494, 35.794253],
+                [113.604974, 35.800127],
+                [113.586141, 35.806127],
+                [113.585273, 35.825765],
+                [113.606059, 35.823744],
+                [113.623807, 35.83151],
+                [113.641208, 35.822482],
+                [113.661038, 35.837255],
+                [113.658218, 35.853919],
+                [113.644028, 35.854866],
+                [113.637389, 35.869886],
+                [113.654443, 35.917199],
+                [113.647803, 35.96713],
+                [113.636868, 35.97589],
+                [113.648888, 35.994164],
+                [113.686467, 35.986414],
+                [113.695927, 35.999897],
+                [113.680739, 36.014826],
+                [113.695146, 36.026793],
+                [113.670195, 36.029501],
+                [113.661429, 36.042913],
+                [113.685773, 36.056009],
+                [113.673796, 36.111578],
+                [113.655527, 36.125102],
+                [113.693193, 36.124222],
+                [113.713762, 36.132964],
+                [113.706862, 36.147365],
+                [113.681347, 36.150698],
+                [113.679264, 36.15994],
+                [113.651665, 36.172199],
+                [113.697923, 36.181879],
+                [113.68638, 36.195517],
+                [113.705387, 36.20067],
+                [113.698444, 36.214305],
+                [113.677311, 36.222535],
+                [113.703911, 36.237799],
+                [113.70057, 36.252306],
+                [113.716235, 36.262604],
+                [113.709075, 36.299703],
+                [113.723308, 36.304849],
+                [113.736413, 36.324677],
+                [113.728733, 36.341427],
+                [113.729601, 36.381623],
+                [113.708381, 36.423365],
+                [113.670195, 36.425119],
+                [113.629231, 36.454688],
+                [113.587226, 36.461014],
+                [113.582105, 36.482931],
+                [113.55442, 36.494701],
+                [113.559454, 36.531001],
+                [113.566961, 36.54414],
+                [113.58089, 36.541075],
+                [113.588137, 36.562719],
+                [113.569695, 36.58592],
+                [113.539753, 36.59411],
+                [113.545264, 36.616865],
+                [113.535457, 36.629239],
+                [113.486856, 36.635238],
+                [113.477049, 36.655232],
+                [113.502001, 36.681528],
+                [113.507034, 36.70488],
+                [113.477526, 36.697263],
+                [113.465376, 36.707752],
+                [113.4777, 36.726416],
+                [113.499353, 36.740583],
+                [113.536195, 36.732345],
+                [113.543528, 36.744327],
+                [113.569174, 36.758116],
+                [113.59994, 36.752875],
+                [113.655744, 36.785686],
+                [113.680956, 36.790114],
+                [113.673883, 36.807511],
+                [113.684124, 36.824779],
+                [113.67627, 36.855628],
+                [113.696925, 36.882291],
+                [113.710507, 36.887336],
+                [113.731597, 36.878616],
+                [113.731944, 36.859117],
+                [113.742055, 36.851142],
+                [113.772343, 36.871141],
+                [113.786924, 36.870082],
+                [113.792825, 36.894748],
+                [113.761669, 36.956065],
+                [113.777464, 36.968572],
+                [113.794952, 36.995009],
+                [113.771866, 37.016836],
+                [113.790178, 37.042946],
+                [113.788225, 37.059788],
+                [113.768785, 37.062523],
+                [113.758154, 37.075633],
+                [113.773515, 37.106939],
+                [113.767353, 37.144626],
+                [113.773168, 37.151888],
+                [113.831923, 37.167527],
+                [113.836566, 37.189491],
+                [113.853099, 37.215107],
+                [113.886425, 37.239165],
+                [113.886859, 37.25993],
+                [113.89901, 37.279512],
+                [113.902177, 37.309991],
+                [113.921184, 37.330675],
+                [113.959848, 37.349001],
+                [113.973864, 37.403147],
+                [113.995344, 37.421146],
+                [114.014524, 37.424609],
+                [114.025329, 37.441304],
+                [114.028323, 37.47456],
+                [114.036785, 37.49421],
+                [114.05961, 37.515893],
+                [114.123268, 37.601452],
+                [114.115371, 37.619896],
+                [114.131123, 37.648264],
+                [114.139715, 37.67588],
+                [114.128259, 37.698188],
+                [114.08825, 37.708785],
+                [114.068028, 37.721537],
+                [114.047243, 37.720243],
+                [113.996906, 37.704473],
+                [114.000811, 37.735333],
+                [114.041167, 37.756823],
+                [114.043858, 37.777444],
+                [114.01882, 37.794861],
+                [114.006669, 37.813503],
+                [113.982543, 37.812826],
+                [113.970175, 37.833986],
+                [113.971521, 37.868788],
+                [113.95924, 37.906338],
+                [113.936545, 37.923171],
+                [113.901266, 37.984818],
+                [113.872366, 37.990342],
+                [113.878354, 38.032369],
+                [113.876271, 38.05506],
+                [113.855963, 38.065912],
+                [113.854748, 38.077131],
+                [113.824199, 38.106732],
+                [113.810053, 38.112553],
+                [113.822507, 38.150468],
+                [113.833572, 38.147468],
+                [113.825457, 38.169143],
+                [113.796861, 38.162837],
+                [113.756591, 38.171653],
+                [113.731119, 38.168347],
+                [113.720618, 38.174653],
+                [113.738496, 38.189527],
+                [113.715064, 38.19375],
+                [113.711722, 38.213699],
+                [113.67909, 38.205377],
+                [113.6498, 38.229788],
+                [113.62615, 38.232541],
+                [113.598899, 38.227158],
+                [113.570346, 38.237434],
+                [113.566267, 38.252357],
+                [113.54483, 38.270516],
+                [113.546045, 38.293072],
+                [113.557284, 38.343476],
+                [113.534329, 38.365216],
+                [113.525433, 38.382981],
+                [113.538017, 38.418071],
+                [113.573166, 38.44918],
+                [113.583494, 38.465949],
+                [113.561363, 38.485762],
+                [113.555548, 38.521046],
+                [113.562057, 38.558322],
+                [113.602804, 38.586876],
+                [113.604236, 38.616087],
+                [113.612871, 38.646016],
+                [113.632616, 38.65307],
+                [113.66707, 38.646989],
+                [113.702132, 38.651672],
+                [113.713805, 38.663712],
+                [113.709987, 38.698301],
+                [113.729036, 38.711974],
+                [113.745396, 38.701522],
+                [113.775641, 38.709847],
+                [113.780415, 38.728317],
+                [113.802936, 38.7633],
+                [113.83956, 38.758381],
+                [113.836566, 38.795959],
+                [113.853663, 38.810159],
+                [113.855529, 38.828967],
+                [113.835611, 38.842555],
+                [113.80133, 38.854866],
+                [113.776205, 38.885665],
+                [113.775121, 38.919056],
+                [113.767527, 38.959637],
+                [113.776726, 38.98694],
+                [113.806798, 38.989725],
+                [113.830534, 39.011813],
+                [113.884429, 39.051676],
+                [113.898012, 39.067639],
+                [113.930297, 39.063467],
+                [113.942881, 39.087467],
+                [113.961757, 39.100823],
+                [113.984365, 39.095384],
+                [114.000464, 39.100763],
+                [114.006496, 39.122877],
+                [114.050801, 39.135864],
+                [114.065251, 39.093511],
+                [114.096798, 39.083719],
+                [114.108732, 39.052281],
+                [114.126653, 39.05089],
+                [114.157202, 39.06117],
+                [114.180895, 39.049076],
+                [114.196994, 39.050406],
+                [114.226372, 39.06649],
+                [114.300141, 39.079246],
+                [114.320797, 39.070481],
+                [114.349133, 39.076768],
+                [114.369658, 39.107531],
+                [114.360762, 39.133992],
+                [114.388187, 39.176985],
+                [114.417999, 39.171613],
+                [114.443601, 39.174148],
+                [114.453147, 39.192618],
+                [114.465601, 39.188514],
+                [114.474844, 39.219228],
+                [114.436354, 39.229604],
+                [114.415959, 39.242873],
+                [114.437656, 39.260421],
+                [114.425072, 39.285137],
+                [114.438611, 39.319424],
+                [114.466643, 39.329664],
+                [114.479704, 39.351104],
+                [114.469464, 39.355199],
+                [114.470896, 39.408767],
+                [114.496802, 39.438543],
+                [114.502313, 39.477082],
+                [114.529868, 39.485196],
+                [114.536594, 39.512897],
+                [114.557336, 39.531998],
+                [114.557336, 39.550674],
+                [114.568922, 39.573967],
+                [114.556989, 39.58141],
+                [114.515374, 39.565023],
+                [114.495804, 39.608172],
+                [114.474758, 39.613751],
+                [114.431668, 39.614051],
+                [114.408148, 39.651953],
+                [114.407107, 39.690374],
+                [114.410231, 39.761705],
+                [114.416784, 39.776189],
+                [114.390704, 39.818608],
+                [114.406716, 39.83344],
+                [114.395434, 39.867217],
+                [114.285084, 39.859686],
+                [114.286819, 39.871042],
+                [114.245509, 39.861897],
+                [114.221468, 39.86118],
+                [114.202071, 39.872297],
+                [114.204501, 39.885205],
+                [114.227717, 39.8959],
+                [114.220644, 39.914298],
+                [114.174169, 39.897632],
+                [114.102873, 39.912865],
+                [114.089942, 39.910177],
+                [114.067768, 39.922301],
+                [114.047373, 39.91615],
+                [114.02828, 39.959318],
+                [114.029451, 39.985397],
+                [114.02125, 39.991781],
+                [113.960455, 40.000908],
+                [113.932032, 40.009438],
+                [113.914631, 40.005919],
+                [113.922486, 40.026613],
+                [113.954857, 40.030847],
+                [113.975556, 40.051057],
+                [113.981024, 40.073227],
+                [113.973864, 40.097118],
+                [113.979852, 40.112306],
+                [114.019948, 40.102479],
+                [114.043815, 40.056898],
+                [114.091157, 40.075313],
+                [114.101224, 40.108733],
+                [114.089118, 40.121477],
+                [114.068028, 40.179748],
+                [114.097753, 40.193549],
+                [114.123399, 40.188672],
+                [114.123963, 40.178141],
+                [114.145095, 40.177368],
+                [114.180071, 40.191527],
+                [114.235875, 40.198308],
+                [114.240171, 40.221976],
+                [114.255229, 40.236185],
+                [114.293111, 40.230122],
+                [114.33516, 40.245399],
+                [114.362585, 40.250094],
+                [114.406412, 40.246172],
+                [114.469941, 40.268041],
+                [114.510948, 40.302969],
+                [114.526439, 40.323574],
+                [114.530605, 40.345121],
+                [114.499318, 40.354023],
+                [114.470809, 40.349691],
+                [114.446552, 40.372891],
+                [114.403722, 40.353786],
+                [114.383544, 40.354023],
+                [114.344446, 40.369569],
+                [114.314418, 40.369569],
+                [114.28708, 40.423418],
+                [114.298709, 40.445585],
+                [114.27545, 40.458029],
+                [114.267205, 40.474202],
+                [114.296409, 40.535957],
+                [114.293459, 40.551402],
+                [114.274322, 40.552881],
+                [114.282957, 40.590796],
+                [114.258223, 40.610662],
+                [114.236135, 40.606997],
+                [114.209318, 40.629754],
+                [114.216435, 40.635013],
+                [114.200075, 40.662191],
+                [114.183239, 40.671701],
+                [114.162366, 40.713562],
+                [114.139541, 40.739941],
+                [114.09324, 40.731917],
+                [114.072281, 40.72153],
+                [114.064079, 40.707128],
+                [114.072715, 40.679142],
+                [114.070458, 40.660301],
+                [114.041818, 40.608652],
+                [114.04811, 40.595882],
+                [114.076881, 40.575834],
+                [114.080178, 40.547733],
+                [114.06191, 40.528855],
+                [114.011399, 40.515892],
+                [113.970089, 40.522226],
+                [113.947784, 40.51678],
+                [113.930904, 40.493392],
+                [113.890114, 40.466442],
+                [113.863427, 40.456488],
+                [113.850973, 40.460577],
+                [113.832704, 40.487055],
+                [113.794821, 40.517964],
+                [113.790699, 40.502511],
+                [113.763448, 40.473965],
+                [113.688767, 40.448193],
+                [113.667981, 40.423773],
+                [113.647803, 40.415533],
+                [113.584145, 40.37123],
+                [113.559888, 40.348623],
+                [113.500135, 40.334497],
+                [113.457652, 40.33046],
+                [113.387615, 40.319121],
+                [113.315972, 40.32013],
+                [113.302737, 40.334675],
+                [113.291194, 40.36506],
+                [113.273967, 40.390093],
+                [113.247757, 40.412983],
+                [113.219377, 40.402844],
+                [113.170733, 40.395965],
+                [113.115362, 40.381137],
+                [113.033131, 40.368916],
+                [112.989824, 40.357405],
+                [112.89297, 40.326423],
+                [112.890453, 40.305167],
+                [112.85513, 40.218409],
+                [112.84502, 40.203899],
+                [112.750725, 40.168026],
+                [112.728594, 40.168205],
+                [112.624319, 40.236839]
+            ]
+        ]
+        ]
+    }
+    }]
+}

Fichier diff supprimé car celui-ci est trop grand
+ 2039 - 0
src/assets/provinceData/sichuan.json


Fichier diff supprimé car celui-ci est trop grand
+ 1249 - 0
src/assets/provinceData/tianjin.json


Fichier diff supprimé car celui-ci est trop grand
+ 1250 - 0
src/assets/provinceData/xinjiang.json


Fichier diff supprimé car celui-ci est trop grand
+ 2315 - 0
src/assets/provinceData/xizang.json


Fichier diff supprimé car celui-ci est trop grand
+ 1814 - 0
src/assets/provinceData/yunnan.json


Fichier diff supprimé car celui-ci est trop grand
+ 3074 - 0
src/assets/provinceData/zhejiang.json


Fichier diff supprimé car celui-ci est trop grand
+ 5100 - 0
src/assets/regionData/dongbei.json


Fichier diff supprimé car celui-ci est trop grand
+ 5011 - 0
src/assets/regionData/dongnan.json


Fichier diff supprimé car celui-ci est trop grand
+ 2938 - 0
src/assets/regionData/huabei.json


Fichier diff supprimé car celui-ci est trop grand
+ 1932 - 0
src/assets/regionData/huadong.json


Fichier diff supprimé car celui-ci est trop grand
+ 4164 - 0
src/assets/regionData/huanan.json


Fichier diff supprimé car celui-ci est trop grand
+ 3453 - 0
src/assets/regionData/huazhong.json


Fichier diff supprimé car celui-ci est trop grand
+ 6384 - 0
src/assets/regionData/other.json


Fichier diff supprimé car celui-ci est trop grand
+ 4626 - 0
src/assets/regionData/xibei.json


Fichier diff supprimé car celui-ci est trop grand
+ 3573 - 0
src/assets/regionData/xinan.json


Fichier diff supprimé car celui-ci est trop grand
+ 4588 - 0
src/assets/regionData/zhongnan.json


+ 0 - 21
src/assets/svg/menu.svg

@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="16px" height="12px" viewBox="0 0 16 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <!-- Generator: Sketch 64 (93537) - https://sketch.com -->
-    <title>菜单</title>
-    <desc>Created with Sketch.</desc>
-    <g id="各种首页" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g id="甘特图-弹窗" transform="translate(-301.000000, -563.000000)" fill-rule="nonzero">
-            <g id="编组-3">
-                <g id="菜单" transform="translate(301.000000, 561.000000)">
-                    <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
-                    <path d="M0.699333328,3.66666667 C0.699333328,4.21895142 1.14704858,4.66666667 1.69933333,4.66666667 C2.25161808,4.66666667 2.69933333,4.21895142 2.69933333,3.66666667 C2.69933333,3.11438192 2.25161808,2.66666667 1.69933333,2.66666667 C1.14704858,2.66666667 0.699333328,3.11438192 0.699333328,3.66666667 Z" id="路径" fill="#8D9399"></path>
-                    <path d="M0.666666672,8.28 C0.666666672,8.83228475 1.11438192,9.28 1.66666667,9.28 C2.21895142,9.28 2.66666667,8.83228475 2.66666667,8.28 C2.66666667,7.72771525 2.21895142,7.28 1.66666667,7.28 C1.11438192,7.28 0.666666672,7.72771525 0.666666672,8.28 Z" id="路径" fill="#8D9399"></path>
-                    <path d="M0.666666672,12.984 C0.666666672,13.5362847 1.11438192,13.984 1.66666667,13.984 C2.21895142,13.984 2.66666667,13.5362847 2.66666667,12.984 C2.66666667,12.4317153 2.21895142,11.984 1.66666667,11.984 C1.11438192,11.984 0.666666672,12.4317153 0.666666672,12.984 Z" id="路径" fill="#8D9399"></path>
-                    <path d="M4.38333333,2.988 L14.3833333,2.988 C14.8277778,2.988 15.05,3.21022222 15.05,3.65466667 L15.05,3.65466667 C15.05,4.09911112 14.8277778,4.32133333 14.3833333,4.32133333 L4.38333333,4.32133333 C3.93888888,4.32133333 3.71666667,4.09911111 3.71666667,3.65466667 L3.71666667,3.65466667 C3.71666667,3.21022222 3.93888889,2.988 4.38333333,2.988 L4.38333333,2.988 Z" id="路径" fill="#8D9399"></path>
-                    <path d="M4.38333333,7.65466667 L14.3833333,7.65466667 C14.8277778,7.65466667 15.05,7.87688889 15.05,8.32133333 L15.05,8.32133333 C15.05,8.76577778 14.8277778,8.988 14.3833333,8.988 L4.38333333,8.988 C3.93888888,8.988 3.71666667,8.76577778 3.71666667,8.32133333 L3.71666667,8.32133333 C3.71666667,7.87688888 3.93888889,7.65466667 4.38333333,7.65466667 Z" id="路径" fill="#8D9399"></path>
-                    <path d="M4.38333333,12.3213333 L14.3833333,12.3213333 C14.8277778,12.3213333 15.05,12.5435556 15.05,12.988 L15.05,12.988 C15.05,13.4324444 14.8277778,13.6546667 14.3833333,13.6546667 L4.38333333,13.6546667 C3.93888888,13.6546667 3.71666667,13.4324444 3.71666667,12.988 L3.71666667,12.988 C3.71666667,12.5435556 3.93888889,12.3213333 4.38333333,12.3213333 Z" id="路径" fill="#8D9399"></path>
-                </g>
-            </g>
-        </g>
-    </g>
-</svg>

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 16
src/assets/svg/picture.svg


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 20
src/assets/svg/plan_time.svg


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 18
src/assets/svg/real_time.svg


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 19
src/assets/svg/report.svg


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 18
src/assets/svg/task.svg


+ 83 - 34
src/components/Legend/src/legend.vue

@@ -6,9 +6,9 @@
 <template>
     <div>
         <div class='legend-container'>
-            <div :class='showView===1?"legend2":"legend"' @click='showTl' v-if='(type==1 || floors.length>0)&& isMessage'>图例</div>
+            <div :class='showView===1?"legend2":"legend"' @click='showTl' v-if='(type==1 || floors.length>0)&& isMessage && legendTable.length>0 '>图例</div>
             <!-- 图里展示状态组件 -->
-            <el-collapse-transition v-if='(type==1 || floors.length>0)&& isMessage'>
+            <el-collapse-transition v-if='(type==1 || floors.length>0)&& isMessage && legendTable.length>0 '>
                 <div class='legend-tab' v-if='showView===1'>
                     <div class='legend-table2' v-if='systemName=="土建系统"'>
                         <lengend-view @changeSwitch='handleSwich' :remarksText='remarksText' ref='viewLengend' :systemName='systemName'></lengend-view>
@@ -19,11 +19,11 @@
                 </div>
             </el-collapse-transition>
             <!-- 图例编辑状态组件 -->
-            <el-collapse-transition @isShow2='isShow2'>
+            <el-collapse-transition>
                 <div v-if='showView===2'>
                     <lengend-edit
                         @handleSwich2='handleSwich2'
-                        v-if='editTable.length>=0'
+                        v-if='editTable.length>0'
                         :loading='loading1'
                         ref='editLen'
                         :editTable='editTable'
@@ -51,12 +51,12 @@
             </el-tooltip>
             <!-- 编辑图例 -->
             <el-tooltip effect='dark' content='编辑图例' placement='left'>
-                <p v-if='systemName != "土建系统" && isMessage' @click='editTl' class='tltk'>
+                <p v-if='systemName != "土建系统" && isMessage' @click='editTl' class='tltk-1'>
                     <img src='@/assets/imgs/bjtl.png' alt />
                 </p>
             </el-tooltip>
             <!-- 新增分布图 -->
-            <el-tooltip effect='dark' content='新增分布图' placement='left' v-if='floorSelect.length!=floors.length && !isMessage && type==0'>
+            <el-tooltip effect='dark' content='新增分布图' placement='left' v-if='floorSelect.length!=floors.length && type==0'>
                 <p class='tltk' style='margin-left: -5px;' @click='addFloor'>
                     <img src='@/assets/imgs/bjj.png' alt />
                 </p>
@@ -64,7 +64,13 @@
             <!-- 编辑分布图 -->
 
             <!-- 有修改权限 -->
-            <el-tooltip v-if='editPmt' class='bjpmt' effect='dark' :content='editTips' placement='left'>
+            <el-tooltip
+                v-if='editPmt'
+                class='bjpmt'
+                effect='dark'
+                :content='editTips?editTips:`编辑${categoryId=="FZQZL"?"分水器支路分布图":"消防泵房引出管路分布图"}`'
+                placement='left'
+            >
                 <span class='edit-icon corner-con' @click='goToEditer'>
                     <img src='@/assets/imgs/bjs.png' alt />
                     <!-- 角标 -->
@@ -112,8 +118,6 @@ export default {
                 '<p>主要设备房包括:冷源机房,热源机房,开闭站,配变电所(室),发电机房,消防水泵房,消防高位水箱间,生活水泵房,慧云机房,垃圾房</p>',
             text2: '<p>图例后×的数字,代表此位置的数量</p>',
             text2: '',
-            show: true,
-            show2: false,
             loading: true,
             loading1: true,
             viewTable: [],
@@ -137,16 +141,18 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'floorSelect', 'isMessage', 'ssoToken', 'showView'])
+        ...mapGetters(['plazaId', 'fmapID', 'floorSelect', 'isMessage', 'ssoToken', 'showView', 'legendTable'])
     },
     props: {
         floors: {
+            //原理图中有数据楼层
             default: () => {
                 ;[]
             },
             type: Array
         },
         type: {
+            // 原理图类型 == 0 ;
             default: '1',
             type: String
         },
@@ -159,6 +165,7 @@ export default {
             type: String
         },
         editTips: {
+            // 编辑器文案
             type: String,
             default: ''
         }
@@ -187,14 +194,18 @@ export default {
         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']
-                }
+                floorId = this.$store.state.currentFloor.gname || this.$cookie.get('floorMapId')
+            // 增加校验 floorId,防止上传 undefined
+            if (!floorId) {
+                return true
+            }
+            let data = {
+                Distinct: true,
+                Filters: `projectId='${this.plazaId}';isPub=false;floorId='${floorId}'`,
+                PageNumber: 1,
+                PageSize: 500,
+                Projection: ['floorId']
+            }
             try {
                 // 调用接口
                 res = await queryDraftNum(data)
@@ -259,14 +270,10 @@ export default {
             } else {
                 this.$store.commit('SETSHOWVIEW', 0)
             }
-            // this.showView = !this.showView
             this.queryView(false)
-            // if (this.showView) {
-            //     this.show2 = false
-            // }
         },
         cance() {
-            this.show2 = false
+            // this.show2 = false
         },
         // 编辑图例
         editTl() {
@@ -275,8 +282,6 @@ export default {
             } else {
                 this.$store.commit('SETSHOWVIEW', 0)
             }
-            // this.show = false
-            // this.show2 = true
             this.queryEditNum(true)
         },
         /**
@@ -314,6 +319,7 @@ export default {
         handleSwich(val) {
             this.queryView(!val)
         },
+        // 默认隐藏为0的项目
         handleSwich2(val) {
             this.editSwitch = val
             this.queryEditNum(!this.editSwitch)
@@ -323,16 +329,18 @@ export default {
         queryView(flag) {
             let postParams = {}
             let data = {
+                categoryId: this.$cookie.get('categoryId'),
                 graphId: this.$cookie.get('graphId'),
                 projectId: this.$store.state.plazaId,
-                flag: flag
+                flag: flag,
+                buildingId: '1',
+                floorId: this.$store.state.currentFloor.gname
             }
             queryStatis({ data, postParams }).then(res => {
                 this.loading = false
                 let viewTable = []
                 viewTable = res.data.Data ? res.data.Data : []
                 this.$store.commit('SETLEGENDTABLE', viewTable)
-
                 if (viewTable.length > 0) {
                     viewTable.forEach(el => {
                         if (el.Name == '主要设备房') {
@@ -354,9 +362,12 @@ export default {
         queryEditNum(flag) {
             let postParams = {}
             let data = {
+                categoryId: this.$cookie.get('categoryId'),
                 graphId: this.$cookie.get('graphId'),
                 projectId: this.$store.state.plazaId,
-                flag: flag
+                flag: flag,
+                buildingId: '1',
+                floorId: this.$store.state.currentFloor.gname
             }
             queryStatis({ data, postParams }).then(res => {
                 //console.log('编辑图例数', res)
@@ -366,9 +377,24 @@ export default {
         },
         // 编辑数量
         queryEdit(val) {
+            let arr = []
+            if (val.length > 0) {
+                val.forEach(el => {
+                    let obj = {
+                        BuildingId: '1',
+                        FloorId: this.$store.state.currentFloor.gname,
+                        ProjectId: this.plazaId,
+                        CategoryId: el.GraphCategoryId,
+                        GraphId: this.$cookie.get('graphId'),
+                        GraphElementId: el.GraphElementId,
+                        Num: el.Num
+                    }
+                    arr.push(obj)
+                })
+            }
             let params = {
                 postParams: {
-                    Content: val
+                    Content: arr
                 }
             }
             updateStatis(params).then(res => {
@@ -378,9 +404,8 @@ export default {
                         message: '操作成功',
                         type: 'success'
                     })
-                    this.queryEditNum(this.editSwitch)
-                    this.show2 = false
-                    this.show = true
+                    this.$store.commit('SETSHOWVIEW', 1)
+                    // this.queryEditNum(this.editSwitch)
                 } else {
                     this.$message({
                         message: '操作失败',
@@ -395,9 +420,9 @@ export default {
                     element.Modify = element.IsModify
                 })
                 this.queryEdit(val)
-                this.isShow2()
+                // this.isShow2()
             } else {
-                this.show2 = false
+                // this.show2 = false
                 // this.isShow2()
                 // this.queryEditNum(true)
             }
@@ -443,6 +468,7 @@ export default {
         }
     },
     mounted() {
+        console.log('editTips', this.editTips)
         this.init()
         // 定时查询草稿箱数量
         this.getDraftNum() //首次查询
@@ -602,8 +628,31 @@ export default {
         cursor: pointer;
         border: 1px solid #eee;
     }
+    .tltk-1 {
+        margin-bottom: 10px;
+        display: none;
+        cursor: pointer;
+        border: 1px solid #eee;
+    }
 }
 .edit_map:hover .tltk {
+    // display: block;
+    // position: fixed;
+    // bottom: 70px;
+    margin-left: -10px;
+    right: 22px;
+    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;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+.edit_map:hover .tltk-1 {
     display: block;
 }
 .edit_map:hover .bjtk {

+ 39 - 3
src/components/Rotation/src/rotation.vue

@@ -4,7 +4,7 @@
 *@info:图片轮播
 */
 <template>
-    <div :class='[type?"rotationFull":"rotation"]'>
+    <div :class='[type==1?"rotationFull":(type==3?"rotationFullYlt":"rotation")]'>
         <div v-if='rotationImg.length==1' class='rotationCon'>
             <!-- <img
                 src='https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1592807833&di=5adf17cda9f46c37696da5b1d0aec9dc&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
@@ -13,7 +13,7 @@
             <img :src='rotationImg[0].url' alt />
             <!-- <img src='./3440.jpg' alt /> -->
         </div>
-        <el-carousel v-else trigger='click' style='height:100%;width:100%' :interval='5000' arrow='always'>
+        <el-carousel v-else trigger='click' style='height:100%;width:100%' :interval='5000' arrow='always' @change='changePic'>
             <el-carousel-item v-for='(item,index) in rotationImg' :key='index'>
                 <img :src='item.url' alt />
             </el-carousel-item>
@@ -29,7 +29,18 @@ export default {
             rotationImgs: [{ url: require('@/assets/images/login_back.png') }]
         }
     },
-    mounted() {}
+    methods: {
+        changePic(val) {
+            if (this.type == 2) {
+                this.$emit('scan', val + 1)
+            }
+        }
+    },
+    mounted() {
+        if (this.type == 2) {
+            this.changePic(1)
+        }
+    }
 }
 </script>
 <style lang="less" scoped>
@@ -75,6 +86,31 @@ export default {
         min-width: 100%;
     }
 }
+.rotationFullYlt {
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    // 轮播图适配
+    /deep/ .el-carousel__container {
+        height: 100% !important;
+    }
+    .rotationCon {
+        height: 100%;
+        width: 100%;
+        overflow: auto;
+    }
+    img {
+        // width: 100%;
+        // height: 100%;
+        // object-fit: fill;
+        // min-width: 100%;
+        width: 100%;
+        min-height: 100%;
+    }
+}
 </style>
 <style lang="less">
 .rotation,

+ 91 - 51
src/components/editLengend.vue

@@ -7,7 +7,7 @@
     <div class='view'>
         <div class='legend-tab2'>
             <div class='legend-table2-box'>
-                <div class='legend-table2' v-if='editTable.length>=0'>
+                <div class='legend-table2' v-if='editTable.length>0'>
                     <el-table
                         v-loading='loading'
                         :header-cell-style='{background:"rgba(2,91,170,0.1)",fontFamily:"PingFangSC-Medium,PingFang SC;",color:"rgba(0,0,0,0.85);",fontSize:"12px"}'
@@ -116,6 +116,8 @@
     </div>
 </template>
 <script>
+import { updateStatis } from '@/api/public.js'
+
 export default {
     props: ['editTable', 'loading'],
     data() {
@@ -131,64 +133,102 @@ export default {
         handleSelectionChange(val) {
             this.multipleSelection = val
         },
+        // 编辑图例取消
         cancel() {
-            this.save()
-            // this.$emit('cance')
+            if (this.editNum.length > 0) {
+                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)
+                        this.$store.commit('SETSHOWVIEW', 1)
+                    })
+            } else {
+                this.$store.commit('SETSHOWVIEW', 1)
+            }
+        },
+        // 编辑图里保存
+        save() {
+            this.queryEdit(this.editNum)
+        },
+        // 编辑数量
+        queryEdit(val) {
+            val.map(item => {
+                item.BuildingId = '1'
+                item.FloorId = this.$store.state.currentFloor.gname
+                item.ProjectId = this.$store.state.plazaId
+                item.CategoryId = this.$cookie.get('categoryId')
+            })
+            let params = {
+                postParams: {
+                    Content: val
+                }
+            }
+            updateStatis(params).then(res => {
+                if (res.Result == 'success') {
+                    this.$message({
+                        message: '操作成功',
+                        type: 'success'
+                    })
+                    this.$store.commit('SETSHOWVIEW', 1)
+                } else {
+                    this.$message({
+                        message: '操作失败',
+                        type: 'error'
+                    })
+                }
+            })
         },
+        // 修改图例数量
         changeTable(val) {
             this.editNum.push(val)
-            var obj = {}
-            this.editNum = this.editNum.reduce(function(item, next) {
-                obj[next.key] ? '' : (obj[next.key] = true && item.push(next))
-                return item
-            }, [])
+            let result = [],
+                obj = {}
+            for (var i = 0; i < this.editNum.length; i++) {
+                if (!obj[this.editNum[i].GraphElementId]) {
+                    result.push(this.editNum[i])
+                    obj[this.editNum[i].GraphElementId] = true
+                }
+            }
         },
+        // 修改隐藏为0的项目的开关
         changeSwitch(val) {
             this.$emit('handleSwich2', val)
-        },
-        save() {
-            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 = []
-            this.tbData2 = []
-            this.tbData3 = []
-            if (this.editTable.length > 0) {
-                this.tbData1 = this.editTable
-                // 以下不要动 不要删
-                // let len = this.tableData.length
-                // if (len <= 10) {
-                //     this.tbData1 = this.tableData
-                // } else if (len > 10 && len <= 20) {
-                //     this.tbData1 = this.tableData.slice(0, 10)
-                //     this.tbData2 = this.tableData.slice(10, len)
-                // } else if (len > 10 && len <= 30) {
-                //     this.tbData1 = this.tableData.slice(0, 10)
-                //     this.tbData2 = this.tableData.slice(10, 20)
-                //     this.tbData3 = this.tableData.slice(20, len)
-                // } else {
-                //     this.tbData1 = this.tableData.slice(0, parseInt(len / 3))
-                //     this.tbData2 = this.tableData.slice(parseInt(len / 3), parseInt(len / 3) * 2)
-                //     this.tbData3 = this.tableData.slice(parseInt(len / 3) * 2, len)
-                // }
-            }
         }
+        // init() {
+        // this.tbData1 = []
+        // this.tbData2 = []
+        // this.tbData3 = []
+        // if (this.editTable.length > 0) {
+        //     this.tbData1 = this.editTable
+        // 以下不要动 不要删
+        // let len = this.tableData.length
+        // if (len <= 10) {
+        //     this.tbData1 = this.tableData
+        // } else if (len > 10 && len <= 20) {
+        //     this.tbData1 = this.tableData.slice(0, 10)
+        //     this.tbData2 = this.tableData.slice(10, len)
+        // } else if (len > 10 && len <= 30) {
+        //     this.tbData1 = this.tableData.slice(0, 10)
+        //     this.tbData2 = this.tableData.slice(10, 20)
+        //     this.tbData3 = this.tableData.slice(20, len)
+        // } else {
+        //     this.tbData1 = this.tableData.slice(0, parseInt(len / 3))
+        //     this.tbData2 = this.tableData.slice(parseInt(len / 3), parseInt(len / 3) * 2)
+        //     this.tbData3 = this.tableData.slice(parseInt(len / 3) * 2, len)
+        // }
+        // }
+        // }
     },
     mounted() {}
 }

+ 13 - 0
src/components/floorList.vue

@@ -45,6 +45,7 @@
 </template>
 <script>
 import store from '../store'
+import { mapGetters } from 'vuex'
 export default {
     data() {
         return {
@@ -74,7 +75,11 @@ export default {
             }
         }
     },
+    computed: {
+        ...mapGetters(['legendTable'])
+    },
     mounted() {
+        window.vm = this
         this.init()
     },
     methods: {
@@ -177,6 +182,14 @@ export default {
             this.handleCookie()
             this.handlePosition(1, index, this.floorIdArr.length)
             this.handleUpDownStatus(index, this.floorIdArr.length)
+            this.viewLengend()
+        },
+        viewLengend() {
+            if (this.legendTable.length > 0) {
+                this.$store.commit('SETSHOWVIEW', 1)
+            } else {
+                this.$store.commit('SETSHOWVIEW', 0)
+            }
         },
         /**
          * @description 楼层位置动画处理

+ 28 - 25
src/components/floorMap/index.vue

@@ -91,10 +91,6 @@ export default {
                     let imgItem = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.fmapID}/${window.fengmapData.frImg}`)
                     this.scene.addItem(imgItem)
                     this.view.scene = this.scene
-                    this.view.minScale = this.view.scale
-                    if (this.$refs.canvasFun) {
-                        this.$refs.canvasFun.everyScale = this.view.scale
-                    }
                     this.view.fitSceneToView()
                 }
             } else {
@@ -122,10 +118,6 @@ export default {
                         this.fParser.casementList.forEach(t => this.scene.addItem(t))
                         this.view.scene = this.scene
                         this.view.fitSceneToView()
-                        this.view.minScale = this.view.scale
-                        if (this.$refs.canvasFun) {
-                            this.$refs.canvasFun.everyScale = this.view.scale
-                        }
                     })
                 } else {
                     console.log('楼层不正确')
@@ -137,7 +129,16 @@ export default {
                     this.$store.commit('SETISMESSAGE', false)
                     return
                 } else {
-                    this.$store.commit('SETISMESSAGE', true)
+                    console.log('data[0].Elements.Node', data)
+                    if (
+                        data.Data[0].Elements.Nodes.length === 0 &&
+                        data.Data[0].Elements.Markers.length === 0 &&
+                        data.Data[0].Elements.Relations.length === 0
+                    ) {
+                        this.$store.commit('SETISMESSAGE', false)
+                    } else {
+                        this.$store.commit('SETISMESSAGE', true)
+                    }
                 }
                 // 无返回Data处理
                 if (!(data.Data && data.Data.length)) {
@@ -191,6 +192,10 @@ export default {
                     this.scene.addItem(t)
                 })
                 this.view.fitSceneToView()
+                this.view.minScale = this.view.scale
+                if (this.$refs.canvasFun) {
+                    this.$refs.canvasFun.everyScale = this.view.scale
+                }
             })
         },
         clearGraphy() {
@@ -208,8 +213,6 @@ export default {
                 if (name.slice(name.length - 2, name.length) == '机房') {
                     if (location) {
                         this.$refs.boxRoom.open({ name: name, type: this.type, location: location })
-                    } else {
-                        this.$message('未添加位置类型')
                     }
                 }
                 // 选中电井设置电井关联的商铺高亮
@@ -342,25 +345,25 @@ export default {
                     let id = t.data.GraphElementId
                     t.maskFlag = !(res.indexOf(id) > -1)
                 })
-                this.topologyParser.textMarkerList.forEach(t => {
-                    let id = t.data.GraphElementId
-                    t.maskFlag = !(res.indexOf(id) > -1)
-                })
-                this.topologyParser.imageMarkerList.forEach(t => {
-                    let id = t.data.GraphElementId
-                    t.maskFlag = !(res.indexOf(id) > -1)
-                })
-                this.topologyParser.lineMarkerList.forEach(t => {
-                    let id = t.data.GraphElementId
-                    t.maskFlag = !(res.indexOf(id) > -1)
-                })
+                // this.topologyParser.textMarkerList.forEach(t => {
+                //     let id = t.data.GraphElementId
+                //     t.maskFlag = !(res.indexOf(id) > -1)
+                // })
+                // this.topologyParser.imageMarkerList.forEach(t => {
+                //     let id = t.data.GraphElementId
+                //     t.maskFlag = !(res.indexOf(id) > -1)
+                // })
+                // this.topologyParser.lineMarkerList.forEach(t => {
+                //     let id = t.data.GraphElementId
+                //     t.maskFlag = !(res.indexOf(id) > -1)
+                // })
                 this.topologyParser.imageLegendList.forEach(t => {
                     let id = t.data.GraphElementId
-                    t.maskFlag = !(res.indexOf(id) > -1)
+                    t.selected = res.indexOf(id) > -1
                 })
                 this.topologyParser.relationList.forEach(t => {
                     let id = t.data.GraphElementId
-                    t.maskFlag = !(res.indexOf(id) > -1)
+                    t.selected = res.indexOf(id) > -1
                 })
             })
         }

+ 3 - 3
src/components/menuList.vue

@@ -5,7 +5,7 @@
             <div class='downright'></div>
             <div class='home-box'>
                 <img src='@/assets/imgs/logo.png' alt />
-                <span>大连高新万达广场</span>
+                <span>{{plazaName}}</span>
                 <!-- <span v-if='plazas'>{{plazas.length>0?formatter(plazaId,plazas):'--'}}</span> -->
             </div>
         </div>
@@ -72,7 +72,7 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['plazas', 'plazaId', 'fmapID'])
+        ...mapGetters(['plazas', 'plazaId', 'fmapID', 'plazaName'])
     },
     watch: {
         $route: 'handleRoute'
@@ -109,7 +109,7 @@ export default {
                 }
             try {
                 // 调用接口
-                // res = await queryDraftNum(data)
+                res = await queryDraftNum(data)
             } catch (error) {
                 console.error(error)
             }

+ 5 - 4
src/components/viewLengend.vue

@@ -14,12 +14,12 @@
                 :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 prop label='说明'>
-                    <template slot-scope='{row}'>
-                        <span>{{(row.Properties && row.Properties.ItemExplain)?row.Properties.ItemExplain:'--'}}</span>
+                    <template slot-scope='{row}' v-if='row.Properties && row.Properties.ItemExplain'>
+                        <span>{{row.Properties.ItemExplain}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column prop label='图例' width='60' align='center'>
-                    <template slot-scope='{row}'>
+                    <template slot-scope='{row}' v-if='row.Properties && row.Properties.ItemExplain'>
                         <div class='scpz-img' :style='`background:${row.Properties.FillColor};border:1px solid ${row.Properties.StrokeColor}`'></div>
                     </template>
                 </el-table-column>
@@ -42,7 +42,8 @@
                 <el-table-column prop='Num' label='数量'>
                     <template slot-scope='{row}'>
                         <span v-if='row.Num || row.Num==0'>{{row.Num}}</span>
-                        <span v-else>--</span>
+                        <span v-else-if='row.Num==null'></span>
+                        <span v-else>{{'--'}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column prop='Unit' label='单位' width='70'>

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

@@ -153,7 +153,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
     }
     toData() {
         this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.text
+        this.data.Name = this.name
         this.data.Properties.FillColor = this.fillColor.value
         this.data.Properties.StrokeColor = this.strokeColor.value
         this.data.Properties.LineWidth = this.lineWidth

+ 1 - 1
src/lib/items/SFHFQZoneLegendItem.ts

@@ -175,7 +175,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
 
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.text
+        this.data.Name = this.name
         this.data.Properties.FillColor = this.fillColor.value
         this.data.Properties.StrokeColor = this.strokeColor.value
         this.data.Properties.LineWidth = this.lineWidth

+ 11 - 0
src/lib/items/SImageLegendItem.js

@@ -54,6 +54,15 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.color) {
             this.color = new SColor(data.Properties.color);
         }
+        if (data.Properties && data.Properties.IsActive) {
+            this.isActive = data.Properties.IsActive;
+        }
+        if (data.AttachObjectIds && data.AttachObjectIds.length) {
+            this.isActive = true;
+        }
+        if (data.Properties && data.Properties.FrameColor) {
+            this.activeColor = new SColor(data.Properties.FrameColor);
+        }
     }
     get num() {
         return this._num;
@@ -82,6 +91,8 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;
         this.data.Properties.color = this.color.value;
+        this.data.Properties.FrameColor = this.activeColor.value;
+        this.data.Properties.IsActive = this.isActive;
         this.data.AnchorList = this.anchorList.map(t => {
             return {
                 ID: t.id,

+ 58 - 48
src/lib/items/SImageLegendItem.ts

@@ -1,9 +1,8 @@
-
-import { SGraphItem } from "@saga-web/graph/lib";
-import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
-import { Legend } from '../types/Legend';
-import { ItemOrder } from '@saga-web/big/lib';
-import { SFont, SColor } from '@saga-web/draw/lib';
+import { SGraphItem } from '@saga-web/graph/lib'
+import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem'
+import { Legend } from '../types/Legend'
+import { ItemOrder } from '@saga-web/big/lib'
+import { SFont, SColor } from '@saga-web/draw/lib'
 /**
  * 图例节点Item(图标类型)
  *
@@ -11,23 +10,23 @@ import { SFont, SColor } from '@saga-web/draw/lib';
  */
 export class SImageLegendItem extends SIconTextItem {
     /** 图例节点对象数据 */
-    data: Legend;
+    data: Legend
     /** 图例数量 */
-    _num: number = 1;
+    _num: number = 1
     get num(): number {
-        return this._num;
+        return this._num
     }
     set num(v: number) {
         if (v) {
-            this._num = v;
-            this.data.Num = v;
+            this._num = v
+            this.data.Num = v
         } else {
-            this._num = 1;
-            this.data.Num = 1;
+            this._num = 1
+            this.data.Num = 1
         }
-        this.data.Properties.Num = this._num;
-        this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`;
-        this.update();
+        this.data.Properties.Num = this._num
+        this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`
+        this.update()
     }
 
     /**
@@ -37,66 +36,77 @@ export class SImageLegendItem extends SIconTextItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent, data.AnchorList);
-        this.isTransform = false;
-        this.zOrder = ItemOrder.markOrder;
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
+        super(parent, data.AnchorList)
+        this.isTransform = false
+        this.zOrder = ItemOrder.markOrder
+        this.data = data
+        this.id = data.ID
+        this.name = data.Name
+        this.moveTo(data.Pos.X, data.Pos.Y)
         if (data.Num) {
-            this._num = data.Num;
+            this._num = data.Num
         }
         if (data.Size) {
-            this.width = data.Size.Width;
-            this.height = data.Size.Height;
+            this.width = data.Size.Width
+            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;
+            this.img.url = data.Properties.Url
         }
         if (data.Properties.ImgPos) {
-            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
+            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);
+            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
         }
         if (data.Properties && data.Properties.sWidth) {
-            this.sWidth = data.Properties.sWidth;
+            this.sWidth = data.Properties.sWidth
         }
         if (data.Properties && data.Properties.sHeight) {
-            this.sHeight = data.Properties.sHeight;
+            this.sHeight = data.Properties.sHeight
         }
         if (data.Properties && data.Properties.font) {
-            this.font = new SFont("sans-serif", data.Properties.font);
+            this.font = new SFont('sans-serif', data.Properties.font)
         }
         if (data.Properties && data.Properties.color) {
-            this.color = new SColor(data.Properties.color);
+            this.color = new SColor(data.Properties.color)
+        }
+        if (data.Properties && data.Properties.IsActive) {
+            this.isActive = data.Properties.IsActive
+        }
+        if (data.AttachObjectIds && data.AttachObjectIds.length) {
+            this.isActive = true
+        }
+        if (data.Properties && data.Properties.FrameColor) {
+            this.activeColor = new SColor(data.Properties.FrameColor)
         }
     }
 
     toData(): Legend {
-        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 => {
+        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.Properties.FrameColor = this.activeColor.value
+        this.data.Properties.IsActive = this.isActive
+        this.data.AnchorList = this.anchorList.map((t) => {
             return {
                 ID: t.id,
                 Pos: {
                     X: t.x,
-                    Y: t.y
-                }
+                    Y: t.y,
+                },
             }
         })
-        return this.data;
+        return this.data
     }
 } // Class SImageLegendItem

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

@@ -160,7 +160,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
     }
     toData() {
         this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.text
+        this.data.Name = this.name
         this.data.Properties.FillColor = this.fillColor.value
         this.data.Properties.StrokeColor = this.strokeColor.value
         this.data.Properties.LineWidth = this.lineWidth

+ 1 - 1
src/lib/items/SSCPZZoneLegendItem.ts

@@ -183,7 +183,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
 
     toData(): any {
         this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Name = this.text
+        this.data.Name = this.name
         this.data.Properties.FillColor = this.fillColor.value
         this.data.Properties.StrokeColor = this.strokeColor.value
         this.data.Properties.LineWidth = this.lineWidth

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

@@ -137,6 +137,7 @@ export class TipelineItem extends SPolylineItem {
             }
         })
         if (this.data) {
+            this.data.Name = this.name;
             this.data.PointList = pointList
             this.data.Properties.LineWidth = this.lineWidth
             // this.data.Properties.LineDash = this.LineDash;

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

@@ -146,6 +146,7 @@ export class TipelineItem extends SPolylineItem {
         })
 
         if (this.data) {
+            this.data.Name = this.name;
             this.data.PointList = pointList
             this.data.Properties.LineWidth = this.lineWidth
             // this.data.Properties.LineDash = this.LineDash;

+ 5 - 21
src/main.ts

@@ -1,4 +1,3 @@
- 
 import Vue from 'vue'
 import router from './router'
 import store from './store'
@@ -30,7 +29,6 @@ import Pui from 'meri-design'
 import 'meri-design/dist/index.css'
 import 'leaflet/dist/leaflet.css'
 
-import {login} from './api/login.js';
 Vue.use(Pui)
 
  
@@ -46,22 +44,8 @@ const username = 'lengqiang'
 //     }
 //     next()
 // })
-
-login({}).then( (res ) => {  // 获取用户当前权限
-    if (res.result === 'success') {
-        store.commit('STOREACCESSLEVEL', res)
-        new Vue({
-            router,
-            store,
-            render: (h) => h(App),
-            mounted() {
-                let level = store.state.accessLevel
-                if (level === 0) {
-                    router.push({path:'./home/homepage'})
-                } else {
-                    router.push({path:'./group'})
-                }
-            },
-        }).$mount('#app')
-    }
-})
+new Vue({
+    router,
+    store,
+    render: (h) => h(App),
+}).$mount('#app')

+ 22 - 20
src/router/index.js

@@ -5,14 +5,14 @@ import { query } from '@/utils/query'
 
 Vue.use(VueRouter)
 const routes = [
-    // 登陆页面
+    //登陆页面
+    // {
+    //     path: '/',
+    //     redirect: '/home/overview', // 只有区域,及区域以上用户才能进入总部首页这一套
+    // },
     {
-        path: '/',
-        redirect: '/home/overview',        // 只有区域,及区域以上用户才能进入总部首页这一套
-    },
-    {
-        path: "/404",
-        component: () => import("../components/404"),
+        path:'/group',
+        component: () => import('../views/statistics/index')
     },
     {
         path:'/group',
@@ -24,7 +24,8 @@ const routes = [
         name: 'home',
         component: () => import('../views/index'),
         redirect: '/home/homepage',
-        children: [{
+        children: [
+            {
                 path: 'homepage',
                 component: () => import('../views/homepage'),
             },
@@ -72,22 +73,24 @@ const router = new VueRouter({
     routes,
 })
 //不需要token的路由
-const ignore = ['/404', '/legendLibrary', '/legendRules']
+const ignore = ['/404', '/home/legendLibrary', '/home/legendRules']
 router.beforeEach(async (to, from, next) => {
     if (!ignore.includes(to.path)) {
-        console.log("vuex", store.state.accessLevel)
-        const token = query().token
-        const ssoToken = store.getters['ssoToken']
-        if (ssoToken) {
-            store.commit('SETSSOTOKEN', ssoToken)
-            await store.dispatch('getUserInfo', router)
+        const token = store.getters['ssoToken'] || query().token
+        if (token) {
+            store.commit('SETSSOTOKEN', token)
+            if (to.path == '/') {
+                next('/group')
+            }
+            if (to.path == '/group' || to.path == '/home/homepage') {
+                if (store.state.accessLevel == -1) {
+                    await store.dispatch('getUserInfo', router)
+                    await store.dispatch('getBrand')
+                }
+            }
             await store.dispatch('getFloors')
             await store.dispatch('getBrand')
             next()
-        } else if (token) {
-            store.commit('SETSSOTOKEN', token)
-            await store.dispatch('getUserInfo', router)
-            next()
         } else {
             let lastRoute = {
                 path: to.path,
@@ -100,7 +103,6 @@ router.beforeEach(async (to, from, next) => {
                 signal = new Date().getTime(),
                 version = '1.0.0'
             window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
-            
         }
     } else {
         next()

+ 37 - 17
src/store/index.js

@@ -8,8 +8,9 @@ import router from '../router'
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
-        ssoToken: 'admin:lengqiang',
+        ssoToken: 'admin:xuliping',
         // ssoToken: null,
+        plazaName: '',
         isPreview: false,
         lastRoute: '',
         isrequestAuth: true, // 是否请求登录校验接口
@@ -32,9 +33,12 @@ export default new Vuex.Store({
         remarksText: '', //备注
         bunkObj: {}, // 铺位名称
         currentFloor: {}, //当前选中的楼层信息
-        accessLevel:0, // 
+        accessLevel: -1, // 权限级别
+        showView: 1,
     },
     getters: {
+        plazaName: (state) => state.plazaName,
+        accessLevel: (state) => state.accessLevel,
         isPreview: (state) => state.isPreview,
         ssoToken: (state) => state.ssoToken,
         lastRoute: (state) => state.lastRoute,
@@ -51,6 +55,12 @@ export default new Vuex.Store({
         bunkObj: (state) => state.bunkObj,
     },
     mutations: {
+        SETPLAZENAME(state, data) {
+            state.plazaName = data
+        },
+        SETSHOWVIEW(state, data) {
+            state.showView = data
+        },
         SETISPREVIEW(state, data) {
             state.isPreview = data
         },
@@ -109,28 +119,38 @@ export default new Vuex.Store({
         SETCURRENTFLOOR(state, data) {
             state.currentFloor = data
         },
-        STOREACCESSLEVEL(state, data) {
-            state.accessLevel = data.level
-        }
+        STOREACCESSLEVEL(state, data) {
+            state.accessLevel = data
+        },
     },
     actions: {
         // 获取项目列表、userId
         async getUserInfo({ commit }, palyload) {
             await login({}).then((res) => {
-                if (res.result == 'success') {
-                    commit('STOREACCESSLEVEL', res)
+                // 获取用户当前权限
+                console.log(res)
+                if (res.result === 'success') {
+                    commit('STOREACCESSLEVEL', res.level)
+                    console.log("res.level", res.level)
+                    let level = res.level
+                    if (level === 0) {
+                        router.push({ path: './home/homepage' })
+                    } else {
+                        router.push({ path: './group' })
+                    }
+                    // commit('SETISREQUESTtAUTH', false)
                 }
-                    // token校验成功 拿到权限
-                    //commit("SETISREQUESTtAUTH", true)
-                //     if (res.permissions.length == 0) {
-                //         router.push('/404')
-                //     }
-                //     commit('SETAUTHMSG', res)
-                // } else {
-                //     commit('SETISREQUESTtAUTH', false)
-                //     router.push('/404')
-                // }
             })
+            // token校验成功 拿到权限
+            //commit("SETISREQUESTtAUTH", true)
+            //     if (res.permissions.length == 0) {
+            //         router.push('/404')
+            //     }
+            //     commit('SETAUTHMSG', res)
+            // } else {
+            //     commit('SETISREQUESTtAUTH', false)
+            //     router.push('/404')
+            // }
         },
         getFloors(context) {
             queryFloor({

+ 60 - 153
src/utils/ganttChart/GanttChart.js

@@ -1,5 +1,9 @@
 import moment from 'moment';
 /**
+ * 数据定义区域
+ *
+ */
+/**
  * 甘特图
  * @param {} options 
  */
@@ -24,7 +28,7 @@ export function GanttChart(options) {
   // 拖动过程事件
   this.dragingEvent = null;
   // 拖动偏移量
-  this.offsetDis = (options['viewWidth']/2) || 800;
+  this.offsetDis = options['viewWidth'] || 800;
   // 拖动定时器
   this.dragTimer = null;
   // 每天的间隔宽度
@@ -38,21 +42,20 @@ export function GanttChart(options) {
   // 总天数
   this.daysCount = options['daysCount'] || 60;
   // 任务图距离顶部高度
-  this.graphTopDis = 40
+  this.graphTopDis = 20
   
   // 每像素代表的小时数
   this.timePerPix = this.cWidth/this.daysCount/24/3600
   // 当前视图开始时间,向前推N天
   this.startAt = moment().subtract(this.daysCount / 3, 'days');
   this.endAt = moment(this.startAt).add(this.daysCount, 'days');
-  this.graphDiv = document.getElementById(options['chartParentContainer']);
-  this.chartContainer = options['chartContainer']
+  this.graphDiv = document.getElementById(options['chartContainer']);
   // 图形容器组
   this.graphGroup = null;
   // 上一次拖动的事件
   this.lastDragEv = null;
-  // 当日刻度线
-  this.todayTimeLineEl = null;
+  // 回调事件
+  this.callback = options.callback || null;
 }
 
 
@@ -110,7 +113,6 @@ GanttChart.prototype.forceRefreshGraph = function() {
   this.tasks.forEach((topTask) => {
     topTask.gGroup = null;
   });
-  this.todayTimeLineEl = null
   this.gCanvas.destroy();
   this.initDrawingReady();
 }
@@ -120,21 +122,17 @@ GanttChart.prototype.forceRefreshGraph = function() {
  */
 GanttChart.prototype.initDrawingReady = function() {
   this.initCanvas();
-  setTimeout(() => {
-    this.initDragHandler();
-    this.drawTimeZone();
-    this.processData();
-    this.drawTasks();
-    this.graphGroup = null
-  }, 200);
+  this.initDragHandler();
+  this.drawTimeZone();
+  this.processData();
+  this.drawTasks();
+  this.graphGroup = null
 }
 
 /**
  * 翻页
  */
 GanttChart.prototype.pageTo = function(dir = 'next') {
-  this.draging = false;
-  this.endEvent = null;
   if (dir == 'next') {
     // 向后翻页`
     this.startAt = this.startAt.add(this.daysCount, 'days');
@@ -156,7 +154,7 @@ let lastClickAt = null;
  * 改变graphDiv 滚动距离
  * 到达边界距离后,刷新页面
  */
-GanttChart.prototype.doDrag = function(sEvent, eEvent) {  
+GanttChart.prototype.doDrag = function(sEvent, eEvent) {
   if (sEvent == null) {
     sEvent = this.startEvent;
   }
@@ -175,7 +173,7 @@ GanttChart.prototype.doDrag = function(sEvent, eEvent) {
     this.offsetDis = this.viewWidth;
     this.pageTo('prev');
   }
-  if ((this.offsetDis - 20) >= this.viewWidth*2.2 ){ //cWidth - viewWidth) {
+  if (this.offsetDis - 20 >= 2964 ){ //cWidth - viewWidth) {
     // 向后滑动,向后翻页
     console.log('此处应该向后翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
     this.offsetDis = this.viewWidth;
@@ -187,9 +185,10 @@ GanttChart.prototype.doDrag = function(sEvent, eEvent) {
 /**
  * 初始化抓取拖动事件
  */
+
 GanttChart.prototype.initDragHandler = function() {
   this.graphDiv.scrollLeft = this.offsetDis;
-  let _canvas = this._canvas
+  let _canvas = document.getElementsByTagName('canvas')[1];
   _canvas.addEventListener('mousedown', (ev) => {
     this.draging = true;
     this.startEvent = ev;
@@ -200,13 +199,6 @@ GanttChart.prototype.initDragHandler = function() {
     this.lastDragEv = ev;
   });
 
-
-  _canvas.addEventListener('mouseleave', (ev) => {
-    console.log('leave...恢复')
-    this.draging = false;
-    this.endEvent = ev;
-  });
-
   _canvas.addEventListener('mouseup', (ev) => {
     this.draging = false;
     this.endEvent = ev;
@@ -223,6 +215,11 @@ GanttChart.prototype.initDragHandler = function() {
       this.lastDragEv = ev;
     }
   });
+  _canvas.addEventListener('mouseleave', (ev) => {
+    console.log('leave...恢复')
+    this.draging = false;
+    this.endEvent = ev;
+  });
 }
 /**
  * 初始化画布
@@ -230,13 +227,11 @@ GanttChart.prototype.initDragHandler = function() {
  */
 
 GanttChart.prototype.initCanvas = function() {
-  console.error('初始化画布...')
   this.gCanvas = new G.Canvas({
-    container: this.chartContainer,
+    container: 'ganttContainer',
     width: this.cWidth,
-    height: this.cHeight,
+    height: 800,
   });
-  this._canvas = document.getElementsByTagName('canvas')[0];
 }
 
 /**
@@ -247,59 +242,45 @@ GanttChart.prototype.drawTimeZone = function() {
   console.log('时间段', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'));
   let start = moment(this.startAt);
   let timeGroup = this.gCanvas.addGroup();
-  this.timeGroupEl = timeGroup
   timeGroup._tname = 'TimeGroup';
-  let startSecond = moment(this.startAt);
-
-  // 顶部底部边框
-  timeGroup.addShape('rect',{
+  // 绘制第一级
+  timeGroup.addShape('text', {
     attrs: {
-      x: 0,
-      y: 0,
-      width: this.cWidth,
-      height: 40,
-      fill: '#dbcccc',
-      radius: [2, 4],
+      x: 20,
+      y: 20,
+      fontSize: 12,
+      text: start.format('YYYY-MM'),
+      lineDash: [10, 10],
+      fill: '#8D9399',
     },
-  })
+  });
+  timeGroup.addShape('text', {
+    attrs: {
+      x: 20 + this.viewWidth,
+      y: 20,
+      fontSize: 12,
+      text: start.add(this.daysCount / 3, 'days').format('YYYY-MM'),
+      lineDash: [10, 10],
+      fill: '#8D9399',
+    },
+  });
+  timeGroup.addShape('text', {
+    attrs: {
+      x: 20 + this.viewWidth * 2,
+      y: 20,
+      fontSize: 12,
+      text: start.add(this.daysCount / 3, 'days').format('YYYY-MM'),
+      lineDash: [10, 10],
+      fill: '#8D9399',
+    },
+  });
+  let startSecond = moment(this.startAt);
   // 绘制第二级
-  let nowAtStr = moment().format('YYYY-MM-DD')
   for (let i = 0; i < this.daysCount; i++) {
-    let tempAt = startSecond.add(1, 'days')
-    let timeText = tempAt.format('DD');
-    if(timeText == '01'){
-      // 第一天,顶部需要绘制年月
-      timeGroup.addShape('text', {
-        attrs: {
-          x: this.dayStep * i,
-          y: 20,
-          fontSize: 12,
-          text: tempAt.format('YYYY-MM'),
-          lineDash: [10, 10],
-          fill: '#8D9399',
-        },
-      });
-      
-    }
-    let isToday = nowAtStr == tempAt.format('YYYY-MM-DD')
-    if(isToday){
-      //是今日,需要画线
-      console.log('绘制 当日刻度线')
-      this.todayTimeLineOffsetPos = this.dayStep * i
-      timeGroup.addShape('rect',{
-        attrs: {
-          x: this.dayStep * i-10,
-          y: 25,
-          width: 30,
-          height: 16,
-          fill: '#0091FF',
-          radius: [2, 4],
-        },
-      })
-    }
+    let timeText = startSecond.add(1, 'days').format('DD');
     timeGroup.addShape('text', {
       attrs: {
-        x: this.dayStep * i,
+        x: 40 * i,
         y: 40,
         fontSize: 10,
         text: timeText,
@@ -307,17 +288,6 @@ GanttChart.prototype.drawTimeZone = function() {
         fill: '#8D9399',
       },
     });
-
-    timeGroup.addShape('rect', {
-      attrs: {
-        x: this.dayStep * i-10,
-        y: 20,
-        width: 1,
-        height: this.cHeight,
-        fill: '#deebeb',
-        radius: [2, 4],
-      },
-    });
   }
 }
 
@@ -394,55 +364,10 @@ GanttChart.prototype.drawTasks = function() {
       taskGroup = this.graphGroup.addGroup();
       taskGroup._tname = 'TaskGroup_' + topTask.id;
       topTask.gGroup = taskGroup;
-
-      // 组名背景矩形
-      // let TopGroupRectEl = taskGroup.addShape('rect', {
-      //   attrs: {
-      //     x: 0,
-      //     y: topTask.renderOptions.startY,
-      //     width: this.cWidth,
-      //     height: this.taskRowHeight,
-      //     fill: '#a6ed53',
-      //     radius: [2, 4],
-      //   },
-      // });
-      // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...
-      topTask.dataList.forEach((taskP, index) => {
-        let taskPGroup = taskGroup.addGroup()
+      // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...    
+      topTask.dataList.forEach((taskP, index) => {                            
+        let taskPGroup = taskGroup.addGroup();
         taskGroup.addGroup(taskPGroup);
-        // 任务背景矩形,主要用于Hover效果变更颜色
-        if(true){
-          let tempTaskContainerEl = taskPGroup.addShape('rect', {
-            attrs: {
-              x: 0,
-              y: topTask.renderOptions.startY + ((index+1)* (this.taskRowHeight + this.rowSpanDis))-5,
-              width: this.cWidth,
-              height: this.taskRowHeight+10,
-              fill: '#fff',
-              // stroke: 'black',
-              radius: [2, 4],
-            },
-          });
-          tempTaskContainerEl.setZIndex(1)
-          tempTaskContainerEl._pdata = taskP
-          tempTaskContainerEl.on('mouseenter',(ev)=>{
-            tempTaskContainerEl.attr({fill: '#F5F6F7'})
-            tempTaskContainerEl._pdata.tasks.forEach(_tempTask=>{
-              if(_tempTask._rectEl){
-                _tempTask._rectEl.setZIndex(5)
-              }
-            })
-          })
-          tempTaskContainerEl.on('mouseleave',(ev)=>{
-            tempTaskContainerEl.attr({fill: '#fff'})
-            tempTaskContainerEl._pdata.tasks.forEach(_tempTask=>{
-              if(_tempTask._rectEl){
-                _tempTask._rectEl.setZIndex(5)
-              }
-            })
-          })
-          taskP._containerEl = tempTaskContainerEl
-        }
         // 第三层循环,用户区分每个子任务的执行时间段,例如:维保-商管1-2020.05-2020.06 / 2020.08- 2020.09
         taskP.tasks.forEach((_taskItem, _index) => {
           let _isInView = this.isInView(_taskItem)
@@ -461,9 +386,7 @@ GanttChart.prototype.drawTasks = function() {
                 radius: [2, 4],
               },
             });
-            rectEl.setZIndex(5)
             rectEl._pdata = _taskItem;
-            _taskItem._rectEl = rectEl
             rectEl.on('mouseover', (ev) => {
               this.handleClick(ev.target, 'enter', ev);
             });
@@ -485,22 +408,6 @@ GanttChart.prototype.drawTasks = function() {
       }
     }
   });
-
-  // 画当前线条 TODO,放前面不行
-  let todayAt = new Date()
-  if(this.startAt < todayAt && this.endAt > todayAt){
-    this.todayTimeLineEl = this.gCanvas.addShape('rect',{
-      attrs: {
-        x: this.todayTimeLineOffsetPos,
-        y: 40,
-        width: 3,
-        height: this.cHeight,
-        fill: '#0091FF',
-        radius: [2, 4],
-      }
-    })
-    this.todayTimeLineEl.setZIndex(50)
-  }
 }
 
 /**

+ 568 - 0
src/utils/ganttChart/GanttChart_day.js

@@ -0,0 +1,568 @@
+import moment from 'moment';
+/**
+ * 甘特图
+ * @param {} options 
+ */
+export function GanttChartDay(options) {
+  // 任务列表
+  this.tasks = options.tasks || [];
+  // AntVG Canvas
+  this.gCanvas = null;
+  // 视口宽度 800,可视区域
+  this.viewWidth = options['viewWidth'] || 800;
+  // 物理画布宽度 800
+  this.cWidth = options['cWidth'] || 2400;
+  this.cHeight = options['cHeight'] || 1600;
+  // 画布偏移位置
+  this.startPos = 0;
+  // 是否拖动中
+  this.draging = false;
+  // 开始拖动事件
+  this.startEvent = null;
+  // 结束拖动事件
+  this.endEvent = null;
+  // 拖动过程事件
+  this.dragingEvent = null;
+  // 拖动偏移量
+  this.offsetDis = (options['viewWidth']/2) || 800;
+  // 拖动定时器
+  this.dragTimer = null;
+  // 每天的间隔宽度
+  this.dayStep = 40;
+  // 分组标题高度
+  this.groupTitleHeight = 18;
+  // 任务矩形高度
+  this.taskRowHeight = 16;
+  // 每行任务的纵向间距
+  this.rowSpanDis = 22;
+  // 总天数
+  this.daysCount = options['daysCount'] || 60;
+  // 任务图距离顶部高度
+  this.graphTopDis = 60
+  
+  // 每像素代表的小时数
+  this.timePerPix = this.cWidth/this.daysCount/24/3600
+  // 当前视图开始时间,向前推N天
+  this.startAt = moment().subtract(this.daysCount / 3, 'days');
+  this.endAt = moment(this.startAt).add(this.daysCount, 'days');
+  this.graphDiv = document.getElementById(options['chartParentContainer']);
+  this.chartContainer = options['chartContainer']
+  // 图形容器组
+  this.graphGroup = null;
+  // 上一次拖动的事件
+  this.lastDragEv = null;
+  // 当日刻度线
+  this.todayTimeLineEl = null;
+  // 点击回调事件
+  this.callback = options.callback || null;
+  // 翻页时间回调
+  this.pageToCallback = options.pageToCallback || null;
+}
+
+
+/**
+ * 设置数据
+ * @param {*} _tasks 
+ */
+GanttChartDay.prototype.changeTasks = function(_tasks){
+  this.tasks = _tasks
+}
+
+/**
+ * 打开关闭分组
+ */
+
+GanttChartDay.prototype.toggle = function(index) {
+  if (this.tasks[index].open) {
+    this.tasks[index].open = false;
+  } else {
+    this.tasks[index].open = true;
+  }
+  this.processData();
+  this.drawTasks();
+}
+
+/**
+ * 预处理数据
+ */
+GanttChartDay.prototype.processData = function() {
+  for (let i = 0; i < this.tasks.length; i++) {
+    let currentTopTask = this.tasks[i];
+    let lastTopTask = null;
+    currentTopTask.renderOptions = {};
+    // 设置StartY
+    if (i != 0) {
+      // 非0个,要补上前面的数据
+      lastTopTask = this.tasks[i - 1];
+      currentTopTask.renderOptions.startY = lastTopTask.renderOptions.endY + 20;
+    } else {
+      // 第一个
+      currentTopTask.renderOptions.startY = this.graphTopDis;
+    }
+    // 设置EndY
+    // 当有数据 且 打开时,
+    //     EndY = StartY + 标题上间距 + 标题 高度 + 任务个数 * (任务高度)
+    if (currentTopTask.dataList.length >0 && currentTopTask.open) {
+      currentTopTask.renderOptions.endY =
+        currentTopTask.renderOptions.startY  + this.groupTitleHeight + currentTopTask.dataList.length * 38;
+    } else {
+      currentTopTask.renderOptions.endY = currentTopTask.renderOptions.startY + this.groupTitleHeight;
+    }
+  }
+}
+
+/**
+ * 强制清空图像,重绘
+ */
+GanttChartDay.prototype.forceRefreshGraph = function() {
+  this.tasks.forEach((topTask) => {
+    topTask.gGroup = null;
+  });
+  this.todayTimeLineEl = null
+  this.gCanvas.destroy();
+  this.initDrawingReady();
+}
+
+/**
+ * 准备绘制,用于初始化和强制刷新
+ */
+GanttChartDay.prototype.initDrawingReady = function() {
+  this.initCanvas();
+  setTimeout(() => {
+    this.initDragHandler();
+    this.drawTimeZone();
+    this.processData();
+    this.drawTasks();
+    this.graphGroup = null
+  }, 200);
+}
+
+/**
+ * 翻页
+ */
+GanttChartDay.prototype.pageTo = function(dir = 'next') {
+  this.draging = false;
+  this.endEvent = null;
+  if (dir == 'next') {
+    // 向后翻页`
+    this.startAt = this.startAt.add(this.daysCount, 'days');
+    this.offsetDis = 0
+  } else {
+    // 向前翻页
+    this.startAt = this.startAt.subtract(this.daysCount, 'days');
+    this.offsetDis = 2*this.viewWidth
+  }
+  this.endAt = moment(this.startAt).add(this.daysCount, 'days');
+  this.pageToCallback({dir: dir, startAt: this.startAt.format('YYYY-MM-DD'), endAt: this.endAt.format('YYYY-MM-DD')})
+  console.log('已翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'), this.offsetDis);
+  // offsetDis = viewWidth;
+  this.forceRefreshGraph();
+}
+// 上次点击时间,用于滚动时误触停止
+let lastClickAt = null;
+/**
+ * 执行拖动
+ * 改变graphDiv 滚动距离
+ * 到达边界距离后,刷新页面
+ */
+GanttChartDay.prototype.doDrag = function(sEvent, eEvent) {  
+  if (sEvent == null) {
+    sEvent = this.startEvent;
+  }
+  let sPos = sEvent.clientX;
+  let cPos = eEvent.clientX;
+  // 滚动距离
+  let dis = cPos - sPos;
+  let tempDis = this.offsetDis
+  // console.log('offsetDis before:', this.offsetDis, dis)
+  this.offsetDis = this.offsetDis - dis / 2;
+  // console.log('draging...',tempDis, this.offsetDis, dis)
+  if (this.offsetDis <= -20) {
+    // 向前滑动,向前翻页
+    console.log('此处应该向前翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
+    this.offsetDis = this.viewWidth;
+    this.pageTo('prev');
+  }
+  if ((this.offsetDis - 20) >= this.viewWidth*2.2 ){ //cWidth - viewWidth) {
+    // 向后滑动,向后翻页
+    console.log('此处应该向后翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
+    this.offsetDis = this.viewWidth;
+    this.pageTo('next');
+  }
+  this.graphDiv.scrollLeft = this.offsetDis;
+}
+
+/**
+ * 初始化抓取拖动事件
+ */
+GanttChartDay.prototype.initDragHandler = function() {
+  this.graphDiv.scrollLeft = this.offsetDis;
+  let _canvas = this._canvas
+  _canvas.addEventListener('mousedown', (ev) => {
+    this.draging = true;
+    this.startEvent = ev;
+    this.dragingEvent = null;
+    this.endEvent = null;
+    this.lastClickAt = new Date();
+    this.lastClickAt = ev;
+    this.lastDragEv = ev;
+  });
+
+
+  _canvas.addEventListener('mouseleave', (ev) => {
+    console.log('leave...恢复')
+    this.draging = false;
+    this.endEvent = ev;
+  });
+
+  _canvas.addEventListener('mouseup', (ev) => {
+    this.draging = false;
+    this.endEvent = ev;
+  });
+
+  _canvas.addEventListener('mousemove', (ev) => {
+    // console.log('this over', this)
+    if (this.draging) {
+      if (new Date() - this.lastClickAt < 20) {
+        return false;
+      }
+      this.dragingEvent = ev;
+      this.doDrag(this.lastDragEv, ev);
+      this.lastDragEv = ev;
+    }
+  });
+}
+/**
+ * 初始化画布
+ *
+ */
+
+GanttChartDay.prototype.initCanvas = function() {
+  console.error('初始化画布...')
+  this.gCanvas = new G.Canvas({
+    container: this.chartContainer,
+    width: this.cWidth,
+    height: this.cHeight,
+  });
+  this._canvas = document.querySelector('#ganttContainer>canvas');
+}
+
+/**
+ * 绘制时间区域
+ */
+
+GanttChartDay.prototype.drawTimeZone = function() {
+  console.log('时间段', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'));
+  let start = moment(this.startAt);
+  let timeGroup = this.gCanvas.addGroup();
+  this.timeGroupEl = timeGroup
+  timeGroup._tname = 'TimeGroup';
+  let startSecond = moment(this.startAt);
+
+  // 顶部底部边框
+  timeGroup.addShape('rect',{
+    attrs: {
+      x: 0,
+      y: 0,
+      width: this.cWidth,
+      height: 52,
+      fill: '#F8F9FA',
+      radius: [2, 4],
+    },
+  })
+  // 绘制第二级
+  let nowAtStr = moment().format('YYYY-MM-DD')
+  this.timeZoneLineEls = []
+  for (let i = 0; i < this.daysCount; i++) {
+    let tempAt = startSecond.add(1, 'days')
+    let timeText = tempAt.format('DD');
+    if(timeText == '01'){
+      // 第一天,顶部需要绘制年月
+      timeGroup.addShape('text', {
+        attrs: {
+          x: this.dayStep * i,
+          y: 20,
+          fontSize: 12,
+          text: tempAt.format('YYYY-MM'),
+          lineDash: [10, 10],
+          fill: '#8D9399',
+        },
+      });
+      
+    }
+    let isToday = nowAtStr == tempAt.format('YYYY-MM-DD')
+    if(isToday){
+      //是今日,需要画线
+      console.log('绘制 当日刻度线')
+      this.todayTimeLineOffsetPos = this.dayStep * i
+      timeGroup.addShape('rect',{
+        attrs: {
+          x: this.dayStep * i-10,
+          y: 25,
+          width: 30,
+          height: 16,
+          fill: '#0091FF',
+          radius: [2, 4],
+        },
+      })
+
+      this.todayTimeLineEl = this.gCanvas.addShape('rect',{
+        attrs: {
+          x: this.todayTimeLineOffsetPos,
+          y: 40,
+          width: 4,
+          height: this.cHeight,
+          fill: '#CDE9FF',
+          radius: [2, 4],
+        }
+      })
+      // this.todayTimeLineEl.setZIndex(3)      
+    }
+    timeGroup.addShape('text', {
+      attrs: {
+        x: this.dayStep * i,
+        y: 40,
+        fontSize: 10,
+        text: timeText,
+        lineDash: [10, 10],
+        fill: '#8D9399',
+      },
+    });
+  }
+}
+
+/**
+ * 处理点击
+ */
+GanttChartDay.prototype.handleClick = function(task, flag, ev) {
+  // let detailDiv = document.getElementById('detailDiv')
+  if(flag == 'enter'){
+    // detailDiv.style.display = 'block'
+    // detailDiv.style.left = ev.clientX+'px';
+    // detailDiv.style.top = ev.clientY+'px';
+    // document.getElementById('detailTaskName').textContent = task._pdata.description
+    // document.getElementById('detailTaskStatus').textContent = task._pdata.status
+    // document.getElementById('detailTaskStartDate').textContent = task._pdata.startDate
+    // document.getElementById('detailTaskEndDate').textContent = task._pdata.endDate
+    console.log('show:', task);
+  } else if (flag === 'leave'){
+    // detailDiv.style.display = 'none'
+    console.log('hide:', task);
+  } else {
+    this.callback(task);
+    console.log('click:', task);
+  }
+}
+
+
+/**
+ * 根据任务状态区分颜色
+ * 
+ */
+GanttChartDay.prototype.statusColor =function(task) {
+  switch (task.status) {
+    case '按时完成':
+      return 'aqua';
+      break;
+    case '计划批准':
+      return '#ff9800';
+      break;
+    case '已完成':
+      return '#19b720';
+      break;
+    default:
+      break;
+  }
+}
+
+/**
+ * 判断任务是否在视图内
+ * 
+ */ 
+GanttChartDay.prototype.isInView = function(task) {
+  let isLessThanEndAt = (task.endDate <= this.startAt.format('YYYY-MM-DD'))
+  let isGreaterThanStartAt = task.startDate >= this.endAt.format('YYYY-MM-DD')
+  return !(isLessThanEndAt || isGreaterThanStartAt)
+}
+
+/**
+ * 绘制完成之后的回调,用于某些工具缺陷的hack写法
+ */
+GanttChartDay.prototype.postDrawTasksCallBack = function(){
+  // 画当前线条 TODO,放前面不行
+  if(true){
+    let todayAt = new Date()
+    if(this.startAt < todayAt && this.endAt > todayAt){
+      this.todayTimeLineEl = this.gCanvas.addShape('rect',{
+        attrs: {
+          x: this.todayTimeLineOffsetPos,
+          y: 40,
+          width: 4,
+          height: this.cHeight,
+          fill: '#CDE9FF',
+          radius: [2, 4],
+        }
+      })
+      this.todayTimeLineEl.setZIndex(3)
+    }
+  }
+
+  if(true){
+    for (let i = 0; i < this.daysCount; i++) {
+      let lineEl = this.timeGroupEl.addShape('rect', {
+        attrs: {
+          x: this.dayStep * i-10,
+          y: 20,
+          width: 1,
+          height: this.cHeight,
+          fill: '#deebeb',
+          radius: [2, 4],
+        },
+      });
+      lineEl.setZIndex(200)    
+    }
+  }
+}
+
+/**
+ * 分组绘制任务块
+ *
+ */
+
+GanttChartDay.prototype.drawTasks = function() {  
+  this.graphGroup = this.gCanvas.addGroup();
+  this.graphGroup._tname = 'graphGroup';
+  
+  // 第一层循环,用于分组,例如,维保--xxxx
+  this.tasks.forEach((topTask, topIndex) => {
+    try {      
+      if (topTask.open) {
+        let taskGroup = null;
+        taskGroup = this.graphGroup.addGroup();
+        taskGroup._tname = 'TaskGroup_' + topTask.id;
+        topTask.gGroup = taskGroup;
+  
+        // 组名背景矩形
+        let TopGroupRectEl = taskGroup.addShape('rect', {
+          attrs: {
+            x: 0,
+            y: topTask.renderOptions.startY,
+            width: this.cWidth,
+            height: this.taskRowHeight,
+            fill: '#F5F6F7',
+            radius: [2, 4],
+          },
+        });
+        TopGroupRectEl.setZIndex(-1)
+        // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...
+        topTask.dataList.forEach((taskP, index) => {
+          let taskPGroup = taskGroup.addGroup()
+          taskGroup.addGroup(taskPGroup);
+          // 任务背景矩形,主要用于Hover效果变更颜色
+          if(true){
+            let tempTaskContainerEl = taskPGroup.addShape('rect', {
+              attrs: {
+                x: 0,
+                y: topTask.renderOptions.startY + ((index+2)* (this.taskRowHeight + this.rowSpanDis))-5,
+                width: this.cWidth,
+                height: this.taskRowHeight+10,
+                fill: '#fff',
+                // stroke: 'black',
+                radius: [2, 4],
+              },
+            });
+            tempTaskContainerEl.setZIndex(1)
+            tempTaskContainerEl._pdata = taskP
+            tempTaskContainerEl.on('mouseenter',(ev)=>{
+              tempTaskContainerEl.attr({fill: '#F5F6F7'})
+              tempTaskContainerEl._pdata.tasks.forEach(_tempTask=>{
+                if(_tempTask._rectEl){
+                  _tempTask._rectEl.setZIndex(5)
+                }
+              })
+            })
+            tempTaskContainerEl.on('mouseleave',(ev)=>{
+              tempTaskContainerEl.attr({fill: '#fff'})
+              tempTaskContainerEl._pdata.tasks.forEach(_tempTask=>{
+                if(_tempTask._rectEl){
+                  _tempTask._rectEl.setZIndex(5)
+                }
+              })
+            })
+            taskP._containerEl = tempTaskContainerEl
+          }
+          // 第三层循环,用户区分每个子任务的执行时间段,例如:维保-商管1-2020.05-2020.06 / 2020.08- 2020.09
+          taskP.tasks.forEach((_taskItem, _index) => {
+            let _isInView = this.isInView(_taskItem)
+            // 在视图中才显示
+            if(_isInView){
+              let pos = this.calRectPos(_taskItem);
+              // console.log('render rect:', _taskItem, pos, topTask.renderOptions.startY + index * taskRowHeight);
+              let rectEl = taskPGroup.addShape('rect', {
+                attrs: {
+                  x: pos.x,
+                  y: topTask.renderOptions.startY + ((index + 1)* (this.taskRowHeight + this.rowSpanDis)),
+                  width: pos.width,
+                  height: this.taskRowHeight,
+                  fill: this.statusColor(_taskItem),
+                  stroke: 'black',
+                  radius: [2, 4],
+                },
+              });
+              rectEl.setZIndex(50)
+              rectEl._pdata = _taskItem;
+              _taskItem._rectEl = rectEl
+              rectEl.on('mouseover', (ev) => {
+                this.handleClick(ev.target, 'enter', ev);
+              });
+              rectEl.on('mouseleave', (ev) => {
+                this.handleClick(ev.target, 'leave', ev);
+              });
+              rectEl.on('click', (ev) => {
+                this.handleClick(ev.target, 'click', ev);
+              });
+            }
+          });
+        });
+  
+        taskGroup.show();
+      } else {
+        if (topTask.gGroup) {
+          // topTask.gGroup.hide()
+          topTask.gGroup = null;
+        }
+      }
+    } catch (error) {
+      console.error('drawTasks error:', error)
+    }
+  });
+
+  this.postDrawTasksCallBack()
+}
+
+/**
+ * 根据 Task 计算矩形位置
+ *
+ */
+GanttChartDay.prototype.calRectPos = function(taskItem) {
+  let duraStartAt = new Date(taskItem.startDate) - new Date(this.startAt.format('YYYY-MM-DD'));
+  let secondsStartAt = duraStartAt/1000
+
+  let duraEndAt = new Date(taskItem.endDate) - new Date(taskItem.startDate);        
+  let secondsEndAt = duraEndAt/1000
+  return {
+    x: secondsStartAt * this.timePerPix,
+    y: 0,
+    width: secondsEndAt * this.timePerPix,
+    height: 0,
+  };
+}
+
+/**
+ * 主函数
+ *
+ */
+
+GanttChartDay.prototype.main = function() {  
+  this.initDrawingReady();
+}

+ 574 - 0
src/utils/ganttChart/GanttChart_month.js

@@ -0,0 +1,574 @@
+import moment from 'moment';
+/**
+ * 甘特图
+ * @param {} options 
+ */
+export function GanttChartMonth(options) {
+  // 任务列表
+  this.tasks = options.tasks || [];
+  // AntVG Canvas
+  this.gCanvas = null;
+  // 视口宽度 800,可视区域
+  this.viewWidth = options['viewWidth'] || 800;
+  // 物理画布宽度 800
+  this.cWidth = options['cWidth'] || 2400;
+  this.cHeight = options['cHeight'] || 1600;
+  // 画布偏移位置
+  this.startPos = 0;
+  // 是否拖动中
+  this.draging = false;
+  // 开始拖动事件
+  this.startEvent = null;
+  // 结束拖动事件
+  this.endEvent = null;
+  // 拖动过程事件
+  this.dragingEvent = null;
+  // 拖动偏移量
+  this.offsetDis = (options['viewWidth']/2) || 800;
+  // 拖动定时器
+  this.dragTimer = null;
+  // 每天的间隔宽度
+  this.dayStep = parseInt(this.cWidth/365);
+  // 分组标题高度
+  this.groupTitleHeight = 18;
+  // 任务矩形高度
+  this.taskRowHeight = 16;
+  // 每行任务的纵向间距
+  this.rowSpanDis = 22;
+  // 总天数
+  this.daysCount = options['daysCount'] || 365;
+  // 任务图距离顶部高度
+  this.graphTopDis = 60
+  
+  // 每像素代表的小时数
+  this.timePerPix = this.cWidth/this.daysCount/24/3600
+  // 当前视图开始时间,向前推N天
+  this.startAt = moment().startOf('year')
+  this.endAt = moment().endOf('year')
+  this.graphDiv = document.getElementById(options['chartParentContainer']);
+  this.chartContainer = options['chartContainer']
+  // 图形容器组
+  this.graphGroup = null;
+  // 上一次拖动的事件
+  this.lastDragEv = null;
+  // 当日刻度线
+  this.todayTimeLineEl = null;
+  // 点击回调事件
+  this.callback = options.callback || null;
+  // 翻页时间回调
+  this.pageToCallback = options.pageToCallback || null;
+}
+
+
+/**
+ * 设置数据
+ * @param {*} _tasks 
+ */
+GanttChartMonth.prototype.changeTasks = function(_tasks){
+  this.tasks = _tasks
+}
+
+/**
+ * 打开关闭分组
+ */
+
+GanttChartMonth.prototype.toggle = function(index) {
+  if (this.tasks[index].open) {
+    this.tasks[index].open = false;
+  } else {
+    this.tasks[index].open = true;
+  }
+  this.processData();
+  this.drawTasks();
+}
+
+/**
+ * 预处理数据
+ */
+GanttChartMonth.prototype.processData = function() {
+  for (let i = 0; i < this.tasks.length; i++) {
+    let currentTopTask = this.tasks[i];
+    let lastTopTask = null;
+    currentTopTask.renderOptions = {};
+    // 设置StartY
+    if (i != 0) {
+      // 非0个,要补上前面的数据
+      lastTopTask = this.tasks[i - 1];
+      currentTopTask.renderOptions.startY = lastTopTask.renderOptions.endY + 20;
+    } else {
+      // 第一个
+      currentTopTask.renderOptions.startY = this.graphTopDis;
+    }
+    // 设置EndY
+    // 当有数据 且 打开时,
+    //     EndY = StartY + 标题上间距 + 标题 高度 + 任务个数 * (任务高度)
+    if (currentTopTask.dataList.length >0 && currentTopTask.open) {
+      currentTopTask.renderOptions.endY =
+        currentTopTask.renderOptions.startY  + this.groupTitleHeight + currentTopTask.dataList.length * 38;
+    } else {
+      currentTopTask.renderOptions.endY = currentTopTask.renderOptions.startY + this.groupTitleHeight;
+    }
+  }
+}
+
+/**
+ * 强制清空图像,重绘
+ */
+GanttChartMonth.prototype.forceRefreshGraph = function() {
+  this.tasks.forEach((topTask) => {
+    topTask.gGroup = null;
+  });
+  this.todayTimeLineEl = null
+  this.gCanvas.destroy();
+  this.initDrawingReady();
+}
+
+/**
+ * 准备绘制,用于初始化和强制刷新
+ */
+GanttChartMonth.prototype.initDrawingReady = function() {
+  this.initCanvas();
+  setTimeout(() => {
+    this.initDragHandler();
+    this.drawTimeZone();
+    this.processData();
+    this.drawTasks();
+    this.graphGroup = null
+  }, 200);
+}
+
+/**
+ * 翻页
+ */
+GanttChartMonth.prototype.pageTo = function(dir = 'next') {
+  this.draging = false;
+  this.endEvent = null;
+  if (dir == 'next') {
+    // 向后翻页`
+    this.startAt = this.startAt.add(this.daysCount, 'days');
+    this.offsetDis = 0
+  } else {
+    // 向前翻页
+    this.startAt = this.startAt.subtract(this.daysCount, 'days');
+    this.offsetDis = 2*this.viewWidth
+  }
+  this.endAt = moment(this.startAt).add(this.daysCount, 'days');
+  this.pageToCallback({dir: dir, startAt: this.startAt.format('YYYY-MM-DD'), endAt: this.endAt.format('YYYY-MM-DD')})
+  console.log('已翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'), this.offsetDis);
+  // offsetDis = viewWidth;
+  this.forceRefreshGraph();
+}
+// 上次点击时间,用于滚动时误触停止
+let lastClickAt = null;
+/**
+ * 执行拖动
+ * 改变graphDiv 滚动距离
+ * 到达边界距离后,刷新页面
+ */
+GanttChartMonth.prototype.doDrag = function(sEvent, eEvent) {  
+  if (sEvent == null) {
+    sEvent = this.startEvent;
+  }
+  let sPos = sEvent.clientX;
+  let cPos = eEvent.clientX;
+  // 滚动距离
+  let dis = cPos - sPos;
+  let tempDis = this.offsetDis
+  // console.log('offsetDis before:', this.offsetDis, dis)
+  this.offsetDis = this.offsetDis - dis / 2;
+  // console.log('draging...',tempDis, this.offsetDis, dis)
+  if (this.offsetDis <= -20) {
+    // 向前滑动,向前翻页
+    console.log('此处应该向前翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
+    this.offsetDis = this.viewWidth;
+    this.pageTo('prev');
+  }
+  if ((this.offsetDis - 20) >= this.viewWidth*2.2 ){ //cWidth - viewWidth) {
+    // 向后滑动,向后翻页
+    console.log('此处应该向后翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
+    this.offsetDis = this.viewWidth;
+    this.pageTo('next');
+  }
+  this.graphDiv.scrollLeft = this.offsetDis;
+}
+
+/**
+ * 初始化抓取拖动事件
+ */
+GanttChartMonth.prototype.initDragHandler = function() {
+  this.graphDiv.scrollLeft = this.offsetDis;
+  let _canvas = this._canvas
+  _canvas.addEventListener('mousedown', (ev) => {
+    this.draging = true;
+    this.startEvent = ev;
+    this.dragingEvent = null;
+    this.endEvent = null;
+    this.lastClickAt = new Date();
+    this.lastClickAt = ev;
+    this.lastDragEv = ev;
+  });
+
+
+  _canvas.addEventListener('mouseleave', (ev) => {
+    console.log('leave...恢复')
+    this.draging = false;
+    this.endEvent = ev;
+  });
+
+  _canvas.addEventListener('mouseup', (ev) => {
+    this.draging = false;
+    this.endEvent = ev;
+  });
+
+  _canvas.addEventListener('mousemove', (ev) => {
+    // console.log('this over', this)
+    if (this.draging) {
+      if (new Date() - this.lastClickAt < 20) {
+        return false;
+      }
+      this.dragingEvent = ev;
+      this.doDrag(this.lastDragEv, ev);
+      this.lastDragEv = ev;
+    }
+  });
+}
+/**
+ * 初始化画布
+ *
+ */
+
+GanttChartMonth.prototype.initCanvas = function() {
+  console.error('初始化画布...')
+  this.gCanvas = new G.Canvas({
+    container: this.chartContainer,
+    width: this.cWidth,
+    height: this.cHeight,
+  });
+  this._canvas = document.querySelector('#ganttContainer>canvas');
+}
+
+/**
+ * 绘制时间区域
+ */
+
+GanttChartMonth.prototype.drawTimeZone = function() {
+  console.log('时间段', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'));
+  let start = moment(this.startAt);
+  let timeGroup = this.gCanvas.addGroup();
+  this.timeGroupEl = timeGroup
+  timeGroup._tname = 'TimeGroup';
+  let startSecond = moment(this.startAt);
+
+  // 顶部底部边框
+  timeGroup.addShape('rect',{
+    attrs: {
+      x: 0,
+      y: 0,
+      width: this.cWidth,
+      height: 52,
+      fill: '#F8F9FA',
+      radius: [2, 4],
+    },
+  })
+  // 绘制第二级
+  let nowAtStr = moment().format('YYYY-MM-DD')
+  let year = this.startAt.format('YYYY')
+  this.timeZoneLineEls = []
+  for (let i = 1; i < 13; i++) {
+    let tempAt = moment(`${year}-${i}`)
+    let timeText = tempAt.format('MM');
+    if(timeText == '01'){
+      // 第一天,顶部需要绘制年月
+      timeGroup.addShape('text', {
+        attrs: {
+          x: this.dayStep * i,
+          y: 20,
+          fontSize: 12,
+          text: tempAt.format('YYYY'),
+          lineDash: [10, 10],
+          fill: '#8D9399',
+        },
+      });
+      
+    }
+    let isToday = nowAtStr == tempAt.format('YYYY-MM-DD')
+    if(isToday){
+      //是今日,需要画线
+      console.log('绘制 当日刻度线')
+      this.todayTimeLineOffsetPos = this.dayStep * i
+      timeGroup.addShape('rect',{
+        attrs: {
+          x: this.dayStep * i-10,
+          y: 25,
+          width: 30,
+          height: 16,
+          fill: '#0091FF',
+          radius: [2, 4],
+        },
+      })
+
+      this.todayTimeLineEl = this.gCanvas.addShape('rect',{
+        attrs: {
+          x: this.todayTimeLineOffsetPos,
+          y: 40,
+          width: 4,
+          height: this.cHeight,
+          fill: '#CDE9FF',
+          radius: [2, 4],
+        }
+      })
+      // this.todayTimeLineEl.setZIndex(3)
+    }
+
+    // 当月天数
+    let daysCount = moment(`${year}-${i}`).dayOfYear()
+    timeGroup.addShape('text', {
+      attrs: {
+        x: this.dayStep * daysCount,
+        y: 40,
+        fontSize: 10,
+        text: timeText,
+        lineDash: [10, 10],
+        fill: '#8D9399',
+      },
+    });
+  }
+}
+
+/**
+ * 处理点击
+ */
+GanttChartMonth.prototype.handleClick = function(task, flag, ev) {
+  // let detailDiv = document.getElementById('detailDiv')
+  if(flag == 'enter'){
+    // detailDiv.style.display = 'block'
+    // detailDiv.style.left = ev.clientX+'px';
+    // detailDiv.style.top = ev.clientY+'px';
+    // document.getElementById('detailTaskName').textContent = task._pdata.description
+    // document.getElementById('detailTaskStatus').textContent = task._pdata.status
+    // document.getElementById('detailTaskStartDate').textContent = task._pdata.startDate
+    // document.getElementById('detailTaskEndDate').textContent = task._pdata.endDate
+    console.log('show:', task);
+  } else if (flag === 'leave'){
+    // detailDiv.style.display = 'none'
+    console.log('hide:', task);
+  } else {
+    this.callback(task);
+    console.log('click:', task);
+  }
+}
+
+
+/**
+ * 根据任务状态区分颜色
+ * 
+ */
+GanttChartMonth.prototype.statusColor =function(task) {
+  switch (task.status) {
+    case '按时完成':
+      return 'aqua';
+      break;
+    case '计划批准':
+      return '#ff9800';
+      break;
+    case '已完成':
+      return '#19b720';
+      break;
+    default:
+      break;
+  }
+}
+
+/**
+ * 判断任务是否在视图内
+ * 
+ */ 
+GanttChartMonth.prototype.isInView = function(task) {
+  let isLessThanEndAt = (task.endDate <= this.startAt.format('YYYY-MM-DD'))
+  let isGreaterThanStartAt = task.startDate >= this.endAt.format('YYYY-MM-DD')
+  return !(isLessThanEndAt || isGreaterThanStartAt)
+}
+
+/**
+ * 绘制完成之后的回调,用于某些工具缺陷的hack写法
+ */
+GanttChartMonth.prototype.postDrawTasksCallBack = function(){
+  // 画当前线条 TODO,放前面不行
+  if(true){
+    let todayAt = new Date()
+    if(this.startAt < todayAt && this.endAt > todayAt){
+      this.todayTimeLineEl = this.gCanvas.addShape('rect',{
+        attrs: {
+          x: this.todayTimeLineOffsetPos,
+          y: 40,
+          width: 4,
+          height: this.cHeight,
+          fill: '#CDE9FF',
+          radius: [2, 4],
+        }
+      })
+      this.todayTimeLineEl.setZIndex(3)
+    }
+  }
+
+  if(true){
+    let year = this.startAt.format('YYYY')
+    for (let i = 1; i < 13; i++) {
+      // 当月天数
+    let daysCount = moment(`${year}-${i}`).dayOfYear()
+      let lineEl = this.timeGroupEl.addShape('rect', {
+        attrs: {
+          x: this.dayStep * daysCount,
+          y: 20,
+          width: 1,
+          height: this.cHeight,
+          fill: '#deebeb',
+          radius: [2, 4],
+        },
+      });
+      lineEl.setZIndex(200)
+    }
+  }
+}
+
+/**
+ * 分组绘制任务块
+ *
+ */
+
+GanttChartMonth.prototype.drawTasks = function() {  
+  this.graphGroup = this.gCanvas.addGroup();
+  this.graphGroup._tname = 'graphGroup';  
+  // 第一层循环,用于分组,例如,维保--xxxx
+  this.tasks.forEach((topTask, topIndex) => {
+    try {      
+      if (topTask.open) {
+        let taskGroup = null;
+        taskGroup = this.graphGroup.addGroup();
+        taskGroup._tname = 'TaskGroup_' + topTask.id;
+        topTask.gGroup = taskGroup;
+  
+        // 组名背景矩形
+        let TopGroupRectEl = taskGroup.addShape('rect', {
+          attrs: {
+            x: 0,
+            y: topTask.renderOptions.startY,
+            width: this.cWidth,
+            height: this.taskRowHeight,
+            fill: '#F5F6F7',
+            radius: [2, 4],
+          },
+        });
+        TopGroupRectEl.setZIndex(-1)
+        // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...
+        topTask.dataList.forEach((taskP, index) => {
+          let taskPGroup = taskGroup.addGroup()
+          taskGroup.addGroup(taskPGroup);
+          // 任务背景矩形,主要用于Hover效果变更颜色
+          if(true){
+            let tempTaskContainerEl = taskPGroup.addShape('rect', {
+              attrs: {
+                x: 0,
+                y: topTask.renderOptions.startY + ((index+2)* (this.taskRowHeight + this.rowSpanDis))-5,
+                width: this.cWidth,
+                height: this.taskRowHeight+10,
+                fill: '#fff',
+                // stroke: 'black',
+                radius: [2, 4],
+              },
+            });
+            tempTaskContainerEl.setZIndex(1)
+            tempTaskContainerEl._pdata = taskP
+            tempTaskContainerEl.on('mouseenter',(ev)=>{
+              tempTaskContainerEl.attr({fill: '#F5F6F7'})
+              tempTaskContainerEl._pdata.tasks.forEach(_tempTask=>{
+                if(_tempTask._rectEl){
+                  _tempTask._rectEl.setZIndex(5)
+                }
+              })
+            })
+            tempTaskContainerEl.on('mouseleave',(ev)=>{
+              tempTaskContainerEl.attr({fill: '#fff'})
+              tempTaskContainerEl._pdata.tasks.forEach(_tempTask=>{
+                if(_tempTask._rectEl){
+                  _tempTask._rectEl.setZIndex(5)
+                }
+              })
+            })
+            taskP._containerEl = tempTaskContainerEl
+          }
+          // 第三层循环,用户区分每个子任务的执行时间段,例如:维保-商管1-2020.05-2020.06 / 2020.08- 2020.09
+          taskP.tasks.forEach((_taskItem, _index) => {
+            let _isInView = this.isInView(_taskItem)
+            // 在视图中才显示
+            if(_isInView){
+              let pos = this.calRectPos(_taskItem);
+              // console.log('render rect:', _taskItem, pos, topTask.renderOptions.startY + index * taskRowHeight);
+              let rectEl = taskPGroup.addShape('rect', {
+                attrs: {
+                  x: pos.x,
+                  y: topTask.renderOptions.startY + ((index + 1)* (this.taskRowHeight + this.rowSpanDis)),
+                  width: pos.width,
+                  height: this.taskRowHeight,
+                  fill: this.statusColor(_taskItem),
+                  stroke: 'black',
+                  radius: [2, 4],
+                },
+              });
+              rectEl.setZIndex(50)
+              rectEl._pdata = _taskItem;
+              _taskItem._rectEl = rectEl
+              rectEl.on('mouseover', (ev) => {
+                this.handleClick(ev.target, 'enter', ev);
+              });
+              rectEl.on('mouseleave', (ev) => {
+                this.handleClick(ev.target, 'leave', ev);
+              });
+              rectEl.on('click', (ev) => {
+                this.handleClick(ev.target, 'click', ev);
+              });
+            }
+          });
+        });
+  
+        taskGroup.show();
+      } else {
+        if (topTask.gGroup) {
+          // topTask.gGroup.hide()
+          topTask.gGroup = null;
+        }
+      }
+    } catch (error) {      
+      console.error('drawTasks error:', error)
+    }
+  });
+
+  this.postDrawTasksCallBack()
+}
+
+/**
+ * 根据 Task 计算矩形位置
+ *
+ */
+GanttChartMonth.prototype.calRectPos = function(taskItem) {
+  let duraStartAt = new Date(taskItem.startDate) - new Date(this.startAt.format('YYYY-MM-DD'));
+  let secondsStartAt = duraStartAt/1000
+
+  let duraEndAt = new Date(taskItem.endDate) - new Date(taskItem.startDate);
+  let secondsEndAt = duraEndAt/1000
+  return {
+    x: secondsStartAt * this.timePerPix,
+    y: 0,
+    width: secondsEndAt * this.timePerPix,
+    height: 0,
+  };
+}
+
+/**
+ * 主函数
+ *
+ */
+
+GanttChartMonth.prototype.main = function() {  
+  this.initDrawingReady();
+}

+ 0 - 438
src/utils/ganttChart/GanttChart_old.js

@@ -1,438 +0,0 @@
-import moment from 'moment';
-/**
- * 数据定义区域
- *
- */
-/**
- * 甘特图
- * @param {} options 
- */
-export function GanttChart(options) {
-  // 任务列表
-  this.tasks = options.tasks || [];
-  // AntVG Canvas
-  this.gCanvas = null;
-  // 视口宽度 800,可视区域
-  this.viewWidth = options['viewWidth'] || 800;
-  // 物理画布宽度 800
-  this.cWidth = options['cWidth'] || 2400;
-  this.cHeight = options['cHeight'] || 600;
-  // 画布偏移位置
-  this.startPos = 0;
-  // 是否拖动中
-  this.draging = false;
-  // 开始拖动事件
-  this.startEvent = null;
-  // 结束拖动事件
-  this.endEvent = null;
-  // 拖动过程事件
-  this.dragingEvent = null;
-  // 拖动偏移量
-  this.offsetDis = options['viewWidth'] || 800;
-  // 拖动定时器
-  this.dragTimer = null;
-  // 每天的间隔宽度
-  this.dayStep = 40;
-  // 分组标题高度
-  this.groupTitleHeight = 38;
-  // 任务矩形高度
-  this.taskRowHeight = 16;
-  // 每行任务的纵向间距
-  this.rowSpanDis = 22;
-  // 总天数
-  this.daysCount = options['daysCount'] || 60;
-  // 任务图距离顶部高度
-  this.graphTopDis = 20
-  
-  // 每像素代表的小时数
-  this.timePerPix = this.cWidth/this.daysCount/24/3600
-  // 当前视图开始时间,向前推N天
-  this.startAt = moment().subtract(this.daysCount / 3, 'days');
-  this.endAt = moment(this.startAt).add(this.daysCount, 'days');
-  this.graphDiv = document.getElementById(options['chartContainer']);
-  // 图形容器组
-  this.graphGroup = null;
-  // 上一次拖动的事件
-  this.lastDragEv = null;
-  // 回调事件
-  this.callback = options.callback || null;
-}
-
-
-/**
- * 设置数据
- * @param {*} _tasks 
- */
-GanttChart.prototype.changeTasks = function(_tasks){
-  this.tasks = _tasks
-}
-
-/**
- * 打开关闭分组
- */
-
-GanttChart.prototype.toggle = function(index) {
-  if (this.tasks[index].open) {
-    this.tasks[index].open = false;
-  } else {
-    this.tasks[index].open = true;
-  }
-  this.processData();
-  this.drawTasks();
-}
-
-/**
- * 预处理数据
- */
-GanttChart.prototype.processData = function() {
-  for (let i = 0; i < this.tasks.length; i++) {
-    let currentTopTask = this.tasks[i];
-    let lastTopTask = null;
-    currentTopTask.renderOptions = {};
-    if (i != 0) {
-      // 非0个,要补上前面的数据
-      lastTopTask = this.tasks[i - 1];
-      currentTopTask.renderOptions.startY = lastTopTask.renderOptions.endY + 20;
-    } else {
-      // 第一个
-      currentTopTask.renderOptions.startY = this.graphTopDis;
-    }
-    if (currentTopTask.open) {
-      currentTopTask.renderOptions.endY =
-        currentTopTask.renderOptions.startY + this.rowSpanDis + this.groupTitleHeight + currentTopTask.dataList.length * this.taskRowHeight;
-    } else {
-      currentTopTask.renderOptions.endY = currentTopTask.renderOptions.startY + this.groupTitleHeight;
-    }
-  }
-}
-
-/**
- * 强制清空图像,重绘
- */
-GanttChart.prototype.forceRefreshGraph = function() {
-  this.tasks.forEach((topTask) => {
-    topTask.gGroup = null;
-  });
-  this.gCanvas.destroy();
-  this.initDrawingReady();
-}
-
-/**
- * 准备绘制,用于初始化和强制刷新
- */
-GanttChart.prototype.initDrawingReady = function() {
-  this.initCanvas();
-  this.initDragHandler();
-  this.drawTimeZone();
-  this.processData();
-  this.drawTasks();
-  this.graphGroup = null
-}
-
-/**
- * 翻页
- */
-GanttChart.prototype.pageTo = function(dir = 'next') {
-  if (dir == 'next') {
-    // 向后翻页`
-    this.startAt = this.startAt.add(this.daysCount, 'days');
-    this.offsetDis = 0
-  } else {
-    // 向前翻页
-    this.startAt = this.startAt.subtract(this.daysCount, 'days');
-    this.offsetDis = 2*this.viewWidth
-  }
-  this.endAt = moment(this.startAt).add(this.daysCount, 'days');
-  console.log('已翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'), this.offsetDis);
-  // offsetDis = viewWidth;
-  this.forceRefreshGraph();
-}
-// 上次点击时间,用于滚动时误触停止
-let lastClickAt = null;
-/**
- * 执行拖动
- * 改变graphDiv 滚动距离
- * 到达边界距离后,刷新页面
- */
-GanttChart.prototype.doDrag = function(sEvent, eEvent) {
-  if (sEvent == null) {
-    sEvent = this.startEvent;
-  }
-  
-  let sPos = sEvent.clientX;
-  let cPos = eEvent.clientX;
-  // 滚动距离
-  let dis = cPos - sPos;
-  let tempDis = this.offsetDis
-  // console.log('offsetDis before:', this.offsetDis, dis)
-  this.offsetDis = this.offsetDis - dis / 2;
-  // console.log('draging...',tempDis, this.offsetDis, dis)
-  if (this.offsetDis <= -20) {
-    // 向前滑动,向前翻页
-    console.log('此处应该向前翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
-    this.offsetDis = this.viewWidth;
-    this.pageTo('prev');
-  }
-  if (this.offsetDis - 20 >= 2964 ){ //cWidth - viewWidth) {
-    // 向后滑动,向后翻页
-    console.log('此处应该向后翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
-    this.offsetDis = this.viewWidth;
-    this.pageTo('next');
-  }
-  this.graphDiv.scrollLeft = this.offsetDis;
-}
-
-/**
- * 初始化抓取拖动事件
- */
-
-GanttChart.prototype.initDragHandler = function() {
-  this.graphDiv.scrollLeft = this.offsetDis;
-  let _canvas = document.querySelector('#ganttContainer>canvas');
-  _canvas.addEventListener('mousedown', (ev) => {
-    this.draging = true;
-    this.startEvent = ev;
-    this.dragingEvent = null;
-    this.endEvent = null;
-    this.lastClickAt = new Date();
-    this.lastClickAt = ev;
-    this.lastDragEv = ev;
-  });
-
-  _canvas.addEventListener('mouseup', (ev) => {
-    this.draging = false;
-    this.endEvent = ev;
-  });
-
-  _canvas.addEventListener('mousemove', (ev) => {
-    // console.log('this over', this)
-    if (this.draging) {
-      if (new Date() - this.lastClickAt < 20) {
-        return false;
-      }
-      this.dragingEvent = ev;
-      this.doDrag(this.lastDragEv, ev);
-      this.lastDragEv = ev;
-    }
-  });
-  _canvas.addEventListener('mouseleave', (ev) => {
-    console.log('leave...恢复')
-    this.draging = false;
-    this.endEvent = ev;
-  });
-}
-/**
- * 初始化画布
- *
- */
-
-GanttChart.prototype.initCanvas = function() {
-  this.gCanvas = new G.Canvas({
-    container: 'ganttContainer',
-    width: this.cWidth,
-    height: 800,
-  });
-}
-
-/**
- * 绘制时间区域
- */
-
-GanttChart.prototype.drawTimeZone = function() {
-  console.log('时间段', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'));
-  let start = moment(this.startAt);
-  let timeGroup = this.gCanvas.addGroup();
-  timeGroup._tname = 'TimeGroup';
-  // 绘制第一级
-  timeGroup.addShape('text', {
-    attrs: {
-      x: 20,
-      y: 20,
-      fontSize: 12,
-      text: start.format('YYYY-MM'),
-      lineDash: [10, 10],
-      fill: '#8D9399',
-    },
-  });
-  timeGroup.addShape('text', {
-    attrs: {
-      x: 20 + this.viewWidth,
-      y: 20,
-      fontSize: 12,
-      text: start.add(this.daysCount / 3, 'days').format('YYYY-MM'),
-      lineDash: [10, 10],
-      fill: '#8D9399',
-    },
-  });
-  timeGroup.addShape('text', {
-    attrs: {
-      x: 20 + this.viewWidth * 2,
-      y: 20,
-      fontSize: 12,
-      text: start.add(this.daysCount / 3, 'days').format('YYYY-MM'),
-      lineDash: [10, 10],
-      fill: '#8D9399',
-    },
-  });
-  let startSecond = moment(this.startAt);
-  // 绘制第二级
-  for (let i = 0; i < this.daysCount; i++) {
-    let timeText = startSecond.add(1, 'days').format('DD');
-    timeGroup.addShape('text', {
-      attrs: {
-        x: 40 * i,
-        y: 40,
-        fontSize: 10,
-        text: timeText,
-        lineDash: [10, 10],
-        fill: '#8D9399',
-      },
-    });
-  }
-}
-
-/**
- * 处理点击
- */
-GanttChart.prototype.handleClick = function(task, flag, ev) {
-  // let detailDiv = document.getElementById('detailDiv')
-  if(flag == 'enter'){
-    // detailDiv.style.display = 'block'
-    // detailDiv.style.left = ev.clientX+'px';
-    // detailDiv.style.top = ev.clientY+'px';
-    // document.getElementById('detailTaskName').textContent = task._pdata.description
-    // document.getElementById('detailTaskStatus').textContent = task._pdata.status
-    // document.getElementById('detailTaskStartDate').textContent = task._pdata.startDate
-    // document.getElementById('detailTaskEndDate').textContent = task._pdata.endDate
-    console.log('show:', task);
-  } else if (flag === 'leave'){
-    // detailDiv.style.display = 'none'
-    console.log('hide:', task);
-  } else {
-    this.callback(task);
-    console.log('click:', task);
-  }
-}
-
-
-/**
- * 根据任务状态区分颜色
- * 
- */
-GanttChart.prototype.statusColor =function(task) {
-  switch (task.status) {
-    case '按时完成':
-      return 'aqua';
-      break;
-    case '计划批准':
-      return '#ff9800';
-      break;
-    case '已完成':
-      return '#19b720';
-      break;
-    default:
-      break;
-  }
-}
-
-/**
- * 判断任务是否在视图内
- * 
- */ 
-GanttChart.prototype.isInView = function(task) {
-  let isLessThanEndAt = (task.endDate <= this.startAt.format('YYYY-MM-DD'))
-  let isGreaterThanStartAt = task.startDate >= this.endAt.format('YYYY-MM-DD')
-  return !(isLessThanEndAt || isGreaterThanStartAt)
-}
-
-/**
- * 分组绘制任务块
- *
- */
-
-GanttChart.prototype.drawTasks = function() {
-  if (this.graphGroup) {
-    this.graphGroup.clear();
-  } else {
-    this.graphGroup = this.gCanvas.addGroup();
-    this.graphGroup._tname = 'graphGroup';
-  }
-  // 第一层循环,用于分组,例如,维保--xxxx
-  this.tasks.forEach((topTask, topIndex) => {
-    if (topTask.open) {
-      let taskGroup = null;
-      taskGroup = this.graphGroup.addGroup();
-      taskGroup._tname = 'TaskGroup_' + topTask.id;
-      topTask.gGroup = taskGroup;
-      // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...    
-      topTask.dataList.forEach((taskP, index) => {                            
-        let taskPGroup = taskGroup.addGroup();
-        taskGroup.addGroup(taskPGroup);
-        // 第三层循环,用户区分每个子任务的执行时间段,例如:维保-商管1-2020.05-2020.06 / 2020.08- 2020.09
-        taskP.tasks.forEach((_taskItem, _index) => {
-          let _isInView = this.isInView(_taskItem)
-          // 在视图中才显示
-          if(_isInView){
-            let pos = this.calRectPos(_taskItem);
-            // console.log('render rect:', _taskItem, pos, topTask.renderOptions.startY + index * taskRowHeight);
-            let rectEl = taskPGroup.addShape('rect', {
-              attrs: {
-                x: pos.x,
-                y: topTask.renderOptions.startY + (index* (this.taskRowHeight + this.rowSpanDis)),
-                width: pos.width,
-                height: this.taskRowHeight,
-                fill: this.statusColor(_taskItem),
-                stroke: 'black',
-                radius: [2, 4],
-              },
-            });
-            rectEl._pdata = _taskItem;
-            rectEl.on('mouseover', (ev) => {
-              this.handleClick(ev.target, 'enter', ev);
-            });
-            rectEl.on('mouseleave', (ev) => {
-              this.handleClick(ev.target, 'leave', ev);
-            });
-            rectEl.on('click', (ev) => {
-              this.handleClick(ev.target, 'click', ev);
-            });
-          }
-        });
-      });
-
-      taskGroup.show();
-    } else {
-      if (topTask.gGroup) {
-        // topTask.gGroup.hide()
-        topTask.gGroup = null;
-      }
-    }
-  });
-}
-
-/**
- * 根据 Task 计算矩形位置
- *
- */
-GanttChart.prototype.calRectPos = function(taskItem) {
-  let duraStartAt = new Date(taskItem.startDate) - new Date(this.startAt.format('YYYY-MM-DD'));
-  let secondsStartAt = duraStartAt/1000
-
-  let duraEndAt = new Date(taskItem.endDate) - new Date(taskItem.startDate);        
-  let secondsEndAt = duraEndAt/1000
-  return {
-    x: secondsStartAt * this.timePerPix,
-    y: 0,
-    width: secondsEndAt * this.timePerPix,
-    height: 0,
-  };
-}
-
-/**
- * 主函数
- *
- */
-
-GanttChart.prototype.main = function() {  
-  this.initDrawingReady();
-}

+ 66 - 47
src/views/analysis/CoreDeviceReport.vue

@@ -28,12 +28,12 @@
     </div>
     <div class="main-right">
       <div class="search-container">
-        <Input iconType="search" v-model="searchKey" placeholder="搜索" width="192" @pressEnter="getTableData" @clear="getTableData"/>
+        <Input iconType="search" v-model="searchKey" placeholder="搜索" width="192"/>
       </div>
       <el-table :data="tableData" style="width: 100%;margin-bottom: 63px;" @row-click="showEquipmentStatus">
         <el-table-column label="序号" type="index" :index="indexMethod"></el-table-column>
         <el-table-column prop="sbjc" label="设备简称"></el-table-column>
-        <el-table-column prop="sbjbm" label="设备编号"></el-table-column>
+        <el-table-column prop="assetnum" label="设备编号"></el-table-column>
         <el-table-column prop="is_exception" label="状态">
           <template slot-scope="scope">
             <span style="display: inline-block;width: 6px;height:6px;border-radius: 3px;background: #0091FF;" :style="{'background': !scope.row.is_exception?'#0091FF' : '#F54E45'}"></span>
@@ -99,17 +99,28 @@
           </el-pagination>
         </div>
       </el-dialog>
-      <el-dialog :title="detailTitle" :visible.sync="showDetail" width="1260px">
-        <div class="detail-container">
-          <div class="pictures-menu">
-            <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item">
-              <img :src="item.url" alt="">
+      <div class="img-detail-container">
+        <el-dialog :title="detailTitle" :visible.sync="showDetail" width="1260px">
+          <div class="detail-container">
+            <div class="pictures-menu">
+              <!-- <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item"> -->
+              <div class="item">
+                <!-- <img :src="item.url" alt=""> -->
+                <img src="../../assets/images/login_back.png" alt="">
+                <div class="name">图层名称1.jpg</div>
+              </div>
+              <div class="item">
+                <img src="../../assets/images/login_back.png" alt="">
+                <div class="name">图层名称1.jpg</div>
+              </div>
+            </div>
+            <div class="cur-img-container">
+              <img src="../../assets/images/login_back.png" alt="">
             </div>
           </div>
-        </div>
-      </el-dialog>
+        </el-dialog>
+      </div>
     </div>
-  </div>
 </template>
 
 <script>
@@ -123,11 +134,11 @@ export default {
       systemId: '', // 当前系统Id
       systemList: [], // 系统
       systemContentData: [
-        // {id: 1, name: '高压配电柜', isMaintenance: true, num: 95, statusNum: 0, abnormal: false, isActive: true},
-        // {id: 2, name: '变压器', isMaintenance: false, num: 256, statusNum: 12, abnormal: true, isActive: false},
-        // {id: 3, name: '低压配电柜', isMaintenance: false, num: 354, statusNum: 0, abnormal: false, isActive: false},
-        // {id: 4, name: '直流屏', isMaintenance: false, num: 175, statusNum: 0, abnormal: false, isActive: false},
-        // {id: 5, name: '柴油发电机组', isMaintenance: false, num: 186, status: 0, abnormal: false, isActive: false},
+        {id: 1, name: '高压配电柜', isMaintenance: true, num: 95, statusNum: 0, abnormal: false, isActive: true},
+        {id: 2, name: '变压器', isMaintenance: false, num: 256, statusNum: 12, abnormal: true, isActive: false},
+        {id: 3, name: '低压配电柜', isMaintenance: false, num: 354, statusNum: 0, abnormal: false, isActive: false},
+        {id: 4, name: '直流屏', isMaintenance: false, num: 175, statusNum: 0, abnormal: false, isActive: false},
+        {id: 5, name: '柴油发电机组', isMaintenance: false, num: 186, status: 0, abnormal: false, isActive: false},
       ], // 系统下的各种组成
       searchKey: '', // 搜索关键字
       tableData: [
@@ -165,8 +176,8 @@ export default {
 
   mounted() {
     this.getSystemList();
-    // this.getEquipmentOfSystem();
-    
+    this.getEquipmentOfSystem();
+    this.getTableData();
   },
 
   methods: {
@@ -200,7 +211,6 @@ export default {
      */
     changeCurSystem(val) {
       console.log('val', val)
-      this.getEquipmentOfSystem();
     },
     /**
      * 获取系统下的设备
@@ -209,39 +219,19 @@ export default {
       let param = {
         plazaId: 1000423,
         ccode: 1002347,
-        smsxt: this.systemId
+      }
+      if (this.systemId !== '') {
+        param.smsxt = this.systemId;
       }
       queryEquipmentList('/data/home/querySystemCard', param).then((res) => {
-        const { result, data } = res;
-        if (result === 'success') {
-          let newData = [];
-          _.forEach(data[0].assetTypeList, (item, index) => {
-            newData.push({
-              id: item.id,
-              name: item.category_name,
-              isMaintenance: item.is_detecting,
-              statusNum: item.is_exception_num,
-              num: item.asset_num,
-              abnormal: item.is_exception_num !== 0,
-              isActive: index === 0,
-              category_code: item.category_code
-            })
-          })
-          this.systemContentData = newData;
-          const { query } = this.$route;
-          if (!_.isEmpty(query) && query.equipId) {
-            _.map(this.systemContentData, (o) => {return o.isActive = o.id == query.equipId});
-          }
-          this.getTableData();
-        }
+        console.log('res', res)
       })
     },
     /**
      * 切换系统下的设备
      */
     changeEquipment(id) {
-      _.map(this.systemContentData, (o) => {return o.isActive = o.id === id});
-      this.getTableData();
+      _.map(this.systemContentData, (o) => {return o.isActive = o.id === id})
     },
     /**
      * 获取表数据
@@ -254,7 +244,7 @@ export default {
       if (_.trim(this.searchKey) !== '') {
         url = `${url}&keyword=${this.searchKey}:sbjc,sbjbm`
       }
-      queryTableData(url, query).then((res) => {
+      queryTableData(`/data/glsms_asset/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}`, query).then((res) => {
         const { result, count, data } = res;
         if (result === 'success') {
           this.tatol = count;
@@ -371,7 +361,7 @@ export default {
     getDetailData(val) {
       let param = {
         file_type: 0, // val.file_type
-        file_type_id: 1144, // val.file_type_id
+        file_type_id: 2914, // val.file_type_id
         type: this.detailTitle === '图片预览'? 0 : 1
       }
 
@@ -386,7 +376,7 @@ export default {
               url: item.urlname
             })
           })
-          this.pictureList = newData;
+          // this.pictureList = newData;
         }
       })
     }
@@ -500,15 +490,44 @@ export default {
     }
     .detail-container{
       display: flex;
-      min-height: 600px
+      height: 600px
     }
     .pictures-menu{
       margin-right: 21px;
+      padding-top: 16px;
+      padding-bottom: 16px;
       width: 180px;
+      height: 100%;
+      overflow: auto;
       .item{
         >img{
           width: 180px;
+          border: 4px solid rgba(245,246,247,1);
+          border-radius: 4px;
         }
+        .name{
+          font-size: 12px;
+          color: #1F2429;
+          line-height: 16px;
+          margin-top: 12px;
+          text-align: center;
+        }
+        &:not(:last-of-type){
+          margin-bottom: 20px;
+        }
+      }
+    }
+    .cur-img-container{
+      padding: 20px;
+      flex: 1;
+      height: 100%;
+      background: #F5F6F7;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      >img{
+        max-width: 730px;
+        max-height: 530px;
       }
     }
   }

+ 326 - 174
src/views/analysis/GanttChart.vue

@@ -2,24 +2,24 @@
 <template>
   <div class="gantt-chart">
     <div class="condition-legend-bar">
-      <Select 
+      <Select
         class="system-select"
         width="217"
-        :isReadOnly="true" 
-        tipPlace="top" 
+        :isReadOnly="true"
+        tipPlace="top"
         caption="系统名称:"
-        v-model="systemId" 
-        :selectdata="systemList" 
+        v-model="systemId"
+        :selectdata="systemList"
         :placeholder="'请选择'"
-        @change="getGanttChartData"
+        @change="changeSystem"
       />
       <div class="legend-container">
         <div v-for="(item) in legends" :key="'key_' + item.id" class="item-legend">
           <div :style="{'background': item.backgroundColor, 'border-color': item.borderColor}"></div>
           <div>{{item.text}}</div>
         </div>
-        <div >
-          <el-radio-group v-model="timeType">
+        <div>
+          <el-radio-group v-model="timeType" @change="changeView">
             <el-radio style="line-height: 32px;margin-right: 16px;" label="month">月视图</el-radio>
             <el-radio style="line-height: 32px;" label="day">日视图</el-radio>
           </el-radio-group>
@@ -29,7 +29,9 @@
     <div class="main-gantt-container">
       <div class="task-title">
         <div class="title">任务标题</div>
-        <Tree :data="treeData" @openNode="toggleNode" />
+        <div>
+          <Tree :data="treeData" @openNode="toggleNode" />
+        </div>
       </div>
       <div class="chart-container" id="chartContainer" ref="chartContainer">
         <div id="ganttContainer"></div>
@@ -38,7 +40,7 @@
         <div class="dialog-container">
           <div class="row task-status">
             <div>
-              <Task class="icon"/>
+              <Task class="icon" />
               <div class="title">任务状态</div>
             </div>
             <div>进行中</div>
@@ -65,11 +67,11 @@
             <div>
               <div>
                 <div class="num">12张</div>
-                <div class="more">查看更多</div>
+                <div class="more" @click="() => showImgDetail = true">查看更多</div>
               </div>
               <div class="pictrue-container">
                 <div v-for="(item) in pictures" :key="'id_' + item.id">
-                  <img :src="item.imgSrc" alt="" />
+                  <img :src="item.imgSrc" alt />
                   <div class="info">{{item.title}}</div>
                 </div>
               </div>
@@ -86,7 +88,7 @@
               </div>
               <div class="pictrue-container">
                 <div v-for="(item) in reports" :key="'id_' + item.id">
-                  <img :src="item.imgSrc" alt="" />
+                  <img :src="item.imgSrc" alt />
                   <div class="info">{{item.title}}</div>
                 </div>
               </div>
@@ -97,104 +99,163 @@
               <Menu class="icon" />
               <div class="title">检测内容</div>
             </div>
-            <el-table :data="tableData">
-              <el-table-column property="time" label="设备简称"></el-table-column>
-              <el-table-column property="evenType" label="设备编号"></el-table-column>
-              <el-table-column property="objid" label="设备数"></el-table-column>
-              <el-table-column property="content" label="空间位置"></el-table-column>
+            <el-table :data="tableData" max-height="300">
+              <el-table-column property="sbjc" label="设备简称"></el-table-column>
+              <el-table-column property="sbjbm" label="设备编号"></el-table-column>
+              <el-table-column property="cnt" label="设备数"></el-table-column>
+              <el-table-column property="wzjc" width="300" label="空间位置"></el-table-column>
             </el-table>
           </div>
         </div>
       </el-dialog>
+      <div class="img-detail-container">
+        <el-dialog :title="'图片预览'" :visible.sync="showImgDetail" width="1260px">
+          <div class="detail-container">
+            <div class="pictures-menu">
+              <!-- <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item"> -->
+              <div class="item">
+                <!-- <img :src="item.url" alt=""> -->
+                <img src="../../assets/images/login_back.png" alt />
+                <div class="name">图层名称1.jpg</div>
+              </div>
+              <div class="item">
+                <img src="../../assets/images/login_back.png" alt />
+                <div class="name">图层名称1.jpg</div>
+              </div>
+            </div>
+            <div class="cur-img-container">
+              <img src="../../assets/images/login_back.png" alt />
+            </div>
+          </div>
+        </el-dialog>
+      </div>
     </div>
   </div>
 </template>
 
 <script>
-import { queryGanttChart, queryGanttDetail } from '../../api/ganttChart';
-import { querySystemList, queryDetailData } from '../../api/coreDeviceReport';
-import { Tree } from 'meri-design';
-import _ from 'lodash';
-import moment from 'moment';
+import { queryGanttChart, queryGanttDetail } from "../../api/ganttChart";
+import { querySystemList, queryDetailData } from "../../api/coreDeviceReport";
+import { Tree } from "meri-design";
+import _ from "lodash";
+import moment from "moment";
 // import '../../utils/ganttChart/g.js';
-import { GanttChart } from '../../utils/ganttChart/GanttChart.js';
-import { parse } from 'path';
-import Task from '../../assets/svg/task.svg';
-import PlanTime from '../../assets/svg/plan_time.svg';
-import RealTime from '../../assets/svg/real_time.svg';
-import Picture from '../../assets/svg/picture.svg';
-import Report from '../../assets/svg/report.svg';
-import Menu from '../../assets/svg/menu.svg';
+import { GanttChartDay } from "../../utils/ganttChart/GanttChart_day.js";
+import { GanttChartMonth } from "../../utils/ganttChart/GanttChart_month.js";
+import { parse } from "path";
+import Task from "../../assets/svg/task.svg";
+import PlanTime from "../../assets/svg/plan_time.svg";
+import RealTime from "../../assets/svg/real_time.svg";
+import Picture from "../../assets/svg/picture.svg";
+import Report from "../../assets/svg/report.svg";
+import Menu from "../../assets/svg/menu.svg";
 export default {
-  data () {
+  data() {
     return {
       systemList: [], // 系统列表
-      systemId: '', // 系统名称
+      systemId: "", // 系统名称
       legends: [
-        {id: 1, text: '按时完成', backgroundColor: '#E7E9EA', borderColor: '#C3C7CB'},
-        {id: 2, text: '未开始/进行中', backgroundColor: 'rgba(91, 143, 249, 0.2)', borderColor: '#5B8FF9'},
-        {id: 3, text: '逾期完成', backgroundColor: '#FBCE99', borderColor: '#F58300'},
-        {id: 4, text: '逾期未完成', backgroundColor: '#FBB8B5', borderColor: '#F54E45'},
+        {
+          id: 1,
+          text: "按时完成",
+          backgroundColor: "#E7E9EA",
+          borderColor: "#C3C7CB"
+        },
+        {
+          id: 2,
+          text: "未开始/进行中",
+          backgroundColor: "rgba(91, 143, 249, 0.2)",
+          borderColor: "#5B8FF9"
+        },
+        {
+          id: 3,
+          text: "逾期完成",
+          backgroundColor: "#FBCE99",
+          borderColor: "#F58300"
+        },
+        {
+          id: 4,
+          text: "逾期未完成",
+          backgroundColor: "#FBB8B5",
+          borderColor: "#F54E45"
+        }
       ], // 图例
-      timeType: 'month', // 甘特图时间类型
+      timeType: "month", // 甘特图时间类型
       treeData: [], // 树结构数据
-      
+      startTime: null, // 甘特图开始时间
+      endTime: null, // 甘特图结束时间
+
       // 弹窗相关
       showDetail: false, // 弹框显示状态
-      detailTitle: '', // 弹窗标题
+      detailTitle: "", // 弹窗标题
       pictures: [
-        {id: 1, imgSrc: require('../../assets/imgs/analysis/picture.png'), title: '2019年5月高压用具检测报告.jpg'},
-        {id: 2, imgSrc: require('../../assets/imgs/analysis/picture.png'), title: '2019年5月高压用具检测报告.jpg'},
+        {
+          id: 1,
+          imgSrc: require("../../assets/imgs/analysis/picture.png"),
+          title: "2019年5月高压用具检测报告.jpg"
+        },
+        {
+          id: 2,
+          imgSrc: require("../../assets/imgs/analysis/picture.png"),
+          title: "2019年5月高压用具检测报告.jpg"
+        }
       ], // 照片
       reports: [
-        {id: 1, imgSrc: require('../../assets/imgs/analysis/report_pdf.png'), title: '2019年5月高压用具检测报告.pdf'},
-        {id: 2, imgSrc: require('../../assets/imgs/analysis/report_word.png'), title: '2019年5月高压用具检测报告.docx'},
+        {
+          id: 1,
+          imgSrc: require("../../assets/imgs/analysis/report_pdf.png"),
+          title: "2019年5月高压用具检测报告.pdf"
+        },
+        {
+          id: 2,
+          imgSrc: require("../../assets/imgs/analysis/report_word.png"),
+          title: "2019年5月高压用具检测报告.docx"
+        }
       ], // 报告
       ganttDetail: {}, // 甘特图明细
       tableData: [], // 表数据
-    }
-  },
 
-  components: {
-    Task,
-    PlanTime,
-    RealTime,
-    Picture,
-    Report,
-    Menu
+      showImgDetail: false, // 查看更多图片弹框显示状态
+    };
   },
 
+  components: {},
+
   computed: {},
 
   mounted() {
+    this.initChartTime();
     this.getSystemList();
   },
 
   methods: {
     /**
+     * 初始化甘特图请求时间
+     */
+    initChartTime() {
+      let endTime = new Date().getTime(),
+          startTime = endTime - 1000*60*60*24*365;
+      this.startTime = startTime;
+      this.endTime = endTime;
+    },
+    /**
      * 获取系统列表数据
      */
     getSystemList() {
-      querySystemList().then((res) => {
-        if (res.result === 'success') {
+      querySystemList().then(res => {
+        if (res.result === "success") {
           let data = res.data;
           let newData = [];
-          _.forEach(data, (item) => {
+          _.forEach(data, item => {
             newData.push({
               id: item.code,
               name: item.name
-            })
-          })
+            });
+          });
           this.systemList = newData;
-          const { query } = this.$route;
-          if (!_.isEmpty(query) && query.smsxt) {
-            this.systemId = query.smsxt;
-          } else {
-            this.systemId = newData[0].id;
-          }
           this.getGanttChartData();
         }
-      })
+      });
     },
     /**
      * 处理请求数据的时间
@@ -202,9 +263,9 @@ export default {
     disQueryTime() {
       let startTime, endTime;
       let curTime = new Date(),
-          curYear = curTime.getFullYear(),
-          curMonth = curTime.getMonth() + 1;
-      if (this.timeType === 'month') {
+        curYear = curTime.getFullYear(),
+        curMonth = curTime.getMonth() + 1;
+      if (this.timeType === "month") {
         startTime = `${curYear}0101000000`;
         endTime = `${curYear + 1}0101000000`;
       } else {
@@ -218,6 +279,27 @@ export default {
       return [startTime, endTime];
     },
     /**
+     * 切换系统
+     */
+    changeSystem() {
+      if (window.gc) {
+        gc.gCanvas.destroy();
+        window.gc = null;
+      }
+      this.getGanttChartData();
+    },
+    /**
+     * 切换视图
+     */
+    changeView() {
+      console.log('timeType', this.timeType)
+      if (window.gc) {
+        gc.gCanvas.destroy();
+        window.gc = null;
+      }
+      this.getGanttChartData();
+    },
+    /**
      * 获取甘特图数据
      */
     getGanttChartData() {
@@ -225,83 +307,101 @@ export default {
       let param = {
         smsxt: this.systemId,
         plazaId: 1000423,
-        startDate: 20000101000000, // time[0]
-        endDate: 20200708000000, // time[1]
-      }
-      queryGanttChart('/data/base/queryGanttChart', param).then((res) => {
+        startDate: this.startTime, // time[0]
+        endDate: this.endTime // time[1]
+      };
+      queryGanttChart("/data/base/queryGanttChart", param).then(res => {
         const { dsfList, wbList, zwList, result } = res;
-          console.log('res', res)
-        if (result === 'success') {
+        console.log("res", res);
+        if (result === "success") {
           let newData = [],
-              data = [wbList, zwList, dsfList],
-              name = ['维保', '专维', '第三方检测'];
+            data = [wbList, zwList, dsfList],
+            name = ["维保", "专维", "第三方检测"];
           _.forEach(data, (item, index) => {
             newData.push({
+              index: index,
               id: index + 1,
               name: name[index],
               open: true,
               // children: name[index] === '专维'?[] : this.disGanttData(dsfList)
               children: this.disGanttData(data[index])
-            })
-          })
-          
+            });
+          });
           this.treeData = newData;
-          
-          let taskData = _.map(_.cloneDeep(newData), (item) => {
+
+          let taskData = _.map(_.cloneDeep(newData), item => {
             return {
               id: item.id,
               type: item.name,
               open: item.open,
-              dataList: _.map(item.children, (_item) => {
+              dataList: _.map(item.children, _item => {
                 return {
                   id: _item.id,
                   title: _item.name,
                   tasks: _item.originData
-                }
+                };
               })
-            }
-          })
-          console.log('taskData', taskData)
-          let width = this.$refs.chartContainer.offsetWidth;
-          window.gc = new GanttChart({
-            chartParentContainer: 'chartContainer',
-            chartContainer: 'ganttContainer',
-            viewWidth: width,
-            cWidth: 3*width,
-            tasks: taskData,
-            daysCount: parseInt(3*width/40),
-            callback: this.showDialog
+            };
           });
-          gc.main()
+          console.log("taskData", taskData);
+          if (!window.gc) {
+            let width = this.$refs.chartContainer.offsetWidth;
+            let handleFn = null;
+            if (this.timeType === 'month') {
+              handleFn = GanttChartMonth
+            } else {
+              handleFn = GanttChartDay
+            }
+            window.gc = new handleFn({
+              chartParentContainer: "chartContainer",
+              chartContainer: "ganttContainer",
+              viewWidth: width,
+              cWidth: 3 * width,
+              tasks: taskData,
+              daysCount: this.timeType === 'month'? 365 : parseInt((3 * width) / 40),
+              callback: this.showDialog,
+              pageToCallback: (data)=>{
+                const { startAt, endAt } = data;
+                this.startTime = new Date(startAt).getTime();
+                this.endTime = new Date(endAt).getTime();
+                this.getGanttChartData();
+              }
+            });
+            gc.main();
+          } else {
+            gc.changeTasks(taskData)
+          }
         }
-      })
+      });
     },
     /**
      * 处理甘特图数据
      */
     disGanttData(arr) {
       let data = [];
-      _.forEach(arr, (item) => {
+      _.forEach(arr, item => {
         data.push({
           id: item.id,
           name: item.name,
-          checked: 'uncheck',
-          originData: _.map(item.data, (_item) => {
-            _item.startDate = moment.unix((new Date().getTime() - 1000*60*60*24*7)/1000).format('YYYY-MM-DD HH:mm:ss');
-            _item.endDate = moment.unix(new Date().getTime()/1000).format('YYYY-MM-DD HH:mm:ss');
+          checked: "uncheck",
+          originData: _.map(item.data, _item => {
+            // _item.startDate = moment.unix((new Date().getTime() - 1000*60*60*24*7)/1000).format('YYYY-MM-DD HH:mm:ss');
+            _item.startDate = moment.unix(_item.startDate / 1000).format("YYYY-MM-DD HH:mm:ss");
+            // _item.endDate = moment.unix(new Date().getTime()/1000).format('YYYY-MM-DD HH:mm:ss');
+            _item.endDate = moment.unix(_item.endDate / 1000).format("YYYY-MM-DD HH:mm:ss");
             _item.description = _item.parentname;
-            return _item
+            return _item;
           })
-        })
-      })
-      return data
+        });
+      });
+      return data;
     },
     /**
      * 展开收起节点
      */
-    toggleNode(status) {
-      console.log('status', status)
-
+    toggleNode(status, item) {
+      console.log("status", status, item);
+      window.gc.toggle(item.index);
     },
     /**
      * 显示弹窗
@@ -321,28 +421,35 @@ export default {
         plazaId: 1000423,
         type: 2,
         id: 1078467
-      }
-      queryGanttDetail('/data/base/queryGanttChartDetails', param).then((res) => {
+      };
+      queryGanttDetail("/data/base/queryGanttChartDetails", param).then(res => {
         const { result, data } = res;
-        if (result === 'success') {
-          const { status, planStartDate, planEndDate, realStartDate, realEndDate } = data;
+        if (result === "success") {
+          const {
+            status,
+            planStartDate,
+            planEndDate,
+            realStartDate,
+            realEndDate
+          } = data;
           let newData = {
             status,
-            color: '',
+            color: "",
             planTime: this.dealDetailTime(planStartDate, planEndDate),
             realTime: this.dealDetailTime(realStartDate, realEndDate)
-          }
+          };
           this.ganttDetail = newData;
+          this.tableData = data.assetList;
         }
-      })
+      });
     },
     /**
      * 处理时间
      */
     dealDetailTime(startTime, endTime) {
-      let start = moment.unix(startTime / 1000).format('YYYY.MM.DD HH:mm:ss'),
-          end = moment.unix(endTime / 1000).format('YYYY.MM.DD HH:mm:ss');
-      return `${start}-${end}`
+      let start = moment.unix(startTime / 1000).format("YYYY.MM.DD HH:mm:ss"),
+        end = moment.unix(endTime / 1000).format("YYYY.MM.DD HH:mm:ss");
+      return `${start}-${end}`;
     },
     /**
      * 获取甘特图的图片/报告详情
@@ -352,18 +459,17 @@ export default {
         file_type: 1,
         file_type_id: 1985,
         type: type
-      }
-      queryDetailData('/data/base/queryFileDetails', param).then((res) => {
-        console.log('photo', res)
-
-      })
+      };
+      queryDetailData("/data/base/queryFileDetails", param).then(res => {
+        console.log("photo", res);
+      });
     }
   }
-}
+};
 </script>
 
 <style lang='less' scoped>
-.gantt-chart{
+.gantt-chart {
   padding-left: 16px;
   padding-right: 16px;
   padding-top: 12px;
@@ -371,23 +477,23 @@ export default {
   width: 100%;
   height: 100%;
   background: #fff;
-  .condition-legend-bar{
+  .condition-legend-bar {
     margin-bottom: 12px;
     display: flex;
     justify-content: space-between;
   }
-  .legend-container{
+  .legend-container {
     display: flex;
-    .item-legend{
+    .item-legend {
       padding-left: 18px;
       position: relative;
       font-size: 14px;
-      color: #646C73;
+      color: #646c73;
       line-height: 32px;
-      &:not(:nth-of-type(4)){
+      &:not(:nth-of-type(4)) {
         margin-right: 20px;
       }
-      >div:first-child{
+      > div:first-child {
         position: absolute;
         left: 0;
         top: calc(50% - 6px);
@@ -395,127 +501,173 @@ export default {
         height: 12px;
         border: 1px solid;
       }
-      &:nth-of-type(4){
+      &:nth-of-type(4) {
         margin-right: 32px;
       }
     }
   }
-  .main-gantt-container{
+  .main-gantt-container {
     width: 100%;
     height: calc(100% - 44px);
-    background: #F2F5F7;
-    border:1px solid rgba(239,240,241,1);
-    border-radius:4px;
+    background: #f2f5f7;
+    border: 1px solid rgba(239, 240, 241, 1);
+    border-radius: 4px;
     display: flex;
-    .task-title{
+    .task-title {
       width: 404px;
       height: 100%;
-      border-right: 1px solid #EFF0F1;
-      .title{
+      border-right: 1px solid #eff0f1;
+      .title {
         padding-left: 32px;
         padding-top: 15px;
         padding-bottom: 15px;
         font-size: 14px;
-        color: #646C73;
+        color: #646c73;
         line-height: 19px;
-        border-bottom: 1px solid #EFF0F1;
+        border-bottom: 1px solid #eff0f1;
+      }
+      > div:nth-of-type(2) {
+        max-height: calc(100% - 50px);
+        overflow: auto;
       }
     }
-    .chart-container{
+    .chart-container {
       flex: 1;
       overflow: hidden;
       background: #fff;
     }
   }
-  .dialog-container{
+  .dialog-container {
     max-height: 580px;
-    overflow: auto ;
-    .row{
+    overflow: auto;
+    .row {
       display: flex;
-      >div:first-child{
+      > div:first-child {
         margin-right: 24px;
         display: flex;
         align-items: center;
       }
-      &:not(:last-of-type){
+      &:not(:last-of-type) {
         margin-bottom: 14px;
       }
-      .info{
+      .info {
         font-size: 14px;
-        color: #1F2429;
+        color: #1f2429;
         line-height: 22px;
       }
     }
-    .icon{
+    .icon {
       margin-right: 6px;
       width: 16px;
     }
-    .title{
+    .title {
       width: 84px;
       font-size: 14px;
-      color: #646C73;
+      color: #646c73;
       line-height: 22px;
       font-weight: 400;
     }
-    .task-status>div:nth-of-type(2){
+    .task-status > div:nth-of-type(2) {
       width: 58px;
       height: 24px;
-      background: rgba(91,143,249,0.2);
+      background: rgba(91, 143, 249, 0.2);
       border-radius: 2px;
-      color: #5B8FF9;
+      color: #5b8ff9;
       line-height: 24px;
       text-align: center;
     }
-    .picture{
-      margin-bottom: 19px!important;
-      >div:first-child{
+    .picture {
+      margin-bottom: 19px !important;
+      > div:first-child {
         align-items: baseline;
       }
-      >div:nth-of-type(2){
+      > div:nth-of-type(2) {
         flex: 1;
       }
-      >div:nth-of-type(2)>div:first-child{
+      > div:nth-of-type(2) > div:first-child {
         margin-bottom: 12px;
         display: flex;
       }
       .num,
-      .more{
+      .more {
         font-size: 14px;
         line-height: 22px;
         font-weight: 400;
       }
-      .num{
+      .num {
         margin-right: 22px;
-        color: #1F2429;
+        color: #1f2429;
       }
-      .more{
-        color: #025BAA;
+      .more {
+        color: #025baa;
         cursor: pointer;
       }
     }
-    .pictrue-container{
-      >div{
+    .pictrue-container {
+      > div {
         padding: 10px 16px;
         width: 100%;
-        border-radius:4px;
-        border:1px solid rgba(233,233,233,1);
+        border-radius: 4px;
+        border: 1px solid rgba(233, 233, 233, 1);
         display: flex;
         align-items: center;
-        >img{
+        > img {
           width: 24px;
           margin-right: 15px;
         }
       }
-      >div:not(:last-child){
+      > div:not(:last-child) {
         margin-bottom: 8px;
       }
     }
-    .test-content{
+    .test-content {
       display: block;
-      >div:first-child{
+      > div:first-child {
         margin-bottom: 13px;
       }
     }
   }
+  .detail-container {
+    display: flex;
+    height: 600px;
+  }
+  .pictures-menu {
+    margin-right: 21px;
+    padding-top: 16px;
+    padding-bottom: 16px;
+    width: 180px;
+    height: 100%;
+    overflow: auto;
+    .item {
+      > img {
+        width: 180px;
+        border: 4px solid rgba(245, 246, 247, 1);
+        border-radius: 4px;
+      }
+      .name {
+        font-size: 12px;
+        color: #1f2429;
+        line-height: 16px;
+        margin-top: 12px;
+        text-align: center;
+      }
+      &:not(:last-of-type) {
+        margin-bottom: 20px;
+      }
+    }
+  }
+  .cur-img-container {
+    padding: 20px;
+    flex: 1;
+    height: 100%;
+    background: #f5f6f7;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    > img {
+      max-width: 730px;
+      max-height: 530px;
+    }
+  }
 }
 </style>

+ 9 - 44
src/views/analysis/SpecificationUpdateRecord.vue

@@ -43,22 +43,20 @@
 </template>
 
 <script>
-import { getSpecificaltionData, queryEventypes } from '../../api/specificationUpdateRecord';
+import { getSpecificaltionData } from '../../api/specificationUpdateRecord';
 import moment from 'moment';
 import _ from 'lodash';
 export default {
   data () {
     return {
-      incidentList: [], // 事件列表
-      oraginIncidentList: [
-        {id: 'all', name: '全部'},
+      incidentList: [
         {id: 0, name: '专维'},
         {id: 1, name: '维保'},
         {id: 2, name: '第三方检测'},
         {id: 3, name: '重点关注'},
-      ], // 事件列表字典表
-      incidentType: 'all', // 事件类型
-      timeVal: null, // 时间
+      ], // 事件列表
+      incidentType: '', // 事件类型
+      timeVal: '', // 时间
       tableData: [], // 表数据
       curPage: 1, // 当前页码
       pageSize: 10, // 每页条数
@@ -73,45 +71,11 @@ export default {
   computed: {},
 
   mounted() {
-    this.initTimePicker();
-    this.getEvenType();
+    this.getTableData();
   },
 
   methods: {
     /**
-     * 初始化时间
-     */
-    initTimePicker() {
-      let endTime = new Date(),
-          startTime = new Date(endTime.getTime() - 1000*60*60*24*30);
-      this.timeVal = [startTime, endTime];
-    },
-    /**
-     * 获取事件类型
-     */
-    getEvenType() {
-      let query = {
-        tableName: 'rpt_change_record',
-        columnName: {
-          objtype: 'objtype'
-        }
-      }
-      queryEventypes(`/data/base/queryOptions?plazaId=1000423`, [query]).then((res) => {
-        const { result, data } = res;
-        if (result === 'success') {
-          let newData = [this.oraginIncidentList[0]];
-          _.forEach(data.rpt_change_record.objtype, (item) => {
-            newData.push({
-              id: item.key,
-              name: _.find(this.oraginIncidentList, (o) => {return item.key === o.id}).name
-            })
-          })
-          this.incidentList = newData;
-          this.getTableData();
-        }
-      })
-    },
-    /**
      * 获取表数据
      */
     getTableData() {
@@ -128,7 +92,7 @@ export default {
       if (this.endTime !== '') {
         param.changeDateEndDate = this.endTime;
       }
-      if (this.incidentType !== 'all') {
+      if (this.incidentType !== '') {
         param.objtype = this.incidentType;
       }
       getSpecificaltionData('/data/rpt_change_record/query', param).then((res) => {
@@ -161,7 +125,8 @@ export default {
         this.startTime = moment.unix(new Date(this.timeVal[0]).getTime() / 1000).format('YYYYMMDDHHmmss');
         this.endTime = moment.unix(new Date(this.timeVal[1]).getTime() / 1000).format('YYYYMMDDHHmmss');
       } else {
-        this.initTimePicker();
+        this.startTime = 20171027000000;
+        this.endTime = 20171028000000;
       }
       this.getTableData();
     }

+ 0 - 8
src/views/analysis/index.vue

@@ -46,14 +46,6 @@ export default {
 		GanttChart
 	},
 	mounted() {
-		const { query } = this.$route;
-		if (!_.isEmpty(query)) {
-			if (query.module === 'specification') {
-				_.map(this.navList, (o) => {return o.isActive = o.id === 2});
-			} else if (query.module === 'gantt') {
-				_.map(this.navList, (o) => {return o.isActive = o.id === 3});
-			}
-		}
 		this.findCurModule();
 	},
 	methods: {

+ 8 - 6
src/views/equipment/eqDialog.vue

@@ -5,8 +5,10 @@
             <!-- 除了清单和原理页面,别的都有记录事项detailDialog页面 -->
             <div slot='title' class='header-title' v-if='Object.keys(dialogInfo).length>0'>
                 <span class='title-name'>{{systemName}}-{{dialogInfo.label}}</span>
+                <!-- 2020-7-12 查看图纸时 隐藏图标(查看入口) -->
+                <!-- v-if='dialogInfo.id.slice(2,4)!="QD" && dialogInfo.id.slice(2,4)!="YL" && dialogInfo.id.slice(0,4)!="GJSP"' -->
                 <img
-                    v-if='dialogInfo.id.slice(2,4)!="QD" && dialogInfo.id.slice(2,4)!="YL" && dialogInfo.id.slice(0,4)!="GJSP"'
+                    v-if='dialogInfo.id.slice(2,4)!="QD" && dialogInfo.id.slice(2,4)!="YL" && dialogInfo.id.slice(0,4)!="GJSP" && dialogInfo.label !== "查看图纸"'
                     src='../../assets/imgs/zy1.png'
                     @click='visibalBox'
                     style='margin-top:-4px;'
@@ -14,10 +16,10 @@
                 />
             </div>
             <!-- 没有tab的页面 -->
-            <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length==0' style='margin:16px 0 0 24px;height:90%'>
+            <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length==0' style='margin:16px 0 0 24px;height:100%'>
                 <!-- 原理图 -->
-                <div v-if='dialogInfo.id.slice(2,4)=="YL"' style='width:90%;overflow:hidden;height:100%'>
-                    <rotation :rotationImg='rotationImg'></rotation>
+                <div v-if='dialogInfo.id.slice(2,4)=="YL"' style='width:100%;overflow:auto;height:100%;margin:0 auto'>
+                    <rotation type='3' :rotationImg='rotationImg'></rotation>
                 </div>
                 <!-- 土建系统主要材料清单 -->
                 <tj-table v-else-if='dialogInfo.id.slice(0,4)=="TJQD"' :param='param'></tj-table>
@@ -62,8 +64,8 @@
                                     v-if='value.id.slice(2,4)=="YL" && eve.count>0 && value.param.type_code.slice(0,3)!="FBT"'
                                 >
                                     <!-- 有tab的原理图 -->
-                                    <div style='width:100%;height:600px;overflow:hidden'>
-                                        <rotation :rotationImg='rotationImg'></rotation>
+                                    <div style='width:100%;height:600px;'>
+                                        <rotation type='3' :rotationImg='rotationImg'></rotation>
                                     </div>
                                 </el-tab-pane>
                                 <!-- 发布之后的编辑器的分支图 -->

+ 17 - 5
src/views/equipment/index.vue

@@ -28,7 +28,6 @@
                             <Legend :systemName='systemName' :floors='floorsArr' type='1' :editTips='`编辑${floorInfo.code}层${systemName}平面图`'></Legend>
                         </div>
                         <floorMap ref='floorMap' :id='"equip"' :loadName='loadName' :type='"system"'></floorMap>
-                        <!--  -->
                         <div class='additional-box' v-if='fqPic.length>0'>
                             <div class='additional2' @click='additionalColl' v-if='showView===3'>
                                 <img src='../../assets/imgs/bg2.png' alt />
@@ -79,7 +78,6 @@ export default {
             dialogInfo: {},
             brand: [], //品牌
             manufacturer: [],
-            show: false,
             fqPic: [],
             loadName: '',
             type: '',
@@ -97,6 +95,7 @@ export default {
             this.$cookie.set('categoryId', item.categoryId, 3)
             this.$refs.floorMap.init(this.floorInfo.gname)
             this.querySmsxt()
+            this.viewLengend()
         },
         querySmsxt() {
             // 目前消防和弱电下面有特殊的数据表格
@@ -146,6 +145,13 @@ export default {
         // 从设备设施进入的机房
         queryType(val) {
             this.type = val
+        },
+        viewLengend() {
+            if (this.legendTable.length > 0) {
+                this.$store.commit('SETSHOWVIEW', 1)
+            } else {
+                this.$store.commit('SETSHOWVIEW', 0)
+            }
         }
     },
     mounted() {
@@ -164,7 +170,7 @@ export default {
         this.$refs.floorMap.init(this.floorInfo.gname)
     },
     computed: {
-        ...mapGetters(['floorsArr', 'plazaId', 'showView'])
+        ...mapGetters(['floorsArr', 'plazaId', 'showView', 'legendTable'])
     }
 }
 </script>
@@ -176,11 +182,11 @@ export default {
     overflow: hidden;
     color: #1f2429;
     .eq-top {
-        margin-left: 260px;
+        // margin-left: 260px;
+        width: 100%;
         padding-top: 24px;
         position: fixed;
         z-index: 3;
-        min-width: 1300px;
         display: flex;
         justify-content: center;
         .eq-system {
@@ -343,6 +349,12 @@ export default {
         }
     }
 }
+@media screen and (max-width: 1366px) {
+    /*当屏幕尺寸小于1366px时,应用下面的CSS样式*/
+    .eq-top {
+        margin-left: 0 !important;
+    }
+}
 </style>
 <style lang="less">
 .el-table {

+ 25 - 10
src/views/equipment/table/djspTable.vue

@@ -44,7 +44,7 @@ import { Select } from 'meri-design'
 import EqDetail from './eqDetaileDialog'
 import { queryShops } from '@/api/equipmentList.js'
 import { mapGetters } from 'vuex'
-
+import store from '../../../store/index'
 export default {
     components: { Select, EqDetail },
     data() {
@@ -102,16 +102,17 @@ export default {
                 console.log(res)
                 this.tableData = []
                 let floor = {}
-                res.data.forEach(i => {
-                    console.log(i)
-                    Object.keys(i).forEach(key => (floor[key] = 0)) // 初始化每一楼层个数为0
-                    Object.values(i).forEach(j => {
-                        Object.values(j).forEach(k => {
-                            console.log(k)
-                            this.tableData.push(k)
+                res.data &&
+                    res.data.forEach(i => {
+                        console.log(i)
+                        Object.keys(i).forEach(key => (floor[key] = 0)) // 初始化每一楼层个数为0
+                        Object.values(i).forEach(j => {
+                            Object.values(j).forEach(k => {
+                                console.log(k)
+                                this.tableData.push(k)
+                            })
                         })
                     })
-                })
 
                 this.tableData.map(n => {
                     if (floor[n.floor] === 0) {
@@ -132,11 +133,25 @@ export default {
                 this.getList()
             }
         },
-        floor() {
+        /* floor() {
+            console.log('watch floor')
             this.getList()
+        }, */
+        // 监听 vuex 中currentFloor的变化,切换楼层后,更新下拉菜单
+        '$store.state.currentFloor': {
+            handler(newV, oldV) {
+                if (newV.gname !== oldV.gname) {
+                    this.floor = newV.gname
+                    this.getList()
+                }
+            },
+            deep: true
         }
     },
     mounted() {
+        console.log('商铺电表数 mounted')
+        this.floor = this.$cookie.get('floorMapId')
+        console.log(this.floor)
         this.getList()
     }
 }

+ 13 - 2
src/views/equipment/table/eqListTable.vue

@@ -60,7 +60,7 @@
             <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
             </el-table-column>
-            <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable min-width="300">
+            <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable min-width='300'>
                 <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
             </el-table-column>
         </el-table>
@@ -86,6 +86,7 @@ import { Select } from 'meri-design'
 import EqDetail from './eqDetaileDialog'
 import { queryEquipmentList } from '@/api/equipmentList.js'
 import { mapGetters } from 'vuex'
+import store from '../../../store/index'
 
 export default {
     components: { Select, EqDetail },
@@ -162,9 +163,19 @@ export default {
                 this.getList()
             }
         },
-        floor(newV, oldV) {
+        /* floor(newV, oldV) {
             console.log(newV, oldV)
             this.getList()
+        }, */
+        // 监听 vuex 中currentFloor的变化,切换楼层后,更新下拉菜单
+        '$store.state.currentFloor': {
+            handler(newV, oldV) {
+                if (newV.gname !== oldV.gname) {
+                    this.floor = newV.gname
+                    this.getList()
+                }
+            },
+            deep: true
         }
     },
     mounted() {

+ 13 - 1
src/views/equipment/table/standTable.vue

@@ -85,6 +85,8 @@ import EqDetail from './eqDetaileDialog'
 
 import { mapGetters } from 'vuex'
 import { Select } from 'meri-design'
+import store from '../../../store/index'
+
 export default {
     data() {
         return {
@@ -170,8 +172,18 @@ export default {
                 this.getList()
             }
         },
-        floor(newV, oldV) {
+        /* floor(newV, oldV) {
             this.getList()
+        }, */
+        // 监听 vuex 中currentFloor的变化,切换楼层后,更新下拉菜单
+        '$store.state.currentFloor': {
+            handler(newV, oldV) {
+                if (newV.gname !== oldV.gname) {
+                    this.floor = newV.gname
+                    this.getList()
+                }
+            },
+            deep: true
         }
     },
     mounted() {

+ 1 - 0
src/views/equipment/table/wbTable.vue

@@ -172,6 +172,7 @@ export default {
         },
         //工单详情
         innerTable(row) {
+            console.log(row)
             if (row.apptype == '外委' || row.apptype == '自维') {
                 if (row.wb_gzglid) {
                     window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`, true)

+ 6 - 3
src/views/equipment/table/wxTable.vue

@@ -95,7 +95,11 @@
             </el-table-column>
             <el-table-column prop='brand' label='现场照片' width='80'>
                 <template slot-scope='{row}'>
-                    <div v-if='row.glsmsImage' style='cursor:pointer;color: #0091ff;' @click='clickPic(row.glsmsImage)'>{{row.glsmsImage.length+'张'}}</div>
+                    <div
+                        v-if='row.glsmsImage'
+                        style='cursor:pointer;color: #0091ff;'
+                        @click.prevent='clickPic(row.glsmsImage)'
+                    >{{row.glsmsImage.length+'张'}}</div>
                     <div v-else>{{'---'}}</div>
                 </template>
             </el-table-column>
@@ -189,8 +193,7 @@ export default {
                     diff: this.diff,
                     plazaId: this.$store.state.plazaId,
                     page: this.currentPage,
-                    size: this.size,
-                    
+                    size: this.size
                 }
             }
             //下拉

+ 30 - 12
src/views/homepage/index.vue

@@ -5,11 +5,11 @@
                 <h4>{{item.smsxtname}}</h4>
                 <div class='equipment-list' v-if='item.assetTypeList'>
                     <div @click='navToInnerPage(item, equip)' class='equipment-item' v-for='(equip , index) in item.assetTypeList' :key="index">
-                        <div class='equip-name'>
+                        <div class='equip-name' >
                             <h5>{{equip.category_name}}</h5>
-                            <div class='exception-number' v-if='equip.is_exception_num'>{{equip.is_exception_num}}</div>
+                            <div class='exception-number' v-if="equip.is_exception_num">{{equip.is_exception_num}}</div>
                         </div>
-                        <section>
+                        <section  >
                             <div class='equip-statis'>
                                 <span class='equip-number'>{{equip.asset_num}}</span>
                                 <span class='equip-unit'>台</span>
@@ -90,6 +90,7 @@ export default {
             cardsList: [],
             itemsList: [],
             changeList: [],
+            plazaId:'',
             srcList: {
                 0: {
                     1: require('../../assets/images/icons/edit_blue_b.png'), //1.正常(蓝色) 2.警告(黄色) 3.严重(红色)
@@ -109,13 +110,19 @@ export default {
             }
         }
     },
+    created () {
+        let plazaId = this.$route.query.plazaId
+        if (plazaId) {
+            this.plazaId = plazaId
+        }
+    },
     mounted() {
         this.testAjax()
         this.getItemsQuery()
         this.getInstructionList()
     },
     methods: {
-        /**
+          /**
          *  点击跳转进入综合事项管理页面
          */
         navToFocusItem () {
@@ -159,17 +166,29 @@ export default {
         navToGanttPage (item) {
             this.$router.push({path:"./analysis", query:{smsxt:item.smsxt, module:'gantt'}})
         },
-        //TODO plazaId目前是写死的 后期需要更换成用户对应的ID
+  
         testAjax() {
             let params = {
                 getParams: {
-                    plazaId: 1000423
+                    plazaId: this.plazaId
                 }
             }
             getCardList(params).then(res => {
                 if (res.result == 'success') {
                     let result = res.data
                     if (result && Array.isArray(result)) {
+                        result.forEach(item => {
+                            if (item.assetTypeList) {
+                                let list = item.assetTypeList
+                                let len = list.length
+                                for (let i=0; i< len; i++) {
+                                    if (list[i] && !list[i].asset_num) {
+                                        list.splice(i, 1)
+                                        i--
+                                    }
+                                }
+                            }
+                        })
                         this.cardsList = result
                     }
                 }
@@ -181,7 +200,7 @@ export default {
         getInstructionList() {
             let params = {
                 getParams: {
-                    plazaId: 1000423,
+                    plazaId: this.plazaId,
                     page: 1,
                     size: 10
                 }
@@ -213,13 +232,12 @@ export default {
             let params = {
                 getParams: {
                     // department=部门 //部门
-                    startDate: '20200208000000', //开始时间
-                    endDate: '20200608000000', //结束时间
-                    plazaId: 1000423, //广场id 必填
+                    // startDate: '20200208000000', //开始时间
+                    // endDate: '20200608000000', //结束时间
+                    plazaId: this.plazaId, //广场id 必填
                     page: 1, //页数
                     size: 10 //条数
-                    // "orderBy":字段名,1;//排序,1正序,0,倒序
-                    // keyword=关键字1:字段名11,字段名12;关键字2:字段名21,字段名22;//模糊查询参数
+              
                 }
             }
             getQueryList(params).then(res => {

+ 13 - 9
src/views/legendLibrary/addForm.vue

@@ -333,7 +333,7 @@ export default {
                 })
 
                 var hex = '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1) + opacity
-                console.log(hex)
+
                 return hex
             } else {
                 return
@@ -353,14 +353,18 @@ export default {
         },
         //线条类型改变
         changeLineType(val) {
-            this.borderLineOptionObject = val && this.borderLineOption.find(item => item.id == val)
-            if (this.$refs.select1 && this.$refs.select1.$el) {
-                this.$refs.select1.$el.children[0].children[0].setAttribute(
-                    'style',
-                    'background:#ffffff url(' + this.borderLineOptionObject.src + ')  10px center no-repeat;color:transparent;'
-                )
-            }
-            this.$set(this.ruleForm, 'LineDash', val)
+            if (val) {
+                this.borderLineOptionObject = val && this.borderLineOption.find(item => item.id == val)
+                this.$nextTick(() => {
+                    if (this.$refs.select1 && this.$refs.select1.$el) {
+                        this.$refs.select1.$el.children[0].children[0].setAttribute(
+                            'style',
+                            'background:#ffffff url(' + this.borderLineOptionObject.src + ')  10px center no-repeat;color:transparent;'
+                        )
+                    }
+                })
+                this.$set(this.ruleForm, 'LineDash', val)
+            }
             if (this.view) {
                 this.view.lineType = val
             }

+ 30 - 0
src/views/legendLibrary/addLegend.vue

@@ -16,6 +16,36 @@
             </span>
         </el-dialog>
 
+        <!-- <Modal :show='dialogVisible' :title='title' mode='middle' @close='dialogVisible = false,cancal()'>
+            <template #content>
+                <add-form
+                    ref='add'
+                    :InfosList='InfosList'
+                    :InfoTypeIdList='InfoTypeIdList'
+                    :ruleForm='info'
+                    @addSuccess='addSuccess'
+                    @updateSuccess='updateSuccess'
+                    :title='title'
+                ></add-form>
+            </template>
+            <template #handle>
+                <Button @click='dialogVisible = false,cancal()' type='default'>取 消</Button>
+                <Button @click='save' type='primary'>确 定</Button>
+            </template>
+        </Modal>-->
+        <!-- 
+        <a-modal v-model='dialogVisible' :title='title' @ok='save' @cancel='dialogVisible = false,cancal()' okText='确定' cancelText='取消' width='900px'>
+            <add-form
+                ref='add'
+                :InfosList='InfosList'
+                :InfoTypeIdList='InfoTypeIdList'
+                :ruleForm='info'
+                @addSuccess='addSuccess'
+                @updateSuccess='updateSuccess'
+                :title='title'
+            ></add-form>
+        </a-modal>-->
+
         <TransferSelectModal
             defaultExpandAll
             default-expand-all

+ 0 - 0
src/views/legendLibrary/index.vue


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff