Browse Source

添加空间

zhangyu 4 năm trước cách đây
mục cha
commit
9df34c378b

+ 0 - 539
src/assets/font/demo.css

@@ -1,539 +0,0 @@
-/* Logo 字体 */
-@font-face {
-  font-family: "iconfont logo";
-  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
-  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
-    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
-    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
-    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
-}
-
-.logo {
-  font-family: "iconfont logo";
-  font-size: 160px;
-  font-style: normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-
-/* tabs */
-.nav-tabs {
-  position: relative;
-}
-
-.nav-tabs .nav-more {
-  position: absolute;
-  right: 0;
-  bottom: 0;
-  height: 42px;
-  line-height: 42px;
-  color: #666;
-}
-
-#tabs {
-  border-bottom: 1px solid #eee;
-}
-
-#tabs li {
-  cursor: pointer;
-  width: 100px;
-  height: 40px;
-  line-height: 40px;
-  text-align: center;
-  font-size: 16px;
-  border-bottom: 2px solid transparent;
-  position: relative;
-  z-index: 1;
-  margin-bottom: -1px;
-  color: #666;
-}
-
-
-#tabs .active {
-  border-bottom-color: #f00;
-  color: #222;
-}
-
-.tab-container .content {
-  display: none;
-}
-
-/* 页面布局 */
-.main {
-  padding: 30px 100px;
-  width: 960px;
-  margin: 0 auto;
-}
-
-.main .logo {
-  color: #333;
-  text-align: left;
-  margin-bottom: 30px;
-  line-height: 1;
-  height: 110px;
-  margin-top: -50px;
-  overflow: hidden;
-  *zoom: 1;
-}
-
-.main .logo a {
-  font-size: 160px;
-  color: #333;
-}
-
-.helps {
-  margin-top: 40px;
-}
-
-.helps pre {
-  padding: 20px;
-  margin: 10px 0;
-  border: solid 1px #e7e1cd;
-  background-color: #fffdef;
-  overflow: auto;
-}
-
-.icon_lists {
-  width: 100% !important;
-  overflow: hidden;
-  *zoom: 1;
-}
-
-.icon_lists li {
-  width: 100px;
-  margin-bottom: 10px;
-  margin-right: 20px;
-  text-align: center;
-  list-style: none !important;
-  cursor: default;
-}
-
-.icon_lists li .code-name {
-  line-height: 1.2;
-}
-
-.icon_lists .icon {
-  display: block;
-  height: 100px;
-  line-height: 100px;
-  font-size: 42px;
-  margin: 10px auto;
-  color: #333;
-  -webkit-transition: font-size 0.25s linear, width 0.25s linear;
-  -moz-transition: font-size 0.25s linear, width 0.25s linear;
-  transition: font-size 0.25s linear, width 0.25s linear;
-}
-
-.icon_lists .icon:hover {
-  font-size: 100px;
-}
-
-.icon_lists .svg-icon {
-  /* 通过设置 font-size 来改变图标大小 */
-  width: 1em;
-  /* 图标和文字相邻时,垂直对齐 */
-  vertical-align: -0.15em;
-  /* 通过设置 color 来改变 SVG 的颜色/fill */
-  fill: currentColor;
-  /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
-      normalize.css 中也包含这行 */
-  overflow: hidden;
-}
-
-.icon_lists li .name,
-.icon_lists li .code-name {
-  color: #666;
-}
-
-/* markdown 样式 */
-.markdown {
-  color: #666;
-  font-size: 14px;
-  line-height: 1.8;
-}
-
-.highlight {
-  line-height: 1.5;
-}
-
-.markdown img {
-  vertical-align: middle;
-  max-width: 100%;
-}
-
-.markdown h1 {
-  color: #404040;
-  font-weight: 500;
-  line-height: 40px;
-  margin-bottom: 24px;
-}
-
-.markdown h2,
-.markdown h3,
-.markdown h4,
-.markdown h5,
-.markdown h6 {
-  color: #404040;
-  margin: 1.6em 0 0.6em 0;
-  font-weight: 500;
-  clear: both;
-}
-
-.markdown h1 {
-  font-size: 28px;
-}
-
-.markdown h2 {
-  font-size: 22px;
-}
-
-.markdown h3 {
-  font-size: 16px;
-}
-
-.markdown h4 {
-  font-size: 14px;
-}
-
-.markdown h5 {
-  font-size: 12px;
-}
-
-.markdown h6 {
-  font-size: 12px;
-}
-
-.markdown hr {
-  height: 1px;
-  border: 0;
-  background: #e9e9e9;
-  margin: 16px 0;
-  clear: both;
-}
-
-.markdown p {
-  margin: 1em 0;
-}
-
-.markdown>p,
-.markdown>blockquote,
-.markdown>.highlight,
-.markdown>ol,
-.markdown>ul {
-  width: 80%;
-}
-
-.markdown ul>li {
-  list-style: circle;
-}
-
-.markdown>ul li,
-.markdown blockquote ul>li {
-  margin-left: 20px;
-  padding-left: 4px;
-}
-
-.markdown>ul li p,
-.markdown>ol li p {
-  margin: 0.6em 0;
-}
-
-.markdown ol>li {
-  list-style: decimal;
-}
-
-.markdown>ol li,
-.markdown blockquote ol>li {
-  margin-left: 20px;
-  padding-left: 4px;
-}
-
-.markdown code {
-  margin: 0 3px;
-  padding: 0 5px;
-  background: #eee;
-  border-radius: 3px;
-}
-
-.markdown strong,
-.markdown b {
-  font-weight: 600;
-}
-
-.markdown>table {
-  border-collapse: collapse;
-  border-spacing: 0px;
-  empty-cells: show;
-  border: 1px solid #e9e9e9;
-  width: 95%;
-  margin-bottom: 24px;
-}
-
-.markdown>table th {
-  white-space: nowrap;
-  color: #333;
-  font-weight: 600;
-}
-
-.markdown>table th,
-.markdown>table td {
-  border: 1px solid #e9e9e9;
-  padding: 8px 16px;
-  text-align: left;
-}
-
-.markdown>table th {
-  background: #F7F7F7;
-}
-
-.markdown blockquote {
-  font-size: 90%;
-  color: #999;
-  border-left: 4px solid #e9e9e9;
-  padding-left: 0.8em;
-  margin: 1em 0;
-}
-
-.markdown blockquote p {
-  margin: 0;
-}
-
-.markdown .anchor {
-  opacity: 0;
-  transition: opacity 0.3s ease;
-  margin-left: 8px;
-}
-
-.markdown .waiting {
-  color: #ccc;
-}
-
-.markdown h1:hover .anchor,
-.markdown h2:hover .anchor,
-.markdown h3:hover .anchor,
-.markdown h4:hover .anchor,
-.markdown h5:hover .anchor,
-.markdown h6:hover .anchor {
-  opacity: 1;
-  display: inline-block;
-}
-
-.markdown>br,
-.markdown>p>br {
-  clear: both;
-}
-
-
-.hljs {
-  display: block;
-  background: white;
-  padding: 0.5em;
-  color: #333333;
-  overflow-x: auto;
-}
-
-.hljs-comment,
-.hljs-meta {
-  color: #969896;
-}
-
-.hljs-string,
-.hljs-variable,
-.hljs-template-variable,
-.hljs-strong,
-.hljs-emphasis,
-.hljs-quote {
-  color: #df5000;
-}
-
-.hljs-keyword,
-.hljs-selector-tag,
-.hljs-type {
-  color: #a71d5d;
-}
-
-.hljs-literal,
-.hljs-symbol,
-.hljs-bullet,
-.hljs-attribute {
-  color: #0086b3;
-}
-
-.hljs-section,
-.hljs-name {
-  color: #63a35c;
-}
-
-.hljs-tag {
-  color: #333333;
-}
-
-.hljs-title,
-.hljs-attr,
-.hljs-selector-id,
-.hljs-selector-class,
-.hljs-selector-attr,
-.hljs-selector-pseudo {
-  color: #795da3;
-}
-
-.hljs-addition {
-  color: #55a532;
-  background-color: #eaffea;
-}
-
-.hljs-deletion {
-  color: #bd2c00;
-  background-color: #ffecec;
-}
-
-.hljs-link {
-  text-decoration: underline;
-}
-
-/* 代码高亮 */
-/* PrismJS 1.15.0
-https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
-/**
- * prism.js default theme for JavaScript, CSS and HTML
- * Based on dabblet (http://dabblet.com)
- * @author Lea Verou
- */
-code[class*="language-"],
-pre[class*="language-"] {
-  color: black;
-  background: none;
-  text-shadow: 0 1px white;
-  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
-  text-align: left;
-  white-space: pre;
-  word-spacing: normal;
-  word-break: normal;
-  word-wrap: normal;
-  line-height: 1.5;
-
-  -moz-tab-size: 4;
-  -o-tab-size: 4;
-  tab-size: 4;
-
-  -webkit-hyphens: none;
-  -moz-hyphens: none;
-  -ms-hyphens: none;
-  hyphens: none;
-}
-
-pre[class*="language-"]::-moz-selection,
-pre[class*="language-"] ::-moz-selection,
-code[class*="language-"]::-moz-selection,
-code[class*="language-"] ::-moz-selection {
-  text-shadow: none;
-  background: #b3d4fc;
-}
-
-pre[class*="language-"]::selection,
-pre[class*="language-"] ::selection,
-code[class*="language-"]::selection,
-code[class*="language-"] ::selection {
-  text-shadow: none;
-  background: #b3d4fc;
-}
-
-@media print {
-
-  code[class*="language-"],
-  pre[class*="language-"] {
-    text-shadow: none;
-  }
-}
-
-/* Code blocks */
-pre[class*="language-"] {
-  padding: 1em;
-  margin: .5em 0;
-  overflow: auto;
-}
-
-:not(pre)>code[class*="language-"],
-pre[class*="language-"] {
-  background: #f5f2f0;
-}
-
-/* Inline code */
-:not(pre)>code[class*="language-"] {
-  padding: .1em;
-  border-radius: .3em;
-  white-space: normal;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
-  color: slategray;
-}
-
-.token.punctuation {
-  color: #999;
-}
-
-.namespace {
-  opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number,
-.token.constant,
-.token.symbol,
-.token.deleted {
-  color: #905;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.builtin,
-.token.inserted {
-  color: #690;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
-  color: #9a6e3a;
-  background: hsla(0, 0%, 100%, .5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
-  color: #07a;
-}
-
-.token.function,
-.token.class-name {
-  color: #DD4A68;
-}
-
-.token.regex,
-.token.important,
-.token.variable {
-  color: #e90;
-}
-
-.token.important,
-.token.bold {
-  font-weight: bold;
-}
-
-.token.italic {
-  font-style: italic;
-}
-
-.token.entity {
-  cursor: help;
-}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1090
src/assets/font/demo_index.html


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 242 - 62
src/assets/font/iconfont.css


BIN
src/assets/font/iconfont.eot


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
src/assets/font/iconfont.js


+ 0 - 289
src/assets/font/iconfont.json

@@ -1,289 +0,0 @@
-{
-  "id": "2088866",
-  "name": "拓扑工具-普通",
-  "font_family": "iconfont",
-  "css_prefix_text": "icon-",
-  "description": "",
-  "glyphs": [
-    {
-      "icon_id": "17559866",
-      "name": "三通_n",
-      "font_class": "santong_n",
-      "unicode": "e664",
-      "unicode_decimal": 58980
-    },
-    {
-      "icon_id": "17559867",
-      "name": "四通_n",
-      "font_class": "sitong_n",
-      "unicode": "e665",
-      "unicode_decimal": 58981
-    },
-    {
-      "icon_id": "17559868",
-      "name": "弯头_n",
-      "font_class": "wantou_n",
-      "unicode": "e666",
-      "unicode_decimal": 58982
-    },
-    {
-      "icon_id": "17559869",
-      "name": "划线_n",
-      "font_class": "huaxian_n",
-      "unicode": "e674",
-      "unicode_decimal": 58996
-    },
-    {
-      "icon_id": "17559870",
-      "name": "矩形_n",
-      "font_class": "juxing_n",
-      "unicode": "e676",
-      "unicode_decimal": 58998
-    },
-    {
-      "icon_id": "17559871",
-      "name": "圆形_n",
-      "font_class": "yuanxing_n",
-      "unicode": "e677",
-      "unicode_decimal": 58999
-    },
-    {
-      "icon_id": "17559872",
-      "name": "多边形_n",
-      "font_class": "duobianxing_n",
-      "unicode": "e678",
-      "unicode_decimal": 59000
-    },
-    {
-      "icon_id": "17559873",
-      "name": "图片_n",
-      "font_class": "tupian_n",
-      "unicode": "e679",
-      "unicode_decimal": 59001
-    },
-    {
-      "icon_id": "17559874",
-      "name": "公式_n",
-      "font_class": "gongshi_n",
-      "unicode": "e67a",
-      "unicode_decimal": 59002
-    },
-    {
-      "icon_id": "17559875",
-      "name": "文字_n",
-      "font_class": "wenzi_n",
-      "unicode": "e67b",
-      "unicode_decimal": 59003
-    },
-    {
-      "icon_id": "17559876",
-      "name": "信息点_n",
-      "font_class": "xinxidian_n",
-      "unicode": "e67c",
-      "unicode_decimal": 59004
-    },
-    {
-      "icon_id": "17487441",
-      "name": "更多",
-      "font_class": "gengduo1",
-      "unicode": "e663",
-      "unicode_decimal": 58979
-    },
-    {
-      "icon_id": "17376666",
-      "name": "关系",
-      "font_class": "guanxi",
-      "unicode": "e667",
-      "unicode_decimal": 58983
-    },
-    {
-      "icon_id": "17376667",
-      "name": "锁定",
-      "font_class": "suoding",
-      "unicode": "e668",
-      "unicode_decimal": 58984
-    },
-    {
-      "icon_id": "17376668",
-      "name": "左对齐",
-      "font_class": "zuoduiqi",
-      "unicode": "e669",
-      "unicode_decimal": 58985
-    },
-    {
-      "icon_id": "17376669",
-      "name": "置底",
-      "font_class": "zhidi",
-      "unicode": "e66a",
-      "unicode_decimal": 58986
-    },
-    {
-      "icon_id": "17376670",
-      "name": "删除",
-      "font_class": "shanchu",
-      "unicode": "e66b",
-      "unicode_decimal": 58987
-    },
-    {
-      "icon_id": "17376671",
-      "name": "置顶",
-      "font_class": "zhiding",
-      "unicode": "e66c",
-      "unicode_decimal": 58988
-    },
-    {
-      "icon_id": "17376672",
-      "name": "组合",
-      "font_class": "zuhe",
-      "unicode": "e66d",
-      "unicode_decimal": 58989
-    },
-    {
-      "icon_id": "17376673",
-      "name": "打散",
-      "font_class": "dasan",
-      "unicode": "e66e",
-      "unicode_decimal": 58990
-    },
-    {
-      "icon_id": "17376674",
-      "name": "粘贴",
-      "font_class": "niantie",
-      "unicode": "e66f",
-      "unicode_decimal": 58991
-    },
-    {
-      "icon_id": "17376675",
-      "name": "重做",
-      "font_class": "zhongzuo",
-      "unicode": "e670",
-      "unicode_decimal": 58992
-    },
-    {
-      "icon_id": "17376676",
-      "name": "撤回",
-      "font_class": "chehui",
-      "unicode": "e671",
-      "unicode_decimal": 58993
-    },
-    {
-      "icon_id": "17376677",
-      "name": "筛选",
-      "font_class": "shaixuan",
-      "unicode": "e672",
-      "unicode_decimal": 58994
-    },
-    {
-      "icon_id": "17376678",
-      "name": "复制",
-      "font_class": "fuzhi",
-      "unicode": "e673",
-      "unicode_decimal": 58995
-    },
-    {
-      "icon_id": "17376680",
-      "name": "搜索",
-      "font_class": "sousuo",
-      "unicode": "e675",
-      "unicode_decimal": 58997
-    },
-    {
-      "icon_id": "17376472",
-      "name": "添加",
-      "font_class": "tianjia",
-      "unicode": "e656",
-      "unicode_decimal": 58966
-    },
-    {
-      "icon_id": "17376473",
-      "name": "箭头",
-      "font_class": "jiantou",
-      "unicode": "e657",
-      "unicode_decimal": 58967
-    },
-    {
-      "icon_id": "17376474",
-      "name": "保存",
-      "font_class": "baocun",
-      "unicode": "e658",
-      "unicode_decimal": 58968
-    },
-    {
-      "icon_id": "17376475",
-      "name": "下载",
-      "font_class": "xiazai",
-      "unicode": "e659",
-      "unicode_decimal": 58969
-    },
-    {
-      "icon_id": "17376476",
-      "name": "Triangle",
-      "font_class": "Triangle",
-      "unicode": "e65a",
-      "unicode_decimal": 58970
-    },
-    {
-      "icon_id": "17376477",
-      "name": "放大",
-      "font_class": "fangda",
-      "unicode": "e65b",
-      "unicode_decimal": 58971
-    },
-    {
-      "icon_id": "17376478",
-      "name": "缩小",
-      "font_class": "suoxiao",
-      "unicode": "e65c",
-      "unicode_decimal": 58972
-    },
-    {
-      "icon_id": "17376479",
-      "name": "发布",
-      "font_class": "fabu",
-      "unicode": "e65d",
-      "unicode_decimal": 58973
-    },
-    {
-      "icon_id": "17373833",
-      "name": "通用",
-      "font_class": "tongyong",
-      "unicode": "e644",
-      "unicode_decimal": 58948
-    },
-    {
-      "icon_id": "17373834",
-      "name": "管线",
-      "font_class": "guanxian",
-      "unicode": "e645",
-      "unicode_decimal": 58949
-    },
-    {
-      "icon_id": "17373835",
-      "name": "楼层",
-      "font_class": "louceng",
-      "unicode": "e646",
-      "unicode_decimal": 58950
-    },
-    {
-      "icon_id": "17373836",
-      "name": "设备",
-      "font_class": "shebei",
-      "unicode": "e647",
-      "unicode_decimal": 58951
-    },
-    {
-      "icon_id": "17373837",
-      "name": "空间",
-      "font_class": "kongjian",
-      "unicode": "e648",
-      "unicode_decimal": 58952
-    },
-    {
-      "icon_id": "17373838",
-      "name": "设备组",
-      "font_class": "shebeizu",
-      "unicode": "e649",
-      "unicode_decimal": 58953
-    }
-  ]
-}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 165 - 30
src/assets/font/iconfont.svg


BIN
src/assets/font/iconfont.ttf


BIN
src/assets/font/iconfont.woff


BIN
src/assets/font/iconfont.woff2


+ 52 - 14
src/components/editview/basePlanEditer.vue

@@ -13,14 +13,13 @@
 <script>
 import { SFloorParser, getJsonz } from "@persagy-web/big";
 import { SImageItem, SImageShowType } from "@persagy-web/graph";
-import { SPlanView, SPlanParser, SPlanScene, SPlanDecorator, SPlanEquipment } from "@/lib";
+import { SPlanView, SPlanParser, SPlanScene, SPlanDecorator, SPlanEquipment, SPlanZone } from "@/lib";
 import { SGraphPropertyCommand } from "@persagy-web/edit";
 import topoTooltip from "./topoTooltip.vue";
 import { mapState, mapMutations } from "vuex";
 import base64ToFile from "@/utils/base64ToFile";
 import { v1 as uuidv1 } from "uuid";
 import bus from "@/bus/bus";
-import { publishGraph } from "@/api/home";
 import { planerSave, planerRead, planerPublish } from "@/api/labsl";
 import { equipQuery } from "@/api/equipcomponent";
 import { imgBaseUrl } from "@/api/imageservice";
@@ -103,7 +102,8 @@ export default {
             "SETPROJECT",
             "SETVERSION",
             "ADDEQUIP",
-            "DELETEQUIP",
+            "ADDZONE",
+            "DELETEITEM",
             "INITSTYLE",
             "INITRULELIST",
             "INITOBJEXTINFO",
@@ -263,7 +263,7 @@ export default {
             bus.$off("deleteItem");
             bus.$on("deleteItem", (val) => {
                 this.scene.deleteItem([val]);
-                this.DELETEQUIP();
+                this.DELETEITEM();
             });
             // 复制
             bus.$off("copy");
@@ -359,20 +359,18 @@ export default {
                 this.INITRULELIST(res.content.ruleList);
                 this.ruleNum = res.content.ruleList.length;
                 res.content.ruleList.forEach(async (rule) => {
-                    this.loadedRuleNum++;
                     if (rule.commond && rule.commond === "query") {
-                        if (rule.returnType && rule.returnType === "equip") {
-                            const params = { ...rule.params, buildingId: this.buildingId, floorId: this.floorId };
+                        const params = { ...rule.params, buildingId: this.buildingId, floorId: this.floorId };
+                        if (rule?.returnType === "equip") {
                             const res = await equipQuery(params);
                             if (res.result === "success") this.mergeEquipData(res.content);
-                        } else if (rule.returnType && rule.returnType === "zone") {
-                            setTimeout(() => {
-                                console.error("请求空间数据");
-                                if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
-                            }, 1000);
-                        } else if (rule.returnType && rule.returnType === "equipGroup") {
+                        } else if (rule?.returnType === "zone") {
+                            const res = await equipQuery(params);
+                            if (res.result === "success") this.mergeZoneData(res.content);
+                        } else if (rule?.returnType === "equipGroup") {
                             setTimeout(() => {
                                 console.error("请求设备组数据");
+                                this.loadedRuleNum++;
                                 if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
                             }, 1000);
                         }
@@ -381,6 +379,7 @@ export default {
                          * 暂未实现
                          */
                         console.error("删除命令!!!", rule);
+                        this.loadedRuleNum++;
                         if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
                     }
                 });
@@ -425,6 +424,46 @@ export default {
                     this.ADDEQUIP(equipItem);
                 }
             });
+            this.loadedRuleNum++;
+            if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
+        },
+        // 解析空间数据
+        mergeZoneData(zoneList) {
+            zoneList.forEach((zone) => {
+                if (!this.zoneItemMap[zone.id]) {
+                    if (this.objExtInfo[zone.id]) {
+                        zone = { ...this.objExtInfo[zone.id], ...zone };
+                    }
+                    if (!zone.pos) {
+                        //如果未维护设备在图中的坐标
+                        if (zone.locationJson) {
+                            // 判断设备是否维护BIM坐标
+                            const { x, y, z } = zone.locationJson;
+                            zone.pos = { x, y: -y, z };
+                        } else {
+                            // 否则显示默认坐标位置
+                            zone.pos = { x: 0, y: 0, z: 0 };
+                        }
+                    }
+                    // 添加设备对象类型
+                    zone.properties = { type: "BaseZone" };
+                    const zoneItem = new SPlanZone(null, zone);
+                    zoneItem.selectable = true;
+                    zoneItem.moveable = true;
+                    zoneItem.connect("finishCreated", this.scene, this.scene.finishCreated);
+                    zoneItem.connect("onContextMenu", this, this.scene.getItem);
+                    if (this.styleMap[zone.id]) {
+                        SPlanDecorator.zoneDecorator(zoneItem, this.styleMap[zone.id]);
+                    } else if (this.styleMap[zone.classCode]) {
+                        SPlanDecorator.zoneDecorator(zoneItem, this.styleMap[zone.classCode]);
+                    } else {
+                        SPlanDecorator.zoneDecorator(zoneItem, this.styleMap["defaultEquipStyle"]);
+                    }
+                    this.scene.addItem(zoneItem);
+                    this.ADDZONE(zoneItem);
+                }
+            });
+            this.loadedRuleNum++;
             if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
         },
         // 加载通用元素和管线元素
@@ -484,7 +523,6 @@ export default {
             });
             if (this.view?.scene) this.view.fitSceneToView();
         },
-
         // 生成快照并保存草稿
         saveTopoDraft() {
             const uuid = uuidv1();

+ 9 - 5
src/components/homeView/leftFolder.vue

@@ -17,8 +17,8 @@
                         @keyup.native.enter="handleClickAddFolder"
                         placeholder="请输入文件夹名称"
                     ></el-input>
-                    <i class="el-icon-refresh-left revoke-icon" title="撤销" @click="handleRevokeAddFolder"></i>
-                    <i class="el-icon-check confirm-icon" title="确认" @click="handleClickAddFolder"></i>
+                    <i class="iconfont icon-chexiao revoke-icon" title="撤销" @click="handleRevokeAddFolder"></i>
+                    <i class="iconfont icon-icondone confirm-icon" title="确认" @click="handleClickAddFolder"></i>
                 </li>
                 <li
                     class="folder-item"
@@ -43,11 +43,11 @@
                     ></el-input>
                     <i
                         v-show="folder.showInput"
-                        class="el-icon-refresh-left revoke-icon"
+                        class="iconfont icon-chexiao revoke-icon"
                         title="撤销"
                         @click.stop="handleRevokeUpdateFolder(folder)"
                     ></i>
-                    <i v-show="folder.showInput" class="el-icon-check confirm-icon" title="确认" @click.stop="handleUpdateFolderName(folder)"></i>
+                    <i v-show="folder.showInput" class="iconfont icon-icondone confirm-icon" title="确认" @click.stop="handleUpdateFolderName(folder)"></i>
                 </li>
                 <!-- 右键菜单部分 -->
                 <ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
@@ -299,9 +299,13 @@ export default {
                 margin-top: 11px;
                 float: right;
             }
+            .iconfont {
+                display: inline-block;
+            }
             .revoke-icon {
                 cursor: pointer;
-                margin-left: 8px;
+                color: #646C73;
+                margin-left: 5px;
             }
             .confirm-icon {
                 cursor: pointer;

+ 31 - 1
src/lib/SPlanDecorator.ts

@@ -25,7 +25,7 @@
 
 import { SColor, SFont } from "@persagy-web/draw";
 import { imgBaseUrl } from "@/api/imageservice";
-import { EquipMap, SPlanEquipment, Style, StyleMap } from ".";
+import { EquipMap, SPlanEquipment, SPlanZone, Style, StyleMap, ZoneMap } from ".";
 
 /**
  * 平面图装饰器
@@ -58,6 +58,21 @@ export class SPlanDecorator {
     }
 
     /**
+     * 空间元素装饰器
+     *
+     * @param zoneItem 空间元素
+     * @param style 样式数据
+     */
+    static zoneDecorator(zoneItem: SPlanZone, style: Style): void {
+        // 设置设备字体颜色
+        if (style.color) zoneItem.color = new SColor(style.color);
+        // 设置设备字体大小
+        if (style.size) zoneItem.font = new SFont("sans-serif", style.size);
+        // 设置设备公式
+        if (style.formula) zoneItem.formula = style.formula;
+    }
+
+    /**
      * 设备类装饰器
      *
      * @param classCode 设备类型编码
@@ -71,4 +86,19 @@ export class SPlanDecorator {
                 this.equipDecorator(equipItem, styleMap[classCode]);
         });
     }
+
+    /**
+     * 空间类装饰器
+     * 
+     * @param classCode 空间类型编码
+     * @param zoneItemMap 空间图元素库
+     * @param styleMap 样式库
+     */
+    static zoneMapDecorator(classCode: string, zoneItemMap: ZoneMap, styleMap: StyleMap): void {
+        Object.values(zoneItemMap).forEach((zoneItem: SPlanZone) => {
+            // 设备类型相同且该设备没独立设置过样式,则该设备应用设备类型样式
+            if (zoneItem.legendData?.classCode === classCode && !styleMap[zoneItem.id] && styleMap[classCode])
+                this.zoneDecorator(zoneItem, styleMap[classCode]);
+        });
+    }
 }

+ 3 - 1
src/lib/index.ts

@@ -3,8 +3,10 @@ import { SPlanParser } from "./SPlanParser";
 import { SPlanView } from "./SPlanView";
 import { SPlanDecorator } from "./SPlanDecorator";
 import { SPlanEquipment } from "./item/SPlanEquipment";
+import { SPlanZone } from "./item/SPlanZone";
 import { Style } from "./style/Style";
 import { Example } from "./style/Example";
 import { StyleMap } from "./style/StyleMap";
 import { EquipMap } from "./style/EquipMap";
-export { SPlanParser, SPlanScene, SPlanView, SPlanDecorator, SPlanEquipment, Style, Example, StyleMap, EquipMap };
+import { ZoneMap } from "./style/ZoneMap";
+export { SPlanParser, SPlanScene, SPlanView, SPlanDecorator, SPlanEquipment, SPlanZone, Style, Example, StyleMap, EquipMap, ZoneMap };

+ 99 - 0
src/lib/item/SPlanZone.ts

@@ -0,0 +1,99 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SGraphItem } from "@persagy-web/graph/lib";
+import { Example } from "../index";
+import { SBasePolygonEdit } from "@persagy-web/edit";
+/**
+ * 编辑基础空间类
+ *
+ * @author 张宇 <taohuzy@163.com>
+ */
+export class SPlanZone extends SBasePolygonEdit {
+    /** 设备图例 */
+    private _legendData: Example | null = null;
+    set legendData(val) {
+        this._legendData = val;
+        this.initData();
+    } // set legendData()
+    get legendData(): Example | null {
+        return this._legendData;
+    } // get legendData()
+
+    /** 公式 */
+    private _formula: string = "";
+    set formula(val) {
+        this._formula = val;
+    } // set formula()
+    get formula(): string {
+        return this._formula;
+    } // get formula()
+
+    //  设备附加数据
+    anotherMsg: string = "";
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      数据
+     */
+    constructor(parent: SGraphItem | null, data: Example) {
+        super(parent);
+        this.moveable = true;
+        this.selectable = true;
+        this.zOrder = 9750;
+        this.legendData = data;
+    } // Constructor
+
+    /**
+     * 设置 legendData 时对 item 做设置
+     */
+    initData() {
+        if (!this.legendData) return;
+        this.id = this.legendData.id ? this.legendData.id : "";
+        this.anotherMsg = this.legendData?.anotherMsg ? this.legendData.anotherMsg : "";
+        this.x = this.legendData.pos.x;
+        this.y = this.legendData.pos.y;
+    }
+
+    /**
+     * 返回对象储存的相关数据
+     *
+     * @return	对象储存的相关数据
+     */
+    toData(): any {
+        if (this.legendData) {
+            // 位置
+            const objExtInfo = {
+                id: this.id,
+                pos: this.pos,
+                anotherMsg: this.anotherMsg,
+            };
+            return objExtInfo;
+        }
+    }
+}

+ 36 - 0
src/lib/style/ZoneMap.ts

@@ -0,0 +1,36 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SPlanZone } from "../";
+
+/**
+ * 空间图元素库接口
+ *
+ * @author 张宇 <taohuzy@163.com>
+ */
+export interface ZoneMap {
+    [propName: string]: SPlanZone;
+}

+ 31 - 10
src/store/index.ts

@@ -128,18 +128,39 @@ export default new Vuex.Store({
                 state.equipItemNum = Object.keys(state.equipItemMap).length;
             }
         },
-        DELETEQUIP(state): void {
-            // 如果设备实例数组中parent 为null 则删除该数组
-            let arr1 = Object.keys(state.equipItemMap);
-            if (!arr1.length) return;
-
-            arr1.forEach((key) => {
+        // 添加空间实例item
+        ADDZONE(state, item): void {
+            // @ts-ignore
+            if (!state.zoneIteMap[item.id]) {
                 // @ts-ignore
-                if (!state.equipItemMap[key].parent) {
+                state.zoneIteMap[item.id] = item;
+                state.zoneItemNum = Object.keys(state.zoneIteMap).length;
+            }
+        },
+        // 删除实例item
+        DELETEITEM(state): void {
+            // 如果实例数组中parent 为null 则删除该数组
+            let arr1 = Object.keys(state.equipItemMap);
+            let arr2 = Object.keys(state.zoneIteMap);
+            if (arr1.length) { // 如果设备实例不为空
+                arr1.forEach((key) => {
                     // @ts-ignore
-                    delete state.equipItemMap[key];
-                }
-            });
+                    if (!state.equipItemMap[key].parent) {
+                        // @ts-ignore
+                        delete state.equipItemMap[key];
+                    }
+                });
+                state.equipItemNum = Object.keys(state.equipItemMap).length;
+            } else if (arr2.length) { // 如果空间实例不为空
+                arr2.forEach((key) => {
+                    // @ts-ignore
+                    if (!state.zoneIteMap[key].parent) {
+                        // @ts-ignore
+                        delete state.zoneIteMap[key];
+                    }
+                });
+                state.zoneItemNum = Object.keys(state.zoneIteMap).length;
+            }
         },
     },
     actions: {},