From f0602b981659c6d1ff18e8dba4ca1ce89c5f5610 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 22 三月 2020 21:18:34 +0800 Subject: [PATCH] 2020-03-22 --- src/templates/zshare/verifycardprint/index.jsx | 62 +++++++++++++++++-------------- 1 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/templates/zshare/verifycardprint/index.jsx b/src/templates/zshare/verifycardprint/index.jsx index 5847ad1..c5e21b4 100644 --- a/src/templates/zshare/verifycardprint/index.jsx +++ b/src/templates/zshare/verifycardprint/index.jsx @@ -15,6 +15,7 @@ import './index.scss' const { TabPane } = Tabs +let _printFunc = null class VerifyCard extends Component { static propTpyes = { @@ -43,8 +44,10 @@ }, linkType: _verify.linkType || 'system', printMode: _verify.printMode || 'normal', - printFunc: _verify.printFunc || '// Function(data, notification) // data-鎵撳嵃鏁版嵁鍒楄〃锛宯otification-淇℃伅鎻愮ず鎺т欢', + printFunc: _verify.printFunc || '// Function(socket, data, printer, notification) socket-WebSocket 瀵硅薄锛宒ata-鎵撳嵃鏁版嵁鍒楄〃锛宲rinter-鎵撳嵃鏈猴紝notification-淇℃伅鎻愮ず鎺т欢' }) + + _printFunc = _verify.printFunc || '' } componentDidMount() { @@ -162,7 +165,7 @@ return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { - let _verify = {...verify, ...values} + let _verify = {...verify, ...values, printFunc: _printFunc} resolve(_verify) } else { @@ -231,6 +234,31 @@ )} </Form.Item> </Col> + <Col span={8}> + <Form.Item label={'閾炬帴绫诲瀷'}> + {getFieldDecorator('linkType', { + initialValue: linkType || 'system' + })( + <Radio.Group onChange={this.changeLinkType}> + <Radio value="system">绯荤粺</Radio> + <Radio value="custom">鑷畾涔�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <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'] + '閾炬帴鍦板潃!' + } + ] + })(<Input placeholder="" autoComplete="off" disabled={linkType === 'system'} />)} + </Form.Item> + </Col> {printMode === 'custom' ? <Col span={24}> <Form.Item label={'澶勭悊鍑芥暟'} className="printFunc"> {getFieldDecorator('printFunc', { @@ -251,35 +279,13 @@ lineWrapping: true }} onBeforeChange={() => {}} + onBlur={(editor) => { + _printFunc = editor.getValue() + }} /> - )} + )} </Form.Item> </Col> : null} - {printMode === 'normal' ? <Col span={8}> - <Form.Item label={'閾炬帴绫诲瀷'}> - {getFieldDecorator('linkType', { - initialValue: linkType || 'system' - })( - <Radio.Group onChange={this.changeLinkType}> - <Radio value="system">绯荤粺</Radio> - <Radio value="custom">鑷畾涔�</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> : null} - {printMode === 'normal' ? <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'] + '閾炬帴鍦板潃!' - } - ] - })(<Input placeholder="" autoComplete="off" disabled={linkType === 'system'} />)} - </Form.Item> - </Col> : null } {printMode === 'normal' ? <Col span={8}> <Form.Item label={'鎵撳嵃妯℃澘'}> {getFieldDecorator('Template', { -- Gitblit v1.8.0