From e0aff8f4c0e9c8f16d1ba07863cf600638067514 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 13 四月 2021 15:08:47 +0800
Subject: [PATCH] 2021-04-13

---
 src/pc/components/login/wrapsetting/settingform/index.jsx |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/src/pc/components/login/wrapsetting/settingform/index.jsx b/src/pc/components/login/wrapsetting/settingform/index.jsx
index 8b3269c..ca13442 100644
--- a/src/pc/components/login/wrapsetting/settingform/index.jsx
+++ b/src/pc/components/login/wrapsetting/settingform/index.jsx
@@ -1,6 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Checkbox, notification } from 'antd'
+import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Checkbox, notification, Radio } from 'antd'
 
 import StyleInput from '@/menu/stylecontroller/styleInput'
 import './index.scss'
@@ -14,7 +14,9 @@
 
   state = {
     roleList: [],
-    msgTemps: []
+    msgTemps: [],
+    appMenus: [],
+    link: this.props.wrap.link || 'menu'
   }
 
   UNSAFE_componentWillMount () {
@@ -41,7 +43,18 @@
       msgTemps = []
     }
 
-    this.setState({roleList, msgTemps})
+    let appMenus = sessionStorage.getItem('appMenus')
+    if (appMenus) {
+      try {
+        appMenus = JSON.parse(appMenus)
+      } catch {
+        appMenus = []
+      }
+    } else {
+      appMenus = []
+    }
+
+    this.setState({roleList, msgTemps, appMenus})
   }
 
   handleConfirm = () => {
@@ -76,7 +89,7 @@
   render() {
     const { wrap } = this.props
     const { getFieldDecorator } = this.props.form
-    const { roleList, msgTemps } = this.state
+    const { roleList, msgTemps, appMenus, link } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -161,6 +174,40 @@
                 })(<StyleInput options={['px', 'vh', 'vw', '%']}/>)}
               </Form.Item>
             </Col>
+            <Col span={12}>
+              <Form.Item label="閾炬帴">
+                {getFieldDecorator('link', {
+                  initialValue: wrap.link || 'menu'
+                })(
+                  <Radio.Group onChange={(e) => this.setState({link: e.target.value})}>
+                    <Radio key="menu" value="menu"> 鑿滃崟 </Radio>
+                    <Radio key="linkmenu" value="linkmenu"> 鍏宠仈鑿滃崟 </Radio>
+                  </Radio.Group>
+                )}
+              </Form.Item>
+            </Col>
+            {link === 'linkmenu' ? <Col span={12}>
+              <Form.Item label="鍏宠仈鑿滃崟">
+                {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}
             {/* $楠岃瘉鐮�$  $mob$  $send_type$ */}
             <Col span={12}>
               <Form.Item label={

--
Gitblit v1.8.0