king
2020-04-03 4c6bdfe1f3557e49a315c1564bcb6164c0bc7faa
src/tabviews/commontable/index.jsx
@@ -29,9 +29,10 @@
class NormalTable extends Component {
  static propTpyes = {
    param: PropTypes.any,        // 其他页面传递的搜索条件等参数
    MenuID: PropTypes.string,    // 菜单Id
    MenuNo: PropTypes.string,    // 菜单参数
    MenuName: PropTypes.string,  // 菜单参数
    MenuID: PropTypes.string     // 菜单Id
    MenuName: PropTypes.string   // 菜单名称
  }
  state = {
@@ -76,13 +77,13 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { permAction } = this.props
    const { permAction, param } = this.props
    let param = {
    let _param = {
      func: 'sPC_Get_LongParam',
      MenuID: this.props.MenuID
    }
    let result = await Api.getSystemCacheConfig(param)
    let result = await Api.getSystemCacheConfig(_param)
    if (result.status) {
      let config = ''
@@ -236,6 +237,10 @@
      config.columns.forEach(col => {
        if (_hideCol.includes(col.uuid)) return
        // if (col.linkThdMenu && !permAction[col.linkThdMenu.MenuID]) {
        //   col.linkThdMenu = ''
        // }
        if (col.type === 'colspan' && col.sublist) {
          let _col = JSON.parse(JSON.stringify(col))
          let subColumn = []
@@ -259,8 +264,12 @@
      }
      let valid = true // 搜索条件必填验证
      config.search.forEach(field => {
        if (field.required === 'true' && !field.initval) {
      config.search.forEach(item => {
        if (item.type === 'text' && param && param.searchkey === item.field) {
          item.initval = param.searchval
        }
        if (item.required === 'true' && !item.initval) {
          valid = false
        }
      })
@@ -1023,6 +1032,34 @@
    this.setState({userParam: param})
  }
  linkTrigger = (menu) => {
    const { tabviews, MenuID } = this.props
    menu.selected = true
    let index = 0
    let isexit = false
    let tabs = tabviews.map((tab, i) => {
      tab.selected = false
      if (tab.MenuID === MenuID) {
        index = i
      } else if (tab.MenuID === menu.MenuID) {
        tab.param = menu.param
        tab.selected = true
        isexit = true
      }
      return tab
    })
    if (!isexit) {
      tabs.splice(index + 1, 0, menu)
    }
    this.props.modifyTabview(tabs)
  }
  settingSubmit = () => {
    const { userParam } = this.state
    let _LongParam = ''
@@ -1088,6 +1125,15 @@
      if (selectTab && selectTab.MenuID === this.props.MenuID) {
        this.setShortcut()
      }
    } else if (nextProps.param && !is(fromJS(this.props.param), fromJS(nextProps.param))) {
      let search = this.state.search.map(item => {
        if (item.type === 'text' && item.key === nextProps.param.searchkey) {
          item.value = nextProps.param.searchval
        }
        return item
      })
      this.refreshbysearch(search)
    }
  }
@@ -1160,6 +1206,7 @@
                loading={this.state.loading}
                refreshdata={this.refreshbytable}
                buttonTrigger={this.buttonTrigger}
                linkTrigger={this.linkTrigger}
                handleTableId={this.handleTableId}
              />
            </div> : null