From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 四月 2021 23:25:29 +0800 Subject: [PATCH] 2021-04-07 --- src/menu/components/share/actioncomponent/index.jsx | 60 +++++++++++++++++++++--------------------------------------- 1 files changed, 21 insertions(+), 39 deletions(-) diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index 36e5f09..c6964ec 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -1,11 +1,9 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Modal, notification, Button } from 'antd' -import Utils from '@/utils/utils.js' -import DevUtils from '@/utils/devutils.js' +import Utils, { FuncUtils } from '@/utils/utils.js' import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' import { getActionForm } from './formconfig' @@ -13,7 +11,7 @@ import MKEmitter from '@/utils/events.js' import ActionForm from './actionform' -import MenuUtils from '@/menu/utils/menuUtils.js' +import MenuUtils from '@/utils/utils-custom.js' import CreateFunc from '@/templates/zshare/createfunc' import DragElement from './dragaction' import './index.scss' @@ -33,7 +31,7 @@ } state = { - dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, // 缂栬緫涓厓绱� formlist: null, // 琛ㄥ崟淇℃伅 actionlist: null, // 鎸夐挳缁� @@ -143,7 +141,7 @@ * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭� */ handleAction = (card) => { - const { menu, config } = this.props + const { config } = this.props let usefulFields = sessionStorage.getItem('permFuncField') if (usefulFields) { @@ -172,7 +170,7 @@ menulist = [] } - let modules = MenuUtils.getSubModules(menu.components, config.uuid) + let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid) this.setState({ visible: true, @@ -334,7 +332,7 @@ * @description 鍒涘缓鎸夐挳瀛樺偍杩囩▼ */ creatFunc = () => { - const { menu } = this.props + const menu = window.GLOB.customMenu let _config = fromJS(this.props.config).toJS() this.actionFormRef.handleConfirm().then(res => { @@ -353,37 +351,28 @@ } if (btn.OpenType === 'pop') { - let fields = [] - if (btn.groups.length > 0) { - btn.groups.forEach(group => { - fields = [...fields, ...group.sublist] - }) - } else { - fields = btn.fields - } - let _param = { funcName: btn.innerFunc, name: _config.setting.tableName || '', - fields: fields, + fields: btn.fields, menuNo: menu.MenuNo } - newLText = Utils.formatOptions(DevUtils.getfunc(_param, btn, menu, _config)) - DelText = Utils.formatOptions(DevUtils.dropfunc(btn.innerFunc)) + newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config)) + DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) } else if (btn.OpenType === 'excelIn') { let _param = { funcName: btn.innerFunc, menuNo: menu.MenuNo } - newLText = Utils.formatOptions(DevUtils.getexcelInfunc(_param, btn, menu)) - DelText = Utils.formatOptions(DevUtils.dropfunc(btn.innerFunc)) + newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu)) + DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) } else if (btn.OpenType === 'excelOut') { let _param = { innerFunc: btn.innerFunc } - newLText = Utils.formatOptions(DevUtils.getTableFunc(_param, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql - DelText = Utils.formatOptions(DevUtils.dropfunc(btn.innerFunc)) + newLText = Utils.formatOptions(FuncUtils.getTableFunc(_param, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql + DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) } else { let _param = { funcName: btn.innerFunc, @@ -391,8 +380,8 @@ fields: '', menuNo: menu.MenuNo } - newLText = Utils.formatOptions(DevUtils.getfunc(_param, btn, menu, _config)) - DelText = Utils.formatOptions(DevUtils.dropfunc(btn.innerFunc)) + newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config)) + DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) } this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText) @@ -405,8 +394,12 @@ btnDoubleClick = (element) => { if (sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') !== 'false') return - if (element.OpenType === 'pop' || element.OpenType === 'popview') { + if (element.OpenType === 'pop' || element.OpenType === 'popview' || element.execMode === 'pop') { this.props.setSubConfig(element) + } else if (element.OpenType === 'innerpage' && element.pageTemplate === 'page') { + MKEmitter.emit('changeEditMenu', {MenuID: element.uuid, copyMenuId: element.copyMenuId}) + } else if (element.OpenType === 'innerpage' && element.pageTemplate === 'linkpage') { + MKEmitter.emit('changeEditMenu', {MenuID: element.linkmenu}) } else { notification.warning({ top: 92, @@ -491,7 +484,6 @@ visible={profVisible} width={'75vw'} maskClosable={false} - style={{minWidth: '900px', maxWidth: '1200px'}} okText={dict['model.submit']} onOk={this.verifySubmit} onCancel={() => { this.setState({ profVisible: false }) }} @@ -536,14 +528,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(ActionComponent) \ No newline at end of file +export default ActionComponent \ No newline at end of file -- Gitblit v1.8.0