| | |
| | | import PropTypes from 'prop-types' |
| | | import moment from 'moment' |
| | | import { Button, Modal, notification, message } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | | import Utils, { getSysDefaultSql } from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | |
| | | |
| | | state = { |
| | | formdata: null, |
| | | tabledata: null, |
| | | loadingUuid: '' |
| | | } |
| | | |
| | |
| | | |
| | | let param = { // 系统存储过程 |
| | | func: 'sPC_TableData_InUpDe', |
| | | exec_type: 'y', // 后台解码 |
| | | BID: '' |
| | | } |
| | | |
| | | if (btn.sql && btn.sqlType === 'insert') { // 系统函数添加时,生成uuid |
| | | param.ID = Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | | param.LText2 = LText2 |
| | | param.LText1 = LText1 |
| | | param.LText = LText |
| | | |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | | _primaryId = param.ID |
| | | } else if (btn.sql && btn.sqlType === 'insertOrUpdate') { // 系统函数添加或修改时 |
| | | param.ID = primaryId || Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | | param.LText2 = LText2 |
| | | param.LText1 = LText1 |
| | | param.LText = LText |
| | | |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | | _primaryId = param.ID |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | | param.LText2 = LText2 |
| | | param.LText1 = LText1 |
| | | param.LText = LText |
| | | |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | } |
| | | |
| | | if (this.props.menuType === 'HS' && param.timestamp) { // 云端验证 |
| | |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | duration: btn.errorTime || 10 |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | duration: btn.errorTime || 10 |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || res.ErrMesg) |