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

68 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-03-31 18:23:43 +08:00
import { WidgetService } from '../service/WidgetService'
2021-04-19 16:50:31 +08:00
const leftPanel = {
2021-04-01 13:33:40 +08:00
icon: 'iconfont icon-shuru',
2021-07-22 15:27:44 +08:00
label: 'deinputsearch.label',
2021-04-19 16:50:31 +08:00
defaultClass: 'text-filter'
}
const dialogPanel = {
options: {
attrs: {
2021-07-22 15:27:44 +08:00
placeholder: 'deinputsearch.placeholder',
2021-05-20 18:38:28 +08:00
viewIds: []
2021-04-19 16:50:31 +08:00
},
value: ''
},
defaultClass: 'text-filter',
component: 'de-input-search'
}
const drawPanel = {
type: 'custom',
2021-03-31 18:23:43 +08:00
style: {
2021-04-19 16:50:31 +08:00
width: 300,
// height: 45.5,
height: 90,
2021-03-31 18:23:43 +08:00
fontSize: 14,
fontWeight: 500,
lineHeight: '',
letterSpacing: 0,
textAlign: '',
2021-04-19 16:50:31 +08:00
color: ''
2021-04-08 18:18:08 +08:00
},
2021-04-19 16:50:31 +08:00
component: 'de-input-search'
2021-03-31 18:23:43 +08:00
}
class TextInputServiceImpl extends WidgetService {
2021-04-19 16:50:31 +08:00
constructor(options = {}) {
Object.assign(options, { name: 'textInputWidget' })
2021-03-31 18:23:43 +08:00
super(options)
2021-04-19 16:50:31 +08:00
this.filterDialog = true
this.showSwitch = false
2021-03-31 18:23:43 +08:00
}
2021-04-19 16:50:31 +08:00
initLeftPanel() {
const value = JSON.parse(JSON.stringify(leftPanel))
return value
2021-03-31 18:23:43 +08:00
}
2021-04-19 16:50:31 +08:00
initFilterDialog() {
const value = JSON.parse(JSON.stringify(dialogPanel))
return value
2021-03-31 18:23:43 +08:00
}
2021-04-19 16:50:31 +08:00
initDrawPanel() {
const value = JSON.parse(JSON.stringify(drawPanel))
return value
2021-04-01 13:33:40 +08:00
}
2021-04-19 16:50:31 +08:00
2021-04-08 18:18:08 +08:00
filterFieldMethod(fields) {
return fields.filter(field => {
return field['deType'] === 0
})
}
2021-03-31 18:23:43 +08:00
}
2021-04-19 16:50:31 +08:00
const textInputServiceImpl = new TextInputServiceImpl()
2021-03-31 18:23:43 +08:00
export default textInputServiceImpl