diff --git a/src/api/table.js b/src/api/table.js new file mode 100644 index 000000000..b475c0a4b --- /dev/null +++ b/src/api/table.js @@ -0,0 +1,11 @@ +import fetch from '@/utils/fetch'; + +export function getList(params) { + return fetch({ + url: '/table/list', + method: 'get', + params + }); +} + + diff --git a/src/router/index.js b/src/router/index.js index 4dc984985..63719e9c5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -16,7 +16,8 @@ const dashboard = _import('dashboard/index'); /* error page */ const Err404 = _import('404'); -const Page = _import('page/index'); +const Form = _import('page/form'); +const Table = _import('table/index'); Vue.use(Router); @@ -51,11 +52,20 @@ export const asyncRouterMap = [ path: '/example', component: Layout, redirect: 'noredirect', - name: 'page', - icon: 'zonghe', + name: 'Example', + icon: 'zujian', children: [ - { path: 'index', component: Page, name: 'page' } + { path: 'index', component: Form, name: 'Form', icon: 'zonghe' } ] }, + { + path: '/table', + component: Layout, + redirect: '/table/index', + name: 'Table', + icon: 'tubiaoleixingzhengchang', + noDropdown: true, + children: [{ path: 'index', component: Table, name: 'Table', meta: { role: ['admin'] } }] + }, { path: '*', redirect: '/404', hidden: true } ]; diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index cd558ee76..52cc61c71 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,7 +1,8 @@ - - {{name}} - + + name:{{name}} + role:{{role}} + + + diff --git a/src/views/page/form.vue b/src/views/page/form.vue new file mode 100644 index 000000000..95dd74612 --- /dev/null +++ b/src/views/page/form.vue @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + 立即创建 + 取消 + + + + + + diff --git a/src/views/page/index.vue b/src/views/page/index.vue deleted file mode 100644 index 56dc105c2..000000000 --- a/src/views/page/index.vue +++ /dev/null @@ -1,5 +0,0 @@ - - - a - - diff --git a/src/views/table/index.vue b/src/views/table/index.vue new file mode 100644 index 000000000..a9e3fb88b --- /dev/null +++ b/src/views/table/index.vue @@ -0,0 +1,57 @@ + + + + + + {{scope.$index}} + + + + + {{scope.row.title}} + + + + + + {{scope.row.author}} + + + + + {{scope.row.pageviews}} + + + + + + {{scope.row.display_time}} + + + + + + +