From 25a71fa66c68d64ce92d122ab83cbdca58256c71 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Thu, 5 Jun 2025 09:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/8232=E3=80=91=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEJSelectDept=E7=BB=84=E4=BB=B6=E5=80=BC?= =?UTF-8?q?=E6=B2=A1=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Form/src/jeecg/hooks/useTreeBiz.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jeecgboot-vue3/src/components/Form/src/jeecg/hooks/useTreeBiz.ts b/jeecgboot-vue3/src/components/Form/src/jeecg/hooks/useTreeBiz.ts index 93ab00ae..ee8da4a6 100644 --- a/jeecgboot-vue3/src/components/Form/src/jeecg/hooks/useTreeBiz.ts +++ b/jeecgboot-vue3/src/components/Form/src/jeecg/hooks/useTreeBiz.ts @@ -2,6 +2,7 @@ import type { Ref } from 'vue'; import { inject, reactive, ref, computed, unref, watch, nextTick } from 'vue'; import { TreeActionType } from '/@/components/Tree'; import { listToTree } from '/@/utils/common/compUtils'; +import { isEqual } from 'lodash-es'; export function useTreeBiz(treeRef, getList, props, realProps, emit) { //接收下拉框选项 @@ -22,7 +23,7 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) { const getCheckStrictly = computed(() => (realProps.multiple ? props.checkStrictly : true)); // 是否是首次加载回显,只有首次加载,才会显示 loading let isFirstLoadEcho = true; - + let prevSelectValues = []; /** * 监听selectValues变化 */ @@ -32,12 +33,17 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) { if(!values){ return; } - if (openModal.value == false && values.length > 0) { + // update-begin--author:liaozhiyang---date:20250604---for:【issues/8232】代码设置JSelectDept组件值没翻译 + if (values.length > 0) { + // 防止多次请求 + if (isEqual(values, prevSelectValues)) return; + prevSelectValues = values; loadingEcho.value = isFirstLoadEcho; isFirstLoadEcho = false; onLoadData(null, values.join(',')).finally(() => { loadingEcho.value = false; }); + // update-end--author:liaozhiyang---date:20250604---for:【issues/8232】代码设置JSelectDept组件值没翻译 } }, { immediate: true }