From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 09 十二月 2022 15:53:32 +0800 Subject: [PATCH] 2022-12-09 --- src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx | 141 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 122 insertions(+), 19 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx index 5f7e68e..324f63b 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx @@ -1,6 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Input, Select, Radio } from 'antd' +import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Input, Select, Radio, Tooltip } from 'antd' +import { QuestionCircleOutlined } from '@ant-design/icons' import moment from 'moment' import Api from '@/api' @@ -17,7 +18,6 @@ floor: PropTypes.any, // 鏄惁涓哄瓙琛� btnTab: PropTypes.any, // 琛ㄥ崟鏍囩椤碉紙鎸夐挳锛夊弬鏁� config: PropTypes.any, // 琛ㄥ崟鏍囩椤靛弬鏁� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, columns: PropTypes.array } @@ -213,6 +213,20 @@ changePrintMode = (e) => { let value = e.target.value + if (value === 'RFID') { + this.setState({linkType: 'USB', port: 255}, () => { + this.props.form.setFieldsValue({ + linkType: 'USB' + }) + }) + } else if (this.state.printMode === 'RFID') { + this.setState({linkType: 'system'}, () => { + this.props.form.setFieldsValue({ + linkType: 'system' + }) + }) + } + this.setState({ printMode: value }) @@ -228,13 +242,21 @@ this.props.form.setFieldsValue({ linkUrl: '127.0.0.1:13529' }) + } else if (value === 'USB') { + this.props.form.setFieldsValue({ + port: '255' + }) + } else if (value === 'network') { + this.props.form.setFieldsValue({ + port: '9100' + }) } }) } render() { + const { card } = this.props const { getFieldDecorator } = this.props.form - const { verify, linkType, printMode, printFunc } = this.state const formItemLayout = { labelCol: { @@ -248,25 +270,27 @@ } return ( - <div id="verify-card-box-tab"> + <div> + {card.label ? <div className="mk-com-name">{card.label} - 楠岃瘉淇℃伅</div> : null} <Tabs defaultActiveKey="1" className="verify-card-print-box" onChange={this.tabchange}> <TabPane tab="鎵撳嵃楠岃瘉" key="1"> <Form {...formItemLayout}> <Row gutter={24}> <Col span={8}> - <Form.Item label={'鎵撳嵃妯″紡'}> + <Form.Item label="鎵撳嵃妯″紡"> {getFieldDecorator('printMode', { initialValue: printMode || 'normal' })( <Radio.Group onChange={this.changePrintMode}> <Radio value="normal">鏍囧噯</Radio> <Radio value="custom">鑷畾涔�</Radio> + <Radio value="RFID">RFID</Radio> </Radio.Group> )} </Form.Item> </Col> - <Col span={8}> - <Form.Item label={'閾炬帴绫诲瀷'}> + {printMode !== 'RFID' ? <Col span={8}> + <Form.Item label="閾炬帴绫诲瀷"> {getFieldDecorator('linkType', { initialValue: linkType || 'system' })( @@ -276,20 +300,45 @@ </Radio.Group> )} </Form.Item> - </Col> + </Col> : <Col span={8}> - <Form.Item label={'閾炬帴鍦板潃'}> + <Form.Item label="閾炬帴绫诲瀷"> + {getFieldDecorator('linkType', { + initialValue: linkType || 'USB' + })( + <Radio.Group onChange={this.changeLinkType}> + <Radio value="USB">USB</Radio> + <Radio value="network">缃戠粶绔彛</Radio> + </Radio.Group> + )} + </Form.Item> + </Col>} + {printMode !== 'RFID' ? <Col span={8}> + <Form.Item label="閾炬帴鍦板潃"> {getFieldDecorator('linkUrl', { initialValue: verify.linkUrl || '127.0.0.1:13529', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '閾炬帴鍦板潃!' + message: '璇疯緭鍏ラ摼鎺ュ湴鍧�!' } ] })(<Input placeholder="" autoComplete="off" disabled={linkType === 'system'} />)} </Form.Item> - </Col> + </Col> : + <Col span={8}> + <Form.Item label={'绔彛'}> + {getFieldDecorator('port', { + initialValue: verify.port || '255', + rules: [ + { + required: true, + message: '璇疯緭鍏ョ鍙�!' + } + ] + })(<Input placeholder="" autoComplete="off" />)} + </Form.Item> + </Col>} {printMode === 'custom' ? <Col span={24}> <Form.Item label={'澶勭悊鍑芥暟'} className="printFunc"> {getFieldDecorator('printFunc', { @@ -297,7 +346,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '澶勭悊鍑芥暟!' + message: '璇疯緭鍏ュ鐞嗗嚱鏁�!' } ] })( @@ -305,14 +354,67 @@ )} </Form.Item> </Col> : null} + {printMode === 'RFID' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鐢ㄤ簬鍗曚綅鎹㈢畻銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鍒嗚鲸鐜� + </Tooltip> + }> + {getFieldDecorator('DPI', { + initialValue: verify.DPI || '300' + })( + <Radio.Group> + <Radio value="203">203</Radio> + <Radio value="300">300</Radio> + <Radio value="600">600</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> : null} + {printMode === 'RFID' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="闇�瑕佸瓨璐嚦鑺墖涓殑鍊硷紝璇峰~鍐欏搴旂殑瀛楁鍚嶏紝娉ㄦ剰澶у皬鍐欍��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鎵撳嵃鍊� + </Tooltip> + }> + {getFieldDecorator('valueField', { + initialValue: verify.valueField || '', + rules: [ + { + required: true, + message: '璇疯緭鍏ュ瓧娈靛悕!' + } + ] + })(<Input placeholder="" autoComplete="off" disabled={linkType === 'system'} />)} + </Form.Item> + </Col> : null} {printMode === 'normal' ? <Col span={8}> - <Form.Item label={'鎵撳嵃妯℃澘'}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鎵撳嵃鍒楄〃涓虹┖鏃讹紝鏄惁鎻愮ず鐢ㄦ埛銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 绌哄�兼彁绀� + </Tooltip> + }> + {getFieldDecorator('emptyTip', { + initialValue: verify.emptyTip || 'true' + })( + <Radio.Group> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> : null} + {printMode !== 'custom' ? <Col span={8}> + <Form.Item label="鎵撳嵃妯℃澘"> {getFieldDecorator('Template', { initialValue: verify.Template || '', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎵撳嵃妯℃澘!' + message: '璇烽�夋嫨鎵撳嵃妯℃澘!' } ] })( @@ -330,8 +432,8 @@ </Select> )} </Form.Item> - </Col> : null } - {printMode === 'normal' ? <Col span={8} offset={8}> + </Col> : null} + {printMode !== 'custom' ? <Col span={8} offset={printMode === 'RFID' ? 16 : 0}> <img className="legend" src={this.state.selectimg} alt=""/> </Col> : null } </Row> @@ -342,14 +444,14 @@ 鎵撳嵃绫诲瀷 {verify.printerTypeList.length ? <span className="count-tip">{verify.printerTypeList.length}</span> : null} </span> - } key="2"> + } disabled={printMode === 'RFID'} key="2"> <Form {...formItemLayout}> <Row gutter={24}> <Col span={24} className="print-tip"> <Form.Item label={'鎻愮ず'}> 濡傛灉姝ゆ寜閽秹鍙婂绉嶆暟鎹被鍨嬬殑鎵撳嵃锛岄渶瑕佽缃笉鍚岀殑鎵撳嵃鏈烘椂锛岃娣诲姞鎵撳嵃绫诲瀷鎺у埗淇℃伅锛岀敤鎴峰湪鑷畾涔夎缃腑锛屽彲鏍规嵁鎵撳嵃绫诲瀷璁剧疆瀵瑰簲鐨勬墦鍗版満銆� - 鎵撳嵃鏃讹紝鏁版嵁鐨勬墦鍗扮被鍨嬪彇鍐充簬杩斿洖鍊硷紙鍐呴儴鎴栧閮ㄦ帴鍙o級涓殑 printType 瀛楁銆� - 娉細杩斿洖鍊间腑鐨� printCount銆乼emplateID 瀛楁锛屽彲鍒嗗埆鎺у埗鎵撳嵃鏁伴噺鍜屾墦鍗版ā鏉裤�� + 鎵撳嵃鏃讹紝鎵撳嵃绫诲瀷鍙栧喅浜庢暟鎹腑鐨� printType 瀛楁銆� + 娉細鏁版嵁涓殑 printCount銆乼emplateID 瀛楁锛屽彲鍒嗗埆鎺у埗鎵撳嵃鏁伴噺鍜屾墦鍗版ā鏉裤�� </Form.Item> </Col> <Col span={24}> @@ -359,6 +461,7 @@ </Form> </TabPane> <TabPane tab="淇℃伅鎻愮ず" key="7"> + <div style={{textAlign: 'center', fontSize: '13px', marginBottom: '10px'}}>鎵撳嵃淇℃伅涓鏋滃瓨鍦ㄧ綉缁滆祫婧愶紙鍥剧墖锛夛紝璇风‘淇濊祫婧愬彲浠ユ甯歌闂紝璧勬簮涓嶅瓨鍦ㄦ椂浼氭姤鏁版嵁寮傚父銆�</div> <Form {...formItemLayout}> <Row gutter={24}> <Col offset={6} span={6}> -- Gitblit v1.8.0