| | |
| | | import { Modal, notification, Switch, message } from 'antd' |
| | | import { CopyOutlined } from '@ant-design/icons' |
| | | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { getColumnForm } from '@/templates/zshare/formconfig' |
| | | |
| | | import ColumnForm from './columnform' |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | columnlist: null, // 显示列 |
| | | showField: true, // 显示列字段 |
| | | modaltype: '', // 模态框控制 |
| | |
| | | */ |
| | | 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 _columnlist = fromJS(_this.state.columnlist).toJS() |
| | | |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { modaltype, columnlist, dict, card } = this.state |
| | | const { modaltype, columnlist, card } = this.state |
| | | |
| | | return ( |
| | | <div className="model-table-column-list"> |
| | | {columnlist && columnlist.length > 0 ? <CopyOutlined className="column-copy" title="copy" onClick={this.copycolumn} /> : null} |
| | | <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={this.onFieldChange} /> |
| | | <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | | list={columnlist} |
| | | setting={config.setting} |
| | |
| | | destroyOnClose |
| | | > |
| | | <ColumnForm |
| | | dict={dict} |
| | | card={card} |
| | | MenuID={this.props.menu.MenuID} |
| | | inputSubmit={this.handleSubmit} |
| | |
| | | </Modal> |
| | | {/* 合并列编辑 */} |
| | | <Modal |
| | | title={dict['model.form.colspan'] + '-' + dict['model.edit']} |
| | | title="合并列-编辑" |
| | | visible={modaltype === 'colspan'} |
| | | width={850} |
| | | maskClosable={false} |
| | |
| | | destroyOnClose |
| | | > |
| | | <ColspanForm |
| | | dict={dict} |
| | | card={card} |
| | | inputSubmit={this.handleSubmit} |
| | | columns={columnlist} |
| | |
| | | destroyOnClose |
| | | > |
| | | <GridBtnForm |
| | | dict={dict} |
| | | inputSubmit={this.handleSubmit} |
| | | card={config.gridBtn} |
| | | wrappedComponentRef={(inst) => this.gridBtnFormRef = inst} |
| | |
| | | visible={modaltype === 'mark'} |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | okText="提交" |
| | | onOk={this.markSubmit} |
| | | onCancel={() => { this.setState({ modaltype: '' }) }} |
| | | destroyOnClose |
| | |
| | | <MarkColumn |
| | | ref="markRef" |
| | | card={card} |
| | | dict={dict} |
| | | columns={columnlist} |
| | | /> |
| | | </Modal> |