forked from github/dataease
fix: 行权限无法过滤下拉组件默认值#7195
This commit is contained in:
parent
0b5b0304ab
commit
0a546a1821
@ -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
|
||||
// 下拉框弹出时,设置弹框的宽度
|
||||
|
Loading…
Reference in New Issue
Block a user