Browse Source

添加三通四通

YaolongHan 4 years ago
parent
commit
1460bccba4

+ 13 - 5
package.json

@@ -1,11 +1,18 @@
 {
   "name": "persagy_topo_editer",
-  "version": "0.1.0",
-  "private": true,
+  "version": "0.1.4",
+  "remote": {
+    "host": "39.102.40.239",
+    "path": "/opt/apps/web",
+    "user": "root",
+    "password": "persagy@2020",
+    "local": "persagyTopo"
+  },
   "scripts": {
     "serve": "vue-cli-service serve",
     "build": "vue-cli-service build",
-    "lint": "vue-cli-service lint"
+    "lint": "vue-cli-service lint",
+    "publish": "node publish.js"
   },
   "dependencies": {
     "@persagy-web/base": "2.2.1",
@@ -42,6 +49,7 @@
     "less-loader": "^5.0.0",
     "polybooljs": "^1.2.0",
     "typescript": "~3.9.3",
-    "vue-template-compiler": "^2.6.11"
+    "vue-template-compiler": "^2.6.11",
+    "node-ssh": "^6.0.0"
   }
-}
+}

+ 52 - 0
publish.js

@@ -0,0 +1,52 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+const Client = require("node-ssh");
+const ssh = new Client();
+
+ssh.connect({
+    host: process.env.npm_package_remote_host,
+    port: "22",
+    username: process.env.npm_package_remote_user,
+    password: process.env.npm_package_remote_password
+}).then(() => {
+    const failedList = [];
+    ssh.putDirectory(
+        process.env.npm_package_remote_local,
+        process.env.npm_package_remote_path,
+        {
+            recursive: true,
+            concurrency: 1,
+            tick: function(localPath, remotePath, error) {
+                if (error) {
+                    failedList.push(localPath);
+                }
+            }
+        }
+    ).then(status => {
+        if (failedList.length > 0) {
+            console.log("发布失败");
+            console.log("failed transfers", failedList.join(", "));
+        } else {
+            console.log(status ? "发布成功" : "发布失败");
+        }
+        ssh.dispose();
+    });
+});

+ 2 - 1
src/components/editClass/big-edit/index.ts

@@ -1,5 +1,6 @@
 import { SBaseEditScene } from "./SBaseEditScene"
 import { SBaseExpainEdit } from "./items/SBaseExpainEdit"
+import { SBasePipeUninTool } from "./items/SBasePipeUninTool"
 import { Anchor } from "./types/Anchor"
 import { ElementData } from "./types/ElementData"
 import { Legend } from "./types/Legend"
@@ -7,4 +8,4 @@ import { Marker } from "./types/Marker"
 import { Relation } from "./types/Relation"
 import { BigEditFactory } from "./BigEditFactory"
 import { SBaseEquipment } from "./items/SBaseEquipment"
-export { SBaseEquipment, BigEditFactory, Anchor, Legend, Marker, Relation, ElementData, SBaseEditScene, SBaseExpainEdit }
+export { SBasePipeUninTool,SBaseEquipment, BigEditFactory, Anchor, Legend, Marker, Relation, ElementData, SBaseEditScene, SBaseExpainEdit }

+ 80 - 0
src/components/editClass/big-edit/items/SBasePipeUninTool.ts

@@ -0,0 +1,80 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+import { SColor, SFont } from "@persagy-web/draw/";
+import { SBaseImageEdit } from './../../edit';
+import { SGraphItem } from "@persagy-web/graph";
+import { Marker } from "./../types/Marker";
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { ItemOrder } from '@persagy-web/big/lib';
+
+/**
+ * 编辑基础管道接头类
+ *
+ * * @author  韩耀龙(han_yao_long#163.com)
+ */
+
+export class SBasePipeUninTool extends SBaseImageEdit {
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //属性
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent, data);
+        if (data && data.style) {
+            switch (data.style.uninToolType) {
+                case 2:
+                    this.url = require('./../../../../assets/images/leftImgs/wantou.png');
+                    break
+                case 3:
+                    this.url = require('./../../../../assets/images/leftImgs/santong.png');
+                    break
+                case 4:
+                    this.url = require('./../../../../assets/images/leftImgs/sitong.png');
+                    break
+                default:
+                    this.url = require('./../../../../assets/images/leftImgs/wantou.png');
+                    break
+            }
+        }
+    }
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
+
+    /**
+    * 返回对象储存的相关数据
+    *
+    * @return	formData
+    */
+    toData(): any {
+        return super.toData()
+    }
+}

