Skip to content

Commit 15a7d07

Browse files
committed
add view
1 parent d103700 commit 15a7d07

File tree

14 files changed

+385
-94
lines changed

14 files changed

+385
-94
lines changed

src/assets/iconfont/iconfont.js

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

33
var svgSprite = '<svg>' +
4+
'' +
5+
'<symbol id="icon-tubiaoleixingzhengchang" viewBox="0 0 1024 1024">' +
6+
'' +
7+
'<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>' +
8+
'' +
9+
'</symbol>' +
410
'' +
511
'<symbol id="icon-zujian" viewBox="0 0 1024 1024">' +
612
'' +
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<template>
2+
<div :class="className" :id="id" :style="{height:height,width:width}"></div>
3+
</template>
4+
<script>
5+
// 引入 ECharts 主模块
6+
const echarts = require('echarts/lib/echarts');
7+
// 引入柱状图
8+
require('echarts/lib/chart/bar');
9+
require('echarts/lib/chart/line');
10+
// 引入提示框和标题组件
11+
require('echarts/lib/component/tooltip');
12+
require('echarts/lib/component/title');
13+
14+
require('echarts/lib/component/visualMap');
15+
export default {
16+
name: 'barPercent',
17+
props: {
18+
className: {
19+
type: String,
20+
default: 'bar-percent-chart'
21+
},
22+
id: {
23+
type: String,
24+
default: 'bar-percent-chart'
25+
},
26+
width: {
27+
type: String,
28+
default: '200px'
29+
},
30+
height: {
31+
type: String,
32+
default: '200px'
33+
}
34+
},
35+
data() {
36+
return {};
37+
},
38+
mounted() {
39+
this.initBar();
40+
},
41+
methods: {
42+
initBar() {
43+
this.chart = echarts.init(document.getElementById(this.id));
44+
45+
const xAxisData = [];
46+
const data = [];
47+
const data2 = [];
48+
for (let i = 0; i < 50; i++) {
49+
xAxisData.push(i);
50+
data.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5);
51+
data2.push((Math.sin(i / 5) * (i / 5 + 10) + i / 6) * 3);
52+
}
53+
this.chart.setOption(
54+
{
55+
backgroundColor: '#08263a',
56+
xAxis: [{
57+
show: false,
58+
data: xAxisData
59+
}, {
60+
show: false,
61+
data: xAxisData
62+
}],
63+
visualMap: {
64+
show: false,
65+
min: 0,
66+
max: 50,
67+
dimension: 0,
68+
inRange: {
69+
color: ['#4a657a', '#308e92', '#b1cfa5', '#f5d69f', '#f5898b', '#ef5055']
70+
}
71+
},
72+
yAxis: {
73+
axisLine: {
74+
show: false
75+
},
76+
axisLabel: {
77+
textStyle: {
78+
color: '#4a657a'
79+
}
80+
},
81+
splitLine: {
82+
show: true,
83+
lineStyle: {
84+
color: '#08263f'
85+
}
86+
},
87+
axisTick: {
88+
show: false
89+
}
90+
},
91+
series: [{
92+
name: 'back',
93+
type: 'bar',
94+
data: data2,
95+
z: 1,
96+
itemStyle: {
97+
normal: {
98+
opacity: 0.4,
99+
barBorderRadius: 5,
100+
shadowBlur: 3,
101+
shadowColor: '#111'
102+
}
103+
}
104+
}, {
105+
name: 'Simulate Shadow',
106+
type: 'line',
107+
data,
108+
z: 2,
109+
showSymbol: false,
110+
animationDelay: 0,
111+
animationEasing: 'linear',
112+
animationDuration: 1200,
113+
lineStyle: {
114+
normal: {
115+
color: 'transparent'
116+
}
117+
},
118+
areaStyle: {
119+
normal: {
120+
color: '#08263a',
121+
shadowBlur: 50,
122+
shadowColor: '#000'
123+
}
124+
}
125+
}, {
126+
name: 'front',
127+
type: 'bar',
128+
data,
129+
xAxisIndex: 1,
130+
z: 3,
131+
itemStyle: {
132+
normal: {
133+
barBorderRadius: 5
134+
}
135+
}
136+
}],
137+
animationEasing: 'elasticOut',
138+
animationEasingUpdate: 'elasticOut',
139+
animationDelay(idx) {
140+
return idx * 20;
141+
},
142+
animationDelayUpdate(idx) {
143+
return idx * 20;
144+
}
145+
})
146+
}
147+
}
148+
}
149+
</script>

