| | |
| | | |
| | | axios.interceptors.response.use((response) => { |
| | | if (response.data.ErrCode === 'LoginError') { |
| | | if (window.debugger === true) { |
| | | if (window.debugger === true || window.GLOB.saving) { |
| | | response.data.ErrCode = 'E' |
| | | return Promise.resolve(response.data) |
| | | } else if (!sessionStorage.getItem('loginError')) { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { connectDragSource, connectDropTarget, moveCol, addElement, dropCol, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | const { connectDragSource, connectDropTarget, moveCol, componentId, addElement, dropCol, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | |
| | | if (index !== undefined && column) { |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | if (!column) return ( |
| | | <th {...restProps}>{children}</th> |
| | | ) |
| | | |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th>), |
| | | ) |
| | | } else if (column) { |
| | | let style = {textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return ( |
| | | <th {...restProps} style={style} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th> |
| | | ) |
| | | } else { |
| | | return (<th {...restProps}>{children}</th>) |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th>), |
| | | ) |
| | | } |
| | | } |
| | | |
| | |
| | | const ColTarget = { |
| | | drop(props, monitor) { |
| | | const item = monitor.getItem() |
| | | const dragIndex = item.index |
| | | const hoverIndex = props.index |
| | | let dragIndex = item.index |
| | | let hoverIndex = props.index |
| | | |
| | | if (item.$init) { |
| | | props.dropCol(item, hoverIndex) |
| | | if (/sub_/.test(hoverIndex)) { |
| | | message.warning('合并列子元素暂不支持拖拽添加。') |
| | | } else { |
| | | props.dropCol(item, hoverIndex.replace(new RegExp(props.componentId + '@', 'ig'), '')) |
| | | } |
| | | return |
| | | } else if (dragIndex === undefined || hoverIndex === undefined || dragIndex === hoverIndex) { |
| | | return |
| | | } else { |
| | | let reg = new RegExp(props.componentId + '@', 'ig') |
| | | if (reg.test(dragIndex)) { |
| | | props.moveCol(dragIndex.replace(reg, ''), hoverIndex.replace(reg, '')) |
| | | } else { |
| | | message.warning('拖动元素不在当前组件中。') |
| | | return |
| | | } |
| | | } |
| | | |
| | | props.moveCol(dragIndex, hoverIndex) |
| | | monitor.getItem().index = hoverIndex |
| | | }, |
| | | } |
| | |
| | | moveCol = (dragIndex, hoverIndex) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | |
| | | _columns.splice(hoverIndex, 0, ..._columns.splice(dragIndex, 1)) |
| | | if (/^sub_/.test(dragIndex) || /^sub_/.test(hoverIndex)) { |
| | | let sign1 = dragIndex.split('_') |
| | | let sign2 = hoverIndex.split('_') |
| | | if (sign1[1] !== sign2[1]) { |
| | | message.warning('拖动元素不在同一个合并列中。') |
| | | return |
| | | } |
| | | this.loopMoveCol(_columns, sign1[1], sign1[2], sign2[2]) |
| | | } else { |
| | | _columns.splice(hoverIndex, 0, ..._columns.splice(dragIndex, 1)) |
| | | } |
| | | |
| | | this.setState({ |
| | | columns: _columns |
| | | }, () => { |
| | | this.props.updatecolumn({...this.props.config, cols: _columns}) |
| | | }) |
| | | } |
| | | |
| | | loopMoveCol = (columns, colId, dragIndex, hoverIndex) => { |
| | | columns.forEach(column => { |
| | | if (column.type === 'colspan' && column.uuid === colId) { |
| | | column.subcols.splice(hoverIndex, 0, ...column.subcols.splice(dragIndex, 1)) |
| | | } else if (column.type === 'colspan') { |
| | | this.loopMoveCol(column.subcols, colId, dragIndex, hoverIndex) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | document.body.removeChild(oInput) |
| | | } |
| | | |
| | | handlecolumns = (columns, fields, config, isSub) => { |
| | | handlecolumns = (columns, fields, config, pId) => { |
| | | return columns.map((col, index) => { |
| | | return { |
| | | title: col.label, |
| | |
| | | upComponent: this.updateCol |
| | | }), |
| | | onHeaderCell: () => ({ |
| | | index: isSub ? undefined : index, |
| | | index: pId ? config.uuid + '@sub_' + pId + '_' + index : config.uuid + '@' + index, |
| | | column: col, |
| | | componentId: config.uuid, |
| | | fields: fields, |
| | | align: col.Align, |
| | | moveCol: this.moveCol, |
| | |
| | | changeStyle: this.changeStyle, |
| | | deleteCol: this.deleteCol, |
| | | }), |
| | | children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, true) : null, |
| | | children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, col.uuid) : null, |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { connectDragSource, connectDropTarget, moveCol, dropCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | const { connectDragSource, connectDropTarget, moveCol, componentId, dropCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | |
| | | if (!column) return ( |
| | | <th {...restProps} index={index}> |
| | | {children} |
| | | </th> |
| | | <th {...restProps}>{children}</th> |
| | | ) |
| | | |
| | | if (index !== undefined) { |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th>), |
| | | ) |
| | | } else if (column) { |
| | | let style = {textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return ( |
| | | <th {...restProps} style={style} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th> |
| | | ) |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th>), |
| | | ) |
| | | } |
| | | } |
| | | |
| | |
| | | const ColTarget = { |
| | | drop(props, monitor) { |
| | | const item = monitor.getItem() |
| | | const dragIndex = item.index |
| | | const hoverIndex = props.index |
| | | let dragIndex = item.index |
| | | let hoverIndex = props.index |
| | | |
| | | if (item.$init) { |
| | | props.dropCol(item, hoverIndex) |
| | | if (/sub_/.test(hoverIndex)) { |
| | | message.warning('合并列子元素暂不支持拖拽添加。') |
| | | } else { |
| | | props.dropCol(item, hoverIndex.replace(new RegExp(props.componentId + '@', 'ig'), '')) |
| | | } |
| | | return |
| | | } else if (dragIndex === undefined || hoverIndex === undefined || dragIndex === hoverIndex) { |
| | | return |
| | | } else { |
| | | let reg = new RegExp(props.componentId + '@', 'ig') |
| | | if (reg.test(dragIndex)) { |
| | | props.moveCol(dragIndex.replace(reg, ''), hoverIndex.replace(reg, '')) |
| | | } else { |
| | | message.warning('拖动元素不在当前组件中。') |
| | | return |
| | | } |
| | | } |
| | | |
| | | props.moveCol(dragIndex, hoverIndex) |
| | | |
| | | monitor.getItem().index = hoverIndex |
| | | }, |
| | | } |
| | |
| | | moveCol = (dragIndex, hoverIndex) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | |
| | | _columns.splice(hoverIndex, 0, ..._columns.splice(dragIndex, 1)) |
| | | if (/^sub_/.test(dragIndex) || /^sub_/.test(hoverIndex)) { |
| | | let sign1 = dragIndex.split('_') |
| | | let sign2 = hoverIndex.split('_') |
| | | if (sign1[1] !== sign2[1]) { |
| | | message.warning('拖动元素不在同一个合并列中。') |
| | | return |
| | | } |
| | | this.loopMoveCol(_columns, sign1[1], sign1[2], sign2[2]) |
| | | } else { |
| | | _columns.splice(hoverIndex, 0, ..._columns.splice(dragIndex, 1)) |
| | | } |
| | | |
| | | this.setState({ |
| | | columns: _columns |
| | | }, () => { |
| | | this.props.updatecolumn({...this.props.config, cols: _columns}) |
| | | }) |
| | | } |
| | | |
| | | loopMoveCol = (columns, colId, dragIndex, hoverIndex) => { |
| | | columns.forEach(column => { |
| | | if (column.type === 'colspan' && column.uuid === colId) { |
| | | column.subcols.splice(hoverIndex, 0, ...column.subcols.splice(dragIndex, 1)) |
| | | } else if (column.type === 'colspan') { |
| | | this.loopMoveCol(column.subcols, colId, dragIndex, hoverIndex) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | } |
| | | |
| | | handlecolumns = (columns, fields, config, isSub) => { |
| | | handlecolumns = (columns, fields, config, pId) => { |
| | | return columns.map((col, index) => { |
| | | let title = col.label |
| | | if (col.editable === 'true') { |
| | |
| | | upComponent: this.updateCol |
| | | }), |
| | | onHeaderCell: () => ({ |
| | | index: isSub ? undefined : index, |
| | | index: pId ? config.uuid + '@sub_' + pId + '_' + index : config.uuid + '@' + index, |
| | | column: col, |
| | | componentId: config.uuid, |
| | | fields: fields, |
| | | align: col.Align, |
| | | moveCol: this.moveCol, |
| | |
| | | changeStyle: this.changeStyle, |
| | | deleteCol: this.deleteCol, |
| | | }), |
| | | children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, true) : null, |
| | | children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, col.uuid) : null, |
| | | } |
| | | }) |
| | | } |
| | |
| | | destroyOnClose |
| | | > |
| | | <TableVerify |
| | | card={config.submit} |
| | | setting={config.setting} |
| | | cols={config.cols} |
| | | columns={config.columns} |
| | | config={config} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, InputNumber, Radio, Typography } from 'antd' |
| | | import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, Cascader, Tooltip, InputNumber, Radio, Typography } from 'antd' |
| | | import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined, QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import UniqueForm from './uniqueform' |
| | | import CustomScript from './customscript' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | state = { |
| | | verify: {}, |
| | | fields: [], |
| | | modules: [], |
| | | fieldLabel: {}, |
| | | systemScripts: [], |
| | | activeKey: 'basemsg', |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { columns, card, setting } = this.props |
| | | let _verify = fromJS(card).toJS() |
| | | const { columns, submit, setting, uuid } = this.props.config |
| | | let _verify = fromJS(submit).toJS() |
| | | _verify.sheet = _verify.sheet || setting.tableName |
| | | |
| | | let fieldLabel = {} |
| | | // let _columns = [] |
| | | // let _fields = {} |
| | | |
| | | columns.forEach(col => { |
| | | fieldLabel[col.field] = col.label |
| | | // _fields[col.field] = col |
| | | }) |
| | | // cols.forEach(col => { |
| | | // if (!col.field || col.type === 'index' || !_fields[col.field]) return |
| | | |
| | | // _columns.push(_fields[col.field]) |
| | | // }) |
| | | |
| | | let supId = '' |
| | | if (setting && setting.supModule) { |
| | | let pid = setting.supModule[setting.supModule.length - 1] |
| | | if (pid && pid !== 'empty') { |
| | | supId = pid |
| | | } else { |
| | | supId = '' |
| | | } |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, uuid, supId) |
| | | |
| | | this.setState({ |
| | | fields: fromJS(columns).toJS().filter(item => item.field !== setting.primaryKey), |
| | | fieldLabel, |
| | | modules: modules, |
| | | verify: _verify |
| | | }, () => { |
| | | this.resetUniqueColumns() |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { verify, scriptsColumns, uniqueColumns, activeKey, fields } = this.state |
| | | const { verify, scriptsColumns, uniqueColumns, activeKey, fields, modules } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“上级(行)”。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 刷新组件 |
| | | </Tooltip> |
| | | }> |
| | | <Cascader options={modules} value={verify.syncComponent || []} expandTrigger="hover" allowClear placeholder="" onChange={(val) => this.onOptionChange(val, 'syncComponent')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | </TabPane> |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { connectDragSource, connectDropTarget, moveCol, dropCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | const { connectDragSource, connectDropTarget, moveCol, componentId, dropCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | |
| | | if (index !== undefined && column) { |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | if (!column) return ( |
| | | <th {...restProps}>{children}</th> |
| | | ) |
| | | |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th>), |
| | | ) |
| | | } else if (column) { |
| | | let style = {textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return ( |
| | | <th {...restProps} style={style} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th> |
| | | ) |
| | | } else { |
| | | return (<th {...restProps}>{children}</th>) |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | if (window.GLOB.columnId === column.uuid) { |
| | | style.color = '#1890ff' |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column.type === 'colspan' ? <PlusOutlined className="plus" title="添加列" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th>), |
| | | ) |
| | | } |
| | | } |
| | | |
| | |
| | | const ColTarget = { |
| | | drop(props, monitor) { |
| | | const item = monitor.getItem() |
| | | const dragIndex = item.index |
| | | const hoverIndex = props.index |
| | | let dragIndex = item.index |
| | | let hoverIndex = props.index |
| | | |
| | | if (item.$init) { |
| | | props.dropCol(item, hoverIndex) |
| | | if (/sub_/.test(hoverIndex)) { |
| | | message.warning('合并列子元素暂不支持拖拽添加。') |
| | | } else { |
| | | props.dropCol(item, hoverIndex.replace(new RegExp(props.componentId + '@', 'ig'), '')) |
| | | } |
| | | return |
| | | } else if (dragIndex === undefined || hoverIndex === undefined || dragIndex === hoverIndex) { |
| | | return |
| | | } else { |
| | | let reg = new RegExp(props.componentId + '@', 'ig') |
| | | if (reg.test(dragIndex)) { |
| | | props.moveCol(dragIndex.replace(reg, ''), hoverIndex.replace(reg, '')) |
| | | } else { |
| | | message.warning('拖动元素不在当前组件中。') |
| | | return |
| | | } |
| | | } |
| | | |
| | | props.moveCol(dragIndex, hoverIndex) |
| | | monitor.getItem().index = hoverIndex |
| | | }, |
| | | } |
| | |
| | | moveCol = (dragIndex, hoverIndex) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | |
| | | _columns.splice(hoverIndex, 0, ..._columns.splice(dragIndex, 1)) |
| | | if (/^sub_/.test(dragIndex) || /^sub_/.test(hoverIndex)) { |
| | | let sign1 = dragIndex.split('_') |
| | | let sign2 = hoverIndex.split('_') |
| | | if (sign1[1] !== sign2[1]) { |
| | | message.warning('拖动元素不在同一个合并列中。') |
| | | return |
| | | } |
| | | this.loopMoveCol(_columns, sign1[1], sign1[2], sign2[2]) |
| | | } else { |
| | | _columns.splice(hoverIndex, 0, ..._columns.splice(dragIndex, 1)) |
| | | } |
| | | |
| | | this.setState({ |
| | | columns: _columns |
| | | }, () => { |
| | | this.props.updatecolumn({...this.props.config, cols: _columns}) |
| | | }) |
| | | } |
| | | |
| | | loopMoveCol = (columns, colId, dragIndex, hoverIndex) => { |
| | | columns.forEach(column => { |
| | | if (column.type === 'colspan' && column.uuid === colId) { |
| | | column.subcols.splice(hoverIndex, 0, ...column.subcols.splice(dragIndex, 1)) |
| | | } else if (column.type === 'colspan') { |
| | | this.loopMoveCol(column.subcols, colId, dragIndex, hoverIndex) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | document.body.removeChild(oInput) |
| | | } |
| | | |
| | | handlecolumns = (columns, fields, config, isSub) => { |
| | | handlecolumns = (columns, fields, config, pId) => { |
| | | return columns.map((col, index) => { |
| | | return { |
| | | title: col.label, |
| | |
| | | upComponent: this.updateCol |
| | | }), |
| | | onHeaderCell: () => ({ |
| | | index: isSub ? undefined : index, |
| | | index: pId ? config.uuid + '@sub_' + pId + '_' + index : config.uuid + '@' + index, |
| | | column: col, |
| | | componentId: config.uuid, |
| | | fields: fields, |
| | | align: col.Align, |
| | | moveCol: this.moveCol, |
| | |
| | | changeStyle: this.changeStyle, |
| | | deleteCol: this.deleteCol, |
| | | }), |
| | | children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, true) : null, |
| | | children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, col.uuid) : null, |
| | | } |
| | | }) |
| | | } |
| | |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$view = 'popview' |
| | | |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | | if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | cell.$view = 'popview' |
| | | cell.$toolbtn = true |
| | | |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | | if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | if (submit.execSuccess !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', submit.$menuId, submit.execSuccess, submit) |
| | | } |
| | | |
| | | submit.syncComponentId && MKEmitter.emit('reloadData', submit.syncComponentId) |
| | | } |
| | | |
| | | execError = (res) => { |
| | |
| | | |
| | | cell.$toolbtn = true |
| | | |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | |
| | | cell = this.resetButton(item, cell, popview) |
| | | |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | | if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | if (item.subtype === 'editable') { |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | | item.submit.$menuId = item.uuid |
| | | item.submit.syncComponentId = item.submit.syncComponent ? (item.submit.syncComponent.pop() || '') : '' |
| | | |
| | | if (item.submit.syncComponentId && item.submit.syncComponentId === item.setting.supModule) { |
| | | item.submit.syncComponentId = '' |
| | | if (item.submit.execSuccess === 'grid') { |
| | | item.submit.execSuccess = 'mainline' |
| | | } |
| | | } |
| | | } |
| | | } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards && item.subcards.forEach(card => { |
| | |
| | | |
| | | cell = this.resetButton(item, cell, popview) |
| | | |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | |
| | | cell = this.resetButton(item, cell, popview) |
| | | |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | |
| | | cell = this.resetButton(item, cell, popview) |
| | | |
| | | if (cell.syncComponentId === item.wrap.supModule) { |
| | | if (cell.syncComponentId && cell.syncComponentId === item.wrap.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | | } |
| | | |
| | | group.subButton.syncComponentId = group.subButton.syncComponent ? group.subButton.syncComponent.pop() : '' |
| | | group.subButton.syncComponentId = group.subButton.syncComponent ? (group.subButton.syncComponent.pop() || '') : '' |
| | | |
| | | if (group.subButton.syncComponentId === item.setting.supModule) { |
| | | if (group.subButton.syncComponentId && group.subButton.syncComponentId === item.setting.supModule) { |
| | | group.subButton.syncComponentId = '' |
| | | if (group.subButton.execSuccess === 'grid') { |
| | | group.subButton.execSuccess = 'mainline' |
| | |
| | | cell = this.resetButton(item, cell, Tab) |
| | | cell.$toolbtn = true |
| | | |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | |
| | | cell = this.resetButton(item, cell, Tab) |
| | | |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | | if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | if (item.subtype === 'editable') { |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | | item.submit.$menuId = item.uuid |
| | | item.submit.syncComponentId = item.submit.syncComponent ? (item.submit.syncComponent.pop() || '') : '' |
| | | |
| | | if (item.submit.syncComponentId && item.submit.syncComponentId === item.setting.supModule) { |
| | | item.submit.syncComponentId = '' |
| | | if (item.submit.execSuccess === 'grid') { |
| | | item.submit.execSuccess = 'mainline' |
| | | } |
| | | } |
| | | } |
| | | } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards && item.subcards.forEach(card => { |
| | |
| | | |
| | | cell = this.resetButton(item, cell, Tab) |
| | | |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | |
| | | cell = this.resetButton(item, cell, Tab) |
| | | |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | |
| | | cell = this.resetButton(item, cell, Tab) |
| | | |
| | | if (cell.syncComponentId === item.wrap.supModule) { |
| | | if (cell.syncComponentId && cell.syncComponentId === item.wrap.supModule) { |
| | | cell.syncComponentId = '' |
| | | if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { |
| | | cell.execSuccess = 'mainline' |
| | |
| | | group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | | } |
| | | |
| | | group.subButton.syncComponentId = group.subButton.syncComponent ? group.subButton.syncComponent.pop() : '' |
| | | group.subButton.syncComponentId = group.subButton.syncComponent ? (group.subButton.syncComponent.pop() || '') : '' |
| | | |
| | | if (group.subButton.syncComponentId === item.setting.supModule) { |
| | | if (group.subButton.syncComponentId && group.subButton.syncComponentId === item.setting.supModule) { |
| | | group.subButton.syncComponentId = '' |
| | | if (group.subButton.execSuccess === 'grid') { |
| | | group.subButton.execSuccess = 'mainline' |
| | |
| | | if (unload) return |
| | | |
| | | if (action.setting && action.setting.focus && fieldMap.has(action.setting.focus)) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', fieldMap.get(action.setting.focus).uuid) |
| | | }, 500) |
| | | let focusItem = fieldMap.get(action.setting.focus) |
| | | |
| | | if (focusItem.type === 'text' || focusItem.type === 'number') { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', focusItem.uuid) |
| | | }, 50) |
| | | } else { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', focusItem.uuid) |
| | | }, 500) |
| | | } |
| | | } |
| | | |
| | | if (deForms.length > 0) { |
| | |
| | | } |
| | | |
| | | values.uuid = editItem ? editItem.uuid : '' |
| | | values.position = values.position || (editItem ? editItem.position : 'front') |
| | | |
| | | if (type === 'fullscreen' && editItem) { |
| | | values.status = editItem.status || 'true' |
| | |
| | | }) |
| | | |
| | | if (reset) { |
| | | message.warn('数值类型均为必填。') |
| | | message.warning('数值类型均为必填。') |
| | | } |
| | | |
| | | this.setState({verify: {...verify, columns}}, () => { |
| | |
| | | }) |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql, |
| | | // position: record.position || 'back' |
| | | sql: record.sql |
| | | }) |
| | | } |
| | | |
| | |
| | | <Form {...formItemLayout} className="verify-form" id="verify-excelin-custom-scripts"> |
| | | <Row gutter={24}> |
| | | <Col span={8}> |
| | | <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | <Form.Item label="表名" style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | {sheet} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={10}> |
| | | <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}> |
| | | <Form.Item label="报错字段" style={{margin: 0, whiteSpace: 'nowrap'}}> |
| | | ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT), retmsg |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | <Form.Item label="可用字段"> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip> |
| | | {usefulfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'搜索条件,请按照@xxx@格式使用。'}>, {usefulfields}</Tooltip> : null} |
| | | {linefields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'表单及行变量,系统会定义变量并赋值。'}>, {linefields}</Tooltip> : null} |
| | | </Form.Item> |
| | | </Col> |
| | | {/* <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 执行位置 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('position', { |
| | | initialValue: 'front' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="init">初始化</Radio> |
| | | <Radio value="front">sql前</Radio> |
| | | <Radio value="back">sql后</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> */} |
| | | <Col span={8}> |
| | | <Form.Item style={{marginBottom: 0}} label={'快捷添加'}> |
| | | <Form.Item style={{marginBottom: 0}} label="快捷添加"> |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | |
| | | </Button> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label={'sql'}> |
| | | <Form.Item label="sql"> |
| | | {getFieldDecorator('sql', { |
| | | initialValue: '', |
| | | rules: [ |
| | |
| | | menuloading: true |
| | | }) |
| | | |
| | | window.GLOB.saving = true |
| | | |
| | | setTimeout(() => { |
| | | let _pass = this.verifyConfig(config) |
| | | |
| | |
| | | menuloading: false |
| | | }) |
| | | |
| | | window.GLOB.saving = false |
| | | |
| | | if (!res) return |
| | | |
| | | if (res.status) { |
| | |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | | |
| | | window.GLOB.saving = false |
| | | |
| | | if (!error) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | menuloading: true |
| | | }) |
| | | |
| | | window.GLOB.saving = true |
| | | |
| | | setTimeout(() => { |
| | | let _pass = this.verifyConfig(config) |
| | | |
| | |
| | | menuloading: false |
| | | }) |
| | | |
| | | window.GLOB.saving = false |
| | | |
| | | if (!res) return |
| | | |
| | | if (res.status) { |
| | |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | | |
| | | window.GLOB.saving = false |
| | | |
| | | if (!error) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | menuloading: true |
| | | }) |
| | | |
| | | window.GLOB.saving = true |
| | | |
| | | setTimeout(() => { |
| | | let _pass = this.verifyConfig(config) |
| | | |
| | |
| | | menuloading: false |
| | | }) |
| | | |
| | | window.GLOB.saving = false |
| | | |
| | | if (!res) return |
| | | |
| | | if (res.status) { |
| | |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | | |
| | | window.GLOB.saving = false |
| | | |
| | | if (!error) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | menuloading: true |
| | | }) |
| | | |
| | | window.GLOB.saving = true |
| | | |
| | | setTimeout(() => { |
| | | let _pass = this.verifyConfig(config) |
| | | |
| | |
| | | menuloading: false |
| | | }) |
| | | |
| | | window.GLOB.saving = false |
| | | |
| | | if (!res) return |
| | | |
| | | if (res.status) { |
| | |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | | |
| | | window.GLOB.saving = false |
| | | |
| | | if (!error) { |
| | | notification.warning({ |
| | | top: 92, |