dataease/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js

66 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-03-31 18:23:43 +08:00
import { WidgetService } from '../service/WidgetService'
const defaultOptions = {
name: 'textInputWidget',
2021-04-01 13:33:40 +08:00
icon: 'iconfont icon-shuru',
2021-03-31 18:23:43 +08:00
label: '文本搜索',
style: {
width: 100,
height: 34,
borderWidth: '',
borderColor: '',
borderRadius: '',
fontSize: 14,
fontWeight: 500,
lineHeight: '',
letterSpacing: 0,
textAlign: '',
color: '',
backgroundColor: ''
},
2021-04-01 13:33:40 +08:00
defaultClass: 'text-filter',
2021-03-31 18:23:43 +08:00
component: 'de-input-search',
options: {
refId: '1234567890',
attrs: {
placeholder: '请输入关键字'
},
value: ''
2021-04-08 18:18:08 +08:00
},
filterDialog: true
2021-03-31 18:23:43 +08:00
}
class TextInputServiceImpl extends WidgetService {
constructor(options) {
Object.assign(options, defaultOptions)
super(options)
}
initWidget() {
// console.log('this is first initWidget')
}
toDrawWidget() {
// console.log('this is first toDrawWidget')
}
// 移动到画布之前回掉
beforeToDraw() {
}
2021-04-01 13:33:40 +08:00
dynamicStype() {
return {
'background-color': 'rgba(35,190,239,.1)'
}
}
2021-04-08 18:18:08 +08:00
filterFieldMethod(fields) {
return fields.filter(field => {
return field['deType'] === 0
})
}
2021-04-01 13:33:40 +08:00
// dynamicIconStype() {
// return {
// color: '#23beef'
// }
// }
2021-03-31 18:23:43 +08:00
}
const textInputServiceImpl = new TextInputServiceImpl({ name: 'textInputWidget' })
export default textInputServiceImpl