add
yirongjin
2025-07-23 4a7f6e608d9e16d5f508829f53a001684467a99f
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
<template>
  <!-- 任务节拍 -->
  <div id="Taskbeat" class="global-content backgroundrgb">
    <div class="width80 height margin-auto overflow">
      <div class="width margintopbot flex align-center justify-end">
        <label class="colorfff fontsiez1rem">查询日期:</label>
        <el-date-picker
          class="margin-right"
          size="mini"
          value-format="yyyy-MM-dd"
          v-model="pickertime"
          type="date"
          placeholder="选择日期"
        >
        </el-date-picker>
        <el-button class="margin-right" type="primary" size="mini" @click="inquer">查询</el-button>
      </div>
      <div class="width height-calc90 overflow margin-top2">
        <task-echart class="width height" colors="#fff" :chartData="chartData" :colorList="colorList" :yTotals="yMax" />
        <!-- <div class="width height" ref="taskbeatEcharts"></div> -->
      </div>
    </div>
  </div>
</template>
 
<script>
import { GetTaskBeatAnalysis } from '@/api/reportforms';
import { GetDateStr } from '@/utils/date';
import TaskEchart from '@/views/Home/components/meterEchart.vue';
export default {
  data() {
    return {
      pickertime: GetDateStr(-1),
      chartData: {},
            yMax:-1,
      colorList: ['#0090FF', '#36CE9E', '#FFC005', '#FF515A', '#8B5CFF', '#00CA69']
    };
  },
  components: { TaskEchart },
  computed: {},
  mounted() {
    this.GetTaskBeatAnalysis();
  },
  methods: {
    inquer() {
      this.GetTaskBeatAnalysis();
    },
 
    GetTaskBeatAnalysis() {
      GetTaskBeatAnalysis({ startTime: this.pickertime }).then(res => {
                this.yMax = res.maxNum
                let stepTotal = 0;
                res.data[1].xdata = res.data[1].xdata.map((mapObj,mapIndex)=>{
                    stepTotal = stepTotal + Number(mapObj);
                    let rateVal = (this.yMax>0?Number((stepTotal/this.yMax*100).toFixed(2)):0)
                    res.data[0].xdata[mapIndex] = rateVal
                    return mapObj
                })
        this.chartData = res;
      });
    }
  }
};
</script>
 
<style lang="scss" scoped>
#Taskbeat {
}
</style>