|
| 1 | +<script> |
| 2 | +// import PreView from '@/pages/preview'; |
| 3 | +// import Sidebar from './components/sidebar.vue' |
| 4 | +import '@/components/core/styles/index.scss' |
| 5 | +
|
| 6 | +const sidebarMenus = [ |
| 7 | + { |
| 8 | + label: '我的作品', |
| 9 | + value: 'workManager', |
| 10 | + antIcon: 'bars', |
| 11 | + key: '1' |
| 12 | + }, |
| 13 | + { |
| 14 | + label: '数据中心', |
| 15 | + value: 'dataCenter', |
| 16 | + antIcon: 'snippets', |
| 17 | + key: '2', |
| 18 | + children: [ |
| 19 | + { |
| 20 | + label: '基础数据', |
| 21 | + value: 'basicData', |
| 22 | + antIcon: 'snippets', |
| 23 | + key: '2-1' |
| 24 | + }, |
| 25 | + { |
| 26 | + label: '表单统计', |
| 27 | + value: 'formData', |
| 28 | + antIcon: 'snippets', |
| 29 | + key: '2-2' |
| 30 | + } |
| 31 | + ] |
| 32 | + }, |
| 33 | + { |
| 34 | + label: '模板中心', |
| 35 | + value: 'templateCenter', |
| 36 | + antIcon: 'snippets', |
| 37 | + key: '3', |
| 38 | + children: [ |
| 39 | + { |
| 40 | + label: '免费模板', |
| 41 | + value: 'freeTemplates', |
| 42 | + antIcon: 'snippets', |
| 43 | + key: '3-1' |
| 44 | + } |
| 45 | + ] |
| 46 | + }, |
| 47 | + { |
| 48 | + label: '账号中心', |
| 49 | + value: 'freeTemplate', |
| 50 | + antIcon: 'appstore', |
| 51 | + key: '4' |
| 52 | + } |
| 53 | +] |
| 54 | +
|
| 55 | +export default { |
| 56 | + components: { |
| 57 | + // PreView, |
| 58 | + // Sidebar |
| 59 | + }, |
| 60 | + render (h) { |
| 61 | + return ( |
| 62 | + <a-layout id="luban-work-manager-layout" style={{ height: '100vh' }}> |
| 63 | + <a-layout-header class="header"> |
| 64 | + <div class="logo">鲁班 H5</div> |
| 65 | + {/* TODO we can show the plugins shortcuts here */} |
| 66 | + <a-dropdown style={{ float: 'right', background: 'transparent', margin: '16px 28px 16px 0' }}> |
| 67 | + <a-menu slot="overlay" onClick={() => {}}> |
| 68 | + <a-menu-item key="1"> |
| 69 | + <span>someone@luban</span> |
| 70 | + </a-menu-item> |
| 71 | + <a-menu-divider /> |
| 72 | + <a-menu-item key="2"><a-icon type="setting" />账号设置</a-menu-item> |
| 73 | + <a-menu-item key="3"><a-icon type="logout" />退出登录</a-menu-item> |
| 74 | + </a-menu> |
| 75 | + <a-avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" /> |
| 76 | + </a-dropdown> |
| 77 | + </a-layout-header> |
| 78 | + <a-layout> |
| 79 | + <a-layout-sider width="160" style="background: #fff"> |
| 80 | + <a-menu |
| 81 | + mode="inline" |
| 82 | + // defaultSelectedKeys={['1']} |
| 83 | + defaultOpenKeys={['1', '2', '3']} |
| 84 | + style="height: 100%" |
| 85 | + > |
| 86 | + { |
| 87 | + sidebarMenus.map(menu => ( |
| 88 | + menu.children |
| 89 | + ? <a-sub-menu key={menu.key}> |
| 90 | + <span slot="title"><a-icon type={menu.antIcon} />{menu.label}</span> |
| 91 | + { |
| 92 | + (menu.children).map(submenu => (<a-menu-item key={submenu.key}>{submenu.label}</a-menu-item>)) |
| 93 | + } |
| 94 | + </a-sub-menu> |
| 95 | + : <a-menu-item key={menu.key}> |
| 96 | + <a-icon type={menu.antIcon} /> |
| 97 | + <span>{menu.label}</span> |
| 98 | + </a-menu-item> |
| 99 | + )) |
| 100 | + } |
| 101 | + </a-menu> |
| 102 | + </a-layout-sider> |
| 103 | + <a-layout style="padding: 0 24px 24px"> |
| 104 | + <a-layout-content style={{ padding: '24px', margin: 0, minHeight: '280px' }}> |
| 105 | + <router-view /> |
| 106 | + </a-layout-content> |
| 107 | + </a-layout> |
| 108 | + </a-layout> |
| 109 | + {/** <PreviewDialog visible={this.previewVisible} handleClose={() => { this.previewVisible = false }} /> */} |
| 110 | + </a-layout>) |
| 111 | + } |
| 112 | +} |
| 113 | +</script> |
0 commit comments