guoxiaohuan 4 years ago
parent
commit
d611811508

+ 4 - 4
public/systemConf.js

@@ -24,11 +24,11 @@ var __systemConf = {
     systemCode: 'wandaBmGuide',
     conf: {
         // 阿里云
-        // editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
-        // wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
+        editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
+        wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
         // http://glsms.wanda-dev.cn/ 测试服
-        editerUrl: 'http://glsms.wanda-dev.cn/wandaEditer/', // 编辑器地址
-        wandaBmGuideUrl: 'http://glsms.wanda-dev.cn/wandaBmGuide/', //管理书地址
+        // editerUrl: 'http://glsms.wanda-dev.cn/wandaEditer/', // 编辑器地址
+        // wandaBmGuideUrl: 'http://glsms.wanda-dev.cn/wandaBmGuide/', //管理书地址
         // editerUrl: 'http://localhost:8091/wandaEditer/', // 编辑器地址
         // wandaBmGuideUrl: 'http://localhost:8090/wandaBmGuide/', //管理书地址
     },

+ 30 - 39
src/components/floorList.vue

@@ -7,17 +7,9 @@
     <div class='floor-box'>
         <div class='floor-list'>
             <div class='icon-top' v-if='floorsArr.length>showNumber'>
-                    <!-- :class='{disabled:currentFloorId == floorsArr[0].seq }' -->
-                <img
-                    :class='{ disabled:currIndex === 0 }'
-                    v-if='showT'
-                    @click='changeFloor(1,currIndex)'
-                    @mousedown='mousedown'
-                    @mouseup='mouseup'
-                    src='@/assets/imgs/iconBlackTop.png'
-                    alt
-                />
-                <img  :class='{ disabled:currIndex === 0 }' v-else src='@/assets/imgs/iconLightTop.png' alt />
+                <!-- :class='{disabled:currentFloorId == floorsArr[0].seq }' -->
+                <img v-repeat-click='increase' :class='{ disabled:currIndex === 0 }' v-if='showT' src='@/assets/imgs/iconBlackTop.png' alt />
+                <img :class='{ disabled:currIndex === 0 }' v-else src='@/assets/imgs/iconLightTop.png' alt />
                 <!-- <img :class='{disabled:currentFloorId == floorsArr[0].seq }' v-else src='@/assets/imgs/iconLightTop.png' alt /> -->
             </div>
             <div class='floor-out'>
@@ -34,15 +26,15 @@
                 </div>
             </div>
             <div class='icon-bottom' v-if='floorsArr.length>showNumber'>
-                    <!-- :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }' -->
+                <!-- :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }' -->
                 <img
                     :class='{disabled:currIndex === floorsArr.length - 1 }'
                     v-if='showB'
-                    @click='changeFloor(-1,currIndex)'
+                    v-repeat-click='decrease'
                     src='@/assets/imgs/iconBlackBottom.png'
                     alt
                 />
-                <img  :class='{ disabled:currIndex === floorsArr.length - 1 }' v-else src='@/assets/imgs/iconLightBottom.png' alt />
+                <img :class='{ disabled:currIndex === floorsArr.length - 1 }' v-else src='@/assets/imgs/iconLightBottom.png' alt />
                 <!-- <img :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }' v-else src='@/assets/imgs/iconLightBottom.png' alt /> -->
             </div>
         </div>
@@ -51,7 +43,12 @@
 <script>
 import store from '../store'
 import { mapGetters } from 'vuex'
