| | |
| | | import moment from 'moment' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import MenuUtils, { getTables } from '@/utils/utils-custom.js' |
| | | import SettingForm from './settingform' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | |
| | | }) |
| | | |
| | | let config = { |
| | | version: 1.0, |
| | | version: 2.0, |
| | | uuid: menuId, |
| | | MenuID: menuId, |
| | | Template: 'webPage', |
| | |
| | | config.tables = _config.tables || [] |
| | | config.style = _config.style || {} |
| | | config.statusBarbgColor = _config.statusBarbgColor || '' |
| | | |
| | | if (config.version !== 2.0) { |
| | | config.components = this.collectTB(config.components) |
| | | config.version = 2.0 |
| | | } |
| | | } |
| | | |
| | | param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) |
| | |
| | | }) |
| | | } |
| | | |
| | | collectTB = (components) => { |
| | | return components.map(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | delete tab.floor |
| | | delete tab.hasSearch |
| | | delete tab.parentId |
| | | |
| | | tab.components = this.collectTB(tab.components) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | item.components = this.collectTB(item.components) |
| | | } else if (!['search', 'navbar', 'login', 'topbar', 'officialAccount'].includes(item.type)) { |
| | | item.$tables = getTables(item) |
| | | } |
| | | |
| | | if (item.subtype === 'tablecard') { // 兼容 |
| | | item.type = 'card' |
| | | } |
| | | |
| | | delete item.tabId |
| | | delete item.parentId |
| | | delete item.btnlog |
| | | delete item.floor |
| | | delete item.dataName |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { config } = this.props |
| | | const { visible, loading } = this.state |