From 3d4bc79a80eb9cff0f8ef7c53f9685c9ff9fbd2d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 02 九月 2021 23:17:36 +0800 Subject: [PATCH] 2021-09-02 --- src/pc/components/navbar/normal-navbar/menusetting/menuform/index.jsx | 53 +++++++++++++++++++++++++++++------------------------ 1 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/pc/components/navbar/normal-navbar/menusetting/menuform/index.jsx b/src/pc/components/navbar/normal-navbar/menusetting/menuform/index.jsx index 19e747f..9e71f6e 100644 --- a/src/pc/components/navbar/normal-navbar/menusetting/menuform/index.jsx +++ b/src/pc/components/navbar/normal-navbar/menusetting/menuform/index.jsx @@ -14,7 +14,6 @@ state = { property: this.props.menu.property || 'menu', - linkIntId: this.props.menu.linkIntId || '', appMenus: [], } @@ -23,7 +22,7 @@ if (appMenus) { try { appMenus = JSON.parse(appMenus) - } catch { + } catch (e) { appMenus = [] } } else { @@ -47,9 +46,6 @@ return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { - if (values.linkmenuid) { - values.linkIntId = this.state.linkIntId || '' - } resolve(values) } else { reject(err) @@ -70,10 +66,6 @@ let val = e.target.value this.setState({property: val}) - } - - changeLinkMenu = (val, { props }) => { - this.setState({linkIntId: props.intid}) } render() { @@ -109,14 +101,27 @@ </Form.Item> </Col> <Col span={22}> + <Form.Item label="鑿滃崟鍙傛暟"> + {getFieldDecorator('MenuNo', { + initialValue: menu.MenuNo || '', + rules: [ + { + required: true, + message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' + } + ] + })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> + <Col span={22}> <Form.Item label="鑿滃崟灞炴��"> {getFieldDecorator('property', { initialValue: menu.property || 'menu' })( <Radio.Group onChange={this.changeProperty}> <Radio value="menu">鑿滃崟</Radio> - <Radio value="link">閾炬帴</Radio> <Radio value="linkmenu">鍏宠仈鑿滃崟</Radio> + <Radio value="link">閾炬帴</Radio> {menu.level === 1 || menu.level === 2 ? <Radio value="classify">鍒嗙被</Radio> : null} </Radio.Group> )} @@ -134,17 +139,6 @@ )} </Form.Item> </Col> - {property === 'link' ? <Col span={22}> - <Form.Item label="閾炬帴鍦板潃"> - {getFieldDecorator('link', { - initialValue: menu.link || '', - rules: [{ - required: true, - message: '璇疯緭鍏ラ摼鎺ュ湴鍧�!' - }] - })(<TextArea rows={2} />)} - </Form.Item> - </Col> : null} {property !== 'classify' ? <Col span={22}> <Form.Item label="鎵撳紑鏂瑰紡"> {getFieldDecorator('open', { @@ -155,6 +149,17 @@ <Radio value="self">褰撳墠绐楀彛</Radio> </Radio.Group> )} + </Form.Item> + </Col> : null} + {property === 'link' ? <Col span={22}> + <Form.Item label="閾炬帴鍦板潃"> + {getFieldDecorator('link', { + initialValue: menu.link || '', + rules: [{ + required: true, + message: '璇疯緭鍏ラ摼鎺ュ湴鍧�!' + }] + })(<TextArea rows={2} />)} </Form.Item> </Col> : null} {property === 'linkmenu' ? <Col span={22}> @@ -171,8 +176,8 @@ message: '璇烽�夋嫨鍏宠仈鑿滃崟!' }] })( - <Select onChange={this.changeLinkMenu}> - {appMenus.map(item => (<Select.Option key={item.MenuID} intid={item.menuid_int} value={item.MenuID}>{item.MenuName}</Select.Option>))} + <Select> + {appMenus.map(item => (<Select.Option key={item.MenuID} value={item.MenuID}>{item.MenuName}</Select.Option>))} </Select> )} </Form.Item> @@ -187,7 +192,7 @@ {getFieldDecorator('copyMenuId', { initialValue: menu.copyMenuId || '' })( - <Select> + <Select allowClear> {appMenus.map(item => (<Select.Option key={item.MenuID} value={item.MenuID}>{item.MenuName}</Select.Option>))} </Select> )} -- Gitblit v1.8.0