Blame view

src/views/dicisection.vue 3.04 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'
adf82b69   liuqimichale   调取接口
18
  import { deviceAddress } from '../api/api'
667dd190   liuqimichale   地磁
19
20
21
22
23
24
25
26
  export default {
    name: 'dicisection',
    components: {
      titlesection,
      totalsection
    },
    data() {
      return {
adf82b69   liuqimichale   调取接口
27
28
        totalVal: '',
        diciList:[]
667dd190   liuqimichale   地磁
29
30
31
      }
    },
    created() {
adf82b69   liuqimichale   调取接口
32
      this.getList()
667dd190   liuqimichale   地磁
33
34
35
    },
    methods: {
      getList() {
adf82b69   liuqimichale   调取接口
36
37
38
39
40
41
42
        deviceAddress({
          orgIds: this.GLOBAL.paramsvariables
        }).then((response)=>{
          const data = response.data.data
          this.totalVal = data[1].num.toString()
          this.diciList = data[1].dicList
        })
667dd190   liuqimichale   地磁
43
44
45
46
47
48
49
50
51
      },
    }
  }
  </script>
  
  <style lang="scss"  scoped>
    @mixin textStyle($color){
      padding-right: 23px;
      text-align: left;
66faa378   liuqimichale   道闸 诱导屏
52
      font-size: 12px;
667dd190   liuqimichale   地磁
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
      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   道闸 诱导屏
69
      width: 80px;
667dd190   liuqimichale   地磁
70
71
      padding-left: 23px;
      text-align: left;
66faa378   liuqimichale   道闸 诱导屏
72
      font-size: 14px;
667dd190   liuqimichale   地磁
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
      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>