From 7b0dbecd1d6155d26ec67be0a47a16264c738c85 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 09 五月 2023 14:48:10 +0800 Subject: [PATCH] 2023-05-09 --- src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 622 +++++++++++++++++++++++++++++++++---------------------- 1 files changed, 373 insertions(+), 249 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 8ed8dfd..4580eb7 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -1,6 +1,8 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber, Radio } from 'antd' +import { fromJS } from 'immutable' +import { Form, Tabs, Row, Col, Input, Button, Popconfirm, Tooltip, notification, Modal, message, InputNumber, Radio, Typography } from 'antd' +import { EditOutlined, QuestionCircleOutlined, StopOutlined, CheckCircleOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' import moment from 'moment' import Api from '@/api' @@ -9,149 +11,203 @@ import UniqueForm from './uniqueform' import ColumnForm from './columnform' import CustomScript from './customscript' +import asyncComponent from '@/utils/asyncComponent' +import MKEmitter from '@/utils/events.js' import './index.scss' const { TabPane } = Tabs const { confirm } = Modal +const { Paragraph } = Typography +const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) class VerifyCard extends Component { static propTpyes = { columns: PropTypes.array, // 鏄剧ず鍒� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, } state = { verify: {}, systemScripts: [], + activeKey: 'basemsg', excelColumns: [ { - title: 'Column', + title: '瀛楁', dataIndex: 'Column', - width: '16%', + width: '14%', + inputType: 'input', + unique: true, editable: true }, { - title: 'Text', + title: '鍚嶇О', dataIndex: 'Text', - width: '19%', + width: '14%', + inputType: 'input', editable: true }, { title: '绫诲瀷', dataIndex: 'type', - width: '12%', - editable: true + width: '15%', + editable: true, + inputType: 'select', + options: [ + { value: 'Nvarchar(10)', text: 'Nvarchar(10)' }, + { value: 'Nvarchar(20)', text: 'Nvarchar(20)' }, + { value: 'Nvarchar(50)', text: 'Nvarchar(50)' }, + { value: 'Nvarchar(100)', text: 'Nvarchar(100)' }, + { value: 'Nvarchar(256)', text: 'Nvarchar(256)' }, + { value: 'Nvarchar(512)', text: 'Nvarchar(512)' }, + { value: 'Nvarchar(1024)', text: 'Nvarchar(1024)' }, + { value: 'Nvarchar(2048)', text: 'Nvarchar(2048)' }, + { value: 'Nvarchar(max)', text: 'Nvarchar(max)' }, + { value: 'Int', text: 'Int' }, + { value: 'Decimal(18,0)', text: 'Decimal(18,0)' }, + { value: 'Decimal(18,2)', text: 'Decimal(18,2)' }, + { value: 'Decimal(18,4)', text: 'Decimal(18,4)' }, + { value: 'Decimal(18,6)', text: 'Decimal(18,6)' }, + { value: 'date', text: 'date' } + ] }, { - title: '鏄惁蹇呭~', + title: '蹇呭~', dataIndex: 'required', - width: '12%', + width: '10%', editable: true, + inputType: 'switch', render: (text, record) => record.required === 'true' ? '鏄�' : '鍚�' + }, + { + title: '瀵煎叆', + dataIndex: 'import', + width: '10%', + editable: true, + inputType: 'switch', + render: (text, record) => record.import !== 'false' ? '鏄�' : '鍚�' }, { title: '鏈�灏忓��', dataIndex: 'min', - width: '12%', + width: '10%', + required: false, + inputType: 'number', + unlimit: true, editable: true }, { title: '鏈�澶у��', dataIndex: 'max', - width: '12%', + width: '10%', + required: false, + inputType: 'number', + unlimit: true, editable: true - }, - { - title: '鎿嶄綔', - align: 'center', - dataIndex: 'operation', - render: (text, record) => - ( - <div> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'columns')} style={{color: '#1890ff'}}><Icon type="edit" /></span> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'columns', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'columns', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <Popconfirm - title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['header.cancel']} - onConfirm={() => this.handleDelete(record, 'columns') - }> - <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> - </Popconfirm> - </div> - ) } ], uniqueColumns: [ { - title: '瀛楁鍚�', + title: '鍒楀悕', + dataIndex: 'fieldlabel', + width: '20%' + }, + { + title: '瀛楁', dataIndex: 'field', - width: '35%' + width: '25%', + editable: true, + inputType: 'multiStr', + options: [] }, { title: '鎶ラ敊缂栫爜', dataIndex: 'errorCode', - width: '12%' + width: '10%', + editable: true, + inputType: 'select', + options: [ + { value: 'E', text: 'E' }, + { value: 'N', text: 'N' }, + { value: 'F', text: 'F' }, + { value: 'NM', text: 'NM' } + ] }, { title: '楠岃瘉绫诲瀷', dataIndex: 'verifyType', - width: '13%', - render: (text, record) => record.verifyType === 'logic' ? '閫昏緫楠岃瘉' : '鐗╃悊楠岃瘉' + width: '14%', + render: (text, record) => { + let names = { + physical: '鐗╃悊楠岃瘉锛堝叏閲忛獙璇侊級', + logic: '閫昏緫楠岃瘉锛堝叏閲忛獙璇侊級', + physical_temp: '鐗╃悊楠岃瘉锛堜粎涓存椂琛級', + logic_temp: '閫昏緫楠岃瘉锛堜粎涓存椂琛級', + } + + return names[text] || '鐗╃悊楠岃瘉锛堝叏閲忛獙璇侊級' + }, + inputType: 'select', + editable: true, + options: [ + { value: 'physical', text: '鐗╃悊楠岃瘉锛堝叏閲忛獙璇侊級' }, + { value: 'logic', text: '閫昏緫楠岃瘉锛堝叏閲忛獙璇侊級' }, + { value: 'physical_temp', text: '鐗╃悊楠岃瘉锛堜粎涓存椂琛級' }, + { value: 'logic_temp', text: '閫昏緫楠岃瘉锛堜粎涓存椂琛級' } + ] }, { - title: '鐘舵��', + title: '鏄惁鍚敤', dataIndex: 'status', - width: '15%', + width: '12%', + editable: true, + required: false, + inputType: 'switch', render: (text, record) => record.status === 'false' ? ( - <div> - {this.props.dict['header.form.status.forbidden']} - <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> + <div style={{color: '#ff4d4f'}}> + 绂佺敤 + <StopOutlined style={{marginLeft: '5px'}} /> </div> ) : ( - <div> - {this.props.dict['header.form.status.open']} - <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> + <div style={{color: '#26C281'}}> + 鍚敤 + <CheckCircleOutlined style={{marginLeft: '5px'}}/> </div> ) }, - { - title: '鎿嶄綔', - align: 'center', - width: '25%', - dataIndex: 'operation', - render: (text, record) => - (<div> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'unique')} style={{color: '#1890ff'}}><Icon type="edit" /></span> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'unique', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> - <Popconfirm - title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['header.cancel']} - onConfirm={() => this.handleDelete(record, 'unique') - }> - <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> - </Popconfirm> - </div>) - } ], scriptsColumns: [ { title: 'SQL', dataIndex: 'sql', - width: '60%' + width: '60%', + render: (text) => { + let title = text.match(/^\s*\/\*.+\*\//) + title = title && title[0] ? title[0] : '' + let _text = title ? text.replace(title, '') : text + + return ( + <div> + {title ? <span style={{color: '#a50'}}>{title}<span style={{fontSize: '12px', marginLeft: '5px'}}>{_text.length}</span></span> : null} + <Paragraph copyable={{ text: text }} ellipsis={{ rows: 4, expandable: true }}>{_text}</Paragraph> + </div> + ) + } }, { title: '鎵ц浣嶇疆', dataIndex: 'position', width: '10%', - render: (text, record) => record.position !== 'front' ? 'sql鍚�' : 'sql鍓�' + render: (text, record) => { + if (record.position === 'init') { + return <span style={{color: 'orange'}}>鍒濆鍖�</span> + } else if (record.position === 'front') { + return <span style={{color: '#26C281'}}>sql鍓�</span> + } else { + return <span style={{color: '#1890ff'}}>sql鍚�</span> + } + } }, { title: '鐘舵��', @@ -159,36 +215,33 @@ width: '10%', render: (text, record) => record.status === 'false' ? ( - <div> - {this.props.dict['header.form.status.forbidden']} - <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> + <div style={{color: '#ff4d4f'}}> + 绂佺敤 + <StopOutlined style={{marginLeft: '5px'}} /> </div> ) : ( - <div> - {this.props.dict['header.form.status.open']} - <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> + <div style={{color: '#26C281'}}> + 鍚敤 + <CheckCircleOutlined style={{marginLeft: '5px'}}/> </div> ) }, { title: '鎿嶄綔', align: 'center', - width: '20%', + width: '140px', dataIndex: 'operation', render: (text, record) => - (<div> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><Icon type="edit" /></span> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'scripts', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> + (<div style={{textAlign: 'center'}}> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm - title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['header.cancel']} + overlayClassName="popover-confirm" + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'scripts') }> - <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> + <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> </Popconfirm> </div>) } @@ -196,13 +249,23 @@ } UNSAFE_componentWillMount() { - let _verify = this.props.card.verify || {} - _verify = JSON.parse(JSON.stringify(_verify)) - + const { card } = this.props + let _verify = fromJS(card.verify || {}).toJS() let _columns = _verify.columns || [] + + delete _verify.dataresource + + // 鏃ф暟鎹吋瀹� _columns = _columns.map(col => { col.required = col.required || 'true' col.type = col.type || 'Nvarchar(50)' + col.import = col.import || 'true' + + if (col.type === 'text' || col.type === 'image') { + col.type = 'Nvarchar(50)' + } else if (col.type === 'number') { + col.type = 'Decimal(18,2)' + } if (/^Nvarchar/ig.test(col.type)) { col.limit = col.type.match(/\d+/)[0] @@ -215,6 +278,10 @@ return col }) + if (!_verify.hasOwnProperty('range')) { + _verify.range = 1 + } + this.setState({ verify: { ..._verify, @@ -225,10 +292,23 @@ scripts: _verify.scripts || [], uniques: _verify.uniques || [] } + }, () => { + this.resetUniqueColumns() }) } componentDidMount () { + this.getsysScript() + } + + getsysScript = () => { + if (sessionStorage.getItem('mk_sys_scripts')) { + this.setState({ + systemScripts: JSON.parse(sessionStorage.getItem('mk_sys_scripts')) + }) + return + } + let _scriptSql = `Select distinct func+Remark as funcname,longparam, s.Sort from聽 s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end order by s.Sort` _scriptSql = Utils.formatOptions(_scriptSql) @@ -240,18 +320,23 @@ arr_field: 'funcname,longparam' } - _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) + _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 浜戠鏁版嵁楠岃瘉 Api.getSystemConfig(_sParam).then(res => { if (res.status) { + let _scripts = res.data.map(item => { + return { + name: item.funcname, + value: window.decodeURIComponent(window.atob(item.longparam)) + } + }) + + sessionStorage.setItem('mk_sys_scripts', JSON.stringify(_scripts)) + this.setState({ - systemScripts: res.data.map(item => { - return { - name: item.funcname, - value: Utils.formatOptions(item.longparam, true) - } - }) + systemScripts: _scripts }) } else { notification.warning({ @@ -263,19 +348,40 @@ }) } + resetUniqueColumns = () => { + const { uniqueColumns, verify } = this.state + + this.setState({uniqueColumns: uniqueColumns.map(col => { + if (col.dataIndex === 'field') { + col.options = verify.columns.map(c => { + return { + field: c.Column, + label: c.Text + } + }) + col.options.unshift({ + field: 'BID', + label: 'BID' + }) + } + + return col + })}) + } + columnFieldInput = () => { const { columns } = this.props const { verify } = this.state let _columns = JSON.parse(JSON.stringify(verify.columns)) - let _cols = _columns.map(col => col.Column ) + let _cols = _columns.map(col => col.Column) columns.forEach(col => { if (col.field && !_cols.includes(col.field)) { let _type = 'Nvarchar(50)' let _limit = '50' - if (col.type === 'number' && col.decimal === 0) { + if (col.type === 'number' && !col.decimal) { _type = 'Int' _limit = '' } else if (col.type === 'number') { @@ -289,6 +395,7 @@ Text: col.label, type: _type, limit: _limit, + import: 'true', required: 'true' } @@ -306,49 +413,123 @@ ...verify, columns: _columns } + }, () => { + this.resetUniqueColumns() + }) + } + + clearField = () => { + const { verify } = this.state + const _this = this + + confirm({ + content: `纭畾娓呯┖Excel鍒楀悧锛焋, + onOk() { + _this.setState({ + verify: { + ...verify, + columns: [] + } + }, () => { + _this.resetUniqueColumns() + }) + }, + onCancel() {} }) } columnChange = (values) => { let verify = JSON.parse(JSON.stringify(this.state.verify)) - if (values.uuid) { - verify.columns = verify.columns.map(item => { - if (item.uuid === values.uuid) { - return values - } else { - return item - } + let fields = verify.columns.map(item => item.Column) + if (fields.includes(values.Column)) { + notification.warning({ + top: 92, + message: values.Column + '瀛楁宸插瓨鍦紒', + duration: 5 }) - } else { - values.uuid = Utils.getuuid() - verify.columns.push(values) + return } + + values.uuid = Utils.getuuid() + verify.columns.push(values) this.setState({ verify: verify + }, () => { + this.resetUniqueColumns() + }) + } + + changeColumns = (columns) => { + const { verify } = this.state + + columns = columns.map(col => { + col.type = col.type || 'Nvarchar(50)' + if (col.type === 'text' || col.type === 'image') { + col.type = 'Nvarchar(50)' + } else if (col.type === 'number') { + col.type = 'Decimal(18,2)' + } + + if (/^Nvarchar/ig.test(col.type)) { + col.limit = col.type.match(/\d+/) ? col.type.match(/\d+/)[0] : '20000' + } else if (/^Decimal/ig.test(col.type)) { + col.limit = col.type.match(/\d+/ig)[1] + col.required = 'true' + } else if (/^int/ig.test(col.type)) { + col.required = 'true' + } else { + col.limit = '' + } + + col.required = col.required || 'true' + col.import = col.import || 'true' + + return col + }) + + this.setState({verify: {...verify, columns}}, () => { + this.resetUniqueColumns() }) } uniqueChange = (values) => { let verify = JSON.parse(JSON.stringify(this.state.verify)) - if (values.uuid) { - verify.uniques = verify.uniques.map(item => { - if (item.uuid === values.uuid) { - return values - } else { - return item - } - }) - } else { - values.uuid = Utils.getuuid() - verify.uniques.push(values) - } + values.status = 'true' + values.uuid = Utils.getuuid() + verify.uniques.push(values) this.setState({ verify: verify }) + } + + changeUniques = (uniques) => { + const { verify } = this.state + + let change = {} + verify.columns.forEach(col => { + change[col.Column] = col.Text + }) + + uniques = uniques.map(item => { + item.status = item.status || 'true' + + if (Array.isArray(item.field)) { + item.fieldlabel = item.field.map(field => { + return change[field] || '' + }) + + item.fieldlabel = item.fieldlabel.join(',') + item.field = item.field.join(',') + } + + return item + }) + + this.setState({verify: {...verify, uniques}}) } scriptsChange = (values) => { @@ -366,6 +547,8 @@ values.uuid = Utils.getuuid() verify.scripts.push(values) } + + MKEmitter.emit('editLineId', values.uuid) this.setState({ verify: verify @@ -387,15 +570,12 @@ } handleEdit = (record, type) => { - if (type === 'columns') { - this.columnForm.edit(record) - } else if (type === 'scripts') { - this.scriptsForm.edit(record) - } else if (type === 'unique') { - this.uniqueForm.edit(record) - } + let node = null - let node = document.getElementById('verify-excel-box-tab').parentNode + if (type === 'scripts') { + this.scriptsForm.edit(record) + node = document.getElementById('mk-exin-script') + } if (node && node.scrollTop) { let inter = Math.ceil(node.scrollTop / 10) @@ -431,68 +611,6 @@ return item } }) - } - - this.setState({ - verify: verify - }) - } - - handleUpDown = (record, type, direction) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) - let index = 0 - - if (type === 'columns') { - verify.columns = verify.columns.filter((item, i) => { - if (item.uuid === record.uuid) { - index = i - } - - return item.uuid !== record.uuid - }) - if ((index === 0 && direction === 'up') || (index === verify.columns.length && direction === 'down')) { - return - } - - if (direction === 'up') { - verify.columns.splice(index - 1, 0, record) - } else { - verify.columns.splice(index + 1, 0, record) - } - } else if (type === 'unique') { - verify.uniques = verify.uniques.filter((item, i) => { - if (item.uuid === record.uuid) { - index = i - } - - return item.uuid !== record.uuid - }) - if ((index === 0 && direction === 'up') || (index === verify.uniques.length && direction === 'down')) { - return - } - - if (direction === 'up') { - verify.uniques.splice(index - 1, 0, record) - } else { - verify.uniques.splice(index + 1, 0, record) - } - } else if (type === 'scripts') { - verify.scripts = verify.scripts.filter((item, i) => { - if (item.uuid === record.uuid) { - index = i - } - - return item.uuid !== record.uuid - }) - if ((index === 0 && direction === 'up') || (index === verify.scripts.length && direction === 'down')) { - return - } - - if (direction === 'up') { - verify.scripts.splice(index - 1, 0, record) - } else { - verify.scripts.splice(index + 1, 0, record) - } } this.setState({ @@ -538,23 +656,17 @@ } let _loading = false - if (this.columnForm && this.columnForm.state.editItem) { + if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.state.editItem) { + this.setState({activeKey: 'scripts'}) + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true - } else if (this.uniqueForm && this.uniqueForm.state.editItem) { - _loading = true - } - - if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { - _loading = true + this.setState({activeKey: 'scripts'}) } if (_loading) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['header.cancel'], onOk() { resolve(_verify) }, @@ -624,10 +736,24 @@ }) } + tabchange = (val) => { + const { activeKey } = this.state + + if (activeKey === 'basemsg') { + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + this.setState({activeKey: val}) + } + }) + } else { + this.setState({activeKey: val}) + } + } + render() { const { card } = this.props const { getFieldDecorator } = this.props.form - const { verify, excelColumns, scriptsColumns, uniqueColumns } = this.state + const { verify, excelColumns, scriptsColumns, uniqueColumns, activeKey } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -640,32 +766,43 @@ } return ( - <div id="verify-excel-box-tab"> - <Tabs defaultActiveKey="1" className="verify-card-box" onChange={this.tabchange}> - <TabPane tab="鍩虹楠岃瘉" key="1"> + <div> + {card.label ? <div className="mk-com-name">{card.label} - 楠岃瘉淇℃伅</div> : null} + <Tabs activeKey={activeKey} className="excelin-verify-card-box" onChange={this.tabchange}> + <TabPane tab="鍩虹楠岃瘉" key="basemsg"> <Form {...formItemLayout}> <Row gutter={24}> <Col span={8}> - <Form.Item label={'Excel琛ㄥ悕'}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title="瀵煎叆鏃跺伐浣滆〃鍚嶄笌excel涓繀椤讳竴鑷达紝娉細宸ヤ綔琛ㄥ悕涓篠heet1涓攅xcel涓粎鏈変竴涓伐浣滆〃鏃朵笉杩涜琛ㄥ悕楠岃瘉銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 宸ヤ綔琛� + </Tooltip> + }> {getFieldDecorator('sheet', { initialValue: verify.sheet || '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['header.form.tablename'] + '!' + message: '璇疯緭鍏ュ伐浣滆〃鍚�!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={8}> - <Form.Item label={'蹇界暐琛�'}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title="蹇界暐棣栬鏃讹紝浼氭牎楠宔xcel涓〃澶村悕绉颁笌excel鍒楄缃槸鍚︿竴鑷淬��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 蹇界暐琛� + </Tooltip> + }> {getFieldDecorator('range', { initialValue: verify.range || 0 })(<InputNumber min={0} max={100} precision={0} />)} </Form.Item> </Col> - {card.intertype === 'inner' && !card.innerFunc ? <Col span={8}> + {card.intertype === 'system' ? <Col span={8}> <Form.Item label={'榛樿sql'}> <Radio.Group value={verify.default} onChange={this.onOptionChange}> <Radio value="true">鎵ц</Radio> @@ -676,44 +813,38 @@ </Row> </Form> </TabPane> - <TabPane tab="Excel鍒楄缃�" key="2x"> - <ColumnForm - dict={this.props.dict} - columns={verify.columns} - columnChange={this.columnChange} - wrappedComponentRef={(inst) => this.columnForm = inst} - /> + <TabPane tab={ + <span> + Excel鍒楄缃� + {verify.columns.length ? <span className="count-tip">{verify.columns.length}</span> : null} + </span> + } key="excelcolumn"> + <ColumnForm columnChange={this.columnChange}/> <Button className="excel-col-add mk-green" title="娣诲姞鏄剧ず鍒楀瓧娈�" onClick={this.columnFieldInput}> - 蹇嵎娣诲姞 + 鍚屾鏄剧ず鍒� </Button> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.columns} - columns={excelColumns} - pagination={false} - /> + <Button className="excel-col-add mk-red" title="娓呯┖Excel鍒�" onClick={this.clearField}> + 娓呯┖Excel鍒� + </Button> + <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>娉細鏁板�肩被鍨嬶紙int 鎴� decimal锛夛紝鍐呭涓哄繀濉紱鏈�澶у�煎拰鏈�灏忓�煎湪绫诲瀷涓烘暟鍊兼椂鏈夋晥銆�</Col> + <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> </TabPane> - {card.intertype === 'inner' && !card.innerFunc ? <TabPane tab="鍞竴鎬ч獙璇�" key="3"> - <UniqueForm - fields={verify.columns} - dict={this.props.dict} - uniqueChange={this.uniqueChange} - wrappedComponentRef={(inst) => this.uniqueForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.uniques} - columns={uniqueColumns} - pagination={false} - /> + {card.intertype === 'system' ? <TabPane tab={ + <span> + 鍞竴鎬ч獙璇� + {verify.uniques.length ? <span className="count-tip">{verify.uniques.length}</span> : null} + </span> + } key="unique"> + <UniqueForm fields={verify.columns} uniqueChange={this.uniqueChange}/> + <EditTable actions={['edit', 'move', 'del', 'status']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/> </TabPane> : null} - {card.intertype === 'inner' && !card.innerFunc ? <TabPane tab="鑷畾涔夎剼鏈�" key="6"> + {card.intertype === 'system' ? <TabPane tab={ + <span> + 鑷畾涔夎剼鏈� + {verify.scripts.length ? <span className="count-tip">{verify.scripts.length}</span> : null} + </span> + } key="scripts" id="mk-exin-script"> <CustomScript - dict={this.props.dict} btn={this.props.card} usefulfields={verify.columns} scripts={verify.scripts} @@ -721,16 +852,9 @@ scriptsChange={this.scriptsChange} wrappedComponentRef={(inst) => this.scriptsForm = inst} /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.scripts} - columns={scriptsColumns} - pagination={false} - /> + <EditTable actions={['move']} data={verify.scripts} columns={scriptsColumns} onChange={(scripts) => {this.setState({verify: {...verify, scripts}})}}/> </TabPane> : null} - <TabPane tab="淇℃伅鎻愮ず" key="7"> + <TabPane tab="淇℃伅鎻愮ず" key="tip"> <Form {...formItemLayout}> <Row gutter={24}> <Col offset={6} span={6}> -- Gitblit v1.8.0