guoxiaohuan 4 سال پیش
والد
کامیت
72ca70f1a0

+ 4 - 5
src/components/Legend/src/legend.vue

@@ -6,9 +6,9 @@
 <template>
     <div>
         <div class='legend-container'>
-            <div :class='showView===1?"legend2":"legend"' @click='showTl' v-if='(type==1 || floors.length>0)&& isMessage'>图例</div>
+            <div :class='showView===1?"legend2":"legend"' @click='showTl' v-if='(type==1 || floors.length>0)&& isMessage && legendTable.length>0 '>图例</div>
             <!-- 图里展示状态组件 -->
-            <el-collapse-transition v-if='(type==1 || floors.length>0)&& isMessage'>
+            <el-collapse-transition v-if='(type==1 || floors.length>0)&& isMessage && legendTable.length>0 '>
                 <div class='legend-tab' v-if='showView===1'>
                     <div class='legend-table2' v-if='systemName=="土建系统"'>
                         <lengend-view @changeSwitch='handleSwich' :remarksText='remarksText' ref='viewLengend' :systemName='systemName'></lengend-view>
@@ -23,7 +23,7 @@
                 <div v-if='showView===2'>
                     <lengend-edit
                         @handleSwich2='handleSwich2'
-                        v-if='editTable.length>=0'
+                        v-if='editTable.length>0'
                         :loading='loading1'
                         ref='editLen'
                         :editTable='editTable'
