소스 검색

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

YaolongHan 4 년 전
부모
커밋
605c6ea6eb

+ 3 - 3
src/api/login.js

@@ -1,12 +1,12 @@
 // 登录校验接口
-import httputils from '@/api/httputils'
+import httputils from "@/api/httputils"
 
 export function login(params) {
-    return httputils.getJson(`/data/auth/check`, params)
+    return httputils.getJson(`/data/data/auth/check`, params)
 }
 // 查询楼层清单
 export function queryFloor(params) {
-    return httputils.getJson(`/data/plaza/floor`, params)
+    return httputils.getJson(`/data/data/plaza/floor`, params)
 }
 export function queryfmapID(params) {
     return httputils.getJson(`/version`, params)

+ 2 - 2
src/api/overview.js

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

+ 13 - 11
src/components/PicLarge/src/picLarge.vue

@@ -5,14 +5,14 @@
 */
 <template>
     <div class='tpyl'>
-        <el-dialog title='图片预览' width='90%' :visible.sync='dialogVisible' :close-on-click-modal='false' append-to-body>
+        <el-dialog title='图片预览' class='tpyl-1' width='90%' :visible.sync='dialogVisible' :close-on-click-modal='false' append-to-body>
             <div class='pic-list'>
                 <div class='pic-left'>
                     <ul v-for='(item,index) in imgUrl' :key='index'>
                         <li @click='getIndex(item.url)'>
                             <img :src='item.url' />
                         </li>
-                        <span>{{item.name}}</span>
+                        <!-- <span>{{item.name}}</span> -->
                     </ul>
                 </div>
                 <div class='pic-right'>
@@ -73,7 +73,6 @@ export default {
             margin-bottom: 0;
             width: 180px;
             margin: 0 auto;
-
             li {
                 width: 180px;
                 height: 135px;
@@ -81,7 +80,7 @@ export default {
                 border: 4px solid rgba(245, 246, 247, 1);
                 img {
                     width: 100%;
-                    height: 100%;
+
                     border-radius: 4px;
                 }
             }
@@ -102,28 +101,31 @@ export default {
         flex: 1;
         background: rgba(245, 246, 247, 1);
         border-radius: 0px 0px 4px 0px;
-
         padding: 20px 50px;
         margin: auto auto;
+        display: flex;
+        justify-content: center;
+        align-items: center;
         .pic-right-img {
             width: 720px;
             height: 540px;
+            text-align: center;
             img {
                 width: 100%;
-                height: 100%;
             }
         }
     }
 }
 </style>
 <style lang="less">
-.tpyl {
+.tpyl-1 {
+    overflow: hidden;
     .el-dialog {
-        height: 80% !important;
+        height: 90vh !important;
         margin-top: 5vh !important;
-    }
-    .el-dialog__body {
-        padding: 0;
+        .el-dialog__body {
+            padding: 10px;
+        }
     }
 }
 </style>

+ 89 - 71
src/components/floorList.vue

@@ -6,14 +6,19 @@
 <template>
     <div class='floor-box'>
         <div class='floor-list'>
-            <!-- <i class='el-icon-caret-top icon-top' v-if='showT' @click='removeTop(num)'></i> -->
             <div v-if='floorsArr.length>5'>
-                <i class='el-icon-caret-top icon-top' v-if='showT' @click='changeFloor(1)'></i>
-                <i class='el-icon-caret-top icon-top' v-else style='color:#ccc'></i>
+                <i
+                    class='el-icon-caret-top icon-top'
+                    :class='{disabled:currentFloorId == floorsArr[0].seq }'
+                    v-if='showT'
+                    @click='changeFloor(1)'
+                    @mousedown='mousedown'
+                    @mouseup='mouseup'
+                ></i>
+                <i class='el-icon-caret-top icon-top' :class='{disabled:currentFloorId == floorsArr[0].seq }' v-else style='color:#ccc'></i>
             </div>
-
             <div class='floor-out'>
-                <div class='floor-center'>
+                <div class='floor-center' :style='{ marginTop : marginTop }'>
                     <div
                         class='floor-item'
                         :class='item.seq == currentFloorId?"isActive":""'
@@ -23,16 +28,24 @@
                     >{{item.code}}</div>
                 </div>
             </div>
-            <!-- <i class='el-icon-caret-bottom icon-bottom' v-if='showB' @click='removeBottom(num)'></i> -->
             <div v-if='floorsArr.length>5'>
-                <i class='el-icon-caret-bottom icon-bottom' v-if='showB' @click='changeFloor(-1)'></i>
-                <i class='el-icon-caret-bottom icon-bottom' v-else style='color:#ccc'></i>
+                <i
+                    class='el-icon-caret-bottom icon-bottom'
+                    :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }'
+                    v-if='showB'
+                    @click='changeFloor(-1)'
+                ></i>
+                <i
+                    class='el-icon-caret-bottom icon-bottom'
+                    :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }'
+                    v-else
+                    style='color:#ccc'
+                ></i>
             </div>
         </div>
     </div>
 </template>
 <script>
-import { animate } from '@/utils/animate.js'
 export default {
     data() {
         return {
@@ -48,10 +61,31 @@ export default {
                 name: '第1层',
                 seq: 100
             },
-            currentFloorId: null
+            currentFloorId: null,
+            marginTop: 0,
+            startTime: '',
+            endTime: ''
+        }
+    },
+    props: {
+        floorsArr: {
+            type: Array
+            /*  default: () => {
+                return [
+                    { name: '第6层', code: 'F6', gname: 'f6', gcode: '6F', seq: 600 },
+                    { name: '第5层', code: 'F5', gname: 'f5', gcode: '5F', seq: 500 },
+                    { name: '第4层', code: 'F4', gname: 'f4', gcode: '4F', seq: 400 },
+                    { name: '第3层', code: 'F3', gname: 'f3', gcode: '3F', seq: 300 },
+                    { name: '第2层', code: 'F2', gname: 'f2', gcode: '2F', seq: 200 },
+                    { name: '第1层', code: 'F1', gname: 'f1', gcode: '1F', seq: 100 },
+                    { name: '地下1层', code: 'B1', gname: 'b1', gcode: 'B1', seq: -100 },
+                    { name: '地下2层', code: 'B2', gname: 'b2', gcode: 'B2', seq: -200 },
+                    { name: '地下3层', code: 'B3', gname: 'b3', gcode: 'B3', seq: -300 },
+                    { name: '地下4层', code: 'B4', gname: 'b4', gcode: 'B4', seq: -400 }
+                ]
+            } */
         }
     },
-    props: ['floorsArr'],
     mounted() {
         this.init()
     },
@@ -65,6 +99,16 @@ export default {
         // }
     },
     methods: {
+        mousedown() {
+            this.startTime = new Date()
+            console.log()
+        },
+        mouseup() {
+            this.endTime = new Date()
+            if (this.endTime - this.startTime < 200) {
+                return false
+            }
+        },
         init() {
             if (!this.floorsArr.length) {
                 return false
@@ -95,27 +139,12 @@ export default {
             }
             // 数据处理
             this.handleCookie()
-            //楼层位置处理,
-            const inner = document.querySelectorAll('.floor-item')
-            const innerbox = document.querySelector('.floor-center')
-            // 页面显示5条,当第五条以上,进行marginTop修改
-            // index从0开始
-            // TODO: 需要修改可以修改这里,配置页面样式,修改showNumber和height
-            let showNumber = 5, //页面中展示的楼层条数
-                height = 32, //一个楼层的div标签高度
-                timer = 500 //动画时长
-            // flag 为0时,timer设置为0
-            flag === 0 && (timer = 0)
-            if (index >= showNumber - 1) {
-                animate(innerbox, { marginTop: -height * (index - (showNumber - 2)) }, timer)
-                // index < len - 1 && animate(innerbox, { marginTop: -height * (index - (showNumber - 2)) }, timer)
-            } else {
-                // 前 showNumber 条的margin-top设置为0
-                animate(innerbox, { marginTop: 0 }, 500)
-            }
+            // 楼层位置动画处理
+            this.handlePosition(flag, index, len)
             // 处理上下按钮禁用逻辑
             this.handleUpDownStatus(index, len)
         },
+
         /**
          * @name handleUpDownStatus
          * @param { Number } index 当前楼层在floorIdArr中的下标
@@ -148,6 +177,7 @@ export default {
          * @description cookie数据处理
          */
         handleCookie() {
+            // return true
             let currentFloor = this.floorsArr.filter(item => item.seq == this.currentFloorId)[0]
             this.$cookie.set('floorNow', currentFloor.code, 3)
             this.$cookie.set('floorMapId', currentFloor.gname, 3)
@@ -164,45 +194,34 @@ export default {
         tabFloor(item, index) {
             this.currentFloorId = this.floorIdArr[index]
             this.handleCookie()
+            this.handlePosition(1, index, this.floorIdArr.length)
             this.handleUpDownStatus(index, this.floorIdArr.length)
         },
-        removeTop(num) {
-            //console.log(num)
-            if (num == -1) {
-                this.num = num
-                this.showT = false
-                this.showB = true
-            }
-            var inner = document.querySelectorAll('.floor-item')
-            var innerbox = document.querySelector('.floor-center')
-            if (this.num < 0) {
-                this.num++
-            } else {
-                this.num = 0
-                this.showT = false
-            }
-            if (this.num <= 0) {
-                animate(innerbox, { marginTop: 32 * this.num }, 500, function() {})
-            }
-        },
-        removeBottom(num) {
-            //console.log(num)
-            // let num = 0
-            if (num == -2) {
-                this.num = num
-                this.showB = false
-                this.showT = true
-            }
-            var inner = document.querySelectorAll('.floor-item')
-            var innerbox = document.querySelector('.floor-center')
-            if (this.num > -(inner.length - 4)) {
-                this.num--
+        /**
+         * @description 楼层位置动画处理
+         * @param flag 是否启用动画时长 0:不启用  其他 启动
+         * @param index 楼层 在floorIdArr中的下标
+         * @param len floorIdArr长度
+         */
+        handlePosition(flag, index, len) {
+            //楼层位置处理
+            // 页面显示5条,当第五条以上,进行marginTop修改
+            // index从0开始
+            // TODO: 需要修改可以修改这里,配置页面样式,修改showNumber和height
+            let showNumber = 5, //页面中展示的楼层条数
+                height = 32, //一个楼层的div标签高度
+                timer = 500 //动画时长
+            // flag 为0时,timer设置为0
+            flag === 0 && (timer = 0)
+            if (index >= showNumber - 1) {
+                if (index < len - 1) {
+                    this.marginTop = -height * (index - (showNumber - 2)) + 'px'
+                } else if ((index = len - 1)) {
+                    this.marginTop = -height * (index - (showNumber - 1)) + 'px'
+                }
             } else {
-                this.num = -(inner.length - 4)
-                this.showB = false
-            }
-            if (this.num > -(inner.length - 4)) {
-                animate(innerbox, { marginTop: 32 * this.num }, 500, function() {})
+                // 前 showNumber 条的margin-top设置为0
+                this.marginTop = 0
             }
         }
     }
@@ -216,8 +235,7 @@ export default {
     z-index: 2;
     .floor-list {
         width: 44px;
-        height: 212px;
-        // height: 312px;
+        // height: 212px;
         background: rgba(255, 255, 255, 1);
         box-shadow: 0px 2px 15px 0px rgba(31, 36, 41, 0.08);
         border-radius: 2px;
@@ -226,8 +244,6 @@ export default {
         text-align: center;
         .floor-out {
             height: 160px;
-            // height: 312px;
-            //TODO:
             overflow: hidden;
             // overflow-y: auto;
             position: relative;
@@ -236,8 +252,7 @@ export default {
             // }
 
             .floor-center {
-                // TODO:
-                // margin-top: 0 !important;
+                transition: all linear 0.8s;
                 .floor-item {
                     width: 36px;
                     height: 32px;
@@ -279,5 +294,8 @@ export default {
             line-height: 32px;
         }
     }
+    .disabled {
+        cursor: not-allowed !important;
+    }
 }
 </style>

+ 88 - 76
src/components/floorListOther.vue

@@ -6,14 +6,19 @@
 <template>
     <div class='floor-box'>
         <div class='floor-list'>
-            <!-- <i class='el-icon-caret-top icon-top' v-if='showT' @click='removeTop(num)'></i> -->
             <div v-if='floorsArr.length>5'>
-                <i class='el-icon-caret-top icon-top' v-if='showT' @click='changeFloor(1)'></i>
-                <i class='el-icon-caret-top icon-top' v-else style='color:#ccc'></i>
+                <i
+                    class='el-icon-caret-top icon-top'
+                    :class='{disabled:currentFloorId == floorsArr[0].seq }'
+                    v-if='showT'
+                    @click='changeFloor(1)'
+                    @mousedown='mousedown'
+                    @mouseup='mouseup'
+                ></i>
+                <i class='el-icon-caret-top icon-top' :class='{disabled:currentFloorId == floorsArr[0].seq }' v-else style='color:#ccc'></i>
             </div>
-
             <div class='floor-out'>
-                <div class='floor-center'>
+                <div class='floor-center' :style='{ marginTop : marginTop }'>
                     <div
                         class='floor-item'
                         :class='item.seq == currentFloorId?"isActive":""'
@@ -23,16 +28,24 @@
                     >{{item.code}}</div>
                 </div>
             </div>
-            <!-- <i class='el-icon-caret-bottom icon-bottom' v-if='showB' @click='removeBottom(num)'></i> -->
             <div v-if='floorsArr.length>5'>
-                <i class='el-icon-caret-bottom icon-bottom' v-if='showB' @click='changeFloor(-1)'></i>
-                <i class='el-icon-caret-bottom icon-bottom' v-else style='color:#ccc'></i>
+                <i
+                    class='el-icon-caret-bottom icon-bottom'
+                    :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }'
+                    v-if='showB'
+                    @click='changeFloor(-1)'
+                ></i>
+                <i
+                    class='el-icon-caret-bottom icon-bottom'
+                    :class='{disabled:currentFloorId == floorsArr[floorsArr.length-1].seq }'
+                    v-else
+                    style='color:#ccc'
+                ></i>
             </div>
         </div>
     </div>
 </template>
 <script>
-import { animate } from '@/utils/animate.js'
 export default {
     data() {
         return {
@@ -48,14 +61,32 @@ export default {
                 name: '第1层',
                 seq: 100
             },
-            currentFloorId: null
+            currentFloorId: null,
+            marginTop: 0,
+            startTime: '',
+            endTime: ''
+        }
+    },
+    props: {
+        floorsArr: {
+            type: Array
+            /*  default: () => {
+                return [
+                    { name: '第6层', code: 'F6', gname: 'f6', gcode: '6F', seq: 600 },
+                    { name: '第5层', code: 'F5', gname: 'f5', gcode: '5F', seq: 500 },
+                    { name: '第4层', code: 'F4', gname: 'f4', gcode: '4F', seq: 400 },
+                    { name: '第3层', code: 'F3', gname: 'f3', gcode: '3F', seq: 300 },
+                    { name: '第2层', code: 'F2', gname: 'f2', gcode: '2F', seq: 200 },
+                    { name: '第1层', code: 'F1', gname: 'f1', gcode: '1F', seq: 100 },
+                    { name: '地下1层', code: 'B1', gname: 'b1', gcode: 'B1', seq: -100 },
+                    { name: '地下2层', code: 'B2', gname: 'b2', gcode: 'B2', seq: -200 },
+                    { name: '地下3层', code: 'B3', gname: 'b3', gcode: 'B3', seq: -300 },
+                    { name: '地下4层', code: 'B4', gname: 'b4', gcode: 'B4', seq: -400 }
+                ]
+            } */
         }
     },
-    props: ['floorsArr'],
     mounted() {
-        //console.log('this.floorsArrthis.floorsArrthis.floorsArrthis.floorsArr', this.floorsArr)
-        // this.removeBottom(-1)
-        // this.tabFloor()
         this.init()
     },
     watch: {
@@ -68,6 +99,16 @@ export default {
         // }
     },
     methods: {
+        mousedown() {
+            this.startTime = new Date()
+            console.log()
+        },
+        mouseup() {
+            this.endTime = new Date()
+            if (this.endTime - this.startTime < 200) {
+                return false
+            }
+        },
         init() {
             if (!this.floorsArr.length) {
                 return false
@@ -76,7 +117,6 @@ export default {
             this.floorsArr.map(item => {
                 this.floorIdArr.push(item.seq)
             })
-            // this.currentFloorId = Number(this.$cookie.get('currentFloorId') || 100)
             this.currentFloorId = this.floorsArr[0].seq
             this.changeFloor(0)
         },
@@ -99,27 +139,12 @@ export default {
             }
             // 数据处理
             this.handleCookie()
-            //楼层位置处理,
-            const inner = document.querySelectorAll('.floor-item')
-            const innerbox = document.querySelector('.floor-center')
-            // 页面显示5条,当第五条以上,进行marginTop修改
-            // index从0开始
-            // TODO: 需要修改可以修改这里,配置页面样式,修改showNumber和height
-            let showNumber = 5, //页面中展示的楼层条数
-                height = 32, //一个楼层的div标签高度
-                timer = 500 //动画时长
-            // flag 为0时,timer设置为0
-            flag === 0 && (timer = 0)
-            if (index >= showNumber - 1) {
-                animate(innerbox, { marginTop: -height * (index - (showNumber - 2)) }, timer)
-                // index < len - 1 && animate(innerbox, { marginTop: -height * (index - (showNumber - 2)) }, timer)
-            } else {
-                // 前 showNumber 条的margin-top设置为0
-                animate(innerbox, { marginTop: 0 }, 500)
-            }
+            // 楼层位置动画处理
+            this.handlePosition(flag, index, len)
             // 处理上下按钮禁用逻辑
             this.handleUpDownStatus(index, len)
         },
+
         /**
          * @name handleUpDownStatus
          * @param { Number } index 当前楼层在floorIdArr中的下标
@@ -152,6 +177,7 @@ export default {
          * @description cookie数据处理
          */
         handleCookie() {
+            // return true
             let currentFloor = this.floorsArr.filter(item => item.seq == this.currentFloorId)[0]
             // this.$cookie.set('floorNow', currentFloor.code, 3)
             // this.$cookie.set('floorMapId', currentFloor.gname, 3)
@@ -168,45 +194,34 @@ export default {
         tabFloor(item, index) {
             this.currentFloorId = this.floorIdArr[index]
             this.handleCookie()
+            this.handlePosition(1, index, this.floorIdArr.length)
             this.handleUpDownStatus(index, this.floorIdArr.length)
         },
-        removeTop(num) {
-            //console.log(num)
-            if (num == -1) {
-                this.num = num
-                this.showT = false
-                this.showB = true
-            }
-            var inner = document.querySelectorAll('.floor-item')
-            var innerbox = document.querySelector('.floor-center')
-            if (this.num < 0) {
-                this.num++
-            } else {
-                this.num = 0
-                this.showT = false
-            }
-            if (this.num <= 0) {
-                animate(innerbox, { marginTop: 32 * this.num }, 500, function() {})
-            }
-        },
-        removeBottom(num) {
-            //console.log(num)
-            // let num = 0
-            if (num == -2) {
-                this.num = num
-                this.showB = false
-                this.showT = true
-            }
-            var inner = document.querySelectorAll('.floor-item')
-            var innerbox = document.querySelector('.floor-center')
-            if (this.num > -(inner.length - 4)) {
-                this.num--
+        /**
+         * @description 楼层位置动画处理
+         * @param flag 是否启用动画时长 0:不启用  其他 启动
+         * @param index 楼层 在floorIdArr中的下标
+         * @param len floorIdArr长度
+         */
+        handlePosition(flag, index, len) {
+            //楼层位置处理
+            // 页面显示5条,当第五条以上,进行marginTop修改
+            // index从0开始
+            // TODO: 需要修改可以修改这里,配置页面样式,修改showNumber和height
+            let showNumber = 5, //页面中展示的楼层条数
+                height = 32, //一个楼层的div标签高度
+                timer = 500 //动画时长
+            // flag 为0时,timer设置为0
+            flag === 0 && (timer = 0)
+            if (index >= showNumber - 1) {
+                if (index < len - 1) {
+                    this.marginTop = -height * (index - (showNumber - 2)) + 'px'
+                } else if ((index = len - 1)) {
+                    this.marginTop = -height * (index - (showNumber - 1)) + 'px'
+                }
             } else {
-                this.num = -(inner.length - 4)
-                this.showB = false
-            }
-            if (this.num > -(inner.length - 4)) {
-                animate(innerbox, { marginTop: 32 * this.num }, 500, function() {})
+                // 前 showNumber 条的margin-top设置为0
+                this.marginTop = 0
             }
         }
     }
@@ -220,8 +235,6 @@ export default {
     z-index: 2;
     .floor-list {
         width: 44px;
-        // height: 212px;
-        // height: 312px;
         background: rgba(255, 255, 255, 1);
         box-shadow: 0px 2px 15px 0px rgba(31, 36, 41, 0.08);
         border-radius: 2px;
@@ -229,9 +242,6 @@ export default {
         padding: 28px 4px;
         text-align: center;
         .floor-out {
-            // height: 160px;
-            // height: 312px;
-            //TODO:
             overflow: hidden;
             // overflow-y: auto;
             position: relative;
@@ -240,8 +250,7 @@ export default {
             // }
 
             .floor-center {
-                // TODO:
-                // margin-top: 0 !important;
+                transition: all linear 0.8s;
                 .floor-item {
                     width: 36px;
                     height: 32px;
@@ -283,5 +292,8 @@ export default {
             line-height: 32px;
         }
     }
+    .disabled {
+        cursor: not-allowed !important;
+    }
 }
 </style>

+ 20 - 6
src/components/floorMap/index.vue

@@ -128,6 +128,10 @@ export default {
                     this.scene.addItem(imgItem)
                     this.view.scene = this.scene
                     this.view.fitSceneToView()
+                    this.view.minScale = this.view.scale
+                    if (this.$refs.canvasFun) {
+                        this.$refs.canvasFun.everyScale = this.view.scale
+                    }
                     this.loading = false
                 }
             } else {
@@ -150,6 +154,10 @@ export default {
                         fParser.casementList.forEach(t => this.scene.addItem(t))
                         this.view.scene = this.scene
                         this.view.fitSceneToView()
+                        this.view.minScale = this.view.scale
+                        if (this.$refs.canvasFun) {
+                            this.$refs.canvasFun.everyScale = this.view.scale
+                        }
                         this.loading = false
                         //console.log('success')
                     })
@@ -167,8 +175,6 @@ export default {
         },
         listChange(item, ev) {
             let name = ev[0][0].data.Name
-            console.log(item, ev)
-
             if (name.slice(name.length - 2, name.length) == '机房') {
                 this.$refs.boxRoom.open({ name: name, type: this.type })
             }
@@ -196,6 +202,7 @@ export default {
                 return
             }
             let scale = this.view.scale
+            console.log(val / scale, this.canvasWidth / 2, this.canvasHeight / 2)
             this.view.scaleByPoint(val / scale, this.canvasWidth / 2, this.canvasHeight / 2)
         },
         // 读取数据
@@ -214,24 +221,31 @@ export default {
                 this.canvasHeight = this.$refs.graphy.offsetHeight - 100
             } else {
                 this.canvasWidth = this.$refs.graphy.offsetWidth
-                this.canvasHeight = 900 + 'px'
+                this.canvasHeight = 900
+            }
+        }
+    },
+    watch: {
+        'view.scale': {
+            handler(n) {
+                if (this.$refs.canvasFun) {
+                    let s = (n * 10) / this.view.minScale
+                    this.$refs.canvasFun.sliderVal = s > 1000 ? 1000 : s
+                }
             }
         }
     },
-    watch: {},
     mounted() {
         this.mapSize()
     },
     created() {
         this.urlMsg = {
-            // categoryId: this.$cookie.get('categoryId') || 'LCGN',
             categoryId: this.$cookie.get('categoryId'),
             ProjectID: this.plazaId,
             BuildingID: '1',
             FloorID: this.$cookie.get('floorMapId') || 'f1',
             fmapID: this.fmapID
         }
-        //console.log('this.urlMsg', this.urlMsg)
     }
 }
 </script>

+ 19 - 18
src/store/index.js

@@ -1,6 +1,6 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import { login, queryFloor, queryfmapID } from '@/api/login.js'
+import Vue from "vue"
+import Vuex from "vuex"
+import { login, queryFloor, queryfmapID } from "@/api/login.js"
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
@@ -8,15 +8,15 @@ export default new Vuex.Store({
         permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
         plazas: [], //项目列表
         userInfo: {
-            employeename: '', //用户名称:艾宇;
-            orgCode: '',
-            username: 'lengqiang', //账户名称
+            employeename: "", //用户名称:艾宇;
+            orgCode: "",
+            username: "lengqiang", //账户名称
         },
-        plazaId: '1000423',
-        projectName: '', //全局项目名称
+        plazaId: "1000423",
+        projectName: "", //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
-        fmapID: '',
+        fmapID: "",
     },
     getters: {
         floorsArr: (state) => state.floorsArr,
@@ -42,8 +42,9 @@ export default new Vuex.Store({
             state.floorsArr = data
             if (data.length > 0) {
                 data.forEach((e) => {
+                    console.log(e)
                     let obj = {
-                        id: e.code,
+                        id: e.gname,
                         name: e.code,
                     }
                     state.floorSelect.push(obj)
@@ -60,19 +61,19 @@ export default new Vuex.Store({
             await login({
                 username: palyload,
             }).then((res) => {
-                if (res.result == 'success') {
-                    commit('SETISREQUESTtAUTH', true)
-                    commit('SETAUTHMSG', res)
+                if (res.result == "success") {
+                    commit("SETISREQUESTtAUTH", true)
+                    commit("SETAUTHMSG", res)
                 } else {
-                    console.log('接口报错!!')
-                    commit('SETISREQUESTtAUTH', false)
+                    console.log("接口报错!!")
+                    commit("SETISREQUESTtAUTH", false)
                 }
             })
         },
         getFloors(context) {
             queryFloor({ plazaId: context.state.plazaId }).then((res) => {
-                if (res.result == 'success') {
-                    context.commit('SETFLOORS', res.data)
+                if (res.result == "success") {
+                    context.commit("SETFLOORS", res.data)
                 }
             })
         },
@@ -80,7 +81,7 @@ export default new Vuex.Store({
             await queryfmapID({
                 mapId: context.state.plazaId,
             }).then((res) => {
-                context.commit('SETMAPID', `${context.state.plazaId}_${res.mapVersion}`)
+                context.commit("SETMAPID", `${context.state.plazaId}_${res.mapVersion}`)
             })
         },
     },

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 360 - 360
src/utils/plugins/components.js


+ 46 - 48
src/views/equipment/eqDialog.vue

@@ -33,45 +33,40 @@
                 <el-tabs v-model='activeName' @tab-click='handleClick' v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length>0'>
                     <el-tab-pane
                         v-for='(value,index) in dialogInfo.children'
+                        v-if='value.id.slice(2,4)!="YL"'
                         :key='"u"+index'
                         :label='`${value.label}`'
                         :name='`${value.param.tab_code}`'
-                        @click='tabClick(value)'
                     >
-                        <!-- 有tab的原理图 -->
-                        <div v-if='value.id.slice(2,4)=="YL"' style='width:100%;height:600px;overflow:hidden'>
-                            <rotation :rotationImg='rotationImg'></rotation>
-                        </div>
                         <!-- 主要设备清单 标准设备表格加tab -->
-                        <tableList v-else-if='value.id.slice(0,4)=="RDQD"' :param='param' ref='list1' major='弱电'></tableList>
+                        <tableList v-if='value.id.slice(0,4)=="RDQD"' :param='param' ref='list1' major='弱电'></tableList>
                         <tableList v-else-if='value.id.slice(0,4)=="NTQD"' :param='param' ref='list2' major='暖通'></tableList>
                         <!-- 维保表格 -->
-                        <wb-table
-                            v-else-if='value.id.slice(2,4)=="WB"'
-                            :smsxt='smsxt'
-                            :tabLabel='tabLabel'
-                            :difference='difference'
-                            :major='dialogInfo.id'
-                        ></wb-table>
+                        <wb-table v-else-if='value.id.slice(2,4)=="WB"' :smsxt='smsxt' :tabLabel='tabLabel' :diff='diff' :major='dialogInfo.id'></wb-table>
                         <!-- 维修的表格 -->
-                        <wx-table
-                            v-else-if='value.id.slice(2,4)=="WX"'
-                            :smsxt='smsxt'
-                            :tabLabel='tabLabel'
-                            :difference='difference'
-                            :major='dialogInfo.id'
-                        ></wx-table>
+                        <wx-table v-else-if='value.id.slice(2,4)=="WX"' :smsxt='smsxt' :tabLabel='tabLabel' :diff='diff' :major='dialogInfo.id'></wx-table>
                         <!-- 专维 -->
-                        <zw-table
-                            v-else-if='value.id.slice(2,4)=="ZW"'
-                            :smsxt='smsxt'
-                            :tabLabel='tabLabel'
-                            :difference='difference'
-                            :major='dialogInfo.id'
-                        ></zw-table>
+                        <zw-table v-else-if='value.id.slice(2,4)=="ZW"' :smsxt='smsxt' :tabLabel='tabLabel' :diff='diff' :major='dialogInfo.id'></zw-table>
                         <!-- 其他 -->
                         <other-table v-else-if='value.id.slice(2,4)=="QT"' ref='qtList' :tabLabel='tabLabel' :smsxt='smsxt' :major='dialogInfo.id'></other-table>
                     </el-tab-pane>
+                    <template v-for='(value,index) in dialogInfo.children'>
+                        <template v-for='(eve,index1) in tabCount'>
+                            <template v-if='eve.typecode == value.param.type_code'>
+                                <el-tab-pane
+                                    :key='index1+index'
+                                    :label='`${value.label}`'
+                                    :name='`${value.param.type_code}`'
+                                    v-if='value.id.slice(2,4)=="YL" && eve.count>0'
+                                >
+                                    <!-- 有tab的原理图 -->
+                                    <div style='width:100%;height:600px;overflow:hidden'>
+                                        <rotation :rotationImg='rotationImg'></rotation>
+                                    </div>
+                                </el-tab-pane>
+                            </template>
+                        </template>
+                    </template>
                 </el-tabs>
             </div>
         </el-dialog>
@@ -100,28 +95,24 @@ export default {
             dialogInfo: {},
             param: '', //区分清单tab
             typecode: '', //区分原理图的tab
-            difference: '', //区分给水排水
+            diff: '', //区分给水排水
             rotationImg: [],
-            tabLabel: ''
+            tabLabel: '',
+            tabCount: []
         }
     },
     mounted() {},
     components: { tableList, tjTable, wbTable, zwTable, lookPage, standTable, otherTable, wxTable, recordDialog, djspTable },
     methods: {
-        modalClose() {
-            this.visible = false
-        },
-        modalConfirm() {
-            //console.log('alertConfirm')
-        },
         //打开弹窗
         showModal(item) {
+            console.log(item)
             this.visible = true
             this.dialogInfo = item
             if (Object.keys(this.dialogInfo).length > 0 && this.dialogInfo.children.length > 0) {
                 this.activeName = this.dialogInfo.children[0].param.tab_code
                 this.typecode = this.dialogInfo.children[0].param.type_code
-                this.difference = this.dialogInfo.children[0].param.difference
+                this.diff = this.dialogInfo.children[0].param.diff
                 if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL') {
                     this.isShowTab()
                     this.initImage(this.typecode)
@@ -148,16 +139,13 @@ export default {
             //原理图的tab怎么传typecode
             if (this.dialogInfo.children.length > 0) {
                 this.typecode = this.dialogInfo.children[`${tab.index}`].param.type_code
-                this.difference = this.dialogInfo.children[`${tab.index}`].param.difference
+                this.diff = this.dialogInfo.children[`${tab.index}`].param.diff
             }
             if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL') {
                 this.initImage(this.typecode)
             }
             this.tabLabel = tab.label
         },
-        // tabClick(e) {
-        //     //console.log(e.label, e.name, '-----.')
-        // },
         visibalBox() {
             this.$refs.Dialog.open(this.dialogInfo.id)
         },
@@ -166,10 +154,11 @@ export default {
             let getParams = {
                 plazaId: this.$store.state.plazaId,
                 // system: this.systemName.slice(0, 2),
-                system: this.systemName,
-                siteid: '1000423',
+                // system: this.systemName,
+                plazaId: this.$store.state.plazaId,
                 module: '1002',
-                neTypename: '位置布置图'
+                neTypename: '位置布置图',
+                typecode: typecode
             }
             switch (this.systemName) {
                 case '暖通系统':
@@ -197,7 +186,7 @@ export default {
             if (this.systemName == '供电系统') {
                 getParams.system = '1001'
             }
-
+            console.log(getParams)
             queryPic({ getParams }).then(res => {
                 this.rotationImg = res.data || []
             })
@@ -212,7 +201,8 @@ export default {
             if (this.dialogInfo.children.length == 0) {
                 postParams.push({
                     params: {
-                        tyepcode: this.dialogInfo.param.type_code
+                        typecode: this.dialogInfo.param.type_code,
+                        module: '1002'
                     },
                     tableName: 'glsms_proimgup'
                 })
@@ -220,15 +210,23 @@ export default {
                 this.dialogInfo.children.forEach(el => {
                     postParams.push({
                         params: {
-                            tyepcode: el.param.type_code
+                            typecode: el.param.type_code,
+                            module: '1002'
                         },
                         tableName: 'glsms_proimgup'
                     })
                 })
             }
-
             queryTab({ data, postParams }).then(res => {
-                //console.log(res)
+                this.tabCount = []
+                console.log('res', res)
+                let data = res.data.data || []
+                data.forEach(el => {
+                    this.tabCount.push({
+                        count: el.count,
+                        typecode: el.params.typecode
+                    })
+                })
             })
         }
     }

+ 13 - 2
src/views/equipment/index.vue

@@ -99,7 +99,7 @@ export default {
         },
         emitFloor(item) {
             this.floorInfo = item
-            // this.$refs.floorMap.init(this.floorInfo.gname)
+            this.$refs.floorMap.init(this.floorInfo.gname)
             this.init()
         },
         dialogVisible(eve) {
@@ -133,9 +133,20 @@ export default {
         }
     },
     mounted() {
+        console.log('smsxtsmsxtsmsxt', this.$route.query.smsxt)
+        if (this.$route.query.smsxt) {
+            this.smsxt = this.$route.query.smsxt
+            this.system.forEach(el => {
+                if (el.smsxt == this.smsxt) {
+                    this.everySystem = el.children
+                    this.systemName = el.name
+                    this.systemId = el.id
+                }
+            })
+        }
         this.everySystem = this.system[0].children
         this.init()
-        // this.$refs.floorMap.init(this.floorInfo.gname)
+        this.$refs.floorMap.init(this.floorInfo.gname)
     },
     computed: {
         ...mapGetters(['floorsArr'])

+ 5 - 4
src/views/equipment/table/djspTable.vue

@@ -82,11 +82,10 @@ export default {
         },
         getList() {
             let getParams = {
-                page: 1,
-                size: 10
+                orderBy: `floor,0;welldesm,1;meterbox,1;`
             }
             if (this.floor) {
-                getParams.floor = this.floorSelect
+                getParams.floor = this.floor
             }
             getParams.keyword = ''
             if (this.welldes) {
@@ -103,10 +102,12 @@ export default {
                 this.tableData = []
                 let floor = {}
                 res.data.forEach(i => {
+                    console.log(i)
                     Object.keys(i).forEach(key => (floor[key] = 0)) // 初始化每一楼层个数为0
                     Object.values(i).forEach(j => {
                         Object.values(j).forEach(k => {
-                            this.tableData.push(...k)
+                            console.log(k)
+                            this.tableData.push(k)
                         })
                     })
                 })

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

@@ -71,7 +71,7 @@
                 <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
             </el-table-column>
             <el-table-column prop='floor' sortable label='楼层' width='100'>
-                <template slot-scope='{row}'>{{row.floor || '--'}}</template>
+                <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
             </el-table-column>
             <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
@@ -250,7 +250,7 @@ export default {
             }
             //下拉筛选
             if (this.floor) {
-                postParams.floor = this.floor
+                postParams.gname = this.floor
             }
             if (this.sbglgs) {
                 postParams.sbglgs = this.sbglgs

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

@@ -46,7 +46,7 @@
                 <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
             </el-table-column>
             <el-table-column prop='floorcode' label='楼层' width='100'>
-                <template slot-scope='{row}'>{{row.floor || '--'}}</template>
+                <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
             </el-table-column>
             <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
@@ -127,7 +127,7 @@ export default {
             //下拉
             if (this.floor) {
                 console.log(this.floor)
-                postParams.floor = this.floor
+                postParams.gname = this.floor
             }
             console.log(this.floor)
             //输入框搜索

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

@@ -1,7 +1,7 @@
 <template>
     <!-- 记录事项 -->
     <div class='detail-dialog'>
-        <el-dialog :title='`${major}${tabName}记录事项`' :visible.sync='visible' style='height:900px;overflow-y:scroll;'>
+        <el-dialog :title='`${major}${tabName}记录事项`' width='70%' :visible.sync='visible' style='height:900px;overflow-y:scroll;'>
             <div class='bottom-table' style='height:520px'>
                 <el-table :data='tableData' height='500' :border='true' style='width: 100%;margin-bottom:12px;' :span-method='objectSpanMethod'>
                     <el-table-column label='位置' prop width='140' show-overflow-tooltip resizable>

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

@@ -47,7 +47,7 @@
                 <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
             </el-table-column>
             <el-table-column prop='floor' label='楼层' width='100'>
-                <template slot-scope='{row}'>{{row.floor || '--'}}</template>
+                <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
             </el-table-column>
             <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
@@ -65,7 +65,7 @@
             ></el-pagination>
         </div>
         <!-- 标准表格详情钻取表 -->
-        <el-dialog width='1260px' style='height:900px;overflow: hidden;' title='标准设备展开清单' :visible.sync='innerVisible' append-to-body>
+        <el-dialog width='90%' style='height:900px;overflow: hidden;' title='标准设备展开清单' :visible.sync='innerVisible' append-to-body>
             <eq-detail ref='qdDialog' :row='row' :major='major'></eq-detail>
         </el-dialog>
     </div>
@@ -132,7 +132,7 @@ export default {
             }
             //下拉
             if (this.floor) {
-                data.floor = this.floor
+                data.gname = this.floor
             }
             //输入框搜索
             data.keyword = ''

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

@@ -158,7 +158,7 @@ export default {
             matters: ''
         }
     },
-    props: ['smsxt', 'major', 'difference', 'tabLabel'],
+    props: ['smsxt', 'major', 'diff', 'tabLabel'],
     computed: {
         ...mapGetters(['floorSelect'])
     },
@@ -176,7 +176,7 @@ export default {
             let getParams = {
                 data: {
                     smsxt: this.smsxt,
-                    difference: this.difference,
+                    diff: this.diff,
                     plazaId: this.$store.state.plazaId,
                     page: this.currentPage,
                     size: this.size,
@@ -231,7 +231,7 @@ export default {
         }
     },
     watch: {
-        difference(newV, oldV) {
+        diff(newV, oldV) {
             if (newV !== oldV) {
                 this.getList()
             }

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

@@ -169,7 +169,7 @@ export default {
     computed: {
         ...mapGetters(['floorSelect'])
     },
-    props: ['smsxt', 'major', 'difference', 'tabLabel'],
+    props: ['smsxt', 'major', 'diff', 'tabLabel'],
     methods: {
         //多余输入框监听
         confirm(wonum) {
@@ -184,7 +184,7 @@ export default {
             let getParams = {
                 data: {
                     smsxt: this.smsxt,
-                    difference: this.difference,
+                    diff: this.diff,
                     plazaId: this.$store.state.plazaId,
                     page: this.currentPage,
                     size: this.size,
@@ -238,7 +238,7 @@ export default {
         }
     },
     watch: {
-        difference(newV, oldV) {
+        diff(newV, oldV) {
             if (newV !== oldV) {
                 this.getList()
             }

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

@@ -146,7 +146,7 @@ export default {
     computed: {
         ...mapGetters(['floorSelect'])
     },
-    props: ['smsxt', 'major', 'difference', 'tabLabel'],
+    props: ['smsxt', 'major', 'diff', 'tabLabel'],
     methods: {
         //多余输入框监听
         confirm(status, yssjwcsj) {
@@ -233,7 +233,7 @@ export default {
                     smsxt: this.smsxt,
                     plazaId: this.$store.state.plazaId,
                     page: this.currentPage,
-                    difference: this.difference,
+                    diff: this.diff,
                     size: this.size
                 }
             }
@@ -278,7 +278,7 @@ export default {
         }
     },
     watch: {
-        difference(newV, oldV) {
+        diff(newV, oldV) {
             if (newV !== oldV) {
                 this.tabFind()
                 this.getList()

+ 7 - 4
src/views/room/index.vue

@@ -818,6 +818,7 @@ export default {
             }
             querySystem(params).then(res => {
                 this.smsxtArr = res.data[0]
+                console.log(this.smsxtArr)
                 this.content = `查看${this.$cookie.get('floorNow')}层${this.smsxtArr.smsxtname}分布图`
             })
         },
@@ -834,10 +835,12 @@ export default {
         },
         // 机房右上角的跳转 如果是在楼层功能打开的机房则要跳转到设备设施对应的系统\楼层 反之亦然
         jumpFloor() {
-            if (location.pathname.split('/')[3] == 'equipment') {
-                this.$router.push({ path: '/home/floorFunc' })
-            } else {
-                this.$router.push({ path: '/home/equipment' })
+            if (this.smsxtArr.smsxt) {
+                if (location.pathname.split('/')[3] == 'equipment') {
+                    this.$router.push({ path: '/home/floorFunc' })
+                } else {
+                    this.$router.push({ path: '/home/equipment', query: { smsxt: this.smsxtArr.smsxt } })
+                }
             }
         }
     },

+ 5 - 1
vue.config.js

@@ -1,6 +1,8 @@
 module.exports = {
     devServer: {
+        port: 8090,
         proxy: {
+            // 工程信息化服务
             '/data': {
                 target: 'http://192.168.200.87:9003',
                 changeOrigin: true,
@@ -9,6 +11,7 @@ module.exports = {
                     '^/data': '',
                 },
             },
+            // 万达蜂鸟服务
             '/wdfn': {
                 target: 'http://map.wanda.cn',
                 changeOrigin: true,
@@ -16,6 +19,7 @@ module.exports = {
                     '^/wdfn': '/editor',
                 },
             },
+            // 图例库服务
             '/serve': {
                 target: 'http://192.168.200.87:8088',
                 // target: 'http://192.168.200.83:8085',
@@ -55,4 +59,4 @@ module.exports = {
     outputDir: 'wandaBmGuide',
     // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
     assetsDir: 'static',
-}
+}