king
2021-06-19 87c445887fe8d724ea124535234df974d3e1d58e
2021-06-19
17个文件已修改
471 ■■■■ 已修改文件
src/assets/css/main.scss 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.jsx 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/changeuserbutton/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/newpagebutton/index.jsx 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/tabbutton/index.jsx 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/actionform/index.jsx 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/datatable/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/main.scss
@@ -391,3 +391,16 @@
.ant-input[disabled] {
  background-color: #fafafa!important;
}
.ant-btn[disabled] {
  background-color: transparent!important;
  border-color: rgba(0, 0, 0, 0.35)!important;
  color: rgba(0, 0, 0, 0.35)!important;
}
.ant-btn.ant-btn-link {
  border-width: 0;
}
.button-list {
  .ant-btn.ant-btn-link {
    border-width: 1px;
  }
}
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -8,15 +8,15 @@
const { TextArea } = Input
const actionTypeOptions = {
  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width', 'controlField', 'controlVal'],
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'controlField', 'controlVal'],
  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width', 'controlField', 'controlVal'],
  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open', 'controlField', 'controlVal'],
  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width', 'controlField', 'controlVal']
  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width'],
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width'],
  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'],
  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'],
  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width']
}
class ActionForm extends Component {
@@ -35,6 +35,7 @@
    interType: null, // 接口类型:内部、外部
    funcType: null,  // 功能类型
    procMode: null,  // 参数方式
    Ot: null,
    requireOptions: [{
      value: 'notRequired',
      text: this.props.dict['header.form.notRequired']
@@ -91,10 +92,12 @@
    let _intertype = card.intertype || 'system'  // 接口类型
    let _funcType = card.funcType || ''          // 功能按钮默认类型
    let _procMode = card.procMode || 'system'    // 参数请求方式
    let _Ot = card.Ot || 'requiredSgl'    // 参数请求方式
    let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode)
    let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode, _Ot)
    this.setState({
      Ot: _Ot,
      openType: _opentype,
      interType: _intertype,
      procMode: _procMode,
@@ -137,7 +140,7 @@
    })
  }
  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode) => {
  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot) => {
    let _options = actionTypeOptions[_opentype] ? fromJS(actionTypeOptions[_opentype]).toJS() : [] // 选项列表
    
    if (_opentype === 'innerpage') {         // 新页面,可选模板(自定义时,可填入外部链接)
@@ -186,6 +189,10 @@
      }
    }
    if (_Ot !== 'notRequired' && _opentype !== 'excelOut') {
      _options.push('controlField', 'controlVal')
    }
    return _options
  }
