guoxiaohuan 4 years ago
parent
commit
a8f3c6610c
61 changed files with 1389 additions and 2178 deletions
  1. 4 4
      package.json
  2. 11 2
      src/App.vue
  3. 8 0
      src/api/public.js
  4. 6 0
      src/assets/css/rotation.css
  5. 6 0
      src/assets/css/rotation.less
  6. BIN
      src/assets/imgs/2020.png
  7. BIN
      src/assets/imgs/20200.png
  8. BIN
      src/assets/imgs/eye2.jpg
  9. 3 2
      src/components/Legend/src/legend.vue
  10. 73 49
      src/components/Rotation/src/rotation.vue
  11. 12 5
      src/components/editLengend.vue
  12. 25 26
      src/components/floorList.vue
  13. 1 1
      src/components/floorMap/canvasFun.vue
  14. 4 3
      src/components/floorMap/index.vue
  15. 1 1
      src/components/viewLengend.vue
  16. 0 86
      src/lib/items/HighlightItem.js
  17. 0 196
      src/lib/items/SFHFQZoneLegendItem.js
  18. 114 94
      src/lib/items/SFHFQZoneLegendItem.ts
  19. 0 155
      src/lib/items/SImageLegendItem.js
  20. 4 0
      src/lib/items/SImageLegendItem.ts
  21. 0 57
      src/lib/items/SImageMarkerItem.js
  22. 4 0
      src/lib/items/SImageMarkerItem.ts
  23. 0 47
      src/lib/items/SLineLegendItem.js
  24. 4 0
      src/lib/items/SLineLegendItem.ts
  25. 0 121
      src/lib/items/SLineMarkerItem.js
  26. 60 50
      src/lib/items/SLineMarkerItem.ts
  27. 0 22
      src/lib/items/SNoneLegendItem.js
  28. 0 203
      src/lib/items/SSCPZZoneLegendItem.js
  29. 115 94
      src/lib/items/SSCPZZoneLegendItem.ts
  30. 0 59
      src/lib/items/STextMarkerItem.js
  31. 4 0
      src/lib/items/STextMarkerItem.ts
  32. 0 197
      src/lib/items/SZoneLegendItem.js
  33. 116 97
      src/lib/items/SZoneLegendItem.ts
  34. 0 190
      src/lib/items/TipelineItem.js
  35. 159 153
      src/lib/items/TipelineItem.ts
  36. 30 1
      src/router/index.js
  37. 12 4
      src/store/index.js
  38. 22 4
      src/views/equipment/eqDialog.vue
  39. 6 1
      src/views/equipment/fenbuPic.vue
  40. 64 6
      src/views/equipment/index.vue
  41. 2 2
      src/views/equipment/table/djspTable.vue
  42. 2 2
      src/views/equipment/table/eqDetaileDialog.vue
  43. 3 3
      src/views/equipment/table/eqListTable.vue
  44. 1 1
      src/views/equipment/table/lookPageTable.vue
  45. 1 1
      src/views/equipment/table/otherTable.vue
  46. 3 3
      src/views/equipment/table/standTable.vue
  47. 13 5
      src/views/equipment/table/tjTable.vue
  48. 1 1
      src/views/equipment/table/wbTable.vue
  49. 2 2
      src/views/equipment/table/wxTable.vue
  50. 9 1
      src/views/equipment/table/zwTable.vue
  51. 4 4
      src/views/legendLibrary/index.vue
  52. 1 1
      src/views/legendRules/addList.vue
  53. 1 1
      src/views/other/gcfz2.vue
  54. 9 1
      src/views/other/zhsxOtherTable1.vue
  55. 10 2
      src/views/other/zhsxOtherTable2.vue
  56. 34 20
      src/views/overview/index.vue
  57. 6 6
      src/views/room/detail.vue
  58. 50 39
      src/views/room/index.vue
  59. 1 1
      src/views/room/room1.vue
  60. 162 152
      src/views/statistics/index.vue
  61. 206 0
      src/views/table/index.vue

+ 4 - 4
package.json

@@ -10,10 +10,10 @@
     "dependencies": {
         "@mapbox/geojson-merge": "^1.1.1",
         "@saga-web/base": "2.1.22",
-        "@saga-web/big": "1.0.79",
-        "@saga-web/draw": "2.1.100",
-        "@saga-web/feng-map": "1.0.23",
-        "@saga-web/graph": "2.1.108",
+        "@saga-web/big": "1.0.81",
+        "@saga-web/draw": "2.1.101",
+        "@saga-web/feng-map": "1.0.24",
+        "@saga-web/graph": "2.1.109",
         "ant-design-vue": "^1.4.10",
         "axios": "^0.19.2",
         "core-js": "^3.4.4",

+ 11 - 2
src/App.vue

@@ -7,6 +7,7 @@
 <script>
 import { mapGetters, mapActions, mapMutations } from 'vuex'
 import { SFengParser } from '@saga-web/feng-map'
+import {setFloor} from "@/api/public.js"
 window.fengmapData = null
 export default {
     data() {
@@ -39,7 +40,6 @@ export default {
     mounted() {
         this.isMounted = true
         this.plazaIds = localStorage.getItem('PLAZAID')
-        console.log(this.plazaIds)
     },
     computed: {
         ...mapGetters(['plazaId', 'fmapID', 'haveFengMap', 'accessLevel'])
@@ -61,11 +61,20 @@ export default {
                 null,
                 this.mapthemeUrl
             )
-            window.fengmapData.loadMap(this.fmapID, () => {
+            window.fengmapData.loadMap(this.fmapID, (a,b) => {
+               const dataArr = b.map(item=>{
+                    return item.gname
+                });
                 // 获取主题数据
                 window.fengmapData.loadTheme(`${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`).then(res => {
                     this.SETHAVEFENGMAP()
                 })
+                // 缓存楼层数据
+                setFloor({plazaId:this.plazaIds},dataArr).then((res)=>{
+                    console.log('缓存楼层',res)
+                }).catch((error)=>{
+                    console.log('缓存楼层',error)
+                })
             })
         }
     },

+ 8 - 0
src/api/public.js

@@ -49,3 +49,11 @@ export function queryDraftNum(data) {
 export function queryBrand({ data, postParams }) {
     return httputils.fetchJson(`/data/tb_brand_intentiondetail/query`, data, postParams)
 }
+//记录PV/UV
+export function getPvUv(data){
+    return httputils.postJson(`/data/pvuv/save`, data)
+}
+// 保存楼层缓存
+export function setFloor( data, postParams ){
+    return httputils.fetchJson(`/data/plaza/floor/set`, data,postParams)
+}

+ 6 - 0
src/assets/css/rotation.css

@@ -185,11 +185,17 @@
   justify-content: flex-start;
 }
 .overview .view-box .view-left .lb-bottom .place-bottom .place-box .place-right span {
+  cursor: pointer;
   display: inline-block;
   font-size: 12px;
   font-family: MicrosoftYaHei;
   color: #1f2429;
   line-height: 22px;
+  width: 300px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  -o-text-overflow: ellipsis;
 }
 .overview .view-box .view-right {
   flex: 1;

+ 6 - 0
src/assets/css/rotation.less

@@ -183,11 +183,17 @@
                             flex-direction: column;
                             justify-content: flex-start;
                             span {
+                                cursor: pointer;
                                 display: inline-block;
                                 font-size: 12px;
                                 font-family: MicrosoftYaHei;
                                 color: rgba(31, 36, 41, 1);
                                 line-height: 22px;
+                                width: 300px;
+                                overflow: hidden;
+                                white-space: nowrap;
+                                text-overflow: ellipsis;
+                                -o-text-overflow: ellipsis;
                             }
                         }
                     }

BIN
src/assets/imgs/2020.png


BIN
src/assets/imgs/20200.png


BIN
src/assets/imgs/eye2.jpg


+ 3 - 2
src/components/Legend/src/legend.vue

@@ -147,7 +147,7 @@ export default {
         floors: {
             //原理图中有数据楼层
             default: () => {
-                ;[]
+                []
             },
             type: Array
         },
@@ -487,11 +487,12 @@ export default {
         queryRemarksMethods() {},
         init() {
             // 图例
+            bus.$off('queryViewMethods') //解决触发多次监听
             bus.$on('queryViewMethods', () => {
-                // console.log('queryViewMethods')
                 this.queryView(false)
             })
             // 备注
+            bus.$off('queryRemarksMethods')
             bus.$on('queryRemarksMethods', res => {
                 let remarksText = ''
                 if (res) {

+ 73 - 49
src/components/Rotation/src/rotation.vue

@@ -4,29 +4,50 @@
 *@info:图片轮播
 */
 <template>
-    <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'
-                alt
-            />-->
+    <div :class='[type==1?"rotationFull":(type==3?"rotationFullYlt":"rotation")]' class='wanda-rotation'>
+        <div v-if='rotationImg.length==1&&size=="width"' class='rotationConType'>
             <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' @change='changePic' :loop='false'>
+        <div v-else-if='rotationImg.length==1&&size=="height"' class='rotationCon'>
+            <img :src='rotationImg[0].url' alt />
+        </div>
+        <!-- <el-carousel v-else trigger='click' style='height:100%;width:100%' :interval='5000' arrow='always' @change='changePic' :loop='false'>
             <el-carousel-item v-for='(item,index) in rotationImg' :key='index'>
                 <img :src='item.url' alt />
             </el-carousel-item>
+        </el-carousel>-->
+        <el-carousel v-else 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 style='  width: 100%; height: 100%;object-fit: cover;' />
+            </el-carousel-item>
         </el-carousel>
     </div>
 </template>s
 <script>
 export default {
     name: 'Rotation',
-    props: ['rotationImg', 'type'],
+    props: ['rotationImg', 'type', 'size'],
     data() {
         return {
-            rotationImgs: [{ url: require('@/assets/images/login_back.png') }]
+            rotationImgs: [{ url: require('@/assets/images/login_back.png') }],
+            fileList: [
+                {
+                    name: 'food.jpeg',
+                    url: require('@/assets/imgs/2020.png')
+                },
+                {
+                    name: 'food2.jpeg',
+                    url: require('@/assets/imgs/20200.png')
+                },
+                {
+                    name: 'food.jpeg',
+                    url: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg'
+                },
+                {
+                    name: 'food2.jpeg',
+                    url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
+                }
+            ]
         }
     },
     methods: {
@@ -40,10 +61,41 @@ export default {
         if (this.type == 2) {
             this.changePic(1)
         }
+        console.log(this.rotationImg, this.size)
     }
 }
 </script>
 <style lang="less" scoped>
+.wanda-rotation {
+    height: 100%;
+    /deep/ .el-carousel__button {
+        background-color: rgba(2, 91, 170, 1);
+    }
+    /deep/ .el-carousel__arrow {
+        background-color: #00000050;
+    }
+    /deep/ .el-carousel__container {
+        height: 100%;
+    }
+    // .rotationConType {
+    //     height: 100%;
+    //     width: 100%;
+    //     overflow: auto;
+    // }
+    /deep/ .el-carousel__item {
+        text-align: center;
+        background: #fff;
+    }
+    img {
+        width: 100%;
+        // height: 100%;
+        // object-fit: fill;
+        // min-width: 100%;
+        // width: 100%;
+        // min-height: 100%;
+    }
+}
+
 .rotation {
     width: 100%;
     height: 100%;
@@ -55,13 +107,8 @@ export default {
         height: 100%;
         width: 100%;
         text-align: center;
-        // display: flex;
     }
     img {
-        // max-width: 100%;
-        // max-height: 100%;
-        // display: block;
-        // margin: auto;
         width: 100%;
         height: 100%;
         object-fit: cover;
@@ -84,7 +131,6 @@ export default {
         max-height: 100%;
         display: block;
         margin: auto;
-        // min-width: 100%;
     }
 }
 .rotationFullYlt {
@@ -94,11 +140,10 @@ export default {
     display: flex;
     justify-content: center;
     align-items: center;
-    // 轮播图适配
     /deep/ .el-carousel__container {
         height: 100% !important;
     }
-    .rotationCon {
+    .rotationConType {
         height: 100%;
         width: 100%;
         overflow: auto;
@@ -108,40 +153,19 @@ export default {
         background: #fff;
     }
     img {
-        // width: 100%;
         height: 100%;
-        // object-fit: fill;
-        // min-width: 100%;
-        // width: 100%;
-        // min-height: 100%;
-    }
-}
-</style>
-<style lang="less">
-.rotation,
-.rotationFull {
-    .el-carousel__item h3 {
-        color: #475669;
-        font-size: 14px;
-        opacity: 0.75;
-        margin: 0;
-    }
-
-    .el-carousel__item:nth-child(2n) {
-        background-color: #99a9bf;
     }
-
-    .el-carousel__item:nth-child(2n + 1) {
-        background-color: #d3dce6;
+    .rotationCon {
+        height: 100%;
+        width: 100%;
+        overflow: auto;
     }
-    .el-carousel__container {
-        height: 100% !important;
+    /deep/ .el-carousel__item {
+        text-align: center;
+        background: #fff;
     }
-    .el-carousel__button {
-        height: 3px;
-        width: 16px;
-        border-radius: 2px;
-        opacity: 0.5;
+    img {
+        width: 100%;
     }
 }
-</style>
+</style>

+ 12 - 5
src/components/editLengend.vue

@@ -31,17 +31,17 @@
                                             :content='`当前图例 ${row.Name} 与平面图中的不一致,平面图中为${row.RealNum}`'
                                             placement='top'
                                         >
-                                            <el-input @change='changeTable(row)' v-model='row.Num' size='mini'></el-input>
+                                            <el-input @keyup.enter.native='changeTable(row)' v-model='row.Num' size='mini'></el-input>
                                         </el-tooltip>
                                     </div>
                                     <div v-else-if='row.Num==null||row.RealNum==null'>
-                                        <el-input @change='changeTable(row)' v-model='row.Num' size='mini'></el-input>
+                                        <el-input @keyup.enter.native='changeTable(row)' v-model='row.Num' size='mini'></el-input>
                                     </div>
                                     <div v-else-if='!row.Num' class='nullData'>
-                                        <el-input @change='changeTable(row)' v-model='row.Num' size='mini'></el-input>
+                                        <el-input @keyup.enter.native='changeTable(row)' v-model='row.Num' size='mini'></el-input>
                                     </div>
                                     <div v-else style='width:50px'>
-                                        <el-input @change='changeTable(row)' v-model='row.Num' size='mini'></el-input>
+                                        <el-input @keyup.enter.native='changeTable(row)' v-model='row.Num' size='mini'></el-input>
                                     </div>
                                 </div>
 
@@ -105,11 +105,12 @@
                     </el-table>
                 </div>-->
             </div>
-
+            <div class='lengend-text'>广场上没有的图例数量填写为0</div>
             <div class='swich'>
                 <el-switch v-model='value' @change='changeSwitch'></el-switch>
                 <span>隐藏数量为0的项目</span>
             </div>
+
             <div class='legendFoot'>
                 <el-button size='mini' @click='cancel'>取消</el-button>
                 <el-button size='mini' v-if='editNum.length==0' type='primary' disabled style='opacity: 0.5'>保存</el-button>
@@ -308,6 +309,12 @@ export default {
             margin: 0 auto;
         }
     }
+    .lengend-text {
+        font-size: 12px;
+        color: red;
+        padding-left: 16px;
+        margin-top: -50px;
+    }
     .legendFoot {
         position: absolute;
         right: 16px;

+ 25 - 26
src/components/floorList.vue

@@ -8,13 +8,10 @@
         <div class='floor-list'>
             <div class='icon-top' v-if='floorsArr.length>showNumber'>
                 <!-- @click='changeFloor(1,currIndex)' -->
-                <!-- @mousedown='mousedown' -->
-                <!-- @mouseup='mouseup' -->
-                <!-- v-repeat-click='increase' -->
-                <img v-if='parseInt(marginTop) !== 0' v-repeat-click='increase' src='@/assets/imgs/iconBlackTop.png' alt />
-                <img class='disabled' v-else src='@/assets/imgs/iconLightTop.png' alt />
+                <img v-show='parseInt(marginTop) !== 0' v-repeat-click='increase' src='@/assets/imgs/iconBlackTop.png' alt />
+                <img class='disabled' v-show='parseInt(marginTop) === 0' src='@/assets/imgs/iconLightTop.png' alt />
             </div>
-            <div class='floor-out'>
+            <div class='floor-out' :style='{ maxHeight:conHeight + "px",height:conHeight + "px" }'>
                 <!--  放开marginTop样式  -->
                 <div class='floor-center' :style='{ marginTop : marginTop }'>
                     <div
@@ -28,8 +25,8 @@
             </div>
             <div class='icon-bottom' v-if='floorsArr.length>showNumber'>
                 <!-- v-repeat-click='decrease' -->
-                <img v-if='parseInt(marginTop) !== marginTopMax' v-repeat-click='decrease' src='@/assets/imgs/iconBlackBottom.png' alt />
-                <img class='disabled' v-else src='@/assets/imgs/iconLightBottom.png' alt />
+                <img v-show='parseInt(marginTop) !== marginTopMax' v-repeat-click='decrease' src='@/assets/imgs/iconBlackBottom.png' alt />
+                <img class='disabled' v-show='parseInt(marginTop) === marginTopMax' src='@/assets/imgs/iconLightBottom.png' alt />
             </div>
         </div>
     </div>
@@ -62,9 +59,10 @@ export default {
             marginTopMax: 0,
             startTime: '',
             endTime: '',
-            showNumber: 8, //需要暂时的楼层数   //TODO:
-            height: 32, //一个楼层的高度
-            currIndex: 0 //当前楼层在 楼层数组中的下标,上下箭头使用
+            showNumber: 8, //需要展示的楼层数   //TODO:
+            height: 39, //一个楼层的高度
+            currIndex: 0, //当前楼层在 楼层数组中的下标,上下箭头使用
+            conHeight: 0 // floor-out 的高度
         }
     },
     props: {
@@ -83,24 +81,19 @@ export default {
         this.init()
     },
     methods: {
-        mousedown() {
-            this.startTime = new Date()
-        },
-        mouseup() {
-            this.endTime = new Date()
-            if (this.endTime - this.startTime < 200) {
-                console.log(11111111)
-                this.changeFloor(1, this.currIndex)
-                return false
-            }
-        },
+        /**
+         * @description 点击上箭头,marginTop<0时执行楼层滚动
+         */
         increase() {
-            console.log('increase')
+            // console.log('increase')
             let marginTop = parseInt(this.marginTop)
             marginTop < 0 && this.changeFloor(1, this.currIndex)
         },
+        /**
+         * @description 点击下箭头,marginTop小于最大值marginTopMax时,执行楼层滚动
+         */
         decrease() {
-            console.log('decrease')
+            // console.log('decrease')
             let marginTop = Math.abs(parseInt(this.marginTop)),
                 marginTopMax = Math.abs(parseInt(this.marginTopMax))
             marginTop < marginTopMax && this.changeFloor(-1, this.currIndex)
@@ -121,6 +114,11 @@ export default {
             if (index === -1) {
                 this.currentFloorId = this.floorIdArr[0]
             }
+            // 修复在设备设施页面中,楼层组件不够 8个楼层时,出现的样式问题,
+            this.conHeight = this.floorsArr.length * 37.5
+            this.conHeight = this.conHeight >= 300 ? 300 : this.conHeight
+            this.showNumber = this.floorsArr.length > 8 ? 8 : this.floorsArr.length
+
             this.marginTopMax = -(this.floorIdArr.length - this.showNumber) * this.height
             this.changeFloor(0, index)
         },
@@ -130,7 +128,7 @@ export default {
          * @description 点击图例下方的,上下切换按钮
          */
         changeFloor(flag, index) {
-            console.log('changeFloor')
+            // console.log('changeFloor')
             const len = this.floorIdArr.length
             // let index = this.floorIdArr.findIndex(item => item === this.currentFloorId)
             this.currIndex = index
@@ -239,7 +237,8 @@ export default {
         padding: 6px 4px;
         text-align: center;
         .floor-out {
-            height: 300px; //TODO:
+            // max-height: 300px; //TODO:
+            min-height: 38px;
             overflow: hidden;
             position: relative;
             overflow-y: auto;

+ 1 - 1
src/components/floorMap/canvasFun.vue

@@ -24,7 +24,7 @@
             </div>
             <div class='small-block' @click='fitToWindow'>
                 <i>
-                    <img src='../../assets/imgs/qp.png' alt />
+                    <img src='../../assets/imgs/eye2.jpg' alt />
                 </i>
             </div>
             <div class='small-size' @click='reduce'>

+ 4 - 3
src/components/floorMap/index.vue

@@ -104,12 +104,13 @@ export default {
                         this.fParser.parseData(res)
                         this.fParser.spaceList.forEach(t => {
                             this.scene.addItem(t)
-                            t.nameSize = 14
+                            t.nameSize = 12
                             t.nameColor = '#646A73'
                             if (t.data.Name && this.bunkObj[t.data.Name]) {
                                 t.name = this.bunkObj[t.data.Name].brandname
                             } else {
-                                t.name = t.data.Name
+                                // t.name = t.data.Name
+                                t.name = ''
                             }
                         })
                         this.fParser.wallList.forEach(t => this.scene.addItem(t))
@@ -228,7 +229,7 @@ export default {
                         selectItem1.data.GraphElementId != '100129'
                     ) {
                         if (location) {
-                            this.$refs.boxRoom.open({ name: name, type: this.type, location: location })
+                            this.$refs.boxRoom.open({ name: selectItem1.name, type: this.type, location: location })
                         }
                     }
                 }

+ 1 - 1
src/components/viewLengend.vue

@@ -39,7 +39,7 @@
                 <el-table-column prop='Name' :show-overflow-tooltip='true' label='项目' width='100'>
                     <template slot-scope='{row}'>{{row.Name||'--'}}</template>
                 </el-table-column>
-                <el-table-column prop='Num' label='数量'>
+                <el-table-column prop='Num' label='数量' align='right'>
                     <template slot-scope='{row}'>
                         <span v-if='row.Num || row.Num==0'>{{row.Num}}</span>
                         <span v-else-if='row.Num==null'></span>

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

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

+ 0 - 196
src/lib/items/SFHFQZoneLegendItem.js

@@ -1,196 +0,0 @@
-import { SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
-/**
- *图例节点Item(区域类型 --防火分区)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SFHFQZoneLegendItem extends SPolygonItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent)
-        /** text item   */
-        this.textItem = new STextItem(this)
-        /** 是否显示文字  */
-        this._showText = true
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
-        if (data) {
-            this.setPointList = []
-            let setPointList
-            if (data.OutLine) {
-                if (data.OutLine[0] instanceof SPoint) {
-                    this.setPointList = data.OutLine
-                } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
-                    })
-                    this.setPointList = setPointList
-                }
-            }
-            // 设置线宽
-            if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
-            }
-            if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
-            }
-            if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
-            }
-            if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
-            }
-            if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
-            }
-            if (data.Properties.font) {
-                this.font = new SFont('sans-serif', data.Properties.font)
-            }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
-        }
-        // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
-            // 计算文本位置
-            let x = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
-                y = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
-        })
-    }
-    get text() {
-        return this.textItem.text
-    }
-    set text(v) {
-        this.textItem.text = v
-        this.update()
-    }
-    get color() {
-        return this.textItem.color
-    }
-    set color(v) {
-        this.textItem.color = v
-    }
-    get font() {
-        return this.textItem.font
-    }
-    set font(v) {
-        this.textItem.font = v
-    }
-    get status() {
-        return this._status
-    }
-    // 编辑当前状态
-    set status(value) {
-        this._status = value
-        // 如果状态为show则需清栈
-        if (value == SItemStatus.Normal) {
-            // 切换显示状态显示文本
-            this.showText = true
-            // 切换显示状态不可移动文本
-            this.textItem.moveable = false
-            if (this.undoStack) {
-                this.undoStack.clear()
-            }
-        } else if (value == SItemStatus.Edit) {
-            // 切换编辑状态显示文本
-            this.showText = true
-            // 切换编辑状态可移动文本
-            this.textItem.moveable = true
-        } else if (value == SItemStatus.Create) {
-            // 切换创建状态不显示文本
-            this.showText = false
-            // 切换创建状态不可移动文本
-            this.textItem.moveable = false
-        }
-        this.update()
-    }
-    get showText() {
-        return this._showText
-    }
-    set showText(v) {
-        if (v === this._showText) {
-            return
-        }
-        this._showText = v
-        if (v) {
-            this.textItem.show()
-        } else {
-            this.textItem.hide()
-        }
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y }
-        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
-        this.data.OutLine = this.getPointList.map((pos) => {
-            return {
-                X: pos.x,
-                Y: pos.y,
-            }
-        })
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y }
-        this.data.Properties.font = this.font.size
-        this.data.Properties.color = this.color.value
-        return this.data
-    }
-    onDraw(painter) {
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            let brushcolor = new SColor(this.fillColor)
-            brushcolor.alpha = brushcolor.alpha / 2
-            painter.pen.color = color
-            painter.pen.lineCapStyle = SLineCapStyle.Square
-            painter.pen.lineWidth = painter.toPx(this._lineWidth)
-            painter.brush.color = brushcolor
-
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            // @ts-ignore
-            painter.drawPolygon([...this.pointList])
-        } else {
-            super.onDraw(painter)
-        }
-    }
-} // Class SZoneLegendItem

+ 114 - 94
src/lib/items/SFHFQZoneLegendItem.ts

@@ -1,9 +1,9 @@
-import { SGraphItem, SLineStyle } from '@saga-web/graph/lib'
-import { Legend } from '../types/Legend'
-import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
+import { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
+import { Legend } from '../types/Legend';
+import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
+import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until"
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
 /**
  *图例节点Item(区域类型 --防火分区)
  *
@@ -11,23 +11,23 @@ import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
  */
 export class SFHFQZoneLegendItem extends SPolygonItem {
     /** 图例节点对象数据 */
-    data: Legend
+    data: Legend;
 
     /** text item   */
-    textItem: STextItem = new STextItem(this)
+    textItem: STextItem = new STextItem(this);
 
     get text(): string {
-        return this.textItem.text
+        return this.textItem.text;
     }
     set text(v: string) {
-        this.textItem.text = v
-        this.update()
+        this.textItem.text = v;
+        this.update();
     }
     get color(): SColor {
-        return this.textItem.color
+        return this.textItem.color;
     }
     set color(v: SColor) {
-        this.textItem.color = v
+        this.textItem.color = v;
     }
     get font(): SFont {
         return this.textItem.font
@@ -37,62 +37,77 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
     }
 
     get status(): SItemStatus {
-        return this._status
+        return this._status;
     }
     // 编辑当前状态
     set status(value: SItemStatus) {
-        this._status = value
+        this._status = value;
         // 如果状态为show则需清栈
         if (value == SItemStatus.Normal) {
             // 切换显示状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换显示状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
 
             if (this.undoStack) {
-                this.undoStack.clear()
+                this.undoStack.clear();
             }
         } else if (value == SItemStatus.Edit) {
             // 切换编辑状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换编辑状态可移动文本
-            this.textItem.moveable = true
+            this.textItem.moveable = true;
         } else if (value == SItemStatus.Create) {
             // 切换创建状态不显示文本
-            this.showText = false
+            this.showText = false;
             // 切换创建状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
         }
-        this.update()
-    }
+        this.update();
+    };
+
+    /** 是否激活  */
+    _isActive: boolean = false;
+    get isActive(): boolean {
+        return this._isActive;
+    } // Get isActive
+    set isActive(v: boolean) {
+        this._isActive = v;
+        if (v) {
+            this.cursor = "pointer";
+        } else {
+            this.cursor = "auto";
+        }
+        this.update();
+    } // Set isActive
 
     /** 是否显示文字  */
-    _showText: boolean = true
+    _showText: boolean = true;
     get showText(): boolean {
-        return this._showText
+        return this._showText;
     }
     set showText(v: boolean) {
         if (v === this._showText) {
             return
         }
-        this._showText = v
+        this._showText = v;
         if (v) {
-            this.textItem.show()
+            this.textItem.show();
         } else {
-            this.textItem.hide()
+            this.textItem.hide();
         }
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
+    _maskFlag: boolean = false;
     get maskFlag(): boolean {
-        return this._maskFlag
+        return this._maskFlag;
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
             return
         }
-        this._maskFlag = v
+        this._maskFlag = v;
         this.update()
     }
 
@@ -103,105 +118,112 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent)
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
+        super(parent);
+        this.textItem.isTransform = false;
+        this.zOrder = ItemOrder.polygonOrder;
+        this.data = data;
+        this.id = data.ID;
+        this.name = data.Name;
+        this.text = data.Name;
         if (data) {
-            this.setPointList = []
-            let setPointList: SPoint[]
+            this.setPointList = [];
+            let setPointList: SPoint[];
             if (data.OutLine) {
                 if (data.OutLine[0] instanceof SPoint) {
-                    this.setPointList = data.OutLine
+                    this.setPointList = data.OutLine;
                 } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
+                    setPointList = data.OutLine.map(i => {
+                        return (new SPoint(i.X, i.Y))
                     })
-                    this.setPointList = setPointList
+                    this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
+                this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
             }
             if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
+                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor));
             }
             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.color) {
-                this.color = new SColor(data.Properties.color)
+                this.color = new SColor(data.Properties.color);
             }
             if (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.IsActive) {
+                this.isActive = data.Properties.IsActive;
+            }
+            if (data.AttachObjectIds && data.AttachObjectIds.length) {
+                this.isActive = true;
             }
             switch (data.Properties.LineDash) {
-                case 'solid':
-                    this.lineStyle = SLineStyle.Solid
-                    break
-                case 'dotted':
-                    this.lineStyle = SLineStyle.Dotted
-                    break
-                case 'dashed':
-                    this.lineStyle = SLineStyle.Dashed
-                    break
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
                 default:
-                    this.lineStyle = SLineStyle.Solid
+                    this.lineStyle = SLineStyle.Solid;
             }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
+        this.connect("finishCreated", this, () => {
             // 计算文本位置
             let x: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
+                return pre + (cur.x / arr.length)
+            }, 0),
                 y: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
+                    return pre + (cur.y / arr.length)
+                }, 0);
+            this.textItem.moveTo(x, y);
         })
     }
 
     toData(): any {
-        this.data.Pos = { X: this.x, Y: this.y }
-        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
+        this.data.Pos = { X: this.x, Y: this.y };
+        this.data.Name = this.name;
+        this.data.Properties.Zorder = this.zOrder;
+        this.data.Properties.FillColor = this.fillColor.value;
+        this.data.Properties.StrokeColor = this.strokeColor.value;
+        this.data.Properties.LineWidth = this.lineWidth;
         switch (this.lineStyle) {
             case SLineStyle.Solid:
-                this.data.Properties.LineDash = 'solid'
-                break
+                this.data.Properties.LineDash = "solid";
+                break;
             case SLineStyle.Dotted:
-                this.data.Properties.LineDash = 'dotted'
-                break
+                this.data.Properties.LineDash = "dotted";
+                break;
             case SLineStyle.Dashed:
-                this.data.Properties.LineDash = 'dashed'
-                break
+                this.data.Properties.LineDash = "dashed";
+                break;
             default:
-                this.data.Properties.LineDash = 'solid'
+                this.data.Properties.LineDash = "solid";
         }
-        this.data.OutLine = this.getPointList.map((pos) => {
+        this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,
-                Y: pos.y,
+                Y: pos.y
             }
-        })
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y }
-        this.data.Properties.font = this.font.size
-        this.data.Properties.color = this.color.value
-        return this.data
+        });
+        this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
+        this.data.Properties.font =  this.font.size;
+        this.data.Properties.color =  this.color.value;
+        this.data.Properties.IsActive = this.isActive;
+        return this.data;
     }
 
     onDraw(painter: SPainter) {
@@ -214,7 +236,6 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
             painter.pen.lineCapStyle = SLineCapStyle.Square
             painter.pen.lineWidth = painter.toPx(this._lineWidth)
             painter.brush.color = brushcolor
-
             if (this.selected) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;
@@ -222,11 +243,10 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
             }
