UNPKG

me-admin-sdk

Version:

一个能够开箱即用的管理模板基架,基于 Vue + ElementUI 构建

214 lines (213 loc) 6.71 kB
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" /> <title>me-admin-sdk的使用</title> <link rel="stylesheet" href="../../dist/libs/element-ui/index.css" /> <link rel="stylesheet" href="../../dist/libs/nprogress/index.css" /> </head> <body> <div id="app"></div> <script src="../../dist/me-admin-sdk-full.js"></script> <script> var Layout = { template: '<v-layout/>' } MeAdminSdk.registerApi('mission', function(request) { return { getMissionList(params) { return request({ url: '/mission/mission/list', method: 'get', params: params, data: {} }) }, getMissionStatistics(params) { return request({ url: '/mission/mission/statistics', method: 'get', params: params }) } } }) MeAdminSdk.registerCodes(null, function() { return { index_path: '/', login_path: '/login', default_date_format: 'yyyy-MM-dd' } }) var vueApp = MeAdminSdk.register({ el: null, //'#app' // 系统信息 sysInfo: { authName: '管理员', sysTitle: 'XXX后台管理系统', sysLogo: '', loginPath: '/login', logoutPath: '/logout', menus: [ { menuId: 'a3361b3ceada4fc8bc1a65969fb652b9', menuName: '控制台', menuIcon: 'iconfont icon-dashboard', menuCode: 'home', children: null }, { menuId: '4ae619b2e52d4f2daa80674603a16b2a', menuName: '系统管理', menuIcon: 'iconfont icon-system', menuCode: null, children: [ { menuId: '49ca8eb42fbe484ba75957d853fc57aa', menuName: '管理员列表', menuIcon: null, menuCode: 'system_admin_list', children: null }, { menuId: '59ca8eb42fbe484ba75957d853fc57aa', menuName: '管理员创建', menuIcon: null, menuCode: 'system_admin_create', children: null } ] } ], modules: ['system_admin_list'] }, store: { state: {}, getters: { githubUrl: state => 'https://github.com/yimogit/me-admin-sdk' }, mutations: {}, actions: {} }, router: { routes: [ { path: '/', component: Layout, meta: {}, redirect: '/home', children: [ { path: 'home', name: 'home', component: { template: '<div title="Welcome Star">仓库地址:<el-button @click="$ui.pages.link($store.getters.githubUrl)">{{$store.getters.githubUrl}}</el-button><div>首页路径:{{$codes.index_path}}</div></div>' }, meta: { skipauth: false, title: '首页', //无权限跳转到welcome页 authRedirect: { name: 'welcome' } } }, { name: 'welcome', path: 'welcome', component: { template: '<div>welcome</div>' }, meta: { cache: true, title: '欢迎页', skipauth: true } } ] }, { path: '/system', component: Layout, children: [ { path: 'admin/list', name: 'system_admin_list', meta: { skipauth: true }, component: { name: 'system_admin_list', template: '<div>管理员列表11<v-form-input/></div>', data() { return { test: '' } } }, meta: { skipauth: true, cache: true, title: '管理员列表' } }, { path: 'admin/create', name: 'system_admin_create', component: { name: 'system_admin_create', template: '<div>管理员创建<v-form-input/></div>' }, meta: { skipauth: true, cache: true, title: '管理员创建', pname: 'system_admin_list' } } ] }, { name: 'login', path: '/login', meta: { skipauth: true }, component: { template: '<div>登录页</div>' } }, { name: 'logout', path: '/logout', component: { template: '<div>退出</div>' } }, { name: '404', path: '/404', component: { template: '<div>404 NotFound</div>' }, meta: { skipauth: true, nolayout: true } }, { path: '*', redirect: '/404', meta: { skipauth: true } } ] } }) // var res = Vue.compile( // '<router-view></router-view>' // ) window.__currentApp = new Vue({ el: '#app', router: vueApp.router, store: vueApp.store, template: '<router-view></router-view>' // render: res.render, // staticRenderFns: res.staticRenderFns }) </script> </body> </html>