| | |
| | | import { fromJS } from 'immutable' |
| | | import Utils from './utils.js' |
| | | |
| | | export default class UpdateUtils { |
| | | /** |
| | | * @description 升级主表信息 |
| | | * @param {Object} config 页面配置信息 |
| | | * @return {Object} config |
| | | */ |
| | | static updateCommonTable (config) { |
| | | export function updateCommonTable (config) { |
| | | if (!config.version || config.version < '1.0') { |
| | | config.version = '1.0' |
| | | // 兼容标签 |
| | |
| | | config.tabgroups.forEach(groupId => { |
| | | let _group = { |
| | | uuid: groupId, |
| | | sublist: fromJS(config[groupId]).toJS() |
| | | sublist: config[groupId] |
| | | } |
| | | |
| | | delete config[groupId] |
| | |
| | | // 兼容图表 |
| | | if (!config.charts) { |
| | | config.expand = true |
| | | config.charts = [{ uuid: Utils.getuuid(), label: '', title: '', chartType: 'table', icon: 'table', Hide: 'false', blacklist: [] }] |
| | | config.charts = [{ uuid: '$$normaltable', label: '', title: '', chartType: 'table', icon: 'table', Hide: 'false', blacklist: [] }] |
| | | } else { |
| | | config.charts.forEach(card => { |
| | | if (card.chartType === 'card') { |
| | |
| | | * @param {Object} config 页面配置信息 |
| | | * @return {Object} config |
| | | */ |
| | | static updateSubTable (config) { |
| | | export function updateSubTable (config) { |
| | | if (!config.version || config.version < '1.0') { |
| | | config.version = '1.0' |
| | | // 兼容图表 |
| | | if (!config.charts) { |
| | | config.expand = false |
| | | config.charts = [{ |
| | | uuid: Utils.getuuid(), |
| | | uuid: '$$normalsubtable', |
| | | label: '', |
| | | title: '', |
| | | chartType: 'table', |
| | |
| | | config.Template = 'SubTable' |
| | | |
| | | return config |
| | | } |
| | | } |