Parcourir la source

Merge branch 'dev' of http://39.106.8.246:3003/yunxing/wanda-bm-guide-h5 into dev

zhangyu il y a 4 ans
Parent
commit
806646d141

+ 9 - 1
src/api/equipmentList.js

@@ -31,11 +31,19 @@ export function queryAssetClass({ getParams }) {
 export function queryShops({ getParams }) {
     return httputils.getJson(`/data/sms_shops/query`, getParams)
 }
+// 查询机房平面布置图数量
+export function queryRoomCount({ getParams }) {
+    return httputils.getJson(`/data/sms_location/queryCount`, getParams)
+}
 // 设备设施- 机房平面布置图列表
 export function querySmsLocation({ data, postParams }) {
     return httputils.fetchJson(`/data/sms_location/query`, data, postParams)
 }
-// 设备设施 - 查询低压出线柜明细 
+// 设备设施 - 查询低压出线柜明细
 export function queryDygjcxline({ data, postParams }) {
     return httputils.fetchJson(`/data/sms_dygjcxline/queryDygjcxline`, data, postParams)
 }
+// 查询更多主要设备
+export function queryMoreAsset({ data, postParams }) {
+    return httputils.fetchJson(`/data/sms_asset/queryAsset`, data, postParams)
+}

+ 1 - 0
src/views/equipmentFacilities/EngineRoomPicture.vue

@@ -149,6 +149,7 @@ export default {
             }
             let postParams = {
                 system_code: this.smsxt,
+                photosNumGte: 1, //查询数量大于等于1的
             }
             // 搜索 设备间名称
             if (this.keyword) {

+ 5 - 0
src/views/equipmentFacilities/LowVoltageCabinet.vue

@@ -239,6 +239,9 @@ export default {
                     },
                 },
             }
