Browse Source

'合并冲突'

zhangyu 4 years ago
parent
commit
e4ff533dbf

+ 2 - 2
package.json

@@ -9,10 +9,10 @@
     },
     "dependencies": {
         "@saga-web/base": "2.1.22",
-        "@saga-web/big": "1.0.63",
+        "@saga-web/big": "1.0.64",
         "@saga-web/draw": "2.1.100",
         "@saga-web/feng-map": "1.0.15",
-        "@saga-web/graph": "2.1.100",
+        "@saga-web/graph": "2.1.101",
         "ant-design-vue": "^1.4.10",
         "axios": "^0.19.2",
         "core-js": "^3.4.4",

+ 1 - 2
public/systemConf.js

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

+ 3 - 2
src/api/httputils.js

@@ -21,6 +21,7 @@ axiosservice.interceptors.request.use(
     (config) => {
         config.withCredentials = true // 允许携带token ,这个是解决跨域产生的相关问题
         let token = store.getters['ssoToken']
+        let isPreview = store.getters["isPreview"]
         // if (token) {
         //     config.headers = {
         //         'sso-token': token,
@@ -28,8 +29,8 @@ axiosservice.interceptors.request.use(
         // }
         if (config.url.indexOf('mapapp') < 0) {
             config.headers = {
-                'sso-token': token,
-                isPreview: false, //默认false,当预览开启的时候是true
+                "sso-token": token,
+                isPreview: isPreview, //默认false,当预览开启的时候是true
             }
         }
         return config

BIN
src/assets/imgs/go-back.png


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

@@ -379,7 +379,9 @@ export default {
                 this.isShow2()
             } else {
                 this.isShow2()
+                this.queryEditNum(this.editSwitch)
             }
+            this.show2 = true
         },
         addFloor() {
             this.isFloor = true

+ 9 - 3
src/components/editLengend.vue

@@ -25,7 +25,12 @@
                             <template slot-scope='{row}'>
                                 <div v-if='row.IsModify'>
                                     <div v-if='row.Num!=row.RealNum ' class='redData'>
-                                        <el-tooltip class='item' effect='dark' :content='`当前图例 ${row.Name} 与平面图中的不一致,平面图中为xx`' placement='top'>
+                                        <el-tooltip
+                                            class='item'
+                                            effect='dark'
+                                            :content='`当前图例 ${row.Name} 与平面图中的不一致,平面图中为${row.RealNum}`'
+                                            placement='top'
+                                        >
                                             <el-input @change='changeTable(row)' v-model='row.Num' size='mini'></el-input>
                                         </el-tooltip>
                                     </div>
@@ -104,7 +109,7 @@
             </div>
             <div class='legendFoot'>
                 <el-button size='mini' @click='cancel'>取消</el-button>
-                <el-button size='mini' v-if='editNum.length<=0' disabled type='primary'>保存</el-button>
+                <el-button size='mini' v-if='editNum.length==0' disabled type='primary'>保存</el-button>
                 <el-button size='mini' v-else @click='save' type='primary'>保存</el-button>
             </div>
         </div>
@@ -155,7 +160,8 @@ export default {
                         type: 'info',
                         message: '已放弃修改'
                     })
-                    this.$emit('saveNum')
+                    this.editNum = []
+                    this.$emit('saveNum', this.editNum)
                 })
         },
         init() {

+ 68 - 1
src/components/legendremarks.vue

@@ -5,7 +5,8 @@
 */
 <template>
     <div class='editModel'>
-        <a-modal v-model='visible' :title='title' @ok='handleOk' ok-text='保存' cancel-text='取消' :maskClosable='false' :width='648'>
+        <a-modal v-model='visible' :title='title' :closable='false' :maskClosable='false' :width='648' :footer='null'>
+            <div class='edit-x' @click='handlCancel'>X</div>
             <div class='edit_container' style='width:600px;height:156px'>
                 <quill-editor
                     v-model='remarksTexts'
@@ -17,6 +18,10 @@
                 ></quill-editor>
                 <p class='p1'>{{valLen||remarksText.length}}/200</p>
             </div>
+            <div class='edit-foot'>
+                <span @click='handlCancel'>取消</span>
+                <span @click='handleOk'>保存</span>
+            </div>
         </a-modal>
     </div>
 </template>
@@ -44,6 +49,28 @@ export default {
         ...mapGetters(['remarksText'])
     },
     methods: {
+        // 点击取消
+        handlCancel() {
+            if (this.remarksTexts != this.remarksText) {
+                this.$confirm('是否保存编辑后的备注?', '提示', {
+                    confirmButtonText: '保存',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                })
+                    .then(() => {
+                        this.handleOk()
+                    })
+                    .catch(() => {
+                        this.$message({
+                            type: 'info',
+                            message: '已取消保存'
+                        })
+                        this.visible = false
+                    })
+            } else {
+                this.visible = false
+            }
+        },
         // val为传过来的备注
         showModal() {
             this.visible = true
@@ -109,6 +136,17 @@ export default {
 }
 </style>
 <style lang="less" scoped>
+.editModel {
+}
+.edit-x {
+    position: absolute;
+    width: 9px;
+    height: 10px;
+    color: #000000;
+    right: 20px;
+    top: 20px;
+    cursor: pointer;
+}
 .edit_container {
     margin: 10px 0 0;
     .p1 {
@@ -118,6 +156,35 @@ export default {
         margin-bottom: 0;
     }
 }
+.edit-foot {
+    height: 30px;
+    width: 100%;
+    margin-top: 20px;
+    display: flex;
+    justify-content: flex-end;
+    padding-top: 10px;
+    span {
+        height: 32px;
+        line-height: 32px;
+        border-radius: 2px;
+        width: 65px;
+        text-align: center;
+        font-size: 14px;
+        font-family: PingFangSC-Regular, PingFang SC;
+        font-weight: 400;
+        cursor: pointer;
+    }
+    span:nth-of-type(1) {
+        background: rgba(255, 255, 255, 1);
+        border: 1px solid rgba(0, 0, 0, 0.15);
+        margin-right: 8px;
+        color: rgba(0, 0, 0, 0.65);
+    }
+    span:nth-of-type(2) {
+        color: rgba(255, 255, 255, 1);
+        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+    }
+}
 .quill-editor {
     height: 130px;
 }

+ 1 - 1
src/components/menuList.vue

@@ -174,7 +174,7 @@ export default {
         dumpLegend() {
             const { conf } = window.__systemConf,
                 { wandaBmGuideUrl } = conf
-            window.open(`${wandaBmGuideUrl}home/legendLibrary&token=${this.$store.state.ssoToken}`, true)
+            window.open(`${wandaBmGuideUrl}home/legendLibrary`, true)
         }
     }
 }

+ 0 - 14
src/lib/enums/SLineStyle.js

@@ -1,14 +0,0 @@
-/**
- * 线样式
- *
- * @author  张宇
- */
-export var SLineStyle;
-(function (SLineStyle) {
-    /** 实线    */
-    SLineStyle[SLineStyle["Soild"] = 0] = "Soild";
-    /** 虚线    */
-    SLineStyle[SLineStyle["Dashed"] = 1] = "Dashed";
-    /** 点线    */
-    SLineStyle[SLineStyle["Dotted"] = 2] = "Dotted";
-})(SLineStyle || (SLineStyle = {})); // Enum SLineStyle

+ 0 - 13
src/lib/enums/SLineStyle.ts

@@ -1,13 +0,0 @@
-/**
- * 线样式
- *
- * @author  张宇
- */
-export enum SLineStyle {
-    /** 实线    */
-    Soild,
-    /** 虚线    */
-    Dashed,
-    /** 点线    */
-    Dotted
-} // Enum SLineStyle

+ 86 - 0
src/lib/items/HighlightItem.js

@@ -0,0 +1,86 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SColor, SLine, SPoint, SRect } from "@saga-web/draw/lib";
+import { ItemOrder, ItemColor } from '@saga-web/big/lib';
+/**
+ * 吸附时高亮对象
+ *
+ * @author  郝建龙
+ */
+export class HighlightItem extends SGraphItem {
+    /**
+     * 构造函数
+     *
+     * @param   parent  指向父对象
+     */
+    constructor(parent) {
+        super(parent);
+        /** 对象与鼠标位置距离   */
+        this.distance = 0;
+        /** 对象类型   */
+        this.type = 1;
+        /** 点对象数据-当吸附的为线时,此点为垂线与线段的交点   */
+        this._point = new SPoint();
+        /** 点对象数据   */
+        this._line = new SLine();
+        this.visible = false;
+        this.zOrder = ItemOrder.highLightOrder;
+    } // Constructor
+    get point() {
+        return this._point;
+    } // Get point
+    set point(v) {
+        this._point = v;
+        this.type = 1;
+        this.update();
+    } // Set point
+    get line() {
+        return this._line;
+    } // Get line
+    set line(v) {
+        this._line = v;
+        this.type = 2;
+        this.update();
+    } // Set line
+    /**
+     * Item对象边界区域
+     *
+     * @return	SRect
+     */
+    boundingRect() {
+        return new SRect(this.point.x, this.point.y, 10, 10);
+    } // Function boundingRect()
+    /**
+     * Item绘制操作
+     *
+     * @param   painter painter对象
+     */
+    onDraw(painter) {
+        if (this.type == 2) {
+            painter.pen.color = ItemColor.highLightLineColor;
+            painter.pen.lineWidth = painter.toPx(6);
+            painter.drawLine(this.line);
+        }
+        painter.pen.color = SColor.Transparent;
+        painter.brush.color = ItemColor.highLightPointColor;
+        painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));
+    } // Function onDraw()
+} // Class HighlightItem

