From 0c515e849e2cf0e9302b1015398e035ee32b49ad Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Sat, 4 Mar 2023 10:45:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?update:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E6=A8=A1=E5=9D=97a-=E7=BB=84=E4=BB=B6=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BAj-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/components/Notice.vue | 4 +- .../Layout/components/NoticeInfo.vue | 8 +- src/components/Layout/components/UserInfo.vue | 16 ++-- .../Center/components/EditInfoDialog.vue | 80 +++++++++---------- .../Center/components/EditPasswordDialog.vue | 26 +++--- src/views/account/Center/index.vue | 36 ++++----- .../components/ViewDialog.vue | 54 ++++++------- .../account/NotificationRecord/index.vue | 7 +- .../components/EditDialog.vue | 46 +++++------ .../NotificationSubscription/index.vue | 4 +- 10 files changed, 140 insertions(+), 141 deletions(-) diff --git a/src/components/Layout/components/Notice.vue b/src/components/Layout/components/Notice.vue index 509c502a..07423bc1 100644 --- a/src/components/Layout/components/Notice.vue +++ b/src/components/Layout/components/Notice.vue @@ -1,6 +1,6 @@ - + diff --git a/src/components/Layout/components/NoticeInfo.vue b/src/components/Layout/components/NoticeInfo.vue index 1ea0b308..f07eec74 100644 --- a/src/components/Layout/components/NoticeInfo.vue +++ b/src/components/Layout/components/NoticeInfo.vue @@ -1,7 +1,7 @@ diff --git a/src/components/Layout/components/UserInfo.vue b/src/components/Layout/components/UserInfo.vue index e0a2b4dc..68bfc63e 100644 --- a/src/components/Layout/components/UserInfo.vue +++ b/src/components/Layout/components/UserInfo.vue @@ -1,6 +1,6 @@ diff --git a/src/views/account/Center/components/EditInfoDialog.vue b/src/views/account/Center/components/EditInfoDialog.vue index da63fb32..fbbbd69d 100644 --- a/src/views/account/Center/components/EditInfoDialog.vue +++ b/src/views/account/Center/components/EditInfoDialog.vue @@ -1,79 +1,79 @@ diff --git a/src/views/system/Department/components/EditPermissionDialog.vue b/src/views/system/Department/components/EditPermissionDialog.vue index 42182b6f..11038ada 100644 --- a/src/views/system/Department/components/EditPermissionDialog.vue +++ b/src/views/system/Department/components/EditPermissionDialog.vue @@ -1,22 +1,21 @@ diff --git a/src/views/system/Department/components/LeftTree.vue b/src/views/system/Department/components/LeftTree.vue index 7057903b..bdc1dd9b 100644 --- a/src/views/system/Department/components/LeftTree.vue +++ b/src/views/system/Department/components/LeftTree.vue @@ -1,6 +1,6 @@ - +
{{ name }} - - - - - @@ -109,8 +73,10 @@
@@ -215,9 +181,24 @@ function refresh(id: string) { } // 弹窗 -const editDialogRef = ref(); // 新增弹窗实例 +const dialog = reactive({ + visible: false, + selectItem: {}, +}); const openDialog = (row: any = {}) => { - editDialogRef.value.openDialog(true, row); + // 计算默认排序值,为子列表中最大的排序值+1 + let sortIndex = row.sortIndex || 1; + if (!row.id) { + let childrens = [] as any[]; + if (row.parentId) { + childrens = row.children; + } else childrens = treeData.value; + sortIndex = + Math.max(...(childrens?.map((item) => item.sortIndex) || [0])) + 1; + } + + dialog.selectItem = { ...row, sortIndex }; + dialog.visible = true; }; init(); function init() { @@ -236,6 +217,7 @@ function init() { diff --git a/src/views/system/Department/device/index.vue b/src/views/system/Department/device/index.vue index cc474d9f..6927ba59 100644 --- a/src/views/system/Department/device/index.vue +++ b/src/views/system/Department/device/index.vue @@ -13,7 +13,7 @@ @cancelSelect="table.cancelSelect" >