Browse Source

730合并代码

YaolongHan 4 years ago
parent
commit
e1d0a915b7

+ 1 - 1
package.json

@@ -14,7 +14,7 @@
         "@saga-web/base": "2.1.25",
         "@saga-web/big": "1.0.107",
         "@saga-web/draw": "2.1.106",
-        "@saga-web/feng-map": "1.0.37",
+        "@saga-web/feng-map": "1.0.38",
         "@saga-web/graph": "2.1.123",
         "ant-design-vue": "^1.4.10",
         "axios": "^0.19.2",

+ 26 - 26
src/components/floorMap/index.vue

@@ -290,9 +290,9 @@ export default {
             if (floor == 'g80') {
                 // 屋顶
                 if (window.fengmapData.frImg) {
-                    // const pj = this.urlMsg.fmapID.split('_')[0]
-                    // // 单张图片
-                    // if (!ProjectRf[pj]) {
+                    const pj = this.fmapID.split('_')[0]
+                    // 单张图片
+                    if (!ProjectRf[pj]) {
                         let imgItem = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.fmapID}/${window.fengmapData.frImg}`)
                         imgItem.showType = SImageShowType.AutoFit
                         imgItem.connect('imgLoadOver', this, () => {
@@ -301,29 +301,29 @@ export default {
                         this.scene.addItem(imgItem)
                         this.view.scene = this.scene
                     // this.view.fitSceneToView()
-                    // } else {
-                    //   // 多张图
-                    //   try {
-                    //     // 初始化0
-                    //     this.count = 0;
-                    //     ProjectRf[pj].forEach(t => {
-                    //       const item = new SImageItem(
-                    //         null,
-                    //         `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${t.name}`
-                    //       );
-                    //       item.width = t.width
-                    //       item.height = t.height
-                    //       item.moveTo(t.x, t.y)
-                    //       item.connect("imgLoadOver", this, () => {
-                    //         this.countRf(ProjectRf[pj].length);
-                    //       });
-                    //       this.scene.addItem(item);
-                    //     })
-                    //     this.view.scene = this.scene;
-                    //   } catch(e) {
-                    //     console.log(e);
-                    //   }
-                    // }
+                    } else {
+                      // 多张图
+                      try {
+                        // 初始化0
+                        this.count = 0;
+                        ProjectRf[pj].forEach(t => {
+                          const item = new SImageItem(
+                            null,
+                            `${this.mapServerURL}/webtheme/${this.fmapID}/${t.name}`
+                          );
+                          item.width = t.width
+                          item.height = t.height
+                          item.moveTo(t.x, t.y)
+                          item.connect("imgLoadOver", this, () => {
+                            this.countRf(ProjectRf[pj].length);
+                          });
+                          this.scene.addItem(item);
+                        })
+                        this.view.scene = this.scene;
+                      } catch(e) {
+                        console.log(e);
+                      }
+                    }
                 } else {
                     // 屋顶图不为图片
                     this.readBaseMap(floor)

+ 18 - 32
src/store/index.js

@@ -1,23 +1,17 @@
 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'
 
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
-        ssoToken: 'admin:liujiandong',
+        // ssoToken: 'admin:liujiandong',
         // ssoToken: '',
-        // ssoToken: null,
-        plazaName: "",
+        ssoToken: null,
+        plazaName: '',
         isPreview: false,
         lastRoute: '',
         isrequestAuth: null, // 是否请求登录校验接口
@@ -106,10 +100,7 @@ export default new Vuex.Store({
             state.isMessage = data
         },
         SETFLOORS(state, data) {
-            console.log(data)
-            let numArr = [],
-                minNum = '',
-                floor = {}
+            let numArr = []
             state.floorSelect = []
             state.floorsArr = data
             if (data.length > 0) {
@@ -183,17 +174,15 @@ export default new Vuex.Store({
     },
     actions: {
         // 获取项目列表、userId
-        async getUserInfo({
-            commit
-        }, palyload) {
+        async getUserInfo({ commit }, palyload) {
             await login({
-                    returnTree: true,
-                })
+                returnTree: true,
+            })
                 .then((res) => {
                     // 获取用户当前权限
                     if (res.result === 'success') {
                         // 如果用户没有权限则跳入404
-                        if(!res.permissions || !res.permissions.includes('GLSMS_VIEW')){
+                        if (!res.permissions || !res.permissions.includes('GLSMS_VIEW')) {
                             router.push({
                                 path: '/404',
                             })
@@ -232,8 +221,8 @@ export default new Vuex.Store({
                         }
                         //   给oA头添加名称
                         // 指定条问题
-                        document.getElementById("wd-fm-id-fm-switch-profile").style.display= 'inline-block';
-                        document.getElementById("wd-fm-id-fm-switch-profile").innerText ='您好,'+ res.username;
+                        document.getElementById('wd-fm-id-fm-switch-profile').style.display = 'inline-block'
+                        document.getElementById('wd-fm-id-fm-switch-profile').innerText = '您好,' + res.username
                     }
                 })
                 .catch((err) => {
@@ -243,21 +232,18 @@ export default new Vuex.Store({
                             path: './home/homepage',
                         })
                     }
-
                 })
         },
-        async getUserInfoNoPath({
-            commit
-        }, palyload) {
+        async getUserInfoNoPath({ commit }, palyload) {
             await login({
-                    returnTree: true,
-                })
+                returnTree: true,
+            })
                 .then((res) => {
                     if (res.result === 'success') {
                         // commit('STOREACCESSLEVEL', res.level)
                         commit('SETAUTHMSG', res)
-                        document.getElementById("wd-fm-id-fm-switch-profile").style.display= 'inline-block';
-                        document.getElementById("wd-fm-id-fm-switch-profile").innerText ='您好,'+ res.username;
+                        document.getElementById('wd-fm-id-fm-switch-profile').style.display = 'inline-block'
+                        document.getElementById('wd-fm-id-fm-switch-profile').innerText = '您好,' + res.username
                     }
                 })
                 .catch((err) => {
@@ -299,4 +285,4 @@ export default new Vuex.Store({
         },
     },
     modules: {},
-})
+})

+ 1 - 0
src/views/analysis/CoreDeviceReport.vue

@@ -344,6 +344,7 @@ export default {
      * 切换系统下的设备
      */
     changeEquipment(id) {
+      this.curPage = 1;
       _.map(this.systemContentData, o => {
         return (o.isActive = o.category_code === id);
       });

+ 17 - 61
src/views/other/index.vue

@@ -55,14 +55,14 @@ export default {
             systemName: '供电系统',
             floorInfo: {
                 floorName: 'F1',
-                floorId: 'f1'
+                floorId: 'f1',
             },
             picFloor: '',
             picFloorImg: [],
             picFloorArr: [],
             dialogInfo: {},
             floorData: [],
-            module: ''
+            module: '',
         }
     },
     components: { floorListOther, OtherDialog, ZhsxOther, GcfzDialog },
@@ -85,9 +85,9 @@ export default {
             let getParams = {
                 module: '1004',
                 floor: floor,
-                plazaId: this.plazaId
+                plazaId: this.plazaId,
             }
-            queryPic({ getParams }).then(res => {
+            queryPic({ getParams }).then((res) => {
                 // console.log('库房管理图', res)
                 this.picFloorImg = res.data || []
             })
@@ -97,79 +97,35 @@ export default {
             let data = { plazaId: this.plazaId }
             let postParams = []
             if (this.floorsArr.length > 0) {
-                this.floorsArr.forEach(e => {
+                this.floorsArr.forEach((e) => {
                     let obj = {
                         tableName: 'glsms_proimgup',
                         params: {
                             module: '1004',
-                            floor: e.gname
-                        }
+                            floor: e.gname,
+                        },
                     }
                     postParams.push(obj)
                 })
             }
-            // [
-            //     {
-            //         tableName: 'glsms_proimgup',
-            //         params: { module: '1004', floor: 'f6' }
-            //     },
-            //     {
-            //         tableName: 'glsms_proimgup',
-            //         params: { module: '1004', floor: 'f5' }
-            //     },
-            //     {
-            //         tableName: 'glsms_proimgup',
-            //         params: { module: '1004', floor: 'f4' }
-            //     },
-            //     {
-            //         tableName: 'glsms_proimgup',
-            //         params: { module: '1004', floor: 'f3' }
-            //     },
-            //     {
-            //         tableName: 'glsms_proimgup',
-            //         params: { module: '1004', floor: 'f2' }
-            //     },
-            //     {
-            //         tableName: 'glsms_proimgup',
-            //         params: { module: '1004', floor: 'f1' }
-            //     },
-            //     {
-            //         tableName: 'glsms_proimgup',
-            //         params: { module: '1004', floor: 'b1' }
-            //     },
-            //     {
-            //         tableName: 'glsms_proimgup',
-            //         params: { module: '1004', floor: 'b2' }
-            //     }
-            // ]
-            queryTab({ data, postParams }).then(res => {
+            queryTab({ data, postParams }).then((res) => {
                 //console.log('查询哪几层楼有图', res)
                 this.floorData = []
                 let data = res.data.data || []
-                data.forEach(el => {
+                data.forEach((el) => {
                     if (el.count > 0) {
-                        let obj = {
-                            gname: el.params.floor,
-                            code: el.params.floor.toUpperCase(),
-                            gcode: el.params.floor
-                                .toUpperCase()
-                                .split('')
-                                .reverse()
-                                .join(''),
-                            seq:
-                                el.params.floor.substring(0, 1) == 'b'
-                                    ? -Number(el.params.floor.substring(1, 2)) + '00'
-                                    : Number(el.params.floor.substring(1, 2)) + '00'
-                        }
-                        this.floorData.push(obj)
+                        this.floorsArr.forEach((item) => {
+                            if (item.gname == el.params.floor) {
+                                this.floorData.push(item)
+                            }
+                        })
                     }
-                    console.log(this.floorData)
                 })
             })
-        }
+        },
     },
     computed: {
-        ...mapGetters(['floorsArr', 'plazaId'])
+        ...mapGetters(['floorsArr', 'plazaId', 'floorObj']),
     },
     mounted() {
         let module = window.location.href.split('=')[1]
@@ -178,7 +134,7 @@ export default {
         }
         this.everySystem = this.matter[0].children
         this.tabSize()
-    }
+    },
 }
 </script>
 <style lang="less" scoped>