king
2020-12-21 4f2e4e84fd2cdca1407ac06c1b44319518be39b9
src/views/menudesign/index.jsx
@@ -227,6 +227,7 @@
          })
        } else if (item.type === 'table' && item.subtype === 'normaltable') {
          item.action && item.action.forEach(btn => {
            if (btn.origin) return
            buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`)
            _sort++
          })
@@ -246,8 +247,24 @@
    return buttons
  }
  filterConfig = (components) => {
    return components.map(item => {
      if (item.type === 'tabs') {
        item.subtabs.forEach(tab => {
          tab.components = this.filterConfig(tab.components)
        })
      } else if (item.type === 'table' && item.subtype === 'normaltable') {
        item.search = item.search.filter(a => !a.origin)
        item.action = item.action.filter(a => !a.origin)
        item.cols = item.cols.filter(a => !a.origin)
      }
      return item
    })
  }
  submitConfig = () => {
    const { config, openEdition } = this.state
    const { openEdition } = this.state
    let config = fromJS(this.state.config).toJS()
    if (config.MenuType === 'billPrint' && (!config.firstCount || !config.everyPCount)) {
      notification.warning({
@@ -271,6 +288,8 @@
      })
      return
    }
    config.components = this.filterConfig(config.components)
    if (config.enabled && this.verifyConfig()) {
      config.enabled = false
@@ -406,7 +425,12 @@
        
        if (res.status) {
          this.setState({
            menuloading: false
            menuloading: false,
            config: {...config, components: []}
          }, () => {
            this.setState({
              config: {...this.state.config, components: this.state.oriConfig.components}
            })
          })
          notification.success({
            top: 92,