From c66c7b65432af8cdab430b7ac079a4fd75c3d60f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 10 九月 2021 19:20:58 +0800 Subject: [PATCH] 2021-09-10 --- src/views/appmanage/submutilform/index.jsx | 99 ++++++++++++++++++++++++++++--------------------- 1 files changed, 56 insertions(+), 43 deletions(-) diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx index c374caf..86c5739 100644 --- a/src/views/appmanage/submutilform/index.jsx +++ b/src/views/appmanage/submutilform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Select, Radio, Input, Tooltip, Icon, notification, InputNumber } from 'antd' +import { Form, Row, Col, Select, Radio, Input, Tooltip, Icon, notification, InputNumber, Checkbox } from 'antd' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -50,6 +50,10 @@ } }) }) + } + + onChange = (vals) => { + this.setState({user_binding: vals}) } /** @@ -118,7 +122,7 @@ <Col span={12}> <Form.Item label="鏉冮檺绠$悊"> {getFieldDecorator('role_type', { - initialValue: card ? card.role_type || 'true' : 'true' + initialValue: card ? card.role_type || 'false' : 'false' })( <Radio.Group> <Radio value="true">鍚敤</Radio> @@ -127,41 +131,6 @@ )} </Form.Item> </Col> - {typename !== 'pc' ? <Col span={12}> - <Form.Item label={ - <Tooltip placement="topLeft" title="浣跨敤寰俊鎺堟潈鐧诲綍鏃讹紝鏄惁闇�瑕佺粦瀹氱敤鎴枫��"> - <Icon type="question-circle" /> - 鐢ㄦ埛缁戝畾 - </Tooltip> - }> - {getFieldDecorator('user_binding', { - initialValue: user_binding - })( - <Select mode="multiple"> - <Select.Option value="uname_pwd">鐢ㄦ埛鍚�</Select.Option> - <Select.Option value="sms_vcode">鎵嬫満鍙�</Select.Option> - </Select> - )} - </Form.Item> - </Col> : null} - {typename !== 'pc' ? <Col span={12}> - <Form.Item label={ - <Tooltip placement="topLeft" title="鐭俊妯℃澘鍙湪绠$悊绯荤粺 HS-濂囦簯鐭俊妯℃澘 澶勬坊鍔犮��"> - <Icon type="question-circle" /> - 鐭俊妯℃澘 - </Tooltip> - }> - {getFieldDecorator('sms_id', { - initialValue: card ? card.sms_id || '' : '' - })( - <Select allowClear> - {msgs.map(option => - <Select.Option key={option.ID} value={option.ID}>{option.SignName + ' - ' + option.TemplateCode}</Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> : null} <Col span={12}> <Form.Item label="鐨偆"> {getFieldDecorator('css', { @@ -186,6 +155,45 @@ )} </Form.Item> </Col> + {typename !== 'pc' ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="浣跨敤鍏紬鍙锋巿鏉冪櫥褰曟椂锛屾槸鍚﹂渶瑕佺粦瀹氱敤鎴枫��"> + <Icon type="question-circle" /> + 鐢ㄦ埛缁戝畾 + </Tooltip> + }> + {getFieldDecorator('user_binding', { + initialValue: user_binding + })( + <Checkbox.Group onChange={this.onChange}> + <Checkbox value="uname_pwd">璐﹀彿</Checkbox> + <Checkbox value="sms_vcode">鎵嬫満鐭俊</Checkbox> + </Checkbox.Group> + )} + </Form.Item> + </Col> : null} + {typename !== 'pc' && user_binding.includes('sms_vcode') ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鐭俊妯℃澘鍙湪绠$悊绯荤粺 HS-濂囦簯鐭俊妯℃澘 澶勬坊鍔犮��"> + <Icon type="question-circle" /> + 鐭俊妯℃澘 + </Tooltip> + }> + {getFieldDecorator('sms_id', { + initialValue: card ? card.sms_id || '' : '', + rules: [{ + required: true, + message: '浣跨敤鎵嬫満鐭俊鏃惰閫夋嫨鐭俊妯℃澘!' + }] + })( + <Select allowClear> + {msgs.map(option => + <Select.Option key={option.ID} value={option.ID}>{option.SignName + ' - ' + option.TemplateCode}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> : null} <Col span={12}> <Form.Item label="鏍囬"> {getFieldDecorator('title', { @@ -202,7 +210,7 @@ )} </Form.Item> </Col> - <Col span={12}> + {typename !== 'pc' && user_binding.length > 0 ? <Col span={12}> <Form.Item label={ <Tooltip placement="topLeft" title="浣跨敤寰俊鎺堟潈鐧诲綍鏃讹紝缁戝畾鐢ㄦ埛椤甸潰鐨勭増鏉冨0鏄庯紝娉細鍙坊鍔爃tml鏍囩銆�"> <Icon type="question-circle" /> @@ -213,16 +221,21 @@ initialValue: card ? card.copyright || '' : '' })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} </Form.Item> - </Col> - <Col span={12}> - <Form.Item label="LOGO"> + </Col> : null} + {typename !== 'pc' && user_binding.length > 0 ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="浣跨敤寰俊鎺堟潈鐧诲綍鏃讹紝缁戝畾鐢ㄦ埛椤甸潰鐨凩OGO銆�"> + <Icon type="question-circle" /> + LOGO + </Tooltip> + }> {getFieldDecorator('logo', { initialValue: card ? card.logo : '' })( <SourceComponent type="picture" placement="right"/> )} </Form.Item> - </Col> + </Col> : null} {typename !== 'pc' ? <Col span={12}> <Form.Item label={ <Tooltip placement="topLeft" title="鍦ㄤ娇鐢ㄦ槑绉戜簯APP鏃讹紝椤甸潰鐨勫垏鎹㈡ā寮�"> @@ -244,7 +257,7 @@ <Form.Item label={ <Tooltip placement="topLeft" title="鍦ㄤ娇鐢ㄦ槑绉戜簯APP鏃讹紝涓斿湪app妯″紡涓棤鏁�"> <Icon type="question-circle" /> - 寤惰繜鍔犺浇 + 寤惰繜鍔犺浇(ms) </Tooltip> }> {getFieldDecorator('delay', { -- Gitblit v1.8.0