+ 93 - 0
src/lib/items/HighlightItem.ts

@@ -0,0 +1,93 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SColor, SLine, SPainter, SPoint, SRect } from "@saga-web/draw/lib";
+import { ItemOrder, ItemColor } from '@saga-web/big/lib';
+
+/**
+ * 吸附时高亮对象
+ *
+ * @author  郝建龙
+ */
+export class HighlightItem extends SGraphItem {
+    /** 对象与鼠标位置距离   */
+    distance: number = 0;
+    /** 对象类型   */
+    private type: number = 1;
+
+    /** 点对象数据-当吸附的为线时,此点为垂线与线段的交点   */
+    _point: SPoint = new SPoint();
+    get point(): SPoint {
+        return this._point;
+    } // Get point
+    set point(v: SPoint) {
+        this._point = v;
+        this.type = 1;
+        this.update();
+    } // Set point
+
+    /** 点对象数据   */
+    _line: SLine = new SLine();
+    get line(): SLine {
+        return this._line;
+    } // Get line
+    set line(v: SLine) {
+        this._line = v;
+        this.type = 2;
+        this.update();
+    } // Set line
+
+    /**
+     * 构造函数
+     *
+     * @param   parent  指向父对象
+     */
+    constructor(parent: SGraphItem | null) {
+        super(parent);
+        this.visible = false;
+        this.zOrder = ItemOrder.highLightOrder;
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return	SRect
+     */
+    boundingRect(): SRect {
+        return new SRect(this.point.x, this.point.y, 10, 10);
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter painter对象
+     */
+    onDraw(painter: SPainter): void {
+        if (this.type == 2) {
+            painter.pen.color = ItemColor.highLightLineColor;
+            painter.pen.lineWidth = painter.toPx(6);
+            painter.drawLine(this.line);
+        }
+        painter.pen.color = SColor.Transparent;
+        painter.brush.color = ItemColor.highLightPointColor;
+        painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));
+    } // Function onDraw()
+} // Class HighlightItem

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

@@ -1,7 +1,7 @@
 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, SPolygonItem } from '@saga-web/big/lib';
-import { hexify } from "../../components/mapClass/until";
 /**
  *图例节点Item(区域类型 --防火分区)
  *
@@ -22,6 +22,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
         this._showText = true;
         /** 是否蒙版遮罩  */
         this._maskFlag = false;
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 1 - 1
src/lib/items/SFHFQZoneLegendItem.ts

@@ -3,8 +3,8 @@ import { SGraphItem } from "@saga-web/graph/lib";
 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, SPolygonItem } from '@saga-web/big/lib';