+            if (this.keyword) {
+                queryData.data.keyword = `${this.keyword}:drawernum,outspec;`
+            }
             // 筛选 配电室之后, location字段上送
             if (this.modalData.location && this.modalData.location !== '全部') {
                 queryData.postParams.location = this.modalData.location
@@ -388,6 +391,8 @@ export default {
         },
         onSearch() {
             // 初始化数据,查询列表
+            this.initData()
+            this.onLoad()
         },
         /**
          * popup 更改配电室

+ 12 - 4
src/views/equipmentFacilities/SystemFloor.vue

@@ -2,7 +2,9 @@
     <div class='system-floor'>
         <van-nav-bar :title='title' left-arrow @click-left='backPage' />
         <!-- 楼层平面图列表 页面组件 -->
-        <FloorFunc class='system-floor-func' />
+        <FloorFunc v-if='!fbt' class='system-floor-func' />
+        <!-- 分支图 -->
+        <LegendList v-else :floorsArr='fbtArr' class='system-floor-func' />
     </div>
 </template>
 <script>
@@ -13,18 +15,24 @@ import Vue from 'vue'
 import { NavBar, List } from 'vant'
 Vue.use(NavBar).use(List)
 import FloorFunc from '@/views/FloorFunc'
+import LegendList from '@/views/legendList'
 export default {
     name: 'SyetemFloor',
     props: {},
-    components: { FloorFunc },
+    components: { FloorFunc, LegendList },
     data() {
         return {
             title: '供电系统-楼层分布',
+            fbt: false,
+            fbtArr: [],
         }
     },
     created() {
-        console.log(this.$route)
-        this.title = this.$route.params.title
+        const { title, fbt, fbtArr } = this.$route.query
+        this.title = title
+        // 分布图使用
+        this.fbt = fbt || false
+        this.fbtArr = fbtArr ? JSON.parse(fbtArr) : []
     },
     beforeMount() {},
     mounted() {},

+ 116 - 5
src/views/equipmentFacilities/index.vue

@@ -48,8 +48,8 @@ import Vue from 'vue'
 import { Cell, Toast } from 'vant'
 Vue.use(Cell).use(Toast)
 import { mapGetters, mapMutations } from 'vuex'
-import { querySystemCount, querySystemCard, querySystemImage, querySystemTuJianImage } from '@/api/equipmentList'
-
+import { querySystemCount, querySystemCard, querySystemImage, querySystemTuJianImage, queryRoomCount } from '@/api/equipmentList'
+import { appGraphElementQuery } from '@/api/public'
 import MCard from '@/components/equipmentFacilities/Card'
 import SystemMenu from '@/components/systemMenu'
 import ImagePreview from '@/components/ImagePreview'
@@ -59,7 +59,7 @@ export default {
     props: {},
     components: { SystemMenu, MCard, ImagePreview },
     computed: {
-        ...mapGetters(['plazaId', 'smsxt', 'categoryId']),
+        ...mapGetters(['plazaId', 'smsxt', 'categoryId', 'floorsArr']),
     },
     data() {
         return {
@@ -137,8 +137,30 @@ export default {
             showImgPreview: false, //是否展示图片预览
             imgList: [], //图片数组
             imgKey: `img${new Date().getTime()}`,
+            fbtArr: [], //分布图使用的楼层数据
         }
     },
+    watch: {
+        // 前五个系统更改,查询机房平面布置图数量
+        smsxt: {
+            handler(newV, oldV) {
+                let smsxtArr = ['1001', '1002', '1003', '1004', '1005']
+                if (smsxtArr.includes(newV)) {
+                    // 查询机房平面布置图数量
+                    this.getRoomCount()
+                }
+                // 暖通,消防,查询 分水器支路分布图,消防泵房引出管路分布图 对应的楼层图例数据
+                if (['1002', '1003'].includes(newV)) {
+                    let dict = {
+                        1002: 'FZQZL',
+                        1003: 'XFBFYCFL',
+                    }
+                    this.getTuliData({ smsxt: newV, system_code: dict[newV] })
+                }
+            },
+            immediate: true,
+        },
+    },
     async created() {
         // let initSys = {
         //     text: '供电',
@@ -177,7 +199,7 @@ export default {
             this.showRight = true
         },
         /**
-         * 查询图片梳理
+         * 查询图片数量
          */
         async getPicCount() {
             let getParams = {
@@ -228,6 +250,75 @@ export default {
             // console.log(this.listData)
         },
         /**
+         * 查询机房平面布置图数量
+         */
+        async getRoomCount() {
+            let getParams = {
+                plazaId: this.plazaId,
+                systemCode: this.smsxt,
+            }
+            // 查询机房平面布置图数量
+            let res = await queryRoomCount({ getParams })
+            // 取出listData中对应的系统数据
+            let data = this.listData[this.smsxt]
+            data.map((item, index, arr) => {
+                if (item.dataType === 'room') {
+                    item.count = res?.count ? res?.count + '张' : '无'
+                }
+            })
+            this.listKey = `list_${new Date().getTime()}`
+        },
+        /**
+         * 分水器支路分布图,消防泵房引出管路分布图 对应的楼层图例数据
+         */
+        async getTuliData({ smsxt, system_code }) {
+            let params = {
+                BuildingID: '1',
+                CategoryID: system_code,
+                ProjectID: this.plazaId,
+                Floors: this.floorsArr.map((item) => {
+                    return {
+                        FloorId: item.gcname,
+                        FloorName: item.code,
+                    }
+                }),
+            }
+            console.log(params)
+            let res = await appGraphElementQuery(params)
+            console.log(res)
+            if (!res?.Data) {
+                return false
+            }
+            let Data = res.Data || []
+            // 过滤有Statistics的条数
+            Data = Data.filter((v) => v.Statistics?.length)
+
+            let fbtArr = []
+            Data.map((item) => {
+                fbtArr.push({
+                    code: item.FloorName,
+                    gcname: item.FloorId,
+                })
+            })
+            this.fbtArr = fbtArr
+            let count = Data.length ? Data.length + '张' : '无'
+            let systemData = this.listData[smsxt]
+            console.log(systemData)
+            systemData.map((item, index, arr) => {
+                if (item.dataType === 'fbt') {
+                    arr[index].count = count
+                }
+            })
+            this.$set(this.listData, smsxt, systemData)
+            this.listKey = `list_${new Date().getTime()}`
+            //     .then(res => {
+            //   this.floorData = res.Data.map(floor => {
+            //     floor.Open = false;
+            //     return floor;
+            //   });
+            // })
+        },
+        /**
          * 查询设备卡片
          */
         async getCard() {
@@ -380,6 +471,9 @@ export default {
          * 跳转 机房平面布置图
          */
         handleRoom(item) {
+            if (!item.count || item.count === '无') {
+                return false
+            }
             // TODO: 机房平面布置图
             this.$router.push({ name: 'EngineRoomPicture', params: {} })
         },
@@ -402,9 +496,26 @@ export default {
          */
         handleFbt(item) {
             console.log(item)
+            let currentSystem = this.listData[this.smsxt]
+            let fbt = currentSystem.filter((v) => v.dataType === 'fbt')[0]
+            if (!fbt || fbt.count === '无') {
+                // return false
+            }
             const { categoryId, text } = item
             this.SETCATEGORYID(categoryId)
-            this.$router.push({ name: 'SystemFloor', params: { title: text } })
+            let query = { title: text }
+            // mockData
+            // this.fbtArr = [
+            //     {
+            //         code: 'RF',
+            //         gcname: 'g80',
+            //     },
+            // ]
+            if (this.fbtArr.length) {
+                query.fbtArr = JSON.stringify(this.fbtArr)
+                query.fbt = true
+            }
+            this.$router.push({ name: 'SystemFloor', query })
         },
         /**
          * 跳转 电井间控制商铺范围