Kaynağa Gözat

fix:解决冲突

YaolongHan 4 yıl önce
ebeveyn
işleme
242a2a0577

BIN
src/assets/imgs/yl.png


+ 42 - 13
src/components/Legend/src/legend.vue

@@ -6,7 +6,7 @@
 <template>
     <div>
         <div class='legend-container'>
-            <div class='legend' @click='showTl' v-if='type==1'>图例</div>
+            <div class='legend' @click='showTl' v-if='(type==1 || floors.length>0)&& isMessage'>图例</div>
             <el-collapse-transition>
                 <div class='legend-tab' v-if='show'>
                     <div class='legend-table'>
@@ -50,11 +50,11 @@
         <div class='edit_map' v-else>
             <!-- 备注编辑器 -->
             <el-tooltip effect='dark' content='编辑备注' placement='left'>
-                <span v-if='systemName != "土建系统"' class='bjtk' @click='legendClik'>备注</span>
+                <span v-if='systemName != "土建系统" && isMessage' class='bjtk' @click='legendClik'>备注</span>
             </el-tooltip>
             <!-- 编辑图例 -->
             <el-tooltip effect='dark' content='编辑图例' placement='left'>
-                <p v-if='systemName != "土建系统"' @click='editTl' class='tltk'>
+                <p v-if='systemName != "土建系统" && isMessage' @click='editTl' class='tltk'>
                     <img src='@/assets/imgs/bjtl.png' alt />
                 </p>
             </el-tooltip>
@@ -77,7 +77,7 @@
         <div class='select-floor' v-if='isFloor'>
             <p class='p1'>请选择需要创建“消防泵房引出管路分布图”的楼层</p>
             <p class='p2'>
-                <Select width='240' tipPlace='top' caption='楼层:' size='mini' :selectdata='floorSelect' :placeholder='"请选择"'></Select>
+                <Select width='240' tipPlace='top' v-model='floor' caption='楼层:' size='mini' :selectdata='floorSelectAble' :placeholder='"请选择"'></Select>
             </p>
             <p class='p3'>
                 <span @click='cancel'>取消</span>
@@ -116,11 +116,14 @@ export default {
             editText: '',
             editSwitch: false,
             isFloor: false,
-            editPmt: true //是否有跳转道图例库的权限
+            editPmt: true, //是否有跳转道图例库的权限
+            floorSelectAble: [],
+            floor: '', //传的楼层
+            floorName: ''
         }
     },
     computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'floorSelect'])
