Skip to content

Commit 33e384e

Browse files
committed
add && refine
1 parent 1e90bc5 commit 33e384e

File tree

17 files changed

+324
-563
lines changed

17 files changed

+324
-563
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
![enter image description here](https://github.com/PanJiaChen/vue-element-admin/blob/master/gifs/uploadAvatar.gif)
2424

25+
#### 错误统计
26+
27+
![enter image description here](https://github.com/PanJiaChen/vue-element-admin/blob/master/gifs/errorlog.png)
28+
2529
#### 富文本(整合七牛 打水印等个性化功能)
2630

2731
![enter image description here](https://github.com/PanJiaChen/vue-element-admin/blob/master/gifs/editor.gif)

documentImg/code1.png

21.8 KB
Loading

gifs/errorlog.gif

486 KB
Loading

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"codemirror": "5.22.0",
1717
"dropzone": "4.3.0",
1818
"echarts": "3.4.0",
19-
"element-ui": "1.2.7",
19+
"element-ui": "1.2.9",
2020
"file-saver": "1.3.3",
2121
"jquery": "3.1.1",
2222
"js-cookie": "2.1.3",
2323
"jsonlint": "1.6.2",
24-
"mockjs": "^1.0.1-beta3",
24+
"mockjs": "1.0.1-beta3",
2525
"normalize.css": "3.0.2",
2626
"nprogress": "0.2.0",
2727
"showdown": "1.6.4",
@@ -58,7 +58,7 @@
5858
"express": "4.14.1",
5959
"extract-text-webpack-plugin": "2.0.0",
6060
"file-loader": "0.10.0",
61-
"friendly-errors-webpack-plugin": "^1.1.3",
61+
"friendly-errors-webpack-plugin": "1.1.3",
6262
"function-bind": "1.1.0",
6363
"html-webpack-plugin": "2.28.0",
6464
"http-proxy-middleware": "0.17.3",

src/assets/iconfont/iconfont.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
;(function(window) {
22

33
var svgSprite = '<svg>' +
4+
'' +
5+
'<symbol id="icon-bug" viewBox="0 0 1024 1024">' +
6+
'' +
7+
'<path d="M969.142857 548.571429q0 14.848-10.861714 25.709714t-25.709714 10.861714l-128 0q0 97.718857-38.290286 165.705143l118.857143 119.442286q10.861714 10.861714 10.861714 25.709714t-10.861714 25.709714q-10.276571 10.861714-25.709714 10.861714t-25.709714-10.861714l-113.152-112.566857q-2.852571 2.852571-8.557714 7.424t-23.990857 16.274286-37.156571 20.845714-46.848 16.566857-55.442286 7.424l0-512-73.142857 0 0 512q-29.147429 0-58.002286-7.716571t-49.700571-18.870857-37.705143-22.272-24.868571-18.578286l-8.557714-8.009143-104.557714 118.272q-11.446857 11.995429-27.428571 11.995429-13.714286 0-24.576-9.142857-10.861714-10.276571-11.702857-25.417143t8.850286-26.587429l115.419429-129.718857q-33.133714-65.133714-33.133714-156.562286l-128 0q-14.848 0-25.709714-10.861714t-10.861714-25.709714 10.861714-25.709714 25.709714-10.861714l128 0 0-168.009143-98.852571-98.852571q-10.861714-10.861714-10.861714-25.709714t10.861714-25.709714 25.709714-10.861714 25.709714 10.861714l98.852571 98.852571 482.304 0 98.852571-98.852571q10.861714-10.861714 25.709714-10.861714t25.709714 10.861714 10.861714 25.709714-10.861714 25.709714l-98.852571 98.852571 0 168.009143 128 0q14.848 0 25.709714 10.861714t10.861714 25.709714zM694.857143 219.428571l-365.714286 0q0-75.995429 53.430857-129.426286t129.426286-53.430857 129.426286 53.430857 53.430857 129.426286z" ></path>' +
8+
'' +
9+
'</symbol>' +
410
'' +
511
'<symbol id="icon-tubiaoleixingzhengchang" viewBox="0 0 1024 1024">' +
612
'' +
713
'<path d="M64 448 320 448 320 960 64 960 64 448 64 448ZM704 256 960 256 960 960 704 960 704 256 704 256ZM384 64 640 64 640 960 384 960 384 64 384 64Z" ></path>' +
814
'' +
915
'</symbol>' +
1016
'' +
17+
'<symbol id="icon-404" viewBox="0 0 1024 1024">' +
18+
'' +
19+
'<path d="M931.6 585.6l0 79c28.6-60.2 44.8-127.4 44.8-198.4C976.4 211 769.4 4 514.2 4S52 211 52 466.2c0 3.2 0.2 6.4 0.2 9.6l166-206 96.4 0L171.8 485.6l46.4 0 0-54.8 99.2-154.6 0 209.4 0 100 0 82.4-99.2 0 0-82.4L67.6 585.6c43 161 170.6 287.4 332.4 328.6-10.4 26.2-40.6 89.4-90.8 100.6-62.2 14 168.8 3.4 333.6-104.6 126.6-36.6 230.8-125.8 287.4-242.2l-97.6 0 0-82.4-166.2 0 0-87.2 0-12.8L666.4 476l166.2-206.2 94 0-140.4 215.8 46.4 0 0-59 99.2-154 0 213.2L931.8 585.6zM366.2 608c-4.8-11.2-7.2-23.2-7.2-36L359 357.6c0-12.8 2.4-24.8 7.2-36 4.8-11.2 11.4-21 19.6-29.2 8.2-8.2 18-14.8 29.2-19.6 11.2-4.8 23.2-7.2 36-7.2l81.6 0c12.8 0 24.8 2.4 36 7.2 11 4.8 20.6 11.2 28.8 19.2l-88.6 129.4 0-23c0-4.8-1.6-8.8-4.8-12-3.2-3.2-7.2-4.8-12-4.8-4.8 0-8.8 1.6-12 4.8-3.2 3.2-4.8 7.2-4.8 12l0 72L372.6 620C370.2 616.2 368 612.2 366.2 608zM624.4 572c0 12.8-2.4 24.8-7.2 36-4.8 11.2-11.4 21-19.6 29.2-8.2 8.2-18 14.8-29.2 19.6-11.2 4.8-23.2 7.2-36 7.2l-81.6 0c-12.8 0-24.8-2.4-36-7.2-11.2-4.8-21-11.4-29.2-19.6-3.6-3.6-7-7.8-10-12l99.2-144.6 0 50.6c0 4.8 1.6 8.8 4.8 12 3.2 3.2 7.2 4.8 12 4.8 4.8 0 8.8-1.6 12-4.8 3.2-3.2 4.8-7.2 4.8-12l0-99.6 92.6-135.2c6.6 7.4 12 15.8 16 25.2 4.8 11.2 7.2 23.2 7.2 36L624.2 572z" ></path>' +
20+
'' +
21+
'</symbol>' +
22+
'' +
23+
'<symbol id="icon-EXCEL" viewBox="0 0 1024 1024">' +
24+
'' +
25+
'<path d="M625.664 132.608V199.68h309.76v43.008h-309.76V312.32h309.76v43.008h-309.76v68.608h309.76v43.008h-309.76v68.608h309.76v43.008h-309.76v68.608h309.76v43.008h-309.76v68.096h309.76v43.008h-309.76v89.088H1024v-757.76h-398.336zM0 914.944L577.024 1024V0L0 109.056" ></path>' +
26+
'' +
27+
'<path d="M229.376 660.48H139.776l118.272-187.904-112.64-180.736h92.16l65.536 119.808L370.688 291.84h89.088l-112.64 177.664L466.944 660.48H373.248l-70.144-125.44L229.376 660.48z" ></path>' +
28+
'' +
29+
'</symbol>' +
30+
'' +
1131
'<symbol id="icon-zujian" viewBox="0 0 1024 1024">' +
1232
'' +
1333
'<path d="M568.6 0h454.9v454.9H568.6V0z m0 568.6h454.9v454.9H568.6V568.6zM0 568.6h454.9v454.9H0V568.6zM0 0h454.9v454.9H0V0z" fill="" ></path>' +

src/components/ErrLog/index.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<el-badge :is-dot="true" style="line-height: 30px;" @click.native="dialogTableVisible=true">
44
<el-button size="small" type="primary">
5-
<wscn-icon-svg icon-class="bug" class="meta-item__icon"/>
5+
<svg t="1492682037685" class="bug-svg" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1863" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M969.142857 548.571429q0 14.848-10.861714 25.709714t-25.709714 10.861714l-128 0q0 97.718857-38.290286 165.705143l118.857143 119.442286q10.861714 10.861714 10.861714 25.709714t-10.861714 25.709714q-10.276571 10.861714-25.709714 10.861714t-25.709714-10.861714l-113.152-112.566857q-2.852571 2.852571-8.557714 7.424t-23.990857 16.274286-37.156571 20.845714-46.848 16.566857-55.442286 7.424l0-512-73.142857 0 0 512q-29.147429 0-58.002286-7.716571t-49.700571-18.870857-37.705143-22.272-24.868571-18.578286l-8.557714-8.009143-104.557714 118.272q-11.446857 11.995429-27.428571 11.995429-13.714286 0-24.576-9.142857-10.861714-10.276571-11.702857-25.417143t8.850286-26.587429l115.419429-129.718857q-33.133714-65.133714-33.133714-156.562286l-128 0q-14.848 0-25.709714-10.861714t-10.861714-25.709714 10.861714-25.709714 25.709714-10.861714l128 0 0-168.009143-98.852571-98.852571q-10.861714-10.861714-10.861714-25.709714t10.861714-25.709714 25.709714-10.861714 25.709714 10.861714l98.852571 98.852571 482.304 0 98.852571-98.852571q10.861714-10.861714 25.709714-10.861714t25.709714 10.861714 10.861714 25.709714-10.861714 25.709714l-98.852571 98.852571 0 168.009143 128 0q14.848 0 25.709714 10.861714t10.861714 25.709714zM694.857143 219.428571l-365.714286 0q0-75.995429 53.430857-129.426286t129.426286-53.430857 129.426286 53.430857 53.430857 129.426286z" p-id="1864"></path></svg>
66
</el-button>
77
</el-badge>
88
<el-dialog title="bug日志" v-model="dialogTableVisible">
@@ -37,7 +37,15 @@
3737
return {
3838
dialogTableVisible: false
3939
}
40-
},
41-
methods: {}
40+
}
4241
}
4342
</script>
43+
<style scoped>
44+
.bug-svg {
45+
width: 1em;
46+
height: 1em;
47+
vertical-align: -0.15em;
48+
fill: currentColor;
49+
overflow: hidden;
50+
}
51+
</style>

src/main.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ router.afterEach(() => {
7373
NProgress.done();
7474
});
7575

76-
77-
// 异步组件
78-
// Vue.component('async-Editor', function (resolve) {
79-
// require(['components/Editor'], resolve)
80-
// });
81-
8276
// window.onunhandledrejection = e => {
8377
// console.log('unhandled', e.reason, e.promise);
8478
// e.preventDefault()

src/router/index.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const AvatarUpload = resolve => require(['../views/components/avatarupload'], re
2727
const Dropzone = resolve => require(['../views/components/dropzone'], resolve);
2828
const Sticky = resolve => require(['../views/components/sticky'], resolve);
2929
const SplitPane = resolve => require(['../views/components/splitpane'], resolve);
30+
const CountTo = resolve => require(['../views/components/countto'], resolve);
31+
const Mixin = resolve => require(['../views/components/mixin'], resolve);
3032

3133

3234
/* charts*/
@@ -35,11 +37,15 @@ const KeyboardChart2 = resolve => require(['../views/charts/keyboard2'], resolve
3537
const LineMarker = resolve => require(['../views/charts/line'], resolve);
3638
const MixChart = resolve => require(['../views/charts/mixchart'], resolve);
3739

40+
/* excel*/
41+
const ErrorLog = resolve => require(['../views/errlog/index'], resolve);
42+
3843
/* excel*/
3944
const ExcelDownload = resolve => require(['../views/excel/index'], resolve);
4045

4146

4247

48+
4349
/* admin*/
4450
// const AdminCreateUser = resolve => require(['../views/admin/createUser'], resolve);
4551
// const QuicklyCreateUser = resolve => require(['../views/admin/quicklycreate'], resolve);
@@ -85,7 +91,9 @@ export default new Router({
8591
{ path: 'splitpane', component: SplitPane, name: 'SplitPane' },
8692
{ path: 'avatarupload', component: AvatarUpload, name: '头像上传' },
8793
{ path: 'dropzone', component: Dropzone, name: 'Dropzone' },
88-
{ path: 'sticky', component: Sticky, name: 'Sticky' }
94+
{ path: 'sticky', component: Sticky, name: 'Sticky' },
95+
{ path: 'countto', component: CountTo, name: 'CountTo' },
96+
{ path: 'mixin', component: Mixin, name: '小组件' }
8997
]
9098
},
9199
{
@@ -106,18 +114,29 @@ export default new Router({
106114
component: Layout,
107115
redirect: 'noredirect',
108116
name: '错误页面',
109-
icon: 'tubiaoleixingzhengchang',
117+
icon: '404',
110118
children: [
111119
{ path: '401', component: Err401, name: '401' },
112120
{ path: '404', component: Err404, name: '404' }
113121
]
114122
},
123+
{
124+
path: '/errlog',
125+
component: Layout,
126+
redirect: 'noredirect',
127+
name: 'errlog',
128+
icon: 'bug',
129+
noDropdown: true,
130+
children: [
131+
{ path: 'log', component: ErrorLog, name: '错误日志' }
132+
]
133+
},
115134
{
116135
path: '/excel',
117136
component: Layout,
118137
redirect: 'noredirect',
119138
name: 'excel',
120-
icon: 'tubiaoleixingzhengchang',
139+
icon: 'EXCEL',
121140
noDropdown: true,
122141
children: [
123142
{ path: 'download', component: ExcelDownload, name: '导出excel' }

src/views/components/countTo.vue

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
<template>
2+
<div class="components-container">
3+
<code>countTo 组件 <a href='https://github.com/PanJiaChen/vue-countTo' target='_blank'>线上地址</a></code>
4+
5+
<count-to ref='example' class='example' :start-val='_startVal' :end-val='_endVal' :duration='_duration' :decimals='_decimals'
6+
:separator='_separator' :prefix='_prefix' :suffix='_suffix' :autoplay='false' />
7+
<div style='margin-left: 25%;margin-top: 40px;'>
8+
<label class="label" for="startValInput">startVal: <input type="number" v-model.number='setStartVal' name='startValInput' /></label>
9+
<label class="label" for="endValInput">endVal: <input type="number" v-model.number='setEndVal' name='endVaInput' /></label>
10+
<label class="label" for="durationInput">duration: <input type="number" v-model.number='setDuration' name='durationInput' /></label>
11+
<div class="startBtn example-btn" @click='start'>开始</div>
12+
<div class="pause-resume-btn example-btn" @click='pauseResume'>暂停/恢复</div>
13+
<br/>
14+
<label class="label" for="decimalsInput">decimals: <input type="number" v-model.number='setDecimals' name='decimalsInput' /></label>
15+
<label class="label" for="separatorInput">separator: <input v-model='setSeparator' name='separatorInput' /></label>
16+
<label class="label" for="prefixInput">prefix: <input v-model='setPrefix' name='prefixInput' /></label>
17+
<label class="label" for="suffixInput">suffix: <input v-model='setSuffix' name='suffixInput' /></label>
18+
</div>
19+
<code>&lt;count-to :start-val=&#x27;{{_startVal}}&#x27; :end-val=&#x27;{{_endVal}}&#x27; :duration=&#x27;{{_duration}}&#x27; :decimals=&#x27;{{_decimals}}&#x27;
20+
:separator=&#x27;{{_separator}}&#x27; :prefix=&#x27;{{_prefix}}&#x27; :suffix=&#x27;{{_suffix}}&#x27; :autoplay=false&gt;</code>
21+
</div>
22+
</template>
23+
<script>
24+
import countTo from 'vue-count-to';
25+
26+
export default {
27+
components: { countTo },
28+
data() {
29+
return {
30+
setStartVal: 0,
31+
setEndVal: 2017,
32+
setDuration: 4000,
33+
setDecimals: 0,
34+
setSeparator: ',',
35+
setSuffix: ' rmb',
36+
setPrefix: '¥ '
37+
}
38+
},
39+
computed: {
40+
_startVal() {
41+
if (this.setStartVal) {
42+
return this.setStartVal
43+
} else {
44+
return 0
45+
}
46+
},
47+
_endVal() {
48+
if (this.setEndVal) {
49+
return this.setEndVal
50+
} else {
51+
return 0
52+
}
53+
},
54+
_duration() {
55+
if (this.setDuration) {
56+
return this.setDuration
57+
} else {
58+
return 100
59+
}
60+
},
61+
_decimals() {
62+
if (this.setDecimals) {
63+
if (this.setDecimals < 0 || this.setDecimals > 20) {
64+
alert('digits argument must be between 0 and 20')
65+
return 0
66+
}
67+
return this.setDecimals
68+
} else {
69+
return 0
70+
}
71+
},
72+
_separator() {
73+
return this.setSeparator
74+
},
75+
_suffix() {
76+
return this.setSuffix
77+
},
78+
_prefix() {
79+
return this.setPrefix
80+
}
81+
},
82+
methods: {
83+
start() {
84+
this.$refs.example.start();
85+
},
86+
pauseResume() {
87+
this.$refs.example.pauseResume();
88+
}
89+
}
90+
};
91+
</script>
92+
93+
<style scoped>
94+
.example-btn {
95+
display: inline-block;
96+
margin-bottom: 0;
97+
font-weight: 500;
98+
text-align: center;
99+
-ms-touch-action: manipulation;
100+
touch-action: manipulation;
101+
cursor: pointer;
102+
background-image: none;
103+
border: 1px solid transparent;
104+
white-space: nowrap;
105+
line-height: 1.5;
106+
padding: 4px 15px;
107+
font-size: 12px;
108+
border-radius: 4px;
109+
-webkit-user-select: none;
110+
-moz-user-select: none;
111+
-ms-user-select: none;
112+
user-select: none;
113+
-webkit-transition: all .3s cubic-bezier(.645, .045, .355, 1);
114+
transition: all .3s cubic-bezier(.645, .045, .355, 1);
115+
position: relative;
116+
color: rgba(0, 0, 0, .65);
117+
background-color: #fff;
118+
border-color: #d9d9d9;
119+
}
120+
121+
.example-btn:hover {
122+
color: #4AB7BD;
123+
background-color: #fff;
124+
border-color: #4AB7BD;
125+
}
126+
.example {
127+
font-size: 50px;
128+
color: #F6416C;
129+
display: block;
130+
margin: 10px 0;
131+
text-align: center;
132+
font-size: 80px;
133+
font-weight: 500;
134+
}
135+
136+
.label {
137+
color: #2f4f4f;
138+
font-size: 16px;
139+
display: inline-block;
140+
margin: 15px 30px 15px 0;
141+
}
142+
143+
input {
144+
position: relative;
145+
display: inline-block;
146+
padding: 4px 7px;
147+
width: 70px;
148+
height: 28px;
149+
cursor: text;
150+
font-size: 12px;
151+
line-height: 1.5;
152+
color: rgba(0, 0, 0, .65);
153+
background-color: #fff;
154+
background-image: none;
155+
border: 1px solid #d9d9d9;
156+
border-radius: 4px;
157+
-webkit-transition: all .3s;
158+
transition: all .3s;
159+
}
160+
161+
.startBtn {
162+
margin-left: 20px;
163+
font-size: 20px;
164+
color: #30B08F;
165+
background-color: #fff;
166+
}
167+
168+
.startBtn:hover {
169+
background-color: #30B08F;
170+
color: #fff;
171+
border-color: #30B08F;
172+
}
173+
174+
.pause-resume-btn {
175+
font-size: 20px;
176+
color: #E65D6E;
177+
background-color: #fff;
178+
}
179+
180+
.pause-resume-btn:hover {
181+
background-color: #E65D6E;
182+
color: #fff;
183+
border-color: #E65D6E;
184+
}
185+
</style>
186+
187+

0 commit comments

Comments
 (0)