【issues/8232】代码设置JSelectDept组件值没翻译

pull/8387/head
JEECG 2025-06-05 09:34:11 +08:00
parent fdc02fa68a
commit 25a71fa66c
1 changed files with 8 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import type { Ref } from 'vue';
import { inject, reactive, ref, computed, unref, watch, nextTick } from 'vue'; import { inject, reactive, ref, computed, unref, watch, nextTick } from 'vue';
import { TreeActionType } from '/@/components/Tree'; import { TreeActionType } from '/@/components/Tree';
import { listToTree } from '/@/utils/common/compUtils'; import { listToTree } from '/@/utils/common/compUtils';
import { isEqual } from 'lodash-es';
export function useTreeBiz(treeRef, getList, props, realProps, emit) { 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)); const getCheckStrictly = computed(() => (realProps.multiple ? props.checkStrictly : true));
// loading // loading
let isFirstLoadEcho = true; let isFirstLoadEcho = true;
let prevSelectValues = [];
/** /**
* 监听selectValues变化 * 监听selectValues变化
*/ */
@ -32,12 +33,17 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
if(!values){ if(!values){
return; return;
} }
if (openModal.value == false && values.length > 0) { // update-begin--author:liaozhiyang---date:20250604---forissues/8232JSelectDept
if (values.length > 0) {
//
if (isEqual(values, prevSelectValues)) return;
prevSelectValues = values;
loadingEcho.value = isFirstLoadEcho; loadingEcho.value = isFirstLoadEcho;
isFirstLoadEcho = false; isFirstLoadEcho = false;
onLoadData(null, values.join(',')).finally(() => { onLoadData(null, values.join(',')).finally(() => {
loadingEcho.value = false; loadingEcho.value = false;
}); });
// update-end--author:liaozhiyang---date:20250604---forissues/8232JSelectDept
} }
}, },
{ immediate: true } { immediate: true }