浏览代码

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-editer into develop

haojianlong 4 年之前
父节点
当前提交
64f9c746ca

+ 2 - 2
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.22",
-    "@saga-web/big": "1.0.70",
+    "@saga-web/big": "1.0.71",
     "@saga-web/draw": "2.1.100",
     "@saga-web/feng-map": "1.0.20",
-    "@saga-web/graph": "2.1.103",
+    "@saga-web/graph": "2.1.104",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 76 - 17
src/components/baseEditer.vue

@@ -59,7 +59,8 @@ export default {
       hasTypeList: [], // 当前类型下包含的typeid(提取)
       graphId: "",
       initScale: 1, //加载好底图之后的,初始缩放比例
-      changeScaleByClick: false //区分 滚轮,点击 事件改变的缩放比例
+      changeScaleByClick: false, //区分 滚轮,点击 事件改变的缩放比例
+      autoSave: null
     };
   },
   mounted() {
@@ -86,6 +87,10 @@ export default {
         this.scene.setCmd = "choice";
       }
     };
+    // 自动保存(时间差为一分钟)
+    this.autoSave = setInterval(() => {
+      this.saveMsgNoMessage();
+    }, 60000);
   },
   methods: {
     init() {
@@ -351,7 +356,17 @@ export default {
         bus.$emit("exportItem", data);
       });
       bus.$on("saveMsgItem", () => {
-        this.saveMsg();
+        const loading = Message({
+          message: "保存中,切勿关闭窗口!",
+          type: "warning"
+        });
+        this.saveMsg()
+          .then(() => {
+            loading.close();
+          })
+          .catch(() => {
+            loading.close();
+          });
       });
       bus.$on("exportByKey", val => {
         if (val.type == "Image") {
@@ -498,12 +513,21 @@ export default {
       }),
         //发布图
         bus.$on("publishMap", () => {
-          // 发布信息时必须保存数据
-          this.saveMsg().then(res => {
-            if (res) {
-              this.publishBtn();
-            }
+          const loading = Message({
+            message: "保存中,切勿关闭窗口!",
+            type: "warning"
           });
+          // 发布信息时必须保存数据
+          this.saveMsg()
+            .then(res => {
+              loading.close();
+              if (res) {
+                this.publishBtn();
+              }
+            })
+            .catch(() => {
+              loading.close();
+            });
         });
       /**
        * @name changeScale缩放底图
@@ -534,6 +558,10 @@ export default {
       bus.$on("changeUndo", () => {
         this.scene.undo();
       });
+         // 选中状态
+      bus.$on("toggleItem", (item) => {
+        this.scene.toggleItem(item);
+      });
     },
     // 读取数据
     readGroup() {
@@ -564,10 +592,13 @@ export default {
       publishGraph(data).then(res => {
         loadings.close();
         if (res.Result == "success") {
-          this.$message.success("发布成功");
+          Message({
+            message: "发布成功!",
+            type: "success"
+          });
           setTimeout(() => {
-             const token = this.$store.getters["token"];
-             const data = `categoryId=${this.urlMsg.categoryId}&projectId=${this.urlMsg.projectId}&BuildingID=${this.urlMsg.BuildingID}&FloorID=${this.urlMsg.FloorID}&fmapID=${this.urlMsg.fmapID}&token=${token}`;
+            const token = this.$store.getters["token"];
+            const data = `categoryId=${this.urlMsg.categoryId}&projectId=${this.urlMsg.projectId}&BuildingID=${this.urlMsg.BuildingID}&FloorID=${this.urlMsg.FloorID}&fmapID=${this.urlMsg.fmapID}&token=${token}`;
             const url =
               window.location.origin +
               "/wandaEditer/drafts?" +
@@ -576,9 +607,12 @@ export default {
             // // 发布成功跳转草稿箱
             // const token = this.$store.getters["token"];
             // this.$router.push({ path: 'drafts', query: { projectId:this.urlMsg.projectId,BuildingID:this.urlMsg.BuildingID,fmapID:this.urlMsg.fmapID,token:token}})
-          }, 1000);
+          }, 2000);
         } else {
-          this.$message.error(res.Message);
+          Message({
+            message: res.Message,
+            type: "error"
+          });
         }
       });
     },
@@ -603,14 +637,9 @@ export default {
         FloorID: this.urlMsg.FloorID, // 楼层id
         Seq // 楼层id
       };
-      const loading = Message({
-        message: "保存中,切勿关闭窗口!",
-        type: "warning"
-      });
       return new Promise(resolve => {
         saveGroup(data)
           .then(res => {
-            loading.close();
             if (res.Result == "success") {
               this.graphId = res.Data;
               Message({
@@ -634,6 +663,32 @@ export default {
             resolve(false);
           });
       });
+    },
+    // 自动保存接口
+    saveMsgNoMessage() {
+      const Elements = this.scene.saveMsgItem();
+      const Seq = Number(this.urlMsg.seq);
+      const data = {
+        Elements,
+        Name: this.appName, // 名称
+        CategoryId: this.urlMsg.categoryId,
+        ProjectID: this.urlMsg.projectId, // 项目ID
+        BuildingID: this.urlMsg.BuildingID, // 建筑ID
+        FloorID: this.urlMsg.FloorID, // 楼层id
+        Seq // 楼层id
+      };
+      saveGroup(data)
+        .then(res => {
+          if (res.Result == "success") {
+            this.graphId = res.Data;
+            console.log("自动保存成功");
+          } else {
+            console.log("自动保存失败");
+          }
+        })
+        .catch(err => {
+          console.log("自动保存失败");
+        });
     }
   },
   watch: {
@@ -682,6 +737,10 @@ export default {
       obj[arr[0]] = arr[1];
     });
     this.urlMsg = obj;
+  },
+  beforeDestroy() {
+    // 销毁自动保存
+    clearInterval(this.autoSave);
   }
 };
 </script>

+ 109 - 89
src/components/edit/attr_select.vue

@@ -62,7 +62,12 @@
       <div class="row">
         <div class="row-tit">背景色</div>
         <div class="color-choice">
-          <swatches v-model="backColor" :swatches="swatches" popover-x="left" @close="changebackColor" />
+          <swatches
+            v-model="backColor"
+            :swatches="swatches"
+            popover-x="left"
+            @close="changebackColor"
+          />
         </div>
       </div>
     </div>
@@ -189,7 +194,11 @@
             <a-button type="link" class="edit-option-btn" @click="OpenEditStatus">编辑区域</a-button>
           </div>
           <div class="row">
-            <a-textarea @change="changeitemExplain" v-model="itemExplain" :auto-size="{ minRows: 4, maxRows: 6 }" />
+            <a-textarea
+              @change="changeitemExplain"
+              v-model="itemExplain"
+              :auto-size="{ minRows: 4, maxRows: 6 }"
+            />
           </div>
           <div class="row">
             <div class="row-tit">描边</div>
@@ -251,10 +260,10 @@
       v-if="type =='Zone' || type =='Image'||type == 'Line'"
     >
       <a-spin :spinning="spinning">
-      <div class="row">
-        <span class="edit-option-text">{{type =='Zone'?`工程信息化中的位置类型`:'工程信息化中的设备类型'}}</span>
-        <a-button type="link" class="edit-option-btn" @click="handleEdit">选择编辑</a-button>
-      </div>
+        <div class="row">
+          <span class="edit-option-text">{{type =='Zone'?`工程信息化中的位置类型`:'工程信息化中的设备类型'}}</span>
+          <a-button type="link" class="edit-option-btn" @click="handleEdit">选择编辑</a-button>
+        </div>
 
         <div class="grid-content" style="margin-top: 12px;">
           <a-card class="attr-card" v-for="(item,index) in attrCards" :key="index">{{item.sbjc ||item.wzjc}}</a-card>
@@ -282,13 +291,16 @@
           >
             <span>{{item.value}}</span>
             <span class="key-board">{{item.keys}}</span>
-            <span v-if="item.events" style="margin: 0 5px;">+ <img style="width:13px;height:18px;" src="./../../assets/images/shubiao.png" alt=""></span>
-            <span> {{item.events}}</span>
+            <span v-if="item.events" style="margin: 0 5px;">
+              +
+              <img style="width:13px;height:18px;" src="./../../assets/images/shubiao.png" alt />
+            </span>
+            <span>{{item.events}}</span>
           </p>
         </a-collapse-panel>
       </a-collapse>
     </div>
-    <editDialog  ref="dialog" :attrCards="attrCards"  :sysNum="imageNum" :key="new Date().getTime()"/>
+    <editDialog ref="dialog" :attrCards="attrCards" :sysNum="imageNum" :key="new Date().getTime()" />
     <!--    <editDialog ref="dialog" :typeEdit="2" :getmajorId="'1001'" :sysNum="5" />-->
   </div>
 </template>
@@ -299,8 +311,12 @@ import Swatches from "vue-swatches";
 import bus from "@/bus";
 import "vue-swatches/dist/vue-swatches.css";
 import { SLineStyle } from "@saga-web/graph/lib";
-import { uploadImg, queryGlsmsLocation,queryGlsmsAsset } from "@/api/editer.js";
-import {getUrlMsg}  from '@/components/urlMsg.js'
+import {
+  uploadImg,
+  queryGlsmsLocation,
+  queryGlsmsAsset
+} from "@/api/editer.js";
+import { getUrlMsg } from "@/components/urlMsg.js";
 export default {
   name: "attr_select",
   props: ["type", "focusItemList"],
@@ -361,26 +377,26 @@ export default {
       },
       swatchess: ["#69C5FC", "#656EDF", "#58AF6F", "#2D8FAA"],
       swatches: [
-          "#00000000",
-          "#1FBC9C",
-          "#1CA085",
-          "#2ECC70",
-          "#27AF60",
-          "#3398DB",
-          "#2980B9",
-          "#A463BF",
-          "#8E43AD",
-          "#3D556E",
-          "#222F3D",
+        "#00000000",
+        "#1FBC9C",
+        "#1CA085",
+        "#2ECC70",
+        "#27AF60",
+        "#3398DB",
+        "#2980B9",
+        "#A463BF",
+        "#8E43AD",
+        "#3D556E",
+        "#222F3D"
       ],
       lengedName: "", // 图例名称
       imageNum: 1, //设备数量
       fillColor: "", //修改填充色 (主要针对防火风区以及石材铺装)
       SubType: "", //空间类型,区分石材铺装
-      itemExplain:'', //图例说明 只针对石材铺装
-      attrCards:[],
-      spinning:false,
-      getmajorId:''
+      itemExplain: "", //图例说明 只针对石材铺装
+      attrCards: [],
+      spinning: false,
+      getmajorId: ""
     };
   },
   methods: {
@@ -473,12 +489,12 @@ export default {
       bus.$emit("OpenEditStatus");
     },
     // 编辑图例说明
-    changeitemExplain(){
-      bus.$emit("changeitemExplain",this.itemExplain);
+    changeitemExplain() {
+      bus.$emit("changeitemExplain", this.itemExplain);
     },
     // 更改工程信息化数据
-    changeAttachObjectIds(arr){
-      bus.$emit('changeAttachObjectIds',arr)
+    changeAttachObjectIds(arr) {
+      bus.$emit("changeAttachObjectIds", arr);
     }
   },
   watch: {
@@ -488,8 +504,8 @@ export default {
       this.imageNum = 1; //切换item初始化
       if (Item.data && Item.data.SubType) {
         this.SubType = Item.data.SubType;
-      }else{
-         this.SubType = '';
+      } else {
+        this.SubType = "";
       }
 
       if (newval.itemList.length == 1) {
@@ -517,9 +533,13 @@ export default {
           newval.itemType == "Image"
         ) {
           this.lengedName = Item.data.Name;
-          this.itemExplain = '';
-          if(Item.data.Properties.ItemExplain){
-          this.itemExplain = Item.data.Properties.ItemExplain ? Item.data.Properties.ItemExplain : '';
+          this.borderColor = Item.strokeColor ? Item.strokeColor.value : "";
+          this.fillColor = Item.fillColor ? Item.fillColor.value : "";
+          this.itemExplain = "";
+          if (Item.data.Properties.ItemExplain) {
+            this.itemExplain = Item.data.Properties.ItemExplain
+              ? Item.data.Properties.ItemExplain
+              : "";
           }
 
           if (newval.itemType == "Image") {
@@ -534,55 +554,56 @@ export default {
           }
         }
       }
-      const  locationList =[];
-      const  assetnumList =[];
-      let  params ={};
+      const locationList = [];
+      const assetnumList = [];
+      let params = {};
       this.attrCards = [];
-      Item.data.AttachObjectIds.map(item=>{
-        if(item.type=='Zone'){
-          locationList.push(item.id)
-        }else if(item.type=='Image'){
-          assetnumList.push(item.id)
+      Item.data.AttachObjectIds.map(item => {
+        if (item.type == "Zone") {
+          locationList.push(item.id);
+        } else if (item.type == "Image") {
+          assetnumList.push(item.id);
         }
-
-      })
-     // if(newval.itemType == 'Zone'){
-       this.spinning = true;
-       if(locationList.length){
-         params = {locationList:locationList}
-       }else{
-         params = {locationList:['']};
-       }
-       queryGlsmsLocation({plazaId: getUrlMsg().projectId},params).then(res=>{
-         this.spinning = false;
-         if(res.data.result =='success'){
-           console.log(res.data);
-           if(res.data.data && res.data.data.length){
-             this.attrCards =  this.attrCards.concat(res.data.data)
-           }
-         }else{
-           this.$message.error('工程信息化中的位置信息获取失败')
-         }
-       })
-     // }else if(newval.itemType == 'Image'){
-       this.spinning = true;
-       if(assetnumList.length){
-         params = {assetnumList:assetnumList}
-       }else{
-         params = {assetnumList:['']};
-       }
-       queryGlsmsAsset({plazaId: getUrlMsg().projectId},params).then(res=>{
-         this.spinning = false;
-         if(res.data.result =='success'){
-           console.log(res.data);
-           if(res.data.data &&res.data.data.length){
-             this.attrCards = this.attrCards.concat(res.data.data)
-           }
-         }else{
-           this.$message.error('工程信息化中的设备信息获取失败')
-         }
-       })
-     // }
+      });
+      // if(newval.itemType == 'Zone'){
+      this.spinning = true;
+      if (locationList.length) {
+        params = { locationList: locationList };
+      } else {
+        params = { locationList: [""] };
+      }
+      queryGlsmsLocation({ plazaId: getUrlMsg().projectId }, params).then(
+        res => {
+          this.spinning = false;
+          if (res.data.result == "success") {
+            console.log(res.data);
+            if (res.data.data && res.data.data.length) {
+              this.attrCards = this.attrCards.concat(res.data.data);
+            }
+          } else {
+            this.$message.error("工程信息化中的位置信息获取失败");
+          }
+        }
+      );
+      // }else if(newval.itemType == 'Image'){
+      this.spinning = true;
+      if (assetnumList.length) {
+        params = { assetnumList: assetnumList };
+      } else {
+        params = { assetnumList: [""] };
+      }
+      queryGlsmsAsset({ plazaId: getUrlMsg().projectId }, params).then(res => {
+        this.spinning = false;
+        if (res.data.result == "success") {
+          console.log(res.data);
+          if (res.data.data && res.data.data.length) {
+            this.attrCards = this.attrCards.concat(res.data.data);
+          }
+        } else {
+          this.$message.error("工程信息化中的设备信息获取失败");
+        }
+      });
+      // }
       console.log(this.attrCards);
     }
   }
@@ -590,13 +611,12 @@ export default {
 </script>
 
 <style scoped lang="less">
-  /deep/ .ant-spin-nested-loading{
+/deep/ .ant-spin-nested-loading {
+  height: 100% !important;
+  .ant-spin-container {
     height: 100% !important;
-    .ant-spin-container{
-      height: 100% !important;
-
-    }
   }
+}
 .attr-select {
   padding: 12px 16px;
   box-sizing: border-box;
@@ -618,7 +638,7 @@ export default {
       }
     }
     .row-tit {
-      color: #8D9399;
+      color: #8d9399;
       font-size: 14px;
     }
   }
@@ -640,7 +660,7 @@ export default {
   }
 
   .edit-option-text {
-    color: #8D9399;
+    color: #8d9399;
     height: 32px;
     line-height: 32px;
     margin-top: -5px;

+ 1 - 1
src/components/edit/left_toolbar.vue

@@ -631,7 +631,7 @@ export default {
             flex-direction: column;
             cursor: pointer;
             &:hover {
-              background: #e1f2ff;
+              background: #f5f6f7;
             }
             .item {
               width: 54px;

+ 6 - 1
src/components/edit/right_toolbar.vue

@@ -26,7 +26,7 @@
         <div class="element">
           <a-input-search placeholder="搜索" style="margin-bottom: 12px;" v-model="key" @search="onSearch" />
           <ul class="element-list">
-            <li v-for="ele in elementData" :key="ele.id" v-show="key?ele.name.search(key) != -1:true">
+            <li v-for="ele in elementData" :key="ele.id" @click="clickElement(ele)" v-show="key?ele.name.search(key) != -1:true">
               <el-image style="width: 45px; height: 26px; margin-top: 6px;" :src="ele.data.Properties.IconUrl" fit="contain"></el-image>
               <span class="element-name">{{ele.name}}</span>
             </li>
@@ -172,6 +172,10 @@ export default {
         });
         bus.$emit("itemPositon", x, y);
       }
+    },
+    // 点击选中元素
+    clickElement(ele){
+      bus.$emit('toggleItem',ele)
     }
   },
   watch: {
@@ -316,6 +320,7 @@ li {
         padding-left: 12px;
         box-sizing: border-box;
         color: #1f2429;
+        cursor: pointer;
         .element-name {
           display: inline-block;
           vertical-align: top;

+ 31 - 22
src/components/mapClass/EditScence.ts

@@ -2,9 +2,9 @@ import { SMouseEvent, SUndoStack } from "@saga-web/base";
 import { SGraphScene, SGraphLayoutType, SAnchorItem } from '@saga-web/graph/lib';
 import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem, ItemColor } from "@saga-web/big";
 import { SGraphItem, SLineStyle, SGraphPropertyCommand, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
-import {SGraphAddListCommand} from "./SGraphAddListCommand"
-import {SGraphDeleteCommand} from "./SGraphDeleteCommand"
-import {SGraphDeleteListCommand} from "./SGraphDeleteListCommand"
+import { SGraphAddListCommand } from "./SGraphAddListCommand"
+import { SGraphDeleteCommand } from "./SGraphDeleteCommand"
+import { SGraphDeleteListCommand } from "./SGraphDeleteListCommand"
 
 import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
 import { SSCPZZoneLegendItem } from "@/lib/items/SSCPZZoneLegendItem";
@@ -372,6 +372,7 @@ export class EditScence extends SGraphScene {
             /** 由应用自己定义  */
             Properties: {
                 IconUrl: require(`../../assets/images/t-img-hover.png`),
+                StrokeColor: "#c0ccda",
                 Url: '',
             }
         }
@@ -522,7 +523,6 @@ export class EditScence extends SGraphScene {
         if (this.focusItem) {
             const oldMsg = this.focusItem.color;
             const newMsg = new SColor(color);
-
             this.focusItem.color = newMsg;
             this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", oldMsg, newMsg));
         }
@@ -763,7 +763,7 @@ export class EditScence extends SGraphScene {
             if (!this.focusItemList) {
                 return
             }
-            this.undoStack.push(new SGraphDeleteListCommand(this,this.focusItemList))
+            this.undoStack.push(new SGraphDeleteListCommand(this, this.focusItemList))
             this.focusItemList.forEach((focusItem) => {
                 this.removeItem(focusItem);
                 let a = -1
@@ -869,7 +869,7 @@ export class EditScence extends SGraphScene {
      */
     finishCreated(item: any) {
         let arrList = []
-        if(this.cmd == 'baseLine'){
+        if (this.cmd == 'baseLine') {
             arrList = this.Markers
         }
         this.cmd = 'choice';
@@ -878,7 +878,7 @@ export class EditScence extends SGraphScene {
         setTimeout(() => {
             this.focusItem = item;
         })
-        this.undoStack.push(new SGraphAddCommand(this, item,arrList));
+        this.undoStack.push(new SGraphAddCommand(this, item, arrList));
     }
     ////////////////////////
     //  以下为鼠标键盘操作事件
@@ -957,7 +957,7 @@ export class EditScence extends SGraphScene {
             if (this.grabItem instanceof SLineMarkerItem && this.grabItem.status == SItemStatus.Edit) {
                 this.setLineItem(event)
                 return true;
-            } else if (this.grabItem instanceof TipelineItem){
+            } else if (this.grabItem instanceof TipelineItem) {
                 this.updateTipeAnc(event);
                 return true;
             }
@@ -989,7 +989,7 @@ export class EditScence extends SGraphScene {
             }
         }
         // 删除键功能
-        if(event.code=='Delete'){
+        if (event.code == 'Delete') {
             this.deleiteItem()
         }
         return false
@@ -1045,7 +1045,7 @@ export class EditScence extends SGraphScene {
      *
     */
     updateTipeAnc(event: SMouseEvent): void {
-        if (this.grabItem instanceof TipelineItem){
+        if (this.grabItem instanceof TipelineItem) {
             const anc = this.clickIsAnchor(event);
             if (anc) {
                 const p = anc.mapToScene(0, 0)
@@ -1053,9 +1053,9 @@ export class EditScence extends SGraphScene {
                 event.y = p.y;
                 if (this.grabItem.status == SItemStatus.Edit) {
                     if (this.grabItem.curIndex == 0) {
-                        if (this.grabItem.startAnchor){
+                        if (this.grabItem.startAnchor) {
                             this.grabItem.startAnchor.isConnected = false
-                            this.grabItem.startAnchor.parent.disconnect('changePos',this.grabItem);
+                            this.grabItem.startAnchor.parent.disconnect('changePos', this.grabItem);
                         }
                         anc.isConnected = true;
                         this.grabItem.startAnchor = anc;
@@ -1063,10 +1063,10 @@ export class EditScence extends SGraphScene {
                         this.grabItem.node1Id = anc.parent.id
                         anc.parent.connect('changePos', this.grabItem, this.grabItem.changePos)
                     }
-                    if (this.grabItem.curIndex == this.grabItem.pointList.length-1) {
-                        if (this.grabItem.endAnchor){
+                    if (this.grabItem.curIndex == this.grabItem.pointList.length - 1) {
+                        if (this.grabItem.endAnchor) {
                             this.grabItem.endAnchor.isConnected = false
-                            this.grabItem.endAnchor.parent.disconnect('changePos',this.grabItem);
+                            this.grabItem.endAnchor.parent.disconnect('changePos', this.grabItem);
                         }
                         anc.isConnected = true;
                         this.grabItem.endAnchor = anc;
@@ -1080,18 +1080,18 @@ export class EditScence extends SGraphScene {
             } else {
                 if (this.grabItem.status == SItemStatus.Edit) {
                     if (this.grabItem.curIndex == 0) {
-                        if (this.grabItem.startAnchor){
+                        if (this.grabItem.startAnchor) {
                             this.grabItem.startAnchor.isConnected = false
-                            this.grabItem.startAnchor.parent.disconnect('changePos',this.grabItem);
+                            this.grabItem.startAnchor.parent.disconnect('changePos', this.grabItem);
                             this.grabItem.startAnchor = null;
                             this.grabItem.anchor1ID = ''
                             this.grabItem.node1Id = ''
                         }
                     }
-                    if (this.grabItem.curIndex == this.grabItem.pointList.length-1) {
-                        if (this.grabItem.endAnchor){
+                    if (this.grabItem.curIndex == this.grabItem.pointList.length - 1) {
+                        if (this.grabItem.endAnchor) {
                             this.grabItem.endAnchor.isConnected = false
-                            this.grabItem.endAnchor.parent.disconnect('changePos',this.grabItem);
+                            this.grabItem.endAnchor.parent.disconnect('changePos', this.grabItem);
                             this.grabItem.endAnchor = null;
                             this.grabItem.anchor2ID = ''
                             this.grabItem.node2Id = ''
@@ -1430,7 +1430,16 @@ export class EditScence extends SGraphScene {
      *  添加多个item命令
      *  @param  focusItemList       鼠标事件对象
      */
-    AddListCommand (focusItemList:any[]):void{
-        this.undoStack.push(new SGraphAddListCommand(this,focusItemList));
+    AddListCommand(focusItemList: any[]): void {
+        this.undoStack.push(new SGraphAddListCommand(this, focusItemList));
+    }
+
+    /**
+     *  选中状态方法
+     *  @param  item       鼠标事件对象
+     */
+    toggleItem(item: SGraphItem): void {
+        this.selectContainer.clear()
+        this.selectContainer.toggleItem(item)
     }
 }

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

@@ -3,6 +3,7 @@ import { SGraphItem, SImageItem } from "@saga-web/graph/lib";
 import { SPainter, SColor } from "@saga-web/draw";
 import { Marker } from '../types/Marker';
 import { ItemOrder } from '@saga-web/big/lib';
+import { hexify } from "@/components/mapClass/until";
 
 /**
  * 标识对象Item(图标类型)