| | |
| | | const { index: overIndex } = findCard(`${targetId}`) |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] }) |
| | | |
| | | if (style) { |
| | | handleList({...menu, style, components: _cards}) |
| | | if (item.component === '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) { |
| | | confirm({ |
| | | title: '如需使用当前应用中已有的菜单栏,请点击右侧关联菜单栏,如需新增请点确定。', |
| | | onOk() { |
| | | if (style) { |
| | | handleList({...menu, style, components: _cards}) |
| | | } else { |
| | | handleList({...menu, components: _cards}) |
| | | } |
| | | setCards(_cards) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | if (style) { |
| | | handleList({...menu, style, components: _cards}) |
| | | } else { |
| | | handleList({...menu, components: _cards}) |
| | | } |
| | | setCards(_cards) |
| | | } |
| | | } else { |
| | | handleList({...menu, components: _cards}) |
| | | if (style) { |
| | | handleList({...menu, style, components: _cards}) |
| | | } else { |
| | | handleList({...menu, components: _cards}) |
| | | } |
| | | setCards(_cards) |
| | | } |
| | | setCards(_cards) |
| | | } |
| | | }) |
| | | |