forked from github/dataease
Merge pull request #3838 from dataease/pr@dev@feat_filter_select_grid_custom_sort
feat(过滤器): 文本下拉列表增加自定义排序
This commit is contained in:
commit
754c8c8673
@ -71,7 +71,7 @@
|
||||
import { linkMultFieldValues, multFieldValues } from '@/api/dataset/dataset'
|
||||
import { getLinkToken, getToken } from '@/utils/auth'
|
||||
import bus from '@/utils/bus'
|
||||
import { isSameVueObj } from '@/utils'
|
||||
import { isSameVueObj, mergeCustomSortOption } from '@/utils'
|
||||
import { attrsMap, styleAttrs, textSelectGridWidget } from '@/components/widget/deWidget/serviceNameFn.js'
|
||||
|
||||
export default {
|
||||
@ -142,6 +142,9 @@ export default {
|
||||
cssArr() {
|
||||
const { brColor, wordColor, innerBgColor } = this.element.style
|
||||
return { brColor, wordColor, innerBgColor }
|
||||
},
|
||||
isCustomSortWidget() {
|
||||
return this.element.serviceName === 'textSelectGridWidget'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -354,7 +357,11 @@ export default {
|
||||
},
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
return data.filter(item => !!item).map(item => {
|
||||
let tempData = data.filter(item => !!item)
|
||||
if (this.isCustomSortWidget && this.element.options.attrs?.sort?.sort === 'custom') {
|
||||
tempData = mergeCustomSortOption(this.element.options.attrs.sort.list, tempData)
|
||||
}
|
||||
return tempData.map(item => {
|
||||
return {
|
||||
id: item,
|
||||
text: item
|
||||
|
@ -96,6 +96,9 @@ class TextSelectGridServiceImpl extends WidgetService {
|
||||
isSortWidget() {
|
||||
return true
|
||||
}
|
||||
isCustomSortWidget() {
|
||||
return true
|
||||
}
|
||||
fillValueDerfault(element) {
|
||||
const defaultV = element.options.value === null ? '' : element.options.value.toString()
|
||||
if (element.options.attrs.multiple) {
|
||||
|
Loading…
Reference in New Issue
Block a user