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

65 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-jidu',
2021-03-31 18:23:43 +08:00
label: '季度',
2021-04-19 16:50:31 +08:00
defaultClass: 'time-filter'
}
const dialogPanel = {
options: {
attrs: {
placeholder: '请选择季度'
2021-04-19 16:50:31 +08:00
},
value: ''
},
defaultClass: 'time-filter',
component: 'de-quarter'
}
const drawPanel = {
type: 'custom',
2021-03-31 18:23:43 +08:00
style: {
2021-04-19 16:50:31 +08:00
width: 300,
2021-06-04 14:43:05 +08:00
height: 47,
2021-03-31 18:23:43 +08:00
fontSize: 14,
fontWeight: 500,
lineHeight: '',
letterSpacing: 0,
textAlign: '',
color: ''
},
2021-04-19 16:50:31 +08:00
component: 'de-quarter'
2021-03-31 18:23:43 +08:00
}
class TimeQuarterServiceImpl extends WidgetService {
2021-04-19 16:50:31 +08:00
constructor(options = {}) {
Object.assign(options, { name: 'timeQuarterWidget' })
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
// console.log('this is first initWidget')
}
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-03-31 18:23:43 +08:00
}
2021-04-08 18:18:08 +08:00
filterFieldMethod(fields) {
return fields.filter(field => {
return field['deType'] === 1
})
}
2021-03-31 18:23:43 +08:00
}
2021-04-19 16:50:31 +08:00
const timeQuarterServiceImpl = new TimeQuarterServiceImpl()
2021-03-31 18:23:43 +08:00
export default timeQuarterServiceImpl