Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄瑜
VueElementTemplate
Commits
4bed888e
Commit
4bed888e
authored
May 16, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine
parent
0da4e5e5
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
25 deletions
+22
-25
README.md
README.md
+5
-2
package.json
package.json
+1
-3
index.js
src/router/index.js
+4
-4
user.js
src/store/modules/user.js
+2
-2
mixin.scss
src/styles/mixin.scss
+7
-4
fetch.js
src/utils/fetch.js
+1
-3
index.js
src/utils/index.js
+0
-5
table.vue
src/views/example/table.vue
+2
-2
No files found.
README.md
View file @
4bed888e
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
[
English Document
](
https://github.com/PanJiaChen/vue-element-admin/blob/master/README-en.md
)
[
English Document
](
https://github.com/PanJiaChen/vue-element-admin/blob/master/README-en.md
)
[
wiki
](
https://github.com/PanJiaChen/vue-element-admin/wiki
)
## 前言
## 前言
> 这半年来一直在用vue写管理后台,目前后台已经有七十多个页面,十几种权限,但维护成本依然很低,所以准备开源分享一下后台开发的经验和成果。目前的技术栈主要的采用vue+element+axios.由于是个人项目,所以数据请求都是用了mockjs代替。注意:在次项目基础上改造开发时请移除mock文件,不然所有请求都将会被代理掉!注意!
> 这半年来一直在用vue写管理后台,目前后台已经有七十多个页面,十几种权限,但维护成本依然很低,所以准备开源分享一下后台开发的经验和成果。目前的技术栈主要的采用vue+element+axios.由于是个人项目,所以数据请求都是用了mockjs代替。注意:在次项目基础上改造开发时请移除mock文件,不然所有请求都将会被代理掉!注意!
...
@@ -10,9 +12,10 @@
...
@@ -10,9 +12,10 @@
相应需求,开了一个qq群 591724180 方便大家交流
相应需求,开了一个qq群 591724180 方便大家交流
-
[
wiki
](
https://github.com/PanJiaChen/vue-element-admin/wiki
)
-
[
手摸手,带你用 vue 撸后台 系列一
](
https://juejin.im/post/59097cd7a22b9d0065fb61d2
)
-
[
手摸手,带你用 vue 撸后台 系列一
](
https://juejin.im/post/59097cd7a22b9d0065fb61d2
)
-
[
手摸手,带你封装一个vue component
](
https://segmentfault.com/a/1190000009090836
)
-
[
手摸手,带你封装一个vue component
](
https://segmentfault.com/a/1190000009090836
)
-
[
wiki
](
https://github.com/PanJiaChen/vue-element-admin/wiki
)
**如有问题请先看上述问题和Wiki,不能满足,欢迎issue和pr~**
**如有问题请先看上述问题和Wiki,不能满足,欢迎issue和pr~**
...
...
package.json
View file @
4bed888e
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
"
mockjs
"
:
"
1.0.1-beta3
"
,
"
mockjs
"
:
"
1.0.1-beta3
"
,
"
normalize.css
"
:
"
3.0.2
"
,
"
normalize.css
"
:
"
3.0.2
"
,
"
nprogress
"
:
"
0.2.0
"
,
"
nprogress
"
:
"
0.2.0
"
,
"
showdown
"
:
"
1.6.4
"
,
"
simplemde
"
:
"
1.11.2
"
,
"
simplemde
"
:
"
1.11.2
"
,
"
sortablejs
"
:
"
1.5.1
"
,
"
sortablejs
"
:
"
1.5.1
"
,
"
vue
"
:
"
2.2.6
"
,
"
vue
"
:
"
2.2.6
"
,
...
@@ -38,7 +37,6 @@
...
@@ -38,7 +37,6 @@
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
autoprefixer
"
:
"
6.7.2
"
,
"
autoprefixer
"
:
"
6.7.2
"
,
"
axios-mock-adapter
"
:
"
1.8.1
"
,
"
babel-core
"
:
"
6.22.1
"
,
"
babel-core
"
:
"
6.22.1
"
,
"
babel-eslint
"
:
"
7.1.1
"
,
"
babel-eslint
"
:
"
7.1.1
"
,
"
babel-loader
"
:
"
6.2.10
"
,
"
babel-loader
"
:
"
6.2.10
"
,
...
@@ -79,7 +77,7 @@
...
@@ -79,7 +77,7 @@
"
vue-loader
"
:
"
12.0.4
"
,
"
vue-loader
"
:
"
12.0.4
"
,
"
vue-style-loader
"
:
"
2.0.5
"
,
"
vue-style-loader
"
:
"
2.0.5
"
,
"
vue-template-compiler
"
:
"
2.2.6
"
,
"
vue-template-compiler
"
:
"
2.2.6
"
,
"
webpack
"
:
"
2.
2.3
"
,
"
webpack
"
:
"
2.
5.1
"
,
"
webpack-bundle-analyzer
"
:
"
2.2.1
"
,
"
webpack-bundle-analyzer
"
:
"
2.2.1
"
,
"
webpack-dashboard
"
:
"
0.2.1
"
,
"
webpack-dashboard
"
:
"
0.2.1
"
,
"
webpack-dev-middleware
"
:
"
1.10.0
"
,
"
webpack-dev-middleware
"
:
"
1.10.0
"
,
...
...
src/router/index.js
View file @
4bed888e
...
@@ -64,11 +64,11 @@ const Permission = resolve => require(['../views/permission/index'], resolve);
...
@@ -64,11 +64,11 @@ const Permission = resolve => require(['../views/permission/index'], resolve);
Vue
.
use
(
Router
);
Vue
.
use
(
Router
);
/**
/**
* icon :the icon show in the sidebar
* icon :
the icon show in the sidebar
* hidden
: if hiddenL
true will not show in the sidebar
* hidden
: if hidden:
true will not show in the sidebar
* redirect :if redirect:noredirect will not redirct in the levelbar
* redirect :
if redirect:noredirect will not redirct in the levelbar
* noDropdown : if noDropdown:true will not has submenu
* noDropdown : if noDropdown:true will not has submenu
* meta: { role: ['admin'] } will control the page role
* meta
: { role: ['admin'] } will control the page role
*/
*/
export
default
new
Router
({
export
default
new
Router
({
// mode: 'history', //后端支持可开
// mode: 'history', //后端支持可开
...
...
src/store/modules/user.js
View file @
4bed888e
src/styles/mixin.scss
View file @
4bed888e
...
@@ -37,19 +37,22 @@
...
@@ -37,19 +37,22 @@
$transparent-border-style
:
$width
solid
transparent
;
$transparent-border-style
:
$width
solid
transparent
;
height
:
0
;
height
:
0
;
width
:
0
;
width
:
0
;
@if
$direction
==
up
{
@if
$direction
==
up
{
border-bottom
:
$color-border-style
;
border-bottom
:
$color-border-style
;
border-left
:
$transparent-border-style
;
border-left
:
$transparent-border-style
;
border-right
:
$transparent-border-style
;
border-right
:
$transparent-border-style
;
}
@else
if
$direction
==
right
{
}
@else
if
$direction
==
right
{
border-left
:
$color-border-style
;
border-left
:
$color-border-style
;
border-top
:
$transparent-border-style
;
border-top
:
$transparent-border-style
;
border-bottom
:
$transparent-border-style
;
border-bottom
:
$transparent-border-style
;
}
@else
if
$direction
==
down
{
}
@else
if
$direction
==
down
{
border-top
:
$color-border-style
;
border-top
:
$color-border-style
;
border-left
:
$transparent-border-style
;
border-left
:
$transparent-border-style
;
border-right
:
$transparent-border-style
;
border-right
:
$transparent-border-style
;
}
@else
if
$direction
==
left
{
}
@else
if
$direction
==
left
{
border-right
:
$color-border-style
;
border-right
:
$color-border-style
;
border-top
:
$transparent-border-style
;
border-top
:
$transparent-border-style
;
border-bottom
:
$transparent-border-style
;
border-bottom
:
$transparent-border-style
;
...
...
src/utils/fetch.js
View file @
4bed888e
...
@@ -12,7 +12,6 @@ const service = axios.create({
...
@@ -12,7 +12,6 @@ const service = axios.create({
// request拦截器
// request拦截器
service
.
interceptors
.
request
.
use
(
config
=>
{
service
.
interceptors
.
request
.
use
(
config
=>
{
// Do something before request is sent
// Do something before request is sent
console
.
log
(
store
.
getters
.
token
)
if
(
store
.
getters
.
token
)
{
if
(
store
.
getters
.
token
)
{
config
.
headers
[
'X-Token'
]
=
store
.
getters
.
token
;
// 让每个请求携带token--['X-Token']为自定义key 请根据实际情况自行修改
config
.
headers
[
'X-Token'
]
=
store
.
getters
.
token
;
// 让每个请求携带token--['X-Token']为自定义key 请根据实际情况自行修改
}
}
...
@@ -28,9 +27,8 @@ service.interceptors.response.use(
...
@@ -28,9 +27,8 @@ service.interceptors.response.use(
response
=>
response
response
=>
response
/**
/**
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
* 如通过
htmlrequest 状态码标示
逻辑可写在下面error中
* 如通过
xmlhttprequest 状态码标识
逻辑可写在下面error中
*/
*/
// const code = response.data.code;
// const code = response.data.code;
// // 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token
// // 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token
// if (code === 50008 || code === 50014 || code === 50012) {
// if (code === 50008 || code === 50014 || code === 50012) {
...
...
src/utils/index.js
View file @
4bed888e
/**
/**
* Created by jiachenpan on 16/11/18.
* Created by jiachenpan on 16/11/18.
*/
*/
import
showdown
from
'showdown'
// markdown转化
const
converter
=
new
showdown
.
Converter
();
export
function
parseTime
(
time
,
cFormat
)
{
export
function
parseTime
(
time
,
cFormat
)
{
if
(
arguments
.
length
===
0
)
{
if
(
arguments
.
length
===
0
)
{
...
@@ -214,6 +212,3 @@
...
@@ -214,6 +212,3 @@
}
}
}
}
export
function
showdownMD
(
md
)
{
return
converter
.
makeHtml
(
md
)
}
src/views/example/table.vue
View file @
4bed888e
...
@@ -321,8 +321,8 @@
...
@@ -321,8 +321,8 @@
}
,
}
,
handleFetchPv
(
pv
)
{
handleFetchPv
(
pv
)
{
fetchPv
(
pv
).
then
(
response
=>
{
fetchPv
(
pv
).
then
(
response
=>
{
this
.
pvData
=
response
.
pvData
this
.
pvData
=
response
.
data
.
pvData
;
this
.
dialogPvVisible
=
true
this
.
dialogPvVisible
=
true
;
}
)
}
)
}
,
}
,
handleDownload
()
{
handleDownload
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment