riku
2025-07-08 91513e171078ed6b0887f87b9fced33895d6d3fb
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<template>
  <!-- <BaseCard> -->
  <el-row> 巡查汇总 </el-row>
  <el-segmented v-model="value" :options="options" block />
  <div><el-text tag="i"> 评估 </el-text></div>
  <el-row justify="space-evenly">
    <div>
      <el-statistic title="总计" :value="10"> </el-statistic>
      <div class="statistic-footer">
        <div class="footer-item">
          <span>对比昨日</span>
          <span class="green">
            24%
            <el-icon>
              <CaretTop />
            </el-icon>
          </span>
        </div>
      </div>
    </div>
    <el-statistic title="高风险" :value="2" :value-style="styleRed"> </el-statistic>
    <el-statistic title="中风险" :value="6" :value-style="styleYellow"> </el-statistic>
    <el-statistic title="低风险" :value="2" :value-style="styleGreen"> </el-statistic>
  </el-row>
  <div><el-text tag="i"> 复核 </el-text></div>
  <el-row justify="space-evenly">
    <div>
      <el-statistic title="需复核" :value="2"> </el-statistic>
      <div class="statistic-footer">
        <div class="footer-item">
          <span>对比昨日</span>
          <span class="green">
            24%
            <el-icon>
              <CaretTop />
            </el-icon>
          </span>
        </div>
      </div>
    </div>
    <el-statistic title="已完成" :value="2" :value-style="styleGreen"> </el-statistic>
  </el-row>
  <div><el-text tag="i"> 问题 </el-text></div>
  <el-row justify="space-evenly">
    <div>
      <el-statistic title="总计" :value="10"> </el-statistic>
      <div class="statistic-footer">
        <div class="footer-item">
          <span>对比昨日</span>
          <span class="green">
            24%
            <el-icon>
              <CaretTop />
            </el-icon>
          </span>
        </div>
      </div>
    </div>
    <el-statistic title="待审核" :value="2" :value-style="styleRed"> </el-statistic>
    <el-statistic title="已审核" :value="6" :value-style="styleYellow"> </el-statistic>
    <el-statistic title="待整改" :value="2" :value-style="styleGreen"> </el-statistic>
    <el-statistic title="已整改" :value="2" :value-style="styleGreen"> </el-statistic>
    <el-statistic title="待确认" :value="2" :value-style="styleGreen"> </el-statistic>
  </el-row>
  <!-- </BaseCard> -->
</template>
 
<script setup>
import { ref, onMounted } from 'vue'
import dayjs from 'dayjs'
import taskApi from '@/api/fysp/taskApi.js'
 
const props = defineProps({
  height: String
})
 
const emits = defineEmits(['update:height'])
 
const value = '今日汇总'
const options = ['今日汇总', '周度汇总', '月度汇总', '季度汇总', '年度汇总']
const styleRed = 'color:var(--el-color-danger);'
const styleYellow = 'color:var(--el-color-warning);'
const styleGreen = 'color:var(--el-color-success);'
 
const subtaskToday = ref([])
const subtaskWeek = ref([])
const subtaskMonth = ref([])
 
function getParams(type) {
  const d = dayjs()
  return {
    starttime: d.startOf(type).format('YYYY-MM-DD HH:mm:ss'),
    endtime: d.endOf(type).format('YYYY-MM-DD HH:mm:ss')
  }
}
 
function fetchSubtaskToday() {
  const area = getParams('day')
 
  taskApi.fetchSubtaskSummaryByArea(area).then((res) => {
    subtaskToday.value = res.data
  })
}
 
function fetchSubtaskThisWeek() {
  const area = getParams('week')
 
  taskApi.fetchSubtaskSummaryByArea(area).then((res) => {
    subtaskWeek.value = res.data
  })
}
 
function fetchSubtaskThisMonth() {
  const area = getParams('month')
 
  taskApi.fetchSubtaskSummaryByArea(area).then((res) => {
    subtaskMonth.value = res.data
  })
}
 
onMounted(() => {
  // fetchSubtaskToday()
  // fetchSubtaskThisWeek()
  fetchSubtaskThisMonth()
})
</script>
 
<style scoped>
/* .el-segmented {
  --el-segmented-item-selected-color: var(--el-text-color-primary);
  --el-segmented-item-selected-bg-color: #ffd100;
  --el-border-radius-base: 16px;
} */
 
.el-statistic {
  --el-statistic-content-font-size: var(--el-font-size-base);
  /* background-color: aliceblue; */
}
 
.statistic-footer {
  background-color: #ffd100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--el-text-color-regular);
  /* margin-top: 16px; */
}
 
.statistic-footer .footer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
 
.statistic-footer .footer-item span:last-child {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}
 
.green {
  color: var(--el-color-success);
}
.red {
  color: var(--el-color-error);
}
</style>