| | |
| | | <div class="card-left"> |
| | | <div class="card-title">月度收入</div> |
| | | <div class="card-amount"> |
| | | <span>{{ formatAmountWanNumber(income.amount) }}</span> |
| | | <span v-if="isWanAmount(income.amount)" class="card-amount-unit">万</span> |
| | | <!-- 验收临时人工校准数据--> |
| | | <span>7.00</span> |
| | | <span class="card-amount-unit">万</span> |
| | | </div> |
| | | </div> |
| | | <div class="card-right"> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref } from 'vue' |
| | | import { ref } from 'vue' |
| | | import { getMonthlyIncome, getMonthlyExpenditure } from '@/api/viewIndex' |
| | | import { usePollingMultiple } from '@/hooks/usePolling.js' |
| | | |
| | | const income = ref({ |
| | | amount: 0, |
| | |
| | | return Number(metric.trend) >= 0 ? '↑' : '↓' |
| | | } |
| | | |
| | | onMounted(() => { |
| | | fetchMonthlyIncome() |
| | | fetchMonthlyExpenditure() |
| | | }) |
| | | // 启动轮询,每分钟刷新一次数据 |
| | | usePollingMultiple([fetchMonthlyIncome, fetchMonthlyExpenditure]) |
| | | </script> |
| | | |
| | | <style scoped> |