king
2020-06-16 6c16e43cd6521460c804391c042348dbb14086fc
src/templates/comtableconfig/index.jsx
@@ -103,7 +103,9 @@
      })
    }
    if (!_config.version || _config.version < '1.0') {
    // 配置默认值,兼容
      // _config.version = '1.0'
    _config.Template = 'CommonTable'
    _config.easyCode = _config.easyCode || ''
@@ -137,6 +139,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
            }
          }
        })
      }
    }
    
    let _oriActions = []
@@ -249,13 +284,6 @@
        })
      }
    })
  }
  /**
   * @description 三级菜单切换模板(弃用)
   */
  changeTemplate = () => {
    this.props.handleView({tabview: 'template'})
  }
  getFuncNames = (data, funcNames, tableNames) => {
@@ -1378,7 +1406,6 @@
              <div>
                <EditComponent dict={this.state.dict} type="maintable" config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
                {/* <Button type="primary" onClick={this.changeTemplate}>{this.state.dict['header.menu.template.change']}</Button> */}
                <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['header.save']}</Button>
                <Button onClick={this.cancelConfig}>{this.state.dict['header.return']}</Button>
              </div>