From d6c6b77672fdc70a6f1cddc3d08a2e0af132c8c3 Mon Sep 17 00:00:00 2001 From: LiuHao Date: Wed, 31 Jan 2024 15:31:33 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UserSelect/index.vue | 35 +++++++++++++++++------------ 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/components/UserSelect/index.vue b/src/components/UserSelect/index.vue index 40c772f..e78bcb5 100644 --- a/src/components/UserSelect/index.vue +++ b/src/components/UserSelect/index.vue @@ -96,7 +96,7 @@ @@ -152,6 +152,18 @@ const queryParams = ref({ roleId: '' }); +const defaultSelectUserIds = computed(() => computedIds(prop.data)); + +/** 根据名称筛选部门树 */ +watchEffect( + () => { + deptTreeRef.value?.filter(deptName.value); + }, + { + flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行 + } +); + const confirm = () => { emit('update:modelValue', selectUserList.value); emit('confirmCallBack', selectUserList.value); @@ -166,23 +178,11 @@ const computedIds = (data) => { } else if (typeof data === 'number') { return [data]; } else { - console.warn('The data type of data should be array or string or number, but I received other'); + console.warn(' The data type of data should be array or string or number, but I received other'); return []; } }; -const defaultSelectUserIds = computed(() => computedIds(prop.data)); - -/** 根据名称筛选部门树 */ -watchEffect( - () => { - deptTreeRef.value?.filter(deptName.value); - }, - { - flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行 - } -); - /** 通过条件过滤节点 */ const filterNode = (value: string, data: any) => { if (!value) return true; @@ -277,6 +277,13 @@ const initSelectUser = async () => { selectUserList.value = data; } }; +const close = () => { + userDialog.closeDialog(); + tableRef.value.clearCheckboxReserve(); + tableRef.value.clearCheckboxRow(); + resetQuery(); + selectUserList.value = []; +}; onMounted(() => { initSelectUser();