king
2021-04-16 d7534812c8199bf1e9faa0279b63e434737d6374
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -81,7 +81,7 @@
   * @description 触发按钮操作
   */
  actionTrigger = (triggerId, record) => {
    const { setting, Tab, BID, btn, selectedData } = this.props
    const { Tab, BID, btn, selectedData } = this.props
    const { loading } = this.state
    if ((triggerId && btn.uuid !== triggerId) || loading) return
@@ -111,14 +111,6 @@
      notification.warning({
        top: 92,
        message: this.state.dict['main.action.confirm.selectSingleLine'],
        duration: 5
      })
      return
    } else if (!setting.primaryKey) {
      // 需要选择行时,校验是否设置主键
      notification.warning({
        top: 92,
        message: '未设置主键!',
        duration: 5
      })
      return
@@ -358,17 +350,21 @@
        let _param = { ...param, ...formdata }
        params.push(_param)
      } else if (btn.Ot === 'requiredSgl') {
        if (setting.primaryKey) {
        param[setting.primaryKey] = data[0][setting.primaryKey]
        }
        let _param = { ...param, ...formdata }
        params.push(_param)
      } else if (btn.Ot === 'requiredOnce') {
        if (setting.primaryKey) {
        let ids = data.map(d => { return d[setting.primaryKey]})
        ids = ids.filter(Boolean)
        ids = ids.join(',')
        param[setting.primaryKey] = ids
        }
        let _param = { ...param, ...formdata }
@@ -376,7 +372,10 @@
      } else if (btn.Ot === 'required') {
        params = data.map((cell, index) => {
          let _param = { ...param }
          if (setting.primaryKey) {
          _param[setting.primaryKey] = cell[setting.primaryKey]
          }
          formlist.forEach(_data => {
            if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) {
@@ -1269,7 +1268,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          loading={loading}
          style={btn.btnstyle}
          style={btn.style}
          icon={show === 'text' ? '' : (btn.icon || '')}
          onClick={() => {this.actionTrigger()}}
        >{show === 'icon' && btn.icon ? '' : btn.label}</Button>