This commit is contained in:
‘937886381’
2026-01-06 13:48:11 +08:00
parent 20ef2b9763
commit 5605eeab06
287 changed files with 1890 additions and 1381 deletions

View File

@@ -2,9 +2,6 @@
<div class="coreBar">
<!-- 新增行容器包裹各基地情况和barTop -->
<div class="header-row">
<div class="base-title">
各基地情况
</div>
<div class="barTop">
<!-- 关键新增右侧容器包裹图例和按钮组实现整体靠右 -->
<div class="right-container">
@@ -297,10 +294,10 @@ export default {
// 新增:头部行容器,实现一行排列
.header-row {
display: flex;
justify-content: space-between; // 左右两端对齐
display: flex;
justify-content: flex-end; // 左右两端对齐
align-items: center; // 垂直居中
width: 100%;
// width: 100%;
margin-bottom: 8px; // 与下方图表区保留间距(可根据需求调整)
}

View File

@@ -108,8 +108,8 @@ export default {
*/
getRateFlag(rate) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
return rate >= 100 ? 1 : 0;
}
return +(rate >= 100 || rate === 0); // + 号将布尔值转为数字true→1false→0
},
}
}
</script>

View File

@@ -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></operatingSingleBar>
@@ -15,7 +15,7 @@
</div>
<div class="dashboard right">
<div class="title">
单价·单位/万元
单价·万元
</div>
<div class="line">
<operatingSingleBar></operatingSingleBar>

View File

