king
2019-12-16 c0930736f5b5955efecdac4c0ca85957d4f7b574
src/templates/modalconfig/index.jsx
@@ -75,6 +75,11 @@
      _config.setting.title = editAction.label
    }
    if (menu.LongParam.tables && menu.LongParam.tables.length > 0 && _config.tables.length === 0) {
      // 主菜单已有选择的表名,模态框没有表名时,复制主菜单表名
      _config.tables = menu.LongParam.tables
    }
    this.setState({
      config: _config,
      selectedTables: _config.tables || [],
@@ -483,10 +488,14 @@
      let _config = JSON.parse(JSON.stringify(this.state.config))
      if ((res.type === 'select' || res.type === 'link') && res.resourceType === '1') {
        let sql = 'select ' + res.valueField + ',' + res.valueText + ' from (' + res.dataSource + ')'
        if (res.orderBy) {
          sql = sql + ' ld order by ' + res.orderBy + ' ' + res.orderType
        let sql = 'select ' + res.valueField + ',' + res.valueText + ' from ' + res.dataSource
        if (res.type === 'link') {
          sql = 'select ' + res.valueField + ',' + res.valueText + ',' + res.linkField + ' from ' + res.dataSource
        }
        if (res.orderBy) {
          sql = sql + ' order by ' + res.orderBy + ' ' + res.orderType
        }
        console.log(sql)
        res.dataSourceSql = Utils.formatOptions(sql)
      }