修改
This commit is contained in:
4
.env.dev
4
.env.dev
@@ -5,11 +5,11 @@ ENV = 'development'
|
||||
VUE_APP_TITLE = 洛玻集团驾驶舱
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://172.16.32.18:7070'
|
||||
VUE_APP_BASE_API = 'http://172.16.32.18:7070'
|
||||
# VUE_APP_BASE_API = 'http://172.16.32.95:7070'
|
||||
# VUE_APP_BASE_API = 'http://172.16.33.83:7070'
|
||||
|
||||
VUE_APP_BASE_API = 'http://192.168.0.35:7070'
|
||||
# VUE_APP_BASE_API = 'http://192.168.0.35:7070'
|
||||
|
||||
|
||||
# 路由懒加载
|
||||
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
selectedProfit: null, // 选中的名称,初始为null
|
||||
profitOptions: [
|
||||
'毛利率',
|
||||
'收入',
|
||||
'营业收入',
|
||||
'全成本',
|
||||
]
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!-- 累计指标1 -->
|
||||
<div class="dashboard left" @click="handleDashboardClick('/operatingRevenue/operatingRevenueBase')">
|
||||
<div class="title">
|
||||
收入·万元
|
||||
营业收入·万元
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="ytdIncomeData"></operatingSingleBar>
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
type: Array,
|
||||
// 正确写法:默认值通过 factory 函数返回(才能调用 default())
|
||||
default: () => [
|
||||
{ title: "收入", budget: 0, real: 0, rate: 0, diff: 0 },
|
||||
{ title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 },
|
||||
{ title: "累计全成本", budget: 0, real: 0, rate: 0, diff: 0 }
|
||||
]
|
||||
},
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ytdIncomeData: { title: "收入", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 },
|
||||
ytdIncomeData: { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 },
|
||||
ytdCostData: { title: "累计全成本", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 }
|
||||
}
|
||||
},
|
||||
@@ -106,7 +106,7 @@ getRateFlag(rate, real, target) {
|
||||
: this.$props.monthAnalysis; // 直接取 props 默认值
|
||||
|
||||
// 提取累计收入(第0项)、累计全成本(第1项)数据
|
||||
const incomeItem = validData[0] || { title: "收入", budget: 0, real: 0, rate: 0, diff: 0 };
|
||||
const incomeItem = validData[0] || { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 };
|
||||
const costItem = validData[1] || { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 };
|
||||
|
||||
// 整合flag字段
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!-- 收入模块(传递整合了flag的incomeData) -->
|
||||
<div class="dashboard left" @click="handleDashboardClick('/operatingRevenue/operatingRevenueBase')">
|
||||
<div class="title">
|
||||
收入·万元
|
||||
营业收入·万元
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="incomeData"></operatingSingleBar>
|
||||
@@ -15,7 +15,7 @@
|
||||
<!-- 全成本模块(传递整合了flag的totalCostData) -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/fullCostAnalysis/fullCostAnalysisBase')">
|
||||
<div class="title">
|
||||
全成本·万元
|
||||
全成本·元/㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="totalCostData"></operatingSingleBar>
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
type: Array,
|
||||
// 默认值:收入、全成本两个对象,结构与原数据一致
|
||||
default: () => [
|
||||
{ title: "收入", budget: 0, real: 0, rate: 0, diff: 0 },
|
||||
{ title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 },
|
||||
{ title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 }
|
||||
]
|
||||
},
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
return {
|
||||
chart: null,
|
||||
// 初始化收入/全成本数据(包含flag字段)
|
||||
incomeData: { title: "收入", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 },
|
||||
incomeData: { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 },
|
||||
totalCostData: { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 }
|
||||
}
|
||||
},
|
||||
@@ -90,18 +90,18 @@ export default {
|
||||
})
|
||||
},
|
||||
// 保留原flag判断逻辑(≥100返回1,<100返回0)
|
||||
getRateFlag(rate, real, target) {
|
||||
if (isNaN(rate) || rate === null || rate === undefined) return 0;
|
||||
getRateFlag(rate, real, target) {
|
||||
if (isNaN(rate) || rate === null || rate === undefined) return 0;
|
||||
|
||||
// 1. 完成率 >= 100 => 达标
|
||||
if (rate >= 100) return 1;
|
||||
// 1. 完成率 >= 100 => 达标
|
||||
if (rate >= 100) return 1;
|
||||
|
||||
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
|
||||
if (rate === 0 && target === 0) return 1;
|
||||
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
|
||||
if (rate === 0 && target === 0) return 1;
|
||||
|
||||
// 其他情况 => 未达标
|
||||
return 0;
|
||||
},
|
||||
// 其他情况 => 未达标
|
||||
return 0;
|
||||
},
|
||||
|
||||
updateChart(data) {
|
||||
// 数据兜底:确保是数组且长度≥2
|
||||
@@ -110,7 +110,7 @@ getRateFlag(rate, real, target) {
|
||||
: this.$props.ytdAnalysis.default();
|
||||
|
||||
// 提取收入(第0项)、全成本(第1项)数据
|
||||
const incomeItem = validData[0] || { title: "收入", budget: 0, real: 0, rate: 0, diff: 0 };
|
||||
const incomeItem = validData[0] || { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 };
|
||||
const totalCostItem = validData[1] || { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 };
|
||||
|
||||
// 整合flag字段到收入/全成本数据中
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!-- 领用量模块(传递整合了flag的useData) -->
|
||||
<div class="dashboard left">
|
||||
<div class="title">
|
||||
领用量·㎡
|
||||
领用量·万㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="useData"></operatingSingleBar>
|
||||
@@ -15,7 +15,7 @@
|
||||
<!-- 加工产量模块(传递整合了flag的processData) -->
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
加工产量·㎡
|
||||
加工产量·万㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="processData"></operatingSingleBar>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!-- 领用量模块(传递整合了flag的useData) -->
|
||||
<div class="dashboard left">
|
||||
<div class="title">
|
||||
领用量·㎡
|
||||
领用量·万㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="useData"></operatingSingleBar>
|
||||
@@ -15,7 +15,7 @@
|
||||
<!-- 加工产量模块(传递整合了flag的processData) -->
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
加工产量·㎡
|
||||
加工产量·万㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="processData"></operatingSingleBar>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
运费·万㎡
|
||||
运费·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
运费·万㎡
|
||||
运费·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<!-- 单价模块(直接传递整合了flag的unitPriceData) -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/unitPriceAnalysis/unitPriceAnalysisBase')">
|
||||
<div class="title">
|
||||
单价·万㎡
|
||||
单价·元/㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="unitPriceData"></operatingSingleBar>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<!-- 单价模块(直接传递整合了flag的unitPriceData) -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/unitPriceAnalysis/unitPriceAnalysisBase')">
|
||||
<div class="title">
|
||||
单价·万㎡
|
||||
单价·元/㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="unitPriceData"></operatingSingleBar>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
gap: 12px;
|
||||
grid-template-columns: 1624px;
|
||||
">
|
||||
<relatedIndicatorsAnalysis :dateData="dateData" :factory="factory" :relatedData="relatedData" :title="'相关指标分析·万元'" />
|
||||
<relatedIndicatorsAnalysis :dateData="dateData" :factory="factory" :relatedData="relatedData" :title="'相关指标分析'" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
'经营性利润',
|
||||
'销量',
|
||||
'单价',
|
||||
'成本',
|
||||
'制造成本',
|
||||
'管理费用',
|
||||
'销售费用',
|
||||
'财务费用',
|
||||
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
*/
|
||||
factoryData() { // 整合原始数据 + 计算flag
|
||||
return {
|
||||
completeRate: this.monData.proportion ? Number(this.monData.proportion).toFixed(2) : 0,
|
||||
completeRate: this.monData.proportion ? Number(this.monData.proportion) : 0,
|
||||
diff: this.monData.diffValue,
|
||||
real: this.monData.value,
|
||||
target: this.monData.targetValue,
|
||||
|
||||
@@ -61,8 +61,8 @@ export default {
|
||||
default: () => [],
|
||||
},
|
||||
dateData: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -61,8 +61,8 @@ export default {
|
||||
default: () => [],
|
||||
},
|
||||
dateData: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -23,7 +23,7 @@ export default {
|
||||
chartD() {
|
||||
// 背景图片路径(若不需要可注释)
|
||||
// const bgImageUrl = require('@/assets/img/labelBg.png');
|
||||
const rate = this.detailData?.proportion ? Number(this.detailData?.proportion).toFixed(2) : 0
|
||||
const rate = this.detailData?.proportion ? Number(this.detailData?.proportion) : 0
|
||||
const diff = this.detailData?.diffValue || 0
|
||||
console.log('diff', diff);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
},
|
||||
// 3. 成本数据:从当前激活数据集中筛选
|
||||
costData() {
|
||||
return (this.activeData.find(item => item.name === "成本")) || {
|
||||
return (this.activeData.find(item => item.name === "制造成本")) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
*/
|
||||
factoryData() { // 整合原始数据 + 计算flag
|
||||
return {
|
||||
completeRate: Number(this.totalData.proportion).toFixed(2),
|
||||
completeRate: Number(this.totalData.proportion),
|
||||
diff: this.totalData.diffValue,
|
||||
real: this.totalData.value,
|
||||
target: this.totalData.targetValue,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left">
|
||||
<div class="title">
|
||||
大宗类·万㎡
|
||||
大宗类·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
石料类·m³/㎡
|
||||
石料类·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
材料类·m³
|
||||
材料类·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
动力类·元m³
|
||||
动力类·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
<div class="dashboard right" @click="handleRoute('/salesVolumeAnalysis/doublePlatedBase')">
|
||||
<div class="title">
|
||||
技术服务类·万㎡
|
||||
技术服务类·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
|
||||
@@ -199,9 +199,10 @@ export default {
|
||||
endTime: this.dateData.endTime,
|
||||
// index: this.index,
|
||||
// sort: 1,
|
||||
trendName: this.trendName,
|
||||
|
||||
trendName: this.$route.query.name ? '原料' + this.$route.query.name + this.trendName : '原料硅砂采购单价',
|
||||
analysisObject: [
|
||||
this.$route.query.name ? this.$route.query.name + '成本' : '硅砂成本'
|
||||
this.$route.query.name ? '原料' + this.$route.query.name : '原料硅砂'
|
||||
],
|
||||
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
|
||||
levelId: this.factory,
|
||||
@@ -210,20 +211,44 @@ export default {
|
||||
// 调用接口
|
||||
getSingleMaterialAnalysis(requestParams).then((res) => {
|
||||
this.monData = res.data.currentMonthData.find(item => {
|
||||
return item.name === "硅砂成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name === '原料' + this.$route.query.name;
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name === '原料硅砂';
|
||||
}
|
||||
});
|
||||
console.log('this.monData', this.monData);
|
||||
console.log('this.monData', this.monData, this.$route.query.name ? '原料' + this.$route.query.name : '原料硅砂');
|
||||
|
||||
this.totalData = res.data.totalMonthData.find(item => {
|
||||
return item.name === "硅砂成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name === '原料' + this.$route.query.name;
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name === '原料硅砂';
|
||||
}
|
||||
});
|
||||
// this.relatedMon = res.data.relatedMon
|
||||
this.relatedData = {
|
||||
relatedMon: res.data.currentMonthData.filter(item => {
|
||||
return item.name !== "硅砂成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name !== '原料' + this.$route.query.name;
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name !== '原料硅砂';
|
||||
}
|
||||
}), // 兜底月度数据
|
||||
relatedTotal: res.data.totalMonthData.filter(item => {
|
||||
return item.name !== "硅砂成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name !== '原料' + this.$route.query.name;
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name !== '原料硅砂';
|
||||
}
|
||||
}) // 兜底累计数据
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ export default {
|
||||
endTime: this.dateData.endTime,
|
||||
// index: this.index,
|
||||
// sort: 1,
|
||||
trendName: this.trendName,
|
||||
trendName: this.trendName +'成本',
|
||||
analysisObject: [
|
||||
"原片燃料成本",
|
||||
],
|
||||
|
||||
@@ -189,7 +189,7 @@ export default {
|
||||
changeItem(item) {
|
||||
console.log('item', item);
|
||||
|
||||
this.trendName = item
|
||||
this.trendName = item
|
||||
this.getData()
|
||||
},
|
||||
getData() {
|
||||
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
totalData: {},
|
||||
trend: [],
|
||||
relatedData: {},
|
||||
trendName: '加工包材成本',
|
||||
trendName: '包材成本',
|
||||
};
|
||||
},
|
||||
|
||||
@@ -186,7 +186,7 @@ export default {
|
||||
// sort: 1,
|
||||
trendName: this.trendName,
|
||||
analysisObject: [
|
||||
'加工包材成本'
|
||||
'包材成本'
|
||||
],
|
||||
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
|
||||
levelId: this.factory,
|
||||
|
||||
@@ -209,20 +209,44 @@ export default {
|
||||
// 调用接口
|
||||
getSingleMaterialAnalysis(requestParams).then((res) => {
|
||||
this.monData = res.data.currentMonthData.find(item => {
|
||||
return item.name === "天然气成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name === this.$route.query.name + '成本';
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name === '天然气成本';
|
||||
}
|
||||
});
|
||||
console.log('this.monData', this.monData);
|
||||
|
||||
this.totalData = res.data.totalMonthData.find(item => {
|
||||
return item.name === "天然气成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name === this.$route.query.name + '成本';
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name === '天然气成本';
|
||||
}
|
||||
});
|
||||
// this.relatedMon = res.data.relatedMon
|
||||
this.relatedData = {
|
||||
relatedMon: res.data.currentMonthData.filter(item => {
|
||||
return item.name !== "天然气成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name !== this.$route.query.name + '成本';
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name !== '天然气成本';
|
||||
}
|
||||
}), // 兜底月度数据
|
||||
relatedTotal: res.data.totalMonthData.filter(item => {
|
||||
return item.name !== "天然气成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name !== this.$route.query.name + '成本';
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name !== '天然气成本';
|
||||
}
|
||||
}) // 兜底累计数据
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ export default {
|
||||
endTime: this.dateData.endTime,
|
||||
// index: this.index,
|
||||
// sort: 1,
|
||||
trendName: this.trendName,
|
||||
trendName: this.$route.query.name ? this.$route.query.name + '成本' + this.trendName : '镀膜液成本' + this.trendName,
|
||||
analysisObject: [
|
||||
this.$route.query.name ? this.$route.query.name + '成本' : '镀膜液成本'
|
||||
],
|
||||
@@ -209,20 +209,44 @@ export default {
|
||||
// 调用接口
|
||||
getSingleMaterialAnalysis(requestParams).then((res) => {
|
||||
this.monData = res.data.currentMonthData.find(item => {
|
||||
return item.name === "镀膜液成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name === this.$route.query.name + '成本'
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name === '镀膜液成本';
|
||||
}
|
||||
});
|
||||
console.log('this.monData', this.monData);
|
||||
|
||||
this.totalData = res.data.totalMonthData.find(item => {
|
||||
return item.name === "镀膜液成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name === this.$route.query.name + '成本'
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name === '镀膜液成本';
|
||||
}
|
||||
});
|
||||
// this.relatedMon = res.data.relatedMon
|
||||
this.relatedData = {
|
||||
relatedMon: res.data.currentMonthData.filter(item => {
|
||||
return item.name !== "镀膜液成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name !== this.$route.query.name + '成本'
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name === '镀膜液成本';
|
||||
}
|
||||
}), // 兜底月度数据
|
||||
relatedTotal: res.data.totalMonthData.filter(item => {
|
||||
return item.name !== "镀膜液成本";
|
||||
if (this.$route.query.name) {
|
||||
// 如果有查询参数,查找 "原料" + 查询参数 的项
|
||||
return item.name !== this.$route.query.name + '成本'
|
||||
} else {
|
||||
// 如果没有查询参数,查找 name 为 "原料硅砂" 的项
|
||||
return item.name !== '镀膜液成本';
|
||||
}
|
||||
}) // 兜底累计数据
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ export default {
|
||||
totalData: {},
|
||||
trend: [],
|
||||
relatedData: {},
|
||||
trendName: '备品、机物料',
|
||||
trendName: '备品丶机物料',
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
'燃料成本',
|
||||
'电成本',
|
||||
'人工成本',
|
||||
'制造成本',
|
||||
'制造费用',
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
profitOptions: [
|
||||
'原片制造费用成本',
|
||||
'包材',
|
||||
'备品、机物料',
|
||||
'备品丶机物料',
|
||||
'折旧',
|
||||
'其他',
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
selectedProfit: '制造费用', // 选中的名称,初始为null
|
||||
profitOptions: [
|
||||
'制造费用',
|
||||
'备品、机物料',
|
||||
'备品丶机物料',
|
||||
'折旧',
|
||||
'其他',
|
||||
]
|
||||
|
||||
@@ -64,9 +64,11 @@ export default {
|
||||
/**
|
||||
* 自动提取monData中的工厂数据,并新增flag字段
|
||||
*/
|
||||
factoryData() { // 整合原始数据 + 计算flag
|
||||
factoryData() {
|
||||
console.log(this.monData,'monData');
|
||||
// 整合原始数据 + 计算flag
|
||||
return {
|
||||
completeRate: this.monData.proportion ? Number(this.monData.proportion).toFixed(2) : 0,
|
||||
completeRate: this.monData.proportion ? Number(this.monData.proportion) : 0,
|
||||
diff: this.monData.diffValue,
|
||||
real: this.monData.value,
|
||||
target: this.monData.targetValue,
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
|
||||
<!-- 新增:topItem 专属包裹容器,统一控制样式和布局(原有行内样式不变) -->
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left" @click="handleDashboardClick('备品、机物料')">
|
||||
<div class="dashboard left" @click="handleDashboardClick('备品丶机物料')">
|
||||
<div class="title">
|
||||
备品、机物料·元/㎡
|
||||
备品丶机物料·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定备件丶机物料对应数据:新增数据绑定,样式不变 -->
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
computed: {
|
||||
// 1. 备件丶机物料数据:精准筛选对应名称数据,兜底值统一
|
||||
sparePartsData() {
|
||||
return this.relatedData.find(item => (item.name || '').includes('备品、机物料')) || {
|
||||
return this.relatedData.find(item => (item.name || '').includes('备品丶机物料')) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
|
||||
@@ -23,9 +23,11 @@ export default {
|
||||
return ['预算', '实际'];
|
||||
},
|
||||
chartD() {
|
||||
console.log(this.detailData,'detailData');
|
||||
|
||||
// 背景图片路径(若不需要可注释)
|
||||
// const bgImageUrl = require('@/assets/img/labelBg.png');
|
||||
const rate = this.detailData?.proportion ? Number(this.detailData?.proportion).toFixed(2) : 0
|
||||
const rate = this.detailData?.proportion ? Number(this.detailData?.proportion) : 0
|
||||
const diff = this.detailData?.diffValue || 0
|
||||
console.log('diff', diff);
|
||||
|
||||
|
||||
@@ -7,28 +7,28 @@
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<!-- 天然气组件:绑定对应筛选数据,点击传递物料名和路由 -->
|
||||
<div class="dashboard left" @click="handleDashboardClick('天然气', 'singleCombustible')">
|
||||
<div class="title">天然气·元/㎡</div>
|
||||
<div class="title">天然气·元/吨</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="naturalGasData"></operatingSingleBar>
|
||||
</div>
|
||||
</div>
|
||||
<!-- LNG液化天然气组件:绑定对应筛选数据 -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('LNG液化天然气', 'singleCombustible')">
|
||||
<div class="title">LNG液化天然气·元/㎡</div>
|
||||
<div class="title">LNG液化天然气·元/吨</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="lngData"></operatingSingleBar>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 重油组件:绑定对应筛选数据 -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('重油', 'singleCombustible')">
|
||||
<div class="title">重油·元/㎡</div>
|
||||
<div class="title">重油·元/吨</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="heavyOilData"></operatingSingleBar>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 水组件:绑定对应筛选数据 -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('水', 'singleCombustible')">
|
||||
<div class="title">水·元/㎡</div>
|
||||
<div class="title">水·元/吨</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="waterData"></operatingSingleBar>
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
<template>
|
||||
<div style="flex: 1">
|
||||
<Container :name="title" icon="cockpitItemIcon" size="opLargeBg" topSize="large">
|
||||
<Container :isShowTab="true" :name="title" icon="cockpitItemIcon" size="opLargeBg" topSize="large"
|
||||
@tabChange="handleChange">
|
||||
<!-- 1. 移除 .kpi-content 的固定高度,改为自适应(样式不变,仅保留原有结构) -->
|
||||
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
|
||||
<!-- 新增:topItem 专属包裹容器,统一控制样式和布局(原有行内样式不变) -->
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left" @click="handleDashboardClick('包材')">
|
||||
<div class="title">
|
||||
包材·元/㎡
|
||||
包材·元/吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
||||
<operatingSingleBar :detailData="packagingData"></operatingSingleBar>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboard right" @click="handleDashboardClick('备品、机物料')">
|
||||
<div class="dashboard right" @click="handleDashboardClick('备品丶机物料')">
|
||||
<div class="title">
|
||||
备品、机物料·元/㎡
|
||||
备品丶机物料·元/吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
||||
@@ -25,7 +26,7 @@
|
||||
</div>
|
||||
<div class="dashboard right" @click="handleDashboardClick('折旧')">
|
||||
<div class="title">
|
||||
折旧·元/㎡
|
||||
折旧·元/吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
||||
@@ -34,7 +35,7 @@
|
||||
</div>
|
||||
<div class="dashboard right" @click="handleDashboardClick('其他')">
|
||||
<div class="title">
|
||||
其他·元/㎡
|
||||
其他·元/吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
||||
@@ -58,9 +59,9 @@ export default {
|
||||
components: { Container, operatingSingleBar },
|
||||
// mixins: [resize],
|
||||
props: {
|
||||
itemData: { // 接收父组件传递的设备数据数组
|
||||
type: Array,
|
||||
default: () => [] // 默认空数组,避免报错
|
||||
relatedData: { // 接收父组件传递的设备数据数组
|
||||
type: Object,
|
||||
default: () => { } // 默认空数组,避免报错
|
||||
},
|
||||
dateData: {
|
||||
type: Object,
|
||||
@@ -82,22 +83,25 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
activeMaterial: '' // 新增:记录选中物料状态,和第二个组件逻辑对齐,样式不变
|
||||
activeData: this.relatedData.relatedMon || [], // 核心激活数据集(默认月度,与第二个组件一致)
|
||||
activeMaterial: '' // 记录选中物料状态,与第二个组件统一
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
itemData: {
|
||||
handler(newValue, oldValue) {
|
||||
// this.updateChart()
|
||||
// 对齐第二个组件:深度监听relatedData变化,同步更新激活数据集
|
||||
relatedData: {
|
||||
handler(newVal) {
|
||||
this.activeData = newVal.relatedMon || [];
|
||||
},
|
||||
deep: true // 若对象内属性变化需触发,需加 deep: true(原有逻辑保留,样式不变)
|
||||
immediate: true, // 挂载时立即执行
|
||||
deep: true // 深度监听对象内部变化
|
||||
}
|
||||
},
|
||||
// 新增:4个指标对应的计算属性,精准筛选itemData中的数据(仅数据逻辑,样式不变)
|
||||
computed: {
|
||||
// 1. 包材数据:从itemData中筛选,兜底值统一
|
||||
packagingData() {
|
||||
return this.itemData.find(item => (item.name || '').includes('包材')) || {
|
||||
return this.activeData.find(item => (item.name || '').includes('包材')) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
@@ -106,7 +110,7 @@ export default {
|
||||
},
|
||||
// 2. 备件丶机物料数据:精准筛选
|
||||
sparePartsData() {
|
||||
return this.itemData.find(item => (item.name || '').includes('备品、机物料')) || {
|
||||
return this.activeData.find(item => (item.name || '').includes('备品丶机物料')) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
@@ -115,7 +119,7 @@ export default {
|
||||
},
|
||||
// 3. 折旧数据:精准筛选
|
||||
depreciationData() {
|
||||
return this.itemData.find(item => (item.name || '').includes('折旧')) || {
|
||||
return this.activeData.find(item => (item.name || '').includes('折旧')) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
@@ -124,7 +128,7 @@ export default {
|
||||
},
|
||||
// 4. 其他数据:精准筛选
|
||||
otherData() {
|
||||
return this.itemData.find(item => (item.name || '').includes('其他')) || {
|
||||
return this.activeData.find(item => (item.name || '').includes('其他')) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
@@ -137,6 +141,17 @@ export default {
|
||||
// this.$nextTick(() => this.updateChart())
|
||||
},
|
||||
methods: {
|
||||
handleChange(value) {
|
||||
console.log('Tab 切换值:', value);
|
||||
// 根据tab值更新激活数据集
|
||||
if (value === 'month') {
|
||||
this.activeData = this.relatedData.relatedMon || [];
|
||||
} else {
|
||||
this.activeData = this.relatedData.relatedTotal || [];
|
||||
}
|
||||
console.log('当前激活数据集:', this.activeData);
|
||||
},
|
||||
|
||||
handleDashboardClick(material) {
|
||||
// 1. 记录选中状态(新增,和第二个组件逻辑对齐,样式不变)
|
||||
this.activeMaterial = material;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left">
|
||||
<div class="title">
|
||||
采购单价·元/㎡
|
||||
采购单价·元/m³
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
产量·万㎡
|
||||
产量·吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
单耗·m³/㎡
|
||||
单耗·吨/m³
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left">
|
||||
<div class="title">
|
||||
采购单价·元/㎡
|
||||
采购单价·元/吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="unitPriceData"></operatingSingleBar>
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
产量·万㎡
|
||||
产量·吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="productData"></operatingSingleBar>
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
单耗·吨/m²
|
||||
单耗·吨/吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="unitHaoData"></operatingSingleBar>
|
||||
@@ -87,12 +87,21 @@ export default {
|
||||
computed: {
|
||||
// 1. 硅砂数据:从激活数据集中筛选,兜底值与第二个组件统一
|
||||
unitPriceData() {
|
||||
console.log('');
|
||||
console.log(this.activeData.find(item => (item.name || '').includes('采购单价')) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
diffValue: 0
|
||||
},'yyyy')
|
||||
return this.activeData.find(item => (item.name || '').includes('采购单价')) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
diffValue: 0
|
||||
};
|
||||
|
||||
|
||||
},
|
||||
// 2. 海砂数据:精准筛选
|
||||
productData() {
|
||||
@@ -126,6 +135,8 @@ export default {
|
||||
// 对齐第二个组件:监听物料数据变化,同步更新激活数据集
|
||||
relatedData: {
|
||||
handler(newVal) {
|
||||
console.log(this.relatedData,'relatedData');
|
||||
|
||||
this.activeData = newVal.relatedMon || [];
|
||||
},
|
||||
immediate: true, // 组件挂载时立即执行
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left">
|
||||
<div class="title">
|
||||
采购单价·元/㎡
|
||||
采购单价·元/度
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="unitPriceData"></operatingSingleBar>
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
产量·万㎡
|
||||
产量·吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="productData"></operatingSingleBar>
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
单耗·度/m²
|
||||
单耗·度/吨
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="unitHaoData"></operatingSingleBar>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<div class="dashboard right"
|
||||
@click="handleDashboardClick('制造成本','mfgOverheadCostAnalysis/mfgOverheadCostAnalysis')">
|
||||
<div class="title">
|
||||
制造成本·元/㎡
|
||||
制造费用·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="manufacturingCostData"></operatingSingleBar>
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
},
|
||||
// 5. 制造成本数据:精准筛选
|
||||
manufacturingCostData() {
|
||||
return this.activeData.find(item => item.name === "制造成本") || {
|
||||
return this.activeData.find(item => item.name === "制造费用") || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
|
||||
<!-- 新增:topItem 专属包裹容器,统一控制样式和布局(原有行内样式不变) -->
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left" @click="handleDashboardClick('备品、机物料')">
|
||||
<div class="dashboard left" @click="handleDashboardClick('备品丶机物料')">
|
||||
<div class="title">
|
||||
备品、机物料·元/㎡
|
||||
备品丶机物料·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<!-- 绑定备件丶机物料对应数据:新增数据绑定,样式不变 -->
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
computed: {
|
||||
// 1. 备件丶机物料数据:精准筛选对应名称数据,兜底值统一
|
||||
sparePartsData() {
|
||||
return this.relatedData.find(item => (item.name || '').includes('备品、机物料')) || {
|
||||
return this.relatedData.find(item => (item.name || '').includes('备品丶机物料')) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left">
|
||||
<div class="title">
|
||||
双镀成本·万㎡
|
||||
双镀成本·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
双镀均价·万㎡
|
||||
双镀均价·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
双镀毛利·万㎡
|
||||
双镀毛利·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||
<div class="dashboard left">
|
||||
<div class="title">
|
||||
双镀成本·万㎡
|
||||
双镀成本·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
双镀均价·万㎡
|
||||
双镀均价·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
双镀毛利·万㎡
|
||||
双镀毛利·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="{
|
||||
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
'利润总额',
|
||||
'销量',
|
||||
'单价',
|
||||
'成本',
|
||||
'制造成本',
|
||||
'管理费用',
|
||||
'销售费用',
|
||||
'财务费用',
|
||||
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
*/
|
||||
factoryData() { // 整合原始数据 + 计算flag
|
||||
return {
|
||||
completeRate: this.monData.proportion ? Number(this.monData.proportion).toFixed(2) : 0,
|
||||
completeRate: this.monData.proportion ? Number(this.monData.proportion) : 0,
|
||||
diff: this.monData.diffValue,
|
||||
real: this.monData.value,
|
||||
target: this.monData.targetValue,
|
||||
|
||||
@@ -23,7 +23,7 @@ export default {
|
||||
chartD() {
|
||||
// 背景图片路径(若不需要可注释)
|
||||
// const bgImageUrl = require('@/assets/img/labelBg.png');
|
||||
const rate = this.detailData?.proportion? Number(this.detailData?.proportion).toFixed(2) : 0
|
||||
const rate = this.detailData?.proportion? Number(this.detailData?.proportion) : 0
|
||||
const diff = this.detailData?.diffValue || 0
|
||||
console.log('diff', diff);
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ export default {
|
||||
},
|
||||
// 3. 成本数据:从当前激活数据集中筛选
|
||||
costData() {
|
||||
return (this.activeData.find(item => item.name === "成本")) || {
|
||||
return (this.activeData.find(item => item.name === "制造成本")) || {
|
||||
targetValue: 0,
|
||||
value: 0,
|
||||
completed: 0,
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
*/
|
||||
factoryData() { // 整合原始数据 + 计算flag
|
||||
return {
|
||||
completeRate: this.totalData.proportion ? Number(this.monData.proportion).toFixed(2) : 0,
|
||||
completeRate: this.totalData.proportion ? Number(this.totalData.proportion) : 0,
|
||||
diff: this.totalData.diffValue,
|
||||
real: this.totalData.value,
|
||||
target: this.totalData.targetValue,
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
:style="{ opacity: isLeftTransparent ? 1 : 0.3 }" ref="leftTitleWrapper">
|
||||
<svg-icon class="title-icon" style="font-size: 32px; margin-left: 16px" :icon-class="icon" />
|
||||
<span class="title-text" ref="leftTitleText">{{ name }}</span>
|
||||
<span class="change-text left-change-text" v-if="!isLeftTransparent" ref="leftChangeText">点击切换</span>
|
||||
</div>
|
||||
|
||||
<!-- 右侧标题 -->
|
||||
@@ -13,14 +14,15 @@
|
||||
:style="{ opacity: isRightTransparent ? 1 : 0.3 }" ref="rightTitleWrapper">
|
||||
<svg-icon class="title-icon" style="font-size: 32px; margin-left: 16px" :icon-class="iconTwo || icon" />
|
||||
<span class="title-text" ref="rightTitleText">{{ nameTwo }}</span>
|
||||
<span class="change-text right-change-text" v-if="!isRightTransparent" ref="rightChangeText">点击切换</span>
|
||||
</div>
|
||||
|
||||
<!-- 左侧切换文字:动态定位 -->
|
||||
<span class="change-text left-change-text" v-if="!isLeftTransparent" ref="leftChangeText">点击切换</span>
|
||||
<!-- 右侧切换文字:动态定位 -->
|
||||
<span class="change-text right-change-text" v-if="!isRightTransparent" ref="rightChangeText">点击切换</span>
|
||||
</div>
|
||||
|
||||
<!-- 左侧切换文字:动态定位 -->
|
||||
|
||||
<!-- 右侧切换文字:动态定位 -->
|
||||
|
||||
|
||||
<!-- Tab组:动态样式 + 点击事件 -->
|
||||
<div class="tab-group">
|
||||
<!-- 月度Tab:点击切换状态,动态绑定样式 -->
|
||||
@@ -65,17 +67,17 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
// 初始化定位
|
||||
this.positionChangeText();
|
||||
// 监听窗口大小变化,重新定位
|
||||
window.addEventListener('resize', this.positionChangeText);
|
||||
},
|
||||
updated() {
|
||||
// 数据更新后重新定位(如标题文字变化)
|
||||
this.positionChangeText();
|
||||
// this.positionChangeText();
|
||||
// // 监听窗口大小变化,重新定位
|
||||
// window.addEventListener('resize', this.positionChangeText);
|
||||
},
|
||||
// updated() {
|
||||
// // 数据更新后重新定位(如标题文字变化)
|
||||
// this.positionChangeText();
|
||||
// },
|
||||
beforeDestroy() {
|
||||
// 移除监听
|
||||
window.removeEventListener('resize', this.positionChangeText);
|
||||
// window.removeEventListener('resize', this.positionChangeText);
|
||||
},
|
||||
methods: {
|
||||
handleLeftClick() {
|
||||
@@ -83,14 +85,14 @@ export default {
|
||||
this.isRightTransparent = false;
|
||||
this.$emit('switchTab', 'cus');
|
||||
// 切换后重新定位
|
||||
this.$nextTick(() => this.positionChangeText());
|
||||
// this.$nextTick(() => this.positionChangeText());
|
||||
},
|
||||
handleRightClick() {
|
||||
this.isLeftTransparent = false;
|
||||
this.isRightTransparent = true;
|
||||
this.$emit('switchTab', 'pro');
|
||||
// 切换后重新定位
|
||||
this.$nextTick(() => this.positionChangeText());
|
||||
// this.$nextTick(() => this.positionChangeText());
|
||||
},
|
||||
/**
|
||||
* Tab点击事件:切换状态 + 向父组件传值
|
||||
@@ -301,11 +303,13 @@ export default {
|
||||
|
||||
// 左侧切换文字(可选:单独样式调整)
|
||||
.left-change-text {
|
||||
left: 70%;
|
||||
/* 若需要可添加单独样式 */
|
||||
}
|
||||
|
||||
// 右侧切换文字(可选:单独样式调整)
|
||||
.right-change-text {
|
||||
left: 18%;
|
||||
/* 若需要可添加单独样式 */
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<!-- 成本图表:传递全成本数据 + 完成率flag -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/fullCostAnalysis/fullCostAnalysisBase')">
|
||||
<div class="title">
|
||||
成本·万㎡
|
||||
成本·元/㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -31,7 +31,7 @@
|
||||
<!-- 运费图表:传递单价数据 + 完成率flag -->
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
运费·万㎡
|
||||
运费·万元
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="{
|
||||
|
||||
@@ -109,18 +109,18 @@ export default {
|
||||
* @param {number} rate 完成率(原始值,如89代表89%)
|
||||
* @returns {0|1} flag值
|
||||
*/
|
||||
getRateFlag(rate, real, target) {
|
||||
if (isNaN(rate) || rate === null || rate === undefined) return 0;
|
||||
getRateFlag(rate, real, target) {
|
||||
if (isNaN(rate) || rate === null || rate === undefined) return 0;
|
||||
|
||||
// 1. 完成率 >= 100 => 达标
|
||||
if (rate >= 100) return 1;
|
||||
// 1. 完成率 >= 100 => 达标
|
||||
if (rate >= 100) return 1;
|
||||
|
||||
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
|
||||
if (rate === 0 && target === 0) return 1;
|
||||
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
|
||||
if (rate === 0 && target === 0) return 1;
|
||||
|
||||
// 其他情况 => 未达标
|
||||
return 0;
|
||||
},
|
||||
// 其他情况 => 未达标
|
||||
return 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<!-- 成本图表:传递全成本数据 + 完成率flag -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/fullCostAnalysis/fullCostAnalysisBase')">
|
||||
<div class="title">
|
||||
成本·万㎡
|
||||
成本·元/㎡
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="{
|
||||
@@ -30,7 +30,7 @@
|
||||
<!-- 运费图表:传递单价数据 + 完成率flag -->
|
||||
<div class="dashboard right">
|
||||
<div class="title">
|
||||
运费·万㎡
|
||||
运费·万元
|
||||
</div>
|
||||
<div class="chart-wrap">
|
||||
<operatingSingleBar :detailData="{
|
||||
|
||||
Reference in New Issue
Block a user