Commit 578f34d8 authored by 高滢's avatar 高滢

feat(首页): 任务情况统计

parent b38c909d
......@@ -28,3 +28,11 @@ export function selectAverageInspectionRate(){
method: 'post'
})
}
export function selectTaskParticipationStatistics(){
return request({
url: '/home/statistics/taskParticipation',
method: 'post'
})
}
......@@ -269,29 +269,38 @@
<el-row>
<el-col :span="24">
<div class="cardStyle" style="height: 500px">
<div class="cardTitle">参与任务情况</div>
<div
style="
display: flex;
flex-wrap: wrap;
justify-content: space-between;
"
>
<div
v-for="(item, index) in taskCompleted"
<el-carousel height="460px" :autoplay="false">
<el-carousel-item
v-for="(item, index) in taskCompletedGroup"
:key="index"
style="width: calc(50% - 30px); margin-bottom: 30px"
>
<div style="margin-bottom: 10px">{{ item.name }}</div>
<el-progress
:percentage="item.value"
color="#1A6FD7"
show-text="true"
:stroke-width="15"
:format="format"
></el-progress>
</div>
</div>
<div class="cardTitle">参与任务情况</div>
<div
style="
display: flex;
flex-wrap: wrap;
justify-content: space-between;
"
>
<div
v-for="(itemChiid, indexChild) in item"
:key="indexChild"
style="width: calc(50% - 30px); margin-bottom: 30px"
>
<div style="margin-bottom: 10px">
{{ itemChiid.userName }}
</div>
<el-progress
:percentage="itemChiid.taskNum"
color="#1A6FD7"
show-text="true"
:stroke-width="15"
:format="format"
></el-progress>
</div>
</div>
</el-carousel-item>
</el-carousel>
</div>
</el-col>
</el-row>
......@@ -307,7 +316,8 @@ import UseCaseTest from './echartHome/useCaseTest.vue'
import AverageTest from './echartHome/averageTest.vue'
import {
selectAverageInspectionRate,
selectQuantityStatistics
selectQuantityStatistics,
selectTaskParticipationStatistics
} from '../api/system/home'
import { getDicts } from '../api/system/dict/data'
......@@ -342,25 +352,29 @@ export default {
}
],
averageInspectionRate: [],
taskCompleted: [
{ name: '张晓刚', value: 90 },
{ name: '王小虎', value: 90 },
{ name: '刘生', value: 90 },
{ name: '李丽', value: 90 },
{ name: '赵明明', value: 90 },
{ name: '张晓刚', value: 90 },
{ name: '王小虎', value: 90 },
{ name: '刘生', value: 90 },
{ name: '李丽', value: 90 },
{ name: '赵明明', value: 90 }
]
taskCompleted: [],
taskCompletedGroup: []
}
},
created() {
this.getQuantityStatistics()
this.getAverageInspectionRate()
this.getTaskCompleted()
},
methods: {
getTaskCompleted() {
selectTaskParticipationStatistics().then(res => {
this.taskCompleted = res.data
if (this.taskCompleted.length > 0) {
var chunkedArray = []
const groupSize = 10
for (var i = 0; i < this.taskCompleted.length; i += groupSize) {
chunkedArray.push(this.taskCompleted.slice(i, i + groupSize))
}
this.taskCompletedGroup = chunkedArray
}
})
},
getAverageInspectionRate() {
selectAverageInspectionRate().then(res => {
this.averageInspectionRate = res.data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment