Merge pull request #1518 from dataease/pr@dev@fix_de_date

fix: 兼容老版本日期控件
This commit is contained in:
fit2cloud-chenyw 2021-12-24 19:05:08 +08:00 committed by GitHub
commit e069f2d0a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,8 +60,20 @@ export function mobile2MainCanvas(mainSource, mobileSource) {
export function panelInit(componentDatas) {
componentDatas.forEach(item => {
/* item.filters = (item.filters || []) */
item.filters = []
if (item.component && item.component === 'de-date') {
if (item.options.attrs && !item.options.attrs.default) {
item.options.attrs.default = {
isDynamic: false,
dkey: 0,
dynamicPrefix: 1,
dynamicInfill: 'day',
dynamicSuffix: 'before'
}
}
}
if (item.filters && item.filters.length > 0) {
item.filters = []
}
item.linkageFilters = (item.linkageFilters || [])
item.auxiliaryMatrix = (item.auxiliaryMatrix || false)
item.x = (item.x || 1)