From 2b3fb88b3c9fe843befd6ce01d55b3c98113725b Mon Sep 17 00:00:00 2001 From: tomaito Date: Sun, 9 May 2021 11:44:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=90=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E8=8F=9C=E5=8D=95=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=89=8D=E9=9D=A2=E4=BB=8D=E7=84=B6=E6=98=BE=E7=A4=BA=E5=8A=A0?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _web/src/views/system/menu/index.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/_web/src/views/system/menu/index.vue b/_web/src/views/system/menu/index.vue index 87180eee..78c0b11e 100644 --- a/_web/src/views/system/menu/index.vue +++ b/_web/src/views/system/menu/index.vue @@ -31,7 +31,7 @@ -
+
@@ -88,6 +88,7 @@ { title: '组件', dataIndex: 'component', + width: '20%', ellipsis: true }, { @@ -124,6 +125,7 @@ getMenuList(this.queryParam).then((res) => { if (res.success) { this.data = res.data + this.removeEmptyChildren(this.data) } }).finally(() => { this.loading = false @@ -131,6 +133,18 @@ this.sysDictTypeDropDown() }, + removeEmptyChildren(data) { + if (data == null || data.length === 0) return + for (let i = 0; i < data.length; i++) { + const item = data[i] + if (item.children != null && item.children.length === 0) { + item.children = null + } else { + this.removeEmptyChildren(item.children) + } + } + }, + typeFilter (type) { // eslint-disable-next-line eqeqeq const values = this.typeDict.filter(item => item.code == type)