@@ -210,10 +217,10 @@
   */
  optionChange = (key, value) => {
    const { card, type } = this.props
    const { openType, procMode } = this.state
    const { openType, procMode, Ot } = this.state
    if (key === 'OpenType') {
      let _options = this.getOptions(value, 'system', this.state.funcType, card.pageTemplate, 'system')
      let _options = this.getOptions(value, 'system', this.state.funcType, card.pageTemplate, 'system', Ot)
      let _fieldval = {}
      
@@ -270,7 +277,7 @@
        this.props.form.setFieldsValue(_fieldval)
      })
    } else if (key === 'funcType') {
      let _options = this.getOptions(openType, this.state.interType, value, card.pageTemplate, procMode)
      let _options = this.getOptions(openType, this.state.interType, value, card.pageTemplate, procMode, Ot)
      let _fieldval = {}
      this.setState({
@@ -334,7 +341,7 @@
      })
    } else if (key === 'pageTemplate') {
      let _fieldval = {}
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode)
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode, Ot)
      this.setState({
        formlist: this.state.formlist.map(item => {
@@ -357,7 +364,7 @@
        this.props.form.setFieldsValue(_fieldval)
      })
    } else if (key === 'intertype') {
      let _options = this.getOptions(openType, value, this.state.funcType, '', procMode)
      let _options = this.getOptions(openType, value, this.state.funcType, '', procMode, Ot)
      this.setState({
        interType: value,
@@ -379,7 +386,7 @@
        })
      })
    } else if (key === 'procMode') {
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', value)
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', value, Ot)
      this.setState({
        procMode: value,
@@ -392,6 +399,16 @@
          return item
        })
      })
    } else if (key === 'Ot') {
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', procMode, value)
      this.setState({
        Ot: value,
        formlist: this.state.formlist.map(item => {
          item.hidden = !_options.includes(item.key)
          return item
        })
      })
    } else if (key === 'sysInterface') {
      if (value === 'true') {
        this.props.form.setFieldsValue({
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -520,19 +520,19 @@
      type: 'select',
      key: 'controlField',
      label: '控制字段',
      tooltip: '显示控制字段,可根据行数据控制按钮是否显示。',
      tooltip: '禁用控制字段,可根据数据控制按钮是否禁用。',
      initVal: card.controlField || '',
      required: false,
      forbid: card.$type !== 'tableButton',
      // forbid: card.$type !== 'tableButton',
      options: [{label: '无', field: ''}, ...columns]
    },
    {
      type: 'text',
      key: 'controlVal',
      label: '控制值',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会隐藏,多个值用逗号分隔。',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会禁用,多个值用逗号分隔。',
      initVal: card.controlVal || '',
      forbid: card.$type !== 'tableButton',
      // forbid: card.$type !== 'tableButton',
      required: false
    }
  ]
src/menu/components/share/actioncomponent/index.jsx
@@ -187,7 +187,7 @@
    this.setState({
      visible: true,
      card: card,
      formlist: getActionForm(card, functip, config.setting, usefulFields, this.props.type, menulist, modules)
      formlist: getActionForm(card, functip, config.setting, usefulFields, this.props.type, menulist, modules, config.columns)
    })
  }
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -550,13 +550,6 @@
        </Col>
      )
    } else if (card.eleType === 'button') {
      if (card.$type === 'tableButton' && card.controlField) { // 表格中按钮隐藏控制
        if (data[card.controlField] === card.controlVal) {
          return null
        } else if (card.controlVal && card.controlVal.split(',').includes(data[card.controlField])) {
          return null
        }
      }
      let _data = data.$$type === 'extendCard' ? [] : [data]
      if (['exec', 'prompt', 'pop'].includes(card.OpenType)) {
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -2,7 +2,6 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Chart } from '@antv/g2'
// import { connect } from 'react-redux'
import DataSet from '@antv/data-set'
import { Spin, Empty, notification } from 'antd'
import moment from 'moment'
@@ -12,7 +11,6 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import UtilsDM from '@/utils/utils-datamanage.js'
// import { modifyTabview } from '@/store/action'
import MKEmitter from '@/utils/events.js'
import './index.scss'
@@ -1618,54 +1616,6 @@
      MKEmitter.emit('resetSelectLine', config.uuid, (data ? data.$$uuid : ''), null)
    })
    // if (plot.linkmenu && plot.linkmenu.length > 0) {
    //   let menu_id = plot.linkmenu.slice(-1)[0]
    //   let menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || ''
    //   chart.on('element:dblclick', (ev) => {
    //     if (!menu) {
    //       notification.warning({
    //         top: 92,
    //         message: '菜单已删除或没有访问权限!',
    //         duration: 5
    //       })
    //       return
    //     }
    //     try {
    //       let data = ev.data.data
    //       let primaryId = ''
    //       if (this.state.config.setting.primaryKey && data) {
    //         primaryId = data[this.state.config.setting.primaryKey] || ''
    //       }
    //       let newtab = {
    //         ...menu,
    //         selected: true,
    //         param: {
    //           $BID: primaryId
    //         }
    //       }
    //       let tabs = this.props.tabviews.filter(tab => {
    //         tab.selected = false
    //         return tab.MenuID !== newtab.MenuID
    //       })
    //       if (this.props.tabviews.length > tabs.length) {
    //         this.props.modifyTabview(fromJS(tabs).toJS())
    //       }
    //       this.setState({}, () => {
    //         tabs.push(newtab)
    //         this.props.modifyTabview(tabs)
    //       })
    //     } catch {
    //       console.warn('菜单打开失败!')
    //     }
    //   })
    // }
    if (plot.interaction && plot.interaction.length) {
      plot.interaction.forEach(t => {
        chart.interaction(t)
@@ -1727,18 +1677,4 @@
  }
}
// const mapStateToProps = (state) => {
//   return {
//     tabviews: state.tabviews,
//     permMenus: state.permMenus,
//   }
// }
// const mapDispatchToProps = (dispatch) => {
//   return {
//     modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews))
//   }
// }
// export default connect(mapStateToProps, mapDispatchToProps)(LineChart)
export default LineChart
src/tabviews/custom/index.jsx
@@ -737,7 +737,7 @@
        return component
      }
      if (component.wrap.datatype === 'static') {
      if (component.wrap && component.wrap.datatype === 'static') {
        component.format = ''
      }
src/tabviews/zshare/actionList/changeuserbutton/index.jsx
@@ -23,7 +23,23 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    disabled: false,
    loading: false
  }
  UNSAFE_componentWillMount () {
    const { btn, selectedData } = this.props
    let disabled = false
    if (btn.controlField && selectedData && selectedData.length > 0) { // 表格中按钮隐藏控制
      selectedData.forEach(item => {
        let s = item[btn.controlField] + ''
        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
          disabled = true
        }
      })
      this.setState({disabled})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -35,6 +51,24 @@
    if (position === 'toolbar') {
      MKEmitter.addListener('triggerBtnId', this.actionTrigger)
    }
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { btn, selectedData } = this.props
    if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
      let disabled = false
      if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制
        nextProps.selectedData.forEach(item => {
          let s = item[btn.controlField] + ''
          if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
            disabled = true
          }
        })
      }
      this.setState({disabled})
    }
  }
@@ -149,13 +183,14 @@
  render() {
    const { btn, show } = this.props
    const { loading } = this.state
    const { loading, disabled } = this.state
    if (show === 'actionList') {
      return (
        <Button
          icon={btn.icon}
          loading={loading}
          disabled={disabled}
          className={'mk-btn mk-' + btn.class}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
        >{btn.label}</Button>
@@ -166,6 +201,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          loading={loading}
          disabled={disabled}
          style={btn.style}
          icon={show === 'text' ? '' : (btn.icon || '')}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -28,7 +28,23 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    loading: false,
    disabled: false,
    primaryId: '',
  }
  UNSAFE_componentWillMount () {
    const { btn, selectedData } = this.props
    let disabled = false
    if (btn.controlField && selectedData && selectedData.length > 0) { // 表格中按钮隐藏控制
      selectedData.forEach(item => {
        let s = item[btn.controlField] + ''
        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
          disabled = true
        }
      })
      this.setState({disabled})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -40,6 +56,24 @@
    if (position === 'toolbar') {
      MKEmitter.addListener('triggerBtnId', this.actionTrigger)
    }
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { btn, selectedData } = this.props
    if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
      let disabled = false
      if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制
        nextProps.selectedData.forEach(item => {
          let s = item[btn.controlField] + ''
          if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
            disabled = true
          }
        })
      }
      this.setState({disabled})
    }
  }
@@ -408,13 +442,14 @@
  render() {
    const { btn, show } = this.props
    const { loading } = this.state
    const { loading, disabled } = this.state
    if (show === 'actionList') {
      return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
        <Button
          icon={btn.icon}
          loading={loading}
          disabled={disabled}
          className={'mk-btn mk-' + btn.class}
          onClick={() => {this.actionTrigger()}}
        >{btn.label}</Button>
@@ -426,6 +461,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          loading={loading}
          disabled={disabled}
          style={btn.style}
          icon={show === 'text' ? '' : (show === 'icon' ? (btn.icon || 'upload') : (btn.icon || ''))}
          onClick={() => {this.actionTrigger()}}
src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -21,7 +21,23 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    disabled: false,
    visible: false
  }
  UNSAFE_componentWillMount () {
    const { btn, selectedData } = this.props
    let disabled = false
    if (btn.controlField && selectedData && selectedData.length > 0) { // 表格中按钮隐藏控制
      selectedData.forEach(item => {
        let s = item[btn.controlField] + ''
        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
          disabled = true
        }
      })
      this.setState({disabled})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -33,6 +49,24 @@
    if (position === 'toolbar') {
      MKEmitter.addListener('triggerBtnId', this.actionTrigger)
    }
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { btn, selectedData } = this.props
    if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
      let disabled = false
      if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制
        nextProps.selectedData.forEach(item => {
          let s = item[btn.controlField] + ''
          if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
            disabled = true
          }
        })
      }
      this.setState({disabled})
    }
  }