src/components/Hamburger/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<template>
22
<div>
3-
<svg @click="toggleClick" class="wscn-icon hamburger" :class="{'is-active':isActive}" aria-hidden="true">
4-
<use xlink:href="#icon-hamburger"></use>
5-
</svg>
3+
<svg t="1492500959545" @click="toggleClick" class="wscn-icon hamburger" :class="{'is-active':isActive}" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1691" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M966.8023 568.849776 57.196677 568.849776c-31.397081 0-56.850799-25.452695-56.850799-56.850799l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 543.397081 998.200404 568.849776 966.8023 568.849776z" p-id="1692"></path><path d="M966.8023 881.527125 57.196677 881.527125c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 856.07443 998.200404 881.527125 966.8023 881.527125z" p-id="1693"></path><path d="M966.8023 256.17345 57.196677 256.17345c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.850799 56.850799-56.850799l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.850799l0 0C1023.653099 230.720755 998.200404 256.17345 966.8023 256.17345z" p-id="1694"></path></svg>
64
</div>
75
</template>
86

src/router/index.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ import reset from '../views/login/reset';
1919
/* components*/
2020
const Tinymce = resolve => require(['../views/components/tinymce'], resolve);
2121
const Markdown = resolve => require(['../views/components/markdown'], resolve);
22+
const Jsoneditor = resolve => require(['../views/components/jsoneditor'], resolve);
23+
24+
/* charts*/
25+
const KeyboardChart = resolve => require(['../views/charts/keyboard'], resolve);
26+
const KeyboardChart2 = resolve => require(['../views/charts/keyboard2'], resolve);
27+
2228

2329
/* admin*/
2430
// const AdminCreateUser = resolve => require(['../views/admin/createUser'], resolve);
@@ -52,14 +58,27 @@ export default new Router({
5258
]
5359
},
5460
{
55-
path: '/admin',
61+
path: '/components',
5662
component: Layout,
5763
redirect: 'noredirect',
5864
name: '组件',
5965
icon: 'zujian',
6066
children: [
6167
{ path: 'tinymce', component: Tinymce, name: '富文本编辑器' },
62-
{ path: 'markdown', component: Markdown, name: 'Markdown' }
68+
{ path: 'markdown', component: Markdown, name: 'Markdown' },
69+
{ path: 'jsoneditor', component: Jsoneditor, name: 'json编辑器' }
70+
71+
]
72+
},
73+
{
74+
path: '/charts',
75+
component: Layout,
76+
redirect: 'noredirect',
77+
name: '图表',
78+
icon: 'tubiaoleixingzhengchang',
79+
children: [
80+
{ path: 'keyboard', component: KeyboardChart, name: '键盘图表' },
81+
{ path: 'keyboard2', component: KeyboardChart2, name: '键盘图表2' }
6382

6483
]
6584
},

