Files
td_official/src/views/largeScreen/components/rightPage.vue

200 lines
4.8 KiB
Vue
Raw Normal View History

2025-08-20 10:28:23 +08:00
<template>
2025-08-21 14:17:57 +08:00
<div class="rightPage">
<div class="funds">
2025-08-21 17:32:10 +08:00
<TitleComponent :title="'资金KPI'" />
<div class="funds_echarts">
<EchartBox :option="lineOption" />
</div>
</div>
<div class="cashFlow">
<TitleComponent :title="'现金流概述'" />
2025-08-21 20:03:15 +08:00
<div class="inflowData">
<div class="inflow">
<div class="title">现金流入</div>
<div class="number">{{ bigDataObj.incomeCash }}</div>
2025-08-21 20:03:15 +08:00
<div class="unit">万元</div>
</div>
<div class="inflow">
<div class="title">现金流出</div>
<div class="number">{{ bigDataObj.expensesCash }}</div>
2025-08-21 20:03:15 +08:00
<div class="unit">万元</div>
</div>
<div class="inflow">
<div class="title">净现金流</div>
<div class="number">{{ bigDataObj.profitCash }}</div>
2025-08-21 20:03:15 +08:00
<div class="unit">万元</div>
</div>
</div>
<div class="inflow_echarts">
<EchartBox :option="barOption" />
</div>
<div class="progress">
<!-- <div class="progress_item">
2025-08-21 20:03:15 +08:00
<div class="title">项目进度</div>
<div class="number">100%</div>
</div> -->
<ProgressComponent title="现金比率" value="123,456.78" percentageChange="98.11%" :progressPercentage="100"
progressColor="rgba(29, 214, 255, 1)" :isShowPrice="false" class="progress_text" />
2025-08-21 20:03:15 +08:00
</div>
2025-08-21 14:17:57 +08:00
</div>
</div>
2025-08-20 10:28:23 +08:00
</template>
2025-08-21 17:32:10 +08:00
<script setup lang="ts">
import TitleComponent from './TitleComponent.vue';
import EchartBox from '@/components/EchartBox/index.vue';
import { getLineOption, getBarOptions } from './optionList';
import ProgressComponent from './ProgressComponent.vue';
import { monthMoney, monthCash, cashTotal } from '@/api/largeScreen';
2025-08-21 17:32:10 +08:00
const lineOption = ref();
2025-08-21 20:03:15 +08:00
const barOption = ref();
const bigDataObj = ref<any>({});
2025-08-21 20:03:15 +08:00
const getCapitalData = async () => {
const { data } = await monthMoney()
const month = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
const income = data.map((item: any) => item.incomeAmount);
const expenses = data.map((item: any) => item.expensesAmount);
const profit = data.map((item: any) => item.profitAmount);
2025-08-21 17:32:10 +08:00
const lineData = {
xLabel: month,
2025-08-21 17:32:10 +08:00
line1: [
income,
expenses,
profit
2025-08-21 17:32:10 +08:00
]
// line2: ['20', '50', '12', '65', '30', '60']
};
lineOption.value = getLineOption(lineData);
};
const getTurnoverList = async () => {
2025-08-21 20:03:15 +08:00
// const xData = data.map((item) => item.time);
// const yData = data.map((item) => {
// // 先将content转换为数字再调用toFixed
// const num = Number(item.content);
// return isNaN(num) ? 0 : Number(num.toFixed(2));
// });
const { data } = await monthCash()
// const month = data.map((item: any) => item.month);
const month = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
const income = data.map((item: any) => item.incomeAmount);
const expenses = data.map((item: any) => item.expensesAmount);
2025-08-21 20:03:15 +08:00
const barData = {
name: month,
2025-08-21 20:03:15 +08:00
value: [
income,
expenses
2025-08-21 20:03:15 +08:00
]
};
barOption.value = getBarOptions(barData);
};
const getTotalAmonunt = async () => {
const { data } = await cashTotal()
bigDataObj.value = data
};
2025-08-21 17:32:10 +08:00
onMounted(() => {
getCapitalData();
2025-08-21 20:03:15 +08:00
getTurnoverList();
getTotalAmonunt();
2025-08-21 17:32:10 +08:00
});
//资金KPI
</script>
2025-08-20 10:28:23 +08:00
<style scoped lang="scss">
.rightPage {
width: 100%;
height: 100%;
2025-08-21 17:32:10 +08:00
box-sizing: border-box;
// padding: 5px;
2025-08-20 10:28:23 +08:00
}
2025-08-21 14:17:57 +08:00
.funds {
width: 100%;
2025-08-21 17:32:10 +08:00
// height: 40%;
border: 1px solid rgba(29, 214, 255, 0.3);
box-sizing: border-box;
padding: 10px 5px;
}
2025-08-21 17:32:10 +08:00
.funds_echarts {
width: 100%;
2025-08-21 20:03:15 +08:00
height: 25vh;
2025-08-21 17:32:10 +08:00
padding: 10px 0 0 0;
}
2025-08-21 17:32:10 +08:00
.cashFlow {
width: 100%;
// height: 50%;
2025-08-21 14:17:57 +08:00
border: 1px solid rgba(29, 214, 255, 0.3);
box-sizing: border-box;
2025-08-21 17:32:10 +08:00
padding: 10px 5px;
margin-top: 10px;
2025-08-21 14:17:57 +08:00
}
2025-08-21 20:03:15 +08:00
.inflowData {
width: 100%;
height: 12vh;
// background: #fff;
padding-top: 20px;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
2025-08-21 20:03:15 +08:00
.inflow {
width: 100%;
height: 100%;
// background: #f5f5f5;
padding: 10px;
box-sizing: border-box;
background: rgba(29, 214, 255, 0.1);
border-left: 1px solid rgba(29, 214, 255, 1);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.title {
font-size: 14px;
// font-weight: 500;
color: #fff;
padding-bottom: 10px;
}
2025-08-21 20:03:15 +08:00
.number {
font-size: 24px;
// font-weight: 500;
color: #fff;
padding-bottom: 10px;
}
2025-08-21 20:03:15 +08:00
.unit {
font-size: 12px;
// font-weight: 500;
color: rgba(255, 255, 255, 0.5);
}
}
}
2025-08-21 20:03:15 +08:00
.inflow_echarts {
width: 100%;
height: 25vh;
margin-top: 20px;
}
2025-08-21 20:03:15 +08:00
.progress {
width: 100%;
margin-top: 10px;
}
:deep(.progress_text) {
.roboto {
color: #fff;
}
2025-08-21 20:03:15 +08:00
}
2025-08-20 10:28:23 +08:00
</style>