@@ -156,12 +190,14 @@
  render() {
    const { btn, show } = this.props
    const { disabled } = this.state
    if (show === 'actionList') {
      return (
        <Button
          className={'mk-btn mk-' + btn.class}
          icon={btn.icon}
          disabled={disabled}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
        >{btn.label}</Button>
      )
@@ -171,6 +207,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          style={btn.style}
          disabled={disabled}
          icon={show === 'text' ? '' : (btn.icon || '')}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
        >{show === 'icon' && btn.icon ? '' : btn.label}</Button>
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -42,10 +42,26 @@
    btnconfig: null,
    loading: false,
    loadingNumber: '',
    disabled: false,
    checkParam: null
  }
  moduleParams = null
  UNSAFE_componentWillMount () {
    const { btn, selectedData } = this.props
    let disabled = false
    if (btn.controlField && selectedData && selectedData.length > 0) { // 表格中按钮隐藏控制
      selectedData.forEach(item => {
        let s = item[btn.controlField] + ''
        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
          disabled = true
        }
      })
      this.setState({disabled})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
@@ -60,6 +76,24 @@
      MKEmitter.addListener('triggerFormSubmit', this.actionSubmit)
    }
    MKEmitter.addListener('returnModuleParam', this.resetModuleParam)
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { btn, selectedData } = this.props
    if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
      let disabled = false
      if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制
        nextProps.selectedData.forEach(item => {
          let s = item[btn.controlField] + ''
          if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
            disabled = true
          }
        })
      }
      this.setState({disabled})
    }
  }
  componentWillUnmount () {
@@ -1698,7 +1732,7 @@
  render() {
    const { btn, show, style } = this.props
    const { loadingNumber, loading, visible } = this.state
    const { loadingNumber, loading, visible, disabled } = this.state
    if (show === 'actionList') {
      return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
@@ -1706,6 +1740,7 @@
          style={style}
          icon={btn.icon}
          loading={loading}
          disabled={disabled}
          className={'mk-btn mk-' + btn.class}
          onClick={() => {this.actionTrigger()}}
        >{(loadingNumber ? `(${loadingNumber})` : '') + btn.label}</Button>
@@ -1728,6 +1763,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          loading={loading}
          disabled={disabled}
          style={btn.style || style}
          icon={show === 'text' ? '' : (btn.icon || '')}
          onClick={() => {this.actionTrigger()}}
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -31,7 +31,23 @@
    visible: false,
    popData: null,
    primaryId: '',
    disabled: false,
    loading: false,
  }
  UNSAFE_componentWillMount () {
    const { btn, selectedData } = this.props
    let disabled = false
    if (btn.controlField && selectedData && selectedData.length > 0) { // 表格中按钮隐藏控制
      selectedData.forEach(item => {
        let s = item[btn.controlField] + ''
        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
          disabled = true
        }
      })
      this.setState({disabled})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -46,6 +62,24 @@
    }
    MKEmitter.addListener('openNewTab', this.openNewTab)
    MKEmitter.addListener('refreshPopButton', this.refreshPopButton)
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { btn, selectedData } = this.props
    if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
      let disabled = false
      if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制
        nextProps.selectedData.forEach(item => {
          let s = item[btn.controlField] + ''
          if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
            disabled = true
          }
        })
      }
      this.setState({disabled})
    }
  }
  componentWillUnmount () {
@@ -160,13 +194,14 @@
  render() {
    const { btn, show } = this.props
    const { loading, popData, primaryId } = this.state
    const { loading, popData, primaryId, disabled } = this.state
    return (
      <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
        {show === 'actionList' ? <Button
          className={'mk-btn mk-' + btn.class}
          icon={btn.icon}
          disabled={disabled}
          onClick={() => {this.actionTrigger()}}
          loading={loading}
        >{btn.label}</Button> : null}
@@ -174,6 +209,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          loading={loading}
          disabled={disabled}
          style={btn.style}
          icon={show === 'text' ? '' : (btn.icon || '')}
          onClick={() => {this.actionTrigger()}}
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -40,7 +40,23 @@
    tabledata: null,
    btnconfig: null,
    loading: false,
    disabled: false,
    loadingNumber: ''
  }
  UNSAFE_componentWillMount () {
    const { btn, selectedData } = this.props
    let disabled = false
    if (btn.controlField && selectedData && selectedData.length > 0) { // 表格中按钮隐藏控制
      selectedData.forEach(item => {
        let s = item[btn.controlField] + ''
        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
          disabled = true
        }
      })
      this.setState({disabled})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -52,6 +68,24 @@
    if (position === 'toolbar') {
      MKEmitter.addListener('triggerBtnId', this.actionTrigger)
    }
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { btn, selectedData } = this.props
    if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
      let disabled = false
      if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制
        nextProps.selectedData.forEach(item => {
          let s = item[btn.controlField] + ''
          if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
            disabled = true
          }
        })
      }
      this.setState({disabled})
    }
  }
