Преглед на файлове

Merge branch 'develop' into aly_dev

guoxiaohuan преди 4 години
родител
ревизия
58b2eac4b6

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

@@ -10,7 +10,7 @@
                 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
             />-->
-            <img :src='rotationImg[0].url' alt />
+            <img :src='rotationImg[0].url' alt ref='imgWidth' />
             <!-- <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'>
@@ -19,14 +19,16 @@
             </el-carousel-item>
         </el-carousel>
     </div>
-</template>s
+</template>
 <script>
 export default {
     name: 'Rotation',
     props: ['rotationImg', 'type'],
     data() {
         return {
-            rotationImgs: [{ url: require('@/assets/images/login_back.png') }]
+            rotationImgs: [{ url: require('@/assets/images/login_back.png') }],
+            myImg: 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921294136524467354供电系统原理图.png',
+            imgInfo: {}
         }
     },
     methods: {
@@ -34,12 +36,27 @@ export default {
             if (this.type == 2) {
                 this.$emit('scan', val + 1)
             }
+        },
+        getImgInfo() {
+            let img = new Image()
+            img.src = this.myImg
+            const vm = this
+            img.onload = function() {
+                vm.$set(vm.imgInfo, 'width', img.width)
+                vm.$set(vm.imgInfo, 'height', img.height)
+                console.log(vm.imgInfo) // 打印图片信息
+            }
+            console.log(this.$refs.imgWidth)
         }
     },
     mounted() {
         if (this.type == 2) {
             this.changePic(1)
         }
+        if (this.rotation.length > 0) {
+            console.log(this.rotation.length)
+        }
+        this.getImgInfo()
     }
 }
 </script>

+ 11 - 4
src/components/floorList.vue

@@ -11,7 +11,7 @@
                 <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
@@ -59,9 +59,10 @@ export default {
             marginTopMax: 0,
             startTime: '',
             endTime: '',
-            showNumber: 8, //需要暂时的楼层数   //TODO:
+            showNumber: 8, //需要展示的楼层数   //TODO:
             height: 39, //一个楼层的高度
-            currIndex: 0 //当前楼层在 楼层数组中的下标,上下箭头使用
+            currIndex: 0, //当前楼层在 楼层数组中的下标,上下箭头使用
+            conHeight: 0 // floor-out 的高度
         }
     },
     props: {
@@ -113,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)
         },
@@ -231,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/store/index.js

@@ -9,7 +9,7 @@ Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
         // ssoToken: 'admin:lengqiang',
-        ssoToken: 'admin:xuliping',
+        ssoToken: 'admin:chuyushu',
         // ssoToken: null,
         plazaName: '',
         isPreview: false,

+ 3 - 2
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' :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 v-if='rotationImg.length>0' type='3' :rotationImg='rotationImg'></rotation>
                                     </div>
                                 </el-tab-pane>
                                 <!-- 发布之后的编辑器的分支图 -->
@@ -208,6 +208,7 @@ export default {
             }
             queryPic({ getParams }).then(res => {
                 this.rotationImg = res.data || []
+                console.log(this.rotationImg)
             })
         },
         //原理图没图片不显示tab 因为供电和燃气系统没有tab所以分开判断

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

@@ -93,13 +93,14 @@ export default {
     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页
@@ -142,12 +143,13 @@ export default {
             }
         },
         /**
-         * 关闭弹窗,子组件传回父组件,
+         * 关闭弹窗后,重新渲染 楼层组件
          * 在父组件(本组件)内将 ShowDialog 置为false
          * @param {Boolean} flag 弹窗组件传回的标志: 一直传回 true
          */
         closeModal(flag) {
             this.ShowDialog = false
+            this.keyFL = 'keyFL' + new Date().getTime()
         },
         //附加数据图片查看 showView为3展示状态
         additionalColl() {

+ 24 - 10
src/views/overview/index.vue

@@ -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.previewUrl,
+                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

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

@@ -535,7 +535,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 +561,7 @@ export default {
         // 明细表
         Index1() {
             let getParams = {
-                locationsid: this.location,
+                location: this.location,
                 plazaId: this.plazaId,
                 page: this.page1,
                 size: this.size1
@@ -667,7 +667,7 @@ export default {
         // 机房维修记录
         Index3() {
             let getParams = {
-                locationsid: this.location,
+                location: this.location,
                 plazaId: this.plazaId,
                 page: this.page3,
                 size: this.size3,
@@ -715,7 +715,7 @@ export default {
         Index4() {
             let postParams = {}
             let data = {
-                locationsid: this.location,
+                location: this.location,
                 plazaId: this.plazaId,
                 page: this.page4,
                 size: this.size4,