| | |
| | | |
| | | return ( |
| | | <div id="verify-excel-box-tab"> |
| | | <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.tabchange}> |
| | | <Tabs activeKey={activeKey} className="tablein-verify-card-box" onChange={this.tabchange}> |
| | | <TabPane tab="基础验证" key="basemsg"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | |
| | | .verify-card-box { |
| | | .tablein-verify-card-box { |
| | | .ant-tabs-nav-scroll { |
| | | text-align: center; |
| | | } |
| | |
| | | |
| | | return ( |
| | | <div className="model-interface-form-box" id="model-interface-form-body"> |
| | | <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.changeTab}> |
| | | <Tabs activeKey={activeKey} onChange={this.changeTab}> |
| | | <TabPane tab="接口设置" key="setting"> |
| | | <BaseForm |
| | | dict={dict} |
| | |
| | | |
| | | return ( |
| | | <div id="verify-excel-box-tab"> |
| | | <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.tabchange}> |
| | | <Tabs activeKey={activeKey} className="excelin-verify-card-box" onChange={this.tabchange}> |
| | | <TabPane tab="基础验证" key="basemsg"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | |
| | | </span> |
| | | } key="unique"> |
| | | <UniqueForm fields={verify.columns} dict={this.props.dict} uniqueChange={this.uniqueChange}/> |
| | | <EditTable actions={['edit', 'move', 'del']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/> |
| | | <EditTable actions={['edit', 'move', 'del', 'status']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/> |
| | | </TabPane> : null} |
| | | {card.intertype === 'system' ? <TabPane tab={ |
| | | <span> |
| | |
| | | .verify-card-box { |
| | | .excelin-verify-card-box { |
| | | .ant-tabs-nav-scroll { |
| | | text-align: center; |
| | | } |
| | |
| | | |
| | | return ( |
| | | <div id="verify-excelout-box-tab"> |
| | | <Tabs defaultActiveKey="1" className="verify-card-box" onChange={this.tabchange}> |
| | | <Tabs defaultActiveKey="1" className="excelout-verify-card-box" onChange={this.tabchange}> |
| | | <TabPane tab={ |
| | | <span> |
| | | Excel导出列 |
| | |
| | | .verify-card-box { |
| | | .excelout-verify-card-box { |
| | | .ant-tabs-nav-scroll { |
| | | text-align: center; |
| | | } |
| | |
| | | return ( |
| | | <div className="model-table-setting-form-box" id="model-setting-form-body"> |
| | | {loading && <Spin size="large" />} |
| | | <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.changeTab}> |
| | | <Tabs activeKey={activeKey} onChange={this.changeTab}> |
| | | <TabPane tab="数据源" key="setting"> |
| | | <DataSource |
| | | menu={menu} |
| | |
| | | return ( |
| | | <div className="model-tree-setting-form-box" id="model-setting-form-body"> |
| | | {loading && <Spin size="large" />} |
| | | <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.changeTab}> |
| | | <Tabs activeKey={activeKey} onChange={this.changeTab}> |
| | | <TabPane tab="数据源" key="setting"> |
| | | <DataSource |
| | | menu={menu} |
| | |
| | | box-shadow: unset; |
| | | } |
| | | |
| | | .verify-card-box .ant-tabs-nav-scroll { |
| | | .ant-tabs-nav-scroll { |
| | | text-align: center; |
| | | } |
| | | } |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { DndProvider, DragSource, DropTarget } from 'react-dnd' |
| | | import { Table, Input, InputNumber, Popconfirm, Form, Select, Radio, Cascader, notification, message, Modal, Typography } from 'antd' |
| | | import { CopyOutlined, EditOutlined, DeleteOutlined, SnippetsOutlined } from '@ant-design/icons' |
| | | import { CopyOutlined, EditOutlined, DeleteOutlined, SnippetsOutlined, SwapOutlined } from '@ant-design/icons' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import ColorSketch from '@/mob/colorsketch' |
| | |
| | | <div className={'edit-operation-btn' + (editingKey !== '' ? ' disabled' : '')} style={{minWidth: '110px', whiteSpace: 'nowrap'}}> |
| | | {actions.includes('edit') ? <span className="primary" onClick={() => {editingKey === '' && this.edit(record.uuid)}}><EditOutlined /></span> : null} |
| | | {actions.includes('copy') ? <span className="copy" onClick={() => {editingKey === '' && this.copy(record)}}><CopyOutlined /></span> : null} |
| | | {actions.includes('status') ? <span className="status" onClick={() => {editingKey === '' && this.handleStatus(record)}}><SwapOutlined /></span> : null} |
| | | {actions.includes('del') && editingKey === '' ? <Popconfirm |
| | | overlayClassName="popover-confirm" |
| | | title={eTDict['model.query.delete']} |
| | |
| | | }) |
| | | } |
| | | |
| | | handleStatus = (record) => { |
| | | const { data } = this.state |
| | | |
| | | record.status = record.status === 'false' ? 'true' : 'false' |
| | | |
| | | let newData = data.map(item => { |
| | | if (record.uuid === item.uuid) return record |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ data: newData }, () => { |
| | | this.props.onChange(newData) |
| | | }) |
| | | } |
| | | |
| | | onSave = (record) => { |
| | | const { columns } = this.state |
| | | const newData = [...this.state.data] |
| | |
| | | .edit-operation-btn { |
| | | display: block; |
| | | text-align: center; |
| | | span { |
| | | > span { |
| | | margin-right: 10px; |
| | | cursor: pointer; |
| | | font-size: 16px; |
| | |
| | | } |
| | | .copy { |
| | | color: #26C281; |
| | | } |
| | | .status { |
| | | color: #8E44AD; |
| | | } |
| | | .danger { |
| | | color: #ff4d4f; |
| | |
| | | .danger { |
| | | color: rgba(0, 0, 0, .25); |
| | | } |
| | | .status { |
| | | color: rgba(0, 0, 0, .25); |
| | | } |
| | | .copy { |
| | | color: rgba(0, 0, 0, .25); |
| | | } |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verify-custom-callback-scripts"> |
| | | <Form {...formItemLayout} className="verify-form verify-custom-callback-scripts" id="verify-custom-callback-scripts"> |
| | | <Row gutter={24}> |
| | | <Col span={8}> |
| | | <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}> |
| | |
| | | #verify-custom-scripts { |
| | | .verify-custom-callback-scripts { |
| | | .ant-select-dropdown-menu-item { |
| | | white-space: normal; |
| | | } |
| | |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green"> |
| | | 保存 |
| | | </Button> |
| | | <div></div> |
| | | <Button onClick={this.handleCancel}> |
| | | 取消 |
| | | </Button> |
| | |
| | | |
| | | class CustomForm extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.any, |
| | | dict: PropTypes.object, // 字典项 |
| | | btn: PropTypes.object, // 按钮信息 |
| | | usefulfields: PropTypes.string, // 可用字段 |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { usefulfields, systemScripts, btn } = this.props |
| | | const { usefulfields, systemScripts, btn, type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | } |
| | | } |
| | | |
| | | let _type = type || '' |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verify-custom-scripts"> |
| | | <Form {...formItemLayout} className="verify-form verify-custom-scripts" id={'verify-custom-scripts' + _type}> |
| | | <Row gutter={24}> |
| | | {btn.sql ? <Col span={8}> |
| | | {!_type && btn.sql ? <Col span={8}> |
| | | <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | {btn.sql} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={10}> |
| | | {!_type ? <Col span={10}> |
| | | <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}> |
| | | ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT), retmsg |
| | | </Form.Item> |
| | | </Col> |
| | | {usefulfields ? <Col span={24} className="sqlfield"> |
| | | </Col> : null} |
| | | {!_type && usefulfields ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | {usefulfields} |
| | | </Form.Item> |
| | |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onSelect={this.selectScript} |
| | | getPopupContainer={() => document.getElementById('verify-custom-scripts')} |
| | | getPopupContainer={() => document.getElementById('verify-custom-scripts' + _type)} |
| | | > |
| | | <Select.Option key="default" value={this.props.defaultsql}>默认sql</Select.Option> |
| | | <Select.Option key="debugger" value={`z_debug: select @ErrorCode='E',@retmsg='测试断点' goto aaa`}> |
| | |
| | | #verify-custom-scripts { |
| | | .verify-custom-scripts { |
| | | .ant-select-dropdown-menu-item { |
| | | white-space: normal; |
| | | } |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Radio, Button, Select, Popconfirm, notification, Modal, message, InputNumber, Tooltip, Typography } from 'antd' |
| | | import { QuestionCircleOutlined, CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined, ExclamationOutlined } from '@ant-design/icons' |
| | | import { QuestionCircleOutlined, CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined, ExclamationOutlined, BorderOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { updateForm } from '@/utils/utils-update.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MinView from '@/assets/img/minview.png' |
| | | import './index.scss' |
| | | |
| | | const { TabPane } = Tabs |
| | |
| | | initsql: '', // sql验证时变量声明及赋值 |
| | | notes: [], // 短信模板 |
| | | setting: null, |
| | | visible: false, |
| | | scriptId: '', |
| | | verify: {}, |
| | | fields: [], |
| | | usefulfields: '', |
| | |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { verify, fields, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes } = this.state |
| | | const { verify, fields, visible, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | </span> |
| | | } key="2x"> |
| | | <ContrastForm dict={this.props.dict} contrastChange={this.contrastChange}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="contrastverify" data={verify.contrasts} columns={contrastColumns} onChange={(contrasts) => this.setState({verify: {...verify, contrasts}})}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'status']} type="contrastverify" data={verify.contrasts} columns={contrastColumns} onChange={(contrasts) => this.setState({verify: {...verify, contrasts}})}/> |
| | | </TabPane> : null} |
| | | {card.intertype === 'system' || (card.intertype === 'custom' && card.procMode === 'system') ? <TabPane tab={ |
| | | <span> |
| | |
| | | dict={this.props.dict} |
| | | uniqueChange={this.uniqueChange} |
| | | /> |
| | | <EditTable actions={['edit', 'move', 'del']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/> |
| | | <EditTable actions={['edit', 'move', 'del', 'status']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/> |
| | | </TabPane> : null} |
| | | {card.intertype === 'system' || (card.intertype === 'custom' && card.procMode === 'system') ? <TabPane tab={ |
| | | <span> |
| | |
| | | {verify.scripts.length ? <span className="count-tip">{verify.scripts.length}</span> : null} |
| | | </span> |
| | | } key="6"> |
| | | |
| | | <BorderOutlined className="full-scripts" onClick={() => { |
| | | if (this.scriptsForm && (this.scriptsForm.state.editItem || (this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))))) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请保存自定义脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({visible: true, scriptId: ''}) |
| | | }}/> |
| | | <CustomScript |
| | | btn={this.props.card} |
| | | dict={this.props.dict} |
| | |
| | | </Form> |
| | | </TabPane> |
| | | </Tabs> |
| | | <Modal |
| | | wrapClassName="model-custom-scripts-modal" |
| | | title="自定义脚本" |
| | | visible={visible} |
| | | width={'95vw'} |
| | | maskClosable={false} |
| | | destroyOnClose |
| | | > |
| | | <img className="unfull-scripts" src={MinView} onClick={() => this.setState({visible: false, scriptId: ''})} alt=""/> |
| | | <div className="script-table-wrap"> |
| | | {verify.scripts.map(item => { |
| | | let title = item.sql.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | let _text = title ? item.sql.replace(title, '') : item.sql |
| | | |
| | | let position = null |
| | | if (item.position === 'init') { |
| | | position = <span style={{color: 'orange'}}>初始化</span> |
| | | } else if (item.position === 'front') { |
| | | position = <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | position = <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | |
| | | return ( |
| | | <div className={'script-item ' + (this.state.scriptId === item.uuid ? 'active' : '') } key={item.uuid}> |
| | | <div style={{cursor: 'pointer'}} onClick={() => { |
| | | this.scriptsFullForm.edit(item) |
| | | this.setState({scriptId: item.uuid}) |
| | | }}> |
| | | {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} |
| | | <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> |
| | | <div>{position}{item.status === 'false' ? |
| | | <span style={{color: '#ff4d4f', marginLeft: '20px'}}> |
| | | 禁用 |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </span> : |
| | | <span style={{color: '#26C281', marginLeft: '20px'}}> |
| | | 启用 |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </span>} |
| | | </div> |
| | | </div> |
| | | <div style={{textAlign: 'right'}}> |
| | | <span className="operation-btn" onClick={() => this.handleStatus(item, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> |
| | | <Popconfirm |
| | | overlayClassName="popover-confirm" |
| | | title={this.props.dict['model.query.delete']} |
| | | onConfirm={() => this.handleDelete(item, 'scripts') |
| | | }> |
| | | <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> |
| | | </Popconfirm> |
| | | </div> |
| | | </div> |
| | | ) |
| | | })} |
| | | </div> |
| | | <CustomScript |
| | | type="fullscreen" |
| | | btn={this.props.card} |
| | | dict={this.props.dict} |
| | | initsql={this.state.initsql} |
| | | customScripts={verify.scripts} |
| | | defaultsql={this.state.defaultsql} |
| | | usefulfields={this.state.usefulfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsFullForm = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | .operation-btn:not(:first-child) { |
| | | margin-left: 5px; |
| | | } |
| | | .full-scripts { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 18px; |
| | | font-size: 18px; |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | .model-custom-scripts-modal { |
| | | .ant-modal { |
| | | top: 30px; |
| | | .ant-modal-footer { |
| | | display: none; |
| | | } |
| | | .ant-modal-close { |
| | | display: none; |
| | | } |
| | | .ant-modal-body { |
| | | height: calc(100vh - 110px); |
| | | overflow-y: auto; |
| | | display: flex; |
| | | |
| | | .script-table-wrap { |
| | | width: 220px; |
| | | |
| | | .operation-btn { |
| | | display: inline-block; |
| | | font-size: 16px; |
| | | padding: 0 5px; |
| | | cursor: pointer; |
| | | margin-left: 5px; |
| | | } |
| | | |
| | | .script-item { |
| | | border: 1px solid #eeeeee; |
| | | padding: 5px; |
| | | margin-bottom: 10px; |
| | | } |
| | | .script-item.active { |
| | | border-color: #1890ff; |
| | | } |
| | | .ant-typography { |
| | | margin-bottom: 5px; |
| | | } |
| | | } |
| | | |
| | | .unfull-scripts { |
| | | position: absolute; |
| | | right: 20px; |
| | | z-index: 2; |
| | | top: 18px; |
| | | color: #1890ff; |
| | | width: 26px; |
| | | cursor: pointer; |
| | | padding: 5px; |
| | | |
| | | } |
| | | |
| | | .verify-form { |
| | | flex: 1; |
| | | .sql { |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | } |
| | | .ant-col-sm-16 { |
| | | width: 89.5%; |
| | | padding-top: 4px; |
| | | } |
| | | .CodeMirror { |
| | | height: auto; |
| | | min-height: calc(100vh - 230px); |
| | | } |
| | | .CodeMirror-scroll { |
| | | min-height: calc(100vh - 230px); |
| | | } |
| | | } |
| | | .sqlfield { |
| | | .ant-form-item { |
| | | margin-bottom: 5px; |
| | | } |
| | | .ant-form-item-control { |
| | | line-height: 24px; |
| | | } |
| | | .ant-form-item-label { |
| | | line-height: 25px; |
| | | } |
| | | .ant-form-item-children { |
| | | line-height: 22px; |
| | | } |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | } |
| | | .ant-col-sm-16 { |
| | | width: 89.5%; |
| | | } |
| | | } |
| | | .add { |
| | | padding-top: 4px; |
| | | } |
| | | } |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | } |