| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { FuncUtils } from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { getActionForm } from '@/templates/zshare/formconfig' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | card: null, // 编辑中元素 |
| | | formlist: null, // 表单信息 |
| | | actionlist: null, // 按钮组 |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | const { dict } = this.state |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} ?`, |
| | | content: `确定删除 - ${card.label} ?`, |
| | | onOk() { |
| | | let _actionlist = fromJS(_this.state.actionlist).toJS() |
| | | |
| | |
| | | |
| | | getVerify = (card) => { |
| | | const { config } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (!card) return null |
| | | |
| | | if (['pop', 'prompt', 'exec'].includes(card.OpenType)) { |
| | | return <VerifyCard |
| | | card={card} |
| | | dict={dict} |
| | | config={config} |
| | | columns={config.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | |
| | | } else if (card.OpenType === 'excelIn') { |
| | | return <VerifyExcelIn |
| | | card={card} |
| | | dict={dict} |
| | | columns={config.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | } else if (card.OpenType === 'excelOut') { |
| | | return <VerifyExcelOut |
| | | card={card} |
| | | dict={dict} |
| | | config={config} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | } else if (card.OpenType === 'funcbutton' && card.funcType === 'print') { |
| | | return <VerifyPrint |
| | | card={card} |
| | | dict={dict} |
| | | columns={config.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | } else if (card.OpenType === 'funcbutton' && card.funcType === 'megvii') { |
| | | return <VerifyMegvii |
| | | card={card} |
| | | dict={dict} |
| | | columns={config.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { actionlist, visible, card, dict, copying, profVisible, record } = this.state |
| | | const { actionlist, visible, card, copying, profVisible, record } = this.state |
| | | |
| | | return ( |
| | | <div className="model-table-action-list" style={config.charts && config.charts.length > 1 ? {paddingTop: 25} : null}> |
| | |
| | | /> |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | | title={dict['model.action'] + '-' + (card && card.copyType === 'action' ? dict['model.copy'] : dict['model.edit'])} |
| | | title={'按钮-' + (card && card.copyType === 'action' ? '复制' : '编辑')} |
| | | wrapClassName="model-table-action-edit-modal" |
| | | visible={visible} |
| | | width={920} |
| | | maskClosable={false} |
| | | onCancel={this.editModalCancel} |
| | | footer={[ |
| | | record && ['pop', 'exec', 'prompt'].includes(record.OpenType) && record.intertype === 'system' ? <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null, |
| | | record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>{dict['model.confirm']}</Button> |
| | | record && ['pop', 'exec', 'prompt'].includes(record.OpenType) && record.intertype === 'system' ? <CreateInterface key="interface" ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null, |
| | | record && record.intertype === 'inner' ? <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={this.editModalCancel}>取消</Button>, |
| | | <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>确定</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | <ActionForm |
| | | dict={dict} |
| | | card={card} |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | |
| | | visible={profVisible} |
| | | width={'90vw'} |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | okText="提交" |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { |
| | | if (this.verifyRef.handleCancel) { |