-
             // @ts-ignore
-            painter.drawPolygon([...this.pointList])
+            painter.drawPolygon([...this.pointList]);
         } else {
-            super.onDraw(painter)
+            super.onDraw(painter);
         }
     }
 } // Class SZoneLegendItem

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

@@ -1,155 +0,0 @@
-import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
-import { ItemOrder, SItemStatus } from '@saga-web/big/lib';
-import { SFont, SColor } from '@saga-web/draw/lib';
-/**
- * 图例节点Item(图标类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SImageLegendItem extends SIconTextItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent, data.AnchorList);
-        /** 图例数量 */
-        this._num = 1;
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false;
-        this.isTransform = false;
-        this.zOrder = ItemOrder.markOrder;
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.text = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
-        if (data.Num) {
-            this.num = data.Num;
-        }
-        if (data.Size) {
-            this.width = data.Size.Width;
-            this.height = data.Size.Height;
-        }
-        if (data.Properties && data.Properties.Url) {
-            this.img.url = data.Properties.Url;
-        }
-        if (data.Properties && data.Properties.sWidth) {
-            this.sWidth = data.Properties.sWidth;
-        }
-        if (data.Properties && data.Properties.sHeight) {
-            this.sHeight = data.Properties.sHeight;
-        }
-        if (data.Properties.ImgPos) {
-            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
-        }
-        if (data.Properties && data.Properties.font) {
-            this.font = new SFont("sans-serif", data.Properties.font);
-        }
-        if (data.Properties.TextPos) {
-            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
-        }
-        else {
-            // 偏移二分之一文本高度
-            this.textItem.moveTo((this.img.width * 0.5), -(this.font.size * 1.25 * 0.5));
-        }
-        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;
-    }
-    set num(v) {
-        if (v) {
-            this._num = v;
-            this.data.Num = v;
-        }
-        else {
-            this._num = 1;
-            this.data.Num = 1;
-        }
-        this.data.Properties.Num = this._num;
-        this.textItem.text = `${this.name}${this.num > 1 ? `×${this.num}` : ''}`;
-        this.update();
-    }
-    get text() {
-        return this.textItem.text;
-    }
-    set text(v) {
-        this.name = v;
-        this.data.Name = v;
-        this.textItem.text = `${this.name}${this.num > 1 ? `×${this.num}` : ''}`;
-        this.update();
-    }
-    get maskFlag() {
-        return this._maskFlag;
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return;
-        }
-        this._maskFlag = v;
-        if (v) {
-            this.textItem.visible = false;
-        }
-        else {
-            this.textItem.visible = true;
-        }
-        this.update();
-    }
-    toData() {
-        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
-                }
-            };
-        });
-        return this.data;
-    }
-    /**
-     * Item绘制框架
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    onPaint(painter, rect) {
-        super.onPaint(painter, rect);
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            painter.pen.color = SColor.Transparent;
-            painter.brush.color = new SColor("#ffffffa1");
-            if (this.selected) {
-                painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0) * 1.25);
-            }
-            else {
-                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
-            }
-        }
-    } // Function onPaint()
-} // Class SImageLegendItem

+ 4 - 0
src/lib/items/SImageLegendItem.ts

@@ -79,6 +79,9 @@ export class SImageLegendItem extends SIconTextItem {
             this.width = data.Size.Width;
             this.height = data.Size.Height;
         }
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
@@ -118,6 +121,7 @@ export class SImageLegendItem extends SIconTextItem {
         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.Zorder = this.zOrder;
         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 };

File diff suppressed because it is too large
+ 0 - 57
src/lib/items/SImageMarkerItem.js


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

@@ -33,6 +33,9 @@ export class SImageMarkerItem extends SImageItem {
             this.width = data.Size.Width;
             this.height = data.Size.Height;
         }
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Url) {
             this.url = data.Properties.Url;
         }
@@ -57,6 +60,7 @@ export class SImageMarkerItem extends SImageItem {
     toData(): Marker {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Size = {Width: this.width, Height: this.height};
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.Url = this.url;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineWidth = this.lineWidth;

+ 0 - 47
src/lib/items/SLineLegendItem.js

@@ -1,47 +0,0 @@
-import { SPoint } from "@saga-web/draw/lib";
-import { SPolylineItem } from '@saga-web/big/lib';
-/**
- * 图例节点Item(线类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SLineLegendItem extends SPolylineItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent, []);
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
-        if (data.Properties && data.Properties.Line) {
-            let setPointList;
-            setPointList = data.Properties.Line.map(i => {
-                return new SPoint(i.x, i.y);
-            });
-            this.pointList = setPointList;
-        }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth;
-        }
-        if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = data.Properties.StrokeColor;
-        }
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y };
-        this.data.Properties.Line = this.pointList.map(pos => {
-            return {
-                X: pos.x,
-                Y: pos.y
-            };
-        });
-        this.data.Properties.LineWidth = this.lineWidth;
-        this.data.Properties.StrokeColor = this.strokeColor;
-        return this.data;
-    }
-} // Class SLineLegendItem

+ 4 - 0
src/lib/items/SLineLegendItem.ts

@@ -25,6 +25,9 @@ export class SLineLegendItem extends SPolylineItem {
         this.id = data.ID;
         this.name = data.Name;
         this.moveTo(data.Pos.X, data.Pos.Y);
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Line) {
             let setPointList: SPoint[];
             setPointList = data.Properties.Line.map(i => {
@@ -48,6 +51,7 @@ export class SLineLegendItem extends SPolylineItem {
                 Y: pos.y
             }
         });
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.LineWidth = this.lineWidth;
         this.data.Properties.StrokeColor = this.strokeColor;
         return this.data;

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

@@ -1,121 +0,0 @@
-import { SLineStyle } from '@saga-web/graph/lib'
-import { SPoint, SColor } from '@saga-web/draw/lib'
-import { ItemOrder, SLineItem, SItemStatus } from '@saga-web/big/lib'
-/**
- * 标识对象Item(线类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SLineMarkerItem extends SLineItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      标识对象数据
-     */
-    constructor(parent, data) {
-        super(parent)
-        /** 起始锚点  */
-        this.startItem = null
-        /** 结束锚点  */
-        this.endItem = null
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        this.zOrder = ItemOrder.lineOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.moveTo(data.Pos.X, data.Pos.Y)
-        if (data.Properties && data.Properties.Line) {
-            let setPointList
-            setPointList = data.Properties.Line.map((i) => {
-                return new SPoint(i.X, i.Y)
-            })
-            this.line = setPointList
-        }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth
-        }
-        if (data.Properties && data.Properties.LineStyle) {
-            this.lineStyle = data.Properties.LineStyle
-        }
-        if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = new SColor(data.Properties.StrokeColor)
-        }
-    } // Constructor
-    /** 是否完成绘制  */
-    get status() {
-        return this._status
-    }
-    set status(v) {
-        this._status = v
-        if (v == SItemStatus.Edit) {
-            this.zOrder = ItemOrder.markOrder
-        } else {
-            this.zOrder = ItemOrder.lineOrder
-        }
-        this.update()
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    /** 接收事件作出修改  */
-    changePos() {
-        if (this.startItem) {
-            // 判断删除equip后,不移动
-            if (this.startItem.parent) {
-                let scenePoint = this.startItem.boundingRect().center()
-                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y)
-            }
-        }
-        if (this.endItem) {
-            // 删除equip后
-            if (this.endItem.parent) {
-                let scenePoint = this.endItem.boundingRect().center()
-                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y)
-            }
-        }
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Properties.Line = this.line.map((pos) => {
-            return {
-                X: pos.x,
-                Y: pos.y,
-            }
-        })
-        this.data.Properties.LineWidth = this.lineWidth
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineStyle = this.lineStyle
-        if (this.startItem && this.startItem.parent) {
-            this.data.Properties.StartItemId = this.startItem.id
-        }
-        if (this.endItem && this.endItem.parent) {
-            this.data.Properties.EndItemId = this.endItem.id
-        }
-        return this.data
-    }
-    onDraw(painter) {
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            painter.pen.color = new SColor(this.strokeColor)
-            if (this.lineStyle == SLineStyle.Dashed) {
-                painter.pen.lineDash = [painter.toPx(this.lineWidth * 3), painter.toPx(this.lineWidth * 7)]
-            } else if (this.lineStyle == SLineStyle.Dotted) {
-                painter.pen.lineDash = [painter.toPx(this.lineWidth), painter.toPx(this.lineWidth)]
-            }
-            painter.drawLine(this.line[0], this.line[1])
-        } else {
-            this.selected = true
-            super.onDraw(painter)
-        }
-    }
-} // Class SLineMarkerItem

