YaolongHan 4 år sedan
förälder
incheckning
741b4260cb
3 ändrade filer med 29 tillägg och 20 borttagningar
  1. 2 2
      src/components/edit/left_toolbar.vue
  2. 24 16
      src/components/mapClass/EditScence.ts
  3. 3 2
      src/views/editer.vue

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

@@ -88,13 +88,13 @@
               <div class="title">{{item.Name}}</div>
               <ul class="example">
                 <li
-                  @click="getexampleItem(item)"
+                  @click="getexampleItem(items)"
                   v-for="(items,indexs) in item.GraphElements"
                   :key="indexs"
                 >
                   <img
                     class="item"
-                    src="http://192.168.200.87:8088/topology-wanda/Picture/query/5a011ab5b9fe465cbe35bbdb3fce6c86"
+                    :src="'/serve/topology-wanda/Picture/query/'+ items.Url"
                     alt
                   />
                   <div class="text">{{items.Name}}</div>

+ 24 - 16
src/components/mapClass/EditScence.ts

@@ -6,7 +6,7 @@ import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
 import { TipelineItem } from "@/lib/items/TipelineItem";
 import { SImgTextItem } from "@/lib/items/SImgTextItem"
 import { SPoint, SFont } from '@saga-web/draw/lib';
-
+import { Legend } from '@/lib/types/Legend';
 
 /**
  * 在线绘图
@@ -54,7 +54,14 @@ export class EditScence extends SGraphScene {
         // // 选择绑定选额item事件
         this.selectContainer.connect("listChange", this, this.listChange);
     }
-
+    /** 绘制图例样式 */
+    _legend: any | null = null;
+    get getlegend(): any {
+        return this._legend;
+    };
+    set setlegend(obj:any) {
+        this._legend = obj
+    }
     /**
      * 监听变化
      * @param obj 变化后的对象
@@ -128,21 +135,22 @@ export class EditScence extends SGraphScene {
      */
     addPolygonItem(event: SMouseEvent): void {
         //创建item
-        const Legend = {
-            ID: 123,
-            Name: "哈哈",
-            GraphElementType: 'Zone',
-            GraphElementId: '123',
-            Pos: { x: 0, y: 0 },
-            OutLine: [[new SPoint(event.x, event.y)]],
-            Properties: {
-                strokeColor: '#3d73c0',
-                fillColor: '#eda986'
-            },
-            Num: 123
-        }
+        // const Legend = {
+        //     ID: 123,
+        //     Name: "哈哈",
+        //     GraphElementType: 'Zone',
+        //     GraphElementId: '123',
+        //     Pos: { x: 0, y: 0 },
+        //     OutLine: [[new SPoint(event.x, event.y)]],
+        //     Properties: {
+        //         strokeColor: '#3d73c0',
+        //         fillColor: '#eda986'
+        //     },
+        //     Num: 123
+        // }
+        const LegendData
 
-        const Polylines = new SZoneLegendItem(null, Legend);
+        const Polylines = new SZoneLegendItem(null, this._legend);
         Polylines.selectable = true;
         //设置状态
         Polylines.setStatus = SItemStatus.Create;

+ 3 - 2
src/views/editer.vue

@@ -49,8 +49,9 @@ export default {
   },
   methods: {
     // 左侧工具栏 点击事件
-    toolActionClick(cmd) {
-     this.cmd = cmd;
+    toolActionClick(item) {
+     this.cmdType = item.Type;
+     console.log('itemafasdfsadf',item)
     },
     setCmdType(cmdType) {
       this.cmdType = cmdType;