From 6afdec0062dacbded57e166230eb22cc55ced0c1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 08 五月 2021 14:30:21 +0800 Subject: [PATCH] 2021-05-08 --- src/views/menudesign/homeform/index.jsx | 69 ++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 1 deletions(-) diff --git a/src/views/menudesign/homeform/index.jsx b/src/views/menudesign/homeform/index.jsx index 6ca64be..ba1e5d7 100644 --- a/src/views/menudesign/homeform/index.jsx +++ b/src/views/menudesign/homeform/index.jsx @@ -1,7 +1,9 @@ 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, Icon, Tooltip, InputNumber, notification } from 'antd' +import Api from '@/api' +import options from '@/store/options.js' import './index.scss' class CustomMenuForm extends Component { @@ -11,6 +13,71 @@ 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 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, + disabled: false + } + + return trdItem + }) + } + return sndItem + }) + } + return fstItem + }) + + sessionStorage.setItem('fstMenuList', JSON.stringify(menulist)) + } else { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + }) + } + // 涓�浜岀骇鑿滃崟鍒囨崲 selectChange = (key, value) => { const { config } = this.props -- Gitblit v1.8.0