From 31ec63f0419895876cbaba99637a884a32d33d0d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 01 九月 2021 10:31:45 +0800
Subject: [PATCH] 2021-09-01

---
 src/pc/components/navbar/normal-navbar/wrapsetting/settingform/index.jsx |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 105 insertions(+), 10 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 3a72098..61d30f0 100644
--- a/src/pc/components/navbar/normal-navbar/wrapsetting/settingform/index.jsx
+++ b/src/pc/components/navbar/normal-navbar/wrapsetting/settingform/index.jsx
@@ -1,11 +1,12 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Tooltip, Icon, InputNumber } from 'antd'
+import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Radio } from 'antd'
 
 import asyncComponent from '@/utils/asyncComponent'
 import './index.scss'
 
 const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
+const { TextArea } = Input
 
 class SettingForm extends Component {
   static propTpyes = {
@@ -16,22 +17,23 @@
   }
 
   state = {
-    roleList: []
+    appMenus: [],
+    property: ''
   }
 
   UNSAFE_componentWillMount () {
-    let roleList = sessionStorage.getItem('sysRoles')
-    if (roleList) {
+    let appMenus = sessionStorage.getItem('appMenus')
+    if (appMenus) {
       try {
-        roleList = JSON.parse(roleList)
-      } catch {
-        roleList = []
+        appMenus = JSON.parse(appMenus)
+      } catch (e) {
+        appMenus = []
       }
     } else {
-      roleList = []
+      appMenus = []
     }
 
-    this.setState({roleList})
+    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, property } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -82,6 +84,19 @@
                     {
                       required: true,
                       message: this.props.dict['form.required.input'] + '瀵艰埅鏍忓悕绉�!'
+                    }
+                  ]
+                })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)}
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item label="鑿滃崟鍙傛暟">
+                {getFieldDecorator('MenuNo', {
+                  initialValue: wrap.MenuNo,
+                  rules: [
+                    {
+                      required: true,
+                      message: this.props.dict['form.required.input'] + '鑿滃崟鍙傛暟!'
                     }
                   ]
                 })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)}
@@ -127,6 +142,86 @@
                 )}
               </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('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}
+                  >
+                    {appMenus.map(option =>
+                      <Select.Option key={option.MenuID} value={option.MenuID}>{option.MenuName}</Select.Option>
+                    )}
+                  </Select>
+                )}
+              </Form.Item>
+            </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="瀛樺湪鐧诲綍涓斿彇鍒扮櫥褰曚俊鎭椂锛屾樉绀虹敤鎴峰ご鍍忋�佺敤鎴峰悕鍙婇��鍑恒��">
+                  <Icon type="question-circle" />
+                  鐢ㄦ埛淇℃伅
+                </Tooltip>
+              }>
+                {getFieldDecorator('user', {
+                  initialValue: wrap.user || 'hidden'
+                })(
+                  <Radio.Group>
+                    <Radio value="hidden">闅愯棌</Radio>
+                    <Radio value="show">鏄剧ず</Radio>
+                  </Radio.Group>
+                )}
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="榛樿闅愯棌鑿滃崟鏍忥紝榧犳爣鍦ㄩ潬杩戦《閮ㄦ椂鏄剧ず銆�">
+                  <Icon type="question-circle" />
+                  鎮诞鏄剧ず
+                </Tooltip>
+              }>
+                {getFieldDecorator('hover', {
+                  initialValue: wrap.hover || 'false'
+                })(
+                  <Radio.Group>
+                    <Radio value="true">鍚敤</Radio>
+                    <Radio value="false">涓嶅惎鐢�</Radio>
+                  </Radio.Group>
+                )}
+              </Form.Item>
+            </Col>
           </Row>
         </Form>
       </div>

--
Gitblit v1.8.0