+ 60 - 50
src/lib/items/SLineMarkerItem.ts

@@ -1,7 +1,7 @@
-import { SGraphItem, SLineStyle } from '@saga-web/graph/lib'
-import { SPoint, SPainter, SColor, SLineCapStyle } from '@saga-web/draw/lib'
-import { ItemOrder, SLineItem, SItemStatus } from '@saga-web/big/lib'
-import { Marker } from '../types/Marker'
+import { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
+import { SPoint, SPainter, SColor, SLineCapStyle } from "@saga-web/draw/lib";
+import { ItemOrder, SLineItem, SItemStatus } from '@saga-web/big/lib';
+import { Marker } from '../types/Marker';
 
 /**
  * 标识对象Item(线类型)
@@ -10,37 +10,37 @@ import { Marker } from '../types/Marker'
  */
 export class SLineMarkerItem extends SLineItem {
     /** 起始锚点  */
-    startItem: SGraphItem | null = null
+    startItem: SGraphItem | null = null;
     /** 结束锚点  */
-    endItem: SGraphItem | null = null
+    endItem: SGraphItem | null = null;
 
     /** 标识对象数据 */
-    data: Marker
+    data: Marker;
 
     /** 是否完成绘制  */
     get status(): SItemStatus {
-        return this._status
+        return this._status;
     }
     set status(v: SItemStatus) {
-        this._status = v
+        this._status = v;
         if (v == SItemStatus.Edit) {
-            this.zOrder = ItemOrder.markOrder
+            this.zOrder = ItemOrder.markOrder;
         } else {
-            this.zOrder = ItemOrder.lineOrder
+            this.zOrder = ItemOrder.lineOrder;
         }
-        this.update()
+        this.update();
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
+    _maskFlag: boolean = false;
     get maskFlag(): boolean {
-        return this._maskFlag
+        return this._maskFlag;
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
             return
         }
-        this._maskFlag = v
+        this._maskFlag = v;
         this.update()
     }
 
@@ -51,27 +51,30 @@ export class SLineMarkerItem extends SLineItem {
      * @param data      标识对象数据
      */
     constructor(parent: SGraphItem | null, data: Marker) {
-        super(parent)
-        this.zOrder = ItemOrder.lineOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.moveTo(data.Pos.X, data.Pos.Y)
+        super(parent);
+        this.zOrder = ItemOrder.lineOrder;
+        this.data = data;
+        this.id = data.ID;
+        this.name = data.Name;
+        this.moveTo(data.Pos.X, data.Pos.Y);
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Line) {
-            let setPointList: SPoint[]
-            setPointList = data.Properties.Line.map((i) => {
+            let setPointList: SPoint[];
+            setPointList = data.Properties.Line.map(i => {
                 return new SPoint(i.X, i.Y)
             })
-            this.line = setPointList
+            this.line = setPointList;
         }
         if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth
+            this.lineWidth = data.Properties.LineWidth;
         }
         if (data.Properties && data.Properties.LineStyle) {
-            this.lineStyle = data.Properties.LineStyle
+            this.lineStyle = data.Properties.LineStyle;
         }
         if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = new SColor(data.Properties.StrokeColor)
+            this.strokeColor = new SColor(data.Properties.StrokeColor);
         }
     } // Constructor
 
@@ -80,53 +83,60 @@ export class SLineMarkerItem extends SLineItem {
         if (this.startItem) {
             // 判断删除equip后,不移动
             if (this.startItem.parent) {
-                let scenePoint: SPoint = this.startItem.boundingRect().center()
-                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y)
+                let scenePoint: SPoint = this.startItem.boundingRect().center();
+                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
             }
         }
         if (this.endItem) {
             // 删除equip后
             if (this.endItem.parent) {
-                let scenePoint: SPoint = this.endItem.boundingRect().center()
-                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y)
+                let scenePoint: SPoint = this.endItem.boundingRect().center();
+                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
             }
         }
     }
 
     toData(): Marker {
-        this.data.Pos = { X: this.x, Y: this.y }
-        this.data.Properties.Line = this.line.map((pos) => {
+        this.data.Pos = { X: this.x, Y: this.y };
+        this.data.Properties.Line = this.line.map(pos => {
             return {
                 X: pos.x,
-                Y: pos.y,
+                Y: pos.y
             }
-        })
-        this.data.Properties.LineWidth = this.lineWidth
-        this.data.Properties.StrokeColor = this.strokeColor.value
-        this.data.Properties.LineStyle = this.lineStyle
+        });
+        this.data.Properties.Zorder = this.zOrder;
+        this.data.Properties.LineWidth = this.lineWidth;
+        this.data.Properties.StrokeColor = this.strokeColor.value;
+        this.data.Properties.LineStyle = this.lineStyle;
         if (this.startItem && this.startItem.parent) {
-            this.data.Properties.StartItemId = this.startItem.id
+            this.data.Properties.StartItemId = this.startItem.id;
         }
         if (this.endItem && this.endItem.parent) {
-            this.data.Properties.EndItemId = this.endItem.id
+            this.data.Properties.EndItemId = this.endItem.id;
         }
-        return this.data
+        return this.data;
     }
 
     onDraw(painter: SPainter) {
         if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            painter.pen.color = new SColor(this.strokeColor)
+            let color = new SColor(this.strokeColor);
+            color.alpha = 100;
+            painter.pen.color = new SColor(this.strokeColor);
             if (this.lineStyle == SLineStyle.Dashed) {
-                painter.pen.lineDash = [painter.toPx(this.lineWidth * 3), painter.toPx(this.lineWidth * 7)]
-            } else if (this.lineStyle == SLineStyle.Dotted) {
-                painter.pen.lineDash = [painter.toPx(this.lineWidth), painter.toPx(this.lineWidth)]
+                painter.pen.lineDash = [
+                    painter.toPx(this.lineWidth * 3),
+                    painter.toPx(this.lineWidth * 7)
+                ];
+            }
+            else if (this.lineStyle == SLineStyle.Dotted) {
+                painter.pen.lineDash = [
+                    painter.toPx(this.lineWidth),
+                    painter.toPx(this.lineWidth)
+                ];
             }
-            painter.drawLine(this.line[0], this.line[1])
+            painter.drawLine(this.line[0], this.line[1]);
         } else {
-            this.selected = true
-            super.onDraw(painter)
+            super.onDraw(painter);
         }
     }
 } // Class SLineMarkerItem

+ 0 - 22
src/lib/items/SNoneLegendItem.js

@@ -1,22 +0,0 @@
-import { SGraphItem } from "@saga-web/graph/lib";
-/**
- * 图例节点Item(非图例类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SNoneLegendItem extends SGraphItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent);
-        this.data = data;
-        this.id = data.ID;
-    }
-    toData() {
-        return this.data;
-    }
-} // Class SNoneLegendItem

+ 0 - 203
src/lib/items/SSCPZZoneLegendItem.js

@@ -1,203 +0,0 @@
-import { SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
-/**
- * 图例节点Item(区域类型 --石材铺装)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SSCPZZoneLegendItem extends SPolygonItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent)
-        /** text item   */
-        this.textItem = new STextItem(this)
-        /** 是否显示文字  */
-        this._showText = true
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
-        if (data) {
-            this.setPointList = []
-            let setPointList
-            if (data.OutLine) {
-                if (data.OutLine[0] instanceof SPoint) {
-                    this.setPointList = data.OutLine
-                } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
-                    })
-                    this.setPointList = setPointList
-                }
-            }
-            // 设置线宽
-            if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
-            }
-            if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
-            }
-            if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
-            }
-            if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
-            }
-            if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
-            }
-            if (data.Properties.font) {
-                this.font = new SFont('sans-serif', data.Properties.font)
-            }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
-        }
-        // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
-            // 计算文本位置
-            let x = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
-                y = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
-        })
-    }
-    get text() {
-        return this.textItem.text
-    }
-    set text(v) {
-        this.textItem.text = v
-        this.update()
-    }
-    get color() {
-        return this.textItem.color
-    }
-    set color(v) {
-        this.textItem.color = v
-    }
-    get font() {
-        return this.textItem.font
-    }
-    set font(v) {
-        this.textItem.font = v
-    }
-    get status() {
-        return this._status
-    }
-    // 编辑当前状态
-    set status(value) {
-        this._status = value
-        // 如果状态为show则需清栈
-        if (value == SItemStatus.Normal) {
-            // 切换显示状态显示文本
-            this.showText = true
-            // 切换显示状态不可移动文本
-            this.textItem.moveable = false
-            if (this.undoStack) {
-                this.undoStack.clear()
-            }
-        } else if (value == SItemStatus.Edit) {
-            // 切换编辑状态显示文本
-            this.showText = true
-            // 切换编辑状态可移动文本
-            this.textItem.moveable = true
-        } else if (value == SItemStatus.Create) {
-            // 切换创建状态不显示文本
-            this.showText = false
-            // 切换创建状态不可移动文本
-            this.textItem.moveable = false
-        }
-        this.update()
-    }
-    get showText() {
-        return this._showText
-    }
-    set showText(v) {
-        if (v === this._showText) {
-            return
-        }
-        this._showText = v
-        if (v) {
-            this.textItem.show()
-        } else {
-            this.textItem.hide()
-        }
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    /** 图例说明  */
-    set itemExplain(v) {
-        this.data.Properties.ItemExplain = v
-    }
-    get itemExplain() {
-        return this.data.Properties.ItemExplain
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y }
-        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
-        this.data.OutLine = this.getPointList.map((pos) => {
-            return {
-                X: pos.x,
-                Y: pos.y,
-            }
-        })
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y }
-        this.data.Properties.font = this.font.size
-        this.data.Properties.color = this.color.value
-        return this.data
-    }
-    onDraw(painter) {
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            let brushcolor = new SColor(this.fillColor)
-            brushcolor.alpha = brushcolor.alpha / 2
-            painter.pen.color = color
-            painter.pen.lineCapStyle = SLineCapStyle.Square
-            painter.pen.lineWidth = painter.toPx(this._lineWidth)
-            painter.brush.color = brushcolor
-
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            // @ts-ignore
-            painter.drawPolygon([...this.pointList])
-        } else {
-            super.onDraw(painter)
-        }
-    }
-} // Class SZoneLegendItem

+ 115 - 94
src/lib/items/SSCPZZoneLegendItem.ts

@@ -1,9 +1,10 @@
-import { SGraphItem, SLineStyle } from '@saga-web/graph/lib'
-import { Legend } from '../types/Legend'
-import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
+
+import { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
+import { Legend } from '../types/Legend';
+import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
+import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until"
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *
@@ -11,23 +12,23 @@ import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
  */
 export class SSCPZZoneLegendItem extends SPolygonItem {
     /** 图例节点对象数据 */
-    data: Legend
+    data: Legend;
 
     /** text item   */
-    textItem: STextItem = new STextItem(this)
+    textItem: STextItem = new STextItem(this);
 
     get text(): string {
-        return this.textItem.text
+        return this.textItem.text;
     }
     set text(v: string) {
-        this.textItem.text = v
-        this.update()
+        this.textItem.text = v;
+        this.update();
     }
     get color(): SColor {
-        return this.textItem.color
+        return this.textItem.color;
     }
     set color(v: SColor) {
-        this.textItem.color = v
+        this.textItem.color = v;
     }
     get font(): SFont {
         return this.textItem.font
@@ -37,62 +38,77 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
     }
 
     get status(): SItemStatus {
-        return this._status
+        return this._status;
     }
     // 编辑当前状态
     set status(value: SItemStatus) {
-        this._status = value
+        this._status = value;
         // 如果状态为show则需清栈
         if (value == SItemStatus.Normal) {
             // 切换显示状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换显示状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
 
             if (this.undoStack) {
-                this.undoStack.clear()
+                this.undoStack.clear();
             }
         } else if (value == SItemStatus.Edit) {
             // 切换编辑状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换编辑状态可移动文本
-            this.textItem.moveable = true
+            this.textItem.moveable = true;
         } else if (value == SItemStatus.Create) {
             // 切换创建状态不显示文本
-            this.showText = false
+            this.showText = false;
             // 切换创建状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
         }
-        this.update()
-    }
+        this.update();
+    };
+
+    /** 是否激活  */
+    _isActive: boolean = false;
+    get isActive(): boolean {
+        return this._isActive;
+    } // Get isActive
+    set isActive(v: boolean) {
+        this._isActive = v;
+        if (v) {
+            this.cursor = "pointer";
+        } else {
+            this.cursor = "auto";
+        }
+        this.update();
+    } // Set isActive
 
     /** 是否显示文字  */
-    _showText: boolean = true
+    _showText: boolean = true;
     get showText(): boolean {
-        return this._showText
+        return this._showText;
     }
     set showText(v: boolean) {
         if (v === this._showText) {
             return
         }
-        this._showText = v
+        this._showText = v;
         if (v) {
-            this.textItem.show()
+            this.textItem.show();
         } else {
-            this.textItem.hide()
+            this.textItem.hide();
         }
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
+    _maskFlag: boolean = false;
     get maskFlag(): boolean {
-        return this._maskFlag
+        return this._maskFlag;
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
             return
         }
-        this._maskFlag = v
+        this._maskFlag = v;
         this.update()
     }
 
@@ -111,105 +127,112 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent)
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
+        super(parent);
+        this.textItem.isTransform = false;
+        this.zOrder = ItemOrder.polygonOrder;
+        this.data = data;
+        this.id = data.ID;
+        this.name = data.Name;
+        this.text = data.Name;
         if (data) {
-            this.setPointList = []
-            let setPointList: SPoint[]
+            this.setPointList = [];
+            let setPointList: SPoint[];
             if (data.OutLine) {
                 if (data.OutLine[0] instanceof SPoint) {
-                    this.setPointList = data.OutLine
+                    this.setPointList = data.OutLine;
                 } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
+                    setPointList = data.OutLine.map(i => {
+                        return (new SPoint(i.X, i.Y))
                     })
-                    this.setPointList = setPointList
+                    this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
+                this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
             }
             if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
+                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor))
             }
             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.color) {
-                this.color = new SColor(data.Properties.color)
+                this.color = new SColor(data.Properties.color);
             }
             if (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.IsActive) {
+                this.isActive = data.Properties.IsActive;
+            }
+            if (data.AttachObjectIds && data.AttachObjectIds.length) {
+                this.isActive = true;
             }
             switch (data.Properties.LineDash) {
-                case 'solid':
-                    this.lineStyle = SLineStyle.Solid
-                    break
-                case 'dotted':
-                    this.lineStyle = SLineStyle.Dotted
-                    break
-                case 'dashed':
-                    this.lineStyle = SLineStyle.Dashed
-                    break
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
                 default:
-                    this.lineStyle = SLineStyle.Solid
+                    this.lineStyle = SLineStyle.Solid;
             }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
+        this.connect("finishCreated", this, () => {
             // 计算文本位置
             let x: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
+                return pre + (cur.x / arr.length)
+            }, 0),
                 y: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
+                    return pre + (cur.y / arr.length)
+                }, 0);
+            this.textItem.moveTo(x, y);
         })
     }
 
     toData(): any {
-        this.data.Pos = { X: this.x, Y: this.y }
-        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
+        this.data.Pos = { X: this.x, Y: this.y };
+        this.data.Name = this.name;
+        this.data.Properties.Zorder = this.zOrder;
+        this.data.Properties.FillColor = this.fillColor.value;
+        this.data.Properties.StrokeColor = this.strokeColor.value;
+        this.data.Properties.LineWidth = this.lineWidth;
         switch (this.lineStyle) {
             case SLineStyle.Solid:
-                this.data.Properties.LineDash = 'solid'
-                break
+                this.data.Properties.LineDash = "solid";
+                break;
             case SLineStyle.Dotted:
-                this.data.Properties.LineDash = 'dotted'
-                break
+                this.data.Properties.LineDash = "dotted";
+                break;
             case SLineStyle.Dashed:
-                this.data.Properties.LineDash = 'dashed'
-                break
+                this.data.Properties.LineDash = "dashed";
+                break;
             default:
-                this.data.Properties.LineDash = 'solid'
+                this.data.Properties.LineDash = "solid";
         }
-        this.data.OutLine = this.getPointList.map((pos) => {
+        this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,
-                Y: pos.y,
+                Y: pos.y
             }
-        })
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y }
-        this.data.Properties.font = this.font.size
-        this.data.Properties.color = this.color.value
-        return this.data
+        });
+        this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
+        this.data.Properties.font =  this.font.size;
+        this.data.Properties.color =  this.color.value;
+        this.data.Properties.IsActive = this.isActive;
+        return this.data;
     }
 
     onDraw(painter: SPainter) {
@@ -222,7 +245,6 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
             painter.pen.lineCapStyle = SLineCapStyle.Square
             painter.pen.lineWidth = painter.toPx(this._lineWidth)
             painter.brush.color = brushcolor
-
             if (this.selected) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;
@@ -230,11 +252,10 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
             }
-
             // @ts-ignore
-            painter.drawPolygon([...this.pointList])
+            painter.drawPolygon([...this.pointList]);
         } else {
-            super.onDraw(painter)
+            super.onDraw(painter);
         }
     }
 } // Class SZoneLegendItem

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

@@ -1,59 +0,0 @@
-import { STextItem } from "@saga-web/graph/lib";
-import { SColor, SFont, SPoint } from "@saga-web/draw";
-import { ItemOrder } from '@saga-web/big/lib';
-/**
- * 标识对象Item(文本类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class STextMarkerItem extends STextItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      标识对象数据
-     */
-    constructor(parent, data) {
-        super(parent);
-        this.zOrder = ItemOrder.textOrder;
-        this.isTransform = false;
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
-        if (data.Size) {
-            this.width = data.Size.Width;
-            this.height = data.Size.Height;
-        }
-        if (data.Properties && data.Properties.Text) {
-            this.text = data.Properties.Text;
-        }
-        if (data.Properties && data.Properties.Color) {
-            this.color = new SColor(data.Properties.Color);
-        }
-        if (data.Properties && data.Properties.Font) {
-            this.font = new SFont("sans-serif", data.Properties.Font);
-            ;
-        }
-        if (data.Properties && data.Properties.BackgroundColor) {
-            this.backgroundColor = new SColor(data.Properties.BackgroundColor);
-        }
-    } // Constructor
-    /**
-     * 根据换行切割文本,绘制多行并计算外轮廓宽高
-     *
-     */
-    drawFormatText() {
-        super.drawFormatText();
-        this.origin = new SPoint(this.width / 2, this.height / 2);
-    } // Function drawFormatText()
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y };
-        this.data.Size = { Width: this.width, Height: this.height };
-        this.data.Properties.Text = this.text;
-        this.data.Properties.Color = this.color.value;
-        this.data.Properties.Font = this.font.size;
-        this.data.Properties.BackgroundColor = this.backgroundColor.value;
-        return this.data;
-    }
-} // Class STextMarkerItem

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

@@ -30,6 +30,9 @@ export class STextMarkerItem extends STextItem {
             this.width = data.Size.Width;
             this.height = data.Size.Height;
         }
+        if (data.Properties.Zorder) {
+            this.zOrder = data.Properties.Zorder;
+        }
         if (data.Properties && data.Properties.Text) {
             this.text = data.Properties.Text;
         }