-import { hexify } from "../../components/mapClass/until";
 /**
  *图例节点Item(区域类型 --防火分区)
  *

+ 19 - 1
src/lib/items/SImageLegendItem.js

@@ -14,9 +14,10 @@ export class SImageLegendItem extends SIconTextItem {
      * @param data      图例节点对象数据
      */
     constructor(parent, data) {
-        super(parent);
+        super(parent, data.AnchorList);
         /** 图例数量 */
         this._num = 1;
+        this.isTransform = false;
         this.zOrder = ItemOrder.markOrder;
         this.data = data;
         this.id = data.ID;
@@ -35,6 +36,12 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
+        if (data.Properties.ImgPos) {
+            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
+        }
+        if (data.Properties.TextPos) {
+            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
+        }
         if (data.Properties && data.Properties.sWidth) {
             this.sWidth = data.Properties.sWidth;
         }
@@ -69,10 +76,21 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Size = { Width: this.width, Height: this.height };
         this.data.Name = this.name;
         this.data.Properties.Url = this.img.url;
+        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
+        this.data.Properties.ImgPos = { X: this.img.x, Y: this.img.y };
         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.value;
+        this.data.AnchorList = this.anchorList.map(t => {
+            return {
+                ID: t.id,
+                Pos: {
+                    X: t.x,
+                    Y: t.y
+                }
+            };
+        });
         return this.data;
     }
 } // Class SImageLegendItem

+ 22 - 6
src/lib/items/SImageLegendItem.ts

@@ -26,7 +26,7 @@ export class SImageLegendItem extends SIconTextItem {
             this.data.Num = 1;
         }
         this.data.Properties.Num = this._num;
