From 025c945db0eca07a2e7cf6a1b432570810c610db Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 5 Jul 2022 18:44:32 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=A4=8D=E7=94=A8=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=97=B6=E7=9F=A9=E9=98=B5=E6=A8=A1=E5=BC=8FY?= =?UTF-8?q?=E6=96=B9=E5=90=91=E6=94=B9=E4=B8=BA=E5=8A=A8=E6=80=81=E5=8F=96?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=B9=B3=E9=93=BA=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E8=A7=86=E5=9B=BE=E6=97=B6=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/store/copy.js | 22 +- frontend/src/styles/deicon/demo_index.html | 282 ++++++++++++++++++- frontend/src/styles/deicon/iconfont.css | 54 +++- frontend/src/styles/deicon/iconfont.js | 2 +- frontend/src/styles/deicon/iconfont.json | 84 ++++++ frontend/src/styles/deicon/iconfont.ttf | Bin 27340 -> 29724 bytes frontend/src/styles/deicon/iconfont.woff | Bin 16992 -> 18300 bytes frontend/src/styles/deicon/iconfont.woff2 | Bin 14388 -> 15476 bytes 8 files changed, 425 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/canvas/store/copy.js b/frontend/src/components/canvas/store/copy.js index 3899b48036..0771f09a48 100644 --- a/frontend/src/components/canvas/store/copy.js +++ b/frontend/src/components/canvas/store/copy.js @@ -17,15 +17,21 @@ export default { left: 0 }, x: 1, - y: 108, + y: 216, sizex: 48, sizey: 24 } }, mutations: { copyMultiplexingComponents(state) { + let pYMax = 0 const _this = this state.isCut = false + state.componentData.forEach(item => { + if (item.y > pYMax) { + pYMax = item.y + } + }) const canvasStyleData = state.canvasStyleData const curCanvasScale = state.curCanvasScale const componentGap = state.componentGap @@ -33,7 +39,7 @@ export default { const component = { ...deepCopy(state.curMultiplexingComponents[viewId]), - ...deepCopy(state.viewBase), + ...deepCopy(deepCopy(state.viewBase)), 'auxiliaryMatrix': canvasStyleData.auxiliaryMatrix } @@ -43,6 +49,8 @@ export default { const width = component.sizex * curCanvasScale.matrixStyleOriginWidth // 取余 平铺4个 此处x 位置偏移 component.x = component.x + component.sizex * tilePosition + // Y 方向根据当前应该放置的最大值 加上50矩阵余量 + component.y = pYMax + 50 + state.viewBase.sizex * divisiblePosition component.style.left = (component.x - 1) * curCanvasScale.matrixStyleOriginWidth component.style.top = (component.y - 1) * curCanvasScale.matrixStyleOriginHeight component.style.width = width @@ -85,17 +93,7 @@ export default { data.style.top += 20 data.style.left += 20 } - - // if (isMouse) { - // data.style.top = state.menuTop - // data.style.left = state.menuLeft - // } else { - // data.style.top += 10 - // data.style.left += 10 - // } - data.id = generateID() - // 如果是用户视图 测先进行底层复制 if (data.type === 'view') { chartCopy(data.propValue.viewId, state.panel.panelInfo.id).then(res => { diff --git a/frontend/src/styles/deicon/demo_index.html b/frontend/src/styles/deicon/demo_index.html index a4ac5390dd..401316c424 100644 --- a/frontend/src/styles/deicon/demo_index.html +++ b/frontend/src/styles/deicon/demo_index.html @@ -54,6 +54,78 @@