Skip to content

Commit bd607b4

Browse files
committed
refine code && document
1 parent f82ec2d commit bd607b4

File tree

26 files changed

+142
-150
lines changed

26 files changed

+142
-150
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
**注意:该项目目前使用[email protected]版本,所以最低兼容 Vue 2.3.0**
99

1010
## 前言
11-
> 这半年来一直在用vue写管理后台,目前后台已经有七十多个页面,十几种权限,但维护成本依然很低,所以准备开源分享一下后台开发的经验和成果。目前的技术栈主要的采用vue+element+axios.由于是个人项目,所以数据请求都是用了mockjs模拟。注意:在次项目基础上改造开发时请移除mock文件。
11+
> 这半年来一直在用vue写管理后台,目前后台已经有百来个个页面,十几种权限,但维护成本依然很低,所以准备开源分享一下后台开发的经验和成果。目前的技术栈主要的采用vue+element+axios由webpack2打包.由于是个人项目,所以数据请求都是用了mockjs模拟。注意:在次项目基础上改造开发时请移除mock文件。
1212
13-
后续会出一系列的教程配套文章,如如何从零构建后台项目框架,如何做完整的用户系统(如权限验证,二次登录等),如何二次开发组件(如富文本),如何整合七牛等等文章,各种后台开发经验等等。莫急~~
14-
15-
相应需求,开了一个qq群 591724180 方便大家交流
13+
写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目:
1614

