From eb611bdac9d7b5bfac9cfffe9ccd968836e21d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Sun, 25 Jun 2023 15:49:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201=E3=80=81=E4=BF=AE=E5=A4=8Dcustomize?= =?UTF-8?q?=E5=8F=AA=E4=BF=9D=E7=95=99=E6=9C=80=E5=90=8E=E4=B8=80=E9=A1=B9?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A9=BA=E7=99=BD=E5=A4=84=EF=BC=8C=E5=86=8D?= =?UTF-8?q?=E6=89=93=E5=BC=80customize=E6=96=B0=E5=A2=9E=E9=80=89=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E4=B8=8A=E6=AC=A1=E7=A6=81=E7=94=A8=E7=9A=84=E9=A1=B9?= =?UTF-8?q?=E8=BF=98=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?2=E3=80=81=E8=A1=A8=E6=A0=BC=E6=9F=90=E4=B8=80=E5=88=97?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0-=E9=81=BF=E5=85=8D=E7=95=8C=E9=9D=A2=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/table/ColumnCustomize.vue | 15 ++++----------- src/components/table/administration/I18nTable.vue | 2 +- .../table/administration/OperationLogTable.vue | 6 +++--- src/components/table/administration/RoleTable.vue | 2 +- src/components/table/administration/UserTable.vue | 4 ++-- src/components/table/report/ReportTable.vue | 14 +++++++++++--- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/components/table/ColumnCustomize.vue b/src/components/table/ColumnCustomize.vue index 64b42c7a..39a9898b 100644 --- a/src/components/table/ColumnCustomize.vue +++ b/src/components/table/ColumnCustomize.vue @@ -70,8 +70,7 @@ export default { return { custom: [], dragIndex: -1, - selectList: [], - lastIndex: -1 + selectList: [] } }, created () { @@ -95,19 +94,13 @@ export default { this.selectList = this.custom.filter(item => item.show) // 最少保留一个选项 if (this.selectList.length === 1) { - let index = -1 - this.custom.find((item, i) => { - index = i - return item.prop === this.selectList[0].prop - }) - this.lastIndex = index - this.custom[index].disabled = true - } else if (this.lastIndex > -1) { + const obj = this.custom.find(item => item.prop === this.selectList[0].prop) + obj.disabled = true + } else if (this.selectList.length > 1) { this.custom.forEach(item => { // 该方案仅用于原始table列表无禁用的情况,目前无原始列表禁用的情况,后续有原始列表禁用的情况再修改 item.disabled = false }) - this.lastIndex = -1 } this.save() }, diff --git a/src/components/table/administration/I18nTable.vue b/src/components/table/administration/I18nTable.vue index a15b2bf4..edf1ee37 100644 --- a/src/components/table/administration/I18nTable.vue +++ b/src/components/table/administration/I18nTable.vue @@ -33,7 +33,7 @@
{{formatUsername(scope.row)}} {{dateFormatByAppearance(scope.row[item.prop])}} - {{scope.row[item.prop]}} + {{scope.row[item.prop] || '-'}} - {{scope.row[item.prop]}} + {{scope.row[item.prop] || '-'}}