From 6c60cd4442b4b85ec6967558a058adc398c65357 Mon Sep 17 00:00:00 2001 From: yangws <1607839436@qq.com> Date: Wed, 11 Sep 2024 14:42:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A7=A3=E5=86=B3=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=8F=AD=E7=BA=A7=E9=99=90=E5=88=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/classManage/index.vue | 13 ++++++++++--- src/renderer/src/views/profile/userInfo.vue | 14 ++++++++++---- .../src/views/resource/container/third-list.vue | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/views/classManage/index.vue b/src/renderer/src/views/classManage/index.vue index 23841e4..4fd66be 100644 --- a/src/renderer/src/views/classManage/index.vue +++ b/src/renderer/src/views/classManage/index.vue @@ -198,9 +198,14 @@ } }); listClassmain({entpid: userStore.deptId, status: 'open', pageSize: 100}).then(response => { + //清除已有的班级 + let arr = [...response.rows] + classList.value.forEach(item => { + const currentIndex = arr.findIndex(items => items.id === item.id) + if(currentIndex) arr.splice(currentIndex, 1) + }) //这里获取组装所有班级 - gradeTree.value = groupByCondition(response.rows, item => item.agekey); - console.log(gradeTree.value,'gradeTree.value') + gradeTree.value = groupByCondition(arr, item => item.agekey); }) } //将所有班级筛选成二级的数组 @@ -293,13 +298,15 @@ // } //新增班级 const btnSave = () => { - addClasses({classIds:classids.value.join(','),regId:userStore.userId}).then(res => { + addClasses({classIds:classids.value.join(','),userId:userStore.userId}).then(res => { if (res.code === 200) { dialogVisible.value = false ElMessage({ message: res.msg, type: 'success', }) + //清空所选中的值 + classids.value = [] }else{ ElMessage({ message: res.msg, diff --git a/src/renderer/src/views/profile/userInfo.vue b/src/renderer/src/views/profile/userInfo.vue index 98dcd52..a56a876 100644 --- a/src/renderer/src/views/profile/userInfo.vue +++ b/src/renderer/src/views/profile/userInfo.vue @@ -40,7 +40,7 @@ diff --git a/src/renderer/src/views/resource/container/third-list.vue b/src/renderer/src/views/resource/container/third-list.vue index b163266..7021b61 100644 --- a/src/renderer/src/views/resource/container/third-list.vue +++ b/src/renderer/src/views/resource/container/third-list.vue @@ -1,5 +1,5 @@