@@ -39,7 +39,7 @@
</div>
</div>
<div class="lineBottom" style="height: 100%; width: 100%">
<operatingLineBar :chartData="chartD" style="height: 99%; width: 100%" />
<operatingLineBar :dateData="dateData" :chartData="chartD" style="height: 99%; width: 100%" />
</div>
</div>
</template>
@@ -51,7 +51,7 @@ import * as echarts from 'echarts';
export default {
name: "Container",
components: { operatingLineBar },
props: ["chartData"],
props: ["chartData",'dateData'],
emits: ['sort-change'], // 声明事件Vue3 推荐)
data() {
return {

View File

@@ -120,7 +120,7 @@ export default {
},
// min: 0,
// max: (value) => Math.ceil((value.max || 0) * 1.1),
scale: true,
axisTick: { show: false },
axisLabel: {
color: 'rgba(0, 0, 0, 0.45)',

View File

@@ -117,7 +117,7 @@ export default {
fontSize: 12,
align: 'right'
},
scale: true,
splitNumber: 4,
axisTick: { show: false },
axisLabel: {

View File

@@ -28,7 +28,11 @@ export default {
chartData: {
type: Object,
default: () => ({}),
}
},
dateData: {
type: Object,
default: () => ({}),
},
},
mounted() {
this.$nextTick(() => {
@@ -44,7 +48,8 @@ export default {
},
deep: true,
immediate: true
}
},
},
beforeDestroy() {
// 组件销毁时清理资源
@@ -80,7 +85,8 @@ export default {
path: 'procurementGainAnalysisBase',
query: { // 使用query传递参数推荐也可使用params
// baseName: itemName,
factory: baseIndex
factory: baseIndex,
dateData: this.dateData
}
// 若仍需用base作为参数
// base: itemName,
@@ -116,11 +122,11 @@ export default {
}
}
},
grid: {
grid: {
top: 30,
bottom: 30,
right: 70,
left: 40
left: 60
},
xAxis: [
{
@@ -154,7 +160,7 @@ export default {
fontSize: 12,
align: 'right'
},
scale: true,
splitNumber: 4,
axisTick: { show: false },
axisLabel: {

View File

@@ -117,7 +117,7 @@ export default {
fontSize: 12,
align: 'right'
},
scale: true,
splitNumber: 4,
axisTick: { show: false },
axisLabel: {
@@ -146,7 +146,7 @@ export default {
},
splitLine: { show: false },
axisLine: { lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } },
// scale: true,
//
splitNumber: 4,
}
],

View File

@@ -83,11 +83,11 @@ export default {
// return html;
// }
},
grid: {
top: 40,
bottom: 40,
right: 70,
left: 60,
grid: {
top: 30,
bottom: 60,
right: 30,
left: 50,
},
xAxis: [
{
@@ -123,7 +123,7 @@ export default {
type: 'solid' // 实线可选dashed虚线、dotted点线
}
},
scale: true,
splitNumber: 2,
axisTick: { show: false },
axisLabel: {

View File

@@ -30,7 +30,7 @@
background-color: rgba(249, 252, 255, 1);
">
<!-- <top-item /> -->
<operatingBar :chartData="chartData" @sort-change="sortChange" />
<operatingBar :dateData="dateData" :chartData="chartData" @sort-change="sortChange" />
</div>
</div>
</Container>
@@ -51,6 +51,10 @@ export default {
default: () => ({}),
required: true, // 标记为必填,避免空数据导致异常
},
dateData: {
type: Object,
default: () => ({}),
},
},
data() {
return {

View File

@@ -30,7 +30,7 @@
background-color: rgba(249, 252, 255, 1);
">
<!-- <top-item /> -->
<operatingBar :chartData="chartData" @sort-change="sortChange" />
<operatingBar :dateData="dateData" :chartData="chartData" @sort-change="sortChange" />
</div>
</div>
</Container>
@@ -51,6 +51,10 @@ export default {
default: () => ({}),
required: true, // 标记为必填,避免空数据导致异常
},
dateData: {
type: Object,
default: () => ({}),
},
},
data() {
return {

View File

@@ -242,90 +242,8 @@ export default {
]
};
// 毛利率场景数据
const grossProfitData = {
series: [
// 1. 完成率(折线图)
{
name: '完成率',
type: 'line',
yAxisIndex: 1,
lineStyle: { color: 'rgba(40, 138, 255, .5)', width: 2 },
itemStyle: {
color: 'rgba(40, 138, 255, 1)',
borderColor: 'rgba(40, 138, 255, 1)',
borderWidth: 2,
radius: 4
},
areaStyle: {
opacity: 0.2,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(40, 138, 255, .9)' },
{ offset: 1, color: 'rgba(40, 138, 255, 0)' }
])
},
data: [106.7, 96.9, 106.5, 106.1, 93.8, 105.9], // 毛利率完成率(%
symbol: 'circle',
symbolSize: 6
},
// 2. 目标(柱状图)
{
name: '目标',
type: 'bar',
yAxisIndex: 0,
barWidth: 14,
itemStyle: {
color: {
type: 'linear',
x: 0, y: 0, x2: 0, y2: 1,
colorStops: [
{ offset: 0, color: 'rgba(130, 204, 255, 1)' },
{ offset: 1, color: 'rgba(75, 157, 255, 1)' }
]
},
borderRadius: [4, 4, 0, 0],
borderWidth: 0
},
data: [30, 32, 31, 33, 32, 34] // 目标毛利率(万元)
},
// 3. 实际(柱状图)
{
name: '实际',
type: 'bar',
yAxisIndex: 0,
barWidth: 14,
itemStyle: {
color: (params) => {
const safeFlag = [1, 0, 1, 1, 0, 1]; // 达标状态
const currentFlag = safeFlag[params.dataIndex] || 0;
return currentFlag === 1
? {
type: 'linear',
x: 0, y: 0, x2: 0, y2: 1,
colorStops: [
{ offset: 0, color: 'rgba(174, 239, 224, 1)' },
{ offset: 1, color: 'rgba(118, 218, 190, 1)' }
]
}
: {
type: 'linear',
x: 0, y: 0, x2: 0, y2: 1,
colorStops: [
{ offset: 0, color: 'rgba(253, 209, 129, 1)' },
{ offset: 1, color: 'rgba(249, 164, 74, 1)' }
]
};
},
borderRadius: [4, 4, 0, 0],
borderWidth: 0
},
data: [32, 31, 33, 35, 30, 36] // 实际毛利率(万元)
}
]
};
// 根据按钮状态返回对应数据
return this.activeButton === 0 ? salesData : grossProfitData;
return salesData
}
},
methods: {},

View File

@@ -4,9 +4,9 @@
@tabChange="handleChange">
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
<div class="topItem-container" style="display: flex; gap: 8px;">
<div class="dashboard left" @click="handleRoute('/netPriceAnalysis/netPriceAnalysisBase')">
<div class="dashboard left">
<div class="title">
大宗类
大宗类·
</div>
<div class="line">
<operatingSingleBar :detailData="{
@@ -15,9 +15,9 @@
}" />
</div>
</div>
<div class="dashboard right" @click="handleRoute('/unitPriceAnalysis/unitPriceAnalysisBase')">
<div class="dashboard right">
<div class="title">
石料类
石料类·/
</div>
<div class="line">
<operatingSingleBar :detailData="{
@@ -26,9 +26,9 @@
}" />
</div>
</div>
<div class="dashboard right" @click="handleRoute('/unitPriceAnalysis/unitPriceAnalysisBase')">
<div class="dashboard right">
<div class="title">
材料类
材料类·
</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="{
@@ -79,6 +79,10 @@ export default {
relatedTotal: {} // 兜底累计数据
})
},
dateData: {
type: Object,
default: () => ({})
},
title: {
type: String,
default: ''

View File

@@ -14,7 +14,7 @@
{{ formatRate(factoryData?.completeRate) }}%
</div>
<div class="mom">
{{ formatRate(factoryData?.thb) }}%
{{ formatRate(factoryData?.thb) }}%
<img v-if="factoryData?.thb >= 0" class="arrow" src="../../../assets/img/topArrow.png" alt="">
<img v-else class="arrow" src="../../../assets/img/downArrow.png" alt="">
</div>
@@ -111,8 +111,8 @@ export default {
*/
getRateFlag(rate) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
return rate >= 100 ? 1 : 0;
}
return +(rate >= 100 || rate === 0); // + 号将布尔值转为数字true→1false→0
},
}
}
</script>

View File

@@ -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></operatingSingleBar>
@@ -15,7 +15,7 @@
</div>
<div class="dashboard right">
<div class="title">
单价·单位/万元
单价·万元
</div>
<div class="line">
<operatingSingleBar></operatingSingleBar>