+ 5 - 4
src/components/editClass/edit/index.ts

@@ -29,10 +29,11 @@ import { SBaseArrowEdit } from "./items/SBaseArrowEdit";
 import { SBaseLineEdit } from "./items/SBaseLineEdit";
 import { SBaseImageEdit } from "./items/SBaseImageEdit";
 import { SBasePolygonEdit } from "./items/SBasePolygonEdit";
-import { SBaseRectEdit } from "./items/SBaseRectEdit"
+import { SBaseRectEdit } from "./items/SBaseRectEdit";
 import { SBaseCircleEdit } from "./items/SBaseCircleEdit";
-import { SBaseTriangleEdit } from "./items/SBaseTriangleEdit"
-import { SBaseTextEdit } from "./items/SBaseTextEdit"
+import { SBaseTriangleEdit } from "./items/SBaseTriangleEdit";
+import { SBaseIconTextEdit } from "./items/SBaseIconTextEdit";
+import { SBaseTextEdit } from "./items/SBaseTextEdit" ;
 import { SGraphCommand } from "./commands/SGraphCommand";
 import { SGraphAddCommand } from "./commands/SGraphAddCommand";
 import { SGraphMoveCommand } from "./commands/SGraphMoveCommand";
@@ -40,4 +41,4 @@ import { SGraphPointListDelete } from "./commands/SGraphPointListDelete";
 import { SGraphPointListInsert } from "./commands/SGraphPointListInsert";
 import { SGraphPointListUpdate } from "./commands/SGraphPointListUpdate";
 import { SGraphPropertyCommand } from "./commands/SGraphPropertyCommand";
-export { SBasePolygonEdit, SBaseTextEdit, SBaseImageEdit, SBaseLineEdit, SBaseCircleEdit, SBaseTriangleEdit, SBaseRectEdit, SBaseArrowEdit, SGraphEditScene, SGraphEdit, SGraphCommand, SGraphAddCommand, SGraphMoveCommand, SGraphPointListDelete, SGraphPointListInsert, SGraphPointListUpdate, SGraphPropertyCommand }
+export { SBaseIconTextEdit, SBasePolygonEdit, SBaseTextEdit, SBaseImageEdit, SBaseLineEdit, SBaseCircleEdit, SBaseTriangleEdit, SBaseRectEdit, SBaseArrowEdit, SGraphEditScene, SGraphEdit, SGraphCommand, SGraphAddCommand, SGraphMoveCommand, SGraphPointListDelete, SGraphPointListInsert, SGraphPointListUpdate, SGraphPropertyCommand }

+ 412 - 0
src/components/editClass/edit/items/SBaseIconTextEdit.ts

