Browse Source

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

haojianlong 4 years ago
parent
commit
d0683d1865

+ 6 - 0
src/api/equipmentList.js

@@ -9,6 +9,12 @@ export function queryEquipmentList({ data, postParams }) {
 export function queryAsset({ data, postParams }) {
     return httputils.fetchJson(`/data/sms_asset/query`, data, postParams)
 }
+
+// 设备设施-主要设备清单详情(不过滤设备类型)
+export function queryAssetAll({ data, postParams }) {
+    return httputils.fetchJson(`/data/sms_asset/queryByClassStructure`, data, postParams)
+}
+
 // 设备设施-主要材料清单
 export function queryMaterialList({ getParams }) {
     return httputils.getJson(`/data/sms_material/query`, getParams)

+ 7 - 7
src/api/httputils.js

@@ -21,17 +21,17 @@ const axiosservice = axios.create({
 axiosservice.interceptors.request.use(
     (config) => {
         config.withCredentials = true // 允许携带token ,这个是解决跨域产生的相关问题
-        // let isPreview = null
+        let isPreview = null
         let token = store.getters['ssoToken']
-        // if (store.getters['isPreview'] == "null" || store.getters['isPreview'] == "" || store.getters['isPreview'] == null) {
-        //     isPreview = false
-        // } else {
-        //     isPreview = store.getters['isPreview']
-        // }
+        if (store.getters['isPreview'] == 'null' || store.getters['isPreview'] == '' || store.getters['isPreview'] == null) {
+            isPreview = false
+        } else {
+            isPreview = store.getters['isPreview']
+        }
         if (config.url.indexOf('/data') > -1) {
             config.headers = {
                 'sso-token': token,
-                isPreview: true, //默认false,当预览开启的时候是true
+                isPreview: isPreview, //默认false,当预览开启的时候是true
             }
         }
         return config

+ 14 - 15
src/components/Legend/src/legend.vue

@@ -69,7 +69,7 @@
                 effect='dark'
                 content='新增分布图1'
                 placement='left'
-                v-if='floorSelect.length!=floors.length && type==0'
+                v-if='floorSelect2.length!=floors.length && type==0'
             >
                 <p class='tltk' style='margin-left: -5px;' @click='addFloor'>
                     <img src='@/assets/imgs/bjj.png' alt />
@@ -143,7 +143,7 @@ export default {
             'remarksText',
             'plazaId',
             'fmapID',
-            'floorSelect',
+            'floorSelect2',
             'isMessage',
             'ssoToken',
             'showView',
@@ -195,7 +195,7 @@ export default {
         // 监听 vuex 中currentFloor的变化,切换楼层后,调用接口查询,显示右下角小红点
         '$store.state.currentFloor': {
             handler(newV, oldV) {
-                if (newV.gcname !== oldV.gcname) {
+                if (newV.gname !== oldV.gname) {
                     clearInterval(this.timer)
                     this.getDraftNum()
                     this.timer = setInterval(() => {
@@ -243,10 +243,10 @@ export default {
          */
         async getDraftNum() {
             let res = null,
-                floorId = this.$store.state.currentFloor.gcname || this.$cookie.get('floorMapId'),
+                floorId = this.$store.state.currentFloor.gname || this.$cookie.get('floorMapId'),
                 categoryId = this.categoryId || this.$cookie.get('categoryId')
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gcname && (floorId = this.floorInfo.gcname)
+            this.floorInfo.gname && (floorId = this.floorInfo.gname)
             // 增加校验 floorId,防止上传 undefined
             if (!floorId) {
                 return true
@@ -273,8 +273,8 @@ export default {
         },
         formatFloor() {
             this.floorSelectAble = []
-            this.floorSelectAble = this.floorSelect.filter((item) => {
-                const hit = this.floors.find((i) => i.gcname == item.id)
+            this.floorSelectAble = this.floorSelect2.filter((item) => {
+                const hit = this.floors.find((i) => i.gname == item.id)
                 return !hit
             })
         },
@@ -354,8 +354,8 @@ export default {
             let categoryId = this.$cookie.get('categoryId') //系统
 
             // 弹窗组件内传入floorInfo, 楼层参数处理
-            if (this.floorInfo.gcname && !this.floor) {
-                FloorID = this.floorInfo.gcname
+            if (this.floorInfo.gname && !this.floor) {
+                FloorID = this.floorInfo.gname
                 floorName = this.floorInfo.code
                 seq = this.floorInfo.seq
                 categoryId = this.categoryId
@@ -363,7 +363,7 @@ export default {
             //弹窗组件点击新增楼层,确认的楼层 楼层字段处理
             if (this.floor) {
                 // 从store中筛选出选中的楼层信息
-                let floorInfo = this.$store.state.floorsArr.filter((item) => item.gcname === this.floor)[0]
+                let floorInfo = this.$store.state.floorsArr.filter((item) => item.gname === this.floor)[0]
                 FloorID = this.floor
                 floorName = floorInfo.code
                 seq = floorInfo.seq
@@ -374,7 +374,6 @@ export default {
             if (!this.plazaId) {
                 return
             }
-            // http://localhost:8091/wandaEditer/editer?categoryId%3DFZQZL%26projectId%3D1001724%26BuildingID%3D1%26FloorID%3Df8%26FloorName%3DF8%26fmapID%3D1001724_31%26seq%3D750%26token%3Dadmin%3Aliujiandong
             let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&FloorName=${floorName}&fmapID=${this.fmapID}&seq=${seq}&token=${this.ssoToken}`
             let url = editerUrl + 'editer?' + encodeURIComponent(data)
             window.open(url, 'edit')
@@ -398,10 +397,10 @@ export default {
                 projectId: this.$store.state.plazaId,
                 flag: flag,
                 buildingId: '1',
-                floorId: this.$store.state.currentFloor.gcname,
+                floorId: this.$store.state.currentFloor.gname,
             }
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gcname && (data.floorId = this.floorInfo.gcname)
+            this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
             queryStatis({ data, postParams }).then((res) => {
                 // this.$store.commit('SETREMARKSTEXT', '')
                 this.$store.commit('SETPLANNUM', '')
@@ -451,10 +450,10 @@ export default {
                 projectId: this.$store.state.plazaId,
                 flag: flag,
                 buildingId: '1',
-                floorId: this.$store.state.currentFloor.gcname,
+                floorId: this.$store.state.currentFloor.gname,
             }
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gcname && (data.floorId = this.floorInfo.gcname)
+            this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
             queryStatis({ data, postParams }).then((res) => {
                 this.loading1 = false
                 this.editTable = res.data.Data ? res.data.Data : []

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

@@ -94,7 +94,7 @@ import { FloorScene } from '@/lib/FloorScene'
 import RoomBox from '@/views/room/index'
 import canvasFun from '@/components/floorMap/canvasFun'
 import { readGroup, queryStatis } from '@/api/public'
-import { queryShops, queryAsset } from '@/api/equipmentList.js'
+import { queryShops, queryAssetAll } from '@/api/equipmentList.js'
 import { STopologyParser } from '@/lib/parsers/STopologyParser'
 import { mapGetters, mapActions } from 'vuex'
 import { SImageItem, SImageShowType, SGraphItem } from '@saga-web/graph/lib'
@@ -190,7 +190,7 @@ export default {
                     let postParams = {
                         assetnumList: this.equipIds,
                     }
-                    queryAsset({ data, postParams }).then((res) => {
+                    queryAssetAll({ data, postParams }).then((res) => {
                         this.tabData.tableData = res.data.data
                         this.eqLoading = false
                     })

+ 9 - 1
src/store/index.js

@@ -11,7 +11,7 @@ export default new Vuex.Store({
         ssoToken: 'admin:liujiandong',
         // ssoToken: '',
         // ssoToken: null,
-        plazaName: '',
+        plazaName: "",
         isPreview: false,
         lastRoute: '',
         isrequestAuth: null, // 是否请求登录校验接口
@@ -26,6 +26,7 @@ export default new Vuex.Store({
         projectName: '', //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
+        floorSelect2: [], //分布图楼层下拉框
         fmapID: '',
         haveFengMap: -1, //是否有蜂鸟地图的数据 -1为等待 0 为失败 1 为成功
         isMessage: true, //是否有发布的图
@@ -51,6 +52,7 @@ export default new Vuex.Store({
         lastRoute: (state) => state.lastRoute,
         floorsArr: (state) => state.floorsArr,
         floorSelect: (state) => state.floorSelect,
+        floorSelect2: (state) => state.floorSelect2,
         plazaId: (state) => state.plazaId,
         plazas: (state) => state.plazas,
         fmapID: (state) => state.fmapID,
@@ -102,6 +104,7 @@ export default new Vuex.Store({
         SETFLOORS(state, data) {
             let numArr = []
             state.floorSelect = []
+            state.floorSelect2 = []
             state.floorsArr = data
             if (data.length > 0) {
                 data.forEach((e) => {
@@ -109,8 +112,13 @@ export default new Vuex.Store({
                         id: e.gcname,
                         name: e.code,
                     }
+                    let obj2 = {
+                        id: e.gname,
+                        name: e.code,
+                    }
                     // 下拉框的楼层数组
                     state.floorSelect.push(obj)
+                    state.floorSelect2.push(obj2)
                     // 获取默认展示楼层
                     if (e.seq > 0) {
                         numArr.push(e.seq)

+ 12 - 11
src/views/equipment/fenbuPic.vue

@@ -2,7 +2,7 @@
     <div class='fenbu-box'>
         <!-- 图例 -->
         <div class='legend-boxs'>
-            <Legend :innerLeng='1' :floorInfo="floorInfo"  :floors='floors' type='0' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`'></Legend>
+            <Legend :innerLeng='1' :floorInfo='floorInfo' :floors='floors' type='0' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`'></Legend>
             <floor-list v-if='floors.length>0' :changeDataFlag='false' :floorsArr='floors' @emitFloor='emitFloor' :id='"floor"'></floor-list>
         </div>
         <div v-show='floors.length>0' class='canvas-box'>
@@ -26,17 +26,17 @@ export default {
             show: false,
             floorInfo: {
                 gname: 'f1',
-                code: 'F1'
+                code: 'F1',
             },
             loadName: '',
             type: '',
             floors: [],
-            modalHeight: 500 //适配底图
+            modalHeight: 500, //适配底图
         }
     },
     props: ['typecode'],
     computed: {
-        ...mapGetters(['floorsArr'])
+        ...mapGetters(['floorsArr']),
     },
     mounted() {
         if (window.screen.width > 1366) {
@@ -61,7 +61,7 @@ export default {
                 Distinct: true,
                 PageNumber: 1,
                 PageSize: 500,
-                Projection: ['floorId']
+                Projection: ['floorId'],
             }
             if (this.typecode == 'FBT1') {
                 postParams.Filters = `projectId =${this.$store.state.plazaId};categoryId='FZQZL';isPub=true`
@@ -71,20 +71,20 @@ export default {
             }
             let floor = []
             this.floors = []
-            queryPics({ postParams }).then(res => {
+            queryPics({ postParams }).then((res) => {
                 if (res.Total == 0) {
                     this.floors = []
                 } else {
                     floor = res.Content
-                    this.floorsArr.forEach(el => {
-                        floor.forEach(ele => {
+                    this.floorsArr.forEach((el) => {
+                        floor.forEach((ele) => {
                             if (ele.FloorId == el.gname) {
                                 this.floors.push({
                                     gname: el.gname,
                                     gcode: el.gcode,
                                     name: el.name,
                                     code: el.code,
-                                    seq: el.seq
+                                    seq: el.seq,
                                 })
                             }
                         })
@@ -92,6 +92,7 @@ export default {
                 }
                 this.floorInfo = this.floors[0]
                 // this.init()
+                console.log(this.floors)
             })
         },
         init() {
@@ -102,8 +103,8 @@ export default {
             this.getFloorData()
             // 注释掉 floorMap init ,由楼层中的emitFloor方法去执行floorMap
             // this.$refs.floorMap.init(this.floorInfo.gname)
-        }
-    }
+        },
+    },
 }
 </script>
 <style lang="less">

+ 2 - 2
vue.config.js

@@ -4,8 +4,8 @@ module.exports = {
         port: 8090,
         proxy: {
             '/data': {
-                // target: "http://60.205.177.43",
-                target: 'http://10.199.143.126',
+                target: "http://60.205.177.43",
+                // target: 'http://10.199.143.126',
                 // target: 'http://192.168.200.11:9003', //yll
                 // target: 'http://localhost:6040/data/',
                 changeOrigin: true,