riku
2025-07-23 3daf8eebf8c0d5b4561f38e21c50818c8f6768b7
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
<template>
  <el-row justify="start" class="wrap">
    <!-- <el-space direction="vertical" :size="0">
      <el-icon size="30"><Stopwatch /></el-icon>
      <el-text class="speed-text">SPD</el-text>
    </el-space>
    <div>
      <el-text class="speed-number">{{ speed }}</el-text>
      <el-text class="speed-unit"><sub>km/h</sub></el-text>
    </div> -->
    <FactorIconText
      elIcon="Odometer"
      label="SPD"
      :value="speed"
      unit="km/h"
    ></FactorIconText>
    <!-- <el-form :inline="true">
      <el-form-item label="车速:" class="tag-2">
        {{ speed }}km/h
      </el-form-item>
    </el-form> -->
    <!-- <GaugeChart name="车速" :value="speed"></GaugeChart> -->
  </el-row>
</template>
<script>
import { FactorDatas } from '@/model/FactorDatas';
 
export default {
  props: {
    loading: Boolean,
    factorDatas: FactorDatas,
    speed: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      // speed: 0
    };
  },
  watch: {
    factorDatas: {
      handler(nV) {
        // this.speed = this.lastOne(nV, '14');
      },
      deep: true
    }
  },
  methods: {
    lastOne(factorDatas, key) {
      const f = factorDatas.factor[key];
      if (f) {
        const lastIndex = f.datas.length - 1;
        return factorDatas.factor[key].datas[lastIndex].factorData;
      } else {
        return 0;
      }
    }
  }
};
</script>
<style scoped>
.wrap {
  /* flex-direction: column; */
  /* background-color: antiquewhite; */
}
</style>