@@ -56,6 +59,7 @@ export class STextMarkerItem extends STextItem {
     toData(): Marker {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Size = {Width: this.width, Height: this.height};
+        this.data.Properties.Zorder = this.zOrder;
         this.data.Properties.Text = this.text;
         this.data.Properties.Color = this.color.value;
         this.data.Properties.Font = this.font.size;

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

@@ -1,197 +0,0 @@
-import { SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
-/**
- * 图例节点Item(区域类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SZoneLegendItem extends SPolygonItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent)
-        /** text item   */
-        this.textItem = new STextItem(this)
-        /** 是否显示文字  */
-        this._showText = true
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
-        if (data) {
-            this.setPointList = []
-            let setPointList
-            if (data.OutLine) {
-                if (data.OutLine[0] instanceof SPoint) {
-                    // @ts-ignore
-                    this.setPointList = data.OutLine
-                } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
-                    })
-                    this.setPointList = setPointList
-                }
-            }
-            // 设置线宽
-            if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
-            }
-            if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
-            }
-            if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
-            }
-            if (data.Properties.TextPos) {
-                this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
-            }
-            if (data.Properties.color) {
-                this.color = new SColor(data.Properties.color)
-            }
-            if (data.Properties.font) {
-                this.font = new SFont('sans-serif', data.Properties.font)
-            }
-            //    if( data.Properties.LineDash){
-            //     this.LineDash =this._legend.Properties.LineDash
-            //    }
-        }
-        // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
-            // 计算文本位置
-            let x = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
-                y = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
-        })
-    }
-    get text() {
-        return this.textItem.text
-    }
-    set text(v) {
-        this.textItem.text = v
-        this.update()
-    }
-    get color() {
-        return this.textItem.color
-    }
-    set color(v) {
-        this.textItem.color = v
-    }
-    get font() {
-        return this.textItem.font
-    }
-    set font(v) {
-        this.textItem.font = v
-    }
-    get status() {
-        return this._status
-    }
-    // 编辑当前状态
-    set status(value) {
-        this._status = value
-        // 如果状态为show则需清栈
-        if (value == SItemStatus.Normal) {
-            // 切换显示状态显示文本
-            this.showText = true
-            // 切换显示状态不可移动文本
-            this.textItem.moveable = false
-            if (this.undoStack) {
-                this.undoStack.clear()
-            }
-        } else if (value == SItemStatus.Edit) {
-            // 切换编辑状态显示文本
-            this.showText = true
-            // 切换编辑状态可移动文本
-            this.textItem.moveable = true
-        } else if (value == SItemStatus.Create) {
-            // 切换创建状态不显示文本
-            this.showText = false
-            // 切换创建状态不可移动文本
-            this.textItem.moveable = false
-        }
-        this.update()
-    }
-    get showText() {
-        return this._showText
-    }
-    set showText(v) {
-        if (v === this._showText) {
-            return
-        }
-        this._showText = v
-        if (v) {
-            this.textItem.show()
-        } else {
-            this.textItem.hide()
-        }
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y }
-        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
-        this.data.OutLine = this.getPointList.map((pos) => {
-            return {
-                X: pos.x,
-                Y: pos.y,
-            }
-        })
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y }
-        this.data.Properties.font = this.font.size
-        this.data.Properties.color = this.color.value
-        return this.data
-    }
-    onDraw(painter) {
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            let color = new SColor(this.strokeColor)
-            color.alpha = color.alpha / 2
-            let brushcolor = new SColor(this.fillColor)
-            brushcolor.alpha = brushcolor.alpha / 2
-            painter.pen.color = color
-            painter.pen.lineCapStyle = SLineCapStyle.Square
-            painter.pen.lineWidth = painter.toPx(this._lineWidth)
-            painter.brush.color = brushcolor
-
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            // @ts-ignore
-            painter.drawPolygon([...this.pointList])
-        } else {
-            super.onDraw(painter)
-        }
-    }
-} // Class SZoneLegendItem

+ 116 - 97
src/lib/items/SZoneLegendItem.ts

@@ -1,10 +1,9 @@
-import { SGraphItem, SLineStyle } from '@saga-web/graph/lib'
-import { Legend } from '../types/Legend'
-import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from '@saga-web/draw'
-import { STextItem } from '@saga-web/graph/lib'
-import { hexify } from '@/components/mapClass/until'
-import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib'
-import { SMouseEvent } from '@saga-web/base/lib'
+import { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
+import { Legend } from '../types/Legend';
+import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
+import { STextItem } from '@saga-web/graph/lib';
+import { hexify } from "@/components/mapClass/until"
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
 /**
  * 图例节点Item(区域类型)
  *
@@ -12,88 +11,103 @@ import { SMouseEvent } from '@saga-web/base/lib'
  */
 export class SZoneLegendItem extends SPolygonItem {
     /** 图例节点对象数据 */
-    data: Legend
+    data: Legend;
 
     /** text item   */
-    textItem: STextItem = new STextItem(this)
+    textItem: STextItem = new STextItem(this);
 
     get text(): string {
-        return this.textItem.text
+        return this.textItem.text;
     }
     set text(v: string) {
-        this.textItem.text = v
-        this.update()
+        this.textItem.text = v;
+        this.update();
     }
     get color(): SColor {
-        return this.textItem.color
+        return this.textItem.color;
     }
     set color(v: SColor) {
-        this.textItem.color = v
+        this.textItem.color = v;
     }
     get font(): SFont {
-        return this.textItem.font
+        return this.textItem.font;
     }
     set font(v: SFont) {
-        this.textItem.font = v
+        this.textItem.font = v;
     }
 
     get status(): SItemStatus {
-        return this._status
+        return this._status;
     }
     // 编辑当前状态
     set status(value: SItemStatus) {
-        this._status = value
+        this._status = value;
         // 如果状态为show则需清栈
         if (value == SItemStatus.Normal) {
             // 切换显示状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换显示状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
 
             if (this.undoStack) {
-                this.undoStack.clear()
+                this.undoStack.clear();
             }
         } else if (value == SItemStatus.Edit) {
             // 切换编辑状态显示文本
-            this.showText = true
+            this.showText = true;
             // 切换编辑状态可移动文本
-            this.textItem.moveable = true
+            this.textItem.moveable = true;
         } else if (value == SItemStatus.Create) {
             // 切换创建状态不显示文本
-            this.showText = false
+            this.showText = false;
             // 切换创建状态不可移动文本
-            this.textItem.moveable = false
+            this.textItem.moveable = false;
         }
-        this.update()
-    }
+        this.update();
+    };
+
+    /** 是否激活  */
+    _isActive: boolean = false;
+    get isActive(): boolean {
+        return this._isActive;
+    } // Get isActive
+    set isActive(v: boolean) {
+        this._isActive = v;
+        if (v) {
+            this.cursor = "pointer";
+        } else {
+            this.cursor = "auto";
+        }
+        this.update();
+    } // Set isActive
 
     /** 是否显示文字  */
-    _showText: boolean = true
+    _showText: boolean = true;
     get showText(): boolean {
-        return this._showText
+        return this._showText;
     }
     set showText(v: boolean) {
         if (v === this._showText) {
             return
         }
-        this._showText = v
+        this._showText = v;
         if (v) {
-            this.textItem.show()
+            this.textItem.show();
         } else {
-            this.textItem.hide()
+            this.textItem.hide();
         }
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
+    _maskFlag: boolean = false;
     get maskFlag(): boolean {
-        return this._maskFlag
+        return this._maskFlag;
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
             return
         }
-        this._maskFlag = v
+        this._maskFlag = v;
         this.update()
     }
 
@@ -104,106 +118,113 @@ export class SZoneLegendItem extends SPolygonItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent)
-        this.textItem.isTransform = false
-        this.zOrder = ItemOrder.polygonOrder
-        this.data = data
-        this.id = data.ID
-        this.name = data.Name
-        this.text = data.Name
+        super(parent);
+        this.textItem.isTransform = false;
+        this.zOrder = ItemOrder.polygonOrder;
+        this.data = data;
+        this.id = data.ID;
+        this.name = data.Name;
+        this.text = data.Name;
         if (data) {
-            this.setPointList = []
-            let setPointList: SPoint[]
+            this.setPointList = [];
+            let setPointList: SPoint[];
             if (data.OutLine) {
                 if (data.OutLine[0] instanceof SPoint) {
                     // @ts-ignore
-                    this.setPointList = data.OutLine
+                    this.setPointList = data.OutLine;
                 } else {
-                    setPointList = data.OutLine.map((i) => {
-                        return new SPoint(i.X, i.Y)
+                    setPointList = data.OutLine.map(i => {
+                        return (new SPoint(i.X, i.Y))
                     })
-                    this.setPointList = setPointList
+                    this.setPointList = setPointList;
                 }
             }
+            if (data.Properties.Zorder) {
+                this.zOrder = data.Properties.Zorder;
+            }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
-                this.strokeColor = data.Properties.StrokeColor.includes('#')
-                    ? new SColor(data.Properties.StrokeColor)
-                    : new SColor(hexify(data.Properties.StrokeColor))
+                this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
             }
             if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#')
-                    ? new SColor(data.Properties.FillColor)
-                    : new SColor(hexify(data.Properties.FillColor))
+                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor))
             }
             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.color) {
-                this.color = new SColor(data.Properties.color)
+                this.color = new SColor(data.Properties.color);
             }
             if (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.IsActive) {
+                this.isActive = data.Properties.IsActive;
+            }
+            if (data.AttachObjectIds && data.AttachObjectIds.length) {
+                this.isActive = true;
             }
             switch (data.Properties.LineDash) {
-                case 'solid':
-                    this.lineStyle = SLineStyle.Solid
-                    break
-                case 'dotted':
-                    this.lineStyle = SLineStyle.Dotted
-                    break
-                case 'dashed':
-                    this.lineStyle = SLineStyle.Dashed
-                    break
+                case "solid":
+                    this.lineStyle = SLineStyle.Solid;
+                    break;
+                case "dotted":
+                    this.lineStyle = SLineStyle.Dotted;
+                    break;
+                case "dashed":
+                    this.lineStyle = SLineStyle.Dashed;
+                    break;
                 default:
-                    this.lineStyle = SLineStyle.Solid
+                    this.lineStyle = SLineStyle.Solid;
             }
         }
         // 监听多边形创建完成事件,并动态计算文本位置
-        this.connect('finishCreated', this, () => {
+        this.connect("finishCreated", this, () => {
             // 计算文本位置
             let x: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.x / arr.length
-                }, 0),
+                return pre + (cur.x / arr.length)
+            }, 0),
                 y: number = this.getPointList.reduce((pre, cur, index, arr) => {
-                    return pre + cur.y / arr.length
-                }, 0)
-            this.textItem.moveTo(x, y)
+                    return pre + (cur.y / arr.length)
+                }, 0);
+            this.textItem.moveTo(x, y);
         })
     }
 
     toData(): any {
-        this.data.Pos = { X: this.x, Y: this.y }
-        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
+        this.data.Pos = { X: this.x, Y: this.y };
+        this.data.Name = this.name;
+        this.data.Properties.Zorder = this.zOrder;
+        this.data.Properties.FillColor = this.fillColor.value;
+        this.data.Properties.StrokeColor = this.strokeColor.value;
+        this.data.Properties.LineWidth = this.lineWidth;
         switch (this.lineStyle) {
             case SLineStyle.Solid:
-                this.data.Properties.LineDash = 'solid'
-                break
+                this.data.Properties.LineDash = "solid";
+                break;
             case SLineStyle.Dotted:
-                this.data.Properties.LineDash = 'dotted'
-                break
+                this.data.Properties.LineDash = "dotted";
+                break;
             case SLineStyle.Dashed:
-                this.data.Properties.LineDash = 'dashed'
-                break
+                this.data.Properties.LineDash = "dashed";
+                break;
             default:
-                this.data.Properties.LineDash = 'solid'
+                this.data.Properties.LineDash = "solid";
         }
-        this.data.OutLine = this.getPointList.map((pos) => {
+        this.data.OutLine = this.getPointList.map(pos => {
             return {
                 X: pos.x,
-                Y: pos.y,
+                Y: pos.y
             }
-        })
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y }
-        this.data.Properties.font = this.font.size
-        this.data.Properties.color = this.color.value
-        return this.data
+        });
+        this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
+        this.data.Properties.font =  this.font.size;
+        this.data.Properties.color =  this.color.value;
+        this.data.Properties.IsActive = this.isActive;
+        return this.data;
     }
 
     onDraw(painter: SPainter) {
@@ -216,7 +237,6 @@ export class SZoneLegendItem extends SPolygonItem {
             painter.pen.lineCapStyle = SLineCapStyle.Square
             painter.pen.lineWidth = painter.toPx(this._lineWidth)
             painter.brush.color = brushcolor
-
             if (this.selected) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;
@@ -224,11 +244,10 @@ export class SZoneLegendItem extends SPolygonItem {
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
             }
-            
             // @ts-ignore
-            painter.drawPolygon([...this.pointList])
+            painter.drawPolygon([...this.pointList]);
         } else {
-            super.onDraw(painter)
+            super.onDraw(painter);
         }
     }
 } // Class SZoneLegendItem

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

