diff --git a/frontend/src/components/pure/ms-tree-select/index.vue b/frontend/src/components/pure/ms-tree-select/index.vue index 3e72c563c5..d24395a7b6 100644 --- a/frontend/src/components/pure/ms-tree-select/index.vue +++ b/frontend/src/components/pure/ms-tree-select/index.vue @@ -7,6 +7,7 @@ :mouse-enter-delay="300" > import type { MsTreeNodeData } from '@/components/business/ms-tree/types'; + import useSelect from '@/hooks/useSelect'; import { filterTreeNode, findNodeByKey } from '@/utils'; import type { TreeFieldNames, TreeNodeData } from '@arco-design/web-vue'; - const props = defineProps<{ - data: TreeNodeData[]; - fieldNames?: TreeFieldNames; - disabled?: boolean; - multiple?: boolean; - }>(); + const props = withDefaults( + defineProps<{ + data: TreeNodeData[]; + fieldNames?: TreeFieldNames; + disabled?: boolean; + multiple?: boolean; + shouldCalculateMaxTag?: boolean; + }>(), + { + shouldCalculateMaxTag: true, + } + ); const selectValue = defineModel('modelValue', { required: true }); const inputValue = ref(''); const tempInputValue = ref(''); + const treeSelectRef = ref(); + const { maxTagCount, calculateMaxTag } = useSelect({ + selectRef: treeSelectRef, + selectVal: selectValue, + }); + watch( + () => selectValue.value, + () => { + if (props.shouldCalculateMaxTag !== false && props.multiple) { + calculateMaxTag(); + } + }, + { + immediate: true, + } + ); + watch( + () => props.data, + () => { + if (props.shouldCalculateMaxTag !== false && props.multiple) { + calculateMaxTag(); + } + } + ); + const getTreeSelectTooltip = computed(() => { return () => { let treeSelectTooltip = ''; diff --git a/frontend/src/views/api-test/management/components/management/api/apiTable.vue b/frontend/src/views/api-test/management/components/management/api/apiTable.vue index df7abee7c6..3080716347 100644 --- a/frontend/src/views/api-test/management/components/management/api/apiTable.vue +++ b/frontend/src/views/api-test/management/components/management/api/apiTable.vue @@ -726,7 +726,6 @@ multiple: true, treeCheckable: true, treeCheckStrictly: true, - maxTagCount: 1, }, }, { diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue index b6eff1407d..c740cdb8ea 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue @@ -818,7 +818,6 @@ multiple: true, treeCheckable: true, treeCheckStrictly: true, - maxTagCount: 1, }, }, { diff --git a/frontend/src/views/case-management/caseReview/components/detail/caseTable.vue b/frontend/src/views/case-management/caseReview/components/detail/caseTable.vue index 45222105b1..26ed93c006 100644 --- a/frontend/src/views/case-management/caseReview/components/detail/caseTable.vue +++ b/frontend/src/views/case-management/caseReview/components/detail/caseTable.vue @@ -1030,7 +1030,6 @@ multiple: true, treeCheckable: true, treeCheckStrictly: true, - maxTagCount: 1, }, }, {