图谱修改

master
1654135867@qq.com 2 years ago
parent 3fca36e346
commit a9ca2a2c54
  1. 34
      ant-design-vue-jeecg/src/views/seknowgroup/atlas/js/main1.js
  2. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java

@ -244,35 +244,31 @@ export let threeMainFunction = function(e) {
var ids = id.indexOf('=') var ids = id.indexOf('=')
var idsur = id.substring(ids + 1) var idsur = id.substring(ids + 1)
var xhr = new XMLHttpRequest(); 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.open('GET', url, false);
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) { if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) {
xhr.send()
console.log(2222); 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(); xhr.send();
e.exports = { e.exports = {
nodes: [{ nodes: nodestemp,
name: "城市数据" links: linkstemp
}, {
name: "交通"
}, {
name: "社区"
}, {
name: "社交"
}, {
name: "民生"
}],
links: [{
source: "城市数据",
target: "交通",
value: .75
}]
} }
console.log(3333); console.log(3333);
}]); }]);

@ -184,7 +184,7 @@ public class SeKnowGroupController extends JeecgController<SeKnowGroup, ISeKnowG
*/ */
@RequestMapping(value = "/zzzztp") @RequestMapping(value = "/zzzztp")
public Result<?> zzzztp(@RequestParam(name="id",required=true) String id) { public Exports zzzztp(@RequestParam(name="id",required=true) String id) {
//最多显示三层结构 //最多显示三层结构
List<NodeName> nodelist = new ArrayList<>(); List<NodeName> nodelist = new ArrayList<>();
//开始根据id查找中心知识点id //开始根据id查找中心知识点id
@ -244,7 +244,7 @@ public class SeKnowGroupController extends JeecgController<SeKnowGroup, ISeKnowG
return Result.OK(exep); return exep;
} }
} }

Loading…
Cancel
Save