| | |
| | | import { Button, Modal, notification, message } from 'antd' |
| | | |
| | | import ExcelIn from './excelin' |
| | | import Utils from '@/utils/utils.js' |
| | | import Utils, { getExcelInSql } from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (btn.verify && btn.verify.sheet && btn.verify.columns && btn.verify.columns.length > 0) { |
| | | let primaryId = '' // 导入时行Id |
| | | if (btn.Ot === 'requiredSgl') { |
| | | primaryId = data[0][setting.primaryKey] || '' |
| | | } |
| | | |
| | | this.setState({ |
| | | primaryId: primaryId |
| | | }, () => { |
| | | this.refs.excelIn.exceltrigger() |
| | | }) |
| | | } else { |
| | | } else if (!btn.verify || !btn.verify.sheet || !btn.verify.columns || btn.verify.columns.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'excel导入验证信息未设置!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let primaryId = '' // 导入时行Id |
| | | if (btn.Ot === 'requiredSgl') { |
| | | primaryId = data[0][setting.primaryKey] || '' |
| | | } |
| | | |
| | | this.setState({ |
| | | primaryId: primaryId |
| | | }, () => { |
| | | this.refs.excelIn.exceltrigger() |
| | | }) |
| | | |
| | | if (window.GLOB.systemType === 'production') { |
| | | MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '导入Excel'}) |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | let result = Utils.getExcelInSql(btn, data, this.state.dict, (this.props.BID || '')) |
| | | let result = getExcelInSql(btn, data, this.state.dict, (this.props.BID || '')) |
| | | |
| | | if (result.errors) { |
| | | notification.warning({ |
| | |
| | | if (btn.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | param.rduri = btn.interface |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | param.rduri = btn.proInterface |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | } |
| | | } else { |
| | | if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | param.rduri = btn.interface |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | param.rduri = btn.proInterface |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | } |
| | | } |
| | | |