| | |
| | | loading: false, |
| | | disabled: false, |
| | | hidden: false, |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | */ |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { BID, btn, selectedData, setting, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | const { loading, disabled, dict } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | message: setting.supModTip || dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.Ot !== 'notRequired' && data.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | message: dict['select_row'] || '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.Ot === 'requiredSgl' && data.length !== 1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | message: dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | */ |
| | | execError = (res) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | |
| | | if (res.ErrCode === '01') { |
| | | message.error('未获取到下载文件。') |
| | | message.error(dict['exc_fail'] || '未获取到下载文件。') |
| | | return |
| | | } else if (res.ErrCode === '02') { |
| | | Modal.error({ |
| | | title: '部分文件下载失败:1、请检查文件路径是否正确,2、请检查文件是否跨域。', |
| | | title: dict['exc_fail'] || '部分文件下载失败:1、请检查文件路径是否正确,2、请检查文件是否跨域。', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | return |
| | | } else if (res.ErrCode === '03') { |
| | | Modal.error({ |
| | | title: '文件下载失败:1、请检查文件路径是否正确,2、请检查文件是否跨域。', |
| | | title: dict['exc_fail'] || '文件下载失败:1、请检查文件路径是否正确,2、请检查文件是否跨域。', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | return |
| | | } else if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || '执行失败!', |
| | | title: res.message || dict['exc_fail'] || '执行失败!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || '执行失败!') |
| | | message.error(res.message || dict['exc_fail'] || '执行失败!') |
| | | } |
| | | |
| | | if (btn.execError !== 'never') { |