he wei
5 天以前 3c3576d5792bfabcef84979757ee344712e71cd3
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
<script setup name="temp">
import { ref, reactive, computed, watch, nextTick, onMounted } from "vue";
import info from '@/components/info.vue';
import bar from '@/components/echarts/bar5.vue';
 
const props = defineProps({
  data: {
    type: Object,
    default: {},
  },
});
 
const chart0 = ref(null);
 
watch(
  () => props.data,
  () => {
    nextTick(() => {
      updateRt();
    });
  },
  { immediate: true, deep: true }
);
 
const list = computed(() => {
  let res = [];
  let rt = props.data.rtdataList;
  if (rt && rt.length) {
    res = rt.map((v) => `${v.monNum}#`);
  }
  return res;
});
 
const chartData = computed(() => {
  let res = [];
  let rt = props.data.rtdataList;
  if (rt && rt.length) {
    res = rt.map((v) => v.monTmp);
  }
  return res;
});
 
function updateRt() {
  
  if(chart0.value) {
    chart0.value.updateChart(list.value, chartData.value);
  }
}
 
 
onMounted(() => {
 
});
</script>
 
<template>
  <div class="tab-content">
    <div class="p-left">
      <card title="单体温度">
        <div class="wrap">
          <div class="row">
            <div class="item">
              <info label="最大值" :value="data.maxData"></info>
            </div>
            <div class="item">
              <info label="最小值" :value="data.minData"></info>
            </div>
            <div class="item">
              <info label="平均值" :value="data.avgData"></info>
            </div>
          </div>
          <div class="main">
            <bar ref="chart0"></bar>
          </div>
        </div>
      </card>
    </div>
    <div class="p-right">
      <div class="btn">季度曲线记录</div>
    </div>
  </div>
</template>
 
<style scoped lang="less">
.tab-content {
  display: flex;
  flex-direction: row;
  height: 100%;
  padding: 10px;
 
  .p-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-right: 10px;
 
    .wrap {
      display: flex;
      flex-direction: column;
      height: 100%;
      .row {
        display: flex;
        flex-direction: row;
        justify-content: center;
        .item {
          min-width: 170px;
          &~.item {
            margin-left: 20px;
          }
        }
      }
      .main {
        flex: 1;
      }
    }
  }
  .p-right {
    .btn {
      font-size: 14px;
      margin: 2px 4px;
      cursor: pointer;
      border: 1px solid #3D9CC9;
      box-shadow: inset 0 0 10px 4px #3D9CC9;
      padding: 6px 12px;
      text-align: center;
      border-radius: 4px;
 
      &:hover {
        color: #FDFE01;
        border: 1px solid #DF7B26;
        box-shadow: inset 0 0 10px 4px #DF7B26;
      }
    }
  }
 
}
</style>