+        ...mapGetters(['plazaId', 'fmapID', 'floorSelect', 'isMessage'])
     },
     props: {
         floors: {
@@ -136,10 +139,22 @@ export default {
         systemName: {
             default: '',
             type: String
+        },
+        categoryId: {
+            default: '',
+            type: String
         }
     },
     components: { lengendView, legendRemarks, lengendEdit },
     methods: {
+        formatFloor() {
+            this.floorSelectAble = []
+            this.floorSelectAble = this.floorSelect.filter(item => {
+                const hit = this.floors.find(i => i.gname == item.id)
+                return !hit
+            })
+            console.log(this.floorSelectAble)
+        },
         testClick(data) {},
         // 编辑备注
         legendClik() {
@@ -148,7 +163,7 @@ export default {
         // 查询备注
         queryMarks() {
             let postParams = {
-                categoryId: this.$cookie.get('categoryId'),
+                categoryId: this.categoryId ? this.categoryId : this.$cookie.get('categoryId'),
                 projectId: this.$store.state.plazaId,
                 BuildingID: '1',
                 FloorID: this.$cookie.get('floorNow')
@@ -156,7 +171,6 @@ export default {
 
             let data = {}
             queryRead({ data, postParams }).then(res => {
-                console.log('备注', res)
                 if (res.data.Data && res.data.Data[0].Note) {
                     let note = res.data.Data[0].Note
                     if (note.search(this.text1) != -1 && note.search(this.text2) != -1) {
@@ -195,14 +209,23 @@ export default {
          * @description t跳转editer编辑器
          */
         goToEditer() {
-            let FloorID = this.$cookie.get('floorMapId') || 'f1'
-            let categoryId = this.$cookie.get('categoryId')
+            if (this.floor) {
+                this.floorSelect.forEach(el => {
+                    if (el.id == this.floor) {
+                        this.floorName = el.name
+                    }
+                })
+                console.log(this.floorName)
+            }
+
+            let FloorID = this.floor ? this.floor : this.$cookie.get('floorMapId') || 'f1'
+            let categoryId = this.categoryId ? this.categoryId : this.$cookie.get('categoryId')
             const { conf } = window.__systemConf,
                 { editerUrl } = conf
-            let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&FloorName=${this.$cookie.get(
-                'floorNow'
-            )}&fmapID=${this.fmapID}`
+            let floorName = this.floorName ? this.floorName : this.$cookie.get('floorNow')
+            let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&FloorName=${floorName}&fmapID=${this.fmapID}`
             let url = editerUrl + 'editer?' + encodeURIComponent(data)
+            console.log(data)
             window.open(url, true)
         },
         isShow2() {
@@ -294,10 +317,16 @@ export default {
         // 新增楼层确定
         determine() {
             this.isFloor = false
+            this.goToEditer()
         }
     },
     mounted() {
         console.log(this.floors)
+        console.log(this.floorSelect)
+        if (this.floors.length > 0) {
+            debugger
+            this.formatFloor()
+        }
     }
 }
 </script>

+ 14 - 21
src/components/floorList.vue

@@ -70,24 +70,14 @@ export default {
     },
     props: {
         floorsArr: {
-            type: Array
-            /*  default: () => {
-                return [
-                    { name: '第6层', code: 'F6', gname: 'f6', gcode: '6F', seq: 600 },
-                    { name: '第5层', code: 'F5', gname: 'f5', gcode: '5F', seq: 500 },
-                    { name: '第4层', code: 'F4', gname: 'f4', gcode: '4F', seq: 400 },
-                    { name: '第3层', code: 'F3', gname: 'f3', gcode: '3F', seq: 300 },
-                    { name: '第2层', code: 'F2', gname: 'f2', gcode: '2F', seq: 200 },
-                    { name: '第1层', code: 'F1', gname: 'f1', gcode: '1F', seq: 100 },
-                    { name: '地下1层', code: 'B1', gname: 'b1', gcode: 'B1', seq: -100 },
-                    { name: '地下2层', code: 'B2', gname: 'b2', gcode: 'B2', seq: -200 },
-                    { name: '地下3层', code: 'B3', gname: 'b3', gcode: 'B3', seq: -300 },
-                    { name: '地下4层', code: 'B4', gname: 'b4', gcode: 'B4', seq: -400 }
-                ]
-            } */
+            type: Array,
+            default: () => {
+                ;[]
+            }
         }
     },
     mounted() {
+        console.log(this.floorsArr)
         this.init()
     },
     watch: {
@@ -180,12 +170,15 @@ export default {
         handleCookie() {
             // return true
             let currentFloor = this.floorsArr.filter(item => item.seq == this.currentFloorId)[0]
-            this.$cookie.set('floorNow', currentFloor.code, 3)
-            this.$cookie.set('floorMapId', currentFloor.gname, 3)
-            this.$cookie.set('currentFloorId', currentFloor.seq, 3)
-            this.floorId = this.$cookie.get('floorNow') || currentFloor.code
-            this.floorMapIdName = this.$cookie.get('floorMapId') || currentFloor.gname
-            this.$emit('emitFloor', currentFloor)
+            console.log(currentFloor)
+            if (currentFloor) {
+                this.$cookie.set('floorNow', currentFloor.code || '', 3)
+                this.$cookie.set('floorMapId', currentFloor.gname, 3)
+                this.$cookie.set('currentFloorId', currentFloor.seq, 3)
+                this.floorId = this.$cookie.get('floorNow') || currentFloor.code
+                this.floorMapIdName = this.$cookie.get('floorMapId') || currentFloor.gname
+                this.$emit('emitFloor', currentFloor)
+            }
         },
         /**
          * @name tabFloor

+ 14 - 4
src/components/floorMap/canvasFun.vue

@@ -12,12 +12,17 @@
                     </el-dropdown-menu>
                 </el-dropdown>
             </div>
-            <div class='small-block'>
+            <div class='small-block' @click='showText'>
                 <i>
-                    <img src='../../assets/imgs/er.png' alt />
+                    <el-tooltip v-if='isShow' effect='dark' content='隐藏店铺名称' placement='top'>
+                        <img src='../../assets/imgs/er.png' alt />
+                    </el-tooltip>
+                    <el-tooltip v-else effect='dark' content='显示店铺名称' placement='top'>
+                        <img src='../../assets/imgs/yl.png' alt />
+                    </el-tooltip>
                 </i>
             </div>
-            <div class='small-block' @click='fitToWindow'>
+            <div class='small-block' @click='showText'>
                 <i>
                     <img src='../../assets/imgs/qp.png' alt />
                 </i>
@@ -43,7 +48,8 @@ export default {
             min: 1,
             max: 1000,
             everyScale: 1, // 每份的放大倍数
-            isSwitch: false // 是否开启吸附
+            isSwitch: false, // 是否开启吸附
+            isShow: true
         }
     },
 
@@ -91,6 +97,10 @@ export default {
                 this.sliderVal = this.maxScale
             }
             this.scale(this.sliderVal)
+        },
+        showText() {
+            this.isShow = !this.isShow
+            this.$emit('showText', this.isShow)
         }
     }
 }

+ 281 - 256
src/components/floorMap/index.vue

@@ -1,280 +1,305 @@
 
 <!-- 底图 -->
 <template>
-  <div id="floor_base" v-loading="loading" ref="graphy">
-    <canvas :id="`canvas${id}`" :width="canvasWidth" :height="canvasHeight" tabindex="0"></canvas>
-    <!-- 地图底部操作按钮 -->
-    <div class="strip-bottom">
-      <canvasFun
-        @fit="fit"
-        @savePng="savePng"
-        @saveSvg="saveSvg"
-        @saveJson="saveJson"
-        @scale="scale"
-        ref="canvasFun"
-      ></canvasFun>
+    <div id='floor_base' v-loading='loading' ref='graphy'>
+        <canvas :id='`canvas${id}`' :width='canvasWidth' :height='canvasHeight' tabindex='0'></canvas>
+        <!-- 地图底部操作按钮 -->
+        <div class='strip-bottom'>
+            <canvasFun @fit='fit' @savePng='savePng' @saveSvg='saveSvg' @saveJson='saveJson' @scale='scale' @showText='showText' ref='canvasFun'></canvasFun>
+        </div>
+        <room-box ref='boxRoom'></room-box>
     </div>
-    <room-box ref="boxRoom"></room-box>
-  </div>
 </template>
 <script>
-import { SFengParser } from "@saga-web/feng-map";
-import { SFloorParser } from "@saga-web/big";
-import { FloorView } from "@/lib/FloorView";
-import { FloorScene } from "@/lib/FloorScene";
-import RoomBox from "@/views/room/index";
-import canvasFun from "@/components/floorMap/canvasFun";
-import { readGroup } from "@/api/public";
-import { STopologyParser } from "@/lib/parsers/STopologyParser";
-import { mapGetters, mapActions } from "vuex";
-import { SImageItem } from "@saga-web/graph/lib";
+import { SFengParser } from '@saga-web/feng-map'
+import { SFloorParser } from '@saga-web/big'
+import { FloorView } from '@/lib/FloorView'
+import { FloorScene } from '@/lib/FloorScene'
+import RoomBox from '@/views/room/index'
+import canvasFun from '@/components/floorMap/canvasFun'
+import { readGroup } from '@/api/public'
+import { STopologyParser } from '@/lib/parsers/STopologyParser'
+import { mapGetters, mapActions } from 'vuex'
+import { SImageItem } from '@saga-web/graph/lib'
+import bus from '@/utils/bus.js'
+
 // import { uuid } from "@/components/mapClass/until";
 
 export default {
-  data() {
-    return {
-      appName: "万达可视化系统",
-      key: "23f30a832a862c58637a4aadbf50a566",
-      mapServerURL: `/wdfn`,
-      canvasWidth: 1100,
-      canvasHeight: 800,
-      loading: false, // 限制重复查询
-      view: null,
-      urlMsg: {},
-      canvasID: "canvas",
-      floorid: "" //楼层id
-    };
-  },
-  props: {
-    id: {
-      default: "1",
-      type: String
-    },
-      categoryId: {
-      default: "",
-      type: String
+    data() {
+        return {
+            appName: '万达可视化系统',
+            key: '23f30a832a862c58637a4aadbf50a566',
+            mapServerURL: `/wdfn`,
+            canvasWidth: 1100,
+            canvasHeight: 800,
+            loading: false, // 限制重复查询
+            view: null,
+            urlMsg: {},
+            canvasID: 'canvas',
+            floorid: '', //楼层id
+            topologyParser: null // 解析器数据
+        }
     },
+    props: {
+        id: {
+            default: '1',
+            type: String
+        },
+        categoryId: {
+            default: '',
+            type: String
+        },
 
-    loadName: null,
-    type: null
-  },
-  components: { RoomBox, canvasFun },
-  computed: {
-    ...mapGetters(["plazaId", "fmapID", "haveFengMap"])
-  },
-  methods: {
-    ...mapActions(["getfmapID"]),
-    init(floorid) {
-      this.loading = true;
-      this.floorid = floorid;
-      setTimeout(() => {
-        if (this.haveFengMap) {
-          this.clearGraphy();
-          this.scene = new FloorScene();
-          this.scene.selectContainer.connect(
-            "listChange",
-            this,
-            this.listChange
-          );
-          if (this.canvasID != `canvas${this.id}`) {
-            this.canvasID = `canvas${this.id}`;
-          }
-          this.parserData(floorid);
-        }
-      },100);
+        loadName: null,
+        type: null
     },
-    parserData(floor) {
-      if (floor == "g80") {
-        // 屋顶
-        if (window.fengmapData.frImg) {
-          let imgItem = new SImageItem(
-            null,
-            `${this.mapServerURL}/webtheme/${this.fmapID}/${window.fengmapData.frImg}`
-          );
-          this.scene.addItem(imgItem);
-          this.view.scene = this.scene;
-          this.view.minScale = this.view.scale;
-          if (this.$refs.canvasFun) {
-            this.$refs.canvasFun.everyScale = this.view.scale;
-          }
-          this.view.fitSceneToView();
-        }
-      } else {
-        if (window.fengmapData.gnameToGid[floor]) {
-          window.fengmapData.parseData(
-            window.fengmapData.gnameToGid[floor],
-            res => {
-              if (res.err) {
-                console.log("errr", res.err);
-                return;
-              }
-              const fParser = new SFloorParser(null);
-              fParser.parseData(res);
-              fParser.spaceList.forEach(t => {
-                //   t.selectable = true;
-                this.scene.addItem(t);
-              });
-              fParser.wallList.forEach(t => this.scene.addItem(t));
-              fParser.virtualWallList.forEach(t => this.scene.addItem(t));
-              fParser.doorList.forEach(t => this.scene.addItem(t));
-              fParser.columnList.forEach(t => this.scene.addItem(t));
-              fParser.casementList.forEach(t => this.scene.addItem(t));
-              this.view.scene = this.scene;
-              this.view.minScale = this.view.scale;
-              if (this.$refs.canvasFun) {
-                this.$refs.canvasFun.everyScale = this.view.scale;
-              }
-              this.view.fitSceneToView();
-              //console.log('success')
+    components: { RoomBox, canvasFun },
+    computed: {
+        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap'])
+    },
+    methods: {
+        ...mapActions(['getfmapID']),
+        init(floorid) {
+            this.loading = true
+            this.floorid = floorid
+            setTimeout(() => {
+                if (this.haveFengMap) {
+                    this.clearGraphy()
+                    this.scene = new FloorScene()
+                    this.scene.selectContainer.connect('listChange', this, this.listChange)
+                    if (this.canvasID != `canvas${this.id}`) {
+                        this.canvasID = `canvas${this.id}`
+                    }
+                    this.parserData(floorid)
+                }
+            }, 100)
+        },
+        parserData(floor) {
+            if (floor == 'g80') {
+                // 屋顶
+                if (window.fengmapData.frImg) {
+                    let imgItem = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.fmapID}/${window.fengmapData.frImg}`)
+                    this.scene.addItem(imgItem)
+                    this.view.scene = this.scene
+                    this.view.minScale = this.view.scale
+                    if (this.$refs.canvasFun) {
+                        this.$refs.canvasFun.everyScale = this.view.scale
+                    }
+                    this.view.fitSceneToView()
+                }
+            } else {
+                if (window.fengmapData.gnameToGid[floor]) {
+                    window.fengmapData.parseData(window.fengmapData.gnameToGid[floor], res => {
+                        if (res.err) {
+                            console.log('errr', res.err)
+                            return
+                        }
+                        const fParser = new SFloorParser(null)
+                        fParser.parseData(res)
+                        fParser.spaceList.forEach(t => {
+                            //   t.selectable = true;
+                            this.scene.addItem(t)
+                        })
+                        fParser.wallList.forEach(t => this.scene.addItem(t))
+                        fParser.virtualWallList.forEach(t => this.scene.addItem(t))
+                        fParser.doorList.forEach(t => this.scene.addItem(t))
+                        fParser.columnList.forEach(t => this.scene.addItem(t))
+                        fParser.casementList.forEach(t => this.scene.addItem(t))
+                        this.view.scene = this.scene
+                        this.view.minScale = this.view.scale
+                        if (this.$refs.canvasFun) {
+                            this.$refs.canvasFun.everyScale = this.view.scale
+                        }
+                        this.view.fitSceneToView()
+                        //console.log('success')
+                    })
+                } else {
+                    console.log('楼层不正确')
+                }
             }
-          );
-        } else {
-          console.log("楼层不正确");
-        }
-      }
-      this.readGroup(this.floorid).then(data => {
-        this.loading = false;
-        if (data.Data.length > 0) {
-          //console.log(data.data.Data[0].ID)
-          this.$cookie.set("graphId", data.Data[0].ID, 3);
+            this.readGroup(this.floorid).then(data => {
+                this.loading = false
+                if (data.Result == 'failure') {
+                    this.$message({
+                        message: data.Message,
+                        type: 'warning'
+                    })
+                    this.$store.commit('SETISMESSAGE', false)
+                    //    一会回来存这个
+                } else {
+                    this.$store.commit('SETISMESSAGE', true)
+                }
+                if (data.Data.length > 0) {
+                    //console.log(data.data.Data[0].ID)
+                    this.$cookie.set('graphId', data.Data[0].ID, 3)
+                }
+                this.topologyParser = new STopologyParser(null)
+                this.topologyParser.parseData(data.Data[0].Elements)
+                // 多边形
+                this.topologyParser.zoneLegendList.forEach(t => {
+                    this.scene.addItem(t)
+                })
+                // 增加文字
+                this.topologyParser.textMarkerList.forEach(t => {
+                    this.scene.addItem(t)
+                })
+                // 增加图片
+                this.topologyParser.imageMarkerList.forEach(t => {
+                    this.scene.addItem(t)
+                })
+                // 增加直线
+                this.topologyParser.lineMarkerList.forEach(t => {
+                    this.scene.addItem(t)
+                })
+                // 增加图标类图例
+                this.topologyParser.imageLegendList.forEach(t => {
+                    this.scene.addItem(t)
+                })
+                // 增加管线类
+                // 增加图标类图例
+                this.topologyParser.relationList.forEach(t => {
+                    this.scene.addItem(t)
+                })
+                this.view.fitSceneToView()
+            })
+        },
+        clearGraphy() {
+            if (this.view) {
+                this.view.scene = null
+                return
+            }
+            this.view = new FloorView(`canvas${this.id}`)
+        },
+        listChange(item, ev) {
+            let name = ev[0][0].data.Name
+            if (name.slice(name.length - 2, name.length) == '机房') {
+                this.$refs.boxRoom.open({ name: name, type: this.type })
+            }
+        },
+        // 适配底图到窗口
+        fit() {
+            this.view.fitSceneToView()
+        },
+        // 保存为png
+        savePng() {
+            this.view.saveImage(`${this.loadName}.png`, 'png')
+            //console.log(`${this.loadName}.png`)
+        },
+        // 保存为svg
+        saveSvg() {
+            this.view.saveSceneSvg(`${this.loadName}.svg`, 6400, 4800)
+        },
+        // 保存为json
+        saveJson() {
+            this.view.saveFloorJson(`${this.loadName}.json`)
+        },
+        // 缩放
+        scale(val) {
+            if (!this.view) {
+                return
+            }
+            let scale = this.view.scale
+            this.view.scaleByPoint(val / scale, this.canvasWidth / 2, this.canvasHeight / 2)
+        },
+        showText(val) {
+            this.topologyParser.zoneLegendList.forEach(t => {
+                t.showText = val
+            })
+        },
+        // 读取数据
+        readGroup(FloorID) {
+            const data = {
+                BuildingID: '1',
+                FloorID: FloorID,
+                categoryId: this.categoryId ? this.categoryId : this.$cookie.get('categoryId'),
+                projectId: this.urlMsg.ProjectID
+            }
+            return readGroup(data)
+        },
+        // 地图尺寸
+        mapSize() {
+            if (window.screen.height == '768') {
+                this.canvasWidth = this.$refs.graphy.offsetWidth
+                this.canvasHeight = this.$refs.graphy.offsetHeight - 100
+            } else {
+                this.canvasWidth = this.$refs.graphy.offsetWidth
+                this.canvasHeight = 900
+            }
+        },
+        getEvent() {
+            bus.$on('changeShow', res => {
+                this.topologyParser.zoneLegendList.forEach(t => {
+                    let id = t.data.GraphElementId
+                    t.maskFlag = !(res.indexOf(id) > -1)
+                })
+                this.topologyParser.textMarkerList.forEach(t => {
+                    let id = t.data.GraphElementId
+                    t.maskFlag = !(res.indexOf(id) > -1)
+                })
+                this.topologyParser.imageMarkerList.forEach(t => {
+                    let id = t.data.GraphElementId
+                    t.maskFlag = !(res.indexOf(id) > -1)
+                })
+                this.topologyParser.lineMarkerList.forEach(t => {
+                    let id = t.data.GraphElementId
+                    t.maskFlag = !(res.indexOf(id) > -1)
+                })
+                this.topologyParser.imageLegendList.forEach(t => {
+                    let id = t.data.GraphElementId
+                    t.maskFlag = !(res.indexOf(id) > -1)
+                })
+                this.topologyParser.relationList.forEach(t => {
+                    let id = t.data.GraphElementId
+                    t.maskFlag = !(res.indexOf(id) > -1)
+                })
+            })
         }
-        const parserData = new STopologyParser(null);
-        parserData.parseData(data.Data[0].Elements);
-        // 多边形
-        parserData.zoneLegendList.forEach(t => {
-          this.scene.addItem(t);
-        });
-        // 增加文字
-        parserData.textMarkerList.forEach(t => {
-          this.scene.addItem(t);
-        });
-        // 增加图片
-        parserData.imageMarkerList.forEach(t => {
-          this.scene.addItem(t);
-        });
-        // 增加直线
-        parserData.lineMarkerList.forEach(t => {
-          this.scene.addItem(t);
-        });
-        // 增加图标类图例
-        parserData.imageLegendList.forEach(t => {
-          this.scene.addItem(t);
-        });
-        // 增加管线类
-        // 增加图标类图例
-        parserData.relationList.forEach(t => {
-          this.scene.addItem(t);
-        });
-        this.view.fitSceneToView();
-      });
-    },
-    clearGraphy() {
-      if (this.view) {
-        this.view.scene = null;
-        return;
-      }
-      this.view = new FloorView(`canvas${this.id}`);
     },
-    listChange(item, ev) {
-      let name = ev[0][0].data.Name;
-      if (name.slice(name.length - 2, name.length) == "机房") {
-        this.$refs.boxRoom.open({ name: name, type: this.type });
-      }
-    },
-    // 适配底图到窗口
-    fit() {
-      this.view.fitSceneToView();
-    },
-    // 保存为png
-    savePng() {
-      this.view.saveImage(`${this.loadName}.png`, "png");
-      //console.log(`${this.loadName}.png`)
-    },
-    // 保存为svg
-    saveSvg() {
-      this.view.saveSceneSvg(`${this.loadName}.svg`, 6400, 4800);
-    },
-    // 保存为json
-    saveJson() {
-      this.view.saveFloorJson(`${this.loadName}.json`);
-    },
-    // 缩放
-    scale(val) {
-      if (!this.view) {
-        return;
-      }
-      let scale = this.view.scale;
-      console.log(val / scale, this.canvasWidth / 2, this.canvasHeight / 2);
-      this.view.scaleByPoint(
-        val / scale,
-        this.canvasWidth / 2,
-        this.canvasHeight / 2
-      );
+    watch: {
+        'view.scale': {
+            handler(n) {
+                if (this.$refs.canvasFun) {
+                    let s = (n * 10) / this.view.minScale
+                    this.$refs.canvasFun.sliderVal = s > 1000 ? 1000 : s
+                }
+            }
+        },
+        haveFengMap(val) {
+            if (val) {
+                this.init(this.floorid)
+            }
+        }
     },
-    // 读取数据
-    readGroup(FloorID) {
-      const data = {
-        BuildingID: "1",
-        FloorID: FloorID,
-        categoryId: this.categoryId ? this.categoryId : this.$cookie.get("categoryId"),
-        projectId: this.urlMsg.ProjectID
-      };
-      return readGroup(data);
+    mounted() {
+        this.mapSize()
+        this.getEvent()
     },
-    // 地图尺寸
-    mapSize() {
-      if (window.screen.height == "768") {
-        this.canvasWidth = this.$refs.graphy.offsetWidth;
-        this.canvasHeight = this.$refs.graphy.offsetHeight - 100;
-      } else {
-        this.canvasWidth = this.$refs.graphy.offsetWidth;
-        this.canvasHeight = 900;
-      }
-    }
-  },
-  watch: {
-    "view.scale": {
-      handler(n) {
-        if (this.$refs.canvasFun) {
-          let s = (n * 10) / this.view.minScale;
-          this.$refs.canvasFun.sliderVal = s > 1000 ? 1000 : s;
+    created() {
+        this.urlMsg = {
+            categoryId: this.$cookie.get('categoryId'),
+            ProjectID: this.plazaId,
+            BuildingID: '1',
+            FloorID: this.$cookie.get('floorMapId') || 'f1',
+            fmapID: this.fmapID
         }
-      }
-    },
-    haveFengMap(val) {
-      if (val) {
-        this.init(this.floorid);
-      }
     }
-  },
-  mounted() {
-    this.mapSize();
-  },
-  created() {
-    this.urlMsg = {
-      categoryId: this.$cookie.get("categoryId"),
-      ProjectID: this.plazaId,
-      BuildingID: "1",
-      FloorID: this.$cookie.get("floorMapId") || "f1",
-      fmapID: this.fmapID
-    };
-  }
-};
+}
 </script>
 <style lang="less" scoped>
 #floor_base {
-  position: relative;
-  .fengMap {
-    position: fixed;
-    width: 100px;
-    height: 100px;
-    z-index: -1;
-  }
-  .strip-bottom {
-    position: absolute;
-    right: 0;
-    bottom: 40px;
-    width: 100%;
-  }
+    position: relative;
+    .fengMap {
+        position: fixed;
+        width: 100px;
+        height: 100px;
+        z-index: -1;
+    }
+    .strip-bottom {
+        position: absolute;
+        right: 0;
+        bottom: 40px;
+        width: 100%;
+    }
 }
 </style>

+ 3 - 1
src/components/menuList.vue

@@ -68,7 +68,7 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['plazas', 'plazaId','fmapID'])
+        ...mapGetters(['plazas', 'plazaId', 'fmapID'])
     },
     watch: {
         $route: 'handleRoute'
@@ -79,7 +79,9 @@ export default {
     mounted() {
         window.vm = this
         this.handleRoute(this.$route)
+        console.log(this.fmapID)
     },
+
     methods: {
         //入草稿箱
         toDrafts() {

+ 2 - 3
src/lib/items/SFHFQZoneLegendItem.js

@@ -28,7 +28,6 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this.id = data.ID;
         this.name = data.Name;
         this.text = data.Name;
-        this.font = new SFont("sans-serif", 2);
         if (data) {
             this.setPointList = [];
             let setPointList;
@@ -57,7 +56,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
                 this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = data.Properties.color;
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
@@ -166,7 +165,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         });
         this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
         this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color;
+        this.data.Properties.color = this.color.value;
         return this.data;
     }
     onDraw(painter) {

+ 8 - 9
src/lib/items/SFHFQZoneLegendItem.ts

@@ -25,11 +25,11 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this.textItem.text = v;
         this.update();
     }
-    get color(): string {
+    get color(): SColor {
         return this.textItem.color;
     }
-    set color(v: string) {
-        this.textItem.color = v
+    set color(v: SColor) {
+        this.textItem.color = v;
     }
     get font(): SFont {
         return this.textItem.font
@@ -111,7 +111,6 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this.id = data.ID;
         this.name = data.Name;
         this.text = data.Name;
-        this.font = new SFont("sans-serif", 2);
         if (data) {
             this.setPointList = [];
             let setPointList: SPoint[];
@@ -133,13 +132,13 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
                 this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
             }
             if (data.Properties.FillColor) {
-                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor))
+                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor));
             }
             if (data.Properties.TextPos) {
                 this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = data.Properties.color
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
@@ -173,9 +172,9 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
                 Y: pos.y
             }
         });
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
-        this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color;
+        this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
+        this.data.Properties.font =  this.font.size;
+        this.data.Properties.color =  this.color.value;
         return this.data;
     }
 

+ 3 - 3
src/lib/items/SImageLegendItem.js

@@ -1,6 +1,6 @@
 import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
 import { ItemOrder } from '@saga-web/big/lib';
-import { SFont } from '@saga-web/draw/lib';
+import { SFont, SColor } from '@saga-web/draw/lib';
 /**
  * 图例节点Item(图标类型)
  *
@@ -45,7 +45,7 @@ export class SImageLegendItem extends SIconTextItem {
             this.font = new SFont("sans-serif", data.Properties.font);
         }
         if (data.Properties && data.Properties.color) {
-            this.color = data.Properties.color;
+            this.color = new SColor(data.Properties.color);
         }
     }
     get num() {
@@ -72,7 +72,7 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Properties.sWidth = this.sWidth;
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color;
+        this.data.Properties.color = this.color.value;
         return this.data;
     }
 } // Class SImageLegendItem

+ 3 - 3
src/lib/items/SImageLegendItem.ts

@@ -3,7 +3,7 @@ import { SGraphItem } from "@saga-web/graph/lib";
 import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
 import { Legend } from '../types/Legend';
 import { ItemOrder } from '@saga-web/big/lib';
-import { SFont } from '@saga-web/draw/lib';
+import { SFont, SColor } from '@saga-web/draw/lib';
 /**
  * 图例节点Item(图标类型)
  *
@@ -66,7 +66,7 @@ export class SImageLegendItem extends SIconTextItem {
             this.font = new SFont("sans-serif", data.Properties.font);
         }
         if (data.Properties && data.Properties.color) {
-            this.color = data.Properties.color;
+            this.color = new SColor(data.Properties.color);
         }
     }
 
@@ -78,7 +78,7 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Properties.sWidth = this.sWidth;
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color;
+        this.data.Properties.color = this.color.value;
 
         return this.data;
     }

+ 0 - 36
src/lib/items/SImageMarkerItem.js

@@ -1,36 +0,0 @@
-import { SImageItem } from "@saga-web/graph/lib";
-import { ItemOrder } from '@saga-web/big/lib';
-/**
- * 标识对象Item(图标类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SImageMarkerItem extends SImageItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      标识对象数据
-     */
-    constructor(parent, data) {
-        super(parent);
-        this.zOrder = ItemOrder.imageOrder;
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
-        if (data.Size) {
-            this.width = data.Size.Width;
-            this.height = data.Size.Height;
-        }
-        if (data.Properties && data.Properties.Url) {
-            this.url = data.Properties.Url;
-        }
-    } // Constructor
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y };
-        this.data.Size = { Width: this.width, Height: this.height };
-        this.data.Properties.Url = this.url;
-        return this.data;
-    }
-} // Class SImageMarkerItem

+ 0 - 47
src/lib/items/SLineLegendItem.js

@@ -1,47 +0,0 @@
-import { SPoint } from "@saga-web/draw/lib";
-import { SPolylineItem } from '@saga-web/big/lib';
-/**
- * 图例节点Item(线类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SLineLegendItem extends SPolylineItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent, []);
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
-        if (data.Properties && data.Properties.Line) {
-            let setPointList;
-            setPointList = data.Properties.Line.map(i => {
-                return new SPoint(i.x, i.y);
-            });
-            this.pointList = setPointList;
-        }
-        if (data.Properties && data.Properties.LineWidth) {
-            this.lineWidth = data.Properties.LineWidth;
-        }
-        if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = data.Properties.StrokeColor;
-        }
-    }
-    toData() {
-        this.data.Pos = { X: this.x, Y: this.y };
-        this.data.Properties.Line = this.pointList.map(pos => {
-            return {
-                X: pos.x,
-                Y: pos.y
-            };
-        });
-        this.data.Properties.LineWidth = this.lineWidth;
-        this.data.Properties.StrokeColor = this.strokeColor;
-        return this.data;
-    }
-} // Class SLineLegendItem

+ 2 - 2
src/lib/items/SLineMarkerItem.js

@@ -36,7 +36,7 @@ export class SLineMarkerItem extends SLineItem {
             this.lineStyle = data.Properties.LineStyle;
         }
         if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = data.Properties.StrokeColor;
+            this.strokeColor = new SColor(data.Properties.StrokeColor);
         }
     } // Constructor
     get maskFlag() {
@@ -58,7 +58,7 @@ export class SLineMarkerItem extends SLineItem {
             };
         });
         this.data.Properties.LineWidth = this.lineWidth;
-        this.data.Properties.StrokeColor = this.strokeColor;
+        this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineStyle = this.lineStyle;
         return this.data;
     }

+ 2 - 2
src/lib/items/SLineMarkerItem.ts

@@ -53,7 +53,7 @@ export class SLineMarkerItem extends SLineItem {
             this.lineStyle = data.Properties.LineStyle;
         }
         if (data.Properties && data.Properties.StrokeColor) {
-            this.strokeColor = data.Properties.StrokeColor;
+            this.strokeColor = new SColor(data.Properties.StrokeColor);
         }
     } // Constructor
 
@@ -66,7 +66,7 @@ export class SLineMarkerItem extends SLineItem {
             }
         });
         this.data.Properties.LineWidth = this.lineWidth;
-        this.data.Properties.StrokeColor = this.strokeColor;
+        this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineStyle = this.lineStyle;
         return this.data;
     }

+ 0 - 22
src/lib/items/SNoneLegendItem.js

@@ -1,22 +0,0 @@
-import { SGraphItem } from "@saga-web/graph/lib";
-/**
- * 图例节点Item(非图例类型)
- *
- * * @author  张宇(taohuzy@163.com)
- */
-export class SNoneLegendItem extends SGraphItem {
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent, data) {
-        super(parent);
-        this.data = data;
-        this.id = data.ID;
-    }
-    toData() {
-        return this.data;
-    }
-} // Class SNoneLegendItem

+ 2 - 3
src/lib/items/SSCPZZoneLegendItem.js

@@ -28,7 +28,6 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this.id = data.ID;
         this.name = data.Name;
         this.text = data.Name;
-        this.font = new SFont("sans-serif", 2);
         if (data) {
             this.setPointList = [];
             let setPointList;
@@ -57,7 +56,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
                 this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = data.Properties.color;
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
@@ -173,7 +172,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         });
         this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
         this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color;
+        this.data.Properties.color = this.color.value;
         return this.data;
     }
     onDraw(painter) {

+ 7 - 8
src/lib/items/SSCPZZoneLegendItem.ts

@@ -25,11 +25,11 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this.textItem.text = v;
         this.update();
     }
-    get color(): string {
+    get color(): SColor {
         return this.textItem.color;
     }
-    set color(v: string) {
-        this.textItem.color = v
+    set color(v: SColor) {
+        this.textItem.color = v;
     }
     get font(): SFont {
         return this.textItem.font
@@ -119,7 +119,6 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this.id = data.ID;
         this.name = data.Name;
         this.text = data.Name;
-        this.font = new SFont("sans-serif", 2);
         if (data) {
             this.setPointList = [];
             let setPointList: SPoint[];
@@ -147,7 +146,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
                 this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = data.Properties.color
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
@@ -181,9 +180,9 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
                 Y: pos.y
             }
         });
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
-        this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color;
+        this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
+        this.data.Properties.font =  this.font.size;
+        this.data.Properties.color =  this.color.value;
         return this.data;
     }
 

+ 2 - 3
src/lib/items/SZoneLegendItem.js

@@ -27,7 +27,6 @@ export class SZoneLegendItem extends SPolygonItem {
         this.id = data.ID;
         this.name = data.Name;
         this.text = data.Name;
-        this.font = new SFont("sans-serif", 2);
         if (data) {
             this.setPointList = [];
             let setPointList;
@@ -57,7 +56,7 @@ export class SZoneLegendItem extends SPolygonItem {
                 this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = data.Properties.color;
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
@@ -166,7 +165,7 @@ export class SZoneLegendItem extends SPolygonItem {
         });
         this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
         this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color;
+        this.data.Properties.color = this.color.value;
         return this.data;
     }
     onDraw(painter) {

+ 9 - 10
src/lib/items/SZoneLegendItem.ts

@@ -24,17 +24,17 @@ export class SZoneLegendItem extends SPolygonItem {
         this.textItem.text = v;
         this.update();
     }
-    get color(): string {
+    get color(): SColor {
         return this.textItem.color;
     }
-    set color(v: string) {
-        this.textItem.color = v
+    set color(v: SColor) {
+        this.textItem.color = v;
     }
     get font(): SFont {
-        return this.textItem.font
+        return this.textItem.font;
     }
     set font(v: SFont) {
-        this.textItem.font = v
+        this.textItem.font = v;
     }
 
     get status(): SItemStatus {
@@ -110,7 +110,6 @@ export class SZoneLegendItem extends SPolygonItem {
         this.id = data.ID;
         this.name = data.Name;
         this.text = data.Name;
-        this.font = new SFont("sans-serif", 2);
         if (data) {
             this.setPointList = [];
             let setPointList: SPoint[];
@@ -139,7 +138,7 @@ export class SZoneLegendItem extends SPolygonItem {
                 this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
             if (data.Properties.color) {
-                this.color = data.Properties.color
+                this.color = new SColor(data.Properties.color);
             }
             if (data.Properties.font) {
                 this.font = new SFont("sans-serif", data.Properties.font);
@@ -173,9 +172,9 @@ export class SZoneLegendItem extends SPolygonItem {
                 Y: pos.y
             }
         });
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
-        this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color;
+        this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
+        this.data.Properties.font =  this.font.size;
+        this.data.Properties.color =  this.color.value;
         return this.data;
     }
 

+ 2 - 2
src/lib/items/TipelineItem.js

@@ -49,7 +49,7 @@ export class TipelineItem extends SPolylineItem {
             this._anchor2ID = data.Anchor2ID;
         }
         if (data.Properties && data.Properties.Color) {
-            this.strokeColor = data.Properties.Color;
+            this.strokeColor = new SColor(data.Properties.Color);
         }
         // if(data.Properties && data.Properties.LineDash){
         //   this.LineDash = data.Properties.LineDash
@@ -140,7 +140,7 @@ export class TipelineItem extends SPolylineItem {
             this.data.PointList = pointList;
             this.data.Properties.LineWidth = this.lineWidth;
             // this.data.Properties.LineDash = this.LineDash;
-            this.data.Properties.Color = this.strokeColor;
+            this.data.Properties.Color = this.strokeColor.value;
         }
         return this.data;
     }

+ 2 - 2
src/lib/items/TipelineItem.ts

@@ -128,7 +128,7 @@ export class TipelineItem extends SPolylineItem {
       this._anchor2ID = data.Anchor2ID
     }
     if (data.Properties && data.Properties.Color) {
-      this.strokeColor = data.Properties.Color
+      this.strokeColor = new SColor(data.Properties.Color);
     }
     // if(data.Properties && data.Properties.LineDash){
     //   this.LineDash = data.Properties.LineDash
@@ -151,7 +151,7 @@ export class TipelineItem extends SPolylineItem {
       this.data.PointList = pointList;
       this.data.Properties.LineWidth = this.lineWidth;
       // this.data.Properties.LineDash = this.LineDash;
-      this.data.Properties.Color = this.strokeColor
+      this.data.Properties.Color = this.strokeColor.value;
     }
 
     return this.data

+ 8 - 3
src/store/index.js

@@ -17,7 +17,8 @@ export default new Vuex.Store({
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
         fmapID: '',
-        haveFengMap:false ,//是否有蜂鸟地图的数据
+        haveFengMap: false, //是否有蜂鸟地图的数据
+        isMessage: true,
     },
     getters: {
         floorsArr: (state) => state.floorsArr,
@@ -25,7 +26,8 @@ export default new Vuex.Store({
         plazaId: (state) => state.plazaId,
         plazas: (state) => state.plazas,
         fmapID: (state) => state.fmapID,
-        haveFengMap:(state) => state.haveFengMap
+        haveFengMap: (state) => state.haveFengMap,
+        isMessage: (state) => state.isMessage,
     },
     mutations: {
         // 设置是否登陆校验
@@ -40,6 +42,9 @@ export default new Vuex.Store({
             state.userInfo.orgCode = palyload.orgCode
             state.userInfo.username = palyload.username
         },
+        SETISMESSAGE(state, data) {
+            state.isMessage = data
+        },
         SETFLOORS(state, data) {
             state.floorsArr = data
             if (data.length > 0) {
@@ -56,7 +61,7 @@ export default new Vuex.Store({
             state.fmapID = data
         },
         SETHAVEFENGMAP(state) {
-            state.haveFengMap = true;
+            state.haveFengMap = true
         },
     },
     actions: {

+ 2 - 2
src/utils/plugins/components.js

@@ -111,7 +111,7 @@ var system = [
                         {
                             label: "分水器支路分布图",
                             id: "NTYL4",
-                            param: { tab_code: "1542", type_code: "FBT" },
+                            param: { tab_code: "1542", type_code: "FBT1" },
                         },
                     ],
                 },
@@ -221,7 +221,7 @@ var system = [
                         {
                             label: "消防泵房引出管路分布图",
                             id: "XFYL5",
-                            param: { type_code: "FBT" },
+                            param: { type_code: "FBT2" },
                         },
                     ],
                     id: "XFYL",

+ 3 - 3
src/views/equipment/eqDialog.vue

@@ -58,7 +58,7 @@
                                     :key='index1+index'
                                     :label='`${value.label}`'
                                     :name='`${value.param.type_code}`'
-                                    v-if='value.id.slice(2,4)=="YL" && eve.count>0 && value.param.type_code!="FBT"'
+                                    v-if='value.id.slice(2,4)=="YL" && eve.count>0 && value.param.type_code.slice(0,3)!="FBT"'
                                 >
                                     <!-- 有tab的原理图 -->
                                     <div style='width:100%;height:600px;overflow:hidden'>
@@ -70,9 +70,9 @@
                                     :key='index1+index'
                                     :label='`${value.label}`'
                                     :name='`${value.param.type_code}`'
-                                    v-if='value.id.slice(2,4)=="YL" && value.param.type_code=="FBT"'
+                                    v-if='value.id.slice(2,4)=="YL" && value.param.type_code.slice(0,3)=="FBT"'
                                 >
-                                    <fenbuPic ref='fenbutu'></fenbuPic>
+                                    <fenbuPic ref='fenbutu' :typecode='value.param.type_code'></fenbuPic>
                                 </el-tab-pane>
                             </template>
                         </template>

+ 28 - 48
src/views/equipment/fenbuPic.vue

@@ -2,19 +2,11 @@
     <div class='fenbu-box'>
         <!-- 图例 -->
         <div class='legend-boxs'>
-            <Legend :floors='floors' type='0'></Legend>
+            <Legend :floors='floors' type='0' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`'></Legend>
         </div>
         <floor-list v-if='floors.length>0' :floorsArr='floors' :type='1' @emitFloor='emitFloor' :id='"floor"'></floor-list>
-        <div class='additional-box' v-if='floors.length>0'>
-            <div class='additional' @click='additionalColl'>
-                <img src='../../assets/imgs/bg.png' alt />
-            </div>
-            <el-collapse-transition>
-                <div v-if='show' class='add-img'>我是放附加数据图片哒。。。</div>
-            </el-collapse-transition>
-        </div>
-        <div v-show='floors.length>0'>
-            <floorMap ref='floorMap' :loadName='loadName' :type='"floor"'></floorMap>
+        <div v-if='floors.length>0'>
+            <floorMap ref='floorMap' :loadName='""' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`' :type='"floor"'></floorMap>
         </div>
         <div class='nodata' v-show='floors.length==0'>
             <img class='img1' src='@/assets/imgs/wtp.png' alt />
@@ -41,11 +33,13 @@ export default {
             floors: []
         }
     },
+    props: ['typecode'],
     computed: {
         ...mapGetters(['floorsArr'])
     },
     methods: {
         emitFloor(item) {
+            console.log(item)
             this.floorInfo = item
             this.$refs.floorMap.init(this.floorInfo.gname)
         },
@@ -55,11 +49,21 @@ export default {
         getFloorData() {
             let postParams = {
                 Distinct: true,
+<<<<<<< HEAD
                 Filters: `projectId =${this.$store.state.plazaId}; categoryId='XFBFYCFL';isPub=true`,
+=======
+                Filters: `projectId =${this.$store.state.plazaId};categoryId='XTYLT';isPub=true`,
+>>>>>>> 4fc95b05ad81abc33c44ac2be3ffca29d9da58fe
                 PageNumber: 1,
                 PageSize: 500,
                 Projection: ['floorId']
             }
+            if (this.typecode == 'FBT1') {
+                postParams.Filters = `projectId =${this.$store.state.plazaId};categoryId='FZQZL';isPub=true`
+            }
+            if (this.typecode == 'FBT2') {
+                postParams.Filters = `projectId =${this.$store.state.plazaId};categoryId='XFBFYCFL';isPub=true`
+            }
             let floor = []
             queryPics({ postParams }).then(res => {
                 console.log(res)
@@ -70,21 +74,32 @@ export default {
                     this.floorsArr.forEach(el => {
                         floor.forEach(ele => {
                             if (ele.FloorId == el.gname) {
+                                console.log(el)
                                 this.floors.push({
                                     gname: el.gname,
-                                    code: el.code
+                                    gcode: el.gcode,
+                                    name: el.name,
+                                    code: el.code,
+                                    seq: el.seq
                                 })
                             }
                         })
                     })
                 }
                 console.log(this.floors)
+                this.floorInfo = this.floors[0]
+                console.log(this.floorInfo.gname)
+                this.$refs.floorMap.init(this.floorInfo.gname)
+                this.init()
             })
+        },
+        init() {
+            this.loadName = `${this.floorInfo.code}`
         }
     },
     mounted() {
+        console.log(this.floorsArr)
         this.getFloorData()
-        // this.$refs.floorMap.init(this.floorInfo.gname)
     }
 }
 </script>
@@ -100,41 +115,6 @@ export default {
         right: 32px;
         top: 155px;
     }
-    .additional-box {
-        position: relative;
-        .additional {
-            width: 44px;
-            height: 44px;
-            background: rgba(255, 255, 255, 1);
-            box-shadow: 0px 2px 15px 0px rgba(31, 36, 41, 0.08);
-            border-radius: 2px;
-            position: fixed;
-            right: 32px;
-            top: 420px;
-            z-index: 2;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-            cursor: pointer;
-            img {
-                width: 20px;
-                height: 20px;
-            }
-        }
-        .add-img {
-            width: 560px;
-            height: 325px;
-            background: #ffffff;
-            -webkit-box-shadow: 0px 2px 8px 0px rgba(31, 36, 41, 0.06);
-            box-shadow: 0px 2px 8px 0px rgba(31, 36, 41, 0.06);
-            border-radius: 2px;
-            border: 1px solid #e4e5e7;
-            position: absolute;
-            right: 77px;
-            top: 93px;
-            z-index: 2;
-        }
-    }
     .nodata {
         height: calc(100%-50px);
         .img1 {

+ 2 - 2
src/views/equipment/index.vue

@@ -25,9 +25,9 @@
                     </div>
                     <div class='eq-content'>
                         <div class='legend-boxs'>
-                            <Legend :systemName='systemName' :floors='floorsArr' type='1'></Legend>
+                            <Legend :systemName='systemName' :categoryId='categoryId' :floors='floorsArr' type='1'></Legend>
                         </div>
-                        <floorMap ref='floorMap' :id='"equip"' :loadName='loadName' :type='"system"'></floorMap>
+                        <floorMap ref='floorMap' :id='"equip"' :loadName='loadName' :categoryId='categoryId' :type='"system"'></floorMap>
                         <div class='additional-box' v-if='fqPic.length>0'>
                             <div class='additional' @click='additionalColl'>
                                 <img src='../../assets/imgs/bg.png' alt />

+ 98 - 12
src/views/legendLibrary/addForm.vue

@@ -114,6 +114,7 @@
                     @change='treeConfirm'
                     @focusChange='focusChange'
                     :hideClear='true'
+                    :selectedIds='selectedIds'
                 />
             </div>
         </div>
@@ -146,9 +147,8 @@ export default {
                     label: '线条'
                 }
             ],
-            options1: [],
-            options2: [],
 
+            selectedIds: [],
             borderLineOption: [
                 {
                     id: 'solid',
@@ -231,6 +231,11 @@ export default {
         },
         create() {
             //新增
+            if (this.ruleForm.FillColor.indexOf('#') > -1) {
+                this.ruleForm.FillColor = this.ruleForm.FillColor
+            } else {
+                this.ruleForm.FillColor = this.hexify(this.ruleForm.FillColor)
+            }
             let postParams = {
                 Content: [this.ruleForm]
             }
@@ -246,6 +251,11 @@ export default {
         },
         update() {
             //修改
+            if (this.ruleForm.FillColor.indexOf('#') > -1) {
+                this.ruleForm.FillColor = this.ruleForm.FillColor
+            } else {
+                this.ruleForm.FillColor = this.hexify(this.ruleForm.FillColor)
+            }
             let postParams = {
                 Content: [this.ruleForm]
             }
@@ -284,16 +294,92 @@ export default {
         },
         //rgba转成16进制
         hexify(color) {
-            var values = color
-                .replace(/rgba?\(/, '')
-                .replace(/\)/, '')
-                .replace(/[\s+]/g, '')
-                .split(',')
-            var a = parseFloat(values[3] || 1),
-                r = Math.floor(a * parseInt(values[0]) + (1 - a) * 255),
-                g = Math.floor(a * parseInt(values[1]) + (1 - a) * 255),
-                b = Math.floor(a * parseInt(values[2]) + (1 - a) * 255)
-            return '#' + ('0' + r.toString(16)).slice(-2) + ('0' + g.toString(16)).slice(-2) + ('0' + b.toString(16)).slice(-2)
+            console.log(color, 'color')
+            // var values = color
+            //     .replace(/rgba?\(/, '')
+            //     .replace(/\)/, '')
+            //     .replace(/[\s+]/g, '')
+            //     .split(',')
+            // var a = parseFloat(values[3] || 1),
+            //     r = Math.floor(a * parseInt(values[0]) + (1 - a) * 255),
+            //     g = Math.floor(a * parseInt(values[1]) + (1 - a) * 255),
+            //     b = Math.floor(a * parseInt(values[2]) + (1 - a) * 255),
+            //     opacity = ''
+            var opacity = ''
+            var rgb = color.split(',')
+            var r = parseInt(rgb[0].split('(')[1])
+            var g = parseInt(rgb[1])
+            var b = parseInt(rgb[2].split(')')[0])
+            switch (parseFloat(rgb[3] || 1) + '') {
+                case '0':
+                    opacity = '00'
+                    break
+                case '0.05':
+                    opacity = '0C'
+                    break
+                case '0.1':
+                    opacity = '19'
+                    break
+                case '0.15':
+                    opacity = '26'
+                    break
+                case '0.2':
+                    opacity = '33'
+                    break
+                case '0.25':
+                    opacity = '3F'
+                    break
+                case '0.3':
+                    opacity = '4C'
+                    break
+                case '0.35':
+                    opacity = '59'
+                    break
+                case '0.4':
+                    opacity = '66'
+                    break
+                case '0.45':
+                    opacity = '72'
+                    break
+                case '0.5':
+                    opacity = '7F'
+                    break
+                case '0.55':
+                    opacity = '8C'
+                    break
+                case '0.6':
+                    opacity = '99'
+                    break
+                case '0.65':
+                    opacity = 'A5'
+                    break
+                case '0.7':
+                    opacity = 'B2'
+                    break
+                case '0.75':
+                    opacity = 'BF'
+                    break
+                case '0.8':
+                    opacity = 'CC'
+                    break
+                case '0.85':
+                    opacity = 'D8'
+                    break
+                case '0.9':
+                    opacity = 'E5'
+                    break
+                case '0.95':
+                    opacity = 'F2'
+                    break
+                case '1':
+                    opacity = 'FF'
+                    break
+            }
+            var hex = '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1) + opacity
+            console.log(hex, 'hrc')
+            return hex
+
+            // return '#' + ('0' + r.toString(16)).slice(-2) + ('0' + g.toString(16)).slice(-2) + ('0' + b.toString(16)).slice(-2) + opacity
         },
         // 背景颜色改变
         changBgColor(val) {

+ 2 - 17
src/views/legendLibrary/addLegend.vue

@@ -19,6 +19,7 @@
             :data='treeData'
             @cancel='treeCancel'
             @confirm='treeConfirm'
+            :key='new Date().getTime()'
         />
     </div>
 </template>
@@ -133,23 +134,7 @@ export default {
             if (this.info.Name == '') {
                 this.$message.info('请填写图例名称')
                 return false
-            }
-            //  else if (this.info.Type == 'Zone') {
-            //     if (this.info.FillColor == '') {
-            //         this.$message.info('请选择填充色以及透明度')
-            //         return false
-            //     }
-            //     if (this.info.Color == '') {
-            //         this.$message.info('请选择边框颜色')
-            //         return false
-            //     }
-            // } else if (this.info.Type == 'Line') {
-            //     if (this.info.Color == '') {
-            //         this.$message.info('请选择边框颜色')
-            //         return false
-            //     }
-            // }
-            else {
+            } else {
                 if (this.info.Type != 'Image' && this.info.Type != 'None') {
                     this.$refs.add.saveImg()
                 } else {

+ 89 - 1
src/views/legendLibrary/index.vue

@@ -169,6 +169,86 @@ import {
     getVisualization,
     queryRelation
 } from '@/api/legendLibrary.js'
+
+function hexToRgba(hex) {
+    let opacity = ''
+    switch (hex.slice(7, 9)) {
+        case '00':
+            opacity = '0'
+            break
+        case '0C':
+            opacity = '0.05'
+            break
+        case '19':
+            opacity = '0.1'
+            break
+        case '26':
+            opacity = '0.15'
+            break
+        case '33':
+            opacity = '0.2'
+            break
+        case '3F':
+            opacity = '0.25'
+            break
+        case '4C':
+            opacity = '0.3'
+            break
+        case '59':
+            opacity = '0.35'
+            break
+        case '66':
+            opacity = '0.4'
+            break
+        case '72':
+            opacity = '0.45'
+            break
+        case '7F':
+            opacity = '0.5'
+            break
+        case '8C':
+            opacity = '0.55'
+            break
+        case '99':
+            opacity = '0.6'
+            break
+        case 'A5':
+            opacity = '0.65'
+            break
+        case 'B2':
+            opacity = '0.7'
+            break
+        case 'BF':
+            opacity = '0.75'
+            break
+        case 'CC':
+            opacity = '0.8'
+            break
+        case 'D8':
+            opacity = '0.85'
+            break
+        case 'E5':
+            opacity = '0.9'
+            break
+        case 'F2':
+            opacity = '0.95'
+            break
+        case 'FF':
+            opacity = '1'
+            break
+    }
+    return (
+        'rgba(' +
+        parseInt('0x' + hex.slice(1, 3)) +
+        ',' +
+        parseInt('0x' + hex.slice(3, 5)) +
+        ',' +
+        parseInt('0x' + hex.slice(5, 7)) +
+        ',' +
+        opacity +
+        ')'
+    )
+}
 export default {
     components: { addLegend, Select },
     data() {
@@ -362,8 +442,16 @@ export default {
             }
             graphElementSearch({ postParams }).then(res => {
                 this.key++
-                this.tableData = res.Content
+                // this.tableData = res.Content
                 this.total = res.Total
+                console.log(res.Content)
+                this.tableData = res.Content.map(i => {
+                    if (i.FillColor.length == '9') {
+                        i.FillColor = hexToRgba(i.FillColor)
+                    }
+                    return i
+                })
+                console.log(this.tableData)
             })
         },