| | |
| | | import GridBtnForm from '@/templates/zshare/gridbtnform' |
| | | import EditCard from '@/templates/zshare/editcard' |
| | | import VerifyCard from '@/templates/zshare/verifycard' |
| | | import VerifyCardPrint from '@/templates/zshare/verifycardprint' |
| | | import VerifyCardExcelIn from '@/templates/zshare/verifycardexcelin' |
| | | import VerifyCardExcelOut from '@/templates/zshare/verifycardexcelout' |
| | | import MenuForm from '@/templates/zshare/menuform' |
| | |
| | | const { card } = this.state |
| | | let config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | | if (card.OpenType === 'excelIn') { |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | |
| | | config.action = config.action.map(item => { |
| | | if (item.uuid === card.uuid) { |
| | | item.verify = res |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | profileVisible: false, |
| | | config: config, |
| | | card: '' |
| | | }) |
| | | }) |
| | | } else if (card.execMode) { |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | |
| | | config.action = config.action.map(item => { |
| | | if (item.uuid === card.uuid) { |
| | | item.verify = res |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | profileVisible: false, |
| | | config: config, |
| | | card: '', |
| | | }) |
| | | }) |
| | | } else { |
| | | let _verify = this.verifyRef.state.verify |
| | | |
| | | if (card.OpenType !== 'excelOut' && _verify.default === 'false' && _verify.scripts.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不执行默认sql时,必须设置自定义脚本!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (card.OpenType === 'excelOut') { |
| | | let _cols = _verify.columns.map(col => col.Column) |
| | | let _vcols = Array.from(new Set(_cols)) |
| | | if (_cols.length > _vcols.length) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'Excel列字段名,不可重复!', |
| | | duration: 10 |
| | | }) |
| | | |
| | | return |
| | | } |
| | | } |
| | | |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | |
| | | config.action = config.action.map(item => { |
| | | if (item.uuid === card.uuid) { |
| | | item.verify = _verify |
| | | item.verify = res |
| | | } |
| | | |
| | | return item |
| | |
| | | config: config, |
| | | card: '' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | onCancel={() => { this.setState({ profileVisible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | {this.state.card && this.state.card.OpenType !== 'excelIn' ? |
| | | {this.state.card && !this.state.card.execMode && this.state.card.OpenType !== 'excelIn' && this.state.card.OpenType !== 'excelOut' ? |
| | | <VerifyCard |
| | | floor="subtable" |
| | | card={this.state.card} |
| | |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> : null |
| | | } |
| | | {this.state.card && this.state.card.execMode ? |
| | | <VerifyCardPrint |
| | | card={this.state.card} |
| | | dict={this.state.dict} |
| | | columns={config.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> : null |
| | | } |
| | | {this.state.card && this.state.card.OpenType === 'excelIn' ? |
| | | <VerifyCardExcelIn |
| | | card={this.state.card} |