|
|
|
@ -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); |
|
|
|
|
}]); |