src/styles/index.scss

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
@import './btn.scss';
22
// @import './editor.scss';
33
@import "./mixin.scss";
4-
54
body {
65
//height: 100%;
76
//overflow-y: scroll;
87
-moz-osx-font-smoothing: grayscale;
98
-webkit-font-smoothing: antialiased;
109
text-rendering: optimizeLegibility;
11-
font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
10+
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
1211
//@include scrollBar;
1312
}
14-
label{
13+
14+
label {
1515
font-weight: 700;
1616
}
1717

1818
html {
1919
box-sizing: border-box;
2020
}
2121

22-
*, *:before, *:after {
22+
*,
23+
*:before,
24+
*:after {
2325
box-sizing: inherit;
2426
}
2527

@@ -68,21 +70,29 @@ a:hover {
6870
display: block;
6971
}
7072

71-
.components-container{
73+
.components-container {
7274
margin: 30px 50px;
75+
position: relative;
7376
}
7477

75-
code{
76-
background: #eef1f6;
77-
padding: 20px 10px;
78-
margin-bottom: 20px;
79-
display: block;
78+
.editor-container .CodeMirror {
79+
height: 100%!important;
8080
}
81-
.fade-enter-active, .fade-leave-active {
81+
82+
code {
83+
background: #eef1f6;
84+
padding: 20px 10px;
85+
margin-bottom: 20px;
86+
display: block;
87+
}
88+
89+
.fade-enter-active,
90+
.fade-leave-active {
8291
transition: all .2s ease
8392
}
8493

85-
.fade-enter, .fade-leave-active {
94+
.fade-enter,
95+
.fade-leave-active {
8696
opacity: 0;
8797
}
8898

@@ -101,7 +111,6 @@ code{
101111
// margin: 0 auto;
102112
// }
103113
//}
104-
105114
//main-container全局样式
106115
.app-container {
107116
padding: 20px;
@@ -139,7 +148,6 @@ code{
139148
.el-upload {
140149
float: left;
141150
width: 100px;
142-
143151
}
144152
.el-upload-list {
145153
float: left;
@@ -190,15 +198,18 @@ code{
190198
}
191199
}
192200

193-
.link-type,.link-type:focus {
201+
.link-type,
202+
.link-type:focus {
194203
color: #337ab7;
195204
cursor: pointer;
196-
&:hover{
205+
&:hover {
197206
color: rgb(32, 160, 255);
198207
}
199208
}
200209

201-
.publishedTag, .draftTag, .deletedTag {
210+
.publishedTag,
211+
.draftTag,
212+
.deletedTag {
202213
color: #fff;
203214
background-color: $panGreen;
204215
line-height: 1;
@@ -242,7 +253,7 @@ code{
242253
.el-checkbox {
243254
margin: 0 20px 15px 0;
244255
}
245-
.el-checkbox + .el-checkbox {
256+
.el-checkbox+.el-checkbox {
246257
margin-left: 0px;
247258
}
248259
}
@@ -272,8 +283,8 @@ code{
272283
p {
273284
display: inline-block;
274285
}
275-
.el-collapse-item__content{
276-
padding-right:0px;
286+
.el-collapse-item__content {
287+
padding-right: 0px;
277288
}
278289
}
279290

@@ -328,12 +339,14 @@ code{
328339
margin-right: 8px;
329340
}
330341
}
331-
.small-padding{
332-
.cell{
342+
343+
.small-padding {
344+
.cell {
333345
padding-left: 8px;
334346
padding-right: 8px;
335347
}
336348
}
349+
337350
.status-col {
338351
.cell {
339352
padding: 0 10px;
@@ -348,7 +361,10 @@ code{
348361
// margin-left: 0px!important;
349362
//}
350363
.no-border {
351-
.el-input-group__prepend, .el-input__inner, .el-date-editor__editor, .multiselect__tags {
364+
.el-input-group__prepend,
365+
.el-input__inner,
366+
.el-date-editor__editor,
367+
.multiselect__tags {
352368
border: none;
353369
}
354370
}
@@ -384,7 +400,7 @@ code{
384400
}
385401

386402
//暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461
387-
.el-dialog{
403+
.el-dialog {
388404
transform: none;
389405
left: 0;
390406
position: relative;

0 commit comments

Comments
 (0)