From 084b60b15d59b5fa1a9abfd7c1fa454784608662 Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 29 Jun 2020 16:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=B7=BB=E5=8A=A0=20?= =?UTF-8?q?=E4=BA=8B=E6=83=85=E5=AE=8C=E6=88=90=E8=BF=9B=E5=BA=A6=20steps?= =?UTF-8?q?=20checkbox=20=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/globel.css | 6 + src/components/goods/edit.vue | 210 +++++++++++++++++++++++++++++++++ src/components/goods/goods.vue | 114 +++++++++++++++++- src/main.js | 13 ++ src/router/router.js | 6 +- 5 files changed, 347 insertions(+), 2 deletions(-) create mode 100644 src/components/goods/edit.vue diff --git a/src/assets/css/globel.css b/src/assets/css/globel.css index f49681b..5ebaad7 100644 --- a/src/assets/css/globel.css +++ b/src/assets/css/globel.css @@ -19,4 +19,10 @@ html,body,#app{ } .el-pagination { margin-top: 15px; +} +.el-steps{ + margin-top: 10px; +} +.el-step__title{ + font-size: 13px; } \ No newline at end of file diff --git a/src/components/goods/edit.vue b/src/components/goods/edit.vue new file mode 100644 index 0000000..4329ea1 --- /dev/null +++ b/src/components/goods/edit.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/src/components/goods/goods.vue b/src/components/goods/goods.vue index 0f2fe1e..a9ba965 100644 --- a/src/components/goods/goods.vue +++ b/src/components/goods/goods.vue @@ -1,12 +1,124 @@ diff --git a/src/main.js b/src/main.js index 2980fa1..c23fb8b 100644 --- a/src/main.js +++ b/src/main.js @@ -10,10 +10,23 @@ import axios from 'axios' Vue.component('table-tree', tableTree) axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/' +// 为每个请求头挂一个 token axios.interceptors.request.use(config => { config.headers.Authorization = sessionStorage.getItem('token') return config }) + +Vue.filter('dataFormat', (time) => { + const dt = (new Date(time)) + const y = dt.getFullYear() + const m = (dt.getMonth() + 1 + '').padStart(2, '0') + const d = (dt.getDate() + '').padStart(2, '0') + const H = dt.getHours().toString().padStart(2, '0') + const i = dt.getMinutes().toString().padStart(2, '0') + const s = dt.getSeconds().toString().padStart(2, '0') + return `${y}-${m}-${d} ${H}:${i}:${s}` +}) + Vue.prototype.$http = axios Vue.use(ElementUI) diff --git a/src/router/router.js b/src/router/router.js index 234ae82..b23cb84 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -8,6 +8,8 @@ import access from '../components/access/access' import roles from '../components/access/roles' import categories from '../components/goods/categories' import params from '../components/goods/params' +import goods from '../components/goods/goods' +import goodsEdit from '../components/goods/edit' Vue.use(VueRouter) @@ -24,7 +26,9 @@ const routes = [ { path: '/rights', component: access }, { path: '/roles', component: roles }, { path: '/categories', component: categories }, - { path: '/params', component: params } + { path: '/params', component: params }, + { path: '/goods', component: goods }, + { path: '/goods/add', component: goodsEdit } ] } ]