Files
property-manager-side/wuye-manager-uniapp/pageSubPack/statistics/components/DepositCard.vue
2026-08-06 18:03:06 +08:00

94 lines
2.1 KiB
Vue

<template>
<view class="deposit-card">
<view class="deposit-card-header">
<text class="deposit-title">押金余额统计</text>
<text class="deposit-balance">余额合计{{ depositBalance }}元</text>
</view>
<view class="deposit-chart">
<qiun-data-charts type="column" :chartData="depositColumnData" :opts="depositColumnOpts" />
</view>
</view>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
depositBalance: { type: String, default: '0' },
depositRenovation: { type: Number, default: 0 },
depositRental: { type: Number, default: 0 }
})
const depositColumnData = computed(() => ({
categories: ['装修押金', '租赁押金'],
series: [
{ name: '余额', data: [props.depositRenovation, props.depositRental] }
]
}))
const depositColumnOpts = computed(() => ({
color: ['#4D5DFA'],
padding: [20, 10, 0, 10],
enableScroll: false,
legend: { show: false },
xAxis: {
disableGrid: true,
axisLineColor: '#EAEAEA',
fontColor: '#666',
fontSize: 12
},
yAxis: {
data: [{
title: '万元',
min: 0,
max: 80,
axisLineColor: '#EAEAEA',
fontColor: '#666',
fontSize: 12,
titleFontSize: 12,
titleFontColor: '#666'
}],
splitLine: { show: true, lineStyle: { color: '#F2F2F2' } },
calibration: { step: 0.5 }
},
extra: {
column: {
type: 'group',
width: 30,
activeBgColor: '#4D5DFA',
activeBgOpacity: 0.08,
dataLabel: {
show: true,
position: 'top',
fontSize: 12,
color: '#333',
formatter: (val) => val.toFixed(2)
}
}
}
}))
</script>
<style scoped lang="scss">
.deposit-card {
margin-top: 20rpx;
background: #fff;
border-radius: 8rpx;
padding: 30rpx 24rpx;
.deposit-card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.deposit-title { font-size: 32rpx; font-weight: 600; color: #222; }
.deposit-balance { font-size: 28rpx; color: #333; }
}
.deposit-chart {
width: 100%;
height: 420rpx;
}
}
</style>