+import RepeatClick from '@/directives/repeat-click'
+
 export default {
+    directives: {
+        repeatClick: RepeatClick
+    },
     data() {
         return {
             floorId: 'F1',
@@ -70,8 +67,8 @@ export default {
             marginTop: 0,
             startTime: '',
             endTime: '',
-            showNumber: 8,   //需要暂时的楼层数
-            currIndex:  0,    //当前楼层在 楼层数组中的下标
+            showNumber: 8, //需要暂时的楼层数
+            currIndex: 0 //当前楼层在 楼层数组中的下标
         }
     },
     props: {
@@ -90,17 +87,15 @@ export default {
         this.init()
     },
     methods: {
-        mousedown() {
-            this.startTime = new Date()
+        // 楼层向上
+        increase() {
+            this.changeFloor(1, this.currIndex)
         },
-        mouseup() {
-            this.endTime = new Date()
-            if (this.endTime - this.startTime < 200) {
-                return false
-            }
+        // 楼层向下
+        decrease() {
+            this.changeFloor(-1, this.currIndex)
         },
         init() {
-            // console.log('init')
             if (!this.floorsArr.length) {
                 return false
             }
@@ -115,15 +110,17 @@ export default {
             if (index === -1) {
                 this.currentFloorId = this.floorIdArr[0]
             }
-            this.changeFloor(0,index)
+            this.changeFloor(0, index)
         },
         /**
          * @name changeFloor
          * @param {Number} flag 1:向上滚动楼层, -1向下滚动 , 0:进入页面初始化时,执行位置处理
          * @description 点击图例下方的,上下切换按钮
          */
-        changeFloor(flag,index) {
-            // console.log('changeFloor')
+        changeFloors() {
+            this.changeFloor(-1, this.currIndex)
+        },
+        changeFloor(flag, index) {
             const len = this.floorIdArr.length
             // let index = this.floorIdArr.findIndex(item => item === this.currentFloorId)
             this.currIndex = index
@@ -131,27 +128,26 @@ export default {
             if (flag === 1) {
                 index--
                 this.currIndex = index
-                // 点击上下箭头,不进行选中的楼层 状态更新 
+                // 点击上下箭头,不进行选中的楼层 状态更新
                 // this.currentFloorId = this.floorIdArr[index]
             } else if (flag === -1) {
                 //点击下箭头
                 index++
                 this.currIndex = index
-                // 点击上下箭头,不进行选中的楼层 状态更新 
+                // 点击上下箭头,不进行选中的楼层 状态更新
                 // this.currentFloorId = this.floorIdArr[index]
             }
-            // FEAT:  点击上下箭头,不触发cookie更改 , 只有初始化时,才进行选中的楼层 状态更新 
-            if(flag === 0){
+            // FEAT:  点击上下箭头,不触发cookie更改 , 只有初始化时,才进行选中的楼层 状态更新
+            if (flag === 0) {
                 this.handleCookie()
                 // 点击楼层,处理上下箭头禁用逻辑
                 this.handleUpDownStatus(index, len)
-            }else{
+            } else {
                 // 点击上下箭头,处理上下按钮禁用逻辑
                 this.handleUpDownStatus1(index, len)
             }
             // 楼层位置动画处理
             this.handlePosition(flag, index, len)
-          
         },
 
         /**
@@ -258,7 +254,7 @@ export default {
             // TODO: 需要修改可以修改这里,配置页面样式,修改showNumber和height
             // FEAT: 使用8条楼层
             let showNumber = this.showNumber, //页面中展示的楼层条数
-                height = 32 //一个楼层的div标签高度
+                height = 39 //一个楼层的div标签高度
             if (index >= showNumber - 1) {
                 if (index < len - 1) {
                     this.marginTop = -height * (index - (showNumber - 2)) + 'px'
@@ -294,11 +290,6 @@ export default {
             max-height: 300px;
             overflow: hidden;
             position: relative;
-            overflow-y: auto;
-            &::-webkit-scrollbar {
-                display: none;
-            }
-
             .floor-center {
                 transition: all linear 0.8s;
                 .floor-item {

+ 230 - 0
src/directives/dom.js

@@ -0,0 +1,230 @@
+/* istanbul ignore next */
+
+import Vue from 'vue'
+
+const isServer = Vue.prototype.$isServer
+const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g
+const MOZ_HACK_REGEXP = /^moz([A-Z])/
+const ieVersion = isServer ? 0 : Number(document.documentMode)
+
+/* istanbul ignore next */
+const trim = function(string) {
+    return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '')
+}
+/* istanbul ignore next */
+const camelCase = function(name) {
+    return name
+        .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
+            return offset ? letter.toUpperCase() : letter
+        })
+        .replace(MOZ_HACK_REGEXP, 'Moz$1')
+}
+
+/* istanbul ignore next */
+export const on = (function() {
+    if (!isServer && document.addEventListener) {
+        return function(element, event, handler) {
+            if (element && event && handler) {
+                element.addEventListener(event, handler, false)
+            }
+        }
+    } else {
+        return function(element, event, handler) {
+            if (element && event && handler) {
+                element.attachEvent('on' + event, handler)
+            }
+        }
+    }
+})()
+
+/* istanbul ignore next */
+export const off = (function() {
+    if (!isServer && document.removeEventListener) {
+        return function(element, event, handler) {
+            if (element && event) {
+                element.removeEventListener(event, handler, false)
+            }
+        }
+    } else {
+        return function(element, event, handler) {
+            if (element && event) {
+                element.detachEvent('on' + event, handler)
+            }
+        }
+    }
+})()
+
+/* istanbul ignore next */
+export const once = function(el, event, fn) {
+    var listener = function() {
+        if (fn) {
+            fn.apply(this, arguments)
+        }
+        off(el, event, listener)
+    }
+    on(el, event, listener)
+}
+
+/* istanbul ignore next */
+export function hasClass(el, cls) {
+    if (!el || !cls) return false
+    if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.')
+    if (el.classList) {
+        return el.classList.contains(cls)
+    } else {
+        return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1
+    }
+}
+
+/* istanbul ignore next */
+export function addClass(el, cls) {
+    if (!el) return
+    var curClass = el.className
+    var classes = (cls || '').split(' ')
+
+    for (var i = 0, j = classes.length; i < j; i++) {
+        var clsName = classes[i]
+        if (!clsName) continue
+
+        if (el.classList) {
+            el.classList.add(clsName)
+        } else if (!hasClass(el, clsName)) {
+            curClass += ' ' + clsName
+        }
+    }
+    if (!el.classList) {
+        el.className = curClass
+    }
+}
+
+/* istanbul ignore next */
+export function removeClass(el, cls) {
+    if (!el || !cls) return
+    var classes = cls.split(' ')
+    var curClass = ' ' + el.className + ' '
+
+    for (var i = 0, j = classes.length; i < j; i++) {
+        var clsName = classes[i]
+        if (!clsName) continue
+
+        if (el.classList) {
+            el.classList.remove(clsName)
+        } else if (hasClass(el, clsName)) {
+            curClass = curClass.replace(' ' + clsName + ' ', ' ')
+        }
+    }
+    if (!el.classList) {
+        el.className = trim(curClass)
+    }
+}
+
+/* istanbul ignore next */
+export const getStyle =
+    ieVersion < 9
+        ? function(element, styleName) {
+              if (isServer) return
+              if (!element || !styleName) return null
+              styleName = camelCase(styleName)
+              if (styleName === 'float') {
+                  styleName = 'styleFloat'
+              }
+              try {
+                  switch (styleName) {
+                      case 'opacity':
+                          try {
+                              return element.filters.item('alpha').opacity / 100
+                          } catch (e) {
+                              return 1.0
+                          }
+                      default:
+                          return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null
+                  }
+              } catch (e) {
+                  return element.style[styleName]
+              }
+          }
+        : function(element, styleName) {
+              if (isServer) return
+              if (!element || !styleName) return null
+              styleName = camelCase(styleName)
+              if (styleName === 'float') {
+                  styleName = 'cssFloat'
+              }
+              try {
+                  var computed = document.defaultView.getComputedStyle(element, '')
+                  return element.style[styleName] || computed ? computed[styleName] : null
+              } catch (e) {
+                  return element.style[styleName]
+              }
+          }
+
+/* istanbul ignore next */
+export function setStyle(element, styleName, value) {
+    if (!element || !styleName) return
+
+    if (typeof styleName === 'object') {
+        for (var prop in styleName) {
+            if (styleName.hasOwnProperty(prop)) {
+                setStyle(element, prop, styleName[prop])
+            }
+        }
+    } else {
+        styleName = camelCase(styleName)
+        if (styleName === 'opacity' && ieVersion < 9) {
+            element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')'
+        } else {
+            element.style[styleName] = value
+        }
+    }
+}
+
+export const isScroll = (el, vertical) => {
+    if (isServer) return
+
+    const determinedDirection = vertical !== null || vertical !== undefined
+    const overflow = determinedDirection ? (vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x')) : getStyle(el, 'overflow')
+
+    return overflow.match(/(scroll|auto)/)
+}
+
+export const getScrollContainer = (el, vertical) => {
+    if (isServer) return
+
+    let parent = el
+    while (parent) {
+        if ([window, document, document.documentElement].includes(parent)) {
+            return window
+        }
+        if (isScroll(parent, vertical)) {
+            return parent
+        }
+        parent = parent.parentNode
+    }
+
+    return parent
+}
+
+export const isInContainer = (el, container) => {
+    if (isServer || !el || !container) return false
+
+    const elRect = el.getBoundingClientRect()
+    let containerRect
+
+    if ([window, document, document.documentElement, null, undefined].includes(container)) {
+        containerRect = {
+            top: 0,
+            right: window.innerWidth,
+            bottom: window.innerHeight,
+            left: 0,
+        }
+    } else {
+        containerRect = container.getBoundingClientRect()
+    }
+
+    return (
+        elRect.top < containerRect.bottom &&
+        elRect.bottom > containerRect.top &&
+        elRect.right > containerRect.left &&
+        elRect.left < containerRect.right
+    )
+}

+ 24 - 0
src/directives/repeat-click.js

@@ -0,0 +1,24 @@
+import { once, on } from './dom'
+
+export default {
+    bind(el, binding, vnode) {
+        let interval = null
+        let startTime
+        const handler = () => vnode.context[binding.expression].apply()
+        const clear = () => {
+            if (Date.now() - startTime < 100) {
+                handler()
+            }
+            clearInterval(interval)
+            interval = null
+        }
+
+        on(el, 'mousedown', (e) => {
+            if (e.button !== 0) return
+            startTime = Date.now()
+            once(document, 'mouseup', clear)
+            clearInterval(interval)
+            interval = setInterval(handler, 100)
+        })
+    },
+}

+ 4 - 4
src/router/index.js

@@ -5,10 +5,10 @@ import { query } from '@/utils/query'
 
 Vue.use(VueRouter)
 const routes = [
-    {
-        path: '/',
-        redirect: '/home/overview', // 只有区域,及区域以上用户才能进入总部首页这一套
-    },
+    // {
+    //     path: '/',
+    //     redirect: '/home/overview', // 只有区域,及区域以上用户才能进入总部首页这一套
+    // },
     {
         path: '/404',
         component: () => import('../components/404'),

+ 15 - 16
src/views/statistics/index.vue

@@ -60,7 +60,7 @@
                                 <div class='number' v-for='(equip , index) in item.assetTypeList' :key='index'>
                                     <div class="title">
                                         <P>{{equip.category_name}}</p>
-                                        <span v-if='equip.is_exception_num'>{{equip.is_exception_num}}</span>
+                                        <span :style="{right: equip.is_exception_num > 99 ? '-2rem' :  equip.is_exception_num > 9 ? '-1.5rem' :'-1rem'}" v-if='equip.is_exception_num'>{{equip.is_exception_num}}</span>
                                     </div>
                                     <p>
                                         <span>{{equip.asset_num}}</span>
@@ -254,9 +254,9 @@ export default {
                 11: { inner: 1000, outer: 2000, offset: 0.04 }
             },
             barColors :{
-                0: 'linear-gradient(to right, #F54E45 , #F54E45)',   // 蓝色
+                0: 'linear-gradient(to right, #369CF7 , #025BAA)',   // 蓝色
                 1: 'linear-gradient(to right, #F58300 , #F58300)',   // 黄色
-                2: 'linear-gradient(to right, #369CF7 , #025BAA)'    // 红色
+                2: 'linear-gradient(to right, #F54E45 , #F54E45)'    // 红色
             }
         }
     },
@@ -321,6 +321,7 @@ export default {
             this.currentLevel = level
             this.getEventStatusData(level, data.ccode)
             this.queryPlazaInfoCount(data.ccode, data.level, data.cid) 
+            this.getSystemList(data.ccode, data.level) 
             if (level === 1) {
                 this.pantGroupMap(data, this.currentSysId)
             } else if (level === 2) {
@@ -365,10 +366,10 @@ export default {
                     plazaId: data.ccode
                 }
                 this.$store.commit('SETPLAZENAME', data.cname) 
-                localStorage.setItem('PLAZAID', data.ccode)       
-                this.$store.commit('STOREPLAZAID', data.ccode) 
-                this.$store.commit('SETISGETMAP',true)                
-            }  
+                localStorage.setItem('PLAZAID', data.ccode)
+                 this.$store.commit('STOREPLAZAID', data.ccode) 
+                this.$store.commit('SETISGETMAP',true) 
+            }
         },
    
         /**
@@ -803,6 +804,7 @@ export default {
          * 用于绘制中心下的地图
          */
         pantZonesMap(data) {
+            let that = this
             this.clearAllLayers()
             let name = data.cname.substr(0, 2)
             let zone = this.zoneNames[name]
@@ -813,7 +815,6 @@ export default {
                 zoom = 6
             }
             this.panTo(this.zoneCenter[zone], zoom)
-            let that = this
             let groupLayer = new L.layerGroup()
             data.children.forEach(item => {
                 let params = {
@@ -863,10 +864,6 @@ export default {
         pantPlazaMap(item, zoom) {
             let that = this
             let groupLayer = new L.layerGroup()
-            if (flag) {
-                this.clearAllLayers()
-                this.panTo(center, 11)
-            }
             let params = {
                 getParams: {
                     plazaId: item.cid,   // 所查对象是广场的时候plazaId必传
@@ -931,9 +928,11 @@ export default {
                     this.createNavpathByData(data)
                     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({
@@ -948,7 +947,7 @@ export default {
                         this.$store.commit('SETPLAZENAME', data.cname) 
                         localStorage.setItem('PLAZAID', data.ccode)
                          this.$store.commit('STOREPLAZAID', data.ccode) 
-                         this.$store.commit('SETISGETMAP',true)              
+                        this.$store.commit('SETISGETMAP',true) 
                     }   
                 })
             }
@@ -1036,7 +1035,8 @@ export default {
         box-shadow: 0px 2px 10px 0px rgba(31, 35, 41, 0.1);
         overflow: hidden;
         .home {
-           min-width: 265px;
+            width: 265px;
+            min-width: 265px;
            max-width: 320px;
             height: 48px;
             // line-height: 48px;
@@ -1459,5 +1459,4 @@ export default {
         }
     }
 }
-</style> 
- 
+</style> 

+ 2 - 2
vue.config.js

@@ -31,8 +31,8 @@ module.exports = {
             },
             // 图例库服务
             '/serve': {
-                target: 'http://192.168.200.87:8088',
-                // target: 'http://192.168.200.83:8085',
+                // target: 'http://192.168.200.87:8088',
+                target: 'http://60.205.177.43:8080',
                 changeOrigin: true,
                 pathRewrite: {
                     '^/serve': '',