From d21375c2ecf6e417f4f0f1faad1fed319737488e Mon Sep 17 00:00:00 2001 From: zhaochong <1036192040@qq.com> Date: Sat, 29 Jul 2023 16:10:28 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E5=A5=BD=E7=9A=84=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form-design/items/layout/table/design.vue | 992 ++++++++++-------- 1 file changed, 556 insertions(+), 436 deletions(-) diff --git a/packages/form-design/items/layout/table/design.vue b/packages/form-design/items/layout/table/design.vue index 16d87d5..f007023 100644 --- a/packages/form-design/items/layout/table/design.vue +++ b/packages/form-design/items/layout/table/design.vue @@ -1,490 +1,610 @@ \ No newline at end of file + --> -- Gitee From 7cfa4c486def6ce665cf2125aa5584d268306876 Mon Sep 17 00:00:00 2001 From: zhaochong <1036192040@qq.com> Date: Sat, 29 Jul 2023 16:27:20 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8C=96=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form-design/items/layout/table/design.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/form-design/items/layout/table/design.vue b/packages/form-design/items/layout/table/design.vue index f007023..84fb6b1 100644 --- a/packages/form-design/items/layout/table/design.vue +++ b/packages/form-design/items/layout/table/design.vue @@ -139,7 +139,6 @@ import cloneDeep from 'lodash/cloneDeep'; import mixin from '../../mixin.js'; import draggable from 'vuedraggable'; -import { getModel, resetKey } from '../../base/options'; export default { mixins: [mixin], components: { @@ -214,8 +213,7 @@ export default { const nitem = cloneDeep(item); const key = item.type + '_' + new Date().getTime(); nitem.key = key; - resetKey(this.formTemplate.list); - nitem.model = getModel(item.type, this.formTemplate.list) || key; + nitem.model = key; // 找到index 插入 const oindex = parent.list.findIndex(t => t.key == item.key); -- Gitee From b719386dc49ee606a08e4d1a55fc510d15f85689 Mon Sep 17 00:00:00 2001 From: zhaochong <1036192040@qq.com> Date: Sat, 29 Jul 2023 18:52:55 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AF=8F=E8=A1=8Ctd?= =?UTF-8?q?=E6=95=B0=E4=B8=BA2=E6=97=B6=EF=BC=8C=E5=90=91=E5=8F=B3?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form-design/items/layout/table/design.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/form-design/items/layout/table/design.vue b/packages/form-design/items/layout/table/design.vue index 84fb6b1..9ba88b5 100644 --- a/packages/form-design/items/layout/table/design.vue +++ b/packages/form-design/items/layout/table/design.vue @@ -351,6 +351,7 @@ export default { const currentLeft = currentX; const targetRight = targetX + targetColspan - 1; const currentRight = currentX + currentColspan - 1; + //与目标完全接触,可以合并 if (targetLeft === currentLeft && targetColspan === currentColspan) { //找到了可以合并的td @@ -394,7 +395,7 @@ export default { let currentX = 0; //当前选中td的x坐标 const currentRowspan = this.record.trs[this.trIndex].tds[this.tdIndex].rowspan; //当前选中td的rowspan const currentColspan = this.record.trs[this.trIndex].tds[this.tdIndex].colspan; //当前选中td的colspan - let maxX = 0; //最大的x坐标 + let maxX = 2; //最大的x坐标 //找到被选中的td的x,y坐标 storeRecord.trs.forEach((tr, y) => { tr.tds.forEach((td, x) => { -- Gitee From d7cebc21ff515cccae677a138aa985bf8e035e7e Mon Sep 17 00:00:00 2001 From: zhaochong <1036192040@qq.com> Date: Sun, 30 Jul 2023 07:59:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AF=8F=E8=A1=8Ctd?= =?UTF-8?q?=E6=95=B0=E4=B8=BA3=E6=97=B6=EF=BC=8C=E5=90=91=E5=8F=B3?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form-design/items/layout/table/design.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/form-design/items/layout/table/design.vue b/packages/form-design/items/layout/table/design.vue index 9ba88b5..5893479 100644 --- a/packages/form-design/items/layout/table/design.vue +++ b/packages/form-design/items/layout/table/design.vue @@ -395,7 +395,7 @@ export default { let currentX = 0; //当前选中td的x坐标 const currentRowspan = this.record.trs[this.trIndex].tds[this.tdIndex].rowspan; //当前选中td的rowspan const currentColspan = this.record.trs[this.trIndex].tds[this.tdIndex].colspan; //当前选中td的colspan - let maxX = 2; //最大的x坐标 + let maxX = 3; //最大的x坐标 //找到被选中的td的x,y坐标 storeRecord.trs.forEach((tr, y) => { tr.tds.forEach((td, x) => { -- Gitee