| | |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { ConfigProvider, notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, RedoOutlined } from '@ant-design/icons' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, RedoOutlined, ArrowLeftOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import backurl from '@/assets/img/back.jpg' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | let param = { |
| | | MenuID: menu.MenuID, |
| | | copyMenuId: menu.copyMenuId || '', |
| | | clearMenu: menu.clearMenu !== 'false', |
| | | type: 'view' |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | let homeId = MenuID || '' |
| | | let homeId = '' |
| | | let appViewList = [] |
| | | if (!homeId && res.data && res.data.length > 0) { |
| | | if (res.data && res.data.length > 0) { |
| | | appViewList = res.data |
| | | appViewList.forEach(item => { |
| | | if (item.keys_type === 'index') { |
| | |
| | | } |
| | | |
| | | if (!homeId) { |
| | | homeId = Utils.getuuid() |
| | | homeId = MenuID || Utils.getuuid() |
| | | |
| | | let param = { |
| | | func: 's_kei_link_keyids_addupt', |
| | |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: homeId, type: 'view'})))) |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: MenuID || homeId, type: 'view'})))) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | } |
| | | } else { |
| | | config.components = MenuUtils.resetConfig(config.components) |
| | | config.components = MenuUtils.resetConfig(config.components, {}, urlParam.clearMenu) |
| | | config.enabled = false |
| | | message.success('复制成功,保存后生效。') |
| | | } |
| | |
| | | |
| | | getMenuMessage = () => { |
| | | const { config } = this.state |
| | | let nodes = {type: 'view', key: config.uuid, title: config.MenuName, children: []} |
| | | let nodes = {type: 'view', version: '1.0', key: config.uuid, title: config.MenuName, children: []} |
| | | let popviews = [] |
| | | |
| | | let traversal = (components) => { |
| | | let list = components.map(item => { |
| | | let list = [] |
| | | components.forEach(item => { |
| | | let m = { |
| | | key: item.uuid, |
| | | title: item.name, |
| | |
| | | return null |
| | | } else if (item.type === 'tabs') { |
| | | let tabs = [] |
| | | let mm = [] |
| | | item.subtabs.forEach(tab => { |
| | | let s = traversal(tab.components) |
| | | |
| | |
| | | title: tab.label, |
| | | children: s |
| | | }) |
| | | |
| | | mm.push(...s) |
| | | }) |
| | | |
| | | if (tabs.length > 0) { |
| | | m.children = tabs |
| | | } |
| | | |
| | | if (item.setting.permission === 'true') { |
| | | list.push(m) |
| | | } else if (mm.length) { |
| | | list.push(...mm) |
| | | } |
| | | |
| | | return null |
| | | } else if (item.type === 'group') { |
| | | m.children = traversal(item.components) |
| | | |
| | | if (item.setting.permission === 'true') { |
| | | list.push(m) |
| | | } else if (m.children.length) { |
| | | list.push(...m.children) |
| | | } |
| | | |
| | | return null |
| | | } if (item.plot && item.plot.permission !== 'true') { |
| | | return null |
| | | } if (item.wrap && item.wrap.permission !== 'true') { |
| | | return null |
| | | } else if (item.type === 'card' || (item.type === 'table' && item.subtype === 'tablecard')) { |
| | | item.action && item.action.forEach(btn => { |
| | | this.checkBtn(btn) |
| | |
| | | }) |
| | | } |
| | | |
| | | return m |
| | | list.push(m) |
| | | }) |
| | | |
| | | list = list.filter(Boolean) |
| | | |
| | | return list |
| | | } |
| | |
| | | |
| | | if (config.components.findIndex(item => item.type === 'login') > -1) { |
| | | nodes.login = true |
| | | nodes.children = [] |
| | | } |
| | | if (config.permission !== 'true') { |
| | | nodes.pass = true |
| | | nodes.children = [] |
| | | } |
| | | |
| | | return nodes |
| | |
| | | |
| | | let roles = { |
| | | type: 'navbar', |
| | | version: '1.0', |
| | | key: item.uuid, |
| | | title: item.name, |
| | | children: [] |
| | | } |
| | | |
| | | roles.children = item.menus.map(fst => { |
| | | if (fst.property === 'classify' && fst.sublist.length > 0) { |
| | | return { |
| | | key: fst.MenuID, |
| | | title: fst.name, |
| | | children: fst.sublist.map(scd => { |
| | | if (scd.property === 'classify' && scd.sublist.length > 0) { |
| | | return { |
| | | key: scd.MenuID, |
| | | title: scd.name, |
| | | children: scd.sublist.map(thd => { |
| | | return { key: thd.MenuID, title: thd.name } |
| | | }) |
| | | |
| | | if (item.wrap.permission === 'true') { |
| | | roles.children = item.menus.map(fst => { |
| | | if (fst.property === 'classify' && fst.sublist.length > 0) { |
| | | return { |
| | | key: fst.MenuID, |
| | | title: fst.name, |
| | | children: fst.sublist.map(scd => { |
| | | if (scd.property === 'classify' && scd.sublist.length > 0) { |
| | | return { |
| | | key: scd.MenuID, |
| | | title: scd.name, |
| | | children: scd.sublist.map(thd => { |
| | | return { key: thd.MenuID, title: thd.name } |
| | | }) |
| | | } |
| | | } else { |
| | | return { key: scd.MenuID, title: scd.name } |
| | | } |
| | | } else { |
| | | return { key: scd.MenuID, title: scd.name } |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | } else { |
| | | return { key: fst.MenuID, title: fst.name } |
| | | } |
| | | } else { |
| | | return { key: fst.MenuID, title: fst.name } |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | roles.pass = true |
| | | } |
| | | |
| | | let _param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | |
| | | return |
| | | } |
| | | |
| | | if (['voucher'].includes(item.subtype)) return |
| | | if (['propcard', 'brafteditor', 'sandbox', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return |
| | | if (['balcony'].includes(item.type) && item.wrap.datatype === 'static') return |
| | | |
| | |
| | | <div className="wrap"> |
| | | <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> |
| | | <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | <img title="后退" className="back-view" onClick={this.backView} src={backurl} alt=""/> |
| | | <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController insert={this.insert} /> |
| | | <StyleCombControlButton menu={config} /> |