YaolongHan 4 年之前
父節點
當前提交
cf4cb4869b

+ 0 - 1
package.json

@@ -13,7 +13,6 @@
     "@saga-web/draw": "2.1.100",
     "@saga-web/feng-map": "1.0.15",
     "@saga-web/graph": "2.1.94",
-    "@saga-web/topology": "1.0.84",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 1 - 1
src/components/baseEditer.vue

@@ -39,7 +39,7 @@ export default {
     return {
       appName: "万达可视化系统",
       key: "23f30a832a862c58637a4aadbf50a566",
-      mapServerURL: "/wdfn",
+      mapServerURL: "http://map.wanda.cn/editor",
       canvasWidth: 700,
       canvasHeight: 800,
       fParser: null,

+ 3 - 2
src/components/edit/attr_select.vue

@@ -283,8 +283,8 @@
         </a-collapse-panel>
       </a-collapse>
     </div>
-    <editDialog ref="dialog" :typeEdit="1" :getmajorId="'1001'" :sysNum="5" />
-    <!--    <editDialog ref="dialog" :typeEdit="2" :getmajorId="'设备间'" :sysNum="5" />-->
+    <editDialog ref="dialog" :typeEdit="type" :getmajorId="'1001'" :sysNum="imageNum" :key="Date.now()"/>
+    <!--    <editDialog ref="dialog" :typeEdit="2" :getmajorId="'1001'" :sysNum="5" />-->
   </div>
 </template>
 
@@ -475,6 +475,7 @@ export default {
   },
   watch: {
     focusItemList: function(newval) {
+      console.log(newval);
       const Item = newval.itemList[0];
       if (Item.data && Item.data.SubType) {
         this.SubType = Item.data.SubType;

+ 14 - 13
src/components/edit/edit-dialog.vue

@@ -41,7 +41,7 @@
           <searchTree  @getTreeId="getTreeId" :treeData="treeData"/>
         </div>
         <div class="checkbox">
-          <a-table :pagination="false" row-key='id' :columns="typeEdit==1?columnsSys:columnsLocal" :data-source="tableData"  :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect }" :scroll="{ y: 340 }"  :loading="loading"/>
+          <a-table :pagination="false" row-key='id' :columns="typeEdit=='Image'?columnsSys:columnsLocal" :data-source="tableData"  :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect }" :scroll="{ y: 340 }"  :loading="loading"/>
           <a-pagination v-if="total>0" v-model="page" :total="total" show-less-items style="margin-left: auto;"  @change="handleTableChange"/>
         </div>
       </div>
@@ -69,7 +69,7 @@
         name: "edit-dialog",
         components: {searchTree},
       props:{
-        typeEdit:Number , //用于区分是设备 还是  位置
+        typeEdit:String , //用于区分是设备 还是  位置
         getmajorId:String, //专业Id
         sysNum:Number //设备总数
       },
@@ -172,9 +172,9 @@
             },
             //获取treeId --classstructureid
             getTreeId(id) {
-              if(this.typeEdit==1){
+              if(this.typeEdit=='Image'){
                 this.classstructureid = id;
-              }else if(this.typeEdit==2){
+              }else if(this.typeEdit=='Zone'){
                 this.locfl = id;
               }
 
@@ -188,12 +188,12 @@
               size: this.size,//条数
             }
             if( this.keyword){
-              data.keyword = this.typeEdit==1? `${this.keyword}:brand`:`${this.keyword}:wzjc`
+              data.keyword = this.typeEdit=='Image'? `${this.keyword}:brand`:`${this.keyword}:wzjc`
             }
             let paramData =  {classstructureid: this.classstructureid,gname:this.floorId};
             let paramDataLocal =  {locfl: this.locfl,gname:this.floorId};
             this.loading = true;
-            if(this.typeEdit==1){
+            if(this.typeEdit=='Image'){
               queryGlsmsasset(data,paramData).then(res => {
                 this.loading = false;
                 if(res.data.result == 'success'){
@@ -212,7 +212,7 @@
                   this.$message.error('数据请求失败')
                 }
               })
-            }else if(this.typeEdit==2){
+            }else if(this.typeEdit=='Zone'){
               queryGlsmsLocation(data,paramDataLocal).then(res => {
                 this.loading = false;
                 if(res.data.result == 'success'){
@@ -291,7 +291,7 @@
           },
           //获取设备大类和位置大类
           getQuerySmsxt(){
-              if (this.typeEdit==1){
+              if (this.typeEdit=='Image'){
                 getQuerySmsxt({}).then(res =>{
                   if(res.result == 'success'){
                     if(res.data){
@@ -304,8 +304,9 @@
                     }
                   }
                 })
-              }else if(this.typeEdit ==2){
-              queryWzfldl({}).then(res =>{
+              }else if(this.typeEdit =='Zone'){
+
+                queryWzfldl({}).then(res =>{
                 if(res.result == 'success'){
                   if(res.data){
                     let data = res.data;
@@ -322,7 +323,7 @@
           },
          // 获取设备大类下的分类和位置大类下的分类
           getQuerySmsxtBy(smsxt){
-              if(this.typeEdit==1){
+              if(this.typeEdit=='Image'){
               let data = {
                 smsxt:smsxt
               }
@@ -347,7 +348,7 @@
                   this.$message.error('获取失败');
                 }
               })
-            }else if(this.typeEdit==2){
+            }else if(this.typeEdit=='Zone'){
                 let data = {
                   dl:smsxt
                 }
@@ -378,7 +379,7 @@
           this.getQuerySmsxt();
           //如果有专业就带过来
           this.getQuerySmsxtBy(this.majorId)
-
+          console.log(this.typeEdit);
 
 
           this.getPlazaFloor();

+ 17 - 3
src/components/edit/left_toolbar.vue

@@ -58,7 +58,7 @@
 
     <a-popover trigger="click" placement="rightBottom" v-model="drawerVisible" >
       <template slot="content" >
-        <itemTree @getSelectId="getSelectId" :drawerVisible="drawerVisible" :categoryIdS="categoryIdS"  :categoryId="categoryId"></itemTree>
+        <itemTree @getSelectId="getSelectId" :drawerVisible="drawerVisible" :categoryIdS="categoryIdS"  ></itemTree>
       </template>
       <div class="bottom-item">
         <a-icon type="ellipsis" />
@@ -128,7 +128,7 @@
 </template>
 <script>
 import itemTree from "./leftbar_components/itemTree";
-import { graphElementGroup} from "@/api/editer.js";
+import {graphElementGroup} from "@/api/editer.js";
 import bus from "@/bus";
 import { queryGroup } from "@/api/editer.js";
 import { mapState, mapActions } from "vuex";
@@ -312,16 +312,30 @@ export default {
         }
         // 打开侧边框
         // 接口请求
+        this.itemList = [];
         this.spinning = true;
+        const data = {
+          GraphCategoryIds: this.categoryId,
+          Type: item.type
+        };
+
+        queryGroup(data).then(res=>{
+          this.itemList = res.Data;
+        });
         const arr = {
           InfoSystems: this.categoryIdS,
           Type: item.type
         };
+
         graphElementGroup(arr).then(res => {
           this.spinning = false;
-          this.itemList = res.Data;
+          res.Data.map(item=>{
+            this.itemList.push(item);
+          })
+
         });
       }
+      console.log(this.itemList);
     },
     getSelectId(data){
       this.categoryIdS=data;

+ 4 - 3
src/components/edit/leftbar_components/itemTree.vue

@@ -33,7 +33,7 @@ export default {
     return {
       expandedKeys: ["", ""],
       autoExpandParent: true,
-      checkedKeys: ["1-1"],
+      checkedKeys: [],
       selectedKeys: [],
       treeData,
       spinning:false
@@ -41,7 +41,7 @@ export default {
   },
   props:{
     categoryIdS:Array,
-    categoryId:String,
+    // categoryId:String,
     drawerVisible:Boolean
   },
   watch: {
@@ -114,7 +114,8 @@ export default {
       if(data == 'cancel'){
         this.checkedKeys = this.categoryIdS;
       }else if(data == 'rest'){
-        this.checkedKeys = [this.categoryId];
+        // this.checkedKeys = [this.categoryId];
+        this.checkedKeys = [];
       }else{
         this.checkedKeys =data;
       }

+ 27 - 12
src/components/mapClass/EditScence.ts

@@ -1,6 +1,6 @@
 import { SMouseEvent, SUndoStack } from "@saga-web/base";
 import { SGraphScene, SGraphLayoutType, SAnchorItem } from '@saga-web/graph/lib';
-import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem } from "@saga-web/big";
+import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem, ItemColor } from "@saga-web/big";
 import { SGraphItem, SLineStyle, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
 import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
 import { SSCPZZoneLegendItem } from "@/lib/items/SSCPZZoneLegendItem";
@@ -71,6 +71,12 @@ export class EditScence extends SGraphScene {
         super();
         // // 选择绑定选额item事件
         this.selectContainer.connect("listChange", this, this.listChange);
+        ItemColor.spaceColor = new SColor("#A4ABB22B")
+        ItemColor.wallColor = new SColor("#A7AEB3FF")
+        ItemColor.columnColor = new SColor("#A7AEB3FF")
+        ItemColor.virtualWallColor = new SColor("#A7AEB3FF")
+        ItemColor.selectColor = new SColor("#84A0BB2B")
+        ItemColor.spaceBorderColor = new SColor("#A7AEB3FF")
     }
     /** 绘制图例样式 */
     _legend: any | null = null;
@@ -219,7 +225,9 @@ export class EditScence extends SGraphScene {
         // 起始锚点
         item.startAnchor = anc;
         if (anc) {
-            anc.parent ?.connect('changePos', item, item.changePos)
+            anc.parent?.connect('changePos', item, item.changePos)
+            item.anchor1ID = anc.id;
+            item.node1Id = anc.parent.id;
         }
         this.scenceUpdate(this);
         return true
@@ -844,17 +852,24 @@ export class EditScence extends SGraphScene {
     */
     setTipeEndanchor(event: SMouseEvent): void {
         if (this.grabItem instanceof TipelineItem) {
-            const anc = this.clickIsAnchor(event);
-            if (anc) {
-                const p = anc.mapToScene(0, 0)
-                anc.isConnected = true;
-                event.x = p.x;
-                event.y = p.y;
-                if (this.grabItem.pointList.length) {
-                    this.grabItem.endAnchor = anc;
-                    anc.parent ?.connect('changePos', this.grabItem, this.grabItem.changePos)
+            if (this.grabItem.status == SItemStatus.Create) {
+                const anc = this.clickIsAnchor(event);
+                if (anc) {
+                    const p = anc.mapToScene(0, 0)
+                    anc.isConnected = true;
+                    event.x = p.x;
+                    event.y = p.y;
+                    if (this.grabItem.pointList.length) {
+                        this.grabItem.endAnchor = anc;
+                        anc.parent?.connect('changePos', this.grabItem, this.grabItem.changePos)
+                    }
+                    this.grabItem.anchor2ID = anc.id
+                    this.grabItem.node2Id = anc.parent.id
+                    this.grabItem.onMouseDown(event)
+                    this.grabItem.status = SItemStatus.Normal;
+                    this.finishCreated(this.grabItem)
+                    return
                 }
-                this.grabItem.status = SItemStatus.Normal;
             }
             this.grabItem.onMouseDown(event)
         }

+ 15 - 7
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();
     }
 
@@ -51,7 +51,7 @@ 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;
@@ -77,17 +77,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.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 - 1
src/views/drafts.vue

@@ -107,7 +107,7 @@ export default {
       view: null,
       urlMsg: null,
       floorList: {},
-      mapServerURL: "/wdfn",
+      mapServerURL: "http://map.wanda.cn/editor",
       key: "23f30a832a862c58637a4aadbf50a566",
       appName: "万达可视化系统",
       defaultProps: {