Merge pull request #8377 from dataease/pr@dev-v2@fix_system_filter

fix: 树形选择器点击节点选中数据无效
This commit is contained in:
fit2cloud-chenyw 2024-03-06 15:04:38 +08:00 committed by GitHub
commit 196ea6f095
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { ElTreeSelect } from 'element-plus-secondary' import { ElTreeSelect } from 'element-plus-secondary'
import { computed, reactive, ref, PropType, toRefs } from 'vue' import { computed, reactive, ref, PropType, toRefs, watch } from 'vue'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n() const { t } = useI18n()
interface TreeConfig { interface TreeConfig {
@ -60,6 +60,15 @@ const optionListNotSelect = computed(() => {
const clear = () => { const clear = () => {
state.currentStatus = [] state.currentStatus = []
} }
watch(
() => state.currentStatus,
() => {
treeChange()
},
{
immediate: true
}
)
defineExpose({ defineExpose({
clear clear
}) })
@ -74,7 +83,6 @@ defineExpose({
ref="filterTree" ref="filterTree"
:teleported="false" :teleported="false"
style="width: 100%" style="width: 100%"
@change="treeChange"
v-model="state.currentStatus" v-model="state.currentStatus"
:data="optionListNotSelect" :data="optionListNotSelect"
:highlight-current="true" :highlight-current="true"