| | |
| | | dataIndex: 'label', |
| | | inputType: 'input', |
| | | editable: true, |
| | | searchable: true, |
| | | width: '28%' |
| | | }, |
| | | { |
| | |
| | | editable: true, |
| | | unique: true, |
| | | strict: true, |
| | | searchable: true, |
| | | copy: true, |
| | | rules: [{ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, |
| | |
| | | |
| | | const { TabPane } = Tabs |
| | | const { confirm } = Modal |
| | | const { Search } = Input |
| | | const { Paragraph } = Typography |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) |
| | | const FullScripts = asyncComponent(() => import('@/templates/zshare/verifycard/fullScripts')) |
| | |
| | | verify: {}, |
| | | systemScripts: [], |
| | | activeKey: 'basemsg', |
| | | searchKey: '', |
| | | excelColumns: [ |
| | | { |
| | | title: '字段', |
| | |
| | | inputType: 'input', |
| | | unique: true, |
| | | strict: true, |
| | | searchable: true, |
| | | copy: true, |
| | | editable: true |
| | | }, |
| | | { |
| | |
| | | dataIndex: 'Text', |
| | | width: '14%', |
| | | inputType: 'input', |
| | | searchable: true, |
| | | editable: true |
| | | }, |
| | | { |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | searchKey: '', |
| | | verify: { |
| | | ..._verify, |
| | | default: _verify.default || 'true', |
| | |
| | | render() { |
| | | const { card } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { verify, excelColumns, scriptsColumns, uniqueColumns, activeKey } = this.state |
| | | const { verify, excelColumns, scriptsColumns, uniqueColumns, activeKey, searchKey } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | 清空Excel列 |
| | | </Button> |
| | | <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:数值类型(int 或 decimal),内容为必填;最大值和最小值在类型为数值时有效。导入-初始化:用于excel中不存在,导入时需要初始化的字段</Col> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'extra:required:是否必填']} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'extra:required:是否必填']} searchKey={searchKey} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | </TabPane> |
| | | {card.intertype === 'system' ? <TabPane tab={ |
| | | <span> |
| | |
| | | /> |
| | | <EditTable actions={['move']} data={verify.scripts} columns={scriptsColumns} onChange={(scripts) => {this.setState({verify: {...verify, scripts}})}}/> |
| | | </TabPane> : null} |
| | | <TabPane tab="信息提示" key="tip"> |
| | | <TabPane tab={ |
| | | <span> |
| | | 信息提示 |
| | | {activeKey === 'excelcolumn' ? <span onClick={(e) => {e.stopPropagation()}}><Search className="mk-search-fields" defaultValue={searchKey} allowClear onSearch={(val, e) => {e.stopPropagation();this.setState({searchKey: val})}} /></span> : null} |
| | | </span> |
| | | } key="tip"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | |
| | | color: #1890ff; |
| | | font-size: 12px; |
| | | } |
| | | .mk-search-fields { |
| | | position: absolute; |
| | | cursor: pointer; |
| | | width: 150px; |
| | | z-index: 1; |
| | | top: 10px; |
| | | right: -170px; |
| | | display: inline-block; |
| | | .ant-input { |
| | | border-radius: 40px; |
| | | height: 30px; |
| | | transition: opacity 0.2s; |
| | | } |
| | | .ant-input:not(:hover):not(:active):not(:focus) { |
| | | opacity: 0.6; |
| | | } |
| | | .ant-input:not(:hover):not(:active):not(:focus) + .ant-input-suffix { |
| | | opacity: 0.6; |
| | | } |
| | | } |
| | | .mk-search-fields:hover { |
| | | .ant-input { |
| | | opacity: 1; |
| | | } |
| | | .ant-input-suffix { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | .verify-form { |
| | | .sql { |
| | | .ant-col-sm-8 { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Spin, Typography, Popconfirm } from 'antd' |
| | | import { Form, Tabs, Row, Col, Button, Input, notification, Modal, message, InputNumber, Spin, Typography, Popconfirm } from 'antd' |
| | | import { EditOutlined, StopOutlined, CheckCircleOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | |
| | | const { TabPane } = Tabs |
| | | const { confirm } = Modal |
| | | const { Search } = Input |
| | | const { Paragraph } = Typography |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) |
| | | |
| | |
| | | verify: {}, |
| | | debugId: '', |
| | | activeKey: 'setting', |
| | | searchKey: '', |
| | | excelColumns: [ |
| | | { |
| | | title: '字段', |
| | |
| | | inputType: 'input', |
| | | editable: true, |
| | | unique: true, |
| | | searchable: true, |
| | | copy: true, |
| | | width: '16%' |
| | | }, |
| | | { |
| | |
| | | dataIndex: 'Text', |
| | | inputType: 'input', |
| | | editable: true, |
| | | searchable: true, |
| | | unique: true, |
| | | width: '16%' |
| | | }, |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | searchKey: '', |
| | | verify: _verify, |
| | | searches: searches, |
| | | activeKey: card.intertype === 'system' && _verify.dataType === 'custom' ? 'setting' : 'columns' |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { card, config } = this.props |
| | | const { activeKey, verify } = this.state |
| | | |
| | | // 表单提交时检查输入值是否正确 |
| | |
| | | }) |
| | | |
| | | return |
| | | } |
| | | |
| | | if (card.intertype === 'system' && verify.dataType !== 'custom' && verify.columns.length > 0 && config.$c_ds && config.setting.interType === 'system' && config.columns && config.columns.length > 0) { |
| | | let cols = [] |
| | | let columns = config.columns.map(c => c.field) |
| | | verify.columns.forEach(col => { |
| | | if (col.output === 'false' || col.Column === '$Index') return |
| | | if (!columns.includes(col.Column)) { |
| | | cols.push(col.Column) |
| | | } |
| | | }) |
| | | if (cols.length) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: `导出列(${cols.join('、')})在字段集中不存在!`, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (activeKey === 'setting') { |
| | |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { verify, excelColumns, scriptsColumns, activeKey, loading, searches } = this.state |
| | | const { verify, excelColumns, scriptsColumns, activeKey, loading, searches, searchKey } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | 清空Excel列 |
| | | </Button> |
| | | <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>如需导出序号,请使用字段 $Index;数值类型导出时可取绝对值以及设置小数位;导出为否时,不使用行信息;红色标题导出时列头文字为红色。</div> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" wrappedComponentRef={(inst) => this.columnRef = inst} data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" searchKey={searchKey} wrappedComponentRef={(inst) => this.columnRef = inst} data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | </TabPane> |
| | | {card.intertype === 'system' ? <TabPane tab={ |
| | | <span> |
| | |
| | | /> |
| | | <EditTable actions={['move']} data={verify.scripts} columns={scriptsColumns} onChange={(scripts) => {this.setState({verify: {...verify, scripts}})}}/> |
| | | </TabPane> : null} |
| | | <TabPane tab="信息提示" key="message"> |
| | | <TabPane tab={ |
| | | <span> |
| | | 信息提示 |
| | | {activeKey === 'columns' ? <span onClick={(e) => {e.stopPropagation()}}><Search className="mk-search-fields" defaultValue={searchKey} allowClear onSearch={(val, e) => {e.stopPropagation();this.setState({searchKey: val})}} /></span> : null} |
| | | </span> |
| | | } key="message"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | |
| | | color: #1890ff; |
| | | font-size: 12px; |
| | | } |
| | | .mk-search-fields { |
| | | position: absolute; |
| | | cursor: pointer; |
| | | width: 150px; |
| | | z-index: 1; |
| | | top: 10px; |
| | | right: -170px; |
| | | display: inline-block; |
| | | .ant-input { |
| | | border-radius: 40px; |
| | | height: 30px; |
| | | transition: opacity 0.2s; |
| | | } |
| | | .ant-input:not(:hover):not(:active):not(:focus) { |
| | | opacity: 0.6; |
| | | } |
| | | .ant-input:not(:hover):not(:active):not(:focus) + .ant-input-suffix { |
| | | opacity: 0.6; |
| | | } |
| | | } |
| | | .mk-search-fields:hover { |
| | | .ant-input { |
| | | opacity: 1; |
| | | } |
| | | .ant-input-suffix { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | .verify-form { |
| | | .sql { |
| | | .ant-col-sm-8 { |
| | |
| | | return item |
| | | }) |
| | | |
| | | let reg = searchKey ? new RegExp(searchKey, 'i') : null |
| | | let reg = null |
| | | let regs = [] |
| | | |
| | | if (searchKey) { |
| | | reg = new RegExp(searchKey, 'i') |
| | | this.state.columns.forEach(col => { |
| | | if (col.searchable) { |
| | | regs.push(col.dataIndex) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return ( |
| | | <EditableContext.Provider value={this.props.form}> |
| | |
| | | className += ' active' |
| | | } |
| | | if (searchKey) { |
| | | if (!reg.test(record.field) && !reg.test(record.label)) { |
| | | if (regs.findIndex(f => reg.test(record[f])) === -1) { |
| | | className += ' hidden' |
| | | } |
| | | } |