From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 十一月 2021 20:47:04 +0800
Subject: [PATCH] 2021-11-18

---
 src/views/menudesign/homeform/index.jsx |  109 +++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 86 insertions(+), 23 deletions(-)

diff --git a/src/views/menudesign/homeform/index.jsx b/src/views/menudesign/homeform/index.jsx
index d16f9b4..db119a5 100644
--- a/src/views/menudesign/homeform/index.jsx
+++ b/src/views/menudesign/homeform/index.jsx
@@ -1,8 +1,11 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Radio, Icon, Tooltip, InputNumber } from 'antd'
+import { Form, Row, Col, Radio, Tooltip, InputNumber, notification } from 'antd'
+import { QuestionCircleOutlined } from '@ant-design/icons'
 
-import './index.scss'
+import Api from '@/api'
+import options from '@/store/options.js'
+// import './index.scss'
 
 class CustomMenuForm extends Component {
   static propTpyes = {
@@ -11,14 +14,91 @@
     updateConfig: PropTypes.func
   }
 
+  state = {
+    menulist: []
+  }
+
+  UNSAFE_componentWillMount () {
+    let _param = {func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}
+    _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
+
+    Api.getSystemConfig(_param).then(result => {
+      if (result.status) {
+        let thdMenuList = []
+        let menulist = result.fst_menu.map(fst => {
+          let fstItem = {
+            MenuID: fst.MenuID,
+            MenuName: fst.MenuName,
+            value: fst.MenuID,
+            label: fst.MenuName,
+            isLeaf: false,
+            children: []
+          }
+    
+          if (fst.snd_menu) {
+            fstItem.children = fst.snd_menu.map(snd => {
+              let sndItem = {
+                ParentId: fst.MenuID,
+                MenuID: snd.MenuID,
+                MenuName: snd.MenuName,
+                value: snd.MenuID,
+                label: snd.MenuName,
+                children: []
+              }
+    
+              if (snd.trd_menu) {
+                sndItem.children = snd.trd_menu.map(trd => {
+                  let trdItem = {
+                    FstId: fst.MenuID,
+                    ParentId: snd.MenuID,
+                    MenuID: trd.MenuID,
+                    MenuName: trd.MenuName,
+                    MenuNo: trd.MenuNo,
+                    EasyCode: trd.EasyCode,
+                    value: trd.MenuID,
+                    label: trd.MenuName,
+                    type: 'CommonTable',
+                    disabled: false
+                  }
+
+                  if (trd.PageParam) {
+                    try {
+                      trd.PageParam = JSON.parse(trd.PageParam)
+                      trdItem.type = trd.PageParam.Template || 'CommonTable'
+                    } catch (e) {
+
+                    }
+                  }
+
+                  thdMenuList.push(trdItem)
+
+                  return trdItem
+                })
+              }
+              return sndItem
+            })
+          }
+          return fstItem
+        })
+
+        sessionStorage.setItem('fstMenuList', JSON.stringify(menulist))
+        sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList))
+      } else {
+        notification.warning({
+          top: 92,
+          message: result.message,
+          duration: 5
+        })
+      }
+    })
+  }
+
   // 涓�浜岀骇鑿滃崟鍒囨崲
   selectChange = (key, value) => {
     const { config } = this.props
 
     if (key === 'cacheUseful') {
       this.props.updateConfig({...config, cacheUseful: value})
-    } else if (key === 'diffUser') {
-      this.props.updateConfig({...config, diffUser: value})
     } else if (key === 'timeUnit') {
       this.props.updateConfig({...config, timeUnit: value})
     }
@@ -46,12 +126,12 @@
     }
 
     return (
-      <Form {...formItemLayout} className="custom-menu-form">
+      <Form {...formItemLayout}>
         <Row>
           <Col span={24}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="瀵逛簬涓嶇粡甯告�у彉鍔ㄧ殑淇℃伅锛岀紦瀛樻暟鎹湁鍔╀簬鎻愰珮鏌ヨ鏁堢巼銆�">
-                <Icon type="question-circle" />
+                <QuestionCircleOutlined className="mk-form-tip" />
                 缂撳瓨鏁版嵁
               </Tooltip>
             }>
@@ -65,23 +145,6 @@
               )}
             </Form.Item>
           </Col>
-          {config.cacheUseful === 'true' ? <Col span={24}>
-            <Form.Item label={
-              <Tooltip placement="topLeft" title="瀵逛簬涓嶅悓鐢ㄦ埛锛屾煡璇俊鎭槸鍚﹀瓨鍦ㄥ樊寮傘��">
-                <Icon type="question-circle" />
-                鍖哄垎鐢ㄦ埛
-              </Tooltip>
-            }>
-              {getFieldDecorator('diffUser', {
-                initialValue: config.diffUser || 'true'
-              })(
-                <Radio.Group onChange={(e) => {this.selectChange('diffUser', e.target.value)}}>
-                  <Radio value="true">鏄�</Radio>
-                  <Radio value="false">鍚�</Radio>
-                </Radio.Group>
-              )}
-            </Form.Item>
-          </Col> : null}
           {config.cacheUseful === 'true' ? <Col span={24}>
             <Form.Item label="鍗曚綅">
               {getFieldDecorator('timeUnit', {

--
Gitblit v1.8.0