Kaynağa Gözat

Merge branch 'develop' of git.sagacloud.cn:web/wanda-bm-guide into develop

guoxiaohuan 4 yıl önce
ebeveyn
işleme
30583c1992

+ 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" />

+ 33 - 27
src/components/floorMap/index.vue

@@ -102,40 +102,46 @@ export default {
                     this.scene.addItem(imgItem)
                     this.view.scene = this.scene
                     // this.view.fitSceneToView()
+                } else {
+                    // 屋顶图不为图片
+                    this.readBaseMap(floor);
                 }
             } else {
                 if (window.fengmapData.gnameToGid[floor]) {
-                    window.fengmapData.parseData(window.fengmapData.gnameToGid[floor], (res) => {
-                        if (res.err) {
-                            console.log('errr', res.err)
-                            return
-                        }
-                        this.fParser = new SFloorParser(null)
-                        this.fParser.parseData(res)
-                        this.fParser.spaceList.forEach((t) => {
-                            this.scene.addItem(t)
-                            t.nameSize = 12
-                            t.nameColor = '#2a2a2a'
-                            if (t.data.Name && this.bunkObj[t.data.Name]) {
-                                t.name = this.bunkObj[t.data.Name].brandname
-                            } else {
-                                // t.name = t.data.Name
-                                t.name = ''
-                            }
-                        })
-                        this.fParser.wallList.forEach((t) => this.scene.addItem(t))
-                        this.fParser.virtualWallList.forEach((t) => this.scene.addItem(t))
-                        this.fParser.doorList.forEach((t) => this.scene.addItem(t))
-                        this.fParser.columnList.forEach((t) => this.scene.addItem(t))
-                        this.fParser.casementList.forEach((t) => this.scene.addItem(t))
-                        this.view.scene = this.scene
-                        // this.view.fitSceneToView()
-                        this.readGraph()
-                    })
+                    this.readBaseMap(floor);
                 } else {
                     console.log('楼层不正确')
                 }
             }
+        },// 解析底图
+        readBaseMap(floor){
+            window.fengmapData.parseData(window.fengmapData.gnameToGid[floor], res => {
+                if (res.err) {
+                    console.log('errr', res.err)
+                    return
+                }
+                this.fParser = new SFloorParser(null)
+                this.fParser.parseData(res)
+                this.fParser.spaceList.forEach(t => {
+                    this.scene.addItem(t)
+                    t.nameSize = 12
+                    t.nameColor = '#2a2a2a'
+                    if (t.data.Name && this.bunkObj[t.data.Name]) {
+                        t.name = this.bunkObj[t.data.Name].brandname
+                    } else {
+                        // t.name = t.data.Name
+                        t.name = ''
+                    }
+                })
+                this.fParser.wallList.forEach(t => this.scene.addItem(t))
+                this.fParser.virtualWallList.forEach(t => this.scene.addItem(t))
+                this.fParser.doorList.forEach(t => this.scene.addItem(t))
+                this.fParser.columnList.forEach(t => this.scene.addItem(t))
+                this.fParser.casementList.forEach(t => this.scene.addItem(t))
+                this.view.scene = this.scene
+                // this.view.fitSceneToView()
+                this.readGraph()
+            })
         },
         readGraph() {
             this.readGroup(this.floorid)

+ 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>