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
<template>
  <div class="order-complete-radio">
    <div class="title-bg-view">
      <ChartTitle name="订单完成比率"></ChartTitle>
    </div>
    <div class="list-view">
      <template v-for="item in tableList">
        <div class="table-bg-view">
          <div class="left">{{ item.title }}</div>
          <div class="middle" ref="middle">
            <el-progress
              :stroke-width="20"
              :text-inside="true"
              :percentage="item.radio"
              :define-back-color="'#083f55'"
              :text-color="'#fec718'"
              :class="
                item.radio < 90
                  ? 'setTitle-right'
                  : item.radio == 100
                  ? 'setTitle-complete'
                  : 'setTitle-left'
              "
            ></el-progress>
          </div>
        </div>
      </template>
    </div>
  </div>
</template>
 
<script>
import ChartTitle from "@/views/cockpitPage/components/ChartTitle.vue";
export default {
  components: {
    ChartTitle,
  },
  props: {
    orderCompleteObject: {
      type: Object,
      default: () => {
        return {
          startIndex: 0,
          orderCompleteList: [],
        };
      },
    },
  },
  data() {
    return {
      startIndex: 0,
      time: 0,
    };
  },
  mounted() {
    setInterval(() => {
      this.startIndex += 4;
    }, 5000);
  },
  computed: {
    tableList: {
      get() {
        if (
          this.startIndex > this.orderCompleteObject.orderCompleteList.length
        ) {
          this.startIndex = 0;
        }
        return this.orderCompleteObject.orderCompleteList.slice(
          this.startIndex,
          this.startIndex + 4
        );
      },
    },
  },
  watch: {
    "orderCompleteObject.orderCompleteList"(val) {
      this.startIndex = this.orderCompleteObject.startIndex;
    },
  },
  methods: {},
};
</script>
 
<style scoped lang="scss">
.order-complete-radio {
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  margin-top: 10px;
  .title-bg-view {
    width: calc(100% - 20px);
  }
  .list-view {
    height: calc(100% - 20px);
    .table-bg-view {
      display: flex;
      align-items: center;
      margin-bottom: 10px;
      background: #083f55;
      height: calc(20% - 10px);
      width: 100%;
      border-radius: 50px;
      transition: all 1s ease-in-out 0s;
      .left {
        width: 23%;
        margin: 0 10px;
        color: #02f1fc;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .middle {
        flex: 1;
        margin-right: 5px;
      }
    }
  }
}
::v-deep {
  .el-progress-bar__outer,
  .el-progress-bar__inner {
    border-radius: inherit;
  }
  .el-progress-bar__inner {
    position: relative;
    // background: #552d08;
    background: url("../../../../public/cockpitPage/order-bg.png") no-repeat
      center center / cover;
  }
  .setTitle-complete .el-progress-bar__inner {
    position: relative;
    // background: #552d08;
    background: url("../../../../public/cockpitPage/order-complete.png")
      no-repeat center center / cover;
  }
  .setTitle-right .el-progress-bar__innerText {
    position: absolute;
    top: 2px;
    right: -66px;
    text-align: left;
    font-size: 18px;
    width: 60px;
  }
  .setTitle-left .el-progress-bar__innerText {
    color: #fffb00 !important;
    font-size: 18px;
    width: 60px;
  }
  .setTitle-complete .el-progress-bar__innerText {
    color: #fff !important;
    font-size: 16px;
    width: 60px;
  }
}
</style>