mirror of
https://github.com/dataease/dataease.git
synced 2026-05-20 19:48:18 +08:00
feat: 条件过滤组件公共功能
This commit is contained in:
@@ -18,25 +18,7 @@ const defaultOptions = {
|
||||
attrs: {
|
||||
multiple: false,
|
||||
placeholder: '请选择',
|
||||
datas: [
|
||||
{
|
||||
id: '0',
|
||||
text: '北京'
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
text: '上海'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
text: '广东'
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
text: '深圳'
|
||||
}
|
||||
|
||||
],
|
||||
datas: [],
|
||||
key: 'id',
|
||||
label: 'text',
|
||||
value: 'id'
|
||||
@@ -44,7 +26,8 @@ const defaultOptions = {
|
||||
value: ''
|
||||
},
|
||||
defaultClass: 'text-filter',
|
||||
component: 'de-select'
|
||||
component: 'de-select',
|
||||
filterDialog: true
|
||||
}
|
||||
|
||||
class TextSelectServiceImpl extends WidgetService {
|
||||
@@ -63,6 +46,16 @@ class TextSelectServiceImpl extends WidgetService {
|
||||
beforeToDraw() {
|
||||
|
||||
}
|
||||
|
||||
setOptionDatas(data) {
|
||||
this.options.attrs.datas = data
|
||||
}
|
||||
|
||||
filterFieldMethod(fields) {
|
||||
return fields.filter(field => {
|
||||
return field['deType'] === 0
|
||||
})
|
||||
}
|
||||
}
|
||||
const textSelectServiceImpl = new TextSelectServiceImpl({ name: 'textSelectWidget' })
|
||||
export default textSelectServiceImpl
|
||||
|
||||
Reference in New Issue
Block a user