1715
- [wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
1816
- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
1917
- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
2018
- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
2119
- [手摸手,带你封装一个vue component](https://segmentfault.com/a/1190000009090836)
2220

21+
相应需求,开了一个qq群 591724180 方便大家交流
22+
2323
**如有问题请先看上述文章和Wiki,若不能满足,欢迎issue和pr~**
24-
24+
2525
**该项目并不是一个脚手架,更倾向于是一个集成解决方案方案**
26-
26+
2727
**该项目不支持低版本游览器,有需求请自行添加polyfill[详情](https://github.com/PanJiaChen/vue-element-admin/wiki#babel-polyfill)**
28-
28+
2929

3030
## 功能
3131
- 登录/注销
@@ -47,6 +47,7 @@
4747
- table example
4848
- 动态table example
4949
- 拖拽table example
50+
- 内联编辑table example
5051
- form example
5152
- 多环境发布
5253
- dashboard

src/components/Charts/mixchart.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
backgroundColor: '#344b58',
5252
title: {
5353
text: '统计',
54-
subtext: 'from http://gallery.echartsjs.com',
5554
x: '4%',
5655
textStyle: {
5756
color: '#fff',

src/views/charts/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="components-container" >
33
<code>
4-
这里的所有的图表都基于echarts,实例代码来源<a href='http://gallery.echartsjs.com/explore.html#sort=rank~timeframe=all~author=all' target='_blank'>gallery</a><br/>其实echarts封装的很好了,用vue封装是很简单的事情,建议大家自己来封装。
4+
这里的所有的图表都基于ECharts,实例代码来源<a href='http://gallery.echartsjs.com/explore.html#sort=rank~timeframe=all~author=all' target='_blank'>gallery</a><br/>其实ECharts封装的很好了,用vue封装是很简单的事情,建议大家自己来封装。<a target='_blank' class='lin' href="https://segmentfault.com/a/1190000009762198#articleHeader16">相关教程</a>
55
</code>
66
</div>
77
</template>

src/views/charts/keyboard.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
<template>
22
<div class="components-container" style='height:100vh'>
33
<div class='chart-container'>
4-
<keyboardChart height='100%' width='100%' />
4+
<keyboardChart height='100%' width='100%' />
55
</div>
6-
76
</div>
87
</template>
8+
99
<script>
1010
import keyboardChart from 'components/Charts/keyboard';
11-
1211
export default {
1312
components: { keyboardChart }
1413
};
1514
</script>
1615

1716
<style scoped>
1817
.chart-container{
19-
position: relative;
20-
width: 100%;
21-
height: 90%;
18+
position: relative;
19+
width: 100%;
20+
height: 90%;
2221
}
2322
</style>
2423

src/views/charts/keyboard2.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
<template>
22
<div class="components-container" style='height:100vh'>
33
<div class='chart-container'>
4-
<keyboardChart2 id='apple' height='100%' width='100%' />
4+
<keyboardChart2 id='apple' height='100%' width='100%' />
55
</div>
6-
76
</div>
87
</template>
8+
99
<script>
1010
import keyboardChart2 from 'components/Charts/keyboard2';
11-
1211
export default {
1312
components: { keyboardChart2 }
1413
};
1514
</script>
1615

1716
<style scoped>
1817
.chart-container{
19-
position: relative;
20-
width: 100%;
21-
height: 90%;
18+
position: relative;
19+
width: 100%;
20+
height: 90%;
2221
}
2322
</style>
2423

src/views/charts/line.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
<template>
22
<div class="components-container" style='height:100vh'>
3-
https://github.com/ecomfe/echarts/blob/master/index.js
4-
http://echarts.baidu.com/tutorial.html
53
<div class='chart-container'>
6-
<lineMarker height='100%' width='100%' />
4+
<lineMarker height='100%' width='100%' />
75
</div>
8-
96
</div>
107
</template>
8+
119
<script>
1210
import lineMarker from 'components/Charts/lineMarker';
13-
1411
export default {
1512
components: { lineMarker }
1613
};
1714
</script>
1815

1916
<style scoped>
2017
.chart-container{
21-
position: relative;
22-
width: 100%;
23-
height: 80%;
18+
position: relative;
19+
width: 100%;
20+
height: 80%;
2421
}
2522
</style>
2623

src/views/charts/mixchart.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
<template>
22
<div class="components-container" style='height:100vh'>
33
<div class='chart-container'>
4-
<mixchart id='apple' height='100%' width='100%' />
4+
<mixchart id='apple' height='100%' width='100%' />
55
</div>
6-
76
</div>
87
</template>
8+
99
<script>
1010
import mixchart from 'components/Charts/mixchart';
11-
1211
export default {
1312
components: { mixchart }
1413
};
1514
</script>
1615

1716
<style scoped>
1817
.chart-container{
19-
position: relative;
20-
width: 100%;
21-
height: 90%;
22-
padding-bottom: 40px;
18+
position: relative;
19+
width: 100%;
20+
height: 90%;
21+
padding-bottom: 40px;
2322
}
2423
</style>
2524

src/views/components/countTo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<div class="components-container">
3-
<code>countTo 组件 <a href='https://github.com/PanJiaChen/vue-countTo' target='_blank'>线上地址</a></code>
3+
<code> <a href='https://github.com/PanJiaChen/vue-countTo' target='_blank'>countTo component</a></code>
44

5-
<count-to ref='example' class='example' :start-val='_startVal' :end-val='_endVal' :duration='_duration' :decimals='_decimals'
5+
<count-to ref='example' class='example' :start-val='_startVal' :end-val='_endVal' :duration='_duration' :decimals='_decimals'
66
:separator='_separator' :prefix='_prefix' :suffix='_suffix' :autoplay='false' />
77
<div style='margin-left: 25%;margin-top: 40px;'>
88
<label class="label" for="startValInput">startVal: <input type="number" v-model.number='setStartVal' name='startValInput' /></label>
@@ -20,9 +20,9 @@
2020
:separator=&#x27;{{_separator}}&#x27; :prefix=&#x27;{{_prefix}}&#x27; :suffix=&#x27;{{_suffix}}&#x27; :autoplay=false&gt;</code>
2121
</div>
2222
</template>
23+
2324
<script>
2425
import countTo from 'vue-count-to';
25-
2626
export default {
2727
components: { countTo },
2828
data() {

src/views/components/dndlist.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="components-container">
3-
<code>拖拽https://github.com/SortableJS/Vue.Draggable 项目:Vue.Draggable</code>
3+
<code>drag-list base on <a href="https://github.com/SortableJS/Vue.Draggable" target="_blank">Vue.Draggable</a></code>
44
<div class="editor-container">
55
<DndList :list1="list1" :list2="list2" list1Title="头条列表" list2Title="文章池" />
66
</div>

src/views/components/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="components-container">
3-
<code>这里暂时列出了自己在项目中自己封装和用到的组件,如有补充可以提<a href='https://github.com/PanJiaChen/vue-element-admin/issues' target='_blank'>issue</a><br/>
4-
我个人崇尚自己封装组件,因为很多组件会和业务后高度的耦合,很多时候第三方封装是满足不了需求的,如有需要可以看楼主之前写过的一篇<a href='https://segmentfault.com/a/1190000009090836' target='_blank'>文章</a>
3+
<code>这里暂时列出了自己在项目中用到的组件和一些自己封装的组件,如有补充可以提<a target='_blank' href='https://github.com/PanJiaChen/vue-element-admin/issues'> issue </a><br/>
4+
我个人崇尚自己封装组件,因为很多组件会和业务后高度的耦合,而且第三方封装的组件灵活性可控性都不高,如有需要可以看楼主之前写过的一篇<a href='https://segmentfault.com/a/1190000009090836' target='_blank'>文章</a>
55
</code>
66
</div>
77
</template>

src/views/components/jsoneditor.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<template>
22
<div class="components-container" style='height:100vh'>
3-
<code>有校验</code>
3+
<code>jsonEditor is base on <a href="https://github.com/codemirror/CodeMirror" target="_blank">CodeMirrorr</a>,lint base on json-lint </code>
44
<div class="editor-container">
55
<json-editor ref="jsonEditor" v-model="value"></json-editor>
66
</div>
77
</div>
88
</template>
9+
910
<script>
1011
import jsonEditor from 'components/jsonEditor';
1112
const jsonData = '[{"items":[{"market_type":"forexdata","symbol":"XAUUSD"},{"market_type":"forexdata","symbol":"UKOIL"},{"market_type":"forexdata","symbol":"CORN"}],"name":""},{"items":[{"market_type":"forexdata","symbol":"XAUUSD"},{"market_type":"forexdata","symbol":"XAGUSD"},{"market_type":"forexdata","symbol":"AUTD"},{"market_type":"forexdata","symbol":"AGTD"}],"name":"贵金属"},{"items":[{"market_type":"forexdata","symbol":"CORN"},{"market_type":"forexdata","symbol":"WHEAT"},{"market_type":"forexdata","symbol":"SOYBEAN"},{"market_type":"forexdata","symbol":"SUGAR"}],"name":"农产品"},{"items":[{"market_type":"forexdata","symbol":"UKOIL"},{"market_type":"forexdata","symbol":"USOIL"},{"market_type":"forexdata","symbol":"NGAS"}],"name":"能源化工"}]';
@@ -21,8 +22,8 @@
2122

2223
<style scoped>
2324
.editor-container{
24-
position: relative;
25-
height: 100%;
25+
position: relative;
26+
height: 100%;
2627
}
2728
</style>
2829

src/views/components/markdown.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<template>
22
<div class="components-container">
3-
<code>公司做的后台主要是一个cms系统,公司也是以自媒体为核心的,所以富文本是后台很核心的功能。在选择富文本的过程中也走了不少的弯路,市面上常见的富文本都基本用过了,最终选择了tinymce</code>
3+
<code>Markdown 我们这里选用了 <a href="https://github.com/sparksuite/simplemde-markdown-editor" target="_blank">simplemde-markdown-editor</a> ,简单的用vue封装了一下<a target='_blank' href='https://segmentfault.com/a/1190000009762198#articleHeader14'> 相关文章 </a></code>
44
<div class="editor-container">
5-
<MdEditor id='contentEditor' ref="contentEditor" v-model='content' :height="300" :zIndex='20'></MdEditor>
5+
<MdEditor id='contentEditor' ref="contentEditor" v-model='content' :height="300" :zIndex='20'></MdEditor>
66
</div>
77
<el-button @click='markdown2Html' style="margin-top:80px;" type="primary">转为HTML<i class="el-icon-document el-icon--right"></i></el-button>
88
<div v-html="html"></div>
99
</div>
1010
</template>
11+
1112
<script>
1213
import MdEditor from 'components/MdEditor';
13-
1414
export default {
1515
components: { MdEditor },
1616
data() {
1717
return {
18-
content: 'Simplemde',
18+
content: '## Simplemde',
1919
html: ''
2020
}
2121
},

src/views/errlog/index.vue

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
<template>
22
<div class="errPage-container">
3-
<!--error code-->
4-
<err-code/>
5-
<!--error code-->
3+
<err-code/>
4+
65
<h3>请点击右上角bug小图表</h3>
7-
<code>
6+
<code>
87
现在的管理后台基本都是spa的形式了,它增强了用户体验,但同时也会怎增加页面出问题的可能性,可能一个小小的疏忽就导致整个页面的死锁。好在Vue官网提供了一个方法来捕获处理异常
98
</code>
109
<a href="#"><img src='../../../documentImg/code1.png'></a>
11-
1210
</div>
1311
</template>
12+
1413
<script>
1514
import errCode from './errcode';
16-
// import code1Img from
1715
export default {
1816
components: { errCode },
19-
data() {
20-
return {
21-
22-
}
23-
},
2417
methods: {
2518
back() {
2619
this.$router.go(-1)
2720
}
2821
}
2922
};
3023
</script>
24+
3125
<style scoped>
3226
.errPage-container{
3327
padding: 30px;

0 commit comments

Comments
 (0)