YaolongHan 4 роки тому
батько
коміт
97e8cc28d7

+ 2 - 2
src/components/baseEditer.vue

@@ -215,7 +215,7 @@ export default {
           Elements,
           Name: "1", // 名称
           categoryId: "NTXT",
-          ProjectID: "3", // 项目ID
+          ProjectID: "4", // 项目ID
           BuildingID: "1", // 建筑ID
           FloorID: "1", // 楼层id
           Note: "1" // 图说明
@@ -273,7 +273,7 @@ export default {
     readGroup() {
       const data = {
         categoryId: "NTXT",
-        projectId: 3
+        projectId: 4
       };
       return readGroup(data);
     }

+ 7 - 11
src/components/mapClass/EditScence.ts

@@ -121,7 +121,7 @@ export class EditScence extends SGraphScene {
             Pos: { X: 0, Y: 0 },
             /** 由应用自己定义  */
             Properties: {
-                Line: [{ x: event.x, y: event.y }]
+                Line: [{ X: event.x, Y: event.y }]
             }
         }
         const item = new SLineMarkerItem(null, data);
@@ -203,14 +203,12 @@ export class EditScence extends SGraphScene {
             AttachObjectIds: [],
             Type: "Zone",
             Pos: { X: event.x, Y: event.y },
-            OutLine: [[new SPoint(event.x, event.y)]],
+            OutLine:[{X:event.x, Y:event.y}],
             Properties: {
-                Text: "区域类型",
-                strokeColor: this._legend.Color,
-                fillColor: this._legend.FillColor,
+                StrokeColor: this._legend.Color,
+                FillColor: this._legend.FillColor,
                 LineDash: this._legend.LineDash,
                 LineWidth: this._legend.LineWidth,
-                Text:this._legend.Name
             },
         }
 
@@ -243,10 +241,8 @@ export class EditScence extends SGraphScene {
             /** 由应用自己定义  */
             Properties: {
                 Url: '',
-                Name: '',
             }
         }
-
         const item = new SImageMarkerItem(null, data);
         item.zOrder = ItemOrder.imageOrder;
         item.selectable = true;
@@ -274,9 +270,9 @@ export class EditScence extends SGraphScene {
             /** 由应用自己定义  */
             Properties: {
                 Text: '请在右侧属性栏输入文字!',
-                color: '',
-                font: 0,
-                backgroundColor: ''
+                Color: '',
+                Font: 0,
+                BackgroundColor: ''
             }
         }
         const item = new STextMarkerItem(null, data);

+ 7 - 2
src/lib/items/SLineMarkerItem.ts

@@ -28,7 +28,7 @@ export class SLineMarkerItem extends SLineItem {
         if (data.Properties && data.Properties.Line) {
             let setPointList: SPoint[];
             setPointList = data.Properties.Line.map(i => {
-                return new SPoint(i.x, i.y)
+                return new SPoint(i.X, i.Y)
             })
             this.line = setPointList;
         }
@@ -45,7 +45,12 @@ export class SLineMarkerItem extends SLineItem {
 
     toData(): Marker {
         this.data.Pos = {X: this.x, Y: this.y};
-        this.data.Properties.Line = this.line;
+        this.data.Properties.Line = this.line.map(pos => {
+            return {
+                X: pos.x,
+                Y: pos.y
+            }
+        });
         this.data.Properties.LineWidth = this.lineWidth;
         this.data.Properties.StrokeColor = this.strokeColor;
         this.data.Properties.LineStyle = this.lineStyle;

+ 9 - 9
src/lib/items/STextMarkerItem.ts

@@ -51,14 +51,14 @@ export class STextMarkerItem extends STextItem {
         if (data.Properties && data.Properties.Text) {
             this.text = data.Properties.Text;
         }
-        if (data.Properties && data.Properties.color) {
-            this.color = data.Properties.color
+        if (data.Properties && data.Properties.Color) {
+            this.color = data.Properties.Color
         }
-        if (data.Properties && data.Properties.font) {
-            this.font = new SFont("sans-serif", data.Properties.font);;
+        if (data.Properties && data.Properties.Font) {
+            this.font = new SFont("sans-serif", data.Properties.Font);;
         }
-        if (data.Properties && data.Properties.backgroundColor) {
-            this.backgroundColor = data.Properties.backgroundColor
+        if (data.Properties && data.Properties.BackgroundColor) {
+            this.backgroundColor = data.Properties.BackgroundColor
         }
     } // Constructor
 
@@ -66,9 +66,9 @@ export class STextMarkerItem extends STextItem {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Size = {Width: this.width, Height: this.height};
         this.data.Properties.Text = this.text;
-        this.data.Properties.color = this.color;
-        this.data.Properties.font = this.font.size
-        this.data.Properties.backgroundColor = this.backgroundColor
+        this.data.Properties.Color = this.color;
+        this.data.Properties.Font = this.font.size
+        this.data.Properties.BackgroundColor = this.backgroundColor
         return this.data;
     }
 

+ 8 - 10
src/lib/items/SZoneLegendItem.ts

@@ -98,6 +98,7 @@ export class SZoneLegendItem extends SPolygonItem {
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;
+        this.text = data.Name;
         this.font = new SFont("sans-serif", 2);
         if (data) {
             this.setPointList = [];
@@ -112,18 +113,15 @@ export class SZoneLegendItem extends SPolygonItem {
                     this.setPointList = setPointList;
                 }
             }
-            if (data.Properties.Text) {
-                this.text = data.Properties.Text;
-            }
             // 设置线宽
             if (data.Properties.LineWidth) {
                 this.lineWidth = data.Properties.LineWidth
             }
-            if (data.Properties.strokeColor) {
-                this.strokeColor = data.Properties.strokeColor.includes('#') ? new SColor(data.Properties.strokeColor) : new SColor(hexify(data.Properties.strokeColor));
+            if (data.Properties.StrokeColor) {
+                this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
             }
-            if (data.Properties.fillColor) {
-                this.fillColor = data.Properties.fillColor.includes('#') ? new SColor(data.Properties.fillColor) : new SColor(hexify(data.Properties.fillColor))
+            if (data.Properties.FillColor) {
+                this.fillColor = data.Properties.FillColor.includes('#') ? new SColor(data.Properties.FillColor) : new SColor(hexify(data.Properties.FillColor))
             }
             if (data.Properties.TextPos) {
                 this.textItem.moveTo(data.Properties.TextPos.x, data.Properties.TextPos.y);
@@ -147,9 +145,9 @@ export class SZoneLegendItem extends SPolygonItem {
 
     toData(): any {
         this.data.Pos = {X: this.x, Y: this.y};
-        this.data.Properties.Text = this.text;
-        this.data.Properties.fillColor = this.fillColor.value;
-        this.data.Properties.strokeColor = this.strokeColor.value;
+        this.data.Name = this.text;
+        this.data.Properties.FillColor = this.FillColor.value;
+        this.data.Properties.StrokeColor = this.strokeColor.value;
         this.data.Properties.lineWidth = this.lineWidth;
         this.data.OutLine = this.getPointList.map(pos => {
             return {