From 41c55c1f103658b997f7a828a7067bdb228f1df0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 04 十月 2022 23:35:10 +0800 Subject: [PATCH] 2022-10-04 --- src/pc/components/navbar/normal-navbar/linksetting/linkform/index.jsx | 41 +++++++++++++++++------------------------ 1 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/pc/components/navbar/normal-navbar/linksetting/linkform/index.jsx b/src/pc/components/navbar/normal-navbar/linksetting/linkform/index.jsx index a07f0a8..41ab933 100644 --- a/src/pc/components/navbar/normal-navbar/linksetting/linkform/index.jsx +++ b/src/pc/components/navbar/normal-navbar/linksetting/linkform/index.jsx @@ -1,6 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Radio, Tooltip, Icon, Select } from 'antd' +import { Form, Row, Col, Input, Radio, Tooltip, Select } from 'antd' +import { QuestionCircleOutlined } from '@ant-design/icons' import './index.scss' @@ -14,7 +15,6 @@ state = { property: this.props.menu.property || 'link', - linkIntId: this.props.menu.linkIntId || '', appMenus: [], } @@ -23,7 +23,7 @@ if (appMenus) { try { appMenus = JSON.parse(appMenus) - } catch { + } catch (e) { appMenus = [] } } else { @@ -47,9 +47,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 +67,6 @@ let val = e.target.value this.setState({property: val}) - } - - changeLinkMenu = (val, { props }) => { - this.setState({linkIntId: props.intid}) } render() { @@ -120,17 +113,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} <Col span={22}> <Form.Item label="鎵撳紑鏂瑰紡"> {getFieldDecorator('open', { @@ -143,10 +125,21 @@ )} </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 === 'linkmenu' ? <Col span={22}> <Form.Item label={ <Tooltip placement="topLeft" title="鍏宠仈褰撳墠app涓凡鏈夌殑鑿滃崟銆�"> - <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}}/> + <QuestionCircleOutlined className="mk-form-tip" /> 鍏宠仈鑿滃崟 </Tooltip> }> @@ -157,8 +150,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> -- Gitblit v1.8.0