index.vue
4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
<div class="home">
<div class="home-left">
<el-row :gutter="8">
<el-col :span="12">
<el-card shadow="hover">
鼠标悬浮时显示
</el-card>
</el-col>
<el-col :span="12">
<el-card shadow="hover">
<div slot="header" class="flexst">
<h5 class="title">通知公告</h5>
<i class="el-icon-s-unfold pointer"></i>
</div>
<ul>
<li v-for="(item, index) in notice" :key="index" class="flexst">
<p class="list-title">{{ item.title }}</p>
<p class="marginZL15">{{ item.date }}</p>
<p>{{ item.state }}</p>
</li>
</ul>
</el-card>
</el-col>
</el-row>
<el-row :gutter="8" class="marginTop10">
<el-col :span="12">
<el-card shadow="hover">
<div slot="header" class="flexst">
<h5 class="title">待办事项</h5>
<i class="el-icon-s-unfold pointer"></i>
</div>
<ul>
<li v-for="(item, index) in toList" :key="index" class="flexst">
<p class="right15">{{ item.date }}</p>
<p class="list-title">{{ item.title }}</p>
</li>
</ul>
</el-card>
</el-col>
<el-col :span="12">
<el-card shadow="hover">
<div slot="header" class="flexst">
<h5 class="title">公司邮件</h5>
<i class="el-icon-s-unfold pointer"></i>
</div>
<ul>
<li v-for="(item, index) in mailList" :key="index" class="flexst">
<p class="right15">{{ item.date }}</p>
<p class="list-title">{{ item.title }}</p>
</li>
</ul>
</el-card>
</el-col>
</el-row>
<el-card shadow="hover" class="marginTop10" :body-style="{ paddingRight: '6px' }">
<div id="mountNode"></div>
</el-card>
</div>
<div class="home-right">
<calendar />
<el-card shadow="hover" class="marginTop10">
鼠标悬浮时显示
</el-card>
</div>
</div>
</template>
<script>
import * as G2 from '@antv/g2'
import calendar from '@/components/calendar/index'
export default {
name: 'home',
components: { calendar },
data () {
return {
chartData: [{
year: '1991',
value: 15468
}, {
year: '1992',
value: 16100
}, {
year: '1993',
value: 15900
}, {
year: '1994',
value: 17409
}, {
year: '1995',
value: 17000
}, {
year: '1996',
value: 31056
}, {
year: '1997',
value: 31982
}, {
year: '1998',
value: 32040
}, {
year: '1999',
value: 33233
}],
notice: [
{
title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
date: '2022-12',
state: '未读'
},
{
title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
date: '2022-12',
state: '未读'
}
],
toList: [
{
title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
date: '2022-12',
},
{
title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
date: '2022-12',
}
],
mailList: [
{
title: '坚持以人民为中心发展推进解决房地产历史遗房地产历史遗',
date: '2022-12',
}
]
}
},
mounted () {
this.buildChart();
},
methods: {
buildChart () {
var chart = new G2.Chart({
container: 'mountNode',
height: 300
});
const e = document.createEvent('Event')
e.initEvent('resize', true, true)
window.dispatchEvent(e)
chart.source(this.chartData);
chart.scale({
value: {
min: 10000
},
year: {
range: [0, 1]
}
});
chart.axis('value', {
label: {
formatter: function formatter (val) {
return (val / 10000).toFixed(1) + 'k';
}
}
});
chart.tooltip({
crosshairs: true
})
chart.forceFit();
chart.area().position('year*value').shape('smooth');
chart.line().position('year*value').size(2).shape('smooth');
chart.render();
}
}
}
</script>
<style scoped lang="scss">
@import "./index.scss";
</style>