bug修改

This commit is contained in:
sean yu 2020-10-29 17:05:55 +08:00
parent 211958792e
commit 0e0ef97164
2 changed files with 56 additions and 18 deletions

View File

@ -7,7 +7,11 @@
<div>等级分布详情</div>
</div>
<div class="detail_content">
<el-cascader :options="depList" @change="handleChange" style="margin-bottom:20px" ></el-cascader>
<el-cascader
:options="depList"
@change="handleChange"
style="margin-bottom:20px"
v-model="defaultOpt"></el-cascader>
<el-table :data="tableData"
border
:header-cell-style="{ background:'#F5F7FA'}"
@ -30,7 +34,12 @@ export default {
//
tableData: [],
//
depList: []
depList: [{
value: '',
label: '全部'
}],
//
defaultOpt: ['']
}
},
computed: {},
@ -66,8 +75,8 @@ export default {
type: 0
}
let result = await getDepList(params)
console.log(result)
this.depList = this.handleDepResult(result.data)
this.depList = this.depList.concat(this.handleDepResult(result.data))
console.log(this.depList)
},
//
handleDepResult (list) {

View File

@ -1,7 +1,12 @@
<!-- -->
<template>
<div class="block">
<el-cascader :props="props" :options="timeOptions" @change="handleChange">
<div class="report_index">
<el-cascader
:props="props"
:options="timeOptions"
@change="handleChange"
v-model="defaultStartId"
style="width:250px">
</el-cascader>
<div class="report_content">
<div class="header">
@ -66,7 +71,7 @@
<el-table :data="tableData"
:header-cell-style="{ background:'#F5F7FA'}"
border
style="flex-grow:2;margin-top:20px">
style="flex-grow:2;margin-top:20px;height:100%">
<el-table-column prop="desc" label="绩效等级">
</el-table-column>
<el-table-column prop="num" label="实际分布">
@ -105,7 +110,9 @@ export default {
return {
//
pickerTime: '',
//
//
defaultStartId: [],
// id
startId: '',
//
statisticals: [
@ -135,16 +142,15 @@ export default {
props: {
lazy: true,
lazyLoad: (node, resolve) => {
console.log('aaaa')
//
let type = node.data.value
// 2
this.handleStartsReq(type, function (reslut) {
const childNode = Array.from(reslut.list).map(item => ({
value: item.startId,
label: item.time,
leaf: true
label: item.time
}))
// console.log(childNode)
resolve(childNode)
})
}
@ -232,7 +238,6 @@ export default {
beforeMount () { },
mounted () {
this.handleChartDataReq()
this.handleLevelChart()
},
methods: {
//
@ -267,7 +272,6 @@ export default {
path: ('report-detial'),
query: {startId: this.startId, flowProcess: rows.desc}
})
console.log(this.$router)
},
// Y34(0)
handleChartYMul (val) {
@ -287,6 +291,7 @@ export default {
},
//
handleChange (val) {
console.log(val)
this.startId = val[1]
this.handleChartDataReq(val[1])
},
@ -297,8 +302,16 @@ export default {
}
try {
const result = await getChartData(params)
// startIdstartId
if (typeof startId === 'undefined') {
this.defaultStartId[0] = result.data[0].type
this.defaultStartId[1] = result.data[0].defaultId
this.startId = result.data[0].defaultId
this.defaultStartName = result.data[0].defaultTime
//
this.handleStartsReq(result.data[0].type)
}
result.data.forEach((val, index) => {
console.log(val)
if (val.type === 0) {
//
this.statisticals = val.statisticals
@ -313,7 +326,6 @@ export default {
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))
console.log(this.option.xAxis[0].data)
this.handleNumChart()
}
})
@ -330,7 +342,20 @@ export default {
}
try {
let res = await getStartsData(params)
handleNode(res.data)
if (typeof handleNode === 'undefined') {
let children = Array.from(res.data.list).map(item => ({
value: item.startId,
label: item.time,
leaf: true
}))
if (type === 0) {
this.timeOptions[0].children = children
} else {
this.timeOptions[1].children = children
}
} else {
handleNode(res.data)
}
} catch (error) {
console.log(error)
}
@ -341,6 +366,10 @@ export default {
</script>
<style lang='' scoped>
.report_index{
display: flex;
flex-direction: column;
}
.report_content {
background: white;
border: #fcfcfc solid 1px;
@ -385,8 +414,8 @@ export default {
.num_tips{
display: flex;
}
.num_chart {
flex-grow: 1;
.num_chart{
flex-grow: 1
}
.num_chart>:nth-child(1){
color: #3a3a3a;