浏览代码

新增模拟参数

YaolongHan 4 年之前
父节点
当前提交
6fd29827f3
共有 2 个文件被更改,包括 7588 次插入4 次删除
  1. 3 4
      docs/.vuepress/components/tuopu/baseTopu1.vue
  2. 7585 0
      docs/.vuepress/components/tuopu/data/data1.js

+ 3 - 4
docs/.vuepress/components/tuopu/baseTopu1.vue

@@ -13,6 +13,7 @@
 import { SGraphView, SGraphScene } from "@persagy-web/graph";
 import { PTopoParser } from "./PTopoParser";
 import axios from "axios";
+import { data } from "./data/data1.js"; //模拟接口返回参数
 export default {
   data() {
     return {
@@ -29,8 +30,6 @@ export default {
       this.view ? (this.view.scene = this.scene) : null;
       // 获取压缩包数据并解压
       this.getMapBlob();
-
-
     },
 
     // 请求获取地图的压缩包
@@ -63,8 +62,8 @@ export default {
       const parse = new PTopoParser();
 
       // 获取数据解析数据再将转化得实例添加到场景中
-
-      parse.parseData(res.data.content.elements);
+      // 测试数据
+      parse.parseData(data.content.elements);
       parse.markers.forEach((item) => {
         this.scene.addItem(item);
       });

文件差异内容过多而无法显示
+ 7585 - 0
docs/.vuepress/components/tuopu/data/data1.js