Explorar el Código

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

haojianlong hace 4 años
padre
commit
136f9467d2

+ 5 - 1
public/index.html

@@ -38,6 +38,10 @@
             background: #f7f9fa !important;
         }
 
+        .fm-menu-left-bar {
+            z-index: 99;
+        }
+
         .my-leaflet-div-icon {
             white-space: nowrap;
         }
@@ -122,7 +126,7 @@
     <div style="height:26px;background-color:#efefef;padding:0 10px;z-index: 999;" id="wd-fm"></div>
     <div id="app">
         <!-- 首屏加载,只在main.ts中写时,页面还是有很长时间的空白,故在此也写首屏加载 -->
-            <!-- <div class="p-index-loading">
+        <!-- <div class="p-index-loading">
                 <ul class="p-index-loading-box">
                     <li class="p-index-loading-list p-index-loading-list-1" />
                     <li class="p-index-loading-list p-index-loading-list-2" />

+ 9 - 11
src/components/Legend/src/legend.vue

@@ -37,7 +37,7 @@
         </div>
 
         <!-- 单独展示新增分布图 -->
-        <el-tooltip effect='dark' v-if='floors.length==0' content='新增分布图' placement='left'>
+        <el-tooltip  v-show="permissions ? permissions.includes('GLSMS_PLANARGRAPH_MANAGE'):false" effect='dark' v-if='floors.length==0' content='新增分布图' placement='left'>
             <div class='edit_map1' @click='addFloor'>
                 <!-- <p class='tltk' style='margin-left: -5px;'> -->
                 <img src='@/assets/imgs/bjj.png' alt />
@@ -58,7 +58,7 @@
                 <!-- </p> -->
             </el-tooltip>
             <!-- 新增分布图 -->
-            <el-tooltip effect='dark' content='新增分布图1' placement='left' v-if='floorSelect.length!=floors.length && type==0'>
+            <el-tooltip  v-show="permissions ? permissions.includes('GLSMS_PLANARGRAPH_MANAGE'):false" effect='dark' content='新增分布图1' placement='left' v-if='floorSelect.length!=floors.length && type==0'>
                 <p class='tltk' style='margin-left: -5px;' @click='addFloor'>
                     <img src='@/assets/imgs/bjj.png' alt />
                 </p>
@@ -66,13 +66,8 @@
             <!-- 编辑分布图 -->
 
             <!-- 有修改权限 -->
-            <el-tooltip
-                class='bjpmt'
-                effect='dark'
-                :content='editTips?editTips:`编辑${categoryId=="FZQZL"?"分水器支路分布图":"消防泵房引出管路分布图"}`'
-                placement='left'
-            >
-                <span v-show="permissions ? permissions.includes('GLSMS_PLANARGRAPH_MANAGE'):false" class='edit-icon corner-con' @click='goToEditer'>
+            <el-tooltip class='bjpmt' effect='dark' :content='editTips?editTips:`编辑${categoryId=="FZQZL"?"分水器支路分布图":"消防泵房引出管路分布图"}`' placement='left'>
+                <span v-show='permissions ? permissions.includes("GLSMS_PLANARGRAPH_MANAGE"):false' class='edit-icon corner-con' @click='goToEditer'>
                     <img src='@/assets/imgs/bjs.png' alt />
                     <!-- 角标 -->
                     <!-- <span v-if='draftNum' class='corner' :style='{lineHeight : draftNum > 99 ?"10px":"18px"}'>{{draftNum > 99 ? '...' : draftNum}}</span> -->
