haojianlong 4 år sedan
förälder
incheckning
06976380e4

+ 2 - 0
docs/.vuepress/components/big/items/zone.vue

@@ -49,8 +49,10 @@
             // 只模拟了轮廓数据
             // @ts-ignore
             const item = new SZoneItem(null,{OutLine:this.outline});
+            item.selectable = true;
             scene.addItem(item);
             this.view.fitSceneToView();
+            console.log(this.view)
             this.view.scalable = false;
         }
     }

+ 29 - 2
docs/guides/big/items/space.md

@@ -48,9 +48,36 @@ Spaces:[
 <big-items-space />
 
 ::: details 查看代码
-
 <<< @/docs/.vuepress/components/big/items/space.vue
-
 :::
 
+空间默认传入样式
+``` json5
+Style: {
+    Default: {
+        Stroke: "#2b2b2b",
+        Fill: "#f1fffd80",
+        LineWidth: 1,
+        Effect: {}
+    },
+    Selected: {
+        Stroke: "#2b2b2b",
+        Fill: "#1abc9c",
+        LineWidth: 1,
+        Effect: {}
+    },
+    Disabled: {
+        Stroke: "#2b2b2b",
+        Fill: "#afafaf",
+        LineWidth: 1,
+        Effect: {}
+    },
+    Highlight: {
+        Stroke: "#2b2b2b",
+        Fill: "#fbb029",
+        LineWidth: 1,
+        Effect: {}
+    }
+}
+```
 

+ 56 - 15
docs/guides/big/items/zone.md

@@ -10,21 +10,29 @@
 ## 代码说明
     
 ### 数据说明
+此数据并非后台返回,需要将接口返回数据处理此格式
+
 ``` json5
 Zone: {
-        xxx: xxx,                           // 等业务空间属性
-        OutLine: [
-            [
-                [{X:0,Y:0,Z:0},...],        // 第一个空间的外轮廓
-                ...                         // 第一个空间的内轮廓
-            ],
-            [
-                [{X:0,Y:0,Z:0},...],        // 第二个空间的外轮廓
-                ...                         // 第二个空间的内轮廓
-            ],
-            ...                             // ...
-        ],                                  // 轮廓线
-    }
+    RoomLocalName: 'string',            // 名称
+    RoomID: 'string',                   // Id
+    Color: 'string',                    // 默认颜色
+    Height: 'number',                   // 高度-非必须
+    HighLightFlag: 'boolean',           // 是否高亮-非必须
+    Transparency: 'number',             // 默认状态透明度-非必须
+    Infected: 'boolean',                // 是否受影响-非必须
+    OutLine: [
+        [
+            [{X:0,Y:0,Z:0},...],        // 第一个空间的外轮廓
+            ...                         // 第一个空间的内轮廓
+        ],
+        [
+            [{X:0,Y:0,Z:0},...],        // 第二个空间的外轮廓
+            ...                         // 第二个空间的内轮廓
+        ],
+        ...                             // ...
+    ],                                  // 轮廓线
+}
 ```
 ::: tip 注
 1、业务空间由多个空间组成 <br/>
@@ -47,9 +55,42 @@ Zone: {
 <big-items-zone />
 
 ::: details 查看代码
-
 <<< @/docs/.vuepress/components/big/items/zone.vue
-
 :::
 
+业务空间默认传入样式
+``` json5
+Style: {
+    Default: {
+        Stroke: "#00000000",
+        Fill: "#ffee2280",
+        LineWidth: 1,
+        Effect: {}
+    },
+    Selected: {
+        Stroke: "#00000000",
+        Fill: "#1abc9c",
+        LineWidth: 1,
+        Effect: {}
+    },
+    Highlight: {
+        Stroke: "#00000000",
+        Fill: data.Color || "#fbb029",
+        LineWidth: 1,
+        Effect: {}
+    },
+    Unselect: {
+        Stroke: "#00000000",
+        Fill: "#cecece",
+        LineWidth: 1,
+        Effect: {}
+    },
+    Infected: {
+        Stroke: "#00000000",
+        Fill: "#ff0000",
+        LineWidth: 1,
+        Effect: {}
+    }
+}
+```
 

+ 1 - 1
package.json

@@ -15,7 +15,7 @@
     "@persagy-web/base": "2.2.1",
     "@persagy-web/big": "2.2.7",
     "@persagy-web/draw": "2.2.6",
-    "@persagy-web/graph": "2.2.11",
+    "@persagy-web/graph": "2.2.12",
     "axios": "^0.19.2",
     "element-ui": "^2.12.0",
     "vue": "^2.6.10",