diff --git a/ant-design-vue-jeecg/src/views/seknowgroup/atlas/js/main1.js b/ant-design-vue-jeecg/src/views/seknowgroup/atlas/js/main1.js index 35742af..b575ef5 100644 --- a/ant-design-vue-jeecg/src/views/seknowgroup/atlas/js/main1.js +++ b/ant-design-vue-jeecg/src/views/seknowgroup/atlas/js/main1.js @@ -244,35 +244,31 @@ export let threeMainFunction = function(e) { var ids = id.indexOf('=') var idsur = id.substring(ids + 1) var xhr = new XMLHttpRequest(); - var url='http://localhost:8080/jeecg-boot/seknowgroup/seKnowGroup/zzzztp'; + var url=process.env.VUE_APP_API_BASE_URL+'/seknowgroup/seKnowGroup/zzzztp?id='+idsur; xhr.open('GET', url, false); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) { - xhr.send() console.log(2222); // 从服务器获得数据 - console.log(xhr.responseText); + var jsonObj = JSON.parse(xhr.responseText) + // 获取 nodes 数组和 links 数组 + nodestemp = jsonObj.nodes; + linkstemp = jsonObj.links; + +// 输出结果 + console.log(nodestemp); + console.log(linkstemp); + /* var stemp= xhr.responseText; + console.log(stemp); + console.log('aaaa',stemp.nodes) + console.log('bbbb',stemp.links)*/ } }; xhr.send(); e.exports = { - nodes: [{ - name: "城市数据" - }, { - name: "交通" - }, { - name: "社区" - }, { - name: "社交" - }, { - name: "民生" - }], - links: [{ - source: "城市数据", - target: "交通", - value: .75 - }] + nodes: nodestemp, + links: linkstemp } console.log(3333); }]); \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java index 1c0b47f..e126ebc 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java @@ -184,7 +184,7 @@ public class SeKnowGroupController extends JeecgController zzzztp(@RequestParam(name="id",required=true) String id) { + public Exports zzzztp(@RequestParam(name="id",required=true) String id) { //最多显示三层结构 List nodelist = new ArrayList<>(); //开始根据id查找中心知识点id @@ -244,7 +244,7 @@ public class SeKnowGroupController extends JeecgController