guoxiaohuan 4 år sedan
förälder
incheckning
fae716cc1b

+ 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>

+ 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所以分开判断

+ 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,