YaolongHan il y a 4 ans
Parent
commit
c31345cca5

+ 1 - 0
public/systemConf.js

@@ -26,6 +26,7 @@ var __systemConf = {
         // 阿里云
         editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
         wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
+        // wandaBmGuideUrl: 'http://192.168.200.100:8090/wandaBmGuide/', //管理书地址
     },
 }
 window.__systemConf = __systemConf

+ 2 - 5
src/components/Legend/src/legend.vue

@@ -304,6 +304,7 @@ export default {
         },
         addFloor() {
             this.isFloor = true
+            this.formatFloor()
         },
         // 新增楼层取消
         cancel() {
@@ -315,11 +316,7 @@ export default {
             this.goToEditer()
         }
     },
-    mounted() {
-        if (this.floors.length > 0) {
-            this.formatFloor()
-        }
-    }
+    mounted() {}
 }
 </script>
 <style lang="less" scoped>

+ 24 - 8
src/components/floorMap/index.vue

@@ -31,7 +31,7 @@ export default {
             appName: '万达可视化系统',
             key: '23f30a832a862c58637a4aadbf50a566',
             mapServerURL: `/wdfn`,
-            canvasWidth: 1100,
+            canvasWidth: 600,
             canvasHeight: 800,
             loading: false, // 限制重复查询
             view: null,
@@ -50,7 +50,11 @@ export default {
             default: '',
             type: String
         },
-
+        // 弹窗高度,适配底图高度使用
+        modalHeight: {
+            type: [Number, undefined],
+            default: undefined
+        },
         loadName: null,
         type: null
     },
