xiugai
This commit is contained in:
@@ -2,9 +2,6 @@
|
||||
<div class="coreBar">
|
||||
<!-- 新增行容器:包裹“各基地情况”和barTop -->
|
||||
<div class="header-row">
|
||||
<div class="base-title">
|
||||
各基地情况
|
||||
</div>
|
||||
<div class="barTop">
|
||||
<!-- 关键:新增右侧容器,包裹图例和按钮组,实现整体靠右 -->
|
||||
<div class="right-container">
|
||||
@@ -259,10 +256,10 @@ export default {
|
||||
// 新增:头部行容器,实现一行排列
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between; // 左右两端对齐
|
||||
align-items: center; // 垂直居中
|
||||
width: 100%;
|
||||
margin-bottom: 8px; // 与下方图表区保留间距(可根据需求调整)
|
||||
justify-content: flex-end; // 左右两端对齐
|
||||
align-items: center; // 垂直居中
|
||||
// width: 100%;
|
||||
margin-bottom: 8px; // 与下方图表区保留间距(可根据需求调整)调整)
|
||||
}
|
||||
|
||||
// 各基地情况标题样式
|
||||
|
||||
@@ -93,8 +93,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→1,false→0)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)',
|
||||
|
||||
@@ -117,7 +117,7 @@ export default {
|
||||
fontSize: 12,
|
||||
align: 'right'
|
||||
},
|
||||
scale: true,
|
||||
|
||||
splitNumber: 4,
|
||||
axisTick: { show: false },
|
||||
axisLabel: {
|
||||
|
||||
@@ -28,7 +28,11 @@ export default {
|
||||
chartData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
}
|
||||
},
|
||||
dateData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
@@ -44,7 +48,7 @@ export default {
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 组件销毁时清理资源
|
||||
@@ -80,7 +84,8 @@ export default {
|
||||
path: 'operatingProfitBase',
|
||||
query: { // 使用query传递参数(推荐),也可使用params
|
||||
// baseName: itemName,
|
||||
factory: baseIndex
|
||||
factory: baseIndex,
|
||||
dateData: this.dateData
|
||||
}
|
||||
// 若仍需用base作为参数:
|
||||
// base: itemName,
|
||||
@@ -116,11 +121,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
grid: {
|
||||
top: 30,
|
||||
bottom: 30,
|
||||
right: 70,
|
||||
left: 40
|
||||
left: 60
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
@@ -154,7 +159,7 @@ export default {
|
||||
fontSize: 12,
|
||||
align: 'right'
|
||||
},
|
||||
scale: true,
|
||||
|
||||
splitNumber: 4,
|
||||
axisTick: { show: true },
|
||||
axisLabel: {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
],
|
||||
|
||||
@@ -84,10 +84,10 @@ export default {
|
||||
// }
|
||||
},
|
||||
grid: {
|
||||
top: 40,
|
||||
bottom: 50,
|
||||
right: 70,
|
||||
left: 60,
|
||||
top: 30,
|
||||
bottom: 60,
|
||||
right: 20,
|
||||
left: 40,
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
type: 'solid' // 实线(可选:dashed虚线、dotted点线)
|
||||
}
|
||||
},
|
||||
scale: true,
|
||||
|
||||
splitNumber: 2,
|
||||
axisTick: { show: false },
|
||||
axisLabel: {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
width: 1220px;
|
||||
background-color: rgba(249, 252, 255, 1);
|
||||
">
|
||||
<operatingBar :chartData="chartData?.barData || {}" />
|
||||
<operatingBar :dateData="dateData" :chartData="chartData?.barData || {}" />
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
@@ -60,6 +60,10 @@ export default {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
dateData: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
width: 1220px;
|
||||
background-color: rgba(249, 252, 255, 1);
|
||||
">
|
||||
<operatingBar :chartData="chartData?.barData || {}" />
|
||||
<operatingBar :dateData="dateData" :chartData="chartData?.barData || {}" />
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
@@ -60,6 +60,10 @@ export default {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
dateData: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<!-- 1. 销量组件:传递当前激活数据集中的销量数据 -->
|
||||
<div class="dashboard left" @click="handleDashboardClick('/salesVolumeAnalysis/salesVolumeAnalysisBase')">
|
||||
<div class="title">
|
||||
销量·单位/万元
|
||||
销量·万㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="salesData"></operatingSingleBar>
|
||||
@@ -17,7 +17,7 @@
|
||||
<!-- 2. 单价组件:传递当前激活数据集中的单价数据 -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/unitPriceAnalysis/unitPriceAnalysisBase')">
|
||||
<div class="title">
|
||||
单价·单位/万元
|
||||
单价·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="unitPriceData"></operatingSingleBar>
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="dashboard right"
|
||||
@click="handleDashboardClick('/productionCostAnalysis/productionCostAnalysisBase')">
|
||||
<div class="title">
|
||||
成本·单位/万元
|
||||
成本·元/㎡
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="costData"></operatingSingleBar>
|
||||
@@ -36,7 +36,7 @@
|
||||
<!-- 4. 管理费用组件:传递当前激活数据集中的管理费用数据 -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/expenseAnalysis/expenseAnalysisBase')">
|
||||
<div class="title">
|
||||
管理费用·单位/万元
|
||||
管理费用·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="manageCostData"></operatingSingleBar>
|
||||
@@ -45,7 +45,7 @@
|
||||
<!-- 5. 销售费用组件:传递当前激活数据集中的销售费用数据 -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/expenseAnalysis/expenseAnalysisBase')">
|
||||
<div class="title">
|
||||
销售费用·单位/万元
|
||||
销售费用·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="salesCostData"></operatingSingleBar>
|
||||
@@ -54,7 +54,7 @@
|
||||
<!-- 6. 财务费用组件:传递当前激活数据集中的财务费用数据 -->
|
||||
<div class="dashboard right" @click="handleDashboardClick('/expenseAnalysis/expenseAnalysisBase')">
|
||||
<div class="title">
|
||||
财务费用·单位/万元
|
||||
财务费用·万元
|
||||
</div>
|
||||
<div class="line">
|
||||
<operatingSingleBar :detailData="financeCostData"></operatingSingleBar>
|
||||
@@ -82,6 +82,10 @@ export default {
|
||||
relatedTotal: [] // 累计数据(数组格式,存储销量/单价等数据)
|
||||
})
|
||||
},
|
||||
dateData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
factory: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
@@ -173,7 +177,8 @@ export default {
|
||||
this.$router.push({
|
||||
path: path,
|
||||
query: {
|
||||
factory: this.$route.query.factory ? this.$route.query.factory : this,factory
|
||||
factory: this.$route.query.factory ? this.$route.query.factory : this.factory,
|
||||
dateData: this.dateData
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
@@ -96,8 +96,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→1,false→0)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user