| | |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/mob.js' |
| | | import enUS from '@/locales/en-US/mob.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyCustomMenu } from '@/store/action' |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('delButtons', this.delButtons) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('delButtons', this.delButtons) |
| | | } |
| | | |
| | | delButtons = (items) => { |
| | | this.setState({delButtons: [...this.state.delButtons, ...items]}) |
| | | } |
| | | |
| | | closeView = () => { |
| | |
| | | } |
| | | |
| | | getMenuParam = () => { |
| | | const { MenuId, MenuType } = this.state |
| | | const { btn } = this.props |
| | | const { MenuId } = this.state |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | MenuID: MenuId, |
| | | Template: 'CustomPage', |
| | | enabled: false, |
| | | MenuName: btn.config.MenuName + '-' + btn.label, |
| | | MenuNo: '', |
| | | tables: [], |
| | | components: [], |
| | | viewType: 'popview', |
| | | style: { |
| | | backgroundColor: '#ffffff', backgroundImage: '', |
| | | paddingTop: '16px', paddingBottom: '80px', paddingLeft: '16px', paddingRight: '16px' |
| | | }, |
| | | MenuType: MenuType |
| | | } |
| | | } else { |
| | | config.uuid = MenuId |
| | | config.MenuID = MenuId |
| | | config.MenuType = config.MenuType || MenuType |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | submitConfig = () => { |
| | | // const { btn } = this.props |
| | | const { openEdition, delButtons } = this.state |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (config.cacheUseful === 'true' && !config.cacheTime) { |
| | | if ((config.cacheUseful === 'true' && !config.cacheTime) || !config.MenuNo || !config.MenuName) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善菜单基本信息!', |
| | |
| | | let param = { |
| | | func: 'sPC_Tab_AddUpt', |
| | | MenuID: _config.uuid, |
| | | MenuNo: _config.tabNo, |
| | | MenuNo: _config.MenuNo, |
| | | Template: 'CustomPage', |
| | | MenuName: _config.tabName, |
| | | MenuName: _config.MenuName, |
| | | Remark: '', |
| | | Sort: 0, |
| | | PageParam: JSON.stringify({Template: 'CustomPage'}), |
| | |
| | | |
| | | let btnParam = { // 添加菜单按钮 |
| | | func: 'sPC_Button_AddUpt', |
| | | Type: 40, // 添加菜单下的按钮type为40,按钮下的按钮type为60 |
| | | Type: 60, // 添加菜单下的按钮type为40,按钮下的按钮type为60 |
| | | ParentID: _config.uuid, |
| | | MenuNo: _config.MenuNo, |
| | | Template: 'CustomPage', |