king
2021-01-27 34f4be5727bf4d0d231e0691a503cf0c9e5d00d3
src/utils/utils-update.js
@@ -1,13 +1,9 @@
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'
      // 兼容标签
@@ -18,7 +14,7 @@
        config.tabgroups.forEach(groupId => {
          let _group = {
            uuid: groupId,
            sublist: fromJS(config[groupId]).toJS()
          sublist: config[groupId]
          }
  
          delete config[groupId]
@@ -32,7 +28,7 @@
      // 兼容图表
      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') {
@@ -92,14 +88,14 @@
   * @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',
@@ -165,5 +161,4 @@
    config.Template = 'SubTable'
    return config
  }
}