From 250b3fcb661058cb481b6061f1cb4c61ba9ddfe0 Mon Sep 17 00:00:00 2001 From: zhh Date: Mon, 14 May 2018 16:06:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Breadcrumb/index.vue | 2 +- src/icons/svg/home.svg | 1 + src/icons/svg/product-add.svg | 1 + src/icons/svg/product-attr.svg | 1 + src/icons/svg/product-brand.svg | 1 + src/icons/svg/product-cate.svg | 1 + src/icons/svg/product-comment.svg | 1 + src/icons/svg/product-list.svg | 1 + src/icons/svg/product-recycle.svg | 1 + src/icons/svg/product.svg | 1 + src/router/index.js | 86 +++++++++++++++++------------ src/views/login/index.vue | 2 +- src/views/pms/addProduct/index.vue | 13 +++++ src/views/pms/brand/index.vue | 13 +++++ src/views/pms/product/index.vue | 13 +++++ 15 files changed, 100 insertions(+), 38 deletions(-) create mode 100644 src/icons/svg/home.svg create mode 100644 src/icons/svg/product-add.svg create mode 100644 src/icons/svg/product-attr.svg create mode 100644 src/icons/svg/product-brand.svg create mode 100644 src/icons/svg/product-cate.svg create mode 100644 src/icons/svg/product-comment.svg create mode 100644 src/icons/svg/product-list.svg create mode 100644 src/icons/svg/product-recycle.svg create mode 100644 src/icons/svg/product.svg create mode 100644 src/views/pms/addProduct/index.vue create mode 100644 src/views/pms/brand/index.vue create mode 100644 src/views/pms/product/index.vue diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index b5d9471..4145c90 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -29,7 +29,7 @@ export default { let matched = this.$route.matched.filter(item => item.name) const first = matched[0] if (first && first.name !== 'dashboard') { - matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched) + matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched) } this.levelList = matched } diff --git a/src/icons/svg/home.svg b/src/icons/svg/home.svg new file mode 100644 index 0000000..2c7ccd7 --- /dev/null +++ b/src/icons/svg/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/product-add.svg b/src/icons/svg/product-add.svg new file mode 100644 index 0000000..4229a60 --- /dev/null +++ b/src/icons/svg/product-add.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/product-attr.svg b/src/icons/svg/product-attr.svg new file mode 100644 index 0000000..3cfe7c4 --- /dev/null +++ b/src/icons/svg/product-attr.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/product-brand.svg b/src/icons/svg/product-brand.svg new file mode 100644 index 0000000..230b6f3 --- /dev/null +++ b/src/icons/svg/product-brand.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/product-cate.svg b/src/icons/svg/product-cate.svg new file mode 100644 index 0000000..734f2ad --- /dev/null +++ b/src/icons/svg/product-cate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/product-comment.svg b/src/icons/svg/product-comment.svg new file mode 100644 index 0000000..ede0a70 --- /dev/null +++ b/src/icons/svg/product-comment.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/product-list.svg b/src/icons/svg/product-list.svg new file mode 100644 index 0000000..312763a --- /dev/null +++ b/src/icons/svg/product-list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/product-recycle.svg b/src/icons/svg/product-recycle.svg new file mode 100644 index 0000000..05dfaff --- /dev/null +++ b/src/icons/svg/product-recycle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/product.svg b/src/icons/svg/product.svg new file mode 100644 index 0000000..a91c572 --- /dev/null +++ b/src/icons/svg/product.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 4a7c06a..715b3bd 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -19,62 +19,76 @@ import Layout from '../views/layout/Layout' } **/ export const constantRouterMap = [ - { path: '/login', component: () => import('@/views/login/index'), hidden: true }, - { path: '/404', component: () => import('@/views/404'), hidden: true }, - + {path: '/login', component: () => import('@/views/login/index'), hidden: true}, + {path: '/404', component: () => import('@/views/404'), hidden: true}, { - path: '/', + path: '', component: Layout, redirect: '/dashboard', - name: 'Dashboard', - hidden: true, children: [{ path: 'dashboard', - component: () => import('@/views/dashboard/index') + name: 'dashboard', + component: () => import('@/views/dashboard/index'), + meta: {title: '首页', icon: 'home'} }] }, - { - path: '/example', + path: '/pms', component: Layout, - redirect: '/example/table', - name: 'Example', - meta: { title: 'Example', icon: 'example' }, - children: [ - { - path: 'table', - name: 'Table', - component: () => import('@/views/table/index'), - meta: { title: 'Table', icon: 'table' } + redirect: '/pms/product', + name: 'pms', + meta: {title: '商品', icon: 'product'}, + children: [{ + path: 'product', + name: 'product', + component: () => import('@/views/pms/product/index'), + meta: {title: '商品列表', icon: 'product-list'} }, { - path: 'tree', - name: 'Tree', - component: () => import('@/views/tree/index'), - meta: { title: 'Tree', icon: 'tree' } - } - ] - }, - - { - path: '/form', - component: Layout, - children: [ + path: 'addProduct', + name: 'addProduct', + component: () => import('@/views/pms/addProduct/index'), + meta: {title: '添加商品', icon: 'product-add'} + }, { - path: 'index', - name: 'Form', - component: () => import('@/views/form/index'), - meta: { title: 'Form', icon: 'form' } + path: 'productRecycle', + name: 'productRecycle', + component: () => import('@/views/pms/product/index'), + meta: {title: '商品回收站', icon: 'product-recycle'} + }, + { + path: 'productComment', + name: 'productComment', + component: () => import('@/views/pms/product/index'), + meta: {title: '商品评价', icon: 'product-comment'} + }, + { + path: 'productCate', + name: 'productCate', + component: () => import('@/views/pms/product/index'), + meta: {title: '商品分类', icon: 'product-cate'} + }, + { + path: 'productAttr', + name: 'productAttr', + component: () => import('@/views/pms/product/index'), + meta: {title: '商品类型', icon: 'product-attr'} + }, + { + path: 'brand', + name: 'brand', + component: () => import('@/views/pms/brand/index'), + meta: {title: '品牌管理', icon: 'product-brand'} } ] }, - { path: '*', redirect: '/404', hidden: true } + {path: '*', redirect: '/404', hidden: true} ] export default new Router({ // mode: 'history', //后端支持可开 - scrollBehavior: () => ({ y: 0 }), + scrollBehavior: () => ({y: 0}), routes: constantRouterMap }) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 2b26223..d751b7b 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,7 +1,7 @@