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

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

parent b38c909d
...@@ -28,3 +28,11 @@ export function selectAverageInspectionRate(){ ...@@ -28,3 +28,11 @@ export function selectAverageInspectionRate(){
method: 'post' method: 'post'
}) })
} }
export function selectTaskParticipationStatistics(){
return request({
url: '/home/statistics/taskParticipation',
method: 'post'
})
}
...@@ -269,29 +269,38 @@ ...@@ -269,29 +269,38 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<div class="cardStyle" style="height: 500px"> <div class="cardStyle" style="height: 500px">
<div class="cardTitle">参与任务情况</div> <el-carousel height="460px" :autoplay="false">
<div <el-carousel-item
style=" v-for="(item, index) in taskCompletedGroup"
display: flex;
flex-wrap: wrap;
justify-content: space-between;
"
>
<div
v-for="(item, index) in taskCompleted"
:key="index" :key="index"
style="width: calc(50% - 30px); margin-bottom: 30px"
> >
<div style="margin-bottom: 10px">{{ item.name }}</div> <div class="cardTitle">参与任务情况</div>
<el-progress <div
:percentage="item.value" style="
color="#1A6FD7" display: flex;
show-text="true" flex-wrap: wrap;
:stroke-width="15" justify-content: space-between;
:format="format" "
></el-progress> >
</div> <div
</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> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -307,7 +316,8 @@ import UseCaseTest from './echartHome/useCaseTest.vue' ...@@ -307,7 +316,8 @@ import UseCaseTest from './echartHome/useCaseTest.vue'
import AverageTest from './echartHome/averageTest.vue' import AverageTest from './echartHome/averageTest.vue'
import { import {
selectAverageInspectionRate, selectAverageInspectionRate,
selectQuantityStatistics selectQuantityStatistics,
selectTaskParticipationStatistics
} from '../api/system/home' } from '../api/system/home'
import { getDicts } from '../api/system/dict/data' import { getDicts } from '../api/system/dict/data'
...@@ -342,25 +352,29 @@ export default { ...@@ -342,25 +352,29 @@ export default {
} }
], ],
averageInspectionRate: [], averageInspectionRate: [],
taskCompleted: [ taskCompleted: [],
{ name: '张晓刚', value: 90 }, taskCompletedGroup: []
{ 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 }
]
} }
}, },
created() { created() {
this.getQuantityStatistics() this.getQuantityStatistics()
this.getAverageInspectionRate() this.getAverageInspectionRate()
this.getTaskCompleted()
}, },
methods: { 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() { getAverageInspectionRate() {
selectAverageInspectionRate().then(res => { selectAverageInspectionRate().then(res => {
this.averageInspectionRate = res.data 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