guoxiaohuan 4 years ago
parent
commit
045179634f

+ 36 - 2
src/components/Rotation/src/rotation.vue

@@ -4,7 +4,7 @@
 *@info:图片轮播
 */
 <template>
-    <div :class='[type?"rotationFull":"rotation"]'>
+    <div :class='[type==1?"rotationFull":(type==3?"rotationFullYlt":"rotation")]'>
         <div v-if='rotationImg.length==1' class='rotationCon'>
             <!-- <img
                 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'
@@ -13,7 +13,7 @@
             <img :src='rotationImg[0].url' alt />
             <!-- <img src='./3440.jpg' alt /> -->
         </div>
-        <el-carousel v-else trigger='click' style='height:100%;width:100%' :interval='5000' arrow='always'>
+        <el-carousel v-else trigger='click' style='height:100%;width:100%' :interval='5000' arrow='always' @change='changePic'>
             <el-carousel-item v-for='(item,index) in rotationImg' :key='index'>
                 <img :src='item.url' alt />
             </el-carousel-item>
@@ -29,6 +29,18 @@ export default {
             rotationImgs: [{ url: require('@/assets/images/login_back.png') }]
         }
     },
+    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 || '')
+            })
+        }
+    },
     mounted() {}
 }
 </script>
@@ -75,6 +87,28 @@ export default {
         min-width: 100%;
     }
 }
+.rotationFullYlt {
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    .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;
+    }
+}
 </style>
 <style lang="less">
 .rotation,

+ 9 - 12
src/store/index.js

@@ -1,13 +1,7 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
-import {
-    login,
-    queryFloor,
-    queryfmapID
-} from '@/api/login.js'
-import {
-    queryBrand
-} from '@/api/public.js'
+import { login, queryFloor, queryfmapID } from '@/api/login.js'
+import { queryBrand } from '@/api/public.js'
 import axios from 'axios'
 import router from '../router'
 
@@ -17,6 +11,7 @@ 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":"平面图维护"
@@ -42,6 +37,7 @@ export default new Vuex.Store({
         showView: 1,
     },
     getters: {
+        pic: (state) => state.pic,
         isPreview: (state) => state.isPreview,
         ssoToken: (state) => state.ssoToken,
         lastRoute: (state) => state.lastRoute,
@@ -59,6 +55,9 @@ export default new Vuex.Store({
         showView: (state) => state.showView,
     },
     mutations: {
+        SETPIC(state, data) {
+            state.pic = data
+        },
         SETSHOWVIEW(state, data) {
             state.showView = data
         },
@@ -127,9 +126,7 @@ export default new Vuex.Store({
     },
     actions: {
         // 获取项目列表、userId
-        async getUserInfo({
-            commit
-        }, palyload) {
+        async getUserInfo({ commit }, palyload) {
             await login({}).then((res) => {
                 if (res.result == 'success') {
                     commit('STOREACCESSLEVEL', res)
@@ -181,4 +178,4 @@ export default new Vuex.Store({
         },
     },
     modules: {},
-})
+})

+ 4 - 4
src/views/equipment/eqDialog.vue

@@ -16,10 +16,10 @@
                 />
             </div>
             <!-- 没有tab的页面 -->
-            <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length==0' style='margin:16px 0 0 24px;height:90%'>
+            <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:90%;overflow:hidden;height:100%'>
-                    <rotation :rotationImg='rotationImg'></rotation>
+                <div v-if='dialogInfo.id.slice(2,4)=="YL"' style='width:100%;overflow:hidden;height:100%;margin:0 auto'>
+                    <rotation type='3' :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;overflow:hidden'>
-                                        <rotation :rotationImg='rotationImg'></rotation>
+                                        <rotation type='3' :rotationImg='rotationImg'></rotation>
                                     </div>
                                 </el-tab-pane>
                                 <!-- 发布之后的编辑器的分支图 -->

+ 21 - 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 :rotationImg='pic2'></rotation>
+                        <rotation :key='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'></rotation>
+                            <rotation :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,18 +196,29 @@ export default {
         return {
             loading: true,
             pic1: [], //区位图
-            pic2: [], //鸟瞰图
+            pic2: [
+                { url: 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921275833224467353鸟瞰图.jpg' },
+                { url: 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921275833224467353鸟瞰图.jpg' }
+            ], //鸟瞰图
             build: {}, //左下信息
             constructions: [], //右下数组
-            shuzihuayijiao: ''
+            shuzihuayijiao: '',
+            va: ''
         }
     },
     methods: {
+        scan(val) {
+            this.va = val
+        },
         picClick(type) {
-            if (type == 1) {
-                this.$refs.picModal.showModal(this.pic1)
+            if (String(this.pic) == String(this.va)) {
+                this.$refs.picModal.showModal([{ url: this.pic }])
             } else {
-                this.$refs.picModal.showModal(this.pic2)
+                if (type == 1) {
+                    this.$refs.picModal.showModal(this.pic1)
+                } else {
+                    this.$refs.picModal.showModal(this.pic2)
+                }
             }
         },
         findxmzl() {
@@ -226,12 +237,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 : ''
@@ -262,13 +273,11 @@ export default {
         // }
         let previewUrl = location.href.split('=')[1] ? location.href.split('=')[1].split('&')[0] : false,
             plazaId = location.href.split('=')[2] ? location.href.split('=')[2] : '1000423'
-        console.log('previewUrl:', previewUrl)
-        console.log('plazaId:', plazaId)
         this.$store.commit('SETISPREVIEW', previewUrl)
         this.query()
     },
     computed: {
-        ...mapGetters(['isPreview'])
+        ...mapGetters(['isPreview', 'pic'])
     },
     components: {
         PicModal

+ 4 - 2
src/views/overview/picModal.vue

@@ -5,7 +5,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
             />-->
-            <rotation :type='1' v-if='rotationImg.length>0' :rotationImg='rotationImg' style='height:100%;width:100%'></rotation>
+            <rotation :key='key' :type='1' v-if='rotationImg.length>0' :rotationImg='rotationImg' style='height:100%;width:100%'></rotation>
             <span class='close' @click='close'>X</span>
         </el-dialog>
     </div>
@@ -17,11 +17,13 @@ export default {
         return {
             dialogVisible: false,
             mode: 'top',
-            rotationImg: []
+            rotationImg: [],
+            key: 1
         }
     },
     methods: {
         showModal(params) {
+            this.key++
             this.dialogVisible = true
             this.rotationImg = params
         },

+ 1 - 1
src/views/room/room1.vue

@@ -1,6 +1,6 @@
 <template>
     <div class='jf-inner' style='width:100%;height:85vh;overflow:hidden'>
-        <rotation :rotationImg='tableImg'></rotation>
+        <rotation :rotationImg='tableImg' :type='3'></rotation>
     </div>
 </template>
 <script>