| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) |
| | | |
| | | class PasteController extends Component { |
| | |
| | | } |
| | | |
| | | resetconfig = (item, appType, commonId) => { |
| | | if (item.type === 'tabs') { |
| | | if (item.type === 'navbar') { |
| | | item.uuid = MenuUtils.getuuid() |
| | | item.menus.forEach(menu => { |
| | | menu.MenuID = MenuUtils.getuuid() |
| | | }) |
| | | } else if (item.type === 'tabs') { |
| | | item.uuid = md5(commonId + item.uuid) |
| | | item.setting.name = (item.setting.name || '') + MenuUtils.getSignName() |
| | | item.name = item.setting.name |
| | |
| | | options = ['tabs', 'timeline', 'datacard', 'doublecard', 'propcard', 'cardatacard', 'carpropcard', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'editor', 'pie', 'scatter', 'iframe', 'sandbox'] |
| | | |
| | | if (appType === 'mob') { |
| | | options.push('menubar', 'singleSearch') |
| | | options.push('menubar', 'singleSearch', 'mobnavbar') |
| | | if (sessionStorage.getItem('editMenuType') !== 'popview') { |
| | | options.push('topbar') |
| | | } |
| | |
| | | }) |
| | | return |
| | | } |
| | | } else if (res.type === 'navbar') { |
| | | if (menu.components.findIndex(m => m.type === 'navbar') > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单栏不可重复添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | } else if (res.type === 'search') { |
| | | if (tab) { |
| | |
| | | |
| | | this.resetlink(res, commonId) |
| | | |
| | | this.props.insert(res) |
| | | |
| | | this.setState({visible: false}) |
| | | |
| | | let skip = true |
| | | if (appType === 'mob' && res.type === 'navbar') { |
| | | let appMenus = sessionStorage.getItem('appViewList') |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | appMenus = appMenus.filter(item => item.keys_type === 'navbar') |
| | | } catch (e) { |
| | | appMenus = [] |
| | | } |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | |
| | | if (appMenus.length) { |
| | | const that = this |
| | | skip = false |
| | | |
| | | confirm({ |
| | | title: '如需使用当前应用中已有的菜单栏,请点击右侧关联菜单栏,如需添加请点确定。', |
| | | onOk() { |
| | | that.props.insert(res) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (skip) { |
| | | this.props.insert(res) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |