From c7414c3cc93649479119d51b230c4b8e36884ca7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 23 七月 2021 18:18:55 +0800 Subject: [PATCH] 2021-07-23 --- src/pc/components/navbar/normal-navbar/wrapsetting/settingform/index.jsx | 45 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/pc/components/navbar/normal-navbar/wrapsetting/settingform/index.jsx b/src/pc/components/navbar/normal-navbar/wrapsetting/settingform/index.jsx index eef3aa1..3d066a8 100644 --- a/src/pc/components/navbar/normal-navbar/wrapsetting/settingform/index.jsx +++ b/src/pc/components/navbar/normal-navbar/wrapsetting/settingform/index.jsx @@ -6,6 +6,7 @@ import './index.scss' const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) +const { TextArea } = Input class SettingForm extends Component { static propTpyes = { @@ -16,7 +17,8 @@ } state = { - appMenus: [] + appMenus: [], + property: '' } UNSAFE_componentWillMount () { @@ -31,7 +33,7 @@ appMenus = [] } - this.setState({appMenus}) + this.setState({appMenus, property: this.props.wrap.property || ''}) } handleConfirm = () => { @@ -58,7 +60,7 @@ render() { const { wrap } = this.props const { getFieldDecorator } = this.props.form - const { appMenus } = this.state + const { appMenus, property } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -141,22 +143,51 @@ </Form.Item> </Col> <Col span={12}> + <Form.Item label="logo灞炴��"> + {getFieldDecorator('property', { + initialValue: wrap.property || '' + })( + <Radio.Group onChange={(e) => this.setState({property: e.target.value})} style={{whiteSpace: 'nowrap'}}> + <Radio value="">绌�</Radio> + <Radio value="linkmenu">鍏宠仈鑿滃崟</Radio> + <Radio value="link">閾炬帴</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + {property === 'linkmenu' ? <Col span={12}> <Form.Item label="logo閾炬帴"> - {getFieldDecorator('logolink', { - initialValue: wrap.logolink || '' + {getFieldDecorator('linkmenu', { + initialValue: wrap.linkmenu || '', + rules: [ + { + required: true, + message: this.props.dict['form.required.select'] + '鍏宠仈鑿滃崟!' + } + ] })( <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} > - <Select.Option key="empty" intid={''} value={''}>鏃�</Select.Option> {appMenus.map(option => <Select.Option key={option.MenuID} value={option.MenuID}>{option.MenuName}</Select.Option> )} </Select> )} </Form.Item> - </Col> + </Col> : null} + {property === 'link' ? <Col span={24}> + <Form.Item label="logo閾炬帴" className="textarea"> + {getFieldDecorator('link', { + initialValue: wrap.link || '', + rules: [{ + required: true, + message: '璇疯緭鍏ラ摼鎺ュ湴鍧�!' + }] + })(<TextArea rows={2} />)} + </Form.Item> + </Col> : null} <Col span={12}> <Form.Item label={ <Tooltip placement="topLeft" title="瀛樺湪鐧诲綍涓斿彇鍒扮櫥褰曚俊鎭椂锛屾樉绀虹敤鎴峰ご鍍忋�佺敤鎴峰悕鍙婇��鍑恒��"> -- Gitblit v1.8.0