|
@@ -11,7 +11,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { SGraphView, SGraphScene } from "@persagy-web/graph";
|
|
|
|
|
|
+import { SGraphView, SGraphScene, STextItem } from "@persagy-web/graph";
|
|
import { SFloorParser, getJsonz, SZoneParser } from "@persagy-web/big/lib";
|
|
import { SFloorParser, getJsonz, SZoneParser } from "@persagy-web/big/lib";
|
|
import { SColor } from "@persagy-web/draw";
|
|
import { SColor } from "@persagy-web/draw";
|
|
/////////模拟接口数据
|
|
/////////模拟接口数据
|
|
@@ -113,10 +113,24 @@ export default {
|
|
parse.parseData(val);
|
|
parse.parseData(val);
|
|
parse.zoneList.forEach((item) => {
|
|
parse.zoneList.forEach((item) => {
|
|
// 添加到场景
|
|
// 添加到场景
|
|
|
|
+ this.addTextName(item, '112313123123');
|
|
|
|
+ item.fillColor = SColor.Red;
|
|
this.scene.addItem(item);
|
|
this.scene.addItem(item);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 添加文本
|
|
|
|
+ */
|
|
|
|
+ addTextName(parent, test) {
|
|
|
|
+ // 创建文本
|
|
|
|
+ const itemName = new STextItem(parent, test);
|
|
|
|
+ // 文本居中
|
|
|
|
+ const center = parent.boundingRect().center();
|
|
|
|
+ itemName.moveTo(center.x, center.y);
|
|
|
|
+ itemName.isTransform = false;
|
|
|
|
+ },
|
|
|
|
+
|
|
// 解析设备点
|
|
// 解析设备点
|
|
mapEquipment(val) {
|
|
mapEquipment(val) {
|
|
val.forEach((item) => {
|
|
val.forEach((item) => {
|