@@ -0,0 +1,412 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import {
+    SObjectItem,
+    SImageItem,
+    STextItem,
+    SAnchorItem,
+    SGraphItem,
+
+} from "@persagy-web/graph";
+import { SItemStatus, ItemOrder, } from "@persagy-web/big";
+import { Anchor } from "@persagy-web/big/lib/types/topology/Anchor";
+import { SMouseEvent } from "@persagy-web/base";
+import {
+    SSize,
+    SRect,
+    SPainter,
+    SColor,
+    SFont,
+    SPoint
+
+} from "@persagy-web/draw";
+import { SGraphEdit } from "..";
+import { Marker } from "../type/Marker";
+
+/**
+ * 图例item  icon
+ *
+ * */
+export class SBaseIconTextEdit extends SGraphEdit {
+    /** item状态 */
+    _status: SItemStatus = SItemStatus.Normal;
+    get status(): SItemStatus {
+        return this._status;
+    }
+    set status(v: SItemStatus) {
+        this._status = v;
+        if (v == SItemStatus.Normal) {
+            this.moveable = true;
+            this.textItem.moveable = false;
+            this.img.moveable = false;
+        } else if (v == SItemStatus.Edit) {
+            this.moveable = false;
+            this.textItem.moveable = true;
+            this.img.moveable = true;
+        } else if (v == SItemStatus.Create) {
+            this.moveable = true;
+            this.textItem.moveable = false;
+            this.img.moveable = false;
+        }
+        this.update();
+    }
+
+    /** 锚点list  */
+    anchorList: SAnchorItem[] = [];
+
+    /** 是否显示文字 */
+    _showText: boolean = true;
+    get showText(): boolean {
+        return this._showText;
+    }
+    set showText(v: boolean) {
+        if (v === this._showText) {
+            return;
+        }
+        this._showText = v;
+        if (v) {
+            this.textItem.show();
+        } else {
+            this.textItem.hide();
+        }
+    }
+
+    /** 是否被选中 */
+    get selected(): boolean {
+        return this._selected && this.selectable && this.enabled;
+    } // Get selected
+    set selected(value: boolean) {
+        // 如果选择状态未变更
+        if (this.selected == value) {
+            return;
+        }
+        this._selected = value;
+        if (value) {
+            this.img.scale = 1.25;
+            this.zOrder = ItemOrder.highLightOrder;
+        } else {
+            this.img.scale = 1;
+            this.zOrder = ItemOrder.markOrder;
+        }
+        this.update();
+    } // Set selected
+
+    /** 是否激活 */
+    _isActive: boolean = false;
+    get isActive(): boolean {
+        return this._isActive;
+    } // Get isActive
+    set isActive(v: boolean) {
+        this._isActive = v;
+        if (v) {
+            this.cursor = "pointer";
+            this.textItem.cursor = "pointer";
+            this.img.cursor = "pointer";
+        } else {
+            this.cursor = "auto";
+            this.textItem.cursor = "auto";
+            this.img.cursor = "auto";
+        }
+        this.update();
+    } // Set isActive
+
+    /** 激活显示颜色 */
+    _activeColor: SColor = new SColor("#00000033");
+    get activeColor(): SColor {
+        return this._activeColor;
+    } // Get activeColor
+    set activeColor(v: SColor) {
+        this._activeColor = v;
+        this.update();
+    } // Set activeColor
+
+    /** X轴坐标 */
+    get x(): number {
+        return this.pos.x;
+    } // Get x
+    set x(v: number) {
+        this.pos.x = v;
+        this.$emit("changePos");
+        this.update();
+    } // Set x
+    /** Y轴坐标 */
+    get y(): number {
+        return this.pos.y;
+    } // Get y
+    set y(v: number) {
+        this.pos.y = v;
+        this.$emit("changePos");
+        this.update();
+    } // Set y
+
+    /** icon宽 */
+    get sWidth(): number {
+        return this.img.width;
+    }
+    set sWidth(v: number) {
+        this.img.width = v;
+        this.img.origin = new SPoint(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
+        this.changeAnchorPoint();
+        this.update();
+    }
+
+    /** icon高 */
+    get sHeight(): number {
+        return this.img.height;
+    }
+    set sHeight(v: number) {
+        this.img.height = v;
+        this.img.origin = new SPoint(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
+        this.changeAnchorPoint();
+        this.update();
+    }
+
+    /** 是否显示锚点 */
+    private _showAnchor: boolean = false;
+    get showAnchor(): boolean {
+        return this._showAnchor;
+    }
+    set showAnchor(v: boolean) {
+        this._showAnchor = v;
+        this.anchorList.forEach(t => {
+            t.visible = v;
+        });
+    }
+    /** 文本内容 */
+    get text(): string {
+        return this.textItem.text;
+    }
+    set text(v: string) {
+        this.textItem.text = v;
+        this.update();
+    }
+    /** 文本颜色 */
+    get color(): SColor {
+        return this.textItem.color;
+    }
+    set color(v: SColor) {
+        this.textItem.color = v;
+        this.update();
+    }
+    /** 文本字体 */
+    get font(): SFont {
+        return this.textItem.font;
+    }
+    set font(v: SFont) {
+        this.textItem.font = v;
+        this.update();
+    }
+    /** img Item */
+    img: SImageItem = new SImageItem(this);
+
+    /** text item */
+    textItem: STextItem = new STextItem(this);
+
+    /**
+     * 构造体
+     *
+     * @param   parent  父类
+     * @param   data    锚点数据
+     * */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent);
+        this.img.width = 32;
+        this.img.height = 32;
+        this.img.origin = new SPoint(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
+        this.img.connect("onMove", this, this.changeAnchorPoint.bind(this));
+        let anchorPoint: any = [];
+        if (data) {
+            anchorPoint = [
+                {
+                    x: data.pos.x,
+                    y: data.pos.y,
+                    id: '123'
+                }
+            ];
+            this.img.url = data.style.default.url
+        }
+        this.anchorList = anchorPoint.map(t => {
+            let item = new SAnchorItem(this);
+            if (t.id) {
+                item.id = t.id;
+            }
+            item.moveTo(t.x, t.y);
+            return item;
+        });
+        this.showAnchor = false;
+        this.textItem.text = "";
+        this.textItem.font.size = 12;
+        // 偏移二分之一文本高度
+        this.textItem.moveTo(
+            this.img.width * 0.5,
+            -(this.font.size * 1.25 * 0.5)
+        );
+        this.moveable = true;
+        this.selectable = true;
+    }
+
+    /**
+     * 计算并移动锚点的位置
+     *
+     * */
+    private changeAnchorPoint(): void {
+        // 判断是否有锚点
+        if (this.anchorList.length) {
+            let anchorPoint = [
+                { x: this.img.x, y: this.img.y },
+                { x: this.img.x, y: this.img.y },
+                { x: this.img.x, y: this.img.y },
+                { x: this.img.x, y: this.img.y }
+                // { x: this.img.x, y: this.img.y + this.img.height / 2 },
+                // { x: this.img.x, y: this.img.y - this.img.height / 2 },
+                // { x: this.img.x - this.img.width / 2, y: this.img.y },
+                // { x: this.img.x + this.img.width / 2, y: this.img.y }
+            ];
+            this.anchorList.forEach((item, index) => {
+                item.moveTo(anchorPoint[index].x, anchorPoint[index].y);
+            });
+        }
+    } // Function changeAnchorPoint()
+
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   事件对象
+     * @return  是否处理事件
+     * */
+    onMouseDown(event: SMouseEvent): boolean {
+        if (this.status == SItemStatus.Normal) {
+            return super.onMouseDown(event);
+        } else if (this.status == SItemStatus.Edit) {
+            return super.onMouseDown(event);
+        }
+        return true;
+    } // Function onMouseDown()
+
+    /**
+     * 宽高发发生变化
+     *
+     * @param   oldSize 改之前的大小
+     * @param   newSize 改之后大小
+     * */
+    onResize(oldSize: SSize, newSize: SSize) {
+        console.log(arguments);
+    } // Function onResize()
+
+    /**
+     * 鼠标双击事件
+     *
+     * @param   event   鼠标事件
+     * @return  是否处理事件
+     * */
+    onDoubleClick(event: SMouseEvent): boolean {
+        // 如果位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();
+        }
+        this.update();
+        return true;
+    } // Function onDoubleClick()
+
+    /**
+     * 宽高发生变化
+     *
+     * @return  SRect   所有子对象的并集
+     * */
+    boundingRect(): SRect {
+        let rect = this.img
+            .boundingRect()
+            .adjusted(this.img.pos.x, this.img.pos.y, 0, 0);
+        if (this.showText) {
+            rect = rect.unioned(
+                this.textItem
+                    .boundingRect()
+                    .adjusted(this.textItem.pos.x, this.textItem.pos.y, 0, 0)
+            );
+        }
+        return rect.adjusted(-5, -5, 10, 10);
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter painter对象
+     */
+    onDraw(painter: SPainter): void {
+        if (this.status == SItemStatus.Edit) {
+            painter.pen.lineWidth = painter.toPx(1);
+            painter.pen.lineDash = [painter.toPx(3), painter.toPx(7)];
+            painter.pen.color = SColor.Black;
+            painter.brush.color = SColor.Transparent;
+            painter.drawRect(this.boundingRect());
+        }
+        if (this.isActive) {
+            painter.pen.color = SColor.Transparent;
+            painter.brush.color = this.activeColor;
+            if (this.selected) {
+                painter.shadow.shadowBlur = 10;
+                painter.shadow.shadowColor = this.activeColor;
+                painter.shadow.shadowOffsetX = 5;
+                painter.shadow.shadowOffsetY = 5;
+                painter.drawCircle(
+                    this.img.x,
+                    this.img.y,
+                    (this.sWidth / 2.0 + 3) * 1.25
+                );
+            } else {
+                painter.drawCircle(
+                    this.img.x,
+                    this.img.y,
+                    this.sWidth / 2.0 + 3
+                );
+            }
+        } else {
+            if (this.selected) {
+                painter.pen.color = SColor.Transparent;
+                painter.brush.color = SColor.Transparent;
+                painter.shadow.shadowBlur = 10;
+                painter.shadow.shadowColor = new SColor(`#00000033`);
+                painter.shadow.shadowOffsetX = 5;
+                painter.shadow.shadowOffsetY = 5;
+                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
+            }
+        }
+    } // Function onDraw()
+} // Class SIconTextItem

+ 0 - 0
src/components/editClass/edit/items/icon.ts


+ 47 - 1
src/components/editClass/persagy-edit/PTopoScene.ts

@@ -1,4 +1,4 @@
-import { SBaseEditScene, SBaseExpainEdit, SBaseEquipment } from "./../big-edit";
+import { SBaseEditScene, SBaseExpainEdit, SBaseEquipment, SBasePipeUninTool } from "./../big-edit";
 import { SBaseRectEdit, SBaseLineEdit, SBaseTextEdit, SGraphEdit, SBaseArrowEdit, SBaseCircleEdit, SBaseTriangleEdit, SBasePolygonEdit } from "./../edit";
 import { SPersagyImageEdit } from "./"
 import { SMouseEvent } from "@persagy-web/base/lib";
@@ -78,6 +78,10 @@ export class PTopoScene extends SBaseEditScene {
             this.addArrowsItem(event)
             this.clearCmdStatus();
         }
+        else if (this.editCmd == "wantou" || this.editCmd == "santong" || this.editCmd == "sitong") {
+            this.addPipeUninTool(event, this.editCmd)
+            this.clearCmdStatus();
+        }
         // else if (this.editCmd == "EditEuqipment") {
         //     this.addEuqipment(event)
         //     this.clearCmdStatus();
@@ -439,6 +443,48 @@ export class PTopoScene extends SBaseEditScene {
         }
     }
     /**
+     * 添加基本管道联通器
+     *
+     */
+    addPipeUninTool(event: SMouseEvent, cmd: string): void {
+        const cmdList = {
+            'wantou': 2,
+            'santong': 3,
+            'sitong': 4,
+        }
+        const data = {
+            /** 名称  */
+            name: '基础管道接头',
+            /** 图标(Image),线类型(Line) */
+            type: "Image",
+            /** 位置  */
+            pos: { x: event.x, y: event.y },
+            /** 由应用自己定义  */
+            properties: {
+                type: "BasePipeUninTool",
+            },
+            style: {
+                uninToolType: cmdList[cmd] ? cmdList[cmd] : 2,  //2,3,4 分别分二头连接器、三头连接器、四头连接器
+                default: {
+                    strokecolor: "#c0ccda",
+                }
+            }
+        }
+        const item = new SBasePipeUninTool(null, data);
+        item.status = SItemStatus.Create;
+        item.selectable = true;
+        item.moveable = true;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        this.grabItem = item;
+        item.connect("finishCreated", this, this.finishCreated);
+        item.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    }
+
+    /**
      * 修改 item 样式,数据等方法
      * @param styletype string 修改样式类型
      * @param changeStyle 更改样式数据

+ 1 - 1
src/components/editview/leftToolBar/data.js

@@ -61,7 +61,7 @@ export const baseEditItems = [{
             title: '联通方式',
             itemList: [{
                     name: '弯头',
-                    id: "EditEuqipment",
+                    id: "wantou",
                     icon:require("./../../../assets/images/leftImgs/"+"wantou.png"),
                     activeIcon:require("./../../../assets/images/leftImgs/"+ "wantou"+"Active"+".png")
                 },

+ 4 - 1
src/components/editview/rightPropertyBar/property.vue

@@ -105,7 +105,10 @@ export default {
         this.textMsg = item.text;
         this.fontSize = item.font.size;
         console.log("item.font.size", item.font.size);
-      } else if (this.itemType == "BaseImage") {
+      } else if (
+        this.itemType == "BaseImage" ||
+        this.itemType == "BasePipeUninTool"
+      ) {
         this.Width = item.width; //item 宽
         this.Height = item.height; //item 高
         this.Url = item.url; // 路径