@@ -63,6 +67,7 @@ export default {
         init(floorid) {
             this.loading = true
             this.floorid = floorid
+            this.mapSize()
             setTimeout(() => {
                 if (this.haveFengMap) {
                     this.clearGraphy()
@@ -121,19 +126,26 @@ export default {
             this.readGroup(this.floorid).then(data => {
                 this.loading = false
                 if (data.Result == 'failure') {
-                    this.$message({
+                    // 取消 失败时的提示: 图不存在
+                    /* this.$message({
                         message: data.Message,
                         type: 'warning'
-                    })
+                    }) */
                     this.$store.commit('SETISMESSAGE', false)
+                    return
                     //    一会回来存这个
                 } else {
                     this.$store.commit('SETISMESSAGE', true)
                 }
-                if (data.Data.length > 0) {
+                // FIXME:   Cannot read property '0' of undefined
+                // 无返回Data处理
+                if (!(data.Data && data.Data.length)) {
+                    return false
                     //console.log(data.data.Data[0].ID)
-                    this.$cookie.set('graphId', data.Data[0].ID, 3)
+                    // this.$cookie.set('graphId', data.Data[0].ID, 3)
                 }
+                // 放到后边 $cookie graphId
+                this.$cookie.set('graphId', data.Data[0].ID, 3)
                 this.topologyParser = new STopologyParser(null)
                 this.topologyParser.parseData(data.Data[0].Elements)
                 // 多边形
@@ -219,13 +231,16 @@ export default {
         },
         // 地图尺寸
         mapSize() {
+            this.canvasWidth = this.$refs.graphy.offsetWidth
             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
             }
+            // 弹窗中底图高度适配
+            if (this.modalHeight) {
+                this.canvasHeight = this.modalHeight
+            }
         },
         getEvent() {
             bus.$on('changeShow', res => {
@@ -289,6 +304,7 @@ export default {
 <style lang="less" scoped>
 #floor_base {
     position: relative;
+    height: 100%;
     .fengMap {
         position: fixed;
         width: 100px;

+ 0 - 650
src/components/mapClass/SPolygonItem.js

@@ -1,650 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *                      :*$@@%$*:                         ;:                ;;    ;;
- *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
- *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
- *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
- *                   =@*                                  %!              @ $= % %@=   =%@!      %=
- *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
- *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
- *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
- *          $@*   ;@@@%=!:                *@*
- *          =@$    ;;;!=%@@@@=!           =@!
- *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
- *            ;%@@$=$@@%*       *@@@$=%@@%;
- *               ::;::             ::;::                                              All rights reserved.
- *
- * ********************************************************************************************************************
- */
-import { SGraphItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate } from "@saga-web/graph/lib";
-import { SUndoStack } from "@saga-web/base/";
-;
-import { SColor, SLineCapStyle, SPoint, SRect, SLine, SPolygonUtil } from "@saga-web/draw";
-import { SMathUtil } from "@saga-web/big/lib/utils/SMathUtil";
-import { SItemStatus } from "@saga-web/big";
-/**
- * 编辑多边形
- *
- * @author  韩耀龙
- */
-export class SPolygonItem extends SGraphItem {
-    /**
-    * 构造函数
-    *
-    * @param parent    指向父对象
-    * @param data      PolygonData数据
-    */
-    constructor(parent) {
-        super(parent);
-        /** X坐标最小值  */
-        this.minX = Number.MAX_SAFE_INTEGER;
-        /** X坐标最大值  */
-        this.maxX = Number.MIN_SAFE_INTEGER;
-        /** Y坐标最小值  */
-        this.minY = Number.MAX_SAFE_INTEGER;
-        /** Y坐标最大值  */
-        this.maxY = Number.MIN_SAFE_INTEGER;
-        /** 轮廓线坐标  */
-        this.pointList = [];
-        /** 是否闭合    */
-        this.closeFlag = false;
-        // 当前状态
-        this._status = SItemStatus.Normal;
-        this.data = null;
-        /** 边框颜色 */
-        this._strokeColor = new SColor("#0091FF");
-        /** 填充颜色 */
-        this._fillColor = new SColor("#1EE887");
-        /** 边框的宽 只可输入像素宽*/
-        this._lineWidth = 4;
-        /** 鼠标移动点  */
-        this.lastPoint = null;
-        /** 当前鼠标获取顶点对应索引 */
-        this.curIndex = -1;
-        /** 当前鼠标获取顶点对应坐标 */
-        this.curPoint = null;
-        /** 灵敏像素 */
-        this.len = 10;
-        /** 场景像素 内部将灵敏像素换算为场景实际距离  */
-        this.scenceLen = 15;
-        /** 场景像素  */
-        this.isAlt = false;
-        /** undoredo堆栈 */
-        this.undoStack = new SUndoStack();
-    }
-    // 获取当前状态
-    get getPointList() {
-        return this.pointList;
-    }
-    // 编辑当前状态
-    set setPointList(arr) {
-        this.pointList = arr;
-        this.update();
-    }
-    ;
-    // 获取当前状态
-    get status() {
-        return this._status;
-    }
-    // 编辑当前状态
-    set status(value) {
-        this._status = value;
-        // 如果状态为show则需清栈
-        if (value == SItemStatus.Normal) {
-            if (this.undoStack) {
-                this.undoStack.clear();
-            }
-        }
-        this.update();
-    }
-    ;
-    /**  画笔颜色 */
-    get strokeColor() {
-        return this._strokeColor;
-    }
-    ;
-    set strokeColor(v) {
-        this._strokeColor = v;
-        this.update();
-    }
-    get fillColor() {
-        return this._fillColor;
-    }
-    ;
-    set fillColor(v) {
-        this._fillColor = v;
-        this.update();
-    }
-    get lineWidth() {
-        return this._lineWidth;
-    }
-    set lineWidth(v) {
-        this._lineWidth = v;
-        this.update();
-    }
-    ;
-    //////////////////
-    //  以下为对pointList 数组的操作方法
-    /**
-     * 储存新的多边形顶点
-     *
-     * @param x   点位得x坐标
-     * @param y   点位得y坐标
-     * @param i   储存所在索引
-     * @return SPoint。添加的顶点
-     */
-    insertPoint(x, y, i = null) {
-        const point = new SPoint(x, y);
-        if (i == null) {
-            this.pointList.push(point);
-        }
-        else {
-            this.pointList.splice(i, 0, point);
-        }
-        this.update();
-        return point;
-    }
-    /**
-     * 删除点位
-     *
-     * @param i   删除点所在的索引
-     * @return    SPoint|null。索引不在数组范围则返回null
-     */
-    deletePoint(i = null) {
-        let point = null;
-        if (i != null) {
-            if (i >= (this.pointList.length) || i < 0) {
-                point = null;
-            }
-            else {
-                point = new SPoint(this.pointList[i].x, this.pointList[i].y);
-                this.pointList.splice(i, 1);
-            }
-        }
-        else {
-            if (this.pointList.length) {
-                point = this.pointList[this.pointList.length - 1];
-                this.pointList.pop();
-            }
-            else {
-                point = null;
-            }
-        }
-        this.update();
-        return point;
-    }
-    /**
-     * 多边形顶点的移动位置
-     *
-     * @param x   点位得x坐标
-     * @param y   点位得y坐标
-     * @param i   点位得i坐标
-     * @return    移动对应得点。如果索引无法找到移动顶点,则返回null
-     */
-    movePoint(x, y, i) {
-        let point = null;
-        if (i >= (this.pointList.length) || i < 0) {
-            return null;
-        }
-        if (this.pointList.length) {
-            this.pointList[i].x = x;
-            this.pointList[i].y = y;
-        }
-        point = this.pointList[i];
-        return point;
-    }
-    /**
-     * 打印出多边形数组
-     *
-     * @return  顶点数组
-     */
-    PrintPointList() {
-        return this.pointList;
-    }
-    ////////////
-    //  以下为三种状态下的绘制多边形方法
-    /**
-     * 展示状态 --绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    drawShowPolygon(painter, pointList) {
-        painter.save();
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this._strokeColor;
-        painter.pen.lineWidth = painter.toPx(this._lineWidth);
-        painter.brush.color = this._fillColor;
-        if (this.selected) {
-            painter.shadow.shadowBlur = 10;
-            painter.shadow.shadowColor = new SColor(`#00000060`);
-            painter.shadow.shadowOffsetX = 5;
-            painter.shadow.shadowOffsetY = 5;
-        }
-        else {
-            painter.shadow.shadowColor = SColor.Transparent;
-        }
-        painter.drawPolygon([...pointList]);
-        painter.restore();
-    }
-    /**
-     * 创建状态 --绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    drawCreatePolygon(painter, pointList) {
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this._strokeColor;
-        painter.pen.lineWidth = painter.toPx(this._lineWidth);
-        if (this.lastPoint && pointList.length) {
-            painter.drawLine(pointList[pointList.length - 1].x, pointList[pointList.length - 1].y, this.lastPoint.x, this.lastPoint.y);
-        }
-        painter.drawPolyline(pointList);
-        painter.pen.color = SColor.Transparent;
-        painter.brush.color = new SColor(this._fillColor.value + "80");
-        painter.pen.lineWidth = painter.toPx(this._lineWidth);
-        if (this.lastPoint) {
-            painter.drawPolygon([...pointList, this.lastPoint]);
-            // 绘制顶点块
-            painter.pen.color = SColor.Black;
-            painter.brush.color = SColor.White;
-            pointList.forEach((item, index) => {
-                painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
-            });
-        }
-        else {
-            painter.drawPolygon(pointList);
-        }
-    }
-    /**
-     *
-     * 编辑状态 --绘制多边形数组
-     *
-     * @param painter    绘制类
-     * @param pointList    绘制多边形数组
-     */
-    drawEditPolygon(painter, pointList) {
-        // 展示多边形
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this._strokeColor;
-        painter.pen.lineWidth = painter.toPx(this._lineWidth);
-        painter.brush.color = new SColor(this._fillColor.value + "80");
-        painter.drawPolygon([...pointList]);
-        // 绘制顶点块
-        painter.pen.color = SColor.Black;
-        painter.brush.color = SColor.White;
-        pointList.forEach((item, index) => {
-            painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
-        });
-    }
-    /**
-     * 编辑状态操作多边形数组
-     *
-     * @param event    鼠标事件
-     *
-     *
-     */
-    editPolygonPoint(event) {
-        //  判断是否为删除状态 isAlt = true为删除状态
-        if (this.isAlt) {
-            // 1 判断是否点击在多边形顶点
-            let lenIndex = -1; // 当前点击到的点位索引;
-            let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
-                let dis = SMathUtil.pointDistance(event.x, event.y, item.x, item.y);
-                if (dis < curenLen) {
-                    curenLen = dis;
-                    lenIndex = index;
-                }
-            });
-            // 若点击到,对该索引对应的点做删除
-            if (lenIndex != -1) {
-                if (this.pointList.length <= 3) {
-                    return;
-                }
-                const delePoint = new SPoint(this.pointList[lenIndex].x, this.pointList[lenIndex].y);
-                this.deletePoint(lenIndex);
-                // 记录顶点操作记录压入堆栈
-                this.recordAction(SGraphPointListDelete, [this.pointList, delePoint, lenIndex]);
-            }
-        }
-        else {
-            // 1 判断是否点击在多边形顶点
-            this.curIndex = -1;
-            this.curPoint = null;
-            let lenIndex = -1; // 当前点击到的点位索引;
-            let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
-                let dis = SMathUtil.pointDistance(event.x, event.y, item.x, item.y);
-                if (dis < curenLen) {
-                    curenLen = dis;
-                    lenIndex = index;
-                }
-            });
-            this.curIndex = lenIndex;
-            // 2判断是否点击在多边形得边上
-            if (-1 == lenIndex) {
-                let len = SMathUtil.pointToLine(new SPoint(event.x, event.y), new SLine(this.pointList[0], this.pointList[1])), index = 0;
-                if (this.pointList.length > 2) {
-                    for (let i = 1; i < this.pointList.length; i++) {
-                        let dis = SMathUtil.pointToLine(new SPoint(event.x, event.y), new SLine(this.pointList[i], this.pointList[i + 1]));
-                        if ((i + 1) == this.pointList.length) {
-                            dis = SMathUtil.pointToLine(new SPoint(event.x, event.y), new SLine(this.pointList[i], this.pointList[0]));
-                        }
-                        if (dis.MinDis < len.MinDis) {
-                            len = dis;
-                            index = i;
-                        }
-                    }
-                }
-                // 判断是否有点
-                if (len.Point) {
-                    console.log(index, len.Point);
-                    // 点在了多边形的边上
-                    if (len.MinDis <= this.scenceLen) {
-                        this.pointList.splice(index + 1, 0, len.Point);
-                        // 记录新增顶点操作记录压入堆栈
-                        this.recordAction(SGraphPointListInsert, [this.pointList, len.Point, index + 1]);
-                    }
-                    else { //没点在多边形边上也没点在多边形顶点上
-                        super.onMouseDown(event);
-                    }
-                }
-            }
-            else {
-                // 当捕捉到顶点后 ,记录当前点的xy坐标,用于undo、redo操作
-                this.curPoint = new SPoint(this.pointList[this.curIndex].x, this.pointList[this.curIndex].y);
-            }
-            // 刷新视图
-            this.update();
-        }
-    }
-    /////////////////////
-    // undo、redo相关操作
-    /**
-     * 记录相关动作并推入栈中
-     * @param	SGraphCommand         相关命令类
-     * @param	any                    对应传入参数
-     */
-    recordAction(SGraphCommand, any) {
-        // 记录相关命令并推入堆栈中
-        const sgraphcommand = new SGraphCommand(this, ...any);
-        if (this.undoStack) {
-            this.undoStack.push(sgraphcommand);
-        }
-    }
-    /**
-     * 执行取消操作执行
-     */
-    undo() {
-        if (this.status == SItemStatus.Normal) {
-            return;
-        }
-        if (this.undoStack) {
-            this.undoStack.undo();
-        }
-    }
-    /**
-     * 执行重做操作执行
-     */
-    redo() {
-        if (this.status == SItemStatus.Normal) {
-            return;
-        }
-        if (this.undoStack) {
-            this.undoStack.redo();
-        }
-    }
-    ///////////////////////////////
-    // 以下为鼠标事件
-    /**
-     * 鼠标双击事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onDoubleClick(event) {
-        console.log(event);
-        // 如果位show状态 双击改对象则需改为编辑状态
-        if (SItemStatus.Normal == this.status) {
-            this.status = SItemStatus.Edit;
-            this.grabItem(this);
-        }
-        else if (SItemStatus.Edit == this.status) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-            if (this.undoStack) {
-                this.undoStack.clear();
-            }
-        }
-        this.update();
-        return true;
-    } // Function onDoubleClick()
-    /**
-     * 键盘事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onKeyDown(event) {
-        if (this.status == SItemStatus.Normal) {
-            return false;
-        }
-        else if (this.status == SItemStatus.Create) {
-            if (event.code == 'Enter') {
-                // 当顶点大于二个时才又条件执行闭合操作并清空堆栈
-                if (this.pointList.length > 2) {
-                    this.status = SItemStatus.Normal;
-                    //3 传递完成事件状态
-                    this.$emit('finishCreated');
-                    //1 grabItem 置为null
-                    this.releaseItem();
-                    //2 清空undo
-                    if (this.undoStack) {
-                        this.undoStack.clear();
-                    }
-                }
-            }
-        }
-        else if (this.status == SItemStatus.Edit) {
-            if (event.key == 'Alt') {
-                this.isAlt = true;
-            }
-        }
-        this.update();
-        return true;
-    } // Function onKeyDown()
-    /**
-     * 键盘键抬起事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onKeyUp(event) {
-        if (this.status == SItemStatus.Edit) {
-            if (event.key == 'Alt') {
-                this.isAlt = false;
-            }
-        }
-        this.update();
-    } // Function onKeyUp()
-    /**
-     * 鼠标按下事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onMouseDown(event) {
-        // 如果状态为编辑状态则添加点
-        if (this.status == SItemStatus.Create) {
-            // 新增顶点
-            this.insertPoint(event.x, event.y);
-            // 记录新增顶点操作记录压入堆栈
-            let pos = new SPoint(event.x, event.y);
-            this.recordAction(SGraphPointListInsert, [this.pointList, pos]);
-        }
-        else if (this.status == SItemStatus.Edit) {
-            // 对多边形数组做编辑操作
-            this.editPolygonPoint(event);
-        }
-        else {
-            return super.onMouseDown(event);
-        }
-        return true;
-    } // Function onMouseDown()
-    /**
-     * 鼠标移入事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onMouseEnter(event) {
-        return true;
-    } // Function onMouseEnter()
-    /**
-     * 鼠标移出事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onMouseLeave(event) {
-        return true;
-    } // Function onMouseLeave()
-    /**
-     * 鼠标移动事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onMouseMove(event) {
-        if (this.status == SItemStatus.Create) {
-            this.lastPoint = new SPoint;
-            this.lastPoint.x = event.x;
-            this.lastPoint.y = event.y;
-            this.update();
-        }
-        else if (this.status == SItemStatus.Edit) {
-            if (-1 != this.curIndex) {
-                this.pointList[this.curIndex].x = event.x;
-                this.pointList[this.curIndex].y = event.y;
-            }
-            this.update();
-        }
-        else {
-            // return super.onMouseMove(event)
-        }
-        return true;
-    } // Function onMouseMove()
-    /**
-     * 鼠标抬起事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onMouseUp(event) {
-        if (this.status == SItemStatus.Edit) {
-            if (-1 != this.curIndex) {
-                const pos = new SPoint(this.pointList[this.curIndex].x, this.pointList[this.curIndex].y);
-                this.recordAction(SGraphPointListUpdate, [this.pointList, this.curPoint, pos, this.curIndex]);
-            }
-            this.curIndex = -1;
-            this.curPoint = null;
-        }
-        else {
-            // return super.onMouseUp(event)
-        }
-        return true;
-    } // Function onMouseUp()
-    /**
-     * 适配事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onResize(event) {
-        return true;
-    } // Function onResize()
-    /**
-     * 取消操作
-     *
-     * @param   painter       painter对象
-     */
-    cancelOperate() {
-        // 当状态为展示状态
-        if (this.status == SItemStatus.Create) {
-            // 闭合多边形
-            this.parent = null;
-        }
-        else if (this.status == SItemStatus.Edit) {
-            // 编辑状态
-            this.status = SItemStatus.Normal;
-        }
-        this.update();
-    } // Function cancelOperate()
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect() {
-        if (this.pointList.length) {
-            this.minX = this.pointList[0].x;
-            this.maxX = this.pointList[0].x;
-            this.minY = this.pointList[0].y;
-            this.maxY = this.pointList[0].y;
-            this.pointList.forEach(it => {
-                let x = it.x, y = it.y;
-                if (x < this.minX) {
-                    this.minX = x;
-                }
-                if (y < this.minY) {
-                    this.minY = y;
-                }
-                if (x > this.maxX) {
-                    this.maxX = x;
-                }
-                if (y > this.maxY) {
-                    this.maxY = y;
-                }
-            });
-        }
-        ;
-        return new SRect(this.minX, this.minY, this.maxX - this.minX, this.maxY - this.minY);
-    } // Function boundingRect()
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    contains(x, y) {
-        let arr = this.pointList;
-        if (arr.length < 3 || !SPolygonUtil.pointIn(x, y, arr)) {
-            return false;
-        }
-        return true;
-    } // Function contains()
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     */
-    onDraw(painter) {
-        this.scenceLen = painter.toPx(this.len);
-        // 当状态为展示状态
-        if (this.status == SItemStatus.Normal) {
-            // 闭合多边形
-            this.drawShowPolygon(painter, this.pointList);
-        }
-        else if (this.status == SItemStatus.Create) {
-            // 创建状态
-            this.drawCreatePolygon(painter, this.pointList);
-        }
-        else {
-            // 编辑状态
-            this.drawEditPolygon(painter, this.pointList);
-        }
-    } // Function onDraw()
-}

+ 0 - 704
src/components/mapClass/SPolygonItem.ts

@@ -1,704 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *                      :*$@@%$*:                         ;:                ;;    ;;
- *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
- *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
- *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
- *                   =@*                                  %!              @ $= % %@=   =%@!      %=
- *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
- *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
- *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
- *          $@*   ;@@@%=!:                *@*
- *          =@$    ;;;!=%@@@@=!           =@!
- *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
- *            ;%@@$=$@@%*       *@@@$=%@@%;
- *               ::;::             ::;::                                              All rights reserved.
- *
- * ********************************************************************************************************************
- */
-import { SGraphItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate } from "@saga-web/graph/lib";
-import { SMouseEvent, SUndoStack } from "@saga-web/base/";;
-import {
-    SColor,
-    SLineCapStyle,
-    SPainter,
-    SPoint,
-    SRect,
-    SLine,
-    SPolygonUtil
-} from "@saga-web/draw";
-import { SMathUtil } from "@saga-web/big/lib/utils/SMathUtil";
-import { SItemStatus } from "@saga-web/big";
-
-/**
- * 编辑多边形
- *
- * @author  韩耀龙
- */
-export class SPolygonItem extends SGraphItem {
-    /** X坐标最小值  */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** 轮廓线坐标  */
-    private pointList: SPoint[] = [];
-    // 获取当前状态
-    get getPointList(): SPoint[] {
-        return this.pointList;
-    }
-    // 编辑当前状态
-    set setPointList(arr: SPoint[]) {
-        this.pointList = arr;
-        this.update();
-    };
-    /** 是否闭合    */
-    closeFlag: boolean = false;
-    // 当前状态
-    protected _status: number = SItemStatus.Normal;
-    // 获取当前状态
-    get status(): SItemStatus {
-        return this._status;
-    }
-    // 编辑当前状态
-    set status(value: SItemStatus) {
-        this._status = value;
-        // 如果状态为show则需清栈
-        if (value == SItemStatus.Normal) {
-            if (this.undoStack) {
-                this.undoStack.clear();
-            }
-        }
-        this.update();
-    };
-    data: any | null = null;
-    /** 边框颜色 */
-    _strokeColor: SColor = new SColor("#0091FF");
-    /**  画笔颜色 */
-    get strokeColor(): SColor {
-        return this._strokeColor
-    };
-    set strokeColor(v: SColor) {
-        this._strokeColor = v;
-        this.update()
-    }
-    /** 填充颜色 */
-    _fillColor: SColor = new SColor("#1EE887");
-    get fillColor(): SColor {
-        return this._fillColor
-    };
-    set fillColor(v: SColor) {
-        this._fillColor = v;
-        this.update()
-    }
-
-    /** 边框的宽 只可输入像素宽*/
-    _lineWidth: number = 4;
-    get lineWidth(): number {
-        return this._lineWidth
-    }
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    };
-    /** 鼠标移动点  */
-    private lastPoint: SPoint | null = null;
-    /** 当前鼠标获取顶点对应索引 */
-    private curIndex: number = -1;
-    /** 当前鼠标获取顶点对应坐标 */
-    private curPoint: null | SPoint = null
-    /** 灵敏像素 */
-    private len: number = 10;
-    /** 场景像素 内部将灵敏像素换算为场景实际距离  */
-    private scenceLen: number = 15;
-    /** 场景像素  */
-    private isAlt: boolean = false;
-    /** undoredo堆栈 */
-    protected undoStack: SUndoStack | null = new SUndoStack();
-
-    /**
-    * 构造函数
-    *
-    * @param parent    指向父对象
-    * @param data      PolygonData数据
-    */
-    constructor(parent: SGraphItem | null) {
-        super(parent);
-    }
-
-    //////////////////
-    //  以下为对pointList 数组的操作方法
-
-    /**
-     * 储存新的多边形顶点
-     *
-     * @param x   点位得x坐标
-     * @param y   点位得y坐标
-     * @param i   储存所在索引
-     * @return SPoint。添加的顶点
-     */
-    insertPoint(x: number, y: number, i: number | null = null): SPoint {
-        const point = new SPoint(x, y);
-        if (i == null) {
-            this.pointList.push(point)
-        } else {
-            this.pointList.splice(i, 0, point);
-        }
-        this.update()
-        return point
-    }
-
-    /**
-     * 删除点位
-     *
-     * @param i   删除点所在的索引
-     * @return    SPoint|null。索引不在数组范围则返回null
-     */
-    deletePoint(i: number | null = null): SPoint | null {
-        let point = null;
-        if (i != null) {
-            if (i >= (this.pointList.length) || i < 0) {
-                point = null
-            } else {
-                point = new SPoint(this.pointList[i].x, this.pointList[i].y);
-                this.pointList.splice(i, 1);
-            }
-        } else {
-            if (this.pointList.length) {
-                point = this.pointList[this.pointList.length - 1];
-                this.pointList.pop();
-            } else {
-                point = null
-            }
-        }
-        this.update()
-        return point
-    }
-
-    /**
-     * 多边形顶点的移动位置
-     *
-     * @param x   点位得x坐标
-     * @param y   点位得y坐标
-     * @param i   点位得i坐标
-     * @return    移动对应得点。如果索引无法找到移动顶点,则返回null
-     */
-    movePoint(x: number, y: number, i: number, ): SPoint | null {
-        let point = null;
-        if (i >= (this.pointList.length) || i < 0) {
-            return null
-        }
-        if (this.pointList.length) {
-            this.pointList[i].x = x;
-            this.pointList[i].y = y;
-        }
-        point = this.pointList[i];
-        return point
-    }
-
-    /**
-     * 打印出多边形数组
-     *
-     * @return  顶点数组
-     */
-    PrintPointList(): SPoint[] {
-        return this.pointList
-    }
-
-    ////////////
-    //  以下为三种状态下的绘制多边形方法
-
-    /**
-     * 展示状态 --绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawShowPolygon(painter: SPainter, pointList: SPoint[]): void {
-        painter.save();
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this._strokeColor;
-        painter.pen.lineWidth = painter.toPx(this._lineWidth);
-        painter.brush.color = this._fillColor;
-        if (this.selected) {
-            painter.shadow.shadowBlur = 10;
-            painter.shadow.shadowColor = new SColor(`#00000060`);
-            painter.shadow.shadowOffsetX = 5;
-            painter.shadow.shadowOffsetY = 5;
-        } else {
-            painter.shadow.shadowColor = SColor.Transparent;
-        }
-        painter.drawPolygon([...pointList]);
-        painter.restore();
-    }
-
-
-    /**
-     * 创建状态 --绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawCreatePolygon(painter: SPainter, pointList: SPoint[]): void {
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this._strokeColor;
-        painter.pen.lineWidth = painter.toPx(this._lineWidth);
-        if (this.lastPoint && pointList.length) {
-            painter.drawLine(pointList[pointList.length - 1].x, pointList[pointList.length - 1].y, this.lastPoint.x, this.lastPoint.y);
-        }
-        painter.drawPolyline(pointList);
-        painter.pen.color = SColor.Transparent;
-        painter.brush.color = new SColor(this._fillColor.value + "80");
-        painter.pen.lineWidth = painter.toPx(this._lineWidth);
-
-        if (this.lastPoint) {
-            painter.drawPolygon([...pointList, this.lastPoint]);
-            // 绘制顶点块
-            painter.pen.color = SColor.Black;
-            painter.brush.color = SColor.White;
-            pointList.forEach((item, index) => {
-                painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2))
-            });
-        } else {
-            painter.drawPolygon(pointList);
-        }
-
-    }
-
-    /**
-     *
-     * 编辑状态 --绘制多边形数组
-     *
-     * @param painter    绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawEditPolygon(painter: SPainter, pointList: SPoint[]): void {
-        // 展示多边形
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this._strokeColor;
-        painter.pen.lineWidth = painter.toPx(this._lineWidth);
-        painter.brush.color = new SColor(this._fillColor.value + "80");
-        painter.drawPolygon([...pointList]);
-        // 绘制顶点块
-        painter.pen.color = SColor.Black;
-        painter.brush.color = SColor.White;
-        pointList.forEach((item, index) => {
-            painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2))
-        })
-    }
-
-    /**
-     * 编辑状态操作多边形数组
-     *
-     * @param event    鼠标事件
-     *
-     *
-     */
-    protected editPolygonPoint(event: SMouseEvent): void {
-        //  判断是否为删除状态 isAlt = true为删除状态
-        if (this.isAlt) {
-            // 1 判断是否点击在多边形顶点
-            let lenIndex = -1;  // 当前点击到的点位索引;
-            let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
-                let dis = SMathUtil.pointDistance(
-                    event.x,
-                    event.y,
-                    item.x,
-                    item.y
-                );
-                if (dis < curenLen) {
-                    curenLen = dis;
-                    lenIndex = index;
-                }
-            });
-            // 若点击到,对该索引对应的点做删除
-            if (lenIndex != -1) {
-                if (this.pointList.length <= 3) {
-                    return
-                }
-                const delePoint = new SPoint(this.pointList[lenIndex].x, this.pointList[lenIndex].y)
-                this.deletePoint(lenIndex);
-                // 记录顶点操作记录压入堆栈
-                this.recordAction(SGraphPointListDelete, [this.pointList, delePoint, lenIndex]);
-            }
-        } else {
-            // 1 判断是否点击在多边形顶点
-            this.curIndex = -1;
-            this.curPoint = null;
-            let lenIndex = -1;  // 当前点击到的点位索引;
-            let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
-                let dis = SMathUtil.pointDistance(
-                    event.x,
-                    event.y,
-                    item.x,
-                    item.y
-                );
-                if (dis < curenLen) {
-                    curenLen = dis;
-                    lenIndex = index;
-                }
-            });
-            this.curIndex = lenIndex;
-            // 2判断是否点击在多边形得边上
-            if (-1 == lenIndex) {
-                let len = SMathUtil.pointToLine(
-                    new SPoint(event.x, event.y),
-                    new SLine(this.pointList[0], this.pointList[1])
-                ),
-                    index = 0;
-                if (this.pointList.length > 2) {
-                    for (let i = 1; i < this.pointList.length; i++) {
-                        let dis = SMathUtil.pointToLine(
-                            new SPoint(event.x, event.y),
-                            new SLine(this.pointList[i], this.pointList[i + 1])
-                        );
-                        if ((i + 1) == this.pointList.length) {
-                            dis = SMathUtil.pointToLine(
-                                new SPoint(event.x, event.y),
-                                new SLine(this.pointList[i], this.pointList[0])
-                            );
-                        }
-                        if (dis.MinDis < len.MinDis) {
-                            len = dis;
-                            index = i;
-                        }
-                    }
-                }
-                // 判断是否有点
-                if (len.Point) {
-                    console.log(index,len.Point);
-                    // 点在了多边形的边上
-                    if (len.MinDis <= this.scenceLen) {
-                        this.pointList.splice(index + 1, 0, len.Point);
-                        // 记录新增顶点操作记录压入堆栈
-                        this.recordAction(SGraphPointListInsert, [this.pointList, len.Point, index + 1]);
-                    } else { //没点在多边形边上也没点在多边形顶点上
-                        super.onMouseDown(event);
-                    }
-                }
-            } else {
-                // 当捕捉到顶点后 ,记录当前点的xy坐标,用于undo、redo操作
-                this.curPoint = new SPoint(this.pointList[this.curIndex].x, this.pointList[this.curIndex].y);
-            }
-            // 刷新视图
-            this.update();
-        }
-
-    }
-
-    /////////////////////
-    // undo、redo相关操作
-
-    /**
-     * 记录相关动作并推入栈中
-     * @param	SGraphCommand         相关命令类
-     * @param	any                    对应传入参数
-     */
-    protected recordAction(SGraphCommand: any, any: any[]): void {
-        // 记录相关命令并推入堆栈中
-        const sgraphcommand = new SGraphCommand(this, ...any);
-        if (this.undoStack) {
-            this.undoStack.push(sgraphcommand);
-        }
-    }
-
-    /**
-     * 执行取消操作执行
-     */
-    undo(): void {
-        if (this.status == SItemStatus.Normal) {
-            return
-        }
-        if (this.undoStack) {
-            this.undoStack.undo();
-        }
-    }
-
-    /**
-     * 执行重做操作执行
-     */
-    redo(): void {
-        if (this.status == SItemStatus.Normal) {
-            return
-        }
-        if (this.undoStack) {
-            this.undoStack.redo();
-        }
-    }
-
-    ///////////////////////////////
-    // 以下为鼠标事件
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onDoubleClick(event: SMouseEvent): boolean {
-        console.log(event)
-        // 如果位show状态 双击改对象则需改为编辑状态
-        if (SItemStatus.Normal == this.status) {
-            this.status = SItemStatus.Edit;
-            this.grabItem(this);
-        } else if (SItemStatus.Edit == this.status) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-            if (this.undoStack) {
-                this.undoStack.clear()
-            }
-        }
-        this.update()
-        return true;
-    } // Function onDoubleClick()
-
-
-    /**
-     * 键盘事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-
-    onKeyDown(event: KeyboardEvent): boolean {
-        if (this.status == SItemStatus.Normal) {
-            return false;
-        } else if (this.status == SItemStatus.Create) {
-            if (event.code == 'Enter') {
-                // 当顶点大于二个时才又条件执行闭合操作并清空堆栈
-                if (this.pointList.length > 2) {
-                    this.status = SItemStatus.Normal;
-                    //3 传递完成事件状态
-                    this.$emit('finishCreated')
-                    //1 grabItem 置为null
-                    this.releaseItem();
-                    //2 清空undo
-                    if (this.undoStack) {
-                        this.undoStack.clear();
-                    }
-                }
-            }
-        } else if (this.status == SItemStatus.Edit) {
-            if (event.key == 'Alt') {
-                this.isAlt = true;
-            }
-        }
-        this.update();
-        return true;
-    } // Function onKeyDown()
-
-
-    /**
-     * 键盘键抬起事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onKeyUp(event: KeyboardEvent): void {
-        if (this.status == SItemStatus.Edit) {
-            if (event.key == 'Alt') {
-                this.isAlt = false;
-            }
-        }
-        this.update()
-    } // Function onKeyUp()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        // 如果状态为编辑状态则添加点
-        if (this.status == SItemStatus.Create) {
-            // 新增顶点
-            this.insertPoint(event.x, event.y);
-            // 记录新增顶点操作记录压入堆栈
-            let pos = new SPoint(event.x, event.y);
-            this.recordAction(SGraphPointListInsert, [this.pointList, pos]);
-        } else if (this.status == SItemStatus.Edit) {
-            // 对多边形数组做编辑操作
-            this.editPolygonPoint(event);
-        } else {
-            return super.onMouseDown(event)
-        }
-        return true;
-
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标移入事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onMouseEnter(event: SMouseEvent): boolean {
-        return true;
-    } // Function onMouseEnter()
-
-
-    /**
-     * 鼠标移出事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-
-    onMouseLeave(event: SMouseEvent): boolean {
-        return true;
-    } // Function onMouseLeave()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-
-    onMouseMove(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Create) {
-            this.lastPoint = new SPoint
-            this.lastPoint.x = event.x;
-            this.lastPoint.y = event.y;
-            this.update();
-        } else if (this.status == SItemStatus.Edit) {
-            if (-1 != this.curIndex) {
-                this.pointList[this.curIndex].x = event.x;
-                this.pointList[this.curIndex].y = event.y;
-            }
-            this.update()
-        } else {
-            // return super.onMouseMove(event)
-        }
-
-        return true;
-    } // Function onMouseMove()
-
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Edit) {
-            if (-1 != this.curIndex) {
-                const pos = new SPoint(this.pointList[this.curIndex].x, this.pointList[this.curIndex].y)
-                this.recordAction(SGraphPointListUpdate, [this.pointList, this.curPoint, pos, this.curIndex])
-            }
-            this.curIndex = -1;
-            this.curPoint = null;
-        } else {
-            // return super.onMouseUp(event)
-        }
-        return true;
-    } // Function onMouseUp()
-
-    /**
-     * 适配事件
-     *
-     * @param	event         事件参数
-     * @return	boolean
-     */
-
-    onResize(event: SMouseEvent): boolean {
-        return true;
-    } // Function onResize()
-
-    /**
-     * 取消操作
-     *
-     * @param   painter       painter对象
-     */
-    cancelOperate(): void {
-        // 当状态为展示状态
-        if (this.status == SItemStatus.Create) {
-            // 闭合多边形
-            this.parent = null
-        } else if (this.status == SItemStatus.Edit) {
-            // 编辑状态
-            this.status = SItemStatus.Normal
-        }
-        this.update()
-    } // Function cancelOperate()
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        if (this.pointList.length) {
-            this.minX = this.pointList[0].x;
-            this.maxX = this.pointList[0].x;
-            this.minY = this.pointList[0].y;
-            this.maxY = this.pointList[0].y;
-            this.pointList.forEach(it => {
-                let x = it.x,
-                    y = it.y;
-                if (x < this.minX) {
-                    this.minX = x;
-                }
-                if (y < this.minY) {
-                    this.minY = y;
-                }
-                if (x > this.maxX) {
-                    this.maxX = x;
-                }
-                if (y > this.maxY) {
-                    this.maxY = y;
-                }
-            });
-        };
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    contains(x: number, y: number): boolean {
-        let arr = this.pointList;
-        if (arr.length < 3 || !SPolygonUtil.pointIn(x, y, arr)) {
-            return false;
-        }
-        return true;
-    } // Function contains()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     */
-    onDraw(painter: SPainter): void {
-        this.scenceLen = painter.toPx(this.len)
-        // 当状态为展示状态
-        if (this.status == SItemStatus.Normal) {
-            // 闭合多边形
-            this.drawShowPolygon(painter, this.pointList);
-        } else if (this.status == SItemStatus.Create) {
-            // 创建状态
-            this.drawCreatePolygon(painter, this.pointList)
-        } else {
-            // 编辑状态
-            this.drawEditPolygon(painter, this.pointList);
-        }
-    } // Function onDraw()
-
-
-}

+ 1 - 1
src/lib/GraphView.js

@@ -52,7 +52,7 @@ export class GraphView extends SCanvasView {
         canvas.clearRect(0, 0, this.width, this.height);
         canvas.pen.lineWidth = this.lineWidth;
         if (this.lineType == 'dashed') {
-            canvas.pen.lineDash = [10, 10];
+            canvas.pen.lineDash = [10, 2];
         }
         if (this.lineType == 'dotted') {
             canvas.pen.lineDash = [this.lineWidth, this.lineWidth];

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

@@ -1,8 +1,7 @@
-import { SPolygonItem } from "@/components/mapClass/SPolygonItem";
 import { SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
-import { hexify } from "@/components/mapClass/until";
-import { SItemStatus, ItemOrder } from '@saga-web/big/lib';
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { hexify } from "../../components/mapClass/until";
 /**
  *图例节点Item(区域类型 --防火分区)
  *

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

@@ -1,11 +1,10 @@
 
 import { SGraphItem } from "@saga-web/graph/lib";
-import { SPolygonItem } from "@/components/mapClass/SPolygonItem";
 import { Legend } from '../types/Legend';
 import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
-import { hexify } from "@/components/mapClass/until"
-import { SItemStatus, ItemOrder } from '@saga-web/big/lib';
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { hexify } from "../../components/mapClass/until";
 /**
  *图例节点Item(区域类型 --防火分区)
  *

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

@@ -0,0 +1,36 @@
+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

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

@@ -0,0 +1,47 @@
+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

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

@@ -0,0 +1,22 @@
+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

@@ -1,8 +1,7 @@
-import { SPolygonItem } from "@/components/mapClass/SPolygonItem";
 import { SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
-import { hexify } from "@/components/mapClass/until";
-import { SItemStatus, ItemOrder } from '@saga-web/big/lib';
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { hexify } from "../../components/mapClass/until";
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *

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

@@ -1,11 +1,10 @@
 
 import { SGraphItem } from "@saga-web/graph/lib";
-import { SPolygonItem } from "@/components/mapClass/SPolygonItem";
 import { Legend } from '../types/Legend';
 import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
-import { hexify } from "@/components/mapClass/until"
-import { SItemStatus, ItemOrder } from '@saga-web/big/lib';
+import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { hexify } from "../../components/mapClass/until";
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *

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

@@ -300,16 +300,16 @@ var system = [
                     label: "系统原理图",
                     children: [
                         {
-                            label: "视频监控系统原理图",
-                            id: "RDYL1",
-                            param: { tab_code: "1572", type_code: "2018" },
-                        },
-                        {
                             label: "门禁管理系统原理图",
                             id: "RDYL2",
                             param: { tab_code: "rd01", type_code: "2019" },
                         },
                         {
+                            label: "视频监控系统原理图",
+                            id: "RDYL1",
+                            param: { tab_code: "1572", type_code: "2018" },
+                        },
+                        {
                             label: "BA楼宇智能化系统原理图",
                             id: "RDYL3",
                             param: { tab_code: "1574", type_code: "2010" },

+ 22 - 13
src/views/equipment/eqDialog.vue

@@ -13,7 +13,7 @@
                 />
             </div>
             <!-- 没有tab的页面 -->
-            <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length==0' style='margin:16px 24px 0 24px'>
+            <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length==0' style='margin:16px 0 0 24px'>
                 <!-- 原理图 -->
                 <div v-if='dialogInfo.id.slice(2,4)=="YL"' style='width:90%;overflow:hidden'>
                     <rotation :rotationImg='rotationImg'></rotation>
@@ -29,7 +29,7 @@
                 <look-page v-else-if='dialogInfo.id.slice(2,4)=="TZ"' param major></look-page>
             </div>
             <!-- 有tab的页面 -->
-            <div v-else style='margin:16px 24px 0 24px;'>
+            <div v-else style='margin:16px 0 0 24px;height:100%;'>
                 <el-tabs v-model='activeName' @tab-click='handleClick' v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length>0'>
                     <el-tab-pane
                         v-for='(value,index) in dialogInfo.children'
@@ -117,7 +117,6 @@ export default {
     methods: {
         //打开弹窗
         showModal(item) {
-            console.log(item)
             this.visible = true
             this.dialogInfo = item
             if (Object.keys(this.dialogInfo).length > 0 && this.dialogInfo.children.length > 0) {
@@ -138,7 +137,6 @@ export default {
                     this.initImage(this.typecode)
                 }
             }
-            //console.log(this.dialogInfo)
             this.param = this.activeName
         },
         //点击tab函数
@@ -154,12 +152,17 @@ export default {
                 this.typecode = this.dialogInfo.children[`${tab.index}`].param.type_code
                 this.diff = this.dialogInfo.children[`${tab.index}`].param.diff
             }
-            if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode != 'FBT') {
+            if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode.slice(0, 3) != 'FBT') {
                 this.initImage(this.typecode)
             }
-           
+            if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode.slice(0, 3) == 'FBT') {
+                this.$nextTick(() => {
+                    this.$refs.fenbutu[0] && this.$refs.fenbutu[0].openFloorMap()
+                })
+            }
             this.tabLabel = tab.label
         },
+
         visibalBox() {
             this.$refs.Dialog.open(this.dialogInfo.id)
         },
@@ -200,7 +203,6 @@ export default {
             if (this.systemName == '供电系统') {
                 getParams.system = '1001'
             }
-            console.log(getParams)
             queryPic({ getParams }).then(res => {
                 this.rotationImg = res.data || []
             })
@@ -236,7 +238,6 @@ export default {
             }
             queryTab({ data, postParams }).then(res => {
                 this.tabCount = []
-                console.log('res', res)
                 let data = res.data.data || []
                 data.forEach(el => {
                     this.tabCount.push({
@@ -298,6 +299,10 @@ export default {
     .el-tabs__nav-wrap::after {
         height: 0;
     }
+    .el-tabs,
+    .el-tabs__content {
+        height: calc(100% - 45px);
+    }
     .el-tabs__item {
         padding: 5px 16px;
         height: 30px;
@@ -308,12 +313,9 @@ export default {
         border: 1px solid rgba(195, 199, 203, 1);
     }
     .el-tab-pane {
-        height: 60% !important;
-    }
-    .el-tabs,
-    .el-tabs__content {
-        height: 700px;
+        height: 100% !important;
     }
+
     .el-tabs__active-bar {
         background-color: transparent !important;
     }
@@ -370,4 +372,11 @@ export default {
         }
     }
 }
+@media screen and (max-width: 1366px) {
+    /*当屏幕尺寸小于1366px时,应用下面的CSS样式*/
+    .el-tabs,
+    .el-tabs__content {
+        height: 700px;
+    }
+}
 </style>

+ 20 - 13
src/views/equipment/fenbuPic.vue

@@ -5,8 +5,8 @@
             <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 v-if='floors.length>0'>
-            <floorMap ref='floorMap' :loadName='""' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`' :type='"floor"'></floorMap>
+        <div v-show='floors.length>0' class='canvas-box'>
+            <floorMap ref='floorMap' :modalHeight='modalHeight' :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 />
@@ -30,16 +30,23 @@ export default {
             },
             loadName: '',
             type: '',
-            floors: []
+            floors: [],
+            modalHeight: 500,   //适配底图
         }
     },
     props: ['typecode'],
     computed: {
         ...mapGetters(['floorsArr'])
     },
+    mounted() {
+        if (window.screen.width > 1366) {
+            this.modalHeight = 700
+        } else {
+            this.modalHeight = 500
+        }
+    },
     methods: {
         emitFloor(item) {
-            console.log(item)
             this.floorInfo = item
             this.$refs.floorMap.init(this.floorInfo.gname)
         },
@@ -60,8 +67,8 @@ export default {
                 postParams.Filters = `projectId =${this.$store.state.plazaId};categoryId='XFBFYCFL';isPub=true`
             }
             let floor = []
+            this.floors = []
             queryPics({ postParams }).then(res => {
-                console.log(res)
                 if (res.Total == 0) {
                     this.floors = []
                 } else {
@@ -69,7 +76,6 @@ export default {
                     this.floorsArr.forEach(el => {
                         floor.forEach(ele => {
                             if (ele.FloorId == el.gname) {
-                                console.log(el)
                                 this.floors.push({
                                     gname: el.gname,
                                     gcode: el.gcode,
@@ -81,20 +87,17 @@ export default {
                         })
                     })
                 }
-                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}`
+        },
+        openFloorMap() {
+            this.getFloorData()
+            this.$refs.floorMap.init(this.floorInfo.gname)
         }
-    },
-    mounted() {
-        console.log(this.floorsArr)
-        this.getFloorData()
     }
 }
 </script>
@@ -110,6 +113,10 @@ export default {
         right: 32px;
         top: 155px;
     }
+    .canvas-box {
+        width: 100%;
+        height: 100%;
+    }
     .nodata {
         height: calc(100%-50px);
         .img1 {

+ 3 - 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' :floors='floorsArr' type='1'></Legend>
                         </div>
-                        <floorMap ref='floorMap' :id='"equip"' :loadName='loadName'  :type='"system"'></floorMap>
+                        <floorMap ref='floorMap' :id='"equip"' :loadName='loadName' :type='"system"'></floorMap>
                         <div class='additional-box' v-if='fqPic.length>0'>
                             <div class='additional' @click='additionalColl'>
                                 <img src='../../assets/imgs/bg.png' alt />
@@ -224,6 +224,7 @@ export default {
             .eq-right-bottom {
                 display: flex;
                 flex: 1;
+                height: 100%;
                 .title-box {
                     position: fixed;
                     z-index: 2;

+ 2 - 2
src/views/equipment/table/djspTable.vue

@@ -32,8 +32,8 @@
             <el-table-column prop='meterbox' label='商铺电表数' width='200'>
                 <template slot-scope='{row}'>{{row.meterbox || '--'}}</template>
             </el-table-column>
-            <el-table-column prop='shopsnum' label='商铺编号' width='200'>
-                <template slot-scope='{row}'>{{row.shopsnum || '--'}}</template>
+            <el-table-column prop='shopsnum' label='商铺编号' >
+                <template slot-scope='{row}'>{{row.shopsnumList || '--'}}</template>
             </el-table-column>
         </el-table>
         <div class='foot'></div>

+ 3 - 9
src/views/equipment/table/eqListTable.vue

@@ -33,10 +33,10 @@
         </div>
         <el-table :data='tableData' style='width: 100%' :border='true' @row-click='rowHandle'>
             <el-table-column type='index' label='序号' width='50'></el-table-column>
-            <el-table-column prop='type_name' label='设备名称' show-overflow-tooltip resizable width='160'>
+            <el-table-column prop='type_name' label='设备名称' show-overflow-tooltip resizable >
                 <template slot-scope='{row}'>{{row.type_name || '--'}}</template>
             </el-table-column>
-            <el-table-column prop='sl' label='数量' width='100'>
+            <el-table-column prop='sl' label='数量' >
                 <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
             </el-table-column>
             <el-table-column prop='brand' label='品牌'>
@@ -45,7 +45,7 @@
             <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
             </el-table-column>
-            <el-table-column prop='floorcode' label='楼层' width='100'>
+            <el-table-column prop='floorcode' label='楼层' >
                 <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
             </el-table-column>
             <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable>
@@ -82,12 +82,6 @@ export default {
     components: { Select, EqDetail },
     data() {
         return {
-            dataSelect2: [
-                { id: 'test1', name: '选择项' },
-                { id: 'test2', name: '单平米' },
-                { id: 'test3', name: '下级分项' },
-                { id: 'test4', name: '滑动平均滑动平均' }
-            ],
             tableData: [],
             total: 0,
             currentPage: 1,

+ 3 - 3
src/views/equipment/table/standTable.vue

@@ -37,7 +37,7 @@
                 <template slot-scope='{row}'>{{row.type_name || '--'}}</template>
             </el-table-column>
             <!-- sbjc -->
-            <el-table-column prop='sl' label='数量' width='100'>
+            <el-table-column prop='sl' label='数量' >
                 <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
             </el-table-column>
             <el-table-column prop='brand' label='品牌'>
@@ -46,7 +46,7 @@
             <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
             </el-table-column>
-            <el-table-column prop='floor' label='楼层' width='100'>
+            <el-table-column prop='floor' label='楼层' >
                 <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
             </el-table-column>
             <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable>
@@ -132,7 +132,7 @@ export default {
             }
             //下拉
             if (this.floor) {
-                data.gname = this.floor
+                postParams.gname = this.floor
             }
             //输入框搜索
             data.keyword = ''

+ 1 - 1
src/views/equipment/table/wbTable.vue

@@ -62,7 +62,7 @@
             </div>
             <input-dialog :type='2' @confirm='confirm'></input-dialog>
         </div>
-        <el-table :data='tableData' style='width: 100%'>
+        <el-table :data='tableData' :border='true' style='width: 100%'>
             <el-table-column type='index' label='序号' width='80'></el-table-column>
             <el-table-column prop='sbmc' label='设备名称' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.sbmc || '--'}}</template>

+ 29 - 28
src/views/legendLibrary/addForm.vue

@@ -101,6 +101,9 @@
                         :data='deviceList'
                         @change='treeConfirmDevice'
                         :hideClear='true'
+                        :lastStage='true'
+                        :selectedIds='InfosList'
+                        :notNull='true'
                     />
                 </span>
                 <TreeSelect
@@ -114,7 +117,8 @@
                     @change='treeConfirm'
                     @focusChange='focusChange'
                     :hideClear='true'
-                    :selectedIds='selectedIds'
+                    :selectedIds='InfoTypeIdList'
+                    :lastStage='true'
                 />
             </div>
         </div>
@@ -195,10 +199,14 @@ export default {
 
             // majorList: [], //专业
             deviceList: [],
-            key: 1
+            key: 1,
+            InfoLocals: undefined, //工程信息化
+            // InfoSystems: undefined, //工程信息化专业/系统
+            InfoTypeIds: undefined //铺位可视化typeid
         }
     },
-    props: ['ruleForm', 'title'],
+    props: ['ruleForm', 'title', 'InfosList', 'InfoTypeIdList'],
+
     methods: {
         //业下设备分类和位置分类树形结构
         initQueryDeviceAndPOsition() {
@@ -208,7 +216,7 @@ export default {
             })
         },
         handleRemove(file, fileList) {
-            console.log(file, fileList, 'file')
+            // console.log(file, fileList, 'file')
             this.ruleForm.Url = ''
         },
         getFile(file) {
@@ -259,6 +267,7 @@ export default {
             let postParams = {
                 Content: [this.ruleForm]
             }
+
             updateLegend({ postParams }).then(res => {
                 if (res.Result == 'success') {
                     this.$message.success('图例修改成功!')
@@ -294,17 +303,6 @@ export default {
         },
         //rgba转成16进制
         hexify(color) {
-            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])
@@ -376,10 +374,7 @@ export default {
                     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) {
@@ -462,20 +457,26 @@ export default {
 
         //位置/设备
         treeConfirmDevice(id, info) {
+            console.log(id)
             // this.$set(this.ruleForm, 'InfoLocal', data)
             let InfoSystem = []
             let InfoLocal = []
-            for (let i = 0; i < info.length; i++) {
-                let type = info[i]
-                if (type.name.includes('/')) {
-                    InfoLocal.push(type)
-                    //位置/设备
-                    this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
-                } else {
-                    InfoSystem.push(type)
-                    //专业
-                    this.$set(this.ruleForm, 'InfoSystem', InfoSystem)
+            if (info && info.length > 0) {
+                for (let i = 0; i < info.length; i++) {
+                    let type = info[i]
+                    if (type.name.includes('/')) {
+                        InfoLocal.push(type)
+                        //位置/设备
+                        this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
+                    } else {
+                        InfoSystem.push(type)
+                        //专业
+                        this.$set(this.ruleForm, 'InfoSystem', InfoSystem)
+                    }
                 }
+            } else {
+                this.$set(this.ruleForm, 'InfoLocal', [])
+                this.$set(this.ruleForm, 'InfoSystem', [])
             }
         },
         focusChange(status) {

+ 24 - 1
src/views/legendLibrary/addLegend.vue

@@ -2,7 +2,15 @@
     <div class='add-legend'>
         <el-dialog :title='title' :visible.sync='dialogVisible'>
             <!-- <add-list v-show='title=="" && GraphCategoryId' ref='searchList' :GraphCategoryId='GraphCategoryId' @mesg='mesg'></add-list> -->
-            <add-form ref='add' :ruleForm='info' @addSuccess='addSuccess' @updateSuccess='updateSuccess' :title='title'></add-form>
+            <add-form
+                ref='add'
+                :InfosList='InfosList'
+                :InfoTypeIdList='InfoTypeIdList'
+                :ruleForm='info'
+                @addSuccess='addSuccess'
+                @updateSuccess='updateSuccess'
+                :title='title'
+            ></add-form>
             <span slot='footer' class='dialog-footer'>
                 <el-button @click='dialogVisible = false,cancal()' size='small'>取 消</el-button>
                 <el-button type='primary' @click='save' size='small'>确 定</el-button>
@@ -33,6 +41,9 @@ export default {
     data() {
         return {
             dialogVisible: false,
+            InfoTypeIdList: [],
+            InfosList: [],
+
             info: {
                 Name: '',
                 Type: 'None',
@@ -78,6 +89,8 @@ export default {
                 }
             } else if (title == '添加图例库') {
                 this.dialogVisible = true
+                this.InfoTypeIdList = []
+                this.InfosList = []
                 this.info = {
                     Name: '',
                     Type: 'None',
@@ -92,6 +105,13 @@ export default {
             } else if (title == '修改图例库') {
                 this.dialogVisible = true
                 this.info = row
+                this.InfosList = []
+                this.InfoTypeIdList = []
+
+                // this.InfosList = [...row.InfoLocal.map(({ id }) => id), ...row.InfoSystem]
+                this.InfosList = [...row.InfoLocal.map(({ id }) => id)]
+                this.InfoTypeIdList = row.InfoTypeId
+                console.log(this.InfosList, this.InfoTypeIdList)
                 console.log(this.info)
                 // 图例库规则中的transform
             } else if (title == '' && this.$refs.searchList) {
@@ -117,6 +137,9 @@ export default {
                 InfoLocal: [], //工程信息化位置与设备分类
                 InfoSystem: [] //工程信息化专业/系统
             }
+            this.InfoTypeIdList = []
+            this.InfosList = []
+
             this.$refs.add.fileList = []
         },
         mesg() {

+ 9 - 9
src/views/legendLibrary/index.vue

@@ -1,17 +1,15 @@
 <template>
     <div class='legend-library'>
-        <div class='nav'>
+        <!-- <div class='nav'>
             <img class='img-menu' src='@/assets/imgs/menu.png' alt />
             <el-divider direction='vertical'></el-divider>
             <img class='img-logo' src='@/assets/imgs/logo_tu.png' alt />
             <span class='nav-span1'>万达管理说明书</span>
             <span class='circular'></span>
-            <!-- <span style='color:#1F2329'>图例库管理</span>
-            <i class='el-icon-caret-bottom'></i>-->
             <Dropdown v-model='selVal' :data='dataSelect'>
                 <span style=' font-size: 14px;color: #1f2329 ;'>{{selText}}</span>
             </Dropdown>
-        </div>
+        </div>-->
         <div class='legend-library-top'>
             图例库管理
             <span class='library-btn'>
@@ -40,6 +38,7 @@
                     :returnParentNode='false'
                     :isShowAllChoice='true'
                     :choseArea='true'
+                    :lastStage='true'
                     :data='positionSelect'
                     @change='treeConfirmPosition'
                     :hideClear='true'
@@ -54,6 +53,7 @@
                         :returnParentNode='true'
                         :choseArea='true'
                         :data='deviceList'
+                        :lastStage='true'
                         :hideClear='true'
                         @change='treeConfirmDevice'
                     />
@@ -81,6 +81,7 @@
                     :choseArea='true'
                     :data='typeVisualization'
                     @change='treeConfirm'
+                    :lastStage='true'
                     @focusChange='focusChange'
                     :hideClear='true'
                 />
@@ -109,24 +110,24 @@
                 <el-table-column prop='Unit' label='单位'>
                     <template slot-scope='{row}'>{{row.Unit}}</template>
                 </el-table-column>
-                <el-table-column prop='position' label='对应广场说明书的位置'>
+                <el-table-column prop='position' label='对应广场说明书的位置' show-overflow-tooltip>
                     <template slot-scope='{row}'>
                         <span v-for='item in row.GraphCategorys ' :key='item.Name'>{{item.Name}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column label='对应工程信息化' align='center'>
-                    <el-table-column prop='type' label='位置/设备分类' width='240' :show-overflow-tooltip='true'>
+                    <el-table-column prop='type' label='位置/设备分类' width='240' show-overflow-tooltip>
                         <template slot-scope='{row}'>
                             <span v-for='item in row.InfoLocal ' :key='item.name'>{{item.name}}</span>
                         </template>
                     </el-table-column>
-                    <el-table-column prop='system' label='专业' :show-overflow-tooltip='true'>
+                    <el-table-column prop='system' label='专业' show-overflow-tooltip>
                         <template slot-scope='{row}'>
                             <span v-for='(item,index) in row.InfoSystems ' :key='index'>{{item.Name}}</span>
                         </template>
                     </el-table-column>
                 </el-table-column>
-                <el-table-column prop='typeId' resizable label='铺位可视化typeid' width='140' :show-overflow-tooltip='true'>
+                <el-table-column prop='typeId' resizable label='铺位可视化typeid' width='140' show-overflow-tooltip>
                     <template slot-scope='{row}'>
                         <span v-for='(item,index) in row.InfoTypes ' :key='index'>{{item.Name}}</span>
                     </template>
@@ -444,7 +445,6 @@ export default {
                 this.key++
                 // 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)

+ 15 - 5
src/views/legendRules/index.vue

@@ -1,20 +1,27 @@
 <template>
     <!-- 图例库首页 -->
     <div class='legend-rules'>
-        <div class='nav'>
+        <!-- <div class='nav'>
             <img class='img-menu' src='@/assets/imgs/menu.png' alt />
             <el-divider direction='vertical'></el-divider>
             <img class='img-logo' src='@/assets/imgs/logo_tu.png' alt />
             <span style='color:#1F2329'>万达管理说明书</span>
             <span class='circular'></span>
-            <!-- <span style='color:#1F2329'>图例绘制规则</span>
-            <i class='el-icon-caret-bottom'></i>-->
             <Dropdown v-model='selVal' :data='dataSelect'>
                 <span style=' font-size: 14px;color: #1f2329 ;'>{{selText}}</span>
             </Dropdown>
-        </div>
+        </div>-->
         <div class='legend-rules-top'>
-            图例绘制规则
+            <span
+                class='el-icon-arrow-left'
+                @click='goBack'
+                style='float: left;
+                        cursor: pointer;
+                        font-size: 25px;
+                        display: inline-block;
+                        margin-top: 10px;
+                        padding-left: 20px;'
+            ></span>图例绘制规则
             <el-button type='primary' class='rules-button' size='small' @click='add'>添加图例</el-button>
         </div>
         <div class='legend-rules-bottom'>
@@ -135,6 +142,9 @@ export default {
         }
     },
     methods: {
+        goBack() {
+            this.$router.push({ path: 'legendLibrary' })
+        },
         buttonClickHandle(obj) {
             let index = Number(obj.item.index.split('-')[1])
             let _this = this