File was renamed from src/tabviews/commontable/mainAction/index.jsx |
| | |
| | | import PropTypes from 'prop-types' |
| | | import moment from 'moment' |
| | | import { Button, Affix, Modal, notification, Spin } from 'antd' |
| | | import MutilForm from '../mutilform' |
| | | import MutilForm from '@/tabviews/tableshare/mutilform' |
| | | import Utils from '@/utils/utils.js' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | |
| | | |
| | | class MainAction extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.string, |
| | | type: PropTypes.string, |
| | | MenuID: PropTypes.string, |
| | | actions: PropTypes.array, // 搜索条件列表 |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | loadingUuid: '', |
| | | btnloading: false, |
| | | configMap: {} |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | console.log(this.props.type) |
| | | } |
| | | |
| | | refreshdata = (item, type) => { |
| | |
| | | (btn.OpenType === 'pop' && !btn.innerFunc && btn.sql && btn.sqlType === 'insert') |
| | | ) { |
| | | let param = { // 系统存储过程 |
| | | func: 'sPC_TableData_InUpDe' |
| | | func: 'sPC_TableData_InUpDe', |
| | | BID: this.props.BID |
| | | } |
| | | |
| | | if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行 |
| | |
| | | } |
| | | |
| | | param.ID = ID |
| | | param.BID = '' |
| | | |
| | | if (btn.innerFunc) { |
| | | param.func = btn.innerFunc |
| | |
| | | if (!param.hasOwnProperty('ID') && setting.primaryKey && data[0] && data[0][setting.primaryKey]) { |
| | | param.ID = data[0][setting.primaryKey] |
| | | } |
| | | if (!param.hasOwnProperty('BID')) { |
| | | param.BID = '' |
| | | } |
| | | } else if (btn.sql && btn.sqlType === 'insert') { |
| | | param.ID = Utils.getguid() |
| | | param.BID = '' |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | } else if (btn.sql) { |
| | | param.ID = data[0][setting.primaryKey] |
| | | param.BID = '' |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | } else if (btn.Ot === 'required' || (btn.Ot === 'requiredOnce' && btn.OpenType === 'pop')) { |
| | | let deffers = data.map(cell => { |
| | | let param = { |
| | | func: 'sPC_TableData_InUpDe' |
| | | func: 'sPC_TableData_InUpDe', |
| | | BID: this.props.BID |
| | | } |
| | | |
| | | if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行 |
| | | param.ID = cell[setting.primaryKey] |
| | | param.BID = '' |
| | | |
| | | if (btn.innerFunc) { |
| | | param.func = btn.innerFunc |
| | |
| | | } |
| | | } else if (btn.sql) { |
| | | param.ID = cell[setting.primaryKey] |
| | | param.BID = '' |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | /** *********************调用外部接口************************* */ |
| | | let param = { |
| | | ID: '', |
| | | BID: '' |
| | | BID: this.props.BID |
| | | } |
| | | |
| | | if (!btn.interface) { // 接口地址不存在时报错 |
| | |
| | | if (btn.innerFunc) { |
| | | let deffers = data.map(cell => { |
| | | let _param = { |
| | | BID: '', |
| | | BID: this.props.BID, |
| | | func: btn.innerFunc |
| | | } |
| | | _param.ID = cell[setting.primaryKey] |
| | |
| | | } else { |
| | | let params = data.map(cell => { |
| | | return { |
| | | BID: '', |
| | | BID: this.props.BID, |
| | | ID: cell[setting.primaryKey] |
| | | } |
| | | }) |
| | |
| | | render() { |
| | | const { loadingUuid, btnloading } = this.state |
| | | |
| | | if (this.props.setting.actionfixed) { // 按钮是否固定在头部 |
| | | if (this.props.setting.actionfixed && this.props.type === 'main') { // 按钮是否固定在头部 |
| | | return ( |
| | | <Affix offsetTop={48}> |
| | | <div className="button-list" id={this.props.MenuID + 'mainaction'}> |