From f5062c2c10b26a50e9cc38bf37d02b3ce4603206 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 十二月 2022 19:00:16 +0800 Subject: [PATCH] 2022-12-07 --- src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx | 130 +++++++++++++++++++++++++++++++++++------- 1 files changed, 107 insertions(+), 23 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx index 1c8b257..324f63b 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx @@ -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 }) @@ -227,6 +241,14 @@ if (value === 'system') { 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' }) } }) @@ -262,11 +284,12 @@ <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}> + {printMode !== 'RFID' ? <Col span={8}> <Form.Item label="閾炬帴绫诲瀷"> {getFieldDecorator('linkType', { initialValue: linkType || 'system' @@ -277,9 +300,21 @@ </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: [ @@ -290,7 +325,20 @@ ] })(<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', { @@ -306,7 +354,60 @@ )} </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={ + <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 || '', @@ -331,25 +432,8 @@ </Select> )} </Form.Item> - </Col> : null } - {printMode === 'normal' ? <Col span={8}> - <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 === 'normal' ? <Col span={8}> + {printMode !== 'custom' ? <Col span={8} offset={printMode === 'RFID' ? 16 : 0}> <img className="legend" src={this.state.selectimg} alt=""/> </Col> : null } </Row> @@ -360,7 +444,7 @@ 鎵撳嵃绫诲瀷 {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"> -- Gitblit v1.8.0