Merge pull request #7797 from dataease/pr@dev@fix_filter_select_row_permission

fix: 行权限无法过滤下拉组件默认值#7195
This commit is contained in:
fit2cloud-chenyw 2024-01-24 16:33:06 +08:00 committed by GitHub
commit eb4a81c92a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -554,6 +554,7 @@ export default {
if (this.isCustomSortWidget && this.element.options.attrs?.sort?.sort === 'custom') {
tempData = mergeCustomSortOption(this.element.options.attrs.sort.list, tempData)
}
this.filterInvalidValue(tempData)
return tempData.map(item => {
return {
id: item,
@ -561,6 +562,20 @@ export default {
}
})
},
filterInvalidValue(data) {
if (this.value === null) {
return
}
if (!data.length) {
this.value = null
return
}
if (this.element.options.attrs.multiple) {
this.value = this.value.filter(item => data.includes(item))
} else {
this.value = data.includes(this.value) ? this.value : null
}
},
setOptionWidth(event) {
this.onFocus = true
//