|
@@ -82,18 +82,18 @@ export default {
|
|
|
this.isFull = screenfull.isFullscreen // 更新全屏状态
|
|
|
},
|
|
|
initGraph(data, id) {
|
|
|
- function replaceIds(obj) {
|
|
|
- if (typeof obj === 'object' && obj!== null) {
|
|
|
- if (obj.hasOwnProperty('id') && obj.hasOwnProperty('unique_id')) {
|
|
|
- obj.id = obj.unique_id;
|
|
|
- }
|
|
|
- if (obj.hasOwnProperty('children')) {
|
|
|
- obj.children && obj.children.forEach(child => replaceIds(child));
|
|
|
- }
|
|
|
- }
|
|
|
- return obj
|
|
|
- }
|
|
|
- data = replaceIds(data)
|
|
|
+ // function replaceIds(obj) {
|
|
|
+ // if (typeof obj === 'object' && obj!== null) {
|
|
|
+ // if (obj.hasOwnProperty('id') && obj.hasOwnProperty('unique_id')) {
|
|
|
+ // obj.id = obj.unique_id;
|
|
|
+ // }
|
|
|
+ // if (obj.hasOwnProperty('children')) {
|
|
|
+ // obj.children && obj.children.forEach(child => replaceIds(child));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // return obj
|
|
|
+ // }
|
|
|
+ // data = replaceIds(data)
|
|
|
let graph = null
|
|
|
const container = document.getElementById(id)
|
|
|
const width = container.scrollWidth
|