@@ -1250,13 +1284,14 @@
  render() {
    const { btn, show } = this.props
    const { loadingNumber, loading } = this.state
    const { loadingNumber, loading, disabled } = this.state
    if (show === 'actionList') {
      return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
        <Button
          icon={btn.icon}
          loading={loading}
          disabled={disabled}
          className={'mk-btn mk-' + btn.class}
          onClick={() => {this.actionTrigger()}}
        >{loadingNumber ? `(${loadingNumber})` : '' + btn.label}</Button>
@@ -1268,6 +1303,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          loading={loading}
          disabled={disabled}
          style={btn.style}
          icon={show === 'text' ? '' : (btn.icon || '')}
          onClick={() => {this.actionTrigger()}}
src/tabviews/zshare/actionList/tabbutton/index.jsx
@@ -22,7 +22,23 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    disabled: false,
    primaryId: ''
  }
  UNSAFE_componentWillMount () {
    const { btn, selectedData } = this.props
    let disabled = false
    if (btn.controlField && selectedData && selectedData.length > 0) { // 表格中按钮隐藏控制
      selectedData.forEach(item => {
        let s = item[btn.controlField] + ''
        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
          disabled = true
        }
      })
      this.setState({disabled})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -34,6 +50,24 @@
    if (position === 'toolbar') {
      MKEmitter.addListener('triggerBtnId', this.actionTrigger)
    }
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { btn, selectedData } = this.props
    if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
      let disabled = false
      if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制
        nextProps.selectedData.forEach(item => {
          let s = item[btn.controlField] + ''
          if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
            disabled = true
          }
        })
      }
      this.setState({disabled})
    }
  }
