dicisection.vue
3.04 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
<template>
<div>
<titlesection title="地磁"></titlesection>
<totalsection :totalNum="totalVal"></totalsection>
<ul class="flexfm dici-wrap">
<li v-for="(item, index) in diciList" :key="index">
<div>{{item.name}}</div>
<div><span :style="{width : item.percentage}"></span></div>
<div>{{item.count | formatNum}}</div>
</li>
</ul>
</div>
</template>
<script>
import titlesection from '../components/titlesection'
import totalsection from '../components/total'
import { deviceAddress } from '../api/api'
export default {
name: 'dicisection',
components: {
titlesection,
totalsection
},
data() {
return {
totalVal: '',
diciList:[]
}
},
created() {
this.getList()
},
methods: {
getList() {
deviceAddress({
orgIds: this.GLOBAL.paramsvariables
}).then((response)=>{
const data = response.data.data
this.totalVal = data[1].num.toString()
this.diciList = data[1].dicList
})
},
}
}
</script>
<style lang="scss" scoped>
@mixin textStyle($color){
padding-right: 23px;
text-align: left;
font-size: 12px;
color: $color;
}
@mixin borderStyle($color) {
flex: 1;
height: 12px;
border:1px solid $color;
position: relative;
}
@mixin fillStyle{
position: absolute;
display: inline-block;
height: 10px;
top:0;
left: 0;
}
@mixin countStyle($color){
width: 80px;
padding-left: 23px;
text-align: left;
font-size: 14px;
color: $color;
}
.dici-wrap{
height: 100%;
display: flex;
flex-direction: column;
li{
flex: 1;
padding: 0 23px;
display: flex;
font-size: 14px;
&:nth-of-type(1){
div{
&:nth-of-type(1){
@include textStyle(#59AAF7)
}
&:nth-of-type(2){
@include borderStyle(#59AAF7);
span{
@include fillStyle;
background:linear-gradient(90deg,rgba(0,202,254,1),rgba(39,114,244,1));
}
}
&:nth-of-type(3){
@include countStyle(#59AAF7)
}
}
}
&:nth-of-type(2){
div{
&:nth-of-type(1){
@include textStyle(#FFB700)
}
&:nth-of-type(2){
@include borderStyle(#59AAF7);
span{
@include fillStyle;
background:linear-gradient(-90deg,rgba(255,186,0,1),rgba(255,129,0,1));
}
}
&:nth-of-type(3){
@include countStyle(#FFB700)
}
}
}
&:nth-of-type(3){
div{
&:nth-of-type(1){
@include textStyle(#FD4B15)
}
&:nth-of-type(2){
@include borderStyle(#59AAF7);
span{
@include fillStyle;
background:linear-gradient(-90deg,rgba(255,129,90,1),rgba(237,60,5,1));
}
}
&:nth-of-type(3){
@include countStyle(#FD4B15)
}
}
}
}
}
</style>