运营驾驶舱修改部分

This commit is contained in:
2026-03-27 11:12:13 +08:00
parent b85ceb2542
commit 05fe91618c
13 changed files with 672 additions and 44 deletions

View File

@@ -1,11 +1,11 @@
<template>
<div style="flex: 1">
<Container name="销售重点指标" icon="cockpitItemIcon" size="topBasic" topSize="basic">
<Container name="销售重点指标" icon="cockpitItemIcon" size="topBasic" topSize="basic" :isShowTab='true' @tabChange='tabChange'>
<!-- 1. 移除 .kpi-content 的固定高度改为自适应 -->
<div class="kpi-content" style="padding: 14px 16px; display: flex;flex-direction: column; width: 100%;">
<!-- 2. .top 保持 flex无需固定高度自动跟随子元素拉伸 -->
<div class="top" style="display: flex; width: 100%;">
<top-item :sale="sale" :dateData="dateData" />
<top-item :sale="saleData" :dateData="dateData" />
</div>
<div class="bottom"
style="display: flex; width: 100%;margin-top: 8px;background-color: rgba(249, 252, 255, 1);">
@@ -39,16 +39,39 @@ export default {
},
data() {
return {
chart: null
chart: null,
saleData:{},
currentTap:'month'
}
},
watch: {
sale: {
handler(newVal) {
if(this.currentTap === 'month') {
this.saleData = this.sale.mon
}else{
this.saleData = this.sale.total
}
},
deep: true
}
},
mounted() {
// 初始化图表(若需展示图表,需在模板中添加对应 DOM
// this.$nextTick(() => this.updateChart())
this.saleData = this.sale.month
},
methods: {
tabChange(val) {
if(val === 'month') {
this.currentTap = 'month'
this.saleData = this.sale.mon
}else{
this.currentTap = 'total'
this.saleData = this.sale.total
}
console.log(this.saleData);
}
}
}
</script>