@@ -135,7 +135,7 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'floorSelect', 'isMessage', 'ssoToken', 'showView'])
+        ...mapGetters(['plazaId', 'fmapID', 'floorSelect', 'isMessage', 'ssoToken', 'showView', 'legendTable'])
     },
     props: {
         floors: {
@@ -325,7 +325,6 @@ export default {
                 let viewTable = []
                 viewTable = res.data.Data ? res.data.Data : []
                 this.$store.commit('SETLEGENDTABLE', viewTable)
-
                 if (viewTable.length > 0) {
                     viewTable.forEach(el => {
                         if (el.Name == '主要设备房') {

+ 8 - 14
src/components/Rotation/src/rotation.vue

@@ -31,17 +31,16 @@ export default {
     },
     methods: {
         changePic(val) {
-            this.rotationImg.forEach((el, i) => {
-                if (val === i) {
-                    this.$store.commit('SETPIC', el.url)
-                } else {
-                    this.$store.commit('SETPIC', '')
-                }
-                this.$emit('scan', el.url || '')
-            })
+            if (this.type == 2) {
+                this.$emit('scan', val + 1)
+            }
         }
     },
-    mounted() {}
+    mounted() {
+        if (this.type == 2) {
+            this.changePic(1)
+        }
+    }
 }
 </script>
 <style lang="less" scoped>
@@ -97,13 +96,8 @@ export default {
     .rotationCon {
         height: 100%;
         width: 100%;
-        // display: flex;
     }
     img {
-        // max-width: 100%;
-        // max-height: 100%;
-        // display: block;
-        // margin: auto;
         width: 100%;
         height: 100%;
         object-fit: fill;

+ 1 - 1
src/components/editLengend.vue

@@ -7,7 +7,7 @@
     <div class='view'>
         <div class='legend-tab2'>
             <div class='legend-table2-box'>
-                <div class='legend-table2' v-if='editTable.length>=0'>
+                <div class='legend-table2' v-if='editTable.length>0'>
                     <el-table
                         v-loading='loading'
                         :header-cell-style='{background:"rgba(2,91,170,0.1)",fontFamily:"PingFangSC-Medium,PingFang SC;",color:"rgba(0,0,0,0.85);",fontSize:"12px"}'

+ 13 - 1
src/components/floorList.vue

@@ -45,6 +45,7 @@
 </template>
 <script>
 import store from '../store'
+import { mapGetters } from 'vuex'
 export default {
     data() {
         return {
@@ -74,7 +75,11 @@ export default {
             }
         }
     },
+    computed: {
+        ...mapGetters(['legendTable'])
+    },
     mounted() {
+        window.vm = this
         this.init()
     },
     methods: {
@@ -173,11 +178,18 @@ export default {
          * @param {Number} 楼层信息在floorsArr数组中的位置
          */
         tabFloor(item, index) {
-            this.$store.commit('SETSHOWVIEW', 1)
             this.currentFloorId = this.floorIdArr[index]
             this.handleCookie()
             this.handlePosition(1, index, this.floorIdArr.length)
             this.handleUpDownStatus(index, this.floorIdArr.length)
+            this.viewLengend()
+        },
+        viewLengend() {
+            if (this.legendTable.length > 0) {
+                this.$store.commit('SETSHOWVIEW', 1)
+            } else {
+                this.$store.commit('SETSHOWVIEW', 0)
+            }
         },
         /**
          * @description 楼层位置动画处理

+ 4 - 8
src/components/viewLengend.vue

@@ -14,17 +14,13 @@
                 :header-cell-style='{background:"rgba(2,91,170,0.1)",fontFamily:"PingFangSC-Medium,PingFang SC;",color:"rgba(0,0,0,0.85);",fontSize:"12px"}'
             >
                 <el-table-column prop label='说明'>
-                    <template slot-scope='{row}'>
-                        <span v-if='row.Properties && row.Properties.ItemExplain'>{{row.Properties.ItemExplain}}</span>
+                    <template slot-scope='{row}' v-if='row.Properties && row.Properties.ItemExplain'>
+                        <span>{{row.Properties.ItemExplain}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column prop label='图例' width='60' align='center'>
-                    <template slot-scope='{row}'>
-                        <div
-                            class='scpz-img'
-                            v-if='row.Properties && row.Properties.ItemExplain'
-                            :style='`background:${row.Properties.FillColor};border:1px solid ${row.Properties.StrokeColor}`'
-                        ></div>
+                    <template slot-scope='{row}' v-if='row.Properties && row.Properties.ItemExplain'>
+                        <div class='scpz-img' :style='`background:${row.Properties.FillColor};border:1px solid ${row.Properties.StrokeColor}`'></div>
                     </template>
                 </el-table-column>
             </el-table>

+ 0 - 5
src/store/index.js

@@ -11,7 +11,6 @@ export default new Vuex.Store({
         ssoToken: 'admin:lengqiang',
         // ssoToken: null,
         isPreview: false,
-        pic: '', //当前轮播的图
         lastRoute: '',
         isrequestAuth: true, // 是否请求登录校验接口
         permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
@@ -37,7 +36,6 @@ export default new Vuex.Store({
         showView: 1,
     },
     getters: {
-        pic: (state) => state.pic,
         isPreview: (state) => state.isPreview,
         ssoToken: (state) => state.ssoToken,
         lastRoute: (state) => state.lastRoute,
@@ -55,9 +53,6 @@ export default new Vuex.Store({
         showView: (state) => state.showView,
     },
     mutations: {
-        SETPIC(state, data) {
-            state.pic = data
-        },
         SETSHOWVIEW(state, data) {
             state.showView = data
         },

+ 9 - 1
src/views/equipment/index.vue

@@ -95,6 +95,7 @@ export default {
             this.$cookie.set('categoryId', item.categoryId, 3)
             this.$refs.floorMap.init(this.floorInfo.gname)
             this.querySmsxt()
+            this.viewLengend()
         },
         querySmsxt() {
             // 目前消防和弱电下面有特殊的数据表格
@@ -144,6 +145,13 @@ export default {
         // 从设备设施进入的机房
         queryType(val) {
             this.type = val
+        },
+        viewLengend() {
+            if (this.legendTable.length > 0) {
+                this.$store.commit('SETSHOWVIEW', 1)
+            } else {
+                this.$store.commit('SETSHOWVIEW', 0)
+            }
         }
     },
     mounted() {
@@ -162,7 +170,7 @@ export default {
         this.$refs.floorMap.init(this.floorInfo.gname)
     },
     computed: {
-        ...mapGetters(['floorsArr', 'plazaId', 'showView'])
+        ...mapGetters(['floorsArr', 'plazaId', 'showView', 'legendTable'])
     }
 }
 </script>

+ 13 - 12
src/views/overview/index.vue

@@ -19,7 +19,7 @@
             <div class='view-left'>
                 <div class='lb-left'>
                     <div v-if='pic2.length>0' style='height:100%'>
-                        <rotation :key='2' :rotationImg='pic2' @scan='scan'></rotation>
+                        <rotation :key='2' type='2' :rotationImg='pic2' @scan='scan'></rotation>
                         <div class='lb-icon' @click='picClick("2")'></div>
                         <img class='lb-img' @click='picClick("2")' src='../../assets/imgs/zk.png' alt />
                     </div>
@@ -78,7 +78,7 @@
                 <div class='view-right-box'>
                     <div class='lb-right'>
                         <div v-if='pic1.length>0' style='height:100%'>
-                            <rotation :rotationImg='pic1' :key='1' @scan='scan'></rotation>
+                            <rotation type='2' :rotationImg='pic1' :key='1' @scan='scan'></rotation>
                             <div class='lb-icon' @click='picClick("1")'></div>
                             <img class='lb-img' @click='picClick("1")' src='../../assets/imgs/zk.png' alt />
                         </div>
@@ -196,10 +196,7 @@ export default {
         return {
             loading: true,
             pic1: [], //区位图
-            pic2: [
-                { url: 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921275833224467353鸟瞰图.jpg' },
-                { url: 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921275833224467353鸟瞰图.jpg' }
-            ], //鸟瞰图
+            pic2: [], //鸟瞰图
             build: {}, //左下信息
             constructions: [], //右下数组
             shuzihuayijiao: '',
@@ -211,11 +208,15 @@ export default {
             this.va = val
         },
         picClick(type) {
-            if (String(this.pic) == String(this.va)) {
-                this.$refs.picModal.showModal([{ url: this.pic }])
-            } else {
-                if (type == 1) {
+            if (type === '1') {
+                if (this.pic1.length >= this.va) {
+                    this.$refs.picModal.showModal([this.pic1[this.va - 1]])
+                } else {
                     this.$refs.picModal.showModal(this.pic1)
+                }
+            } else {
+                if (this.pic2.length >= this.va) {
+                    this.$refs.picModal.showModal([this.pic2[this.va - 1]])
                 } else {
                     this.$refs.picModal.showModal(this.pic2)
                 }
@@ -237,12 +238,12 @@ export default {
                 if (res.result == 'success') {
                     this.loading = false
                     this.pic1 = []
-                    // this.pic2 = []
+                    this.pic2 = []
                     this.build = {}
                     this.constructions = []
                     this.shuzihuayijiao = ''
                     this.pic1 = res.pic1 ? res.pic1 : []
-                    // this.pic2 = res.pic2 ? res.pic2 : []
+                    this.pic2 = res.pic2 ? res.pic2 : []
                     this.build = res.build ? res.build : {}
                     this.constructions = res.constructions ? res.constructions : []
                     this.shuzihuayijiao = res.shuzihuayijiao ? res.shuzihuayijiao : ''