Skip to content

Commit 5fb564c

Browse files
committed
增加编辑表单第4种render渲染demo
1 parent 342254a commit 5fb564c

File tree

2 files changed

+392
-171
lines changed

2 files changed

+392
-171
lines changed

Vol.Vue/src/views/Home.vue

Lines changed: 150 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
<div class="home-contianer">
33
<el-scrollbar style="height:100%;">
44
<div style>
5-
<div data-v-542f4644 class="ivu-row">
6-
<div v-for="item in topColor" :key="item.name" class="ivu-col ivu-col-span-6">
5+
<div data-v-542f4644
6+
class="ivu-row">
7+
<div v-for="item in topColor"
8+
:key="item.name"
9+
class="ivu-col ivu-col-span-6">
710
<div class="item-name">
811
{{item.name}}
9-
<Tooltip class="icon" placement="left-start">
12+
<Tooltip class="icon"
13+
placement="left-start">
1014
<Icon type="ios-information-circle-outline" />
1115
<div slot="content">
1216
<p>{{item.name}}</p>
@@ -17,18 +21,40 @@
1721
<div class="rate">
1822
<span>
1923
<span>环比{{item.down}}%</span>
20-
<Icon class="down" type="md-arrow-dropdown" />
24+
<Icon class="down"
25+
type="md-arrow-dropdown" />
2126
</span>
2227
<span>
2328
<span>同比{{item.up}}%</span>
24-
<Icon class="up" type="md-arrow-dropup" />
29+
<Icon class="up"
30+
type="md-arrow-dropup" />
2531
</span>
2632
</div>
2733
<div class="bottom">平均增长趋势{{item.up}}%</div>
2834
</div>
2935
</div>
3036
<div class="charts-line">
31-
<div id="charts-line" style="height:350px;"></div>
37+
<div id="charts-line"
38+
class="left"
39+
style="height:350px;"></div>
40+
<div class="right">
41+
<div class="title">活跃用户榜</div>
42+
<div class="user-item">
43+
<div v-for="(item,index) in cell"
44+
:key="index"
45+
class="cell">
46+
<div class="primary">
47+
<span :class="{top3:index<3,badge:index>=3}"
48+
class="badge-count">{{index+1}}</span>
49+
<Avatar :src="item.img" />
50+
<span class="name">{{item.name}}</span>
51+
52+
</div>
53+
54+
<div>{{item.number}}</div>
55+
</div>
56+
</div>
57+
</div>
3258
</div>
3359
<div style="background:#fff; margin: 0 13px;">
3460
<div class="h5-desc">
@@ -47,25 +73,6 @@
4773
</div>
4874
</div>
4975
</div>
50-
<div class="charts">
51-
<div id="charts" style="height:360px;padding-bottom:0;" class="left"></div>
52-
<div class="right">
53-
<div class="title">活跃用户榜</div>
54-
55-
<div class="user-item">
56-
<div v-for="(item,index) in cell" :key="index" class="cell">
57-
<div class="primary">
58-
<span :class="{top3:index<3,badge:index>=3}" class="badge-count">{{index+1}}</span>
59-
<Avatar :src="item.img" />
60-
<span class="name">{{item.name}}</span>
61-
<span class="desc">{{item.desc}}</span>
62-
</div>
63-
64-
<div>{{item.number}}</div>
65-
</div>
66-
</div>
67-
</div>
68-
</div>
6976
</div>
7077
</el-scrollbar>
7178
</div>
@@ -78,7 +85,7 @@ var echarts = require("echarts");
7885
7986
export default {
8087
components: { Community: Community, Cow: Cow, Question: Question },
81-
data() {
88+
data () {
8289
return {
8390
n: 90,
8491
cell: [
@@ -163,138 +170,122 @@ export default {
163170
value1: "1"
164171
};
165172
},
166-
mounted() {
167-
var myChart = echarts.init(document.getElementById("charts"));
168-
// 绘制图表
169-
myChart.setOption({
170-
color: ["#3398DB"],
173+
mounted () {
174+
var $charts_line = echarts.init(document.getElementById("charts-line"));
175+
$charts_line.setOption({
171176
title: {
172-
left: "center",
173-
text: "QQ交流群:还没想好..."
177+
text: '销售订单'
174178
},
175-
tooltip: {},
176-
xAxis: {
177-
data: ["商品", "数据", "订单", "消息", "标签", "异常", "审批", "取消"]
179+
tooltip: {
180+
trigger: 'axis',
181+
axisPointer: {
182+
type: 'cross',
183+
label: {
184+
backgroundColor: '#6a7985'
185+
}
186+
}
178187
},
179-
yAxis: {},
180-
series: [
188+
189+
color: ['#ffab6f', '#09b916', '#83cddc'], //图例颜色
190+
legend: {
191+
icon: "roundRect",
192+
data: ['销售订单', '退货订单', '折扣订单']
193+
},
194+
toolbox: {
195+
feature: {
196+
197+
}
198+
},
199+
grid: {
200+
left: '3%',
201+
right: '4%',
202+
bottom: '3%',
203+
containLabel: true
204+
},
205+
xAxis: [
181206
{
182-
name: "数量",
183-
type: "bar",
184-
data: [5, 20, 36, 10, 10, 20, 15, 22]
207+
type: 'category',
208+
boundaryGap: false,
209+
data: ['2020.06.15', '2020.06.16', '2020.06.17',
210+
'2020.06.18', '2020.06.19', '2020.06.20', '2020.06.21']
185211
}
186-
]
187-
});
188-
var $charts_line = echarts.init(document.getElementById("charts-line"));
189-
$charts_line.setOption({
190-
title: {
191-
text: '日销售订单统计'
192-
},
193-
tooltip: {
194-
trigger: 'axis',
195-
axisPointer: {
196-
type: 'cross',
197-
label: {
198-
backgroundColor: '#6a7985'
212+
],
213+
yAxis: [
214+
{
215+
type: "value",
216+
splitLine: {
217+
lineStyle: {
218+
color: "#eee"
219+
}
220+
}
199221
}
200-
}
201-
},
202-
203-
color: ['#ffab6f', '#09b916', '#83cddc'], //图例颜色
204-
legend: {
205-
icon: "roundRect",
206-
data:['销售订单', '退货订单', '折扣订单']
207-
},
208-
toolbox: {
209-
feature: {
210-
211-
}
212-
},
213-
grid: {
214-
left: '3%',
215-
right: '4%',
216-
bottom: '3%',
217-
containLabel: true
218-
},
219-
xAxis: [
220-
{
221-
type: 'category',
222-
boundaryGap: false,
223-
data: ['2020.06.15', '2020.06.16', '2020.06.17',
224-
'2020.06.18', '2020.06.19', '2020.06.20', '2020.06.21','2020.06.22']
225-
}
226-
],
227-
yAxis: [
228-
{
229-
type: 'value'
230-
}
231-
],
232-
series: [
233-
{
234-
name: '销售订单',
235-
type: 'line',
236-
smooth: true,
237-
lineStyle: {
238-
color: "#45d4ba",
239-
width: 1
240-
}, //线条的样式
241-
areaStyle: {
242-
color: new
243-
echarts.graphic.LinearGradient(0, 0, 0, 1, [{
244-
offset: 0,
245-
color: '#83cddc'
246-
}, {
247-
offset: 1,
248-
color: '#bfdffbb5'
249-
}])
250-
},
251-
data: [5, 22, 150, 54, 1, 230, 4,1]
252-
},
253-
{
254-
name: '退货订单',
255-
type: 'line',
222+
],
223+
series: [
224+
{
225+
name: '销售订单',
226+
type: 'line',
227+
smooth: true,
228+
lineStyle: {
229+
color: "#45d4ba",
230+
width: 1
231+
}, //线条的样式
232+
areaStyle: {
233+
color: new
234+
echarts.graphic.LinearGradient(0, 0, 0, 1, [{
235+
offset: 0,
236+
color: '#83cddc'
237+
}, {
238+
offset: 1,
239+
color: '#bfdffbb5'
240+
}])
241+
},
242+
data: [5, 22, 150, 54, 1, 230, 1]
243+
},
244+
{
245+
name: '退货订单',
246+
type: 'line',
256247
257-
smooth: true,
258-
lineStyle: {
259-
color: "#04a710",
260-
width: 1
261-
}, //
262-
areaStyle: {
263-
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
264-
offset: 0,
265-
color: '#0cbf22'
266-
}, {
267-
offset: 1,
268-
color: '#b8f7d1b5'
269-
}])
270-
},
271-
data: [10, 150, 1, 250,
272-
20, 100, 10,150]
273-
},
274-
{
275-
name: '折扣订单',
276-
type: 'line',
248+
smooth: true,
249+
lineStyle: {
250+
color: "#04a710",
251+
width: 1
252+
}, //
253+
areaStyle: {
254+
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
255+
offset: 0,
256+
color: '#0cbf22'
257+
}, {
258+
offset: 1,
259+
color: '#b8f7d1b5'
260+
}])
261+
},
262+
data: [10, 150, 1, 250,
263+
20, 100, 10]
264+
},
265+
{
266+
name: '折扣订单',
267+
type: 'line',
277268
278-
lineStyle: {
279-
color:
280-
"#0864c3",
281-
width: 1
282-
}, //线条的样式
283-
smooth: true,
284-
areaStyle: {
285-
color: new
286-
echarts.graphic.LinearGradient(0, 0, 0, 1, [{
287-
offset: 0,
288-
color: '#29d7ff'
289-
}, {
290-
offset: 1,
291-
color: '#34ccef85'
292-
}])
293-
},
294-
data: [100, 2, 260, 1, 200, 30, 101,40]
295-
}
296-
]
297-
});
269+
lineStyle: {
270+
color:
271+
"#0864c3",
272+
width: 1
273+
}, //线条的样式
274+
smooth: true,
275+
areaStyle: {
276+
color: new
277+
echarts.graphic.LinearGradient(0, 0, 0, 1, [{
278+
offset: 0,
279+
color: '#29d7ff'
280+
}, {
281+
offset: 1,
282+
color: '#34ccef85'
283+
}])
284+
},
285+
data: [100, 2, 290, 1, 200, 30, 101]
286+
}
287+
]
288+
});
298289
}
299290
};
300291
</script>
@@ -396,33 +387,21 @@ export default {
396387
padding-top: 10px;
397388
}
398389
</style>
399-
<style lang="less">
390+
<style lang="less" scope>
400391
.charts-line {
401392
margin: 0px 13px 13px 13px;
402-
background: white;
403-
padding-top: 10px;
404-
}
405-
.charts {
406-
margin: 25px 13px;
407-
display: inline-block;
408-
width: 100%;
409-
// padding: 0px 24px;
393+
display: flex;
410394
.left {
411-
padding: 25px;
412-
background: white;
413-
height: 360px;
414-
width: 49%;
415-
float: left;
416-
margin-right: 1%;
395+
flex: 1;
417396
background: white;
397+
padding: 10px;
418398
}
419399
.right {
420-
padding: 25px 45px;
400+
padding: 10px 15px;
421401
background: white;
422-
height: 360px;
423-
width: 49%;
424-
float: left;
425-
margin-left: 1%;
402+
height: 350px;
403+
width: 400px;
404+
margin-left: 16px;
426405
.badge-count {
427406
padding: 3px 7px;
428407
position: relative;
@@ -442,7 +421,7 @@ export default {
442421
.cell {
443422
position: relative;
444423
display: flex;
445-
padding: 10px 0;
424+
padding: 12px 0;
446425
border-bottom: 1px dotted #eee;
447426
}
448427
.primary {

0 commit comments

Comments
 (0)