From 7e3e54c3b18b1ff5cc2fd095e0153ea9928068c2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 02 六月 2023 11:50:05 +0800 Subject: [PATCH] 2023-06-02 --- src/menu/components/chart/antv-X6/index.jsx | 35 +++++------------------------------ 1 files changed, 5 insertions(+), 30 deletions(-) diff --git a/src/menu/components/chart/antv-X6/index.jsx b/src/menu/components/chart/antv-X6/index.jsx index 885210e..815cdf0 100644 --- a/src/menu/components/chart/antv-X6/index.jsx +++ b/src/menu/components/chart/antv-X6/index.jsx @@ -110,8 +110,6 @@ kapmaprender = () => { const { card } = this.state - preWork() - // #region 鍒濆鍖栫敾甯� const graph = new Graph({ container: document.getElementById(card.uuid + 'container'), @@ -197,10 +195,10 @@ target: graph, stencilGraphWidth: 200, stencilGraphHeight: 180, - collapsable: true, + // collapsable: true, groups: [ { - title: '鍩虹娴佺▼鍥�', + title: '閫氱敤鑺傜偣', name: 'group1', }, { @@ -218,7 +216,7 @@ rowHeight: 55, }, }) - document.getElementById('stencil').appendChild(stencil.container) + document.getElementById(card.uuid + 'stencil').appendChild(stencil.container) // #endregion // #region 蹇嵎閿笌浜嬩欢 @@ -599,34 +597,9 @@ }), ) stencil.load(imageNodes, 'group2') - // #endregion - - function preWork() { - // 杩欓噷鍗忓姪婕旂ず鐨勪唬鐮侊紝鍦ㄥ疄闄呴」鐩腑鏍规嵁瀹為檯鎯呭喌杩涜璋冩暣 - const container = document.getElementById(card.uuid + 'canvas') - const stencilContainer = document.createElement('div') - stencilContainer.id = 'stencil' - stencilContainer.classList.add('mk-stencil') - const graphContainer = document.createElement('div') - graphContainer.id = card.uuid + 'container' - graphContainer.classList.add('mk-container') - container.appendChild(stencilContainer) - container.appendChild(graphContainer) - } } updateComponent = (card) => { - if (this.state.card && (!is(fromJS(card.plot), fromJS(this.state.card.plot)) || !is(fromJS(card.style), fromJS(this.state.card.style)))) { - let _element = document.getElementById(card.uuid + 'canvas') - if (_element) { - _element.innerHTML = '' - } - this.$timer && clearTimeout(this.$timer) - this.$timer = setTimeout(() => { - this.viewrender() - }, 150) - } - card.width = card.plot.width card.name = card.plot.name card.subtype = card.plot.subtype @@ -687,6 +660,8 @@ </Popover> <NormalHeader config={card} updateComponent={this.updateComponent}/> <div className="canvas" style={{width: '100%', minHeight: card.plot.height, height: card.plot.height}} id={card.uuid + 'canvas'}> + <div id={card.uuid + 'stencil'} className="mk-stencil"></div> + <div id={card.uuid + 'container'} className="mk-container"></div> </div> <div className="component-name"> <div className="center"> -- Gitblit v1.8.0