From cb4c8706eb48183ac8875d92d4a950ad6b6675a2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 三月 2020 11:01:11 +0800 Subject: [PATCH] 2020-03-18 --- src/templates/tableshare/verifycardprint/index.jsx | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/templates/tableshare/verifycardprint/index.jsx b/src/templates/tableshare/verifycardprint/index.jsx index 484761d..6379135 100644 --- a/src/templates/tableshare/verifycardprint/index.jsx +++ b/src/templates/tableshare/verifycardprint/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Input, Select } from 'antd' +import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Input, Select, Radio } from 'antd' import moment from 'moment' import Api from '@/api' @@ -33,7 +33,8 @@ verify: { ..._verify, Template: _verify.Template || '' - } + }, + linkType: _verify.linkType || 'system' }) } @@ -166,10 +167,24 @@ }) } + changeLinkType = (e) => { + let value = e.target.value + + this.setState({ + linkType: value + }, () => { + if (value === 'system') { + this.props.form.setFieldsValue({ + linkUrl: '127.0.0.1:13529' + }) + } + }) + } + render() { const { getFieldDecorator } = this.props.form - const { verify } = this.state + const { verify, linkType } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -183,10 +198,22 @@ return ( <div id="verify-card-box-tab"> - <Tabs defaultActiveKey="1" className="verify-card-box" onChange={this.tabchange}> + <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={'閾炬帴绫诲瀷'}> + {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', { @@ -197,7 +224,7 @@ message: this.props.dict['form.required.input'] + '閾炬帴鍦板潃!' } ] - })(<Input placeholder="" autoComplete="off" />)} + })(<Input placeholder="" autoComplete="off" disabled={linkType === 'system'} />)} </Form.Item> </Col> <Col span={8}> -- Gitblit v1.8.0