king
2020-06-16 6c16e43cd6521460c804391c042348dbb14086fc
src/templates/subtableconfig/index.jsx
@@ -128,6 +128,10 @@
    let _activeKey =  editSubTab ? editSubTab.activeKey : editTab.activeKey
    if (!_config.version || _config.version < '1.0') {
      // 配置默认值,兼容
      // _config.version = '1.0'
    // 兼容图表
    if (!_config.charts) {
      _config.expand = false
@@ -140,6 +144,39 @@
        Hide: 'false',
        blacklist: []
      }]
      } else {
        _config.charts.forEach(card => {
          if (card.chartType === 'card') {
            card.details = card.details.map(_cell => {
              if (!_cell.fontSize) {
                _cell.fontSize = 14
              }
              if (!_cell.width) {
                _cell.width = 100
              } else if (_cell.width === 'helf') {
                _cell.width = 50
              } else if (_cell.width === 'third') {
                _cell.width = 33
              }
              if (_cell.bold === 'true') {
                _cell.fontWeight = 'normal'
              }
              if (!_cell.height) {
                _cell.height = 1
              }
              return _cell
            })
            if (card.widthType === 'ratio' && card.avatar && card.avatar.widthType !== 'ratio') {
              card.avatar.widthType = 'ratio'
              card.avatar.width = 32
            }
          }
        })
      }
    }
    this.setState({