|
@@ -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 })
|
|
|
},
|
|
|
/**
|
|
|
* 跳转 电井间控制商铺范围
|