@@ -1,190 +0,0 @@
-import { SPolylineItem, ItemOrder, SItemStatus } from '@saga-web/big/lib'
-import { SColor } from '@saga-web/draw'
-import { SPoint } from '@saga-web/draw/lib'
-/**
- * 管道item
- *
- * */
-export class TipelineItem extends SPolylineItem {
-    constructor(parent, data) {
-        super(parent, [])
-        /** 起始锚点  */
-        this.startAnchor = null
-        /** 结束锚点  */
-        this.endAnchor = null
-        /** 对应的图例ID  */
-        this._graphElementId = ''
-        /** 关联节点1ID  */
-        this._node1Id = ''
-        /** 关联节点2ID  */
-        this._node2Id = ''
-        /** 关联锚点1ID  */
-        this._anchor1ID = ''
-        /** 关联锚点2ID  */
-        this._anchor2ID = ''
-        /** 是否蒙版遮罩  */
-        this._maskFlag = false
-        /** 数据存储  */
-        this.data = null
-        this.zOrder = ItemOrder.polylineOrder
-        this.pointList = data.PointList.map((item) => {
-            return new SPoint(item.X, item.Y)
-        })
-        this.data = data
-        this.name = data.Name
-        this.id = data.ID
-        if (data.GraphElementId) {
-            this._graphElementId = data.GraphElementId
-        }
-        if (data.Node1ID) {
-            this._node1Id = data.Node1ID
-        }
-        if (data.Node2ID) {
-            this._node2Id = data.Node2ID
-        }
-        if (data.Anchor1ID) {
-            this._anchor1ID = data.Anchor1ID
-        }
-        if (data.Anchor2ID) {
-            this._anchor2ID = data.Anchor2ID
-        }
-        if (data.Properties && data.Properties.Color) {
-            this.strokeColor = new SColor(data.Properties.Color)
-        }
-        // if(data.Properties && data.Properties.LineDash){
-        //   this.LineDash = data.Properties.LineDash
-        // }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth
-        }
-    }
-    get graphElementId() {
-        return this._graphElementId
-    }
-    set graphElementId(v) {
-        this._graphElementId = v
-        if (this.data) {
-            this.data.GraphElementId = this._graphElementId
-        }
-    }
-    get node1Id() {
-        return this._node1Id
-    }
-    set node1Id(v) {
-        this._node1Id = v
-        if (this.data) {
-            this.data.Node1ID = this._node1Id
-        }
-    }
-    get node2Id() {
-        return this._node2Id
-    }
-    set node2Id(v) {
-        this._node2Id = v
-        if (this.data) {
-            this.data.Node2ID = this._node2Id
-        }
-    }
-    get anchor1ID() {
-        return this._anchor1ID
-    }
-    set anchor1ID(v) {
-        this._anchor1ID = v
-        if (this.data) {
-            this.data.Anchor1ID = this._anchor1ID
-        }
-    }
-    get anchor2ID() {
-        return this._anchor2ID
-    }
-    set anchor2ID(v) {
-        this._anchor2ID = v
-        if (this.data) {
-            this.data.Anchor2ID = this._anchor2ID
-        }
-    }
-    get maskFlag() {
-        return this._maskFlag
-    }
-    set maskFlag(v) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
-    }
-    /** 接收事件作出修改  */
-    changePos() {
-        if (this.startAnchor) {
-            // 判断删除equip后,不移动
-            if (this.startAnchor.parent && this.startAnchor.parent.parent) {
-                this.pointList[0] = this.startAnchor.mapToScene(0, 0)
-            }
-        }
-        if (this.endAnchor) {
-            // 删除equip后
-            if (this.endAnchor.parent && this.endAnchor.parent.parent) {
-                this.pointList[this.pointList.length - 1] = this.endAnchor.mapToScene(0, 0)
-            }
-        }
-    }
-    /** 获取data数据  */
-    toData() {
-        let pointList = this.pointList.map((item) => {
-            return {
-                X: item.x,
-                Y: item.y,
-            }
-        })
-        if (this.data) {
-            this.data.Name = this.name;
-            this.data.PointList = pointList
-            this.data.Properties.LineWidth = this.lineWidth
-            // this.data.Properties.LineDash = this.LineDash;
-            this.data.Properties.Color = this.strokeColor.value
-        }
-        return this.data
-    }
-   // onDraw(painter: SPainter) {
-    //     if (this.maskFlag && this.status == SItemStatus.Normal) {
-    //         let color = new SColor(this.strokeColor)
-    //         color.alpha = color.alpha / 8
-    //         painter.pen.color = color
-
-    //         if (this.selected) {
-    //             painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-    //             painter.shadow.shadowBlur = 10;
-    //             painter.shadow.shadowColor = new SColor(`#00000033`);
-    //             painter.shadow.shadowOffsetX = 5;
-    //             painter.shadow.shadowOffsetY = 5;
-    //         } else {
-    //             painter.pen.lineWidth = painter.toPx(this.lineWidth);
-    //             painter.shadow.shadowColor = SColor.Transparent
-    //         }
-    //         painter.drawPolyline(this.pointList)
-
-    //         painter.pen.color = new SColor('#ffffff80')
-    //         painter.drawPolyline(this.pointList)
-    //     } else {
-    //         super.onDraw(painter)
-    //     }
-    // }
-    /**
-     * Item绘制框架
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    onPaint(painter, rect) {
-        super.onPaint(painter, rect);
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-            } else {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth);
-            }
-            painter.pen.color = new SColor('#ffffff80')
-            painter.drawPolyline(this.pointList)
-        }
-    } // Function onPaint()
-}

+ 159 - 153
src/lib/items/TipelineItem.ts

@@ -1,161 +1,167 @@
-import { SPolylineItem, ItemOrder, SItemStatus } from '@saga-web/big/lib'
-import { SPainter, SColor, SRect } from '@saga-web/draw'
-import { SAnchorItem, SGraphItem } from '@saga-web/graph/lib'
-import { Relation } from '../types/Relation'
-import { SPoint } from '@saga-web/draw/lib'
-import { Point } from '@saga-web/big/lib/types/Point'
+import { SPolylineItem, ItemOrder, SItemStatus } from '@saga-web/big/lib';
+import { SPainter, SColor, SRect } from '@saga-web/draw';
+import { SAnchorItem, SGraphItem } from '@saga-web/graph/lib';
+import { Relation } from '../types/Relation';
+import { SPoint } from "@saga-web/draw/lib";
+import { Point } from "@saga-web/big/lib/types/Point";
 
 /**
  * 管道item
  *
  * */
 export class TipelineItem extends SPolylineItem {
-    /** 起始锚点  */
-    startAnchor: SAnchorItem | null = null
-    /** 结束锚点  */
-    endAnchor: SAnchorItem | null = null
-    /** 对应的图例ID  */
-    _graphElementId: string = ''
-    get graphElementId(): string {
-        return this._graphElementId
-    }
-    set graphElementId(v: string) {
-        this._graphElementId = v
-        if (this.data) {
-            this.data.GraphElementId = this._graphElementId
-        }
-    }
-    /** 关联节点1ID  */
-    _node1Id: string = ''
-    get node1Id(): string {
-        return this._node1Id
-    }
-    set node1Id(v: string) {
-        this._node1Id = v
-        if (this.data) {
-            this.data.Node1ID = this._node1Id
-        }
-    }
-    /** 关联节点2ID  */
-    _node2Id: string = ''
-    get node2Id(): string {
-        return this._node2Id
-    }
-    set node2Id(v: string) {
-        this._node2Id = v
-        if (this.data) {
-            this.data.Node2ID = this._node2Id
-        }
-    }
-    /** 关联锚点1ID  */
-    _anchor1ID: string = ''
-    get anchor1ID(): string {
-        return this._anchor1ID
-    }
-    set anchor1ID(v: string) {
-        this._anchor1ID = v
-        if (this.data) {
-            this.data.Anchor1ID = this._anchor1ID
-        }
-    }
-    /** 关联锚点2ID  */
-    _anchor2ID: string = ''
-    get anchor2ID(): string {
-        return this._anchor2ID
-    }
-    set anchor2ID(v: string) {
-        this._anchor2ID = v
-        if (this.data) {
-            this.data.Anchor2ID = this._anchor2ID
-        }
+  /** 起始锚点  */
+  startAnchor: SAnchorItem | null = null;
+  /** 结束锚点  */
+  endAnchor: SAnchorItem | null = null;
+  /** 对应的图例ID  */
+  _graphElementId: string = "";
+  get graphElementId(): string {
+    return this._graphElementId;
+  }
+  set graphElementId(v: string) {
+    this._graphElementId = v;
+    if (this.data) {
+      this.data.GraphElementId = this._graphElementId;
     }
-
-    /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false
-    get maskFlag(): boolean {
-        return this._maskFlag
-    }
-    set maskFlag(v: boolean) {
-        if (v === this._maskFlag) {
-            return
-        }
-        this._maskFlag = v
-        this.update()
+  }
+  /** 关联节点1ID  */
+  _node1Id: string = "";
+  get node1Id(): string {
+    return this._node1Id;
+  }
+  set node1Id(v: string) {
+    this._node1Id = v;
+    if (this.data) {
+      this.data.Node1ID = this._node1Id;
+    }
+  }
+  /** 关联节点2ID  */
+  _node2Id: string = "";
+  get node2Id(): string {
+    return this._node2Id;
+  }
+  set node2Id(v: string) {
+    this._node2Id = v;
+    if (this.data) {
+      this.data.Node2ID = this._node2Id;
+    }
+  }
+  /** 关联锚点1ID  */
+  _anchor1ID: string = "";
+  get anchor1ID(): string {
+    return this._anchor1ID;
+  }
+  set anchor1ID(v: string) {
+    this._anchor1ID = v;
+    if (this.data) {
+      this.data.Anchor1ID = this._anchor1ID;
+    }
+  }
+  /** 关联锚点2ID  */
+  _anchor2ID: string = "";
+  get anchor2ID(): string {
+    return this._anchor2ID;
+  }
+  set anchor2ID(v: string) {
+    this._anchor2ID = v;
+    if (this.data) {
+      this.data.Anchor2ID = this._anchor2ID;
     }
+  }
 
-    /** 数据存储  */
-    data: Relation | null = null
-    /** 接收事件作出修改  */
-    changePos() {
-        if (this.startAnchor) {
-            // 判断删除equip后,不移动
-            if (this.startAnchor.parent && this.startAnchor.parent.parent) {
-                this.pointList[0] = this.startAnchor.mapToScene(0, 0)
-            }
-        }
-        if (this.endAnchor) {
-            // 删除equip后
-            if (this.endAnchor.parent && this.endAnchor.parent.parent) {
-                this.pointList[this.pointList.length - 1] = this.endAnchor.mapToScene(0, 0)
-            }
-        }
+  /** 是否蒙版遮罩  */
+  _maskFlag: boolean = false;
+  get maskFlag(): boolean {
+    return this._maskFlag;
+  }
+  set maskFlag(v: boolean) {
+    if (v === this._maskFlag) {
+      return
     }
+    this._maskFlag = v;
+    this.update()
+  }
 
-    constructor(parent: SGraphItem | null, data: Relation) {
-        super(parent, [])
-        this.zOrder = ItemOrder.polylineOrder
-        this.pointList = data.PointList.map((item) => {
-            return new SPoint(item.X, item.Y)
-        })
-        this.data = data
-        this.name = data.Name
-        this.id = data.ID
-        if (data.GraphElementId) {
-            this._graphElementId = data.GraphElementId
-        }
-        if (data.Node1ID) {
-            this._node1Id = data.Node1ID
-        }
-        if (data.Node2ID) {
-            this._node2Id = data.Node2ID
-        }
-        if (data.Anchor1ID) {
-            this._anchor1ID = data.Anchor1ID
-        }
-        if (data.Anchor2ID) {
-            this._anchor2ID = data.Anchor2ID
-        }
-        if (data.Properties && data.Properties.Color) {
-            this.strokeColor = new SColor(data.Properties.Color)
-        }
-        // if(data.Properties && data.Properties.LineDash){
-        //   this.LineDash = data.Properties.LineDash
-        // }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth
-        }
+  /** 数据存储  */
+  data: Relation | null = null;
+  /** 接收事件作出修改  */
+  changePos() {
+    if (this.startAnchor) {
+      // 判断删除equip后,不移动
+      if (this.startAnchor.parent && this.startAnchor.parent.parent) {
+        this.pointList[0] = this.startAnchor.mapToScene(0, 0);
+      }
     }
+    if (this.endAnchor) {
+      // 删除equip后
+      if (this.endAnchor.parent && this.endAnchor.parent.parent) {
+        this.pointList[
+          this.pointList.length - 1
+        ] = this.endAnchor.mapToScene(0, 0);
+      }
+    }
+  }
 
-    /** 获取data数据  */
-    toData(): Relation | null {
-        let pointList: Point[] = this.pointList.map((item) => {
-            return {
-                X: item.x,
-                Y: item.y,
-            }
-        })
+  constructor(parent: SGraphItem | null, data: Relation) {
+    super(parent, []);
+    this.zOrder = ItemOrder.polylineOrder;
+    this.pointList = data.PointList.map(item => {
+      return new SPoint(item.X, item.Y);
+    });
+    this.data = data;
+    this.name = data.Name;
+    this.id = data.ID;
+    if (data.GraphElementId) {
+      this._graphElementId = data.GraphElementId
+    }
+    if (data.Node1ID) {
+      this._node1Id = data.Node1ID
+    }
+    if (data.Node2ID) {
+      this._node2Id = data.Node2ID
+    }
+    if (data.Anchor1ID) {
+      this._anchor1ID = data.Anchor1ID
+    }
+    if (data.Anchor2ID) {
+      this._anchor2ID = data.Anchor2ID
+    }
+    if (data.Properties.Zorder) {
+      this.zOrder = data.Properties.Zorder;
+    }
+    if (data.Properties && data.Properties.Color) {
+      this.strokeColor = new SColor(data.Properties.Color);
+    }
+    // if(data.Properties && data.Properties.LineDash){
+    //   this.LineDash = data.Properties.LineDash
+    // }
+    if (data.Properties && data.Properties.LineWidth) {
+      this.lineWidth = data.Properties.LineWidth;
+    }
+  }
 
-        if (this.data) {
-            this.data.Name = this.name;
-            this.data.PointList = pointList
-            this.data.Properties.LineWidth = this.lineWidth
-            // this.data.Properties.LineDash = this.LineDash;
-            this.data.Properties.Color = this.strokeColor.value
-        }
+  /** 获取data数据  */
+  toData(): Relation | null {
+    let pointList: Point[] = this.pointList.map(item => {
+      return {
+        X: item.x,
+        Y: item.y
+      }
+    });
 
-        return this.data
+    if (this.data) {
+      this.data.Name = this.name;
+      this.data.PointList = pointList;
+      this.data.Properties.Zorder = this.zOrder;
+      this.data.Properties.LineWidth = this.lineWidth;
+      // this.data.Properties.LineDash = this.LineDash;
+      this.data.Properties.Color = this.strokeColor.value;
     }
 
+    return this.data
+  }
+
     // onDraw(painter: SPainter) {
     //     if (this.maskFlag && this.status == SItemStatus.Normal) {
     //         let color = new SColor(this.strokeColor)
@@ -187,15 +193,15 @@ export class TipelineItem extends SPolylineItem {
      * @param   rect          绘制区域
      */
     onPaint(painter: SPainter, rect: SRect): void {
-        super.onPaint(painter, rect);
-        if (this.maskFlag && this.status == SItemStatus.Normal) {
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-            } else {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth);
-            }
-            painter.pen.color = new SColor('#ffffff80')
-            painter.drawPolyline(this.pointList)
-        }
-    } // Function onPaint()
-}
+      super.onPaint(painter, rect);
+      if (this.maskFlag && this.status == SItemStatus.Normal) {
+          if (this.selected) {
+              painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
+          } else {
+              painter.pen.lineWidth = painter.toPx(this.lineWidth);
+          }
+          painter.pen.color = new SColor('#ffffff80')
+          painter.drawPolyline(this.pointList)
+      }
+  } // Function onPaint()
+}

+ 30 - 1
src/router/index.js

@@ -2,7 +2,7 @@ import Vue from 'vue'
 import store from '@/store'
 import VueRouter from 'vue-router'
 import { query } from '@/utils/query'
-
+import { getPvUv } from '@/api/public.js'
 Vue.use(VueRouter)
 const routes = [
     // {
@@ -11,10 +11,16 @@ const routes = [
     // },
     {
         path: '/404',
+        name: '404页面',
         component: () => import('../components/404'),
     },
     {
+        path: '/400',
+        component: () => import('../views/table'),
+    },
+    {
         path: '/group',
+        name: '集团首页',
         component: () => import('../views/statistics/index'),
     },
     // home
@@ -26,42 +32,50 @@ const routes = [
         children: [
             {
                 path: 'homepage',
+                name: '项目首页',
                 component: () => import('../views/homepage'),
                 redirect: '/home/overview',
             },
             //概览
             {
                 path: 'overview',
+                name: '项目概览',
                 component: () => import('../views/overview'),
             },
             // 楼层功能
             {
                 path: 'floorFunc',
+                name: '楼层功能',
                 component: () => import('../views/floorFunc'),
             },
             // 设备设施
             {
                 path: 'equipment',
+                name: '设备设施',
                 component: () => import('../views/equipment'),
             },
             // 其他功能
             {
                 path: 'other',
+                name: '其他事项',
                 component: () => import('../views/other'),
             },
             // 分析
             {
                 path: 'analysis',
+                name: '分享报表',
                 component: () => import('../views/analysis'),
             },
             //图例库管理
             {
                 path: 'legendLibrary',
+                name: '图例管理',
                 component: () => import('../views/legendLibrary'),
             },
             //图例绘制规则
             {
                 path: 'legendRules',
+                name: '绘制规则',
                 component: () => import('../views/legendRules'),
             },
         ],
@@ -110,4 +124,19 @@ router.beforeEach(async (to, from, next) => {
         return
     }
 })
+// 跳入路由后要对发送pvuv
+router.afterEach((to, from) => {
+    let data = {
+        type: 'router',
+        target: to.name,
+        parameter: to.path,
+    }
+    getPvUv(data)
+        .then((res) => {
+            console.log('pvuv', res)
+        })
+        .catch((res) => {
+            console.log('error', res)
+        })
+})
 export default router

+ 12 - 4
src/store/index.js

@@ -149,7 +149,9 @@ export default new Vuex.Store({
     actions: {
         // 获取项目列表、userId
         async getUserInfo({ commit }, palyload) {
-            await login({ returnTree: true }).then((res) => {
+            await login({
+                returnTree: true,
+            }).then((res) => {
                 // 获取用户当前权限
                 if (res.result === 'success') {
                     commit('STOREACCESSLEVEL', res.level)
@@ -160,7 +162,9 @@ export default new Vuex.Store({
                         commit('SETPLAZENAME', data.plazaName)
                         localStorage.setItem('PLAZAID', data.plazaId)
                         commit('STOREPLAZAID', data.plazaId)
-                        router.push({ path: './home/homepage' })
+                        router.push({
+                            path: './home/homepage',
+                        })
                     } else {
                         if (level === 0) {
                             if (res.treeData[0].ccode) {
@@ -168,9 +172,13 @@ export default new Vuex.Store({
                                 commit('STOREPLAZAID', res.treeData[0].ccode)
                                 commit('SETPLAZENAME', res.treeData[0].cname)
                             }
-                            router.push({ path: './home/homepage' })
+                            router.push({
+                                path: './home/homepage',
+                            })
                         } else {
-                            router.push({ path: './group' })
+                            router.push({
+                                path: './group',
+                            })
                         }
                     }
                     // commit('SETISREQUESTtAUTH', false)

+ 22 - 4
src/views/equipment/eqDialog.vue

@@ -19,7 +19,7 @@
             <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:100%;overflow:auto;height:100%;margin:0 auto'>
-                    <rotation type='3' :rotationImg='rotationImg'></rotation>
+                    <rotation type='3' v-if='rotationImg.length>0' :size='sizePic' :rotationImg='rotationImg'></rotation>
                 </div>
                 <!-- 土建装饰主要材料清单 -->
                 <tj-table v-else-if='dialogInfo.id.slice(0,4)=="TJQD"' :param='param'></tj-table>
@@ -65,7 +65,7 @@
                                 >
                                     <!-- 有tab的原理图 -->
                                     <div style='width:100%;height:600px;'>
-                                        <rotation type='3' :rotationImg='rotationImg'></rotation>
+                                        <rotation :size='sizePic' v-if='rotationImg.length>0' type='3' :rotationImg='rotationImg'></rotation>
                                     </div>
                                 </el-tab-pane>
                                 <!-- 发布之后的编辑器的分支图 -->
@@ -75,7 +75,7 @@
                                     :name='`${value.param.type_code}`'
                                     v-if='value.id.slice(2,4)=="YL" && value.param.type_code.slice(0,3)=="FBT"'
                                 >
-                                    <fenbuPic ref='fenbutu' :typecode='value.param.type_code'></fenbuPic>
+                                    <fenbuPic ref='fenbutu' v-if='showFenbuPic' :typecode='value.param.type_code'></fenbuPic>
                                 </el-tab-pane>
                             </template>
                         </template>
@@ -112,7 +112,10 @@ export default {
             diff: '', //区分给水排水
             rotationImg: [],
             tabLabel: '',
-            tabCount: []
+            tabCount: [],
+            sizePic: '',
+            imgInfo: {},
+            showFenbuPic: false //显示楼层分布组件
         }
     },
     mounted() {},
@@ -159,6 +162,7 @@ export default {
                 this.initImage(this.typecode)
             }
             if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode.slice(0, 3) == 'FBT') {
+                this.showFenbuPic = true
                 this.$nextTick(() => {
                     this.$refs.fenbutu[0] && this.$refs.fenbutu[0].openFloorMap()
                 })
@@ -208,6 +212,19 @@ export default {
             }
             queryPic({ getParams }).then(res => {
                 this.rotationImg = res.data || []
+                this.rotationImg[0].url
+                let img = new Image()
+                img.src = this.rotationImg[0].url
+                const vm = this
+                img.onload = function() {
+                    vm.$set(vm.imgInfo, 'width', img.width)
+                    vm.$set(vm.imgInfo, 'height', img.height)
+                    if (vm.imgInfo.width > vm.imgInfo.height) {
+                        vm.sizePic = 'width'
+                    } else {
+                        vm.sizePic = 'height'
+                    }
+                }
             })
         },
         //原理图没图片不显示tab 因为供电和燃气系统没有tab所以分开判断
@@ -256,6 +273,7 @@ export default {
          *  关闭弹窗,传回父组件,在父组件内 处理逻辑(关闭弹窗)
          */
         closeModal() {
+            this.showFenbuPic = false
             this.$emit('closeModal', true)
         }
     }

+ 6 - 1
src/views/equipment/fenbuPic.vue

@@ -46,6 +46,9 @@ export default {
         }
     },
     methods: {
+        /**
+         * 楼层组件,传回的方法,进行 floorMap 渲染底图
+         */
         emitFloor(item) {
             this.floorInfo = item
             this.$refs.floorMap.init(this.floorInfo.gname)
@@ -95,8 +98,10 @@ export default {
             this.loadName = `${this.floorInfo.code}`
         },
         openFloorMap() {
+            // 查询楼层数据
             this.getFloorData()
-            this.$refs.floorMap.init(this.floorInfo.gname)
+            // 注释掉 floorMap init ,由楼层中的emitFloor方法去执行floorMap
+            // this.$refs.floorMap.init(this.floorInfo.gname)
         }
     }
 }

+ 64 - 6
src/views/equipment/index.vue

@@ -28,7 +28,13 @@
                     </div>
                     <div class='eq-content'>
                         <div class='legend-boxs'>
-                            <Legend :systemName='systemName' :floors='floorsArr' type='1' :editTips='`编辑${floorInfo.code}层${systemName}平面图`'></Legend>
+                            <Legend
+                                :key='keyLd'
+                                :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'>
@@ -63,7 +69,7 @@ import floorMap from '@/components/floorMap/index.vue'
 import eqDialog from './eqDialog'
 import editList from '@/components/edit.vue'
 import { system } from '@/utils/plugins/components.js'
-import { queryPic } from '@/api/public.js'
+import { queryPic,getPvUv } from '@/api/public.js'
 import { mapGetters } from 'vuex'
 import store from '../../store'
 export default {
@@ -87,19 +93,21 @@ export default {
             type: '',
             objCount: [],
             keyFL: 'keyFL' + new Date().getTime(),
+            keyLd: 'keyLd_' + new Date().getTime(),
             ShowDialog: false //是否显示弹窗
         }
     },
     components: { floorList, eqDialog, floorMap, editList },
     watch: {
         // 监听currentFloor变化,重新渲染楼层组件,解决 数据与视图不照应的问题
-        '$store.state.currentFloor': {
+        /* '$store.state.currentFloor': {
             handler(newV, oldV) {
                 if (newV.seq !== oldV.seq) {
+                    // TODO: keyFL更新
                     this.keyFL = 'keyFL' + new Date().getTime()
                 }
             }
-        }
+        } */
     },
     methods: {
         // 查询tab页
@@ -112,7 +120,20 @@ export default {
             store.commit('SETCATEGORYID', item.categoryId)
             this.$refs.floorMap.init(this.floorInfo.gname)
             this.querySmsxt()
-            this.viewLengend()
+            this.viewLengend();
+                  // 发送pvUv
+      let data = {
+        type: "equipmentRouter",
+        target: item.name,
+        parameter: item.categoryId
+      };
+      getPvUv(data)
+        .then(res => {
+          console.log("pvuv", res);
+        })
+        .catch(res => {
+          console.log("error", res);
+        });
         },
         querySmsxt() {
             // 目前消防和弱电下面有特殊的数据表格
@@ -139,15 +160,30 @@ export default {
                 this.$nextTick(() => {
                     this.$refs.dialog.showModal(eve)
                 })
+                // pvuv接口记录
+                 let data = {
+        type: "modal",
+        target: eve.id,
+        parameter: eve.label
+      };
+      getPvUv(data)
+        .then(res => {
+          console.log("pvuv", res);
+        })
+        .catch(res => {
+          console.log("error", res);
+        });
             }
         },
         /**
-         * 关闭弹窗,子组件传回父组件,
+         * 关闭弹窗后,重新渲染 楼层组件
          * 在父组件(本组件)内将 ShowDialog 置为false
          * @param {Boolean} flag 弹窗组件传回的标志: 一直传回 true
          */
         closeModal(flag) {
             this.ShowDialog = false
+            this.keyFL = 'keyFL' + new Date().getTime()
+            this.keyLd = 'keyLd' + new Date().getTime()
         },
         //附加数据图片查看 showView为3展示状态
         additionalColl() {
@@ -185,6 +221,25 @@ export default {
             } else {
                 this.$store.commit('SETSHOWVIEW', 0)
             }
+        },
+        smsxtQuery() {
+            if (this.smsxt == '1001') {
+                this.$cookie.set('categoryId', 'GDXT')
+            } else if (this.smsxt == '1002') {
+                this.$cookie.set('categoryId', 'NTXT')
+            } else if (this.smsxt == '1003') {
+                this.$cookie.set('categoryId', 'XFXT')
+            } else if (this.smsxt == '1004') {
+                this.$cookie.set('categoryId', 'RDXT')
+            } else if (this.smsxt == '1005') {
+                this.$cookie.set('categoryId', 'JPSXT')
+            } else if (this.smsxt == '1006') {
+                this.$cookie.set('categoryId', 'DTXT')
+            } else if (this.smsxt == '1007') {
+                this.$cookie.set('categoryId', 'RQYL')
+            } else {
+                this.$cookie.set('categoryId', 'SCPZ')
+            }
         }
     },
     /* mounted() {
@@ -205,7 +260,9 @@ export default {
     mounted() {
         window._vm = this
         if (this.$route.query.smsxt) {
+            console.log(this.$route.query.smsxt)
             this.smsxt = this.$route.query.smsxt
+            this.smsxtQuery()
             this.system.forEach(el => {
                 if (el.smsxt == this.smsxt) {
                     this.everySystem = el.children
@@ -227,6 +284,7 @@ export default {
             this.viewLengend()
         }
         this.init()
+        console.log(this.floorInfo.gname)
         this.$refs.floorMap.init(this.floorInfo.gname)
     },
     computed: {

+ 2 - 2
src/views/equipment/table/djspTable.vue

@@ -5,7 +5,7 @@
             <el-input
                 placeholder='搜索电井间'
                 size='small'
-                @change='getList'
+                @keyup.enter.native='getList'
                 prefix-icon='el-icon-search'
                 v-model='welldes'
                 clearable
@@ -14,7 +14,7 @@
             <el-input
                 placeholder='搜索商铺编号'
                 size='small'
-                @change='getList'
+                @keyup.enter.native='getList'
                 prefix-icon='el-icon-search'
                 v-model='shopsnum'
                 clearable

+ 2 - 2
src/views/equipment/table/eqDetaileDialog.vue

@@ -11,7 +11,7 @@
                 prefix-icon='el-icon-search'
                 v-model='sbjc'
                 clearable
-                @blur='queryTableList'
+                @keyup.enter.native='queryTableList'
             ></el-input>
             <Select v-model='sbglgs' width='180' tipPlace='top' caption='管理归属:' size='small' :selectdata='sbglgsOption' @change='queryTableList'></Select>
             <Select
@@ -31,7 +31,7 @@
                 clearable
                 prefix-icon='el-icon-search'
                 v-model='brand'
-                @blur='queryTableList'
+                @keyup.enter.native='queryTableList'
             ></el-input>
             <Select
                 width='150'

+ 3 - 3
src/views/equipment/table/eqListTable.vue

@@ -5,7 +5,7 @@
             <el-input
                 placeholder='搜索设备名称'
                 size='small'
-                @blur='getList'
+                @keyup.enter.native='getList'
                 prefix-icon='el-icon-search'
                 v-model='sbjc'
                 clearable
@@ -14,7 +14,7 @@
             <el-input
                 placeholder='搜索品牌型号'
                 size='small'
-                @blur='getList'
+                @keyup.enter.native='getList'
                 clearable
                 prefix-icon='el-icon-search'
                 v-model='keyword'
@@ -34,7 +34,7 @@
                 placeholder='搜索生产厂商'
                 clearable
                 size='small'
-                @blur='getList'
+                @keyup.enter.native='getList'
                 prefix-icon='el-icon-search'
                 v-model='manufacturer'
                 style='width:192px;'

+ 1 - 1
src/views/equipment/table/lookPageTable.vue

@@ -5,7 +5,7 @@
             <el-input
                 placeholder='搜索文件名'
                 size='small'
-                @change='getList'
+                @keyup.enter.native='getList'
                 clearable
                 prefix-icon='el-icon-search'
                 v-model='keyword'

+ 1 - 1
src/views/equipment/table/otherTable.vue

@@ -9,7 +9,7 @@
                 prefix-icon='el-icon-search'
                 v-model='keyword'
                 clearable
-                @blur='getList'
+                @keyup.enter.native='getList'
             ></el-input>
 
             <div class='picker-box'>

+ 3 - 3
src/views/equipment/table/standTable.vue

@@ -5,7 +5,7 @@
             <el-input
                 placeholder='搜索设备名称'
                 size='small'
-                @blur='getList'
+                @keyup.enter.native='getList'
                 prefix-icon='el-icon-search'
                 v-model='sbjc'
                 clearable
@@ -15,7 +15,7 @@
                 placeholder='搜索品牌型号'
                 size='small'
                 clearable
-                @blur='getList'
+                @keyup.enter.native='getList'
                 prefix-icon='el-icon-search'
                 v-model='keyword'
                 style='width:192px;margin-right:12px'
@@ -34,7 +34,7 @@
                 clearable
                 placeholder='搜索生产厂商'
                 size='small'
-                @blur='getList'
+                @keyup.enter.native='getList'
                 prefix-icon='el-icon-search'
                 v-model='manufacturer'
                 style='width:192px;'

+ 13 - 5
src/views/equipment/table/tjTable.vue

@@ -11,14 +11,22 @@
                 v-model='lb'
                 style='width:192px;margin-right:12px'
             ></el-input>
-            <el-input clearable placeholder='搜索品牌' size='small' @blur='getList' prefix-icon='el-icon-search' v-model='brand' style='width:192px'></el-input>
+            <el-input
+                clearable
+                placeholder='搜索品牌'
+                size='small'
+                @keyup.enter.native='getList'
+                prefix-icon='el-icon-search'
+                v-model='brand'
+                style='width:192px'
+            ></el-input>
         </div>
         <el-table :data='tableData' style='width: 100%' :border='true'>
-            <el-table-column type='index' label='序号' width='60' :index="indexMethod"></el-table-column>
-            <el-table-column prop='category' label='类别'  show-overflow-tooltip resizable>
+            <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
+            <el-table-column prop='category' label='类别' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.category || '--'}}</template>
             </el-table-column>
-            <el-table-column prop='sl' label='数量' >
+            <el-table-column prop='sl' label='数量'>
                 <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
             </el-table-column>
             <el-table-column prop='brand' label='品牌'>
@@ -63,7 +71,7 @@ export default {
     methods: {
         //序号的方法
         indexMethod(index) {
-            return (this.currentPage - 1) * this.size + index +1
+            return (this.currentPage - 1) * this.size + index + 1
         },
         pageChanged(page, size) {
             this.currentPage = page

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

@@ -14,7 +14,7 @@
             <el-input
                 placeholder='搜索重要事项记录描述'
                 size='small'
-                @blur='getList'
+                @keyup.enter.native='getList'
                 clearable
                 prefix-icon='el-icon-search'
                 v-model='matters'

+ 2 - 2
src/views/equipment/table/wxTable.vue

@@ -5,7 +5,7 @@
             <el-input
                 placeholder='搜索设备名称编号'
                 size='small'
-                @blur='getList'
+                @keyup.enter.native='getList'
                 clearable
                 prefix-icon='el-icon-search'
                 v-model='sbjc'
@@ -15,7 +15,7 @@
                 placeholder='搜索重要事项记录描述'
                 size='small'
                 clearable
-                @blur='getList'
+                @keyup.enter.native='getList'
                 prefix-icon='el-icon-search'
                 v-model='matters'
                 style='width:192px;margin-right:12px'

+ 9 - 1
src/views/equipment/table/zwTable.vue

@@ -22,7 +22,15 @@
                 style='margin:0 12px'
                 @change='getList'
             ></Select>
-            <el-input placeholder='搜索实施方案说明' prefix-icon='el-icon-search' size='small' style='width:192px' v-model='ssfasm' clearable @blur='getList'></el-input>
+            <el-input
+                placeholder='搜索实施方案说明'
+                prefix-icon='el-icon-search'
+                size='small'
+                style='width:192px'
+                v-model='ssfasm'
+                clearable
+                @keyup.enter.native='getList'
+            ></el-input>
             <!-- 当前阶段 -->
             <Select
                 width='180'

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

@@ -98,7 +98,7 @@
                 ></Select>
                 <el-input
                     size='small'
-                    @change='getTableList'
+                    @keyup.enter.native='getTableList'
                     prefix-icon='el-icon-search'
                     v-model='keyword'
                     clearable
@@ -121,13 +121,13 @@
                 <el-table-column prop='Unit' label='单位' width='60'>
                     <template slot-scope='{row}'>{{row.Unit}}</template>
                 </el-table-column>
-                <el-table-column prop='position' label='对应广场说明书的位置' show-overflow-tooltip width='560'>
+                <el-table-column prop='position' label='对应广场说明书的位置' show-overflow-tooltip>
                     <template slot-scope='{row}'>
                         <span>{{ row.GraphCategorys.length?row.GraphCategorys.map(item => item.Name).join(' ,'):'' }}</span>
                     </template>
                 </el-table-column>
 
-                <el-table-column label='对应工程信息化中的专业/位置、设备分类' show-overflow-tooltip width='462'>
+                <el-table-column label='对应工程信息化中的专业/位置、设备分类' show-overflow-tooltip>
                     <template slot-scope='{row}'>
                         <span>{{row.InfoLocal.length?row.InfoLocal.map(item => item.name).join(' ,') :''}}</span>
                     </template>
@@ -138,7 +138,7 @@
                         </template>
                 </el-table-column>-->
 
-                <el-table-column prop='typeId' resizable label='铺位可视化typeid' width='364' show-overflow-tooltip>
+                <el-table-column prop='typeId' resizable label='铺位可视化typeid' show-overflow-tooltip>
                     <template slot-scope='{row}'>
                         <span>{{row.InfoTypes.length ?row.InfoTypes.map(item => `${item.Id }-${item.Name}`).join(' ,'):'' }}</span>
                     </template>

+ 1 - 1
src/views/legendRules/addList.vue

@@ -3,7 +3,7 @@
         <div>
             <el-input
                 size='small'
-                @change='queryAll'
+                @keyup.enter.native='queryAll'
                 prefix-icon='el-icon-search'
                 v-model='keyword'
                 style='width:192px;margin-right:12px;margin-top:20px;margin-bottom:12px'

+ 1 - 1
src/views/other/gcfz2.vue

@@ -13,7 +13,7 @@
                 :placeholder='"选择楼层"'
             ></Select>
             <el-input
-                @change='changelc'
+                @keyup.enter.native='changelc'
                 placeholder='搜索区域'
                 size='small'
                 style='width:200px;margin-right:12px;'

+ 9 - 1
src/views/other/zhsxOtherTable1.vue

@@ -27,7 +27,15 @@
                 :selectdata='department'
                 :placeholder='"请选择"'
             ></Select>
-            <el-input clearable placeholder='搜索记录事项' @change='getZhjl' size='small' prefix-icon='el-icon-search' v-model='ssjlsx' style='width:200px'></el-input>
+            <el-input
+                clearable
+                placeholder='搜索记录事项'
+                @keyup.enter.native='getZhjl'
+                size='small'
+                prefix-icon='el-icon-search'
+                v-model='ssjlsx'
+                style='width:200px'
+            ></el-input>
         </div>
         <el-table
             border

+ 10 - 2
src/views/other/zhsxOtherTable2.vue

@@ -36,14 +36,22 @@
             ></Select>-->
             <el-input
                 clearable
-                @change='dsfjc'
+                @keyup.enter.native='dsfjc'
                 placeholder='搜索部门'
                 size='small'
                 prefix-icon='el-icon-search'
                 v-model='bmdsf'
                 style='width:200px;margin-right:12px'
             ></el-input>
-            <el-input clearable @change='dsfjc' placeholder='搜索检测结论' size='small' prefix-icon='el-icon-search' v-model='jcjldsf' style='width:200px'></el-input>
+            <el-input
+                clearable
+                @keyup.enter.native='dsfjc'
+                placeholder='搜索检测结论'
+                size='small'
+                prefix-icon='el-icon-search'
+                v-model='jcjldsf'
+                style='width:200px'
+            ></el-input>
             <!-- <Select
                 @change='dsfjc'
                 width='200'

+ 34 - 20
src/views/overview/index.vue

@@ -30,12 +30,12 @@
                         <span></span>
                         <span>建筑综合信息</span>
                     </nav>
-                    <p class='place-p1'>
+                    <!-- <p class='place-p1'>
                         <span>
                             <img src='@/assets/imgs/jz.png' alt />
                             {{build.length>0?formatter('项目名称',build):'--'}}
                         </span>
-                    </p>
+                    </p>-->
                     <p class='place-p2'>
                         <span>
                             <img src='@/assets/imgs/didian.png' alt />
@@ -51,10 +51,10 @@
                                 <span>车位信息</span>
                             </div>
                             <div class='place-right'>
-                                <span>{{build.length>0?formatter('建筑面积',build):'--'}}</span>
-                                <span>{{build.length>0?formatter('建筑高度',build):'--'}}</span>
-                                <span>{{build.length>0?formatter('楼层分布',build):'--'}}</span>
-                                <span>{{build.length>0?formatter('车位信息',build):'--'}}</span>
+                                <span :title='`${build.length>0?formatter("建筑面积",build):"--"}`'>{{build.length>0?formatter('建筑面积',build):'--'}}</span>
+                                <span :title='`${build.length>0?formatter("建筑高度",build):"--"}`'>{{build.length>0?formatter('建筑高度',build):'--'}}</span>
+                                <span :title='`${build.length>0?formatter("楼层分布",build):"--"}`'>{{build.length>0?formatter('楼层分布',build):'--'}}</span>
+                                <span :title='`${build.length>0?formatter("车位信息",build):"--"}`'>{{build.length>0?formatter('车位信息',build):'--'}}</span>
                             </div>
                         </div>
                         <div class='place-box'>
@@ -65,10 +65,10 @@
                                 <span>移交日期</span>
                             </div>
                             <div class='place-right'>
-                                <span>{{build.length>0?formatter('租赁面积',build):'--'}}</span>
-                                <span>{{build.length>0?formatter('竣工日期',build):'--'}}</span>
-                                <span>{{build.length>0?formatter('开业日期',build):'--'}}</span>
-                                <span>{{build.length>0?formatter('移交日期',build):'--'}}</span>
+                                <span :title='`${build.length>0?formatter("租赁面积",build):"--"}`'>{{build.length>0?formatter('租赁面积',build):'--'}}</span>
+                                <span :title='`${build.length>0?formatter("竣工日期",build):"--"}`'>{{build.length>0?formatter('竣工日期',build):'--'}}</span>
+                                <span :title='`${build.length>0?formatter("开业日期",build):"--"}`'>{{build.length>0?formatter('开业日期',build):'--'}}</span>
+                                <span :title='`${build.length>0?formatter("移交日期",build):"--"}`'>{{build.length>0?formatter('移交日期',build):'--'}}</span>
                             </div>
                         </div>
                     </div>
@@ -266,22 +266,36 @@ export default {
             } else {
                 return ''
             }
+        },
+        init() {
+            //预览是否开启
+            // let previewUrl = location.href.split('?')[1]
+            // if (previewUrl) {
+            //     previewUrl = Boolean(previewUrl.split('=')[1])
+            //     this.$store.commit('SETISPREVIEW', previewUrl)
+            // }
+            let previewUrl = this.$route.query.isPreview,
+                plazaId = this.$route.query.plazaId
+            if (previewUrl != '') {
+                console.log(previewUrl)
+                this.$store.commit('SETISPREVIEW', previewUrl)
+            }
+            if (plazaId) {
+                localStorage.setItem('PLAZAID', plazaId)
+                this.$store.commit('STOREPLAZAID', plazaId)
+            }
+            // let previewUrl = location.href.split('=')[1] ? location.href.split('=')[1].split('&')[0] : false,
+            // plazaId = location.href.split('=')[2] ? location.href.split('=')[2] : '1000423'
         }
     },
     mounted() {
-        //预览是否开启
-        // let previewUrl = location.href.split('?')[1]
-        // if (previewUrl) {
-        //     previewUrl = Boolean(previewUrl.split('=')[1])
-        //     this.$store.commit('SETISPREVIEW', previewUrl)
-        // }
-        let previewUrl = location.href.split('=')[1] ? location.href.split('=')[1].split('&')[0] : false,
-            plazaId = location.href.split('=')[2] ? location.href.split('=')[2] : '1000423'
-        this.$store.commit('SETISPREVIEW', previewUrl)
         this.query()
     },
+    created() {
+        this.init()
+    },
     computed: {
-        ...mapGetters(['isPreview', 'pic'])
+        ...mapGetters(['isPreview', 'pic', 'plazaId'])
     },
     components: {
         PicModal

+ 6 - 6
src/views/room/detail.vue

@@ -4,7 +4,7 @@
         <div class='gdqd-dialog-top'>
             <el-input
                 clearable
-                @change='queryDetail'
+                @keyup.enter.native='queryDetail'
                 placeholder='搜索设备名称编号'
                 style='width:196px;margin-right:12px'
                 size='small'
@@ -35,7 +35,7 @@
             ></Select>
             <el-input
                 clearable
-                @change='queryDetail'
+                @keyup.enter.native='queryDetail'
                 placeholder='搜索品牌型号'
                 style='width:196px;margin-right:12px'
                 size='small'
@@ -166,7 +166,7 @@ import { mapGetters } from 'vuex'
 import { queryHxsbDetail } from '@/api/room.js'
 
 export default {
-    props: ['row', 'floorChange'],
+    props: ['row'],
     data() {
         return {
             dialogFormVisible: false,
@@ -250,9 +250,9 @@ export default {
                 classstructureid: this.row.classstructureid,
                 type_code: this.row.type_code
             }
-            if (this.floorChange) {
-                postParams.gname = this.floorChange
-            }
+            // if (this.floorChange) {
+            //     postParams.gname = this.floorChange
+            // }
             // if (this.row.floorcode) {
             //     postParams.floorcode = this.row.floorcode
             // }

+ 50 - 39
src/views/room/index.vue

@@ -5,7 +5,7 @@
 */
 <template>
     <div class='compute-box'>
-        <el-dialog :title='`${systemName}`||"机房"' :visible.sync='visible' :fullscreen='true'>
+        <el-dialog :title='`${systemName}`' :visible.sync='visible' :fullscreen='true'>
             <el-tooltip
                 class='item'
                 effect='dark'
@@ -35,7 +35,7 @@
                             ></Select>
                             <el-input
                                 clearable
-                                @change='Index1'
+                                @keyup.enter.native='Index1'
                                 v-model='ctbhInput'
                                 placeholder='搜索抽屉编号'
                                 size='small'
@@ -44,7 +44,7 @@
                             ></el-input>
                             <el-input
                                 clearable
-                                @change='Index1'
+                                @keyup.enter.native='Index1'
                                 v-model='cxggInput'
                                 placeholder='搜索出线规格'
                                 size='small'
@@ -53,7 +53,7 @@
                             ></el-input>
                             <el-input
                                 clearable
-                                @change='Index1'
+                                @keyup.enter.native='Index1'
                                 v-model='djbhInput'
                                 placeholder='搜索电井编号'
                                 size='small'
@@ -62,7 +62,7 @@
                             ></el-input>
                             <el-input
                                 clearable
-                                @change='Index1'
+                                @keyup.enter.native='Index1'
                                 v-model='kzhlInput'
                                 placeholder='搜索控制回路'
                                 size='small'
@@ -88,19 +88,19 @@
                                 size='small'
                                 prefix-icon='el-icon-search'
                                 v-model='sbjcInput'
-                                @change='Index2'
+                                @keyup.enter.native='Index2'
                                 style='width:200px;margin-right:12px'
                             ></el-input>
                             <el-input
                                 clearable
-                                @change='Index2'
+                                @keyup.enter.native='Index2'
                                 placeholder='搜索品牌、型号'
                                 size='small'
                                 prefix-icon='el-icon-search'
                                 v-model='ppxhInput'
                                 style='width:200px;margin-right:12px'
                             ></el-input>
-                            <Select
+                            <!-- <Select
                                 width='200'
                                 @change='Index2'
                                 tipPlace='top'
@@ -109,10 +109,10 @@
                                 :selectdata='floorSelect'
                                 :placeholder='"请选择"'
                                 style='margin-right:12px'
-                            ></Select>
+                            ></Select>-->
                             <el-input
                                 clearable
-                                @change='Index2'
+                                @keyup.enter.native='Index2'
                                 placeholder='搜索生产厂商'
                                 size='small'
                                 prefix-icon='el-icon-search'
@@ -127,7 +127,6 @@
                             :page='page2'
                             :total='total2'
                             :size='size2'
-                            :floorChange='floorChange'
                             @Index2Emit='Index2Emit'
                         ></room-table3>
                     </el-tab-pane>
@@ -135,7 +134,7 @@
                         <div class='compute-center'>
                             <el-input
                                 clearable
-                                @change='Index3'
+                                @keyup.enter.native='Index3'
                                 placeholder='搜索设备名称、编号'
                                 size='small'
                                 prefix-icon='el-icon-search'
@@ -144,7 +143,7 @@
                             ></el-input>
                             <el-input
                                 clearable
-                                @change='Index3'
+                                @keyup.enter.native='Index3'
                                 placeholder='搜索重要事项记录、描述'
                                 size='small'
                                 prefix-icon='el-icon-search'
@@ -163,7 +162,7 @@
                             ></Select>
                             <el-input
                                 clearable
-                                @change='Index3'
+                                @keyup.enter.native='Index3'
                                 placeholder='搜索工单编号'
                                 size='small'
                                 prefix-icon='el-icon-search'
@@ -253,7 +252,7 @@
                     <el-tab-pane label='维保记录' name='5'>
                         <div class='compute-center'>
                             <el-input
-                                @change='Index4'
+                                @keyup.enter.native='Index4'
                                 clearable
                                 placeholder='搜索设备名称、编号'
                                 size='small'
@@ -262,7 +261,7 @@
                                 style='margin-right:12px;width:220px;'
                             ></el-input>
                             <el-input
-                                @change='Index4'
+                                @keyup.enter.native='Index4'
                                 clearable
                                 placeholder='搜索核心维保事项记录描述'
                                 size='small'
@@ -271,7 +270,7 @@
                                 style='margin-right:12px;width:220px;'
                             ></el-input>
                             <el-input
-                                @change='Index4'
+                                @keyup.enter.native='Index4'
                                 clearable
                                 placeholder='搜索任务编号'
                                 size='small'
@@ -459,7 +458,7 @@ export default {
             sccsInput: '',
             ppxhInput: '',
             sbjcInput: '',
-            floorChange: '',
+            // floorChange: '',
             //
             total3: 0,
             page3: 1,
@@ -535,7 +534,7 @@ export default {
             this.picFloor = this.$cookie.get('floorNow')
             let getParams = {
                 typename: '位置布置图',
-                locationsid: this.location,
+                location: this.location,
                 module: '1002',
                 // system: system,
                 plazaId: this.plazaId
@@ -561,7 +560,7 @@ export default {
         // 明细表
         Index1() {
             let getParams = {
-                locationsid: this.location,
+                location: this.location,
                 plazaId: this.plazaId,
                 page: this.page1,
                 size: this.size1
@@ -639,9 +638,9 @@ export default {
                     data.keyword = `${this.sccsInput}:manufacturer`
                 }
             }
-            if (this.floorChange) {
-                postParams.gname = this.floorChange
-            }
+            // if (this.floorChange) {
+            //     postParams.gname = this.floorChange
+            // }
             queryHxsb({ data, postParams }).then(res => {
                 this.loading2 = false
                 this.total2 = res.data.count
@@ -667,7 +666,7 @@ export default {
         // 机房维修记录
         Index3() {
             let getParams = {
-                locationsid: this.location,
+                location: this.location,
                 plazaId: this.plazaId,
                 page: this.page3,
                 size: this.size3,
@@ -715,7 +714,7 @@ export default {
         Index4() {
             let postParams = {}
             let data = {
-                locationsid: this.location,
+                location: this.location,
                 plazaId: this.plazaId,
                 page: this.page4,
                 size: this.size4,
@@ -878,6 +877,31 @@ export default {
 </script>
 <style lang="less" scoped>
 .compute-box {
+    /deep/ .el-dialog {
+        // padding: 16px 20px 20px;
+        overflow: hidden;
+        .el-dialog__header {
+            padding: 0;
+            font-size: 16px;
+            font-family: PingFangSC-Medium, PingFang SC;
+            font-weight: 500;
+            color: rgba(0, 0, 0, 0.85);
+            height: 60px;
+            line-height: 60px;
+            background: #f1f2f2;
+            padding-left: 20px;
+            // padding-bottom: 16px;
+        }
+        .el-dialog__headerbtn {
+            top: 0;
+        }
+        .el-dialog__body {
+            padding: 0 24px;
+            .is-active {
+                background: rgba(2, 91, 170, 0.15);
+            }
+        }
+    }
     .compute-zf {
         width: 15px;
         height: 13px;
@@ -971,26 +995,13 @@ export default {
 </style>
 <style lang="less">
 .compute-box {
-    .el-dialog {
-        padding: 16px 20px 20px;
-        overflow: hidden;
-        .el-dialog__header {
-            padding: 0;
-            font-size: 16px;
-            font-family: PingFangSC-Medium, PingFang SC;
-            font-weight: 500;
-            color: rgba(0, 0, 0, 0.85);
-            line-height: 24px;
-            padding-bottom: 16px;
-        }
-    }
     .compute-tab {
         .el-dialog__title {
             font-size: 16px;
             font-family: PingFangSC-Medium, PingFang SC;
             font-weight: 500;
             color: rgba(0, 0, 0, 0.85);
-            line-height: 24px;
+            line-height: 60px;
         }
         .el-dialog__body {
             padding: 0 24px;

+ 1 - 1
src/views/room/room1.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class='jf-inner' style='width:100%;height:85vh;overflow:hidden'>
+    <div class='jf-inner' style='width:100%;overflow:hidden'>
         <rotation :rotationImg='tableImg' :type='3'></rotation>
     </div>
 </template>

+ 162 - 152
src/views/statistics/index.vue

@@ -165,9 +165,8 @@ import 'leaflet-contextmenu'
 export default {
     data() {
         return {
-            toolTipHtml:'',
-            crumbsHtml: [],
-            zoneNames: {
+            crumbsHtml: [], // 导航数据
+            zoneNames: {   // 各个中心对应的拼音名称
                 "东北": 'dongbei',
                 "西北": 'xibei',
                 "华北": 'huabei',
@@ -179,40 +178,40 @@ export default {
                 "东南": 'dongnan',
                 "其他": 'Other'
             },
-            provinceCities: {
-                "青岛区域": { province: 'shandong', center: [36.06667, 120.33333], zoom: 8 },
-                "北京区域": { province: 'beijing', center: [39.604882122321174, 116.43660987308282], zoom: 8 },
-                "天津区域": { province: 'tianjin', center: [39.130593, 117.260892], zoom: 7 },
-                "济南区域": { province: 'shandong', center: [36.4, 117.0], zoom: 7 },
-                "上海区域": { province: 'shanghai', center: [31.090574094954192, 121.46299249603001], zoom: 10 },
-                "南京区域": { province: 'jiangsu', center: [32.05, 118.78333], zoom: 7 },
-                "无锡区域": { province: 'jiangsu', center: [31.57, 120.3], zoom: 9 },
-                "厦门区域": { province: 'fujian', center: [24.46667, 118.1], zoom: 9 },
-                "宁波区域": { province: 'zhejiang', center: [29.52, 121.33], zoom: 8 },
-                "杭州区域": { province: 'zhejiang', center: [30.323100460201648, 120.50270908851112], zoom: 9 },
-                "福州区域": { province: 'fujian', center: [26.05, 119.18], zoom: 8 },
-                "合肥区域": { province: 'anhui', center: [31.52, 117.17], zoom: 7 },
-                "长沙区域": { province: 'hunan', center: [28.12, 112.59], zoom: 8 },
-                "南昌区域": { province: 'jiangxi', center: [28.4, 115.55], zoom: 8 },
-                "大连区域": { province: 'liaoning', center: [39.98974718404572, 122.66034125625548], zoom: 8 },
-                "沈阳区域": { province: 'liaoning', center: [41.72213058512578, 122.93479223528372], zoom: 8 },
-                "长春区域": { province: 'jilin', center: [42.88033923363183, 127.02188147691707], zoom: 8 },
-                "东莞区域": { province: 'guangdong', center: [23.644524198573688, 114.83844948916203], zoom: 8 },
-                "南宁区域": { province: 'guangxi', center: [22.48, 108.19], zoom: 7 },
-                "广州区域": { province: 'guangdong', center: [22.755920681486405, 112.01244459124548], zoom: 7 },
-                "太原区域": { province: 'shanxi1', center: [37.54, 112.33], zoom: 7 },
-                "武汉区域": { province: 'hubei', center: [31.147006308556566, 112.97898510653813], zoom: 7 },
-                "郑州区域": { province: 'henan', center: [34.46, 113.4], zoom: 7 },
-                "哈尔滨区域": { province: 'heilongjiang', center: [46.800059446787316, 128.40505022926592], zoom: 7 },
-                "乌鲁木齐区域": { province: 'xinjiang', center: [43.45, 87.36], zoom: 8 },
-                "呼和浩特区域": { province: 'neimenggu', center: [45.182036837015886, 116.82329020199336], zoom: 5 },
-                "西安区域": { province: 'shanxi2', center: [36.08462129606931, 109.4527754086213], zoom: 7 },
-                "银川区域": { province: 'ningxia', center: [38.108627664321276, 102.36578196225639], zoom: 7 },
-                "成都区域": { province: 'sichuan', center: [30.24957724046765, 103.4647651330231], zoom: 7 },
-                "昆明区域": { province: 'yunnan', center: [25.903703303407667, 105.10972266685498], zoom: 8 },
-                "重庆区域": { province: 'chongqing', center: [29.35, 106.33], zoom: 8 }
+            provinceCities: {  // 各个区域的的省会城市  坐标 缩放级别 
+                "青岛区域商管公司": { province: 'shandong', center: [36.06667, 120.33333], zoom: 8 },
+                "北京区域商管公司": { province: 'beijing', center: [39.604882122321174, 116.43660987308282], zoom: 8 },
+                "天津区域商管公司": { province: 'tianjin', center: [39.130593, 117.260892], zoom: 7 },
+                "济南区域商管公司": { province: 'shandong', center: [36.4, 117.0], zoom: 7 },
+                "上海区域商管公司": { province: 'shanghai', center: [31.090574094954192, 121.46299249603001], zoom: 10 },
+                "南京区域商管公司": { province: 'jiangsu', center: [32.05, 118.78333], zoom: 7 },
+                "无锡区域商管公司": { province: 'jiangsu', center: [31.57, 120.3], zoom: 9 },
+                "厦门区域商管公司": { province: 'fujian', center: [24.46667, 118.1], zoom: 9 },
+                "宁波区域商管公司": { province: 'zhejiang', center: [29.52, 121.33], zoom: 8 },
+                "杭州区域商管公司": { province: 'zhejiang', center: [30.323100460201648, 120.50270908851112], zoom: 9 },
+                "福州区域商管公司": { province: 'fujian', center: [26.05, 119.18], zoom: 8 },
+                "合肥区域商管公司": { province: 'anhui', center: [31.52, 117.17], zoom: 7 },
+                "长沙区域商管公司": { province: 'hunan', center: [28.12, 112.59], zoom: 8 },
+                "南昌区域商管公司": { province: 'jiangxi', center: [28.4, 115.55], zoom: 8 },
+                "大连区域商管公司": { province: 'liaoning', center: [39.98974718404572, 122.66034125625548], zoom: 8 },
+                "沈阳区域商管公司": { province: 'liaoning', center: [41.72213058512578, 122.93479223528372], zoom: 8 },
+                "长春区域商管公司": { province: 'jilin', center: [42.88033923363183, 127.02188147691707], zoom: 8 },
+                "东莞区域商管公司": { province: 'guangdong', center: [23.644524198573688, 114.83844948916203], zoom: 8 },
+                "南宁区域商管公司": { province: 'guangxi', center: [22.48, 108.19], zoom: 7 },
+                "广州区域商管公司": { province: 'guangdong', center: [22.755920681486405, 112.01244459124548], zoom: 7 },
+                "太原区域商管公司": { province: 'shanxi1', center: [37.54, 112.33], zoom: 7 },
+                "武汉区域商管公司": { province: 'hubei', center: [31.147006308556566, 112.97898510653813], zoom: 7 },
+                "郑州区域商管公司": { province: 'henan', center: [34.46, 113.4], zoom: 7 },
+                "哈尔滨区域商管公司": { province: 'heilongjiang', center: [46.800059446787316, 128.40505022926592], zoom: 7 },
+                "乌鲁木齐区域商管公司": { province: 'xinjiang', center: [43.45, 87.36], zoom: 8 },
+                "呼和浩特区域商管公司": { province: 'neimenggu', center: [45.182036837015886, 116.82329020199336], zoom: 5 },
+                "西安区域商管公司": { province: 'shanxi2', center: [36.08462129606931, 109.4527754086213], zoom: 7 },
+                "银川区域商管公司": { province: 'ningxia', center: [38.108627664321276, 102.36578196225639], zoom: 7 },
+                "成都区域商管公司": { province: 'sichuan', center: [30.24957724046765, 103.4647651330231], zoom: 7 },
+                "昆明区域商管公司": { province: 'yunnan', center: [25.903703303407667, 105.10972266685498], zoom: 8 },
+                "重庆区域商管公司": { province: 'chongqing', center: [29.35, 106.33], zoom: 8 }
             },
-            zoneCenter: {
+            zoneCenter: {  // 各个区域的中心坐标
                 dongbei: [43.161614, 124.396818], // 取自 东北运营中心 长春区域 四平万达广场
                 xibei: [37.999781, 106.197518], // 西北  银川区域 吴忠万达广场     zoom 5
                 huabei: [39.019075, 117.686953], // 华北中心  天津区域  天津塘沽万达广场
@@ -223,7 +222,7 @@ export default {
                 dongnan: [26.657907, 119.545678], //东南 福州 宁德万达广场
                 xinan: [28.749998, 104.648788] // 西南 成都 宜宾万达广场
             },
-            legendList: [
+            legendList: [  // 地图图例数据
                 { color: '#F54E45', num: '≥200' },
                 { color: '#F58300', num: '100-200' },
                 { color: '#FFBA6B', num: '50-99' },
@@ -232,18 +231,14 @@ export default {
                 { color: '#EEEEEE', num: '0' }
             ],
             plazaInfoCount: {},
-            systemList: [],
-            currentZoneData: {}, //
+            systemList: [],  // 系统列表数据
+            currentZoneData: {}, // 当前分区
             currentDistrictData: [], //当前管理分区数据
-            currentSelectedSys: {},
-            currentSysId: '',
-            state: '',
-            value: 190,
-            currentPanel: '',
-            regulateDistrictData: [],
-            projectsCode: [],
-            maintainList: [],
-            circleSize: {
+            currentSelectedSys: {}, // 当前所选择的系统
+            currentSysId: '', // 当前系统ID
+            regulateDistrictData: [], // 分区数据
+            maintainList: [],  // 专维  维保  第三方检测 数据
+            circleSize: {  // 根据缩放级别 规定绘制点的尺寸  下标文字离点的距离
                 4: { inner: 50000, outer: 100000, offset: 2 },
                 5: { inner: 15000, outer: 30000, offset: 0.8 },
                 6: { inner: 15000, outer: 30000, offset: 0.8 },
@@ -253,7 +248,7 @@ export default {
                 10: { inner: 1000, outer: 2000, offset: 0.04 },
                 11: { inner: 1000, outer: 2000, offset: 0.04 }
             },
-            barColors :{
+            barColors :{  // // 专维  维保  第三方检测 颜色
                 0: 'linear-gradient(to right, #369CF7 , #025BAA)',   // 蓝色
                 1: 'linear-gradient(to right, #F58300 , #F58300)',   // 黄色
                 2: 'linear-gradient(to right, #F54E45 , #F54E45)'    // 红色
@@ -274,12 +269,11 @@ export default {
         window.addEventListener('resize', this.reinitalMap, false)
     },
     methods: {  
-        showToolTip (index, title) {
-            
+        showToolTip (index) {
             this.maintainList.forEach(item => {item.showToolTip = false})
             this.maintainList[index].showToolTip = true
         },
-        hideToolTip (index, title) {
+        hideToolTip (index) {
             this.maintainList[index].showToolTip = false
         },
         reinitalMap () {
@@ -310,13 +304,31 @@ export default {
             // this.$router.push({path:''})
         },
         /**
-         * 通过导航进行导航
-         *
+         * @Description 根据数据创建导航路径
+         * @Param data 当前点击的项
+         */
+        createNavpathByData(data) {
+            if (data.level === 1) {
+                this.crumbsHtml = []
+            } else {
+                let pathArr = data.path.split('/')
+                let newArr = []
+                pathArr.forEach(item => {
+                    newArr.push(item.split('&'))
+                })
+                this.crumbsHtml = newArr
+            }
+            this.currentZoneData = data
+        },
+        /**
+         * @Description 通过导航进行导航 
+         * @Param id 所选区域的id
+         * @Param index 点击项的序号
          */
         navgateFromCrumbs(id, index) {
-            let data = this.getDataByCityCcode(id)
+            let data = this.getDataByCityCcode(id)  // 根据
             if (!data) return
-            let level = data.level //1集团 2中心 3区域 0广场
+            let level = data.level    //1集团 2中心 3区域 0广场
             this.currentZoneData = data
             this.currentLevel = level
             this.getEventStatusData(level, data.ccode)
@@ -331,32 +343,33 @@ export default {
             }
             this.crumbsHtml = this.crumbsHtml.splice(0, index + 1)
         },
-        // 获取 区域/中心/项目
+        /**
+         * @Description 分区树 点击选择分区
+         * @Param ids  返回选中项的id
+         * @Param data 返回选中项的数据
+         */
         selectProjectItem(ids, data) {
             this.currentLevel = data.level
             if (data.level === 0) {  //  level=0时 plazaId必填
-                this.queryPlazaInfoCount(data.ccode, data.level, data.cid)
+                this.queryPlazaInfoCount(data.ccode, data.level, data.ccode)
             } else {
                 this.queryPlazaInfoCount(data.ccode, data.level)
             }
-            if (data.level !== 0) {
-                this.getSystemList(data.ccode, data.level) 
-            }
+            this.getSystemList(data.ccode, data.level) 
             this.getEventStatusData(this.currentLevel, data.ccode)
             this.createNavpathByData(data)
             this.currentZoneData = data
-            let JSONName = data.cname
+  
             let level = data.level // //1集团 2中心 3区域 0广场
             if (level === 1) {
                 this.pantGroupMap(data, this.currentSysId)
             } else if (level === 2) {
                 this.pantZonesMap(data, '1001')
             } else if (level === 3) {
-                let res = this.provinceCities[JSONName]
                 this.pantProjectsMap(data, this.currentSysId)
-            } else {
+            } else {   // 点击项为广场时 直接跳转到详情页  地图不用响应
                 let pathData = {fromGroup: 'true'}
-                let routeData = this.$router.resolve({ // 点击广场时 直接跳转到详情页  地图不用响应
+                let routeData = this.$router.resolve({  
                     name:'/home/homePage',
                 })
                 window.open(routeData.href, '_blank');
@@ -367,20 +380,20 @@ export default {
                 }
                 this.$store.commit('SETPLAZENAME', data.cname) 
                 localStorage.setItem('PLAZAID', data.ccode)
-                 this.$store.commit('STOREPLAZAID', data.ccode) 
+                this.$store.commit('STOREPLAZAID', data.ccode) 
                 this.$store.commit('SETISGETMAP',true) 
             }
         },
    
         /**
-         * @description  查询项目信息统计数量
-         * @param  plazaId level=0时 必填
-         * @param  ccode  管理分区编码 必填
-         * @param  level 1集团 2中心 3区域 0广场 必填
+         * @Description  查询项目信息统计数量
+         * @Param  ccode  管理分区编码 必填
+         * @Param  level 1集团 2中心 3区域 0广场 必填
+         * @Param  plazaId level=0时 必填
          */
         queryPlazaInfoCount(ccode, level, plazaId) {
             let params = {}
-            if (plazaId) {
+            if (level === 0 ) {
                 params = {getParams:{ccode, level}}
             } else {
                 params = {getParams:{ccode, level, plazaId}}
@@ -394,7 +407,8 @@ export default {
             })
         },
         /**
-         * 根据id 查找数据
+         * @Description 根据指定id 查找数据
+         * @Param id 要查找数据的id
          */
         getDataByCityCcode(id) {
             return recursionFindData(this.currentDistrictData, id)
@@ -415,8 +429,7 @@ export default {
             }
         },
         /**
-        * @description 获取集团 中心 区域 项目 数据树数据
-        * fetch the data of specific group / center / zone / project
+        * @Description 获取分区树数据
         * @method param empty
         */
         getFrameworkTreeData() {
@@ -432,18 +445,18 @@ export default {
                     data.open = true  // 默认展开第一级
                     this.regulateDistrictData = [data]
                     this.currentDistrictData = res.treeData
-                    this.getSystemList(data.ccode,level )
+                    this.getSystemList(data.ccode, level )
                     this.getEventStatusData(level, data.ccode)
                     if (level === 0) {  //  level=0时 plazaId必填
-                        this.queryPlazaInfoCount(data.ccode, level, data.cid)
+                        this.queryPlazaInfoCount(data.ccode, level, data.ccode)
                     } else {
-                         this.queryPlazaInfoCount(data.ccode, level)
+                        this.queryPlazaInfoCount(data.ccode, level)
                     }
                 }
                 function recursionData(data, parent) {
                     data.forEach(item => {
                         item.name = item.cname
-                        item.id = item.cid
+                        item.id = item.ccode
                         if (parent) {
                             item.path = parent + '/' + (item.cname + '&' + item.ccode)
                         }
@@ -456,12 +469,10 @@ export default {
             })
         },
          /**
-        * @description 获取集团 中心 区域 项目 数据树数据
-        * fetch the data of specific group / center / zone / project
-        * @method param empty
+        * @Description 展开 维保 第三方检测 专维 
+        * @Param  item 展开的某一项
         */
         toggerPanel(item) {
-            this.currentPanel = item.title
             // expand 0 初始状态  1 展开状态 2 隐藏状态
             if (item.expand === 0 || item.expand === 2) {
                 item.expand = 1 // 展开
@@ -477,9 +488,8 @@ export default {
             }
         },
          /**
-        * @description 获取集团 中心 区域 项目 数据树数据
-        * fetch the data of specific group / center / zone / project
-        * @method param empty
+        * @Description  计算 维保/第三方检测/专维 三个模块的高度
+        * @Param item 数据中的每一项
         */
         panelStyle(item) {
             // expand 0 初始状态  1 展开状态 2 隐藏状态
@@ -492,8 +502,10 @@ export default {
             }
         },
         /**
-         * 计算长度  维保、第三方检测是用即将逾期数据判断;专维是如果有逾期未完成直接标红,如果没有,按照即将逾期的数量显示颜色
-         */
+        *@Description 根据数据计算维保/第三方检测/专维各自颜色条的长度  维保、第三方检测是用即将逾期数据判断;专维是如果有逾期未完成直接标红,如果没有,按照即将逾期的数量显示颜色
+        *@Param item 某一项的数据
+        *@Param title 标题 
+        */
         barStyle(item, title) {
             let bg = ''
             let type = this.selectColorByNum(item.due_num, item.total)
@@ -501,7 +513,6 @@ export default {
             if (title === '专维') {
                 if (item.unfinished>0) {
                     bg = 'linear-gradient(to right, #F54E45 , #F54E45)'  
-                    // bg='red'
                 } else {
                     bg = this.barColors[type]
                 }
@@ -515,9 +526,13 @@ export default {
                 backgroundImage: bg
             }
         },
-        selectColorByNum (num, total) {   //  >=   <=
+        /**
+         * @Description 根据数据来返 维保/第三方检测/专维 三个模块中显示条的颜色 
+         * @Param num 即将逾期数 / 逾期未完成数
+         * @Param total 总数
+         */
+        selectColorByNum (num, total) {    
             let devide =  num / total
-            // console.log(num, devide)
             if ( (num > 1 && num <=24  ) || (  devide > 0.1 && devide <=0.2 ) ) {
                 return 0
             } else if ( (num > 24 && num <= 49  ) || (  devide > 0.2 && devide <=0.5 ) ) {
@@ -526,11 +541,10 @@ export default {
                 return 2
             }
         },
-        // 根据数据渲染颜色
-         /**
-        * @description 获取集团 中心 区域 项目 数据树数据
-        * fetch the data of specific group / center / zone / project
-        * @method param empty
+  
+        /**
+        * @Description 根据数据 判定地图上图标的显示显示颜色
+        * @Param data 作为判断的数据
         */
         paintColorByData(data) {
             let color = {
@@ -558,22 +572,16 @@ export default {
             }
             return color
         },
-        
-         /**
-        * @description 获取集团 中心 区域 项目 数据树数据
-        * fetch the data of specific group / center / zone / project
-        * @method param empty
+        /**
+        * @Description 显示当期时间
         */
         currentTime() {
             this.times = moment().format('YYYY.MM.DD HH:mm')
             setTimeout(this.currentTime, 1000)
         },
-        /**根据选择的系统重新渲染地图
-         * param sysId:系统Id
-         */
+ 
          /**
-        * @description 获取集团 中心 区域 项目 数据树数据
-        * fetch the data of specific group / center / zone / project
+        * @Description 格式化时间
         * @method param empty
         */
         formatter(str, arrv) {
@@ -585,18 +593,17 @@ export default {
             }
         },
          /**
-        * @description 获取集团 中心 区域 项目 数据树数据
-        * fetch the data of specific group / center / zone / project
+        * @Description 获取集团 中心 区域 项目 数据树数据
         * @method param ccode  管理分区编码 集团首页必填
         * @method param level  1集团 2中心 3区域 0广场 集团首页必填
-        * @method param plazaId 广场id 必填
+        * @method param plazaId 广场id  如果是广场则此参数必填 其他情况下非必填
         */
-        getSystemList(ccode, level, plazaId) {
-            let params = {}
-            if (plazaId) {
-                params = {getParams:{ccode, level}}
+        getSystemList(ccode, level) {
+            let params = null 
+            if (level === 0) {
+                params = {getParams:{plazaId: ccode, level}}
             } else {
-                params = {getParams:{ccode, level, plazaId}}
+                params = {getParams:{ccode, level}}
             }
             getCardList(params).then(res => {
                 if (res.result == 'success') {
@@ -620,9 +627,9 @@ export default {
             })
         },
         /**
-         * @description 获取事项状态统计数据
-         * @param ccode 管理分区编码 必填
-         * @param level 1集团 2中心 3区域 0广场 必填
+         * @Description 获取事项状态统计数据
+         * @Param ccode 管理分区编码 必填
+         * @Param level 1集团 2中心 3区域 0广场 必填
          */
         getEventStatusData(level, ccode) {  
             let params = {
@@ -665,7 +672,9 @@ export default {
                 }
             })
         },
-        //初始化地图
+        /**
+         *@Description 初始化地图
+         */
         initMap() {
             let that = this
             myMaps = L.map('map', {
@@ -701,7 +710,9 @@ export default {
                 this.pantProjectsMap(this.currentZoneData, this.currentSysId)
             }  
         },
-        //**清空地图 并添加全国底图*/
+        /**
+         * @Description 清空地图 并添加全国底图
+        */
         clearAllLayers() {
             myMaps.eachLayer(function(layer) {
                 myMaps.removeLayer(layer)
@@ -718,14 +729,14 @@ export default {
             }).addTo(myMaps)
         },
         /**
-         * 移动地图到指定中心
+         * @Description 移动地图到指定中心
          */
         panTo(center, zoom) {
             myMaps.setView(center, zoom)
         },
         /**
-         * 切换系统时 地图响应
-         * @params  system:当前选择的系统
+         * @Description 切换系统时 地图响应
+         * @Params  system:当前选择的系统
          */
         getInfoOfProject(system) {
             this.systemList.forEach(item => {
@@ -744,7 +755,10 @@ export default {
                 this.pantProjectsMap(this.currentZoneData, system.smsxt)
             }
         },
-        // 用于绘制集团地图
+        /**
+         * @Description 用于绘制集团级别的地图
+         * @Param data 数据
+         */
         pantGroupMap(data) {
             this.clearAllLayers()
             myMaps.setView([38, 103], 4)
@@ -801,7 +815,8 @@ export default {
             groupLayer.addTo(myMaps)
         },
         /**
-         * 用于绘制中心下的地图
+         * @Description  用于绘制中心地图
+         * @Param data 数据
          */
         pantZonesMap(data) {
             let that = this
@@ -826,6 +841,7 @@ export default {
                 }
                 querySystemCard(params).then(res => {
                     if (res.result === 'success') {
+
                         let city = that.provinceCities[item.cname]
                         let num = 0
                         let center = city.center
@@ -847,8 +863,9 @@ export default {
             groupLayer.addTo(myMaps)
         },
         
-        /***
-         * 用于绘制项目的点
+        /**
+         * @Description 用于绘制项目的点
+         * @Param data 数据
          */
         pantProjectsMap(data) {
             this.clearAllLayers()
@@ -859,7 +876,8 @@ export default {
             })
         },
         /**
-         * 用于绘制广场的点
+         * @Description 用于绘制广场
+         * @Param data 数据
          */
         pantPlazaMap(item, zoom) {
             let that = this
@@ -895,7 +913,15 @@ export default {
             })
         },
          /**
-         * 
+         * @Description 用于绘制广场的点
+         * @Param num 当前点的逾期设备数
+         * @Param groupLayer 地图图层
+         * @Param contentHtml 弹出框的Html内容
+         * @Param center 该点坐标
+         * @Param data  该点数据
+         * @Param name  改点名称
+         * @Param type  地图级别  group / zone / project  集团 / 中心 / 区域
+         * @param zoom 缩放级别
          */
         createPointOnMap (num, groupLayer, contentHtml, center, data,  name, type , zoom) {
             let popup = null
@@ -911,7 +937,6 @@ export default {
             let sizes = this.circleSize[zoom]
             if (color  && center) { 
                 popup = L.popup({closeOnClick:true}).setLatLng(center).setContent(contentHtml)
-
                 marker = L.marker([center[0] - sizes.offset,  center[1]], { icon: myIcon }).addTo(groupLayer)
                 outCircle = L.circle(center, sizes.outer, { color: 'transparent', fillColor: color.border, fillOpacity: 1 }).bindPopup(contentHtml).addTo(groupLayer)
                 innerCircle =L.circle(center, sizes.inner, { color: 'transparent', fillColor: color.area, fillOpacity: 1 }).bindPopup(contentHtml).addTo(groupLayer)
@@ -924,15 +949,16 @@ export default {
                     this.currentLevel = data.level
                     this.getEventStatusData(data.level, data.ccode)
                     this.queryPlazaInfoCount(data.ccode, data.level) 
-                    groupLayer.clearLayers()
+                    if (type !== 'project') {
+                        groupLayer.clearLayers()
+                    }
                     this.createNavpathByData(data)
+                    this.getSystemList(data.ccode, data.level)
                     if (type === 'group') {
                         this.pantZonesMap(data, this.currentSysId)
-                        this.getSystemList(data.ccode, data.level) 
                     } 
                     if (type === 'zone') {
                         this.pantProjectsMap(data, this.currentSysId)
-                        this.getSystemList(data.ccode, data.level) 
                     } 
                     if (type === 'project') {
                         let routeData = this.$router.resolve({
@@ -946,7 +972,7 @@ export default {
                         }
                         this.$store.commit('SETPLAZENAME', data.cname) 
                         localStorage.setItem('PLAZAID', data.ccode)
-                         this.$store.commit('STOREPLAZAID', data.ccode) 
+                        this.$store.commit('STOREPLAZAID', data.ccode) 
                         this.$store.commit('SETISGETMAP',true) 
                     }   
                 })
@@ -954,7 +980,7 @@ export default {
           
         },
         /**
-         * 生成弹框HTML
+         *@Description 生成弹框HTML
          */
         createPopupHtmlContent(data, name) {
             if (Array.isArray(data) && data.length) {
@@ -983,22 +1009,7 @@ export default {
                 return ''
             }
         },
-        /**
-         * 根据数据创建导航路径
-         */
-        createNavpathByData(data) {
-            if (data.level === 1) {
-                this.crumbsHtml = []
-            } else {
-                let pathArr = data.path.split('/')
-                let newArr = []
-                pathArr.forEach(item => {
-                    newArr.push(item.split('&'))
-                })
-                this.crumbsHtml = newArr
-            }
-            this.currentZoneData = data
-        }
+        
     },
     beforeDestroy() {
         window.removeEventListener('resize', this.reinitalMap)
@@ -1036,8 +1047,6 @@ export default {
         overflow: hidden;
         .home {
             width: 265px;
-            min-width: 265px;
-           max-width: 320px;
             height: 48px;
             // line-height: 48px;
             text-align: center;
@@ -1459,4 +1468,5 @@ export default {
         }
     }
 }
-</style> 
+</style> 
+ 

+ 206 - 0
src/views/table/index.vue

@@ -0,0 +1,206 @@
+<template>
+    <div>
+        <h4>Table1</h4>
+        <h6>原数据</h6>
+        <el-table :data='tableData1' border style='width: 100%'>
+            <el-table-column prop='type' label='type' width='180'></el-table-column>
+            <el-table-column prop='professional' label='professional'></el-table-column>
+            <el-table-column prop='unit' label='unit'></el-table-column>
+            <el-table-column prop='seq0' label='seq0'></el-table-column>
+            <el-table-column prop='seq1' label='seq1'></el-table-column>
+            <el-table-column prop='seq2' label='seq2'></el-table-column>
+            <el-table-column prop='seq3' label='seq3'></el-table-column>
+            <el-table-column prop='seq4' label='seq4'></el-table-column>
+        </el-table>
+        <h6>合并数据</h6>
+        <el-table :data='tableData2' border style='width: 100%'>
+            <el-table-column prop='type' label='type' width='180'></el-table-column>
+            <el-table-column prop='professional' label='professional'></el-table-column>
+            <el-table-column prop='unit' label='unit'></el-table-column>
+            <el-table-column prop='seq0' label='seq0'></el-table-column>
+            <el-table-column prop='seq1' label='seq1'></el-table-column>
+            <el-table-column prop='seq2' label='seq2'></el-table-column>
+            <el-table-column prop='seq3' label='seq3'></el-table-column>
+            <el-table-column prop='seq4' label='seq4'></el-table-column>
+        </el-table>
+        <el-table :data='tableData2' :span-method='arraySpanMethod' border style='width: 100%'>
+            <el-table-column prop='type' label='type' width='180'></el-table-column>
+            <el-table-column prop='professional' label='professional'></el-table-column>
+            <el-table-column prop='unit' label='unit'></el-table-column>
+            <el-table-column prop='seq0' label='seq0'></el-table-column>
+            <el-table-column prop='seq1' label='seq1'></el-table-column>
+            <el-table-column prop='seq2' label='seq2'></el-table-column>
+            <el-table-column prop='seq3' label='seq3'></el-table-column>
+            <el-table-column prop='seq4' label='seq4'></el-table-column>
+        </el-table>
+    </div>
+</template>
+<script>
+export default {
+    name: 'Table1',
+    props: [],
+    components: {},
+    data() {
+        return {
+            tableData1: [],
+            tableData2: []
+        }
+    },
+    computed: {},
+    methods: {
+        arraySpanMethod({ row, column, rowIndex, columnIndex }) {
+            // console.log('span method rowIndex=', rowIndex, ', columnIndex=', columnIndex, JSON.stringify(row))
+            if (columnIndex == 0) {
+                if (row.type == '总包') {
+                    return [row.seq1, 1]
+                } else if (row.type == '分包') {
+                    return [1, 1]
+                } else {
+                    return [0, 1]
+                }
+            }
+            if (columnIndex == 1) {
+                if (row.professional) {
+                    return [row.seq2, 1]
+                } else {
+                    return [0, 1]
+                }
+            }
+            if (columnIndex == 2) {
+                if (row.unit) {
+                    return [row.seq3, 1]
+                } else {
+                    return [0, 1]
+                }
+            }
+
+            return [1, 1]
+        },
+        parseTableData(data) {
+            let seq = {}
+            data.forEach(item => {
+                let flag = item.type
+                if (!seq[flag]) {
+                    seq[flag] = 1
+                } else {
+                    seq[flag] = seq[flag] + 1
+                }
+                flag = item.type + '-' + item.professional
+                if (!seq[flag]) {
+                    seq[flag] = 1
+                } else {
+                    seq[flag] = seq[flag] + 1
+                }
+                flag = item.type + '-' + item.unit
+                if (!seq[flag]) {
+                    seq[flag] = 1
+                } else {
+                    seq[flag] = seq[flag] + 1
+                }
+            })
+
+            console.log(seq)
+
+            data.forEach(item => {
+                item.seq0 = item.type == '总包' ? 1 : 2
+                item.seq1 = seq[item.type]
+                item.seq2 = seq[item.type + '-' + item.professional]
+                item.seq3 = seq[item.type + '-' + item.unit]
+                item.seq4 = item.seq2 + item.seq3
+            })
+            data.forEach(item => console.log(JSON.stringify(item)))
+
+            data.sort((a, b) => {
+                if (a.seq0 != b.seq0) {
+                    return a.seq0 - b.seq0
+                }
+                if (a.seq4 != b.seq4) {
+                    return a.seq4 - b.seq4
+                }
+                if (a.seq3 != b.seq3) {
+                    return a.seq3 - b.seq3
+                }
+                if (a.seq2 != b.seq2) {
+                    return a.seq2 - b.seq2
+                }
+                let result = a.professional.localeCompare(b.professional)
+                if (result == 0) {
+                    return a.unit.localeCompare(b.unit)
+                } else {
+                    return result
+                }
+            })
+
+            let result = []
+            let temp = null
+            for (let i = 0; i < data.length; i++) {
+                let item = data[i]
+                if (item.type != '总包') {
+                    continue
+                }
+                if (!temp) {
+                    result.push(item)
+                } else {
+                    let content = { seq0: item.seq0, seq1: item.seq1, seq2: item.seq2, seq3: item.seq3, seq4: item.seq4 }
+                    content.type = item.type == '分包' ? '分包' : null
+                    if (item.professional != temp.professional) {
+                        content.professional = item.professional
+                    }
+                    if (item.unit != temp.unit) {
+                        content.unit = item.unit
+                    }
+                    result.push(content)
+                }
+                temp = data[i]
+            }
+            temp = null
+            for (let i = 0; i < data.length; i++) {
+                let item = data[i]
+                if (item.type != '分包') {
+                    continue
+                }
+                if (!temp) {
+                    result.push(item)
+                } else {
+                    let item = data[i]
+                    let content = { seq0: item.seq0, seq1: item.seq1, seq2: item.seq2, seq3: item.seq3, seq4: item.seq4 }
+                    content.type = item.type == '分包' ? '分包' : null
+                    if (item.professional != temp.professional) {
+                        content.professional = item.professional
+                    }
+                    if (item.unit != temp.unit) {
+                        content.unit = item.unit
+                    }
+                    result.push(content)
+                }
+                temp = data[i]
+            }
+            this.tableData1 = data
+            this.tableData2 = result
+        }
+    },
+    created() {
+        console.log('--------------------- Table1 created')
+        let tableData = [
+            { siteid: '1000423', type: '总包', professional: '土建', unit: '中建二局' },
+            { siteid: '1000423', type: '分包', professional: '电梯', unit: '上海三菱' },
+            { siteid: '1000423', type: '总包', professional: '消防电', unit: '中建二局2' },
+            { siteid: '1000423', type: '总包', professional: '机电', unit: '中建二局' },
+            { siteid: '1000423', type: '分包', professional: '精装', unit: '深圳嘉信' },
+            { siteid: '1000423', type: '总包', professional: '给排水', unit: '中建二局' },
+            { siteid: '1000423', type: '分包', professional: '幕墙', unit: '中建二局' },
+            { siteid: '1000423', type: '分包', professional: '精装', unit: '深圳艺涛' },
+            { siteid: '1000423', type: '分包', professional: '采光顶', unit: '上海通用' },
+            { siteid: '1000423', type: '分包', professional: '空调', unit: '武汉三重' },
+            { siteid: '1000423', type: '总包', professional: '弱电', unit: '中建二局' },
+            { siteid: '1000423', type: '分包', professional: '消防水', unit: '辽宁强盾' }
+        ]
+        this.parseTableData(tableData)
+    },
+    mounted() {
+        console.log('--------------------- Table1 mounted')
+    }
+}
+</script>
+<style lang='css' scoped>
+</style>