部分修改

master
lion 5 months ago
parent bb46171f83
commit 352f85d099

@ -1,12 +1,12 @@
<template>
<div :class="className" :style="{ height: height, width: width }" ref="chartContainer" />
</template>
</template>
<script>
import * as echarts from 'echarts'
import resize from '@/mixins/resize'
<script>
import * as echarts from 'echarts'
import resize from '@/mixins/resize'
export default {
export default {
mixins: [resize],
props: {
className: {
@ -110,9 +110,10 @@ export default {
},
series: [{
type: 'pie',
radius: ['50%', '70%'],
center: ['50%', '40%'], //
radius: ['40%', '65%'],
center: ['50%', '45%'],
avoidLabelOverlap: false,
minShowLabelAngle: 10,
itemStyle: {
borderRadius: 6,
borderColor: '#fff',
@ -120,22 +121,21 @@ export default {
},
label: {
show: true,
position: 'center',
formatter: () => `已用\n{value|${this.formattedUsedAmount}}\n{percent|${this.formattedUsedPercent}%}`,
rich: {
value: {
fontSize: 14,
fontWeight: 'bold',
lineHeight: 30
},
percent: {
position: 'outside',
fontSize: 12,
color: '#666'
}
color: '#333',
formatter: params => {
//
if (params.value === 0) return '';
const percent = this.totalAmount > 0 ? ((params.value / this.totalAmount) * 100).toFixed(2) : '0.00';
return `${params.name}\n${percent}%`;
}
},
labelLine: {
show: false
show: true,
length: 8,
length2: 5,
smooth: true
},
data: [
{
@ -158,38 +158,10 @@ export default {
this.chart.setOption(option)
},
bindEvents() {
//
this.chart.on('mouseover', params => {
if (params.data.name === '剩余金额') {
this.showRemaining = true
this.chart.setOption({
series: [{
label: {
formatter: () => `剩余\n{value|${this.formattedRemainingAmount}}\n{percent|${this.formattedRemainingPercent}%}`
}
}]
})
}
})
//
this.chart.on('mouseout', params => {
if (params.data.name === '剩余金额') {
this.showRemaining = false
this.chart.setOption({
series: [{
label: {
formatter: () => `已用\n{value|${this.formattedUsedAmount}}\n{percent|${this.formattedUsedPercent}%}`
}
}]
})
}
})
// bindEvents
}
}
}
</script>
</script>
<style scoped>
</style>
<style scoped>
</style>

@ -2,7 +2,7 @@
<div>
<el-drawer
size="1050px"
size="1250px"
title="预算统计"
:visible.sync="drawer"
direction="rtl">
@ -80,27 +80,7 @@ export default {
align: 'left',
fixed: this.$store.getters.device === 'mobile'?false:'left'
},
{
prop: 'type_detail.value',
label: '预算类型',
width: 120,
},
{
prop: 'year',
label: '所属年份',
width: 160
},
{
prop: 'plan_department.name',
label: "相关科室",
width: 180
},
{
prop: 'content',
label: '描述',
align: 'left',
minWidth: 300
},
{
prop: 'money',
width: 180,
@ -138,6 +118,27 @@ export default {
return ( <div><el-progress percentage={perShow}> </el-progress></div>)
}
},
{
prop: 'type_detail.value',
label: '预算类型',
width: 120,
},
{
prop: 'year',
label: '所属年份',
width: 160
},
{
prop: 'plan_department.name',
label: "相关科室",
width: 180
},
{
prop: 'content',
label: '描述',
align: 'left',
minWidth: 300
},
]
}
},
@ -168,7 +169,7 @@ export default {
this.list =
mergeTableRow({
data: res.list.data,
mergeColNames: ["pid_info_name",'selection','index'], //
mergeColNames: ["pid_info_name",'index'], //
firstMergeColNames: ["pid_info_name"], // firstMerge
firstMerge: 'pid_info_name' //
})
@ -177,24 +178,24 @@ export default {
},
selected (selections, selected) {
if (selected['pid_info_name-span']?.rowspan > 1) {
if (this.selections.find(i => i.id === selected.id)) {
let len = selected['pid_info_name-span'].rowspan
let idx = this.selections.indexOf(selected)
this.selections.splice(idx,len)
} else {
let len = selected['pid_info_name-span'].rowspan
let idx = this.list.indexOf(selected)
this.selections.push(...this.list.slice(idx,idx+len))
}
} else {
// if (selected['pid_info_name-span']?.rowspan > 1) {
// if (this.selections.find(i => i.id === selected.id)) {
// let len = selected['pid_info_name-span'].rowspan
// let idx = this.selections.indexOf(selected)
// this.selections.splice(idx,len)
// } else {
// let len = selected['pid_info_name-span'].rowspan
// let idx = this.list.indexOf(selected)
// this.selections.push(...this.list.slice(idx,idx+len))
// }
// } else {
if (this.selections.find(i => i.id === selected.id)) {
let idx = this.selections.indexOf(this.selections.find(i => i.id === selected.id))
this.selections.splice(idx,1)
} else {
this.selections.push(selected)
}
}
// }
},
selectAll (selections) {

@ -22,7 +22,7 @@
</el-tabs>
</div>
<div class="table-tree1" v-if="activeName==='todo'">
<el-table :data="list" border class="v-table" style="width: 100%; margin-bottom: 20px;height:220px">
<el-table :data="list" border class="v-table" style="width: 100%; margin-bottom: 20px;height:260px">
<el-table-column type="index" label="序号" align="center" />
<el-table-column prop="type" width="100" label="类型" align="center" :formatter="typeFormatter" />
<el-table-column prop="content" label="内容" align="left" show-overflow-tooltip />
@ -58,7 +58,7 @@
</div>
</div>
<div v-if="isShowNoPay && activeName==='todolist'">
<xy-table :cell-style="nopayCellStyle" :height="270" :list="nopay" :table-item="nopayTable">
<xy-table :cell-style="nopayCellStyle" :height="300" :list="nopay" :table-item="nopayTable">
<template v-slot:btns />
</xy-table>
</div>
@ -105,8 +105,8 @@
<div class="progress-card-item">
<MyProgress
ref="MyProgress"
width="145px"
height="145px"
width="300px"
height="165px"
title="执行率"
:chart-data="[{value:statistic.progress.use_money_total,name:'已用金额'},{value:statistic.progress.money_total_2 ? statistic.progress.money_total_2 : statistic.progress.money_total_1,name:'合计金额'}]"
/>
@ -145,7 +145,7 @@
</el-row>
<div v-for="(sitem, index) in typeList">
<template v-if="sitem[0]&&sitem[1]">
<el-col v-if="sitem[0]" :span="12">
<el-col v-if="sitem[0]" :span="12" style="padding-right:10px">
<el-card class="box-card">
<div slot="header" class="box-card-header">
<SvgIcon style="color: #2D8cF0;width: 24px;height: 24px;" icon-class="caidan" />
@ -178,15 +178,15 @@
<div class="progress-card-item">
<MyProgress
ref="MyProgress1"
width="145px"
height="145px"
width="300px"
height="165px"
title="执行率"
:chart-data="[{value:parseFloat(sitem[0].use_money_total),name:'已用金额'},{value:parseFloat(sitem[0].money_total_2) ? parseFloat(sitem[0].money_total_2) : parseFloat(sitem[0].money_total_1),name:'合计金额'}]"
/>
</div>
</div>
</div>
<xy-table :height="380" :list="sitem[0].departments" :table-item="departmentTable">
<xy-table :height="560" :list="sitem[0].departments" :table-item="departmentTable">
<template v-slot:btns>
<el-table-column :width="80" fixed="right" label="操作" header-align="center" align="center">
<template slot-scope="scope">
@ -201,7 +201,7 @@
</el-card>
</el-col>
<el-col v-if="sitem[1]" :span="12">
<el-col v-if="sitem[1]" :span="12" style="padding-left:10px">
<el-card class="box-card">
<div slot="header" class="box-card-header">
<SvgIcon style="color: #2D8cF0;width: 24px;height: 24px;" icon-class="caidan" />
@ -234,15 +234,15 @@
<div class="progress-card-item">
<MyProgress
ref="MyProgress2"
width="145px"
height="145px"
width="300px"
height="165px"
title="执行率"
:chart-data="[{value:parseFloat(sitem[1].use_money_total),name:'已用金额'},{value:parseFloat(sitem[1].money_total_2) ? parseFloat(sitem[1].money_total_2) : parseFloat(sitem[1].money_total_1),name:'合计金额'}]"
/>
</div>
</div>
</div>
<xy-table :height="380" :list="sitem[1].departments" :table-item="departmentTable">
<xy-table :height="280" :list="sitem[1].departments" :table-item="departmentTable">
<template v-slot:btns>
<el-table-column
:width="80"
@ -1337,6 +1337,7 @@ export default {
this.statistic.departmentList = res.departmentList?.sort((a, b) => a.plan_department.sortnumber - b.plan_department.sortnumber)
}
console.log("this.statistic.typeList",this.typeList)
// this.split = Array.from({ length: Math.ceil(this.typeList/2) },() => 0.5)
},
getPer(row) {
@ -1532,15 +1533,17 @@ export default {
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
height:280px;
height:310px;
margin-top:10px;
&-item {
min-width: 120px;
margin: 10px;
// margin: 10px;
margin-bottom: 10px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
flex-basis: 50%;
&__label {
font-size: 15px;
@ -1626,7 +1629,7 @@ export default {
.table-tree1 {
margin-top: 10px;
height:280px;
height:310px;
}
.v-text {

Loading…
Cancel
Save