@@ -130,13 +125,13 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['planNum', 'typeNum', 'plazaId', 'fmapID', 'floorSelect', 'isMessage', 'ssoToken', 'showView', 'legendTable','permissions']),
+        ...mapGetters(['planNum', 'typeNum', 'plazaId', 'fmapID', 'floorSelect', 'isMessage', 'ssoToken', 'showView', 'legendTable', 'permissions']),
     },
     props: {
         floors: {
             //原理图中有数据楼层
             default: () => {
-                []
+                ;[]
             },
             type: Array,
         },
@@ -275,6 +270,7 @@ export default {
             }
             let data = {}
             queryRead({ data, postParams }).then((res) => {
+                this.$store.commit('SETREMARKSTEXT', '')
                 if (res.data) {
                     let Res = res.data.Data && res.data.Data[0] ? res.data.Data[0].Note : ''
                     if (Res) {
@@ -382,6 +378,7 @@ export default {
             // 弹窗组件内传入floorInfo,使用其楼层id
             this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
             queryStatis({ data, postParams }).then((res) => {
+                this.$store.commit('SETREMARKSTEXT', '')
                 this.$store.commit('SETPLANNUM', '')
                 this.loading = false
                 let viewTable = []
@@ -517,6 +514,7 @@ export default {
             // 备注
             bus.$off('queryRemarksMethods')
             bus.$on('queryRemarksMethods', (res) => {
+                this.$store.commit('SETREMARKSTEXT', '')
                 if (res) {
                     this.$store.commit('SETREMARKSTEXT', res)
                 } else {

+ 35 - 34
src/components/floorMap/index.vue

@@ -42,29 +42,29 @@ export default {
             floorid: '', //楼层id
             topologyParser: null, // 解析器数据
             fParser: null, // 底图解析器
-            wellMap: {} // 电井控制商铺映射
+            wellMap: {}, // 电井控制商铺映射
         }
     },
     props: {
         id: {
             default: '1',
-            type: String
+            type: String,
         },
         categoryId: {
             default: '',
-            type: String
+            type: String,
         },
         // 弹窗高度,适配底图高度使用
         modalHeight: {
             type: [Number, undefined],
-            default: undefined
+            default: undefined,
         },
         loadName: null,
-        type: null
+        type: null,
     },
     components: { RoomBox, canvasFun },
     computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap', 'bunkObj'])
+        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap', 'bunkObj']),
     },
     methods: {
         ...mapActions(['getfmapID']),
@@ -145,7 +145,7 @@ export default {
         },
         readGraph() {
             this.readGroup(this.floorid)
-                .then(data => {
+                .then((data) => {
                     if (data.Result == 'failure') {
                         this.$store.commit('SETISMESSAGE', false)
                         this.view.fitSceneToView()
@@ -189,7 +189,7 @@ export default {
                         scpzTable = data.Data[0].Elements.Nodes || []
                         console.log(scpzTable)
                         if (scpzTable.length > 0) {
-                            scpzTable.forEach(e => {
+                            scpzTable.forEach((e) => {
                                 if (e.Properties.ItemExplain) {
                                     let obj = e
                                     arr.push(obj)
@@ -202,8 +202,9 @@ export default {
                     if (data.Data[0].Elements.Nodes.length > 0) {
                         this.$store.commit('SETTYPENUM', '')
                         let Lengd = data.Data[0].Elements.Nodes
-                        Lengd.forEach(el => {
+                        Lengd.forEach((el) => {
                             if (el.Type == 'Image' && el.Num > 1) {
+                                console.log(el.Num)
                                 this.$store.commit('SETTYPENUM', el.Num)
                             }
                         })
@@ -218,28 +219,28 @@ export default {
                     this.topologyParser = new STopologyParser(null)
                     this.topologyParser.parseData(data.Data[0].Elements)
                     // 多边形
-                    this.topologyParser.zoneLegendList.forEach(t => {
+                    this.topologyParser.zoneLegendList.forEach((t) => {
                         this.scene.addItem(t)
                     })
                     // 增加文字
-                    this.topologyParser.textMarkerList.forEach(t => {
+                    this.topologyParser.textMarkerList.forEach((t) => {
                         this.scene.addItem(t)
                     })
                     // 增加图片
-                    this.topologyParser.imageMarkerList.forEach(t => {
+                    this.topologyParser.imageMarkerList.forEach((t) => {
                         this.scene.addItem(t)
                     })
                     // 增加直线
-                    this.topologyParser.lineMarkerList.forEach(t => {
+                    this.topologyParser.lineMarkerList.forEach((t) => {
                         this.scene.addItem(t)
                     })
                     // 增加图标类图例
-                    this.topologyParser.imageLegendList.forEach(t => {
+                    this.topologyParser.imageLegendList.forEach((t) => {
                         this.scene.addItem(t)
                     })
                     // 增加管线类
                     // 增加图标类图例
-                    this.topologyParser.relationList.forEach(t => {
+                    this.topologyParser.relationList.forEach((t) => {
                         t.selectable = true
                         this.scene.addItem(t)
                     })
@@ -286,7 +287,7 @@ export default {
         // 选中电井关联的商铺高亮
         setHightLight(arr) {
             this.clearHightLight()
-            arr.forEach(item => {
+            arr.forEach((item) => {
                 let location = item.data.AttachObjectIds[0] ? item.data.AttachObjectIds[0].id : ''
                 // 添加了位置类型并且选中的类型为电井类型
                 if (
@@ -297,7 +298,7 @@ export default {
                     location
                 ) {
                     if (this.wellMap.hasOwnProperty(location)) {
-                        this.wellMap[location].forEach(item => {
+                        this.wellMap[location].forEach((item) => {
                             item.highLightFlag = true
                             item.zOrder = 30
                         })
@@ -305,23 +306,23 @@ export default {
                         let getParams = {
                             plazaId: this.plazaId,
                             floor: this.floorid,
-                            keyword: `${location}:wellnum;`
+                            keyword: `${location}:wellnum;`,
                         }
-                        queryShops({ getParams }).then(res => {
+                        queryShops({ getParams }).then((res) => {
                             let shopsnumList = []
                             let shopsnumItemList = []
                             if (res.data && res.data.length) {
                                 for (let floor in res.data[0]) {
                                     if (res.data[0][floor].length) {
-                                        res.data[0][floor].forEach(v => {
+                                        res.data[0][floor].forEach((v) => {
                                             shopsnumList = shopsnumList.concat(v.shopsnumList.split(','))
                                         })
                                     }
                                 }
                             }
                             if (shopsnumList.length) {
-                                this.fParser.spaceList.forEach(item => {
-                                    if (shopsnumList.findIndex(name => name == item.data.Name) != -1) {
+                                this.fParser.spaceList.forEach((item) => {
+                                    if (shopsnumList.findIndex((name) => name == item.data.Name) != -1) {
                                         item.highLightFlag = true
                                         item.zOrder = 30
                                         shopsnumItemList.push(item)
@@ -338,7 +339,7 @@ export default {
         clearHightLight() {
             ItemColor.spaceHighColor = new SColor('#FBF2CC')
             for (let key in this.wellMap) {
-                this.wellMap[key].forEach(item => {
+                this.wellMap[key].forEach((item) => {
                     item.highLightFlag = false
                     item.zOrder = ItemOrder.spaceOrder
                 })
@@ -375,7 +376,7 @@ export default {
             // this.topologyParser.zoneLegendList.forEach(t => {
             //     t.showText = val
             // })
-            this.fParser.spaceList.forEach(t => {
+            this.fParser.spaceList.forEach((t) => {
                 t.showBaseName = val
             })
         },
@@ -386,7 +387,7 @@ export default {
                 FloorID: FloorID,
                 categoryId: this.categoryId ? this.categoryId : this.$cookie.get('categoryId'),
                 projectId: this.urlMsg.ProjectID,
-                Pub: true
+                Pub: true,
             }
             return readGroup(data)
         },
@@ -404,9 +405,9 @@ export default {
             }
         },
         getEvent() {
-            bus.$on('changeShow', res => {
+            bus.$on('changeShow', (res) => {
                 this.topologyParser &&
-                    this.topologyParser.zoneLegendList.forEach(t => {
+                    this.topologyParser.zoneLegendList.forEach((t) => {
                         let id = t.data.GraphElementId
                         t.maskFlag = !(res.indexOf(id) > -1)
                     })
@@ -423,17 +424,17 @@ export default {
                 //     t.maskFlag = !(res.indexOf(id) > -1)
                 // })
                 this.topologyParser &&
-                    this.topologyParser.imageLegendList.forEach(t => {
+                    this.topologyParser.imageLegendList.forEach((t) => {
                         let id = t.data.GraphElementId
                         t.maskFlag = !(res.indexOf(id) > -1)
                     })
                 this.topologyParser &&
-                    this.topologyParser.relationList.forEach(t => {
+                    this.topologyParser.relationList.forEach((t) => {
                         let id = t.data.GraphElementId || t.data.GraphElementID
                         t.maskFlag = !(res.indexOf(id) > -1)
                     })
             })
-        }
+        },
     },
     watch: {
         'view.scale': {
@@ -442,11 +443,11 @@ export default {
                     let s = (n * 10) / this.view.minScale
                     this.$refs.canvasFun.sliderVal = s > 1000 ? 1000 : s
                 }
-            }
+            },
         },
         haveFengMap() {
             this.init(this.floorid)
-        }
+        },
     },
     mounted() {
         this.mapSize()
@@ -458,9 +459,9 @@ export default {
             ProjectID: this.plazaId,
             BuildingID: '1',
             FloorID: this.$cookie.get('floorMapId') || 'f1',
-            fmapID: this.fmapID
+            fmapID: this.fmapID,
         }
-    }
+    },
 }
 </script>
 <style lang="less" scoped>

+ 13 - 13
src/components/legendremarks.vue

@@ -40,17 +40,17 @@ export default {
             text2: '图例后×的数字,代表此位置的数量',
             editorOption: {
                 modules: {
-                    toolbar: [['bold', 'underline'], [{ color: [] }], [{ list: 'ordered' }]]
+                    toolbar: [['bold', 'underline'], [{ color: [] }], [{ list: 'ordered' }]],
                 },
                 theme: 'snow',
-                placeholder: '请输入内容...'
+                placeholder: '请输入内容...',
             },
             title: '编辑图例备注',
-            visible: false
+            visible: false,
         }
     },
     computed: {
-        ...mapGetters(['remarksText', 'typeNum', 'planNum'])
+        ...mapGetters(['remarksText', 'typeNum', 'planNum']),
     },
     methods: {
         // 点击取消
@@ -59,7 +59,7 @@ export default {
                 this.$confirm('是否保存编辑后的备注?', '提示', {
                     confirmButtonText: '保存',
                     cancelButtonText: '取消',
-                    type: 'warning'
+                    type: 'warning',
                 })
                     .then(() => {
                         this.handleOk()
@@ -67,7 +67,7 @@ export default {
                     .catch(() => {
                         this.$message({
                             type: 'info',
-                            message: '已取消保存'
+                            message: '已取消保存',
                         })
                         this.visible = false
                     })
@@ -107,7 +107,7 @@ export default {
                 if (this.remarksText.search(`${this.text2}`) != -1) {
                     this.remarksTexts = this.remarksText
                 } else {
-                    if (this.planNum) {
+                    if (this.typeNum) {
                         this.remarksTexts = `${this.remarksText}<ol style="padding-left: 1.5em;"><li>${this.text2}</li></ol>`
                     } else {
                         this.remarksTexts = this.remarksText
@@ -131,14 +131,14 @@ export default {
                 postParams: {
                     graphId: this.$cookie.get('graphId'),
                     projectId: this.$store.state.plazaId,
-                    Note: val
-                }
+                    Note: val,
+                },
             }
-            updateRead(params).then(res => {
+            updateRead(params).then((res) => {
                 this.$message({
                     showClose: true,
                     message: '更新成功',
-                    type: 'success'
+                    type: 'success',
                 })
                 this.$emit('queryMarks')
                 this.visible = false
@@ -161,9 +161,9 @@ export default {
             if (val.html) {
                 this.remarksTexts = val.html
             }
-        }
+        },
     },
-    mounted() {}
+    mounted() {},
 }
 </script>
 

+ 57 - 67
src/store/index.js

@@ -1,15 +1,9 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import {
-    login,
-    queryFloor,
-    queryfmapID
-} from '@/api/login.js'
-import {
-    queryBrand
-} from '@/api/public.js'
-import axios from 'axios'
-import router from '../router'
+import Vue from "vue"
+import Vuex from "vuex"
+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({
@@ -17,36 +11,36 @@ export default new Vuex.Store({
         // ssoToken: 'admin:liujiandong',
         // ssoToken: '',
         ssoToken: null,
-        plazaName: '',
+        plazaName: "",
         isPreview: false,
-        lastRoute: '',
+        lastRoute: "",
         isrequestAuth: null, // 是否请求登录校验接口
-        permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
+        permissions: [""], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
         plazas: [], //项目列表
         userInfo: {
-            employeename: '', //用户名称:艾宇;
-            orgCode: '',
-            username: 'lengqiang', //账户名称
+            employeename: "", //用户名称:艾宇;
+            orgCode: "",
+            username: "lengqiang", //账户名称
         },
-        plazaId: '', //项目Id
-        projectName: '', //全局项目名称
+        plazaId: "", //项目Id
+        projectName: "", //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
-        fmapID: '',
+        fmapID: "",
         haveFengMap: -1, //是否有蜂鸟地图的数据 -1为等待 0 为失败 1 为成功
         isMessage: true, //是否有发布的图
         scpzTable: [], //土建装饰图例展示
         legendTable: [], //除土建装饰图例展示
-        remarksText: '', //备注
+        remarksText: "", //备注
         // defaultComment: '',
         bunkObj: {}, // 铺位名称
         currentFloor: {}, //当前选中的楼层信息
         accessLevel: -1, // 权限级别
         showView: 1,
-        categoryId: 'GDXT', //当前选中的系统
+        categoryId: "GDXT", //当前选中的系统
         isGetmap: false, //是否可以请求底图(在项目中方可请求)
-        planNum: '', //主要设备房 展示备注需要
-        typeNum: '', //图例数量 展示备注需要
+        planNum: "", //主要设备房 展示备注需要
+        typeNum: "", //图例数量 展示备注需要
     },
     getters: {
         plazaName: (state) => state.plazaName,
@@ -167,45 +161,43 @@ export default new Vuex.Store({
     },
     actions: {
         // 获取项目列表、userId
-        async getUserInfo({
-            commit
-        }, palyload) {
+        async getUserInfo({ commit }, palyload) {
             await login({
-                    returnTree: true,
-                })
+                returnTree: true,
+            })
                 .then((res) => {
                     // 获取用户当前权限
                     console.log(res.result)
-                    if (res.result === 'success') {
-                        commit('STOREACCESSLEVEL', res.level)
-                        commit('SETAUTHMSG', res)
+                    if (res.result === "success") {
+                        commit("STOREACCESSLEVEL", res.level)
+                        commit("SETAUTHMSG", res)
                         let level = res.level
-                        console.log('window.opener', window.opener)
+                        console.log("window.opener", window.opener)
                         if (window.opener && window.opener.__fromGroupPage) {
                             let data = window.opener.__fromGroupPage
                             level = data.level
-                            commit('SETPLAZENAME', data.plazaName)
-                            localStorage.setItem('PLAZAID', data.plazaId)
-                            commit('STOREPLAZAID', data.plazaId)
+                            commit("SETPLAZENAME", data.plazaName)
+                            localStorage.setItem("PLAZAID", data.plazaId)
+                            commit("STOREPLAZAID", data.plazaId)
                             router.push({
-                                path: './home/homepage',
+                                path: "./home/homepage",
                             })
                         } else {
                             if (level === 0) {
                                 if (res.treeData[0].ccode) {
-                                    localStorage.setItem('PLAZAID', res.treeData[0].ccode)
-                                    commit('STOREPLAZAID', res.treeData[0].ccode)
-                                    commit('SETPLAZENAME', res.treeData[0].cname)
+                                    localStorage.setItem("PLAZAID", res.treeData[0].ccode)
+                                    commit("STOREPLAZAID", res.treeData[0].ccode)
+                                    commit("SETPLAZENAME", res.treeData[0].cname)
                                 }
                                 router.push({
-                                    path: './home/overview',
+                                    path: "./home/overview",
                                     query: {
-                                        plazaId: res.treeData[0].ccode
+                                        plazaId: res.treeData[0].ccode,
                                     },
                                 })
                             } else {
                                 router.push({
-                                    path: './group',
+                                    path: "./group",
                                 })
                             }
                         }
@@ -213,38 +205,36 @@ export default new Vuex.Store({
                         // 指定条问题
                         window.wd_fm_info = {
                             profile: {
-                                username: encodeURIComponent(res.username)
-                            }
-                        };
+                                username: encodeURIComponent(res.username),
+                            },
+                        }
                     }
                 })
                 .catch((err) => {
-                    console.log('getuserfo catch', err)
+                    console.log("getuserfo catch", err)
                     // router.push({
                     //     path: '/404',
                     // })
                     // commit('SETISREQUESTtAUTH', err)
                 })
         },
-        async getUserInfoNoPath({
-            commit
-        }, palyload) {
+        async getUserInfoNoPath({ commit }, palyload) {
             await login({
-                    returnTree: true,
-                })
+                returnTree: true,
+            })
                 .then((res) => {
-                    if (res.result === 'success') {
+                    if (res.result === "success") {
                         // commit('STOREACCESSLEVEL', res.level)
-                        commit('SETAUTHMSG', res)
+                        commit("SETAUTHMSG", res)
                         window.wd_fm_info = {
                             profile: {
-                                username: encodeURIComponent(res.username)
-                            }
-                        };
+                                username: encodeURIComponent(res.username),
+                            },
+                        }
                     }
                 })
                 .catch((err) => {
-                    console.log('getuserfo catch', err)
+                    console.log("getuserfo catch", err)
                     // router.push({
                     //     path: '/404',
                     // })
@@ -253,23 +243,23 @@ export default new Vuex.Store({
         },
         async getFloors(context) {
             await queryFloor({
-                plazaId: localStorage.getItem('PLAZAID') || context.state.plazaId,
+                plazaId: localStorage.getItem("PLAZAID") || context.state.plazaId,
             }).then((res) => {
-                if (res.result == 'success') {
-                    context.commit('SETFLOORS', res.data)
+                if (res.result == "success") {
+                    context.commit("SETFLOORS", res.data)
                 }
             })
         },
         async getfmapID(context) {
             await queryfmapID({
-                mapId: localStorage.getItem('PLAZAID') || context.state.plazaId,
+                mapId: localStorage.getItem("PLAZAID") || context.state.plazaId,
             }).then((res) => {
-                context.commit('SETMAPID', `${localStorage.getItem('PLAZAID') || context.state.plazaId}_${res.mapVersion}`)
+                context.commit("SETMAPID", `${localStorage.getItem("PLAZAID") || context.state.plazaId}_${res.mapVersion}`)
             })
         },
         async getBrand(context) {
             let data = {
-                plazaId: `${localStorage.getItem('PLAZAID') || context.state.plazaId}`,
+                plazaId: `${localStorage.getItem("PLAZAID") || context.state.plazaId}`,
             }
             await queryBrand({
                 data,
@@ -281,9 +271,9 @@ export default new Vuex.Store({
                         obj[i.bunkdesc] = i
                     })
                 }
-                context.commit('SETBUNKOBJ', obj)
+                context.commit("SETBUNKOBJ", obj)
             })
         },
     },
     modules: {},
-})
+})

+ 10 - 12
src/views/equipment/eqDialog.vue

@@ -141,7 +141,6 @@ export default {
     methods: {
         //打开弹窗
         showModal(item) {
-            debugger
             console.log(item)
             this.visible = true
             this.dialogInfo = item
@@ -157,17 +156,6 @@ export default {
                     this.activeName = this.typecode
                     this.isShowTab()
                     this.initImage(this.typecode)
-                    if (
-                        this.dialogInfo.children[0].id.slice(2, 4) == 'YL' &&
-                        this.dialogInfo.children[this.dialogInfo.children.length - 1].param.type_code.slice(0, 3) == 'FBT'
-                    ) {
-                        this.typecode = this.dialogInfo.children[this.dialogInfo.children.length - 1].param.type_code
-                        this.activeName = this.typecode
-                        this.showFenbuPic = true
-                        this.$nextTick(() => {
-                            this.$refs.fenbutu[0] && this.$refs.fenbutu[0].openFloorMap()
-                        })
-                    }
                 }
             } else {
                 this.activeName = this.dialogInfo.param.tab_code
@@ -304,14 +292,24 @@ export default {
             queryTab({ data, postParams }).then((res) => {
                 this.tabCount = []
                 let data = res.data.data || []
+                let counts = []
                 data.forEach((el) => {
                     this.tabCount.push({
                         count: el.count,
                         system: el.params.system,
                         typecode: el.params.typecode,
                     })
+                    counts.push(el.count)
                 })
                 this.$emit('emitCount', this.tabCount)
+                if (counts.every((el) => el == 0)) {
+                    this.typecode = this.dialogInfo.children[this.dialogInfo.children.length - 1].param.type_code
+                    this.activeName = this.typecode
+                    this.showFenbuPic = true
+                    this.$nextTick(() => {
+                        this.$refs.fenbutu[0] && this.$refs.fenbutu[0].openFloorMap()
+                    })
+                }
             })
         },
         /**

+ 18 - 18
src/views/legendLibrary/addLegend.vue

@@ -85,13 +85,13 @@ export default {
                 Size: { Height: '32', Width: '32' },
                 InfoTypeId: [], //铺位可视化typeid
                 InfoLocal: [], //工程信息化位置与设备分类
-                InfoSystem: [] //工程信息化专业/系统
+                InfoSystem: [], //工程信息化专业/系统
             },
             title: '',
             GraphCategoryId: 'DTXT',
             modalShow4: false,
             treeData: [],
-            tableData: []
+            tableData: [],
         }
     },
     components: { addForm, addList },
@@ -101,17 +101,17 @@ export default {
             this.GraphCategoryId = GraphCategoryId
             //console.log(title)
             let getParams = {
-                categoryId: String(this.GraphCategoryId)
+                categoryId: String(this.GraphCategoryId),
             }
             if (GraphCategoryId) {
-                groupByCategory({ getParams }).then(res => {
+                groupByCategory({ getParams }).then((res) => {
                     this.treeData = []
-                    this.treeData = res.Data.map(i => this.getTree(i))
+                    this.treeData = res.Data.map((i) => this.getTree(i))
                 })
                 //获取图例列表
                 let postParams = this.GraphCategoryId
                 let data = {}
-                queryRelation({ data, postParams }).then(res => {
+                queryRelation({ data, postParams }).then((res) => {
                     this.tableData = res.data.Content
                 })
                 //treeSelect
@@ -127,7 +127,7 @@ export default {
 
                     InfoTypeId: [], //铺位可视化typeid
                     InfoLocal: [], //工程信息化位置与设备分类
-                    InfoSystem: [] //工程信息化专业/系统
+                    InfoSystem: [], //工程信息化专业/系统
                 }
             } else if (title == '添加图例库') {
                 this.dialogVisible = true
@@ -144,7 +144,7 @@ export default {
 
                     InfoTypeId: [], //铺位可视化typeid
                     InfoLocal: [], //工程信息化位置与设备分类
-                    InfoSystem: [] //工程信息化专业/系统
+                    InfoSystem: [], //工程信息化专业/系统
                 }
             } else if (title == '修改图例库') {
                 this.dialogVisible = true
@@ -152,7 +152,7 @@ export default {
                 this.InfosList = []
                 this.InfoTypeIdList = []
                 // this.InfosList = [...row.InfoLocal.map(({ id }) => id), ...row.InfoSystem]
-                this.InfosList = row.InfoLocal ? [...row.InfoLocal.map(({ id }) => id)] : []
+                this.InfosList = row.InfoLocal ? [...row.InfoLocal.map(({ id, type }) => id + type)] : []
                 this.InfoTypeIdList = row.InfoTypeId
 
                 // 图例库规则中的transform
@@ -164,7 +164,7 @@ export default {
             return {
                 id: data.Id,
                 name: data.Name,
-                children: data.Children && data.Children.length > 0 ? data.Children.map(i => this.getTree(i)) : []
+                children: data.Children && data.Children.length > 0 ? data.Children.map((i) => this.getTree(i)) : [],
             }
         },
         cancal() {
@@ -178,7 +178,7 @@ export default {
                 Size: { Height: '32', Width: '32' },
                 InfoTypeId: [], //铺位可视化typeid
                 InfoLocal: [], //工程信息化位置与设备分类
-                InfoSystem: [] //工程信息化专业/系统
+                InfoSystem: [], //工程信息化专业/系统
             }
             this.InfoTypeIdList = []
             this.InfosList = []
@@ -223,26 +223,26 @@ export default {
             let tableList = [],
                 list = [],
                 totalLst = []
-            dataObj.forEach(i => {
+            dataObj.forEach((i) => {
                 list.push({
                     Id: i.id,
-                    name: i.name
+                    name: i.name,
                 })
             })
             tableList = [...list, ...this.tableData]
             tableList.forEach((i, index) => {
                 totalLst.push({
                     GraphElementId: i.Id,
-                    OrderId: index
+                    OrderId: index,
                 })
             })
 
             let postParams = {
                 GraphCategoryId: this.GraphCategoryId[0],
-                GraphRelations: totalLst
+                GraphRelations: totalLst,
             }
             console.log(totalLst, 'list')
-            updateRelation({ postParams }).then(res => {
+            updateRelation({ postParams }).then((res) => {
                 if (res.Result == 'success') {
                     this.$message.success('添加成功!')
                     this.$emit('mesg')
@@ -251,8 +251,8 @@ export default {
         },
         treeCancel() {
             this.modalShow4 = false
-        }
-    }
+        },
+    },
 }
 </script>