From d29346248eaac5d9f83bc17401f88e96ded95ffd Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Fri, 17 Mar 2023 17:43:58 +0800 Subject: [PATCH] fix: bug#10537 --- .../system/Department/components/LeftTree.vue | 117 ++++++++++-------- src/views/system/User/index.vue | 12 +- 2 files changed, 70 insertions(+), 59 deletions(-) diff --git a/src/views/system/Department/components/LeftTree.vue b/src/views/system/Department/components/LeftTree.vue index aa741a5c..7386aaf3 100644 --- a/src/views/system/Department/components/LeftTree.vue +++ b/src/views/system/Department/components/LeftTree.vue @@ -21,56 +21,59 @@ - - - - +
+ + + +
+ +
{ if (row.parentId) { childrens = row.children; } else childrens = treeData.value; - const indexs = childrens.length > 0 ? childrens?.map((item) => item.sortIndex) :[0] - sortIndex = - Math.max(...indexs) + 1; + const indexs = + childrens.length > 0 + ? childrens?.map((item) => item.sortIndex) + : [0]; + sortIndex = Math.max(...indexs) + 1; } dialog.selectItem = { ...row, sortIndex }; @@ -248,5 +253,11 @@ function init() { } } } + + .loading { + display: flex; + justify-content: center; + margin-top: 20px; + } } diff --git a/src/views/system/User/index.vue b/src/views/system/User/index.vue index cf9c8007..8d6128ba 100644 --- a/src/views/system/User/index.vue +++ b/src/views/system/User/index.vue @@ -92,7 +92,7 @@ }" :popConfirm="{ title: `确认删除`, - onConfirm: () => table.clickDel(slotProps), + onConfirm: () => table.clickDel(slotProps.id), }" :disabled="slotProps.status" > @@ -223,10 +223,10 @@ const table = { dialog.type = type; dialog.visible = true; }, - changeStatus: (row: any) => { + changeStatus: ({ id, status }: any) => { const params = { - id: row.id, - status: row.status === 0 ? 1 : 0, + status: status === 0 ? 1 : 0, + id, }; changeUserStatus_api(params).then(() => { message.success('操作成功'); @@ -234,8 +234,8 @@ const table = { }); }, // 删除 - clickDel: (row: any) => { - deleteUser_api(row.id).then(() => { + clickDel: (id: string) => { + deleteUser_api(id).then(() => { message.success('操作成功'); table.refresh(); });