Blame view

src/views/dicisection.vue 3.22 KB
667dd190   liuqimichale   地磁
1
2
3
4
5
6
7
  <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>
7818f74f   liuqimichale   地磁
8
9
          <div><span :style="{width : item.percentage}"></span></div>
          <div>{{item.count | formatNum}}</div>
667dd190   liuqimichale   地磁
10
11
12
13
14
15
16
17
        </li>
      </ul>
    </div>
  </template>
  
  <script>
  import titlesection from '../components/titlesection'
  import totalsection from '../components/total'
7818f74f   liuqimichale   地磁
18
  import { formatNum } from '../filters/filters'
667dd190   liuqimichale   地磁
19
20
21
22
23
24
25
26
27
28
  import {fetchList} from '../api/api'
  
  export default {
    name: 'dicisection',
    components: {
      titlesection,
      totalsection
    },
    data() {
      return {
fafdedae   liuqimichale   道闸 诱导屏
29
        totalVal: '219734',
667dd190   liuqimichale   地磁
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
        diciList:[
          {
            name: '正常',
            count: '23454',
            percentage: '80%'
          },
          {
            name: '异常',
            count: '12192',
            percentage: '60%'
          },
          {
            name: '正常',
            count: '6235',
            percentage: '40%'
          }
        ]
      }
    },
    created() {
667dd190   liuqimichale   地磁
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    },
    methods: {
      getList() {
        fetchList()
        .then(res => {
          console.log(res);
  
        });
      },
    }
  }
  </script>
  
  <style lang="scss"  scoped>
    @mixin textStyle($color){
      padding-right: 23px;
      text-align: left;
66faa378   liuqimichale   道闸 诱导屏
67
      font-size: 12px;
667dd190   liuqimichale   地磁
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
      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){
e00e4982   liuqimichale   道闸 诱导屏
84
      width: 80px;
667dd190   liuqimichale   地磁
85
86
      padding-left: 23px;
      text-align: left;
66faa378   liuqimichale   道闸 诱导屏
87
      font-size: 14px;
667dd190   liuqimichale   地磁
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
      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>