From f458156d809d42cd17c3093ba8435dfc32561521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=AF=BA?= <1253070437@qq.com> Date: Tue, 18 Oct 2022 02:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=80=E4=B8=AA=E8=A7=92=E8=89=B2=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=95=8C=E9=9D=A2=E6=97=A0=E6=B3=95=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF=EF=BC=88=E8=A1=A5?= =?UTF-8?q?=E5=85=85=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/sys/role/grantResourceForm.vue | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/snowy-admin-web/src/views/sys/role/grantResourceForm.vue b/snowy-admin-web/src/views/sys/role/grantResourceForm.vue index 9ac0e8a9..ff24eb50 100644 --- a/snowy-admin-web/src/views/sys/role/grantResourceForm.vue +++ b/snowy-admin-web/src/views/sys/role/grantResourceForm.vue @@ -256,21 +256,23 @@ const convertData = () => { resultDataModel.grantInfoList = [] echoDatalist.value.forEach((table) => { - table.menu.forEach((item) => { - const grantInfo = { - menuId: '', - buttonInfo: [] - } - if (item.nameCheck) { - grantInfo.menuId = item.id - item.button.forEach((button) => { - if (button.check) { - grantInfo.buttonInfo.push(button.id) - } - }) - resultDataModel.grantInfoList.push(grantInfo) - } - }) + if (table.menu) { + table.menu.forEach((item) => { + const grantInfo = { + menuId: '', + buttonInfo: [] + } + if (item.nameCheck) { + grantInfo.menuId = item.id + item.button.forEach((button) => { + if (button.check) { + grantInfo.buttonInfo.push(button.id) + } + }) + resultDataModel.grantInfoList.push(grantInfo) + } + }) + } }) return resultDataModel }