修改禅道bug

This commit is contained in:
2026-03-11 15:59:57 +08:00
parent 4d3b2b13b8
commit 2a316f89c6
40 changed files with 104 additions and 99 deletions

View File

@@ -10,11 +10,11 @@ VUE_APP_TITLE = 洛玻集团驾驶舱
# VUE_APP_BASE_API = 'http://172.16.33.83:7070'
# 杨姗姗
VUE_APP_BASE_API = 'http://172.16.20.218:7070'
# VUE_APP_BASE_API = 'http://172.16.20.218:7070'
# 小田
# VUE_APP_BASE_API = 'http://172.16.19.232:7070'
# 测试
# VUE_APP_BASE_API = 'http://192.168.0.35:8080'
VUE_APP_BASE_API = 'http://192.168.0.35:8080'
# 路由懒加载

View File

@@ -84,7 +84,7 @@ export default {
return dataMap.map(itemInfo => {
const rawItem = rawData[itemInfo.key] || {};
const progress = Math.max(0, Math.round((rawItem.rate || 0)));
const progress = rawItem.rate || 0;
return {
unit: itemInfo.unit,

View File

@@ -89,7 +89,7 @@ export default {
unit: mappingItem.unit,
targetValue: indicatorData.target, // 目标值
currentValue: indicatorData.real, // 实际值
progress: indicatorData.rate ? Math.round(indicatorData.rate) : 0, // 完成率(百分比,四舍五入)
progress: indicatorData.rate || 0, // 完成率
path: mappingItem.path // 路由路径
};
});

View File

@@ -101,7 +101,7 @@ export default {
return dataMap.map(itemInfo => {
const rawItem = rawData[itemInfo.key] || {};
// 计算进度百分比确保不小于0
const progress = Math.max(0, Math.round((rawItem.rate || 0)));
const progress = rawItem.rate || 0;
return {
unit: itemInfo.unit,

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.rate || 0 }} </span>
<span class="precentNum">{{ detailData.rate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -84,10 +84,11 @@ export default {
// }
},
grid: {
top: 30,
bottom: 50,
right: 20,
left: 40,
top: 25,
bottom: 30,
right: 0,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -95,7 +95,7 @@ export default {
if (rate >= 100) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
if (real <= target) return 1;
// 其他情况 => 未达标
return 0;

View File

@@ -90,7 +90,7 @@ export default {
if (rate >= 100) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
if (real <= target) return 1;
// 其他情况 => 未达标
return 0;

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.completeRate || 0 }} </span>
<span class="precentNum">{{ detailData.completeRate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -83,11 +83,12 @@ export default {
// return html;
// }
},
grid: {
top: 30,
bottom: 60,
right: 30,
left: 50,
grid: {
top: 25,
bottom: 20,
right: 10,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -88,8 +88,8 @@ getRateFlag(rate, real, target) {
// 1. 完成率 >= 100 => 达标
if (rate >= 100) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
// 2. 实际小于等于目标) => 达标
if (real <= target) return 1;
// 其他情况 => 未达标
return 0;

View File

@@ -163,7 +163,7 @@ export default {
// const flags = flags || [];
const currentDiff = diff || 0;
const currentFlag = flags[0] || 0;
const currentFlag = data?.flags[0] || 0;
// const prefix = currentFlag === 1 ? '+' : '';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.rate || 0 }} </span>
<span class="precentNum">{{ detailData.rate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -83,11 +83,12 @@ export default {
// return html;
// }
},
grid: {
top: 30,
bottom: 60,
right: 30,
left: 50,
grid: {
top: 25,
bottom: 30,
right: 0,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.rate || 0 }} </span>
<span class="precentNum">{{ detailData.rate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -84,10 +84,11 @@ export default {
// }
},
grid: {
top: 30,
bottom: 60,
right: 30,
left: 50,
top: 25,
bottom: 30,
right: 0,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.completeRate || 0 }} </span>
<span class="precentNum">{{ detailData.completeRate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -83,11 +83,12 @@ export default {
// return html;
// }
},
grid: {
top: 30,
bottom: 60,
right: 30,
left: 50,
grid: {
top: 25,
bottom: 20,
right: 10,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.rate || 0 }} </span>
<span class="precentNum">{{ detailData.rate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -92,10 +92,11 @@ export default {
// }
},
grid: {
top: 20,
bottom: 60,
right: 20,
left: 40,
top: 25,
bottom: 30,
right: 0,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -23,6 +23,7 @@ export default {
chartD() {
// 背景图片路径(若不需要可注释)
// const bgImageUrl = require('@/assets/img/labelBg.png');
console.log('this.detailData', this.detailData);
const rate = this.detailData?.rate || 0
const diff = this.detailData?.diff || 0
console.log('diff', diff);

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.completeRate || 0 }} </span>
<span class="precentNum">{{ detailData.completeRate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -84,10 +84,11 @@ export default {
// }
},
grid: {
top: 30,
bottom: 60,
right: 20,
left: 40,
top: 25,
bottom: 40,
right: 5,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.completeRate || 0 }} </span>
<span class="precentNum">{{ detailData.completeRate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -83,11 +83,12 @@ export default {
// return html;
// }
},
grid: {
top: 30,
bottom: 60,
right: 30,
left: 50,
grid: {
top: 25,
bottom: 20,
right: 10,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -215,20 +215,20 @@ export default {
// 调用接口
getSingleMaterialAnalysis(requestParams).then((res) => {
this.monData = res.data.currentMonthData.find(item => {
return item.name === "电成本";
return item.name === "原片电成本";
});
console.log('this.monData', this.monData);
this.totalData = res.data.totalMonthData.find(item => {
return item.name === "电成本";
return item.name === "原片电成本";
});
// this.relatedMon = res.data.relatedMon
this.relatedData = {
relatedMon: res.data.currentMonthData.filter(item => {
return item.name !== "电成本";
return item.name !== "原片电成本";
}), // 兜底月度数据
relatedTotal: res.data.totalMonthData.filter(item => {
return item.name !== "电成本";
return item.name !== "原片电成本";
}) // 兜底累计数据
}

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.completeRate || 0 }} </span>
<span class="precentNum">{{ detailData.completeRate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -74,7 +74,7 @@ export default {
target: this.monData.targetValue,
thb: this.monData.thb,
// ...rawData,
flag: this.getRateFlag(this.monData.completed) // 新增flag字段
flag: this.monData.completed
};
}
},
@@ -87,15 +87,6 @@ export default {
return 0;
}
return value;
},
/**
* 判断完成率对应的flag值<100为0≥100为1
* @param {number} rate 完成率原始值如89代表89%
* @returns {0|1} flag值
*/
getRateFlag(rate) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
return rate >= 100 ? 1 : 0;
}
}
}

View File

@@ -10,7 +10,7 @@
·万元
</div>
<div class="line">
<operatingSingleBar></operatingSingleBar>
<operatingSingleBar :detailData='dianData'></operatingSingleBar>
</div>
</div>
<div class="dashboard right" @click="handleDashboardClick('水')" :detailData="shuiData">
@@ -18,7 +18,7 @@
·/
</div>
<div class="line">
<operatingSingleBar></operatingSingleBar>
<operatingSingleBar :detailData='shuiData'></operatingSingleBar>
</div>
</div>
</div>

View File

@@ -84,10 +84,11 @@ export default {
// }
},
grid: {
top: 40,
bottom: 60,
right: 70,
left: 60,
top: 25,
bottom: 30,
right: 10,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -23,7 +23,7 @@ export default {
return ['预算', '实际'];
},
chartD() {
console.log(this.detailData,'detailData');
console.log(this.detailData,'detailData==========');
// 背景图片路径(若不需要可注释)
// const bgImageUrl = require('@/assets/img/labelBg.png');

View File

@@ -10,7 +10,7 @@
·万元
</div>
<div class="line">
<operatingSingleBar></operatingSingleBar>
<operatingSingleBar :detailData='dianData'></operatingSingleBar>
</div>
</div>
<div class="dashboard right" @click="handleDashboardClick('水')" :detailData="shuiData">
@@ -18,7 +18,7 @@
·/
</div>
<div class="line">
<operatingSingleBar></operatingSingleBar>
<operatingSingleBar :detailData='shuiData'></operatingSingleBar>
</div>
</div>
</div>

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.rate || 0 }} </span>
<span class="precentNum">{{ detailData.rate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -84,10 +84,11 @@ export default {
// }
},
grid: {
top: 30,
bottom: 60,
right: 30,
left: 50,
top: 25,
bottom: 30,
right: 0,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.completeRate || 0 }} </span>
<span class="precentNum">{{ detailData.completeRate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -84,10 +84,11 @@ export default {
// }
},
grid: {
top: 20,
bottom: 40,
right:20,
left: 40,
top: 25,
bottom: 20,
right: 10,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.completeRate ? detailData.completeRate : 0 }} </span>
<span class="precentNum">{{ detailData.completeRate ? detailData.completeRate : 0 }}% </span>
</div>
</div>
</div>

View File

@@ -83,11 +83,12 @@ export default {
// return html;
// }
},
grid: {
top: 20,
bottom: 40,
right: 20,
left: 40,
grid: {
top: 25,
bottom: 20,
right: 10,
left: 2,
containLabel: true
},
xAxis: [
{

View File

@@ -4,7 +4,7 @@
<div :id="id" style="width: 100%; height:100%;"></div>
<div class="bottomTip">
<div class="precent">
<span class="precentNum">{{ detailData.completeRate || 0 }} </span>
<span class="precentNum">{{ detailData.completeRate || 0 }}% </span>
</div>
</div>
</div>

View File

@@ -84,10 +84,11 @@ export default {
// }
},
grid: {
top: 20,
bottom: 55,
right: 20,
left: 40,
top: 25,
bottom: 30,
right: 0,
left: 2,
containLabel: true
},
xAxis: [
{