index.vue
1.34 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
<template>
<div>
<Chart :cdata="cdata" />
<el-carousel height="40px" indicator-position="none">
<el-carousel-item v-for="item in 4" :key="item">
<div class="rotograph">佛坪县</div>
</el-carousel-item>
</el-carousel>
</div>
</template>
<script>
import Chart from "./Chart";
import work from "@/api/work";
export default {
data () {
return {
cdata: {
seriesData: [],
},
};
},
components: {
Chart,
},
mounted () {
this.getdjywltotal();
},
methods: {
async getdjywltotal () {
try {
let p = {
DJLX: "",
QLLX: "",
XZQDM: "",
};
let res = await work.getdjywltotal(p);
console.log("res",res);
res.result.filter((item) => {
return (
this.cdata.seriesData.push({ "name": item.AREACODE, "value": item.ywtotal })
)
});
console.log("this.cdata.seriesData",this.cdata.seriesData);
} catch (error) {
this.$refs.msg.messageShow();
}
},
},
};
</script>
<style lang="scss" scoped>
.rotograph {
margin: auto;
width: 200px;
height: 30px;
background-color: rgb(6, 121, 167);
font-size: 20px;
line-height: 30px;
text-align: center;
border-radius: 6px;
font-weight: 600;
color: #02d9fd;
}
</style>