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/login/wrapsetting/settingform/index.jsx |  103 +++++++++++++++++++++++++++++++++------------------
 1 files changed, 67 insertions(+), 36 deletions(-)

diff --git a/src/pc/components/login/wrapsetting/settingform/index.jsx b/src/pc/components/login/wrapsetting/settingform/index.jsx
index 8b3269c..a5eeeda 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'
@@ -13,35 +13,36 @@
   }
 
   state = {
-    roleList: [],
-    msgTemps: []
+    msgTemps: [],
+    appMenus: [],
+    link: this.props.wrap.link || 'menu'
   }
 
   UNSAFE_componentWillMount () {
-    let roleList = sessionStorage.getItem('sysRoles')
     let msgTemps = sessionStorage.getItem('msgTemplate')
-
-    if (roleList) {
-      try {
-        roleList = JSON.parse(roleList)
-      } catch {
-        roleList = []
-      }
-    } else {
-      roleList = []
-    }
 
     if (msgTemps) {
       try {
         msgTemps = JSON.parse(msgTemps)
-      } catch {
+      } catch (e) {
         msgTemps = []
       }
     } else {
       msgTemps = []
     }
 
-    this.setState({roleList, msgTemps})
+    let appMenus = sessionStorage.getItem('appMenus')
+    if (appMenus) {
+      try {
+        appMenus = JSON.parse(appMenus)
+      } catch (e) {
+        appMenus = []
+      }
+    } else {
+      appMenus = []
+    }
+
+    this.setState({msgTemps, appMenus})
   }
 
   handleConfirm = () => {
@@ -76,7 +77,7 @@
   render() {
     const { wrap } = this.props
     const { getFieldDecorator } = this.props.form
-    const { roleList, msgTemps } = this.state
+    const { msgTemps, appMenus, link } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -124,8 +125,9 @@
                 })(
                   <Checkbox.Group
                     options={[
-                      { label: '璐﹀彿瀵嗙爜', value: 'uname_pwd' },
-                      { label: '鐭俊楠岃瘉鐮�', value: 'sms_vcode' },
+                      { label: '璐﹀彿', value: 'uname_pwd' },
+                      { label: '鐭俊', value: 'sms_vcode' },
+                      { label: '鎵爜', value: 'app_scan' },
                     ]}
                   />
                 )}
@@ -151,6 +153,18 @@
             </Col>
             <Col span={12}>
               <Form.Item label={
+                <Tooltip placement="topLeft" title="鐧诲綍妗嗙殑鏈�澶у搴﹀�笺��">
+                  <Icon type="question-circle" />
+                  鏈�澶у搴�
+                </Tooltip>
+              }>
+                {getFieldDecorator('maxWidth', {
+                  initialValue: wrap.maxWidth || ''
+                })(<InputNumber min={100} max={2000} precision={0} onPressEnter={this.handleSubmit} />)}
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item label={
                 <Tooltip placement="topLeft" title="缁勪欢鍗犵敤鐨勬渶灏忛珮搴︼紝鐢ㄤ簬椤甸潰甯冨眬銆�">
                   <Icon type="question-circle" />
                   楂樺害
@@ -161,6 +175,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={
@@ -179,23 +227,6 @@
                   >
                     {msgTemps.map(option =>
                       <Select.Option key={option.ID} value={option.ID}>{option.SignName + ' - ' + option.TemplateCode}</Select.Option>
-                    )}
-                  </Select>
-                )}
-              </Form.Item>
-            </Col>
-            <Col span={12}>
-              <Form.Item label="榛戝悕鍗�">
-                {getFieldDecorator('blacklist', {
-                  initialValue: wrap.blacklist || []
-                })(
-                  <Select
-                    showSearch
-                    mode="multiple"
-                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
-                  >
-                    {roleList.map(option =>
-                      <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option>
                     )}
                   </Select>
                 )}

--
Gitblit v1.8.0