From 3193df5faaacb0fe903ce993b16319276528524f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 06 七月 2020 23:14:17 +0800 Subject: [PATCH] 2020-07-06 --- src/templates/sharecomponent/actioncomponent/index.jsx | 72 +++++++++++++++++++++++++++++++++-- 1 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx index 69892b4..a628cd5 100644 --- a/src/templates/sharecomponent/actioncomponent/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/index.jsx @@ -5,6 +5,7 @@ import moment from 'moment' import Api from '@/api' +import options from '@/store/options.js' import Utils from '@/utils/utils.js' import DevUtils from '@/utils/devutils.js' import zhCN from '@/locales/zh-CN/model.js' @@ -86,20 +87,81 @@ } /** - * @description 鎼滅储鏉′欢缂栬緫锛岃幏鍙栨悳绱㈡潯浠惰〃鍗曚俊鎭� + * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭� */ handleAction = (card) => { + const { menu } = this.props let ableField = this.props.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> - this.setState({ - visible: true, - card: card, - formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type) + let menulist = menu.fstMenuList.map(item => { + return { + value: item.MenuID, + label: item.text, + isLeaf: false + } }) + + if (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({ + visible: true, + card: card, + formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist) + }) + }) + } else { + this.setState({ + visible: true, + card: card, + formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist) + }) + } } /** -- Gitblit v1.8.0