feat: 条件过滤组件公共功能

This commit is contained in:
fit2cloud-chenyw
2021-04-08 18:18:08 +08:00
parent 9b036083a3
commit 8f2c2fbc30
16 changed files with 203 additions and 41 deletions

View File

@@ -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