From 89fb1308d92e10a27cf8f91f4dd766eb38976e12 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 十一月 2020 21:56:42 +0800 Subject: [PATCH] 2020-11-26 --- src/menu/components/card/cardcellcomponent/index.jsx | 97 +++++++++++++----------------------------------- 1 files changed, 27 insertions(+), 70 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 3d80bc4..9d8b224 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -2,10 +2,8 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import {connect} from 'react-redux' -import { Modal, Button, notification } from 'antd' +import { Modal, Button } from 'antd' -import Api from '@/api' -import options from '@/store/options.js' import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' import asyncComponent from '@/utils/asyncComponent' @@ -246,82 +244,41 @@ handleAction = (card) => { const { menu, cards } = this.props - let ableField = menu.permFuncField ? menu.permFuncField.join(', ') : '' + let usefulFields = sessionStorage.getItem('permFuncField') + if (usefulFields) { + try { + usefulFields = JSON.parse(usefulFields) + } catch { + usefulFields = [] + } + } else { + usefulFields = [] + } + + let ableField = usefulFields.join(', ') let functip = <div> <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> <p>{this.state.dict['model.tooltip.func.outface']}</p> </div> - let menulist = [] - if (menu.fstMenuList) { - menulist = menu.fstMenuList.map(item => { - return { - value: item.MenuID, - label: item.text, - isLeaf: false - } - }) + let menulist = sessionStorage.getItem('fstMenuList') + if (menulist) { + try { + menulist = JSON.parse(menulist) + } catch { + menulist = [] + } + } else { + menulist = [] } let modules = this.getModules(menu.components, cards.uuid) - if (menu.fstMenuList && card.linkmenu && card.linkmenu.length > 0) { - let _param = { - func: 'sPC_Get_FunMenu', - ParentID: card.linkmenu[0], - systemType: options.sysType, - debug: 'Y' - } - - Api.getSystemConfig(_param).then(result => { - if (result.status) { - menulist = menulist.map(item => { - if (item.value === card.linkmenu[0]) { - item.children = result.data.map(item => { - let submenu = { - value: item.ParentID, - label: item.MenuNameP, - children: item.FunMenu.map(cell => { - return { - value: cell.MenuID, - label: cell.MenuName, - MenuID: cell.MenuID, - MenuName: cell.MenuName, - MenuNo: cell.MenuNo, - Ot: cell.Ot, - PageParam: cell.PageParam, - LinkUrl: cell.LinkUrl, - disabled: cell.MenuID === menu.MenuID - } - }) - } - - return submenu - }) - } - return item - }) - } else { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - } - - this.setState({ - actvisible: true, - card: card, - formlist: getActionForm(card, functip, cards.setting, menu.permFuncField, 'card', menulist, modules) - }) - }) - } else { - this.setState({ - actvisible: true, - card: card, - formlist: getActionForm(card, functip, cards.setting, menu.permFuncField, 'card', menulist, modules) - }) - } + this.setState({ + actvisible: true, + card: card, + formlist: getActionForm(card, functip, cards.setting, usefulFields, 'card', menulist, modules) + }) } getModules = (components, selfId) => { -- Gitblit v1.8.0