From 8cdfdd9914d1c4f6cd59176d61869522f51f39e4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 10 十月 2021 13:53:57 +0800 Subject: [PATCH] 2021-10-10 --- src/menu/components/table/edit-table/columns/index.jsx | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index 639a389..569b68d 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { DndProvider, DragSource, DropTarget } from 'react-dnd' -import { Table, Popover, Icon, Modal, message } from 'antd' +import { Table, Popover, Icon, Modal, message, Button } from 'antd' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' @@ -14,6 +14,7 @@ const { confirm } = Modal const EditColumn = asyncComponent(() => import('./editColumn')) +const TableVerify = asyncComponent(() => import('./tableIn')) const MarkColumn = asyncIconComponent(() => import('@/menu/components/share/markcomponent')) const CardCellComponent = asyncComponent(() => import('@/menu/components/card/cardcellcomponent')) @@ -219,6 +220,7 @@ return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(config.wrap), fromJS(nextProps.config.wrap)) || + !is(fromJS(config.submit), fromJS(nextProps.config.submit)) || !is(fromJS(config.search), fromJS(nextProps.config.search)) || !is(fromJS(config.action), fromJS(nextProps.config.action)) || config.setting.laypage !== nextProps.config.setting.laypage @@ -294,10 +296,6 @@ submitCol = (col) => { const { card } = this.state - - col.uuid = card.uuid - col.isSub = card.isSub === true - col.marks = card.marks || [] if (col.type === 'custom') { col.elements = card.type === 'custom' ? (card.elements || []) : [] @@ -449,6 +447,18 @@ }) } + verifySubmit = () => { + const { config } = this.props + + this.verifyRef.handleConfirm().then(res => { + this.setState({ + visible: false + }, () => { + this.props.updatecolumn({...config, submit: res}) + }) + }) + } + componentDidMount () { MKEmitter.addListener('submitStyle', this.getStyle) } @@ -465,7 +475,7 @@ render() { const { config } = this.props - const { fields, card, lineMarks, dict, tableId } = this.state + const { fields, card, lineMarks, dict, tableId, visible } = this.state const components = { header: { cell: DragableHeaderCol @@ -513,6 +523,13 @@ return ( <div className={`edit-table-columns ${config.setting.laypage} ${config.wrap.mode || ''}`} id={tableId}> <div className="col-control"> + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <Icon className="edit" title="缂栬緫" type="edit" onClick={() => this.setState({visible: true})} /> + </div> + } trigger="hover"> + <Button style={{height: '24px', marginRight: '10px', backgroundColor: '#1890ff'}} onDoubleClick={() => this.setState({visible: true})} type="primary">鎻愪氦</Button> + </Popover> <Icon title="澶嶅埗鏄剧ず鍒�" type="copy" onClick={this.copycolumn} /> <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} /> <Icon title="鍚屾瀛楁闆�" type="file-sync" onClick={this.syncfield} /> @@ -539,6 +556,24 @@ /> </DndProvider> <EditColumn column={card} dict={dict} columns={this.state.columns} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> + <Modal + wrapClassName="model-table-action-verify-modal" + title={'缂栬緫'} + visible={visible} + width={'75vw'} + maskClosable={false} + onOk={this.verifySubmit} + onCancel={() => { this.setState({ visible: false }) }} + destroyOnClose + > + <TableVerify + card={config.submit} + dict={dict} + cols={config.cols} + columns={config.columns} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> + </Modal> </div> ) } -- Gitblit v1.8.0