diff --git a/src/assets/less/common.less b/src/assets/less/common.less index d76d2cbb..351af8d6 100644 --- a/src/assets/less/common.less +++ b/src/assets/less/common.less @@ -124,7 +124,6 @@ /*弹出modal 先有content后有body 故滚动条控制在body上*/ .ant-modal-cust-warp .ant-modal-content { - height: 90% !important; overflow-y: hidden } diff --git a/src/components/MindMap.vue b/src/components/MindMap.vue index d0f2907d..99a13cd6 100644 --- a/src/components/MindMap.vue +++ b/src/components/MindMap.vue @@ -90,21 +90,32 @@ export default { data () { return { data: {}, - graph: null + graph: null, + loadEnd: false } }, watch: { mapData: { handler () { this.data = JSON.parse(JSON.stringify(this.mapData)) - this.$nextTick(() => { + if (this.loadEnd) { this.initMindMap() - }) + } }, deep: true, immediate: true + }, + loadEnd () { + if (this.loadEnd) { + this.initMindMap() + } } }, + mounted () { + this.$nextTick(() => { + this.loadEnd = true + }) + }, methods: { initMindMap () { G6.registerNode('tree-node', { @@ -194,6 +205,8 @@ export default { }, 'single-shape') this.graph = new G6.TreeGraph({ container: this.domId, + width: document.getElementById(this.domId).clientWidth, + height: document.getElementById(this.domId).clientHeight, modes: { default: [{ type: 'collapse-expand', diff --git a/src/views/businessSupport/dataCenter/modules/AddModel.vue b/src/views/businessSupport/dataCenter/modules/AddModel.vue index 371c4d6e..6dbdd1f6 100644 --- a/src/views/businessSupport/dataCenter/modules/AddModel.vue +++ b/src/views/businessSupport/dataCenter/modules/AddModel.vue @@ -1,6 +1,6 @@ diff --git a/src/views/businessSupport/dataCenter/modules/AddNodeModal.vue b/src/views/businessSupport/dataCenter/modules/AddNodeModal.vue index 1a2309c5..a44aab8e 100644 --- a/src/views/businessSupport/dataCenter/modules/AddNodeModal.vue +++ b/src/views/businessSupport/dataCenter/modules/AddNodeModal.vue @@ -1,9 +1,10 @@