-        this.text = `${this.data.Name}${this.data.Num > 1?` × ${this.data.Num}`:''}`;
+        this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`;
         this.update();
     }
 
@@ -37,7 +37,7 @@ export class SImageLegendItem extends SIconTextItem {
      * @param data      图例节点对象数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent);
+        super(parent, data.AnchorList);
         this.isTransform = false;
         this.zOrder = ItemOrder.markOrder;
         this.data = data;
@@ -52,11 +52,17 @@ export class SImageLegendItem extends SIconTextItem {
             this.height = data.Size.Height;
         }
         if (data.Num) {
-            this.text = `${data.Name}${data.Num > 1?` × ${data.Num}`:''}`;
+            this.text = `${data.Name}${data.Num > 1 ? ` × ${data.Num}` : ''}`;
         }
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
+        if (data.Properties.ImgPos) {
+            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
+        }
+        if (data.Properties.TextPos) {
+            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
+        }
         if (data.Properties && data.Properties.sWidth) {
             this.sWidth = data.Properties.sWidth;
         }
@@ -72,15 +78,25 @@ export class SImageLegendItem extends SIconTextItem {
     }
 
     toData(): Legend {
-        this.data.Pos = {X: this.x, Y: this.y};
-        this.data.Size = {Width: this.width, Height: this.height};
+        this.data.Pos = { X: this.x, Y: this.y };
+        this.data.Size = { Width: this.width, Height: this.height };
         this.data.Name = this.name;
         this.data.Properties.Url = this.img.url;
+        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
+        this.data.Properties.ImgPos = { X: this.img.x, Y: this.img.y };
         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.value;
-
+        this.data.AnchorList = this.anchorList.map(t => {
+            return {
+                ID: t.id,
+                Pos: {
+                    X: t.x,
+                    Y: t.y
+                }
+            }
+        })
         return this.data;
     }
 } // Class SImageLegendItem

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

@@ -15,6 +15,7 @@ export class SImageMarkerItem extends SImageItem {
     constructor(parent, data) {
         super(parent);
         this.zOrder = ItemOrder.imageOrder;
+        this.isTransform = false;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

+ 41 - 0
src/lib/items/SLineMarkerItem.js

@@ -15,6 +15,10 @@ export class SLineMarkerItem extends SLineItem {
      */
     constructor(parent, data) {
         super(parent);
+        /** 起始锚点  */
+        this.startItem = null;
+        /** 结束锚点  */
+        this.endItem = null;
         /** 是否蒙版遮罩  */
         this._maskFlag = false;
         this.zOrder = ItemOrder.lineOrder;
@@ -39,6 +43,20 @@ export class SLineMarkerItem extends SLineItem {
             this.strokeColor = new SColor(data.Properties.StrokeColor);
         }
     } // Constructor
+    /** 是否完成绘制  */
+    get status() {
+        return this._status;
+    }
+    set status(v) {
+        this._status = v;
+        if (v == SItemStatus.Edit) {
+            this.zOrder = ItemOrder.markOrder;
+        }
+        else {
+            this.zOrder = ItemOrder.lineOrder;
+        }
+        this.update();
+    }
     get maskFlag() {
         return this._maskFlag;
     }
@@ -49,6 +67,23 @@ export class SLineMarkerItem extends SLineItem {
         this._maskFlag = v;
         this.update();
     }
+    /** 接收事件作出修改  */
+    changePos() {
+        if (this.startItem) {
+            // 判断删除equip后,不移动
+            if (this.startItem.parent) {
+                let scenePoint = this.startItem.boundingRect().center();
+                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
+            }
+        }
+        if (this.endItem) {
+            // 删除equip后
+            if (this.endItem.parent) {
+                let scenePoint = this.endItem.boundingRect().center();
+                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
+            }
+        }
+    }
     toData() {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Properties.Line = this.line.map(pos => {
@@ -60,6 +95,12 @@ export class SLineMarkerItem extends SLineItem {
         this.data.Properties.LineWidth = this.lineWidth;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineStyle = this.lineStyle;
+        if (this.startItem && this.startItem.parent) {
+            this.data.Properties.StartItemId = this.startItem.id;
+        }
+        if (this.endItem && this.endItem.parent) {
+            this.data.Properties.EndItemId = this.endItem.id;
+        }
         return this.data;
     }
     onDraw(painter) {

+ 43 - 0
src/lib/items/SLineMarkerItem.ts

@@ -10,9 +10,28 @@ import { Marker } from '../types/Marker';
  * * @author  张宇(taohuzy@163.com)
  */
 export class SLineMarkerItem extends SLineItem {
+     /** 起始锚点  */
+    startItem: SGraphItem | null = null;
+    /** 结束锚点  */
+    endItem: SGraphItem | null = null;
+
     /** 标识对象数据 */
     data: Marker;
 
+    /** 是否完成绘制  */
+    get status(): SItemStatus {
+        return this._status;
+    }
+    set status(v: SItemStatus) {
+        this._status = v;
+        if (v == SItemStatus.Edit) {
+            this.zOrder = ItemOrder.markOrder;
+        } else {
+            this.zOrder = ItemOrder.lineOrder;
+        }
+        this.update();
+    }
+
     /** 是否蒙版遮罩  */
     _maskFlag: boolean = false;
     get maskFlag(): boolean {
@@ -57,6 +76,24 @@ export class SLineMarkerItem extends SLineItem {
         }
     } // Constructor
 
+    /** 接收事件作出修改  */
+    changePos() {
+        if (this.startItem) {
+            // 判断删除equip后,不移动
+            if (this.startItem.parent) {
+                let scenePoint: SPoint = this.startItem.boundingRect().center();
+                this.line[0] = this.startItem.mapToScene(scenePoint.x, scenePoint.y);
+            }
+        }
+        if (this.endItem) {
+            // 删除equip后
+            if (this.endItem.parent) {
+                let scenePoint: SPoint = this.endItem.boundingRect().center();
+                this.line[1] = this.endItem.mapToScene(scenePoint.x, scenePoint.y);
+            }
+        }
+    }
+
     toData(): Marker {
         this.data.Pos = { X: this.x, Y: this.y };
         this.data.Properties.Line = this.line.map(pos => {
@@ -68,6 +105,12 @@ export class SLineMarkerItem extends SLineItem {
         this.data.Properties.LineWidth = this.lineWidth;
         this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.LineStyle = this.lineStyle;
+        if (this.startItem && this.startItem.parent) {
+            this.data.Properties.StartItemId = this.startItem.id;
+        }
+        if (this.endItem && this.endItem.parent) {
+            this.data.Properties.EndItemId = this.endItem.id;
+        }
         return this.data;
     }
 

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

@@ -1,7 +1,7 @@
 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, SPolygonItem } from '@saga-web/big/lib';
-import { hexify } from "../../components/mapClass/until";
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *
@@ -22,6 +22,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
         this._showText = true;
         /** 是否蒙版遮罩  */
         this._maskFlag = false;
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 1 - 1
src/lib/items/SSCPZZoneLegendItem.ts

@@ -3,8 +3,8 @@ import { SGraphItem } from "@saga-web/graph/lib";
 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, SPolygonItem } from '@saga-web/big/lib';
-import { hexify } from "../../components/mapClass/until";
 /**
  * 图例节点Item(区域类型 --石材铺装)
  *

+ 1 - 0
src/lib/items/STextMarkerItem.js

@@ -16,6 +16,7 @@ export class STextMarkerItem extends STextItem {
     constructor(parent, data) {
         super(parent);
         this.zOrder = ItemOrder.textOrder;
+        this.isTransform = false;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

+ 1 - 0
src/lib/items/STextMarkerItem.ts

@@ -22,6 +22,7 @@ export class STextMarkerItem extends STextItem {
         super(parent);
         this.isTransform = false;
         this.zOrder = ItemOrder.textOrder;
+        this.isTransform = false;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

+ 1 - 0
src/lib/items/SZoneLegendItem.js

@@ -22,6 +22,7 @@ export class SZoneLegendItem extends SPolygonItem {
         this._showText = true;
         /** 是否蒙版遮罩  */
         this._maskFlag = false;
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 17 - 9
src/lib/parsers/STopologyParser.js

@@ -6,7 +6,8 @@ import { SImageMarkerItem } from '../items/SImageMarkerItem';
 import { SLineMarkerItem } from '../items/SLineMarkerItem';
 import { STextMarkerItem } from '../items/STextMarkerItem';
 import { TipelineItem } from '../items/TipelineItem';
-import { ItemOrder } from "@saga-web/big";
+import { SSCPZZoneLegendItem } from '../items/SSCPZZoneLegendItem';
+import { SFHFQZoneLegendItem } from '../items/SFHFQZoneLegendItem';
 /**
  * 拓扑图信息解析器
  *
@@ -64,10 +65,21 @@ export class STopologyParser extends SParser {
             this.noneLegendList.push(item);
         }
         else if (t.GraphElementType == "Zone") {
-            let item = new SZoneLegendItem(null, t);
-            item.selectable = true;
-            item.zOrder == ItemOrder.polygonOrder;
-            this.zoneLegendList.push(item);
+            if (t.SubType == "SCPZ") {
+                let item = new SSCPZZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
+            else if (t.SubType == "FHFQ") {
+                let item = new SFHFQZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
+            else {
+                let item = new SZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
         }
         else if (t.GraphElementType == 'Image') {
             let item = new SImageLegendItem(null, t);
@@ -85,18 +97,15 @@ export class STopologyParser extends SParser {
             let item = new SImageMarkerItem(null, t);
             this.imageMarkerList.push(item);
             item.selectable = true;
-            item.zOrder = ItemOrder.imageOrder;
         }
         else if (t.Type == "Line") {
             let item = new SLineMarkerItem(null, t);
             item.selectable = true;
-            item.zOrder = ItemOrder.lineOrder;
             this.lineMarkerList.push(item);
         }
         else if (t.Type == "Text") {
             let item = new STextMarkerItem(null, t);
             item.selectable = true;
-            item.zOrder = ItemOrder.lineOrder;
             this.textMarkerList.push(item);
         }
     } // Function addMarker()
@@ -108,7 +117,6 @@ export class STopologyParser extends SParser {
     addRelation(t) {
         let item = new TipelineItem(null, t);
         item.selectable = true;
-        item.zOrder == ItemOrder.polylineOrder;
         this.relationList.push(item);
     } // Function addRelation()
 } // class STopologyParser

+ 15 - 8
src/lib/parsers/STopologyParser.ts

@@ -15,6 +15,8 @@ import { STextMarkerItem } from '../items/STextMarkerItem';
 import { TipelineItem } from '../items/TipelineItem';
 import { ItemOrder } from "@saga-web/big";
 import { SItemStatus } from "@saga-web/big";
+import { SSCPZZoneLegendItem } from '../items/SSCPZZoneLegendItem';
+import { SFHFQZoneLegendItem } from '../items/SFHFQZoneLegendItem';
 /**
  * 拓扑图信息解析器
  *
@@ -72,10 +74,19 @@ export class STopologyParser extends SParser {
             let item = new SNoneLegendItem(null, t);
             this.noneLegendList.push(item);
         } else if (t.GraphElementType == "Zone") {
-            let item = new SZoneLegendItem(null, t);
-            item.selectable = true;
-            item.zOrder == ItemOrder.polygonOrder;
-            this.zoneLegendList.push(item);
+            if (t.SubType == "SCPZ") {
+                let item = new SSCPZZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            } else if (t.SubType == "FHFQ") {
+                let item = new SFHFQZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            } else {
+                let item = new SZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
         } else if (t.GraphElementType == 'Image') {
             let item = new SImageLegendItem(null, t);
             item.selectable = true;
@@ -93,16 +104,13 @@ export class STopologyParser extends SParser {
             let item = new SImageMarkerItem(null, t);
             this.imageMarkerList.push(item);
             item.selectable = true;
-            item.zOrder = ItemOrder.imageOrder;
         } else if (t.Type == "Line") {
             let item = new SLineMarkerItem(null, t);
             item.selectable = true;
-            item.zOrder = ItemOrder.lineOrder;
             this.lineMarkerList.push(item);
         } else if (t.Type == "Text") {
             let item = new STextMarkerItem(null, t);
             item.selectable = true;
-            item.zOrder = ItemOrder.lineOrder;
             this.textMarkerList.push(item);
         }
     } // Function addMarker()
@@ -115,7 +123,6 @@ export class STopologyParser extends SParser {
     private addRelation(t: Relation): void {
         let item = new TipelineItem(null, t);
         item.selectable = true;
-        item.zOrder == ItemOrder.polylineOrder;
         this.relationList.push(item);
     } // Function addRelation()
 } // class STopologyParser

+ 3 - 2
src/lib/types/Legend.ts

@@ -23,6 +23,7 @@ import { Anchor } from "./Anchor";
 import { SGraphElementType } from "./../enums/SGraphElementType";
 import { Point } from "@saga-web/big/lib/types/Point";
 import { Size } from "@saga-web/big/lib/types/Size";
+import { SPoint } from '@saga-web/draw/lib';
 
 /**
  * 图例节点接口
@@ -37,7 +38,7 @@ export interface Legend {
     /** 返回工程信息化对象 ID 列表 */
     AttachObjectIds?: string[];
     /** 图标,区域类型  */
-    GraphElementType: SGraphElementType;
+    GraphElementType: string;
     /** 对应的图例ID  */
     GraphElementId: string;
     /** 图例数量  */
@@ -55,7 +56,7 @@ export interface Legend {
     /** 锚点List  */
     AnchorList?: Anchor[];
     /** 轮廓线  */
-    OutLine?: Point[];
+    OutLine?: Point[] | SPoint[];
     /** 由应用自己定义  */
     Properties?: any;
      /** zone 区分防火分区和石材铺装  */

+ 1 - 1
src/lib/types/Relation.ts

@@ -47,7 +47,7 @@ export interface Relation {
     /** 方向(0:无向,1:节点1到节点2,2:节点2到节点1) */
     Dir?: SRelationDir;
     /** 线类型(0:直线,1:水平/垂直线,2:曲线) */
-    LineType: SLineType;
+    LineType: string;
     /** 线的顶点坐标 */
     PointList: Point[];
     /** 线的绘图样式 */

+ 28 - 23
src/store/index.js

@@ -1,37 +1,39 @@
-import Vue from "vue"
-import Vuex from "vuex"
-import { login, queryFloor, queryfmapID } from "@/api/login.js"
-import { queryBrand } from "@/api/public.js"
-import axios from "axios"
+import Vue from 'vue'
+import Vuex from 'vuex'
+import { login, queryFloor, queryfmapID } from '@/api/login.js'
+import { queryBrand } from '@/api/public.js'
+import axios from 'axios'
 
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
-        ssoToken: "admin:lengqiang",
+        ssoToken: 'admin:lengqiang',
         // ssoToken: null,
-        lastRoute: "",
+        isPreview: false,
+        lastRoute: '',
         isrequestAuth: true, // 是否请求登录校验接口
         permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
         plazas: [], //项目列表
         userInfo: {
-            employeename: "", //用户名称:艾宇;
-            orgCode: "",
-            username: "lengqiang", //账户名称
+            employeename: '', //用户名称:艾宇;
+            orgCode: '',
+            username: 'lengqiang', //账户名称
         },
-        plazaId: "1000423", //项目Id
-        projectName: "", //全局项目名称
+        plazaId: '1000423', //项目Id
+        projectName: '', //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
-        fmapID: "",
+        fmapID: '',
         haveFengMap: false, //是否有蜂鸟地图的数据
         isMessage: true, //是否有发布的图
         scpzTable: [], //土建系统图例展示
         legendTable: [], //除土建系统图例展示
-        remarksText: "", //备注
+        remarksText: '', //备注
         bunkObj: {}, // 铺位名称
         currentFloor: {}, //当前选中的楼层信息
     },
     getters: {
+        isPreview: (state) => state.isPreview,
         ssoToken: (state) => state.ssoToken,
         lastRoute: (state) => state.lastRoute,
         floorsArr: (state) => state.floorsArr,
@@ -47,6 +49,9 @@ export default new Vuex.Store({
         bunkObj: (state) => state.bunkObj,
     },
     mutations: {
+        SETISPREVIEW(state, data) {
+            state.isPreview = data
+        },
         SETSSOTOKEN(state, data) {
             state.ssoToken = data
         },
@@ -107,19 +112,19 @@ export default new Vuex.Store({
         // 获取项目列表、userId
         async getUserInfo({ commit }, palyload) {
             await login({ username: palyload }).then((res) => {
-                if (res.result == "success") {
-                    commit("SETISREQUESTtAUTH", true)
-                    commit("SETAUTHMSG", res)
+                if (res.result == 'success') {
+                    commit('SETISREQUESTtAUTH', true)
+                    commit('SETAUTHMSG', res)
                 } else {
-                    console.log("接口报错!!")
-                    commit("SETISREQUESTtAUTH", false)
+                    console.log('接口报错!!')
+                    commit('SETISREQUESTtAUTH', false)
                 }
             })
         },
         getFloors(context) {
             queryFloor({ plazaId: context.state.plazaId }).then((res) => {
-                if (res.result == "success") {
-                    context.commit("SETFLOORS", res.data)
+                if (res.result == 'success') {
+                    context.commit('SETFLOORS', res.data)
                 }
             })
         },
@@ -127,7 +132,7 @@ export default new Vuex.Store({
             await queryfmapID({
                 mapId: context.state.plazaId,
             }).then((res) => {
-                context.commit("SETMAPID", `${context.state.plazaId}_${res.mapVersion}`)
+                context.commit('SETMAPID', `${context.state.plazaId}_${res.mapVersion}`)
             })
         },
         async getBrand(context) {
@@ -142,7 +147,7 @@ export default new Vuex.Store({
                         obj[i.bunkdesc] = i
                     })
                 }
-                context.commit("SETBUNKOBJ", obj)
+                context.commit('SETBUNKOBJ', obj)
             })
         },
     },

+ 75 - 48
src/views/legendLibrary/addForm.vue

@@ -10,8 +10,8 @@
                     </el-col>
                     <el-col :span='12'>
                         <div class='start'>图例名称</div>
-                        <!-- <el-input v-model='ruleForm.Name' style='width:200px;height:32px;'></el-input> -->
-                        <Input v-model='ruleForm.Name' placeholder maxlength='20' style='width:200px' />
+                        <el-input v-model='ruleForm.Name' class='reset-input-name' oninput='if(value.length>20)value=value.slice(0,20)'></el-input>
+                        <!-- <Input v-model='ruleForm.Name' placeholder style='width:200px;' @input='if(value.length>11)value=value.slice(0,11)' /> -->
                     </el-col>
                     <el-col :span='12' style='margin-top:20px'>
                         <div class>单位</div>
@@ -41,7 +41,7 @@
             </div>
             <div v-show='ruleForm.Type=="Zone" || ruleForm.Type=="Image" || ruleForm.Type =="Line"'>
                 <div style='color:#646C73'>展示预览</div>
-                <div class='input-right' ref='graph' style="width:200px;height:114px;">
+                <div class='input-right' ref='graph' style='width:200px;height:114px;'>
                     <canvas id='canvas' :width='canvasWidth' :height='canvasHeight'></canvas>
                 </div>
             </div>
@@ -109,7 +109,7 @@
                         tipPlace='top'
                         width='200'
                         style=' margin-right:48px;'
-                        :returnParentNode='true'
+                        :returnParentNode='false'
                         :isShowAllChoice='true'
                         :choseArea='true'
                         :data='deviceList'
@@ -149,6 +149,7 @@ import { GraphView } from '@/lib/GraphView'
 export default {
     data() {
         return {
+            maxlength: 20,
             options: [
                 {
                     id: 'None',
@@ -277,7 +278,6 @@ export default {
             let postParams = {
                 Content: [this.ruleForm]
             }
-
             updateLegend({ postParams }).then(res => {
                 if (res.Result == 'success') {
                     this.$message.success('图例修改成功!')
@@ -392,30 +392,43 @@ export default {
         // 把canvas图保存到图片服务器
         saveImg() {
             let vm = this
-            if (this.view) {
-                let data = this.view.canvasView.toDataURL('image/png')
-                var formData = new FormData()
-                if (this.ruleForm.Type == 'Zone' || this.ruleForm.Type == 'Line') {
-                    formData.append('file', this.base64ToFile(data))
-                } else {
-                    formData.append('file', this.file)
+            if (!this.file && this.ruleForm.Type == 'Image') {
+                //修改图片的时候没有重新上传图片
+                if (this.title == '添加图例库') {
+                    this.create()
+                    this.$emit('addSuccess')
+                    this.view.canvas.clearRect(0, 0, this.width, this.height)
+                } else if (this.title == '修改图例库') {
+                    this.update()
+                    this.$emit('updateSuccess')
+                    this.view.canvas.clearRect(0, 0, this.width, this.height)
                 }
-                let postParams = formData
-                uploadImg({ postParams }).then(res => {
-                    if (res.Result == 'success') {
-                        this.$set(vm.ruleForm, 'Url', res.EntityList[0])
-                        this.$message.success('图标上传成功!')
-                        if (this.title == '添加图例库') {
-                            this.create()
-                            this.$emit('addSuccess')
-                            this.view.canvas.clearRect(0, 0, this.width, this.height)
-                        } else if (this.title == '修改图例库') {
-                            this.update()
-                            this.$emit('updateSuccess')
-                            this.view.canvas.clearRect(0, 0, this.width, this.height)
-                        }
+            } else {
+                if (this.view) {
+                    let data = this.view.canvasView.toDataURL('image/png')
+                    var formData = new FormData()
+                    if (this.ruleForm.Type == 'Zone' || this.ruleForm.Type == 'Line') {
+                        formData.append('file', this.base64ToFile(data))
+                    } else {
+                        formData.append('file', this.file)
                     }
-                })
+                    let postParams = formData
+                    uploadImg({ postParams }).then(res => {
+                        if (res.Result == 'success') {
+                            this.$set(vm.ruleForm, 'Url', res.EntityList[0])
+                            this.$message.success('图标上传成功!')
+                            if (this.title == '添加图例库') {
+                                this.create()
+                                this.$emit('addSuccess')
+                                this.view.canvas.clearRect(0, 0, this.width, this.height)
+                            } else if (this.title == '修改图例库') {
+                                this.update()
+                                this.$emit('updateSuccess')
+                                this.view.canvas.clearRect(0, 0, this.width, this.height)
+                            }
+                        }
+                    })
+                }
             }
         },
         // 铺位可视化
@@ -426,27 +439,33 @@ export default {
 
         //位置/设备
         treeConfirmDevice(id, info) {
-            console.log(id)
-            // this.$set(this.ruleForm, 'InfoLocal', data)
-            let InfoSystem = []
-            let InfoLocal = []
-            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)
+            let InfoSystem = [],
+                InfoSystems = [],
+                InfoLocal = []
+            this.deviceList.forEach(i => {
+                i.children.length > 0 &&
+                    i.children.forEach(j => {
+                        if (id.includes(j.id)) {
+                            InfoSystems.push(i)
+                        }
+                    })
+            })
+            InfoSystem = JSON.parse(JSON.stringify(InfoSystems))
+                .reduce((prev, element) => {
+                    if (!prev.find(el => el.id == element.id)) {
+                        prev.push(element)
                     }
-                }
-            } else {
-                this.$set(this.ruleForm, 'InfoLocal', [])
-                this.$set(this.ruleForm, 'InfoSystem', [])
-            }
+                    return prev
+                }, [])
+                .map(i => {
+                    if (i.children.length) {
+                        delete i.children
+                    }
+                    return i
+                })
+            InfoLocal = info
+            this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
+            this.$set(this.ruleForm, 'InfoSystem', InfoSystem)
         },
         focusChange(status) {
             // //console.log('focusChange', status)
@@ -522,6 +541,14 @@ export default {
     .ant-input-number {
         border-radius: 4px 0 0 4px;
     }
+    .reset-input-name {
+        /deep/ .el-input__inner {
+            width: 200px;
+            height: 32px;
+            line-height: 32px;
+            // border: 1px solid #c3c7cb;
+        }
+    }
     // .add-form-type {
     //     /deep/ .p-select .p-select-header {
     //         height: 40px;
@@ -663,7 +690,7 @@ export default {
     width: 245px !important;
 }
 .p-select-area .p-transfer-right .p-transfer-selected .p-transfer-selected-item {
-    height: 25px;
+    height: 30px !important;
 }
 .p-select-area .p-transfer-right .p-transfer-selected .p-transfer-selected-item > span {
     word-break: break-all !important;

+ 110 - 57
src/views/legendLibrary/index.vue

@@ -29,20 +29,21 @@
                     @change='getTableList'
                     :hideClear='true'
                 ></Select>
-
-                <TreeSelect
-                    title='已选项'
-                    caption='说明书位置:'
-                    tipPlace='top'
-                    width='200'
-                    style='margin:0 0 0 12px'
-                    :returnParentNode='false'
-                    :isShowAllChoice='true'
-                    :choseArea='true'
-                    :lastStage='true'
-                    :data='positionSelect'
-                    @change='treeConfirmPosition'
-                />
+                <span class='instructions'>
+                    <TreeSelect
+                        title='已选项'
+                        caption='说明书位置:'
+                        tipPlace='top'
+                        width='220'
+                        style='margin:0 0 0 12px'
+                        :returnParentNode='false'
+                        :isShowAllChoice='true'
+                        :choseArea='true'
+                        :lastStage='true'
+                        :data='positionSelect'
+                        @change='treeConfirmPosition'
+                    />
+                </span>
                 <span class='device-position'>
                     <TreeSelect
                         caption='专业/设备、位置类型:'
@@ -50,7 +51,7 @@
                         width='280'
                         style='margin:0 12px'
                         :isShowAllChoice='true'
-                        :returnParentNode='true'
+                        :returnParentNode='false'
                         :choseArea='true'
                         :data='deviceList'
                         :lastStage='true'
@@ -70,19 +71,20 @@
                     @change='treeConfirmMajor'
                     :hideClear='true'
                 />-->
-
-                <TreeSelect
-                    caption='铺位可视化:'
-                    tipPlace='top'
-                    width='250'
-                    :returnParentNode='false'
-                    :isShowAllChoice='true'
-                    :choseArea='true'
-                    :data='typeVisualization'
-                    @change='treeConfirm'
-                    :lastStage='true'
-                    @focusChange='focusChange'
-                />
+                <span class='visualization'>
+                    <TreeSelect
+                        caption='铺位可视化:'
+                        tipPlace='top'
+                        width='250'
+                        :returnParentNode='false'
+                        :isShowAllChoice='true'
+                        :choseArea='true'
+                        :data='typeVisualization'
+                        @change='treeConfirm'
+                        :lastStage='true'
+                        @focusChange='focusChange'
+                    />
+                </span>
                 <Select
                     width='150'
                     tipPlace='top'
@@ -105,12 +107,15 @@
                 ></el-input>
             </div>
             <el-table :data='tableData' v-loading='loading' :key='key' :border='true' style='width: 100%'>
+                <el-table-column prop='Name' label='图例编码' width='180'>
+                    <template slot-scope='{row}'>{{row.Id }}</template>
+                </el-table-column>
                 <el-table-column prop='Name' label='图例名称' width='180'>
                     <template slot-scope='{row}'>{{row.Name }}</template>
                 </el-table-column>
                 <el-table-column prop='style' label='图例样式' width='150'>
                     <template slot-scope='{row}'>
-                        <img :class='`${row.Type!="Image"?"img1":"img"}`' :src='`/serve/topology-wanda/Picture/query/${row.Url}`' alt />
+                        <img :class='`${row.Type=="Zone"?"img1":"img"}`' :src='`/serve/topology-wanda/Picture/query/${row.Url}`' alt />
                     </template>
                 </el-table-column>
                 <el-table-column prop='Unit' label='单位' width='120'>
@@ -118,24 +123,24 @@
                 </el-table-column>
                 <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>
+                        <span>{{ row.GraphCategorys.length?row.GraphCategorys.map(item => item.Name).join(' ,'):'' }}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label='对应工程信息化' align='center'>
-                    <el-table-column prop='type' label='位置/设备分类' 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 width='120'>
+
+                <el-table-column label='对应工程信息化中的专业/位置、设备分类' show-overflow-tooltip>
+                    <template slot-scope='{row}'>
+                        <span>{{row.InfoLocal.length?row.InfoLocal.map(item => item.name).join(' ,') :''}}</span>
+                    </template>
+                </el-table-column>
+                <!-- <el-table-column prop='system' label='专业' show-overflow-tooltip width='120'>
                         <template slot-scope='{row}'>
-                            <span v-for='(item,index) in row.InfoSystems ' :key='index'>{{item.Name}}</span>
+                            <span>{{row.InfoSystem.length ?row.InfoSystem.map(item => item.Name).join(' ,') :''}}</span>
                         </template>
-                    </el-table-column>
-                </el-table-column>
+                </el-table-column>-->
+
                 <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>
+                        <span>{{row.InfoTypes.length ?row.InfoTypes.map(item => item.Name).join(' ,'):'' }}</span>
                     </template>
                 </el-table-column>
                 <el-table-column label='操作' width='100' v-if='state==1'>
@@ -272,6 +277,15 @@ export default {
             InfoTypeIds: [] //铺位可视化typeid
         }
     },
+    filters: {
+        filterName(val, index, arr) {
+            if (arr.length != 1) {
+                return val + ','
+            } else {
+                return val
+            }
+        }
+    },
     watch: {
         selVal(n, o) {
             if (n === o) return
@@ -418,6 +432,25 @@ export default {
                 this.total = res.Total
             })
         },
+        transformDate(arr) {
+            arr.map(({ GraphCategorys, InfoLocal, InfoSystems, InfoTypes }) => {
+                if (GraphCategorys.length) {
+                    GraphCategorys.map(i => i)
+                }
+                if (InfoLocal.length) {
+                    GraphCategorys.map(i => {
+                        i.name
+                    })
+                }
+                if (InfoSystems.length) {
+                    GraphCategorys.map()
+                }
+                if (InfoTypes.length) {
+                    GraphCategorys.map()
+                }
+            })
+            return arr
+        },
         getTableList() {
             // if (this.GraphCategoryIds || this.InfoLocals || this.InfoSystems || this.keyword) {
             //     this.currentPage = 1
@@ -467,21 +500,19 @@ export default {
         // },
         //位置/设备
         treeConfirmDevice(id, info) {
+            let InfoSystem = []
             this.InfoSystems = []
             this.InfoLocals = []
-            if (info) {
-                for (let i = 0; i < info.length; i++) {
-                    let type = info[i]
-                    if (type.name.includes('/')) {
-                        this.InfoLocals.push(type.id)
-                    } else {
-                        this.InfoSystems.push(type.id)
-                    }
-                }
-            } else {
-                this.InfoSystems = []
-                this.InfoLocals = []
-            }
+            this.deviceList.forEach(i => {
+                i.children.length > 0 &&
+                    i.children.forEach(j => {
+                        if (id.includes(j.id)) {
+                            InfoSystem.push(i.id)
+                        }
+                    })
+            })
+            this.InfoSystems = [...new Set(JSON.parse(JSON.stringify(InfoSystem)))]
+            this.InfoLocals = id
             this.getTableList()
         },
         //说明书位置
@@ -573,7 +604,8 @@ export default {
             height: 28px;
         }
         .img1 {
-            width: 44px;
+            width: 32px;
+            height: 18px;
         }
     }
     .foot {
@@ -586,9 +618,23 @@ export default {
         line-height: 32px;
     }
     .device-position {
-        /deep/ .p-date-picker-caption {
+        /deep/ .p-select-input-caption {
             display: block;
-            width: 200px !important;
+            width: 250px !important;
+            max-width: 250px !important;
+        }
+    }
+    .instructions {
+        /deep/ .p-select-input-caption {
+            display: block;
+            width: 100px !important;
+            max-width: 200px !important;
+        }
+    }
+    .visualization {
+        /deep/ .p-select-input-caption {
+            display: block;
+            width: 100px !important;
             max-width: 200px !important;
         }
     }
@@ -614,4 +660,11 @@ export default {
     background: #fff;
     border: 1px solid #ccc;
 }
+.p-tree-node-check,
+.p-tree-node-check .p-tree-node-title {
+    vertical-align: top !important;
+}
+.p-checkbox .p-checkbox-box {
+    top: 4px !important;
+}
 </style>

+ 13 - 8
src/views/legendRules/index.vue

@@ -12,11 +12,10 @@
             </Dropdown>
         </div>-->
         <div class='legend-rules-top'>
-            <div style='float: left; margin-top: 4px;
-                    padding-left: 20px;   display: inline-block;'>
-                <i class='el-icon-arrow-left' @click='goBack' style='cursor: pointer; font-size: 25px;'></i>
+            <div style='float: left;  padding-left: 20px;  padding-right:7px; display: inline-block;'>
+                <img src='@/assets/imgs/go-back.png' @click='goBack' alt style='cursor: pointer;' />
             </div>
-            <span style='float: left;display: inline-block;font-size:14px'>返回</span>
+            <span style='float: left;display: inline-block;font-size:14px;padding-top: 2px;color:#1F2429'>返回</span>
             图例绘制规则
             <el-button type='primary' class='rules-button' size='small' @click='add'>添加图例</el-button>
         </div>
@@ -57,11 +56,12 @@
                     :head='headList2'
                     :source='tableData'
                     :toolButtons='toolBtns'
-                    :selectWidth='180'
+                    :selectWidth='200'
                     height='100%'
                     @tool-button-click='buttonClickHandle'
                 >
                     <img slot-scope='{col, row}' v-if='col.key==="Url"' class='img' :src='`/serve/topology-wanda/Picture/query/${row.Url}`' alt />
+                    <span slot-scope='{col, row}' v-else-if='col.key==="caozuo"' style='color:#0091FF'>删除</span>
                 </Table>
             </div>
         </div>
@@ -99,20 +99,25 @@ export default {
                     title: '单位',
                     key: 'Unit',
                     show: true
+                },
+                {
+                    title: '操作',
+                    key: 'caozuo',
+                    show: true
                 }
             ],
             // 操作按钮组 (非必填)
             toolBtns: [
                 {
-                    icon: 'copy',
+                    icon: 'ascendingOrder',
                     name: '上移'
                 },
                 {
-                    icon: 'print',
+                    icon: 'descendingOrder',
                     name: '下移'
                 },
                 {
-                    icon: 'pending',
+                    icon: 'close',
                     name: '删除'
                 }
             ],

+ 15 - 0
src/views/overview/index.vue

@@ -184,6 +184,7 @@
 <script>
 import PicModal from './picModal'
 import { queryFact } from '@/api/overview'
+import { mapGetters } from 'vuex'
 export default {
     data() {
         return {
@@ -235,8 +236,22 @@ export default {
         }
     },
     mounted() {
+        //预览是否开启
+        // let previewUrl = location.href.split('?')[1]
+        // if (previewUrl) {
+        //     previewUrl = Boolean(previewUrl.split('=')[1])
+        //     this.$store.commit('SETISPREVIEW', previewUrl)
+        // }
+        let previewUrl = location.href.split('=')[1] ? location.href.split('=')[1].split('&')[0] : false,
+            plazaId = location.href.split('=')[2] ? location.href.split('=')[2] : '1000423'
+        console.log('previewUrl:', previewUrl)
+        console.log('plazaId:', plazaId)
+        this.$store.commit('SETISPREVIEW', previewUrl)
         this.query()
     },
+    computed: {
+        ...mapGetters(['isPreview'])
+    },
     components: {
         PicModal
     }