2025-12-16 19:32:45 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="card rounded-lg border border-gray-200 pb-2 mb-2">
|
2026-02-08 16:56:41 +08:00
|
|
|
|
<div class="flex items-center justify-between mb-4 px-4 pt-4">
|
|
|
|
|
|
<LTitle title="统计概览" />
|
|
|
|
|
|
<!-- 维度切换按钮组 -->
|
|
|
|
|
|
<div class="inline-flex rounded-full overflow-hidden text-base">
|
|
|
|
|
|
<button class="px-4 py-1 border border-[#2B79EE] rounded-l-full"
|
|
|
|
|
|
:class="dimension === 'id' ? 'bg-[#2B79EE] text-white' : 'bg-white text-[#2B79EE]'"
|
|
|
|
|
|
@click="$emit('update:dimension', 'id')">
|
|
|
|
|
|
身份证匹配
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button class="px-4 py-1 border border-[#2B79EE] border-l-0 rounded-r-full"
|
|
|
|
|
|
:class="dimension === 'cell' ? 'bg-[#2B79EE] text-white' : 'bg-white text-[#2B79EE]'"
|
|
|
|
|
|
@click="$emit('update:dimension', 'cell')">
|
|
|
|
|
|
手机号匹配
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2025-12-16 19:32:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="grid grid-cols-2 gap-4 px-4 pb-4">
|
|
|
|
|
|
<div v-for="item in items" :key="item.label"
|
|
|
|
|
|
class="bg-blue-50 rounded-lg p-3 text-center border border-[#2B79EE1A]">
|
2026-02-08 16:56:41 +08:00
|
|
|
|
<div class="text-2xl font-bold text-[#111827]">
|
2025-12-16 19:32:45 +08:00
|
|
|
|
{{ item.value }}
|
2026-02-08 16:56:41 +08:00
|
|
|
|
<span class="text-base text-gray-500 ml-1">{{ item.unit }}</span>
|
2025-12-16 19:32:45 +08:00
|
|
|
|
</div>
|
2026-02-08 16:56:41 +08:00
|
|
|
|
<div class="text-base text-gray-600 mt-1">
|
2025-12-16 19:32:45 +08:00
|
|
|
|
{{ item.label }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-02-08 16:56:41 +08:00
|
|
|
|
|
2025-12-16 19:32:45 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { computed } from 'vue'
|
|
|
|
|
|
import { getApplicationCounts, getBankOrgDetails, getNBankOrgDetails } from '../utils/dataParser'
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
data: {
|
|
|
|
|
|
type: Object,
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
default: () => ({}),
|
|
|
|
|
|
},
|
2026-02-08 16:56:41 +08:00
|
|
|
|
// 维度:id(身份证) / cell(手机号)
|
|
|
|
|
|
dimension: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: 'id',
|
|
|
|
|
|
},
|
2025-12-16 19:32:45 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const items = computed(() => {
|
|
|
|
|
|
const v = props.data || {}
|
|
|
|
|
|
|
|
|
|
|
|
// 近12个月申请次数(总/银行/非银)
|
2026-02-08 16:56:41 +08:00
|
|
|
|
const m12 = getApplicationCounts(v, 'm12', props.dimension)
|
2025-12-16 19:32:45 +08:00
|
|
|
|
|
|
|
|
|
|
// 近12个月申请机构总数(银行+非银)
|
2026-02-08 16:56:41 +08:00
|
|
|
|
const bankOrgs = getBankOrgDetails(v, 'm12', props.dimension)
|
|
|
|
|
|
const nbankOrgs = getNBankOrgDetails(v, 'm12', props.dimension)
|
2025-12-16 19:32:45 +08:00
|
|
|
|
const bankOrgTotal = Object.values(bankOrgs || {}).reduce((sum, val) => sum + (val || 0), 0)
|
|
|
|
|
|
const nbankOrgTotal = Object.values(nbankOrgs || {}).reduce((sum, val) => sum + (val || 0), 0)
|
|
|
|
|
|
const orgTotal = bankOrgTotal + nbankOrgTotal
|
|
|
|
|
|
|
|
|
|
|
|
// 近12个月周末 / 夜间申请次数(银行+非银)
|
2026-02-08 16:56:41 +08:00
|
|
|
|
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
2025-12-16 19:32:45 +08:00
|
|
|
|
const weekendTotal =
|
2026-02-08 16:56:41 +08:00
|
|
|
|
Number(v[`als_m12_${dimKey}_bank_week_allnum`] || 0) +
|
|
|
|
|
|
Number(v[`als_m12_${dimKey}_nbank_week_allnum`] || 0)
|
2025-12-16 19:32:45 +08:00
|
|
|
|
const nightTotal =
|
2026-02-08 16:56:41 +08:00
|
|
|
|
Number(v[`als_m12_${dimKey}_bank_night_allnum`] || 0) +
|
|
|
|
|
|
Number(v[`als_m12_${dimKey}_nbank_night_allnum`] || 0)
|
2025-12-16 19:32:45 +08:00
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
{ label: '总申请次数', value: m12.total || 0, unit: '次' },
|
|
|
|
|
|
{ label: '总申请机构数', value: orgTotal || 0, unit: '家' },
|
|
|
|
|
|
{ label: '银行申请次数', value: m12.bank || 0, unit: '次' },
|
|
|
|
|
|
{ label: '非银申请次数', value: m12.nbank || 0, unit: '次' },
|
|
|
|
|
|
{ label: '夜间申请次数', value: nightTotal || 0, unit: '次' },
|
|
|
|
|
|
{ label: '周末申请次数', value: weekendTotal || 0, unit: '次' },
|
|
|
|
|
|
]
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.card {
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|