This commit is contained in:
熊成强 2020-10-27 17:22:46 +08:00
commit a5a2d9b78a
4 changed files with 216 additions and 97 deletions

View File

@ -4,8 +4,8 @@ import requestFuc from '@/utils/request'
export function getChartData (query) {
return requestFuc({
url: '/lz_management/performance/chart/result',
method: 'POST',
data: query
method: 'get',
params: query
})
}

View File

@ -0,0 +1,40 @@
<!-- -->
<template>
<div>
<div>返回</div>
<span></span>
<div>等级分布详情<div>
</div>
<div>
<el-cascader></el-cascader>
<el-table :data="tableData"
border
:header-cell-style="{ background:'#F5F7FA'}">
<el-table-column></el-table-column>
<el-table-column></el-table-column>
<el-table-column></el-table-column>
<el-table-column><el-table-column>
</el-table>
</div>
</template>
<script>
export default {
data () {
return {
}
},
computed: {},
beforeMount () {},
mounted () {},
methods: {},
watch: {}
}
</script>
<style lang='' scoped>
</style>

View File

@ -1,41 +1,42 @@
<!-- -->
<template>
<div class="block">
<el-cascader :props="props" :options="timeOptions"></el-cascader>
<el-cascader :props="props" :options="timeOptions" @change="handleChange">
</el-cascader>
<div class="report_content">
<div class="header">
<div>
<div>7</div>
<div>参与人数</div>
<div>{{statisticals[0].num}}</div>
<div>{{statisticals[0].desc}}</div>
</div>
<span></span>
<div>
<div>7</div>
<div>目标定制</div>
<div>{{statisticals[1].num}}</div>
<div>{{statisticals[1].desc}}</div>
</div>
<div>
<div>1</div>
<div>目标确认</div>
<div>{{statisticals[2].num}}</div>
<div>{{statisticals[2].desc}}</div>
</div>
<div>
<div>7</div>
<div>执行中</div>
<div>{{statisticals[3].num}}</div>
<div>{{statisticals[3].desc}}</div>
</div>
<div>
<div>7</div>
<div>结果值录入</div>
<div>{{statisticals[4].num}}</div>
<div>{{statisticals[4].desc}}</div>
</div>
<div>
<div>7</div>
<div>评分</div>
<div>{{statisticals[4].num}}</div>
<div>{{statisticals[4].desc}}</div>
</div>
<div>
<div>7</div>
<div>考核结束</div>
<div>{{statisticals[4].num}}</div>
<div>{{statisticals[4].desc}}</div>
</div>
</div>
<div>
<div>考核人数分析</div>
<div class="num_title">考核人数分析</div>
<div class="num_tips">
<div>考核人数分析</div>
<div>参与考核部门人数</div>
@ -43,28 +44,26 @@
<div class="num_report">
<div id="num_chart"></div>
<ul>
<li v-for="(dep, index) in deps" :key="dep.id">
<div
:class="{
width: '20px',
height: '20px',
background: handleliColor(index)
}"
>
{{ index }}
</div>
<div>{{ dep.title }} {{ dep.num }}</div>
<li v-for="(assessItem, index) in assessNum" :key="assessItem.desc">
<div class="rep_list">
<div :class="handleliColor(index)">{{ index }}
</div>
<div>{{ assessItem.title }} {{ assessItem.num }}</div>
</div>
</li>
</ul>
</div>
<div>结果分析</div>
<div>等级分布</div>
<div class="level_title">结果分析</div>
<div class="level_tips">等级分布</div>
<div class="reslut_display">
<div id="level_chart"></div>
<el-table :data="tableData" style="display: inline-block;">
<el-table-column prop="level" label="绩效等级" width="200">
<el-table :data="tableData"
:header-cell-style="{ background:'#F5F7FA'}"
border
style="flex:1">
<el-table-column prop="desc" label="绩效等级" width="200">
</el-table-column>
<el-table-column prop="layout" label="实际分布" width="200">
<el-table-column prop="num" label="实际分布" width="200">
</el-table-column>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
@ -89,17 +88,32 @@
<script>
//
import { getChartData, getStartsData } from '@/api/report'
let echarts = require('echarts/lib/echarts')
// ECharts
var echarts = require('echarts/lib/echarts')
//
require('echarts/lib/chart/bar')
//
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
export default {
data () {
return {
//
pickerTime: '',
//
statisticals: [
{num: '0', desc: '参与人数'},
{num: '0', desc: '目标制定'},
{num: '0', desc: '目标确认'},
{num: '0', desc: '执行中'},
{num: '0', desc: '结果值录入'},
{num: '0', desc: '评分'},
{num: '0', desc: '考核结束'}],
//
tableData: [],
//
deps: [],
//
assessNum: [],
//
value: [],
timeOptions: [{
@ -115,22 +129,17 @@ export default {
props: {
lazy: true,
lazyLoad: (node, resolve) => {
const { level } = node
let type = node.data.val
console.log(this)
console.log('aaaa')
//
let type = node.data.value
// 2
this.handleStartsReq(type, function (reslut) {
console.log('aaaaaaa')
if (reslut.data.code === 200) {
const childNode = Array.from(reslut.data.list).map(item => ({
value: item.desc,
lable: item.num,
leaf: level >= 2
}))
resolve(childNode)
} else {
const childNode = []
resolve(childNode)
}
const childNode = Array.from(reslut.list).map(item => ({
value: item.startId,
label: item.time,
leaf: true
}))
resolve(childNode)
})
}
},
@ -172,7 +181,7 @@ export default {
}
]
},
//
//
levelOption: {
color: ['#3398DB'],
tooltip: {
@ -203,7 +212,7 @@ export default {
],
series: [
{
name: '',
name: '直接访问',
type: 'bar',
barWidth: '60%',
data: []
@ -213,25 +222,36 @@ export default {
}
},
computed: {
//
handleliColor (pos) {
switch (pos) {
case 0:
return '#ff7705'
case 1:
return '#ff8b22'
case 2:
return '#ff9e45'
default:
return '#bcbcbc'
}
}
},
beforeMount () { },
mounted () {
this.handleChartDataReq()
this.handleLevelChart()
},
methods: {
//
handleliColor (val) {
let color
switch (val) {
case 0:
color = '#ff7705'
break
case 1:
color = '#ff8b22'
break
case 2:
color = '#ff9e45'
break
default:
color = '#bcbcbc'
break
}
return {
width: '20px',
height: '20px',
background: color
}
},
//
handleDetailClick (index, rows) {
@ -252,11 +272,41 @@ export default {
let levelChart = echarts.init(document.getElementById('level_chart'))
levelChart.setOption(this.levelOption)
},
//
handleChartDataReq () {
getChartData()
//
handleChange (val) {
console.log(val)
this.handleChartDataReq(val[1])
},
//
async handleChartDataReq (startId) {
let params = {
startId: startId
}
try {
const result = await getChartData(params)
result.forEach((val, index) => {
console.log(val)
if (val.type === 0) {
//
this.statisticals = val.statisticals
} else if (val.type === 1) {
//
this.tableData = val.statisticals
this.levelOption.series[0].data = Array.from(this.tableData).map(item => (item.num))
this.levelOption.xAxis[0].data = Array.from(this.tableData).map(item => (item.desc))
this.handleLevelChart()
} else if (val.type === 2) {
//
this.assessNum = val.statisticals
this.option.series[0].data = Array.from(this.assessNum).map(item => (item.num))
this.option.xAxis[0].data = Array.from(this.assessNum).map(item => (item.desc))
this.handleNumChart()
}
})
} catch (error) {
console.log(error)
}
},
// 999
async handleStartsReq (type, handleNode) {
let params = {
@ -283,12 +333,34 @@ export default {
height: fit-content;
background: white;
border-style: #fcfcfc solid 3px;
margin-top: 20px;
margin-top:20px;
padding-top:40px;
padding-left: 20px;
padding-right: 20px;
}
.header {
background: #fcfcfc;
width: fit-content;
}
.header > div {
display: inline-block;
width: fit-content;
height: fit-content;
padding-top: 20px;
padding-bottom: 20px;
padding-left: 30px;
padding-right: 30px;
text-align: center;
}
.header > div > div:nth-child(1) {
color: black;
font-weight: bold;
font-size: 20px;
}
.header > div > div:nth-child(2) {
color: #3a3a3a;
font-size: 14px;
}
.header > span {
display: inline-block;
background: #333333;
@ -296,25 +368,14 @@ export default {
width: 1px;
margin-top: 20px;
}
.header > div {
display: inline-block;
width: 200px;
height: 100px;
text-align: center;
}
.header > div > div:nth-child(1) {
color: black;
font-weight: bold;
margin-top: 30px;
size: 20px;
}
.header > div > div:nth-child(2) {
color: #999999;
font-size: 10px;
.num_title{
margin-top:20px;
margin-bottom: 25px;
color: #333333;
}
.num_tips > div:nth-child(1) {
display: inline-block;
color: #333333;
color: #3a3a3a;
font-size: 14px;
width: fit-content;
padding-left: 20px;
@ -322,12 +383,30 @@ export default {
}
.num_tips > div:nth-child(2) {
display: inline-block;
color: #333333;
color: #3a3a3a;
font-size: 14px;
width: fit-content;
padding-left: 50%;
position: relative;
}
.level_title{
margin-top:20px;
margin-bottom: 25px;
color: #333333;
}
.level_tips{
color: #3a3a3a;
font-size: 14px;
width: fit-content;
padding-left: 20px;
position: relative;
}
.num_report{
display: flex
}
.rep_list{
display: flex;
}
#num_chart {
display: inline-block;
width: 600px;
@ -337,7 +416,6 @@ export default {
display: flex;
}
#level_chart {
display: inline-block;
width: 600px;
height: 360px;
flex: 1;

View File

@ -291,9 +291,10 @@ export default {
}
apiInitiateAssessmentInfo(para).then(res => {
this.dialogSendVisible = false
// this.$router.push({ name: 'assessment' })
console.log('发起考核成功', res)
this.$router.push({name: 'assessment-stepList', query: {id: res.data.id, name: 'assessment-homeList'}})
this.$message({
message: '发起考核成功',
message: res.msg,
type: 'success'
})
})
@ -328,10 +329,10 @@ export default {
name: this.rqAssessmentParameter.searchName
}
getWorkList(para).then(res => {
this.rqAssessmentParameter.totalPage = res.totalPage
this.rqAssessmentParameter.totalCount = res.totalCount
this.currPage = res.currPage
this.popupData.tableList = res.list
this.rqAssessmentParameter.totalPage = res.data.totalPage
this.rqAssessmentParameter.totalCount = res.data.totalCount
this.currPage = res.data.currPage
this.popupData.tableList = res.data.list
})
}
}