| | |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | visible: false, |
| | | formdata: null, |
| | | tabledata: null, |
| | | selines: null, |
| | | confirmLoading: false, |
| | | btnconfig: null, |
| | | loading: false, |
| | | loadingNumber: '', |
| | | disabled: false, |
| | | hidden: false, |
| | | checkParam: null, |
| | | autoMatic: false |
| | | } |
| | |
| | | disabled = true |
| | | } |
| | | }) |
| | | this.setState({disabled}) |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | }) |
| | | } |
| | | this.setState({disabled}) |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | this.setState({ loading: true }) |
| | | |
| | | this.execSubmit(this.state.tabledata, () => {}, res.form) |
| | | this.execSubmit(this.state.selines, () => {}, res.form) |
| | | } |
| | | |
| | | resetModuleParam = (menuId, btnId, param) => { |
| | |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | selines: data |
| | | }) |
| | | |
| | | if (btn.OpenType === 'formSubmit') { |
| | | this.setState({ |
| | | tabledata: data |
| | | }) |
| | | MKEmitter.emit('mkFormSubmit', btn.uuid) |
| | | return |
| | | } else if (btn.OpenType === 'prompt') { |
| | |
| | | |
| | | this.setState({ |
| | | loading: true, |
| | | tabledata: data, |
| | | btnconfig: modal |
| | | }, () => { |
| | | this.improveAction() |
| | |
| | | if (btn.execSuccess === 'closetab') { |
| | | MKEmitter.emit('closeTabView', btn.$MenuID) |
| | | } else if (btn.execSuccess !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, id) |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, id, this.state.selines) |
| | | } |
| | | |
| | | if (btn.refreshTab && btn.refreshTab.length > 0) { |
| | |
| | | visible: false |
| | | }) |
| | | if (btn.execError !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn) |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines) |
| | | } |
| | | } |
| | | }) |
| | |
| | | } |
| | | |
| | | if (btn.execError !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn) |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines) |
| | | } |
| | | } |
| | | |
| | |
| | | this.formRef.handleConfirm().then(res => { |
| | | this.setState({ confirmLoading: true }) |
| | | |
| | | this.execSubmit(this.state.tabledata, () => { this.setState({ confirmLoading: false }) }, res) |
| | | this.execSubmit(this.state.selines, () => { this.setState({ confirmLoading: false }) }, res) |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | modelconfirm = () => { |
| | | const { BData } = this.props |
| | | const { btnconfig, tabledata } = this.state |
| | | const { btnconfig, selines } = this.state |
| | | let _this = this |
| | | |
| | | let result = [] |
| | |
| | | |
| | | if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) { |
| | | _initval = BData[item.field] |
| | | } else if (_readin && tabledata[0] && tabledata[0].hasOwnProperty(item.field)) { |
| | | _initval = tabledata[0][item.field] |
| | | } else if (_readin && selines[0] && selines[0].hasOwnProperty(item.field)) { |
| | | _initval = selines[0][item.field] |
| | | } else if (item.type === 'date' && _initval) { |
| | | _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD') |
| | | } else if (item.type === 'datemonth' && _initval) { |
| | |
| | | title: this.state.dict['main.action.confirm.tip'], |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execSubmit(tabledata, resolve, result) |
| | | _this.execSubmit(selines, resolve, result) |
| | | }) |
| | | }, |
| | | onCancel() { |
| | |
| | | menuType={this.props.menuType} |
| | | action={btnconfig} |
| | | inputSubmit={this.handleOk} |
| | | data={this.state.tabledata[0]} |
| | | data={this.state.selines[0]} |
| | | BData={BData} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> |
| | |
| | | menuType={this.props.menuType} |
| | | action={btnconfig} |
| | | inputSubmit={this.handleOk} |
| | | data={this.state.tabledata[0]} |
| | | data={this.state.selines[0]} |
| | | BData={BData} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> |
| | |
| | | |
| | | render() { |
| | | const { btn, show, style } = this.props |
| | | const { loadingNumber, loading, disabled } = this.state |
| | | const { loadingNumber, loading, disabled, hidden } = this.state |
| | | |
| | | if (hidden) return null |
| | | |
| | | if (show === 'actionList') { |
| | | return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}> |