增加项目成本页面

This commit is contained in:
砂糖
2025-10-14 13:58:33 +08:00
parent d0520e7872
commit de492664c3
10 changed files with 715 additions and 297 deletions

View File

@@ -14,10 +14,16 @@
},
data() {
return {
chartData: {},
chartData: {
series: []
},
chartOpts: {
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
padding: [5, 5, 5, 5],
legend: {
show: false
},
dataLabel: false, // 不显示数据标签
enableScroll: false,
extra: {
pie: {
@@ -37,20 +43,29 @@
projectList: {
handler(newVal) {
const pieData = this.projectList
// .filter(p => p.totalPrice > 0)
.filter(p => {
// 过滤 totalPrice 非数字/小于等于0的项
const price = Number(p.totalPrice);
return !isNaN(price) && price > 0;
})
.map(p => ({
name: p.projectName,
value: p.totalPrice,
value: parseInt(p.totalPrice)
}));
this.chartData = {
// this.chartData = {
// series: [{
// data: pieData
// }]
// }
let res = {
series: [{
data: pieData
}]
}
};
this.chartData = JSON.parse(JSON.stringify(res));
},
immediate: true,
},
}
}
</script>