From a57505fd1d9fe3e5ad10d470ca2fc4e364e7b312 Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 8 May 2018 14:46:40 +0800 Subject: [PATCH 1/2] refactor: Adjust the example directory structure --- src/icons/svg/edit.svg | 1 + src/icons/svg/list.svg | 1 + src/lang/en.js | 5 +- src/lang/zh.js | 5 +- src/router/index.js | 67 +++++---- .../components/ArticleDetail.vue | 0 src/views/{form => example}/create.vue | 0 src/views/{form => example}/edit.vue | 0 .../{table/inlineEditTable.vue => list.vue} | 0 src/views/example/table/index.vue | 18 --- .../{example => }/tab/components/tabPane.vue | 0 src/views/{example => }/tab/index.vue | 2 + .../{example => }/table/complexTable.vue | 0 src/views/{example => }/table/dragTable.vue | 0 .../table/dynamicTable/fixedThead.vue | 0 .../table/dynamicTable/index.vue | 0 .../table/dynamicTable/unfixedThead.vue | 0 src/views/table/inlineEditTable.vue | 129 ++++++++++++++++++ .../table/treeTable/customEval.js | 0 .../table/treeTable/customTreeTable.vue | 0 .../table/treeTable/treeTable.vue | 0 21 files changed, 172 insertions(+), 56 deletions(-) create mode 100644 src/icons/svg/edit.svg create mode 100644 src/icons/svg/list.svg rename src/views/{form => example}/components/ArticleDetail.vue (100%) rename src/views/{form => example}/create.vue (100%) rename src/views/{form => example}/edit.vue (100%) rename src/views/example/{table/inlineEditTable.vue => list.vue} (100%) delete mode 100644 src/views/example/table/index.vue rename src/views/{example => }/tab/components/tabPane.vue (100%) rename src/views/{example => }/tab/index.vue (85%) rename src/views/{example => }/table/complexTable.vue (100%) rename src/views/{example => }/table/dragTable.vue (100%) rename src/views/{example => }/table/dynamicTable/fixedThead.vue (100%) rename src/views/{example => }/table/dynamicTable/index.vue (100%) rename src/views/{example => }/table/dynamicTable/unfixedThead.vue (100%) create mode 100644 src/views/table/inlineEditTable.vue rename src/views/{example => }/table/treeTable/customEval.js (100%) rename src/views/{example => }/table/treeTable/customTreeTable.vue (100%) rename src/views/{example => }/table/treeTable/treeTable.vue (100%) diff --git a/src/icons/svg/edit.svg b/src/icons/svg/edit.svg new file mode 100644 index 00000000..5c77d97a --- /dev/null +++ b/src/icons/svg/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/list.svg b/src/icons/svg/list.svg new file mode 100644 index 00000000..c45f4591 --- /dev/null +++ b/src/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/lang/en.js b/src/lang/en.js index fc0405c9..899f4fc6 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -34,8 +34,9 @@ export default { customTreeTable: 'Custom TreeTable', tab: 'Tab', form: 'Form', - createForm: 'Create Form', - editForm: 'Edit Form', + createArticle: 'Create Article', + editArticle: 'Edit Article', + articleList: 'Article List', errorPages: 'Error Pages', page401: '401', page404: '404', diff --git a/src/lang/zh.js b/src/lang/zh.js index 41c959c3..13f0ddee 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -34,8 +34,9 @@ export default { customTreeTable: '自定义树表', tab: 'Tab', form: '表单', - createForm: '创建表单', - editForm: '编辑表单', + createArticle: '创建文章', + editArticle: '编辑文章', + articleList: '文章列表', errorPages: '错误页面', page401: '401', page404: '404', diff --git a/src/router/index.js b/src/router/index.js index 70e51d36..a04c0fb1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -133,6 +133,36 @@ export const asyncRouterMap = [ ] }, + { + path: '/tab', + component: Layout, + children: [{ + path: 'index', + component: _import('tab/index'), + name: 'tab', + meta: { title: 'tab', icon: 'tab' } + }] + }, + + { + path: '/table', + component: Layout, + redirect: '/table/complex-table', + name: 'table', + meta: { + title: 'Table', + icon: 'table' + }, + children: [ + { path: 'dynamic-table', component: _import('table/dynamicTable/index'), name: 'dynamicTable', meta: { title: 'dynamicTable' }}, + { path: 'drag-table', component: _import('table/dragTable'), name: 'dragTable', meta: { title: 'dragTable' }}, + { path: 'inline-edit-table', component: _import('table/inlineEditTable'), name: 'inlineEditTable', meta: { title: 'inlineEditTable' }}, + { path: 'tree-table', component: _import('table/treeTable/treeTable'), name: 'treeTableDemo', meta: { title: 'treeTable' }}, + { path: 'custom-tree-table', component: _import('table/treeTable/customTreeTable'), name: 'customTreeTableDemo', meta: { title: 'customTreeTable' }}, + { path: 'complex-table', component: _import('table/complexTable'), name: 'complexTable', meta: { title: 'complexTable' }} + ] + }, + { path: '/example', component: Layout, @@ -143,40 +173,9 @@ export const asyncRouterMap = [ icon: 'example' }, children: [ - { - path: '/example/table', - component: _import('example/table/index'), - redirect: '/example/table/complex-table', - name: 'Table', - meta: { - title: 'Table', - icon: 'table' - }, - children: [ - { path: 'dynamic-table', component: _import('example/table/dynamicTable/index'), name: 'dynamicTable', meta: { title: 'dynamicTable' }}, - { path: 'drag-table', component: _import('example/table/dragTable'), name: 'dragTable', meta: { title: 'dragTable' }}, - { path: 'inline-edit-table', component: _import('example/table/inlineEditTable'), name: 'inlineEditTable', meta: { title: 'inlineEditTable' }}, - { path: 'tree-table', component: _import('example/table/treeTable/treeTable'), name: 'treeTableDemo', meta: { title: 'treeTable' }}, - { path: 'custom-tree-table', component: _import('example/table/treeTable/customTreeTable'), name: 'customTreeTableDemo', meta: { title: 'customTreeTable' }}, - { path: 'complex-table', component: _import('example/table/complexTable'), name: 'complexTable', meta: { title: 'complexTable' }} - ] - }, - { path: 'tab/index', icon: 'tab', component: _import('example/tab/index'), name: 'tab', meta: { title: 'tab' }} - ] - }, - - { - path: '/form', - component: Layout, - redirect: 'noredirect', - name: 'form', - meta: { - title: 'form', - icon: 'form' - }, - children: [ - { path: 'create-form', component: _import('form/create'), name: 'createForm', meta: { title: 'createForm', icon: 'table' }}, - { path: 'edit-form', component: _import('form/edit'), name: 'editForm', meta: { title: 'editForm', icon: 'table' }} + { path: 'create', component: _import('example/create'), name: 'createArticle', meta: { title: 'createArticle', icon: 'edit' }}, + { path: 'edit/:id(\\d+)', component: _import('example/edit'), name: 'editArticle', meta: { title: 'editArticle' }, hidden: true }, + { path: 'list', component: _import('example/list'), name: 'articleList', meta: { title: 'articleList', icon: 'list' }} ] }, diff --git a/src/views/form/components/ArticleDetail.vue b/src/views/example/components/ArticleDetail.vue similarity index 100% rename from src/views/form/components/ArticleDetail.vue rename to src/views/example/components/ArticleDetail.vue diff --git a/src/views/form/create.vue b/src/views/example/create.vue similarity index 100% rename from src/views/form/create.vue rename to src/views/example/create.vue diff --git a/src/views/form/edit.vue b/src/views/example/edit.vue similarity index 100% rename from src/views/form/edit.vue rename to src/views/example/edit.vue diff --git a/src/views/example/table/inlineEditTable.vue b/src/views/example/list.vue similarity index 100% rename from src/views/example/table/inlineEditTable.vue rename to src/views/example/list.vue diff --git a/src/views/example/table/index.vue b/src/views/example/table/index.vue deleted file mode 100644 index de92c020..00000000 --- a/src/views/example/table/index.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/src/views/example/tab/components/tabPane.vue b/src/views/tab/components/tabPane.vue similarity index 100% rename from src/views/example/tab/components/tabPane.vue rename to src/views/tab/components/tabPane.vue diff --git a/src/views/example/tab/index.vue b/src/views/tab/index.vue similarity index 85% rename from src/views/example/tab/index.vue rename to src/views/tab/index.vue index 2a3239a3..7f4b9bfa 100644 --- a/src/views/example/tab/index.vue +++ b/src/views/tab/index.vue @@ -1,6 +1,8 @@