@@ -148,12 +182,14 @@
  render() {
    const { btn, show } = this.props
    const { disabled } = this.state
    if (show === 'actionList') {
      return (
        <Button
          className={'mk-btn mk-' + btn.class}
          icon={btn.icon}
          disabled={disabled}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
        >{btn.label}</Button>
      )
@@ -163,6 +199,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          style={btn.style}
          disabled={disabled}
          icon={show === 'text' ? '' : (btn.icon || '')}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
        >{show === 'icon' && btn.icon ? '' : btn.label}</Button>
src/templates/sharecomponent/actioncomponent/actionform/index.jsx
@@ -38,6 +38,7 @@
    position: null,  // 按钮位置
    procMode: null,  // 外部接口参数处理方式
    pageTemplate: null,
    Ot: null,
    requireOptions: [{
      value: 'notRequired',
      text: this.props.dict['header.form.notRequired']
@@ -97,6 +98,7 @@
    let _funcType = card.funcType || ''         // 功能按钮默认类型
    let _tabTemplate = card.tabTemplate         // 按钮为标签页时,标签类型:三级菜单或表单标签页
    let _pageTemplate = card.pageTemplate       // 新页面类型
    let _Ot = card.Ot || 'requiredSgl'
    if (_opentype === 'outerpage') {
      card.pageTemplate = 'custom'
@@ -104,9 +106,10 @@
    }
    let _tabs = this.props.tabs.filter(tab => tab.type === 'SubTable')
    let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode)
    let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode, _Ot)
    
    this.setState({
      Ot: _Ot,
      openType: _opentype,
      pageTemplate: _pageTemplate,
      interType: _intertype,
@@ -172,7 +175,7 @@
    }
  }
  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode) => {
  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode, _Ot) => {
    let _options = fromJS(actionTypeOptions[_opentype]).toJS() // 选项列表
    
    if (_opentype === 'innerpage') {         // 新页面,可选模板(自定义时,可填入外部链接)
@@ -227,6 +230,10 @@
      _options.push('resetPageIndex')
    }
    if (_Ot !== 'notRequired' && _opentype !== 'excelOut') {
      _options.push('controlField', 'controlVal')
    }
    return _options
  }
@@ -234,11 +241,11 @@
   * @description 切换
   */
  optionChange = (key, value) => {
    const { openType, funcType, procMode } = this.state
    const { openType, funcType, procMode, Ot } = this.state
    const { card } = this.props
    if (key === 'OpenType') {
      let _options = this.getOptions(value, 'system', '', this.state.pageTemplate, card.tabTemplate, 'system')
      let _options = this.getOptions(value, 'system', '', this.state.pageTemplate, card.tabTemplate, 'system', Ot)
      let _fieldval = {}
      let _formlist = this.state.formlist.map(item => {
        item.hidden = !_options.includes(item.key)
@@ -343,7 +350,7 @@
    //     this.props.form.setFieldsValue(_fieldval)
    //   })
    } else if (key === 'funcType') {
      let _options = this.getOptions('funcbutton', this.state.interType, value, card.pageTemplate, card.tabTemplate, procMode)
      let _options = this.getOptions('funcbutton', this.state.interType, value, card.pageTemplate, card.tabTemplate, procMode, Ot)
      let _fieldval = {}
      this.setState({
@@ -397,7 +404,7 @@
        this.props.form.setFieldsValue(_fieldval)
      })
    } else if (key === 'pageTemplate') {
      let _options = this.getOptions('innerpage', this.state.interType, this.state.funcType, value, card.tabTemplate, procMode)
      let _options = this.getOptions('innerpage', this.state.interType, this.state.funcType, value, card.tabTemplate, procMode, Ot)
      let _fieldval = {}
      this.setState({
@@ -438,7 +445,7 @@
        })
      })
    } else if (key === 'intertype') {
      let _options = this.getOptions(openType, value, funcType, '', '', procMode)
      let _options = this.getOptions(openType, value, funcType, '', '', procMode, Ot)
      this.setState({
        interType: value,
@@ -458,7 +465,7 @@
        })
      })
    } else if (key === 'procMode') {
      let _options = this.getOptions(openType, this.state.interType, funcType, '', '', value)
      let _options = this.getOptions(openType, this.state.interType, funcType, '', '', value, Ot)
      this.setState({
        procMode: value,
@@ -468,6 +475,16 @@
          if (item.key === 'innerFunc') {
            item.required = true
          }
          return item
        })
      })
    } else if (key === 'Ot') {
      let _options = this.getOptions(openType, this.state.interType, funcType, this.state.pageTemplate, card.tabTemplate, procMode, value)
      this.setState({
        Ot: value,
        formlist: this.state.formlist.map(item => {
          item.hidden = !_options.includes(item.key)
          return item
        })
      })
@@ -599,8 +616,8 @@
                  getPopupContainer={() => document.getElementById('winter')}
                >
                  {item.options.map((option, index) =>
                    <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}>
                      {item.key === 'icon' && option.value && <Icon type={option.value} />} {option.text}
                    <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value || option.field}>
                      {item.key === 'icon' && option.value ? <Icon type={option.value} /> : null} {option.text || option.label}
                    </Select.Option>
                  )}
                </Select>
src/templates/zshare/formconfig.jsx
@@ -615,6 +615,8 @@
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, config, usefulFields, type, menulist = [], printTemps = []) {
  let columns = (config.columns || []).filter(col => col.field)
  let opentypes = [
    {
      value: 'pop',
@@ -1125,6 +1127,23 @@
        value: 'false',
        text: '非必填'
      }]
    },
    {
      type: 'select',
      key: 'controlField',
      label: '控制字段',
      tooltip: '禁用控制字段,可根据数据控制按钮是否禁用。',
      initVal: card.controlField || '',
      required: false,
      options: [{label: '无', field: ''}, ...columns]
    },
    {
      type: 'text',
      key: 'controlVal',
      label: '控制值',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会禁用,多个值用逗号分隔。',
      initVal: card.controlVal || '',
      required: false
    }
  ]
}
src/templates/zshare/modalform/datatable/index.jsx
@@ -297,10 +297,10 @@
  handleAdd = () => {
    const { fields, type } = this.props
    if (this.state.data.length >= 20) {
    if (this.state.data.length >= 100) {
      notification.warning({
        top: 92,
        message: '最多可添加20项!',
        message: '最多可添加100项!',
        duration: 5
      })
      return