From 58a28e1faa15f638a136fefdcfcd0b3106c1fa16 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 24 六月 2020 10:18:54 +0800 Subject: [PATCH] 2020-06-24 --- src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 45 +++++++++++++++++++++++++++++++-------------- 1 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index a9a815f..99cb33e 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -1,6 +1,6 @@ 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 { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber, Radio, Typography } from 'antd' import moment from 'moment' import Api from '@/api' @@ -13,6 +13,7 @@ const { TabPane } = Tabs const { confirm } = Modal +const { Paragraph } = Typography class VerifyCard extends Component { static propTpyes = { @@ -26,29 +27,29 @@ systemScripts: [], excelColumns: [ { - title: 'Column', + title: this.props.dict['model.form.field'], dataIndex: 'Column', width: '16%', editable: true }, { - title: 'Text', + title: this.props.dict['model.name'], dataIndex: 'Text', width: '19%', editable: true }, { - title: '绫诲瀷', + title: this.props.dict['model.form.type'], dataIndex: 'type', width: '12%', editable: true }, { - title: '鏄惁蹇呭~', + title: this.props.dict['model.required'], dataIndex: 'required', width: '12%', editable: true, - render: (text, record) => record.required === 'true' ? '鏄�' : '鍚�' + render: (text, record) => record.required === 'true' ? this.props.dict['model.true'] : this.props.dict['model.false'] }, { title: '鏈�灏忓��', @@ -75,7 +76,7 @@ <Popconfirm title={this.props.dict['header.form.query.delete']} okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['header.cancel']} + cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'columns') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -133,7 +134,7 @@ <Popconfirm title={this.props.dict['header.form.query.delete']} okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['header.cancel']} + cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'unique') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -145,13 +146,26 @@ { title: 'SQL', dataIndex: 'sql', - width: '60%' + width: '60%', + render: (text) => ( + <Paragraph copyable ellipsis={{ rows: 5, expandable: true }}>{text}</Paragraph> + ) }, { title: '鎵ц浣嶇疆', dataIndex: 'position', width: '10%', - render: (text, record) => record.position !== 'front' ? 'sql鍚�' : 'sql鍓�' + render: (text, record) => { + let _text = '' + if (record.position === 'front') { + _text = 'sql鍓�' + } else if (record.position === 'init') { + _text = '鍒濆鍖�' + } else { + _text = 'sql鍚�' + } + return _text + } }, { title: '鐘舵��', @@ -185,7 +199,7 @@ <Popconfirm title={this.props.dict['header.form.query.delete']} okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['header.cancel']} + cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -197,6 +211,7 @@ UNSAFE_componentWillMount() { let _verify = this.props.card.verify || {} + _verify = JSON.parse(JSON.stringify(_verify)) let _columns = _verify.columns || [] _columns = _columns.map(col => { @@ -241,6 +256,8 @@ _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) + + _sParam.open_key = Utils.encrypt(_sParam.secretkey, _sParam.timestamp, true) // 浜戠鏁版嵁楠岃瘉 Api.getSystemConfig(_sParam).then(res => { if (res.status) { @@ -553,7 +570,7 @@ confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['header.cancel'], + cancelText: this.props.dict['model.cancel'], onOk() { resolve(_verify) }, @@ -645,13 +662,13 @@ <Form {...formItemLayout}> <Row gutter={24}> <Col span={8}> - <Form.Item label={'Excel琛ㄥ悕'}> + <Form.Item label={this.props.dict['model.form.tablename']}> {getFieldDecorator('sheet', { initialValue: verify.sheet || '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['header.form.tablename'] + '!' + message: this.props.dict['form.required.input'] + this.props.dict['model.form.tablename'] + '!' } ] })(<Input placeholder="" autoComplete="off" />)} -- Gitblit v1.8.0