From a6df74d63dd30a0f1343a9e9b31eef570c30f863 Mon Sep 17 00:00:00 2001 From: "meilin.huang" <954537473@qq.com> Date: Sat, 18 Nov 2023 21:15:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=99=9A=E6=8B=9F=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/ops/db/component/table/DbTableData.vue | 15 +++++++++++---- .../ops/db/component/table/DbTableDataOp.vue | 10 ++++++++++ mayfly_go_web/src/views/ops/tag/TagTreeList.vue | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/mayfly_go_web/src/views/ops/db/component/table/DbTableData.vue b/mayfly_go_web/src/views/ops/db/component/table/DbTableData.vue index 4a00a5cc..7a0cc50b 100644 --- a/mayfly_go_web/src/views/ops/db/component/table/DbTableData.vue +++ b/mayfly_go_web/src/views/ops/db/component/table/DbTableData.vue @@ -88,13 +88,13 @@ @@ -312,7 +312,12 @@ watch( watch( () => props.columns, (newValue: any) => { - setTableColumns(newValue); + // 赋值列字段值是否隐藏,state.columns多了一列索引列 + if (newValue.length + 1 == state.columns.length) { + for (let i = 0; i < newValue.length; i++) { + state.columns[i + 1].hidden = !newValue[i].show; + } + } }, { deep: true, @@ -507,7 +512,9 @@ const onGenerateJson = async () => { for (let selectionData of selectionDatas) { let obj = {}; for (let column of state.columns) { - obj[column.title] = selectionData[column.dataKey]; + if (column.show) { + obj[column.title] = selectionData[column.dataKey]; + } } jsonObj.push(obj); } diff --git a/mayfly_go_web/src/views/ops/db/component/table/DbTableDataOp.vue b/mayfly_go_web/src/views/ops/db/component/table/DbTableDataOp.vue index d5802a88..f6df1029 100644 --- a/mayfly_go_web/src/views/ops/db/component/table/DbTableDataOp.vue +++ b/mayfly_go_web/src/views/ops/db/component/table/DbTableDataOp.vue @@ -35,6 +35,16 @@ + + + + + + 提交 diff --git a/mayfly_go_web/src/views/ops/tag/TagTreeList.vue b/mayfly_go_web/src/views/ops/tag/TagTreeList.vue index cd43d44e..6700ee98 100644 --- a/mayfly_go_web/src/views/ops/tag/TagTreeList.vue +++ b/mayfly_go_web/src/views/ops/tag/TagTreeList.vue @@ -4,7 +4,7 @@ 添加
- +