更新:JRZQ6F2A更新
This commit is contained in:
@@ -52,6 +52,11 @@ const props = defineProps({
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({})
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -61,7 +66,7 @@ const labels = periodKeys.map(key => PERIOD_MAP[key].label)
|
||||
// 总申请次数图表配置
|
||||
const chartOption = computed(() => {
|
||||
const data = periodKeys.map(key => {
|
||||
const counts = getApplicationCounts(props.data, key)
|
||||
const counts = getApplicationCounts(props.data, key, props.dimension)
|
||||
return counts.total
|
||||
})
|
||||
|
||||
@@ -137,11 +142,11 @@ const chartOption = computed(() => {
|
||||
// 特殊时段(周末 / 夜间)图表配置
|
||||
const specialChartOption = computed(() => {
|
||||
const weekendData = periodKeys.map(key => {
|
||||
const s = getSpecialPeriodCounts(props.data, key)
|
||||
const s = getSpecialPeriodCounts(props.data, key, props.dimension)
|
||||
return s.weekend || 0
|
||||
})
|
||||
const nightData = periodKeys.map(key => {
|
||||
const s = getSpecialPeriodCounts(props.data, key)
|
||||
const s = getSpecialPeriodCounts(props.data, key, props.dimension)
|
||||
return s.night || 0
|
||||
})
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<template>
|
||||
<div class="card application-total-section">
|
||||
<div class="rounded-lg border border-gray-200 pb-2 mb-4">
|
||||
<div class="flex items-center mb-4 p-4">
|
||||
<span class="font-bold text-gray-800">申请总次数 (银行+非银) {{ totalCount }}次</span>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<!-- Tab切换 -->
|
||||
<div class="mb-6">
|
||||
@@ -13,10 +10,9 @@
|
||||
<van-tab v-for="(period, index) in periods" :key="period.key" :title="period.label">
|
||||
<div class="p-4">
|
||||
<!-- 银行机构 -->
|
||||
<BankInstitutionSection :data="data" :period="period.key" />
|
||||
|
||||
<BankInstitutionSection :data="data" :period="period.key" :dimension="dimension" />
|
||||
<!-- 非银机构 -->
|
||||
<NBankInstitutionSection :data="data" :period="period.key" />
|
||||
<NBankInstitutionSection :data="data" :period="period.key" :dimension="dimension" />
|
||||
</div>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
@@ -28,9 +24,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import LTitle from '@/components/LTitle.vue'
|
||||
import { getApplicationCounts, PERIOD_MAP } from '../utils/dataParser'
|
||||
import BankInstitutionSection from './BankInstitutionSection.vue'
|
||||
import NBankInstitutionSection from './NBankInstitutionSection.vue'
|
||||
|
||||
@@ -39,6 +34,11 @@ const props = defineProps({
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({})
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -52,12 +52,6 @@ const periods = [
|
||||
{ key: 'm6', label: '6个月' },
|
||||
{ key: 'm12', label: '12个月' }
|
||||
]
|
||||
|
||||
// 计算总申请次数(12个月)
|
||||
const totalCount = computed(() => {
|
||||
const counts = getApplicationCounts(props.data, 'm12')
|
||||
return counts.total
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -53,6 +53,11 @@ const props = defineProps({
|
||||
period: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -69,7 +74,9 @@ const COLORS = [
|
||||
]
|
||||
|
||||
// 获取银行机构申请详情
|
||||
const bankDetails = computed(() => getBankApplicationDetails(props.data, props.period))
|
||||
const bankDetails = computed(() =>
|
||||
getBankApplicationDetails(props.data, props.period, props.dimension)
|
||||
)
|
||||
|
||||
// 计算银行机构总次数
|
||||
const bankTotal = computed(() => {
|
||||
|
||||
@@ -53,6 +53,11 @@ const props = defineProps({
|
||||
period: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -69,7 +74,9 @@ const COLORS = [
|
||||
]
|
||||
|
||||
// 获取银行机构数详情
|
||||
const bankOrgs = computed(() => getBankOrgDetails(props.data, props.period))
|
||||
const bankOrgs = computed(() =>
|
||||
getBankOrgDetails(props.data, props.period, props.dimension)
|
||||
)
|
||||
|
||||
// 计算银行机构总数
|
||||
const bankTotal = computed(() => {
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
<van-tab v-for="(period, index) in periods" :key="period.key" :title="period.label">
|
||||
<div class="p-4">
|
||||
<!-- 银行机构 -->
|
||||
<BankOrgSection :data="data" :period="period.key" />
|
||||
<BankOrgSection :data="data" :period="period.key" :dimension="dimension" />
|
||||
|
||||
<!-- 非银机构 -->
|
||||
<NBankOrgSection :data="data" :period="period.key" />
|
||||
<NBankOrgSection :data="data" :period="period.key" :dimension="dimension" />
|
||||
</div>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
@@ -25,9 +25,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import LTitle from '@/components/LTitle.vue'
|
||||
import { getBankOrgDetails, getNBankOrgDetails } from '../utils/dataParser'
|
||||
import BankOrgSection from './BankOrgSection.vue'
|
||||
import NBankOrgSection from './NBankOrgSection.vue'
|
||||
|
||||
@@ -36,6 +35,11 @@ const props = defineProps({
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({})
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -49,15 +53,6 @@ const periods = [
|
||||
{ key: 'm6', label: '6个月' },
|
||||
{ key: 'm12', label: '12个月' }
|
||||
]
|
||||
|
||||
// 计算总机构数(12个月)
|
||||
const totalCount = computed(() => {
|
||||
const bankOrgs = getBankOrgDetails(props.data, 'm12')
|
||||
const nbankOrgs = getNBankOrgDetails(props.data, 'm12')
|
||||
const bankTotal = Object.values(bankOrgs).reduce((sum, val) => sum + (val || 0), 0)
|
||||
const nbankTotal = Object.values(nbankOrgs).reduce((sum, val) => sum + (val || 0), 0)
|
||||
return bankTotal + nbankTotal
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -53,6 +53,11 @@ const props = defineProps({
|
||||
period: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -69,7 +74,9 @@ const COLORS = [
|
||||
]
|
||||
|
||||
// 获取非银机构申请详情
|
||||
const nbankDetails = computed(() => getNBankApplicationDetails(props.data, props.period))
|
||||
const nbankDetails = computed(() =>
|
||||
getNBankApplicationDetails(props.data, props.period, props.dimension)
|
||||
)
|
||||
|
||||
// 计算非银机构总次数
|
||||
const nbankTotal = computed(() => {
|
||||
|
||||
@@ -53,6 +53,11 @@ const props = defineProps({
|
||||
period: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -69,7 +74,9 @@ const COLORS = [
|
||||
]
|
||||
|
||||
// 获取非银机构数详情
|
||||
const nbankOrgs = computed(() => getNBankOrgDetails(props.data, props.period))
|
||||
const nbankOrgs = computed(() =>
|
||||
getNBankOrgDetails(props.data, props.period, props.dimension)
|
||||
)
|
||||
|
||||
// 计算非银机构总数
|
||||
const nbankTotal = computed(() => {
|
||||
|
||||
@@ -52,6 +52,11 @@ const props = defineProps({
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({})
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -79,7 +84,8 @@ const detailList = computed(() => {
|
||||
const labels = FIELD_LABELS.bank || {}
|
||||
|
||||
return TYPE_KEYS.map((key, index) => {
|
||||
const field = `${PREFIX}_id_${key}_allnum`
|
||||
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
||||
const field = `${PREFIX}_${dimKey}_${key}_allnum`
|
||||
const value = getValue(v[field]) || 0
|
||||
|
||||
return {
|
||||
@@ -170,15 +176,4 @@ const chartOption = computed(() => {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
{
|
||||
"cells": [],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
</style>
|
||||
@@ -48,15 +48,38 @@ const props = defineProps({
|
||||
required: true,
|
||||
default: () => ({}),
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id',
|
||||
},
|
||||
})
|
||||
|
||||
const bankCons = computed(() => getValue(props.data?.als_lst_id_bank_consnum))
|
||||
const bankDays = computed(() => getValue(props.data?.als_lst_id_bank_csinteday))
|
||||
const nbankCons = computed(() => getValue(props.data?.als_lst_id_nbank_consnum))
|
||||
const nbankDays = computed(() => getValue(props.data?.als_lst_id_nbank_csinteday))
|
||||
const bankCons = computed(() => {
|
||||
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
||||
return getValue(props.data?.[`als_lst_${dimKey}_bank_consnum`])
|
||||
})
|
||||
const bankDays = computed(() => {
|
||||
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
||||
return getValue(props.data?.[`als_lst_${dimKey}_bank_csinteday`])
|
||||
})
|
||||
const nbankCons = computed(() => {
|
||||
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
||||
return getValue(props.data?.[`als_lst_${dimKey}_nbank_consnum`])
|
||||
})
|
||||
const nbankDays = computed(() => {
|
||||
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
||||
return getValue(props.data?.[`als_lst_${dimKey}_nbank_csinteday`])
|
||||
})
|
||||
|
||||
const bankGap = computed(() => getValue(props.data?.als_lst_id_bank_inteday))
|
||||
const nbankGap = computed(() => getValue(props.data?.als_lst_id_nbank_inteday))
|
||||
const bankGap = computed(() => {
|
||||
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
||||
return getValue(props.data?.[`als_lst_${dimKey}_bank_inteday`])
|
||||
})
|
||||
const nbankGap = computed(() => {
|
||||
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
||||
return getValue(props.data?.[`als_lst_${dimKey}_nbank_inteday`])
|
||||
})
|
||||
|
||||
const hasAnyData = computed(() => {
|
||||
return (
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
<template>
|
||||
<div class="card rounded-lg border border-gray-200 pb-2 mb-2">
|
||||
<div class="flex items-center mb-4 p-4">
|
||||
<span class="font-bold text-gray-800">借贷申请统计概览</span>
|
||||
<div class="flex items-center justify-between mb-4 px-4 pt-4">
|
||||
<span class="font-bold text-gray-800">借贷意向统计概览</span>
|
||||
<!-- 维度切换按钮组 -->
|
||||
<div class="inline-flex rounded-full overflow-hidden text-sm">
|
||||
<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>
|
||||
</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]">
|
||||
<div class="text-xl font-bold text-[#111827]">
|
||||
{{ item.value }}
|
||||
<span class="text-xs text-gray-500 ml-1">{{ item.unit }}</span>
|
||||
<span class="text-sm text-gray-500 ml-1">{{ item.unit }}</span>
|
||||
</div>
|
||||
<div class="text-xs text-gray-600 mt-1">
|
||||
<div class="text-sm text-gray-600 mt-1">
|
||||
{{ item.label }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,26 +41,34 @@ const props = defineProps({
|
||||
required: true,
|
||||
default: () => ({}),
|
||||
},
|
||||
// 维度:id(身份证) / cell(手机号)
|
||||
dimension: {
|
||||
type: String,
|
||||
default: 'id',
|
||||
},
|
||||
})
|
||||
|
||||
const items = computed(() => {
|
||||
const v = props.data || {}
|
||||
|
||||
// 近12个月申请次数(总/银行/非银)
|
||||
const m12 = getApplicationCounts(v, 'm12')
|
||||
const m12 = getApplicationCounts(v, 'm12', props.dimension)
|
||||
|
||||
// 近12个月申请机构总数(银行+非银)
|
||||
const bankOrgs = getBankOrgDetails(v, 'm12')
|
||||
const nbankOrgs = getNBankOrgDetails(v, 'm12')
|
||||
const bankOrgs = getBankOrgDetails(v, 'm12', props.dimension)
|
||||
const nbankOrgs = getNBankOrgDetails(v, 'm12', props.dimension)
|
||||
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个月周末 / 夜间申请次数(银行+非银)
|
||||
const dimKey = props.dimension === 'cell' ? 'cell' : 'id'
|
||||
const weekendTotal =
|
||||
Number(v.als_m12_id_bank_week_allnum || 0) + Number(v.als_m12_id_nbank_week_allnum || 0)
|
||||
Number(v[`als_m12_${dimKey}_bank_week_allnum`] || 0) +
|
||||
Number(v[`als_m12_${dimKey}_nbank_week_allnum`] || 0)
|
||||
const nightTotal =
|
||||
Number(v.als_m12_id_bank_night_allnum || 0) + Number(v.als_m12_id_nbank_night_allnum || 0)
|
||||
Number(v[`als_m12_${dimKey}_bank_night_allnum`] || 0) +
|
||||
Number(v[`als_m12_${dimKey}_nbank_night_allnum`] || 0)
|
||||
|
||||
return [
|
||||
{ label: '总申请次数', value: m12.total || 0, unit: '次' },
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<template>
|
||||
<div class="flex flex-col gap-4">
|
||||
<!-- 统计概览小模块 -->
|
||||
<SummaryApplyStats :data="variableValue" />
|
||||
<!-- 统计概览小模块(内部自带维度切换按钮) -->
|
||||
<SummaryApplyStats v-model:dimension="activeDimension" :data="variableValue" />
|
||||
|
||||
<!-- 申请次数 -->
|
||||
<ApplicationCountSection :data="variableValue" />
|
||||
<ApplicationCountSection :data="variableValue" :dimension="activeDimension" />
|
||||
|
||||
<!-- 产品类型申请分布 -->
|
||||
<ProductTypeDistributionSection :data="variableValue" />
|
||||
<ProductTypeDistributionSection :data="variableValue" :dimension="activeDimension" />
|
||||
|
||||
<!-- 近期集中申请提示 -->
|
||||
<RecentIntensiveApplicationSection :data="variableValue" />
|
||||
<RecentIntensiveApplicationSection :data="variableValue" :dimension="activeDimension" />
|
||||
|
||||
<!-- 申请总次数 (银行+非银) -->
|
||||
<ApplicationTotalSection :data="variableValue" />
|
||||
<ApplicationTotalSection :data="variableValue" :dimension="activeDimension" />
|
||||
|
||||
<!-- 申请机构总数 (银行+非银) -->
|
||||
<InstitutionTotalSection :data="variableValue" />
|
||||
<InstitutionTotalSection :data="variableValue" :dimension="activeDimension" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRiskNotifier } from '@/composables/useRiskNotifier'
|
||||
import { extractVariableValue } from './utils/dataParser'
|
||||
import ApplicationCountSection from './components/ApplicationCountSection.vue'
|
||||
@@ -51,6 +51,9 @@ const props = defineProps({
|
||||
},
|
||||
})
|
||||
|
||||
// 当前维度:id(身份证) / cell(手机号)
|
||||
const activeDimension = ref('id')
|
||||
|
||||
// 获取数据
|
||||
const rawData = computed(() => props.data?.data || props.data || {})
|
||||
|
||||
@@ -60,6 +63,7 @@ const variableValue = computed(() => extractVariableValue(rawData.value))
|
||||
// 计算风险评分(0-100分,分数越高越安全)
|
||||
const riskScore = computed(() => {
|
||||
const data = variableValue.value
|
||||
const dimKey = activeDimension.value === 'cell' ? 'cell' : 'id'
|
||||
|
||||
if (!data || Object.keys(data).length === 0) {
|
||||
return 100 // 无数据视为最安全
|
||||
@@ -68,7 +72,9 @@ const riskScore = computed(() => {
|
||||
let score = 100 // 初始满分
|
||||
|
||||
// 近7天申请次数评估
|
||||
const d7Total = parseInt(data.als_d7_id_bank_allnum || 0) + parseInt(data.als_d7_id_nbank_allnum || 0)
|
||||
const d7Total =
|
||||
parseInt(data[`als_d7_${dimKey}_bank_allnum`] || 0) +
|
||||
parseInt(data[`als_d7_${dimKey}_nbank_allnum`] || 0)
|
||||
if (d7Total > 5) {
|
||||
score -= 20 // 近7天申请过多
|
||||
} else if (d7Total > 3) {
|
||||
@@ -76,7 +82,9 @@ const riskScore = computed(() => {
|
||||
}
|
||||
|
||||
// 近15天申请次数评估
|
||||
const d15Total = parseInt(data.als_d15_id_bank_allnum || 0) + parseInt(data.als_d15_id_nbank_allnum || 0)
|
||||
const d15Total =
|
||||
parseInt(data[`als_d15_${dimKey}_bank_allnum`] || 0) +
|
||||
parseInt(data[`als_d15_${dimKey}_nbank_allnum`] || 0)
|
||||
if (d15Total > 10) {
|
||||
score -= 15
|
||||
} else if (d15Total > 5) {
|
||||
@@ -84,7 +92,9 @@ const riskScore = computed(() => {
|
||||
}
|
||||
|
||||
// 近1个月申请次数评估
|
||||
const m1Total = parseInt(data.als_m1_id_bank_allnum || 0) + parseInt(data.als_m1_id_nbank_allnum || 0)
|
||||
const m1Total =
|
||||
parseInt(data[`als_m1_${dimKey}_bank_allnum`] || 0) +
|
||||
parseInt(data[`als_m1_${dimKey}_nbank_allnum`] || 0)
|
||||
if (m1Total > 15) {
|
||||
score -= 20
|
||||
} else if (m1Total > 8) {
|
||||
@@ -92,7 +102,9 @@ const riskScore = computed(() => {
|
||||
}
|
||||
|
||||
// 近3个月申请次数评估
|
||||
const m3Total = parseInt(data.als_m3_id_bank_allnum || 0) + parseInt(data.als_m3_id_nbank_allnum || 0)
|
||||
const m3Total =
|
||||
parseInt(data[`als_m3_${dimKey}_bank_allnum`] || 0) +
|
||||
parseInt(data[`als_m3_${dimKey}_nbank_allnum`] || 0)
|
||||
if (m3Total > 20) {
|
||||
score -= 15
|
||||
} else if (m3Total > 10) {
|
||||
@@ -100,7 +112,9 @@ const riskScore = computed(() => {
|
||||
}
|
||||
|
||||
// 近6个月申请次数评估
|
||||
const m6Total = parseInt(data.als_m6_id_bank_allnum || 0) + parseInt(data.als_m6_id_nbank_allnum || 0)
|
||||
const m6Total =
|
||||
parseInt(data[`als_m6_${dimKey}_bank_allnum`] || 0) +
|
||||
parseInt(data[`als_m6_${dimKey}_nbank_allnum`] || 0)
|
||||
if (m6Total > 30) {
|
||||
score -= 10
|
||||
} else if (m6Total > 15) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 数据解析工具函数
|
||||
* 用于解析借贷申请验证A的返回数据
|
||||
* 用于解析借贷意向验证A的返回数据
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -53,19 +53,20 @@ export const PERIOD_MAP = {
|
||||
/**
|
||||
* 获取申请次数(按时间段)
|
||||
*/
|
||||
export function getApplicationCounts(variableValue, period) {
|
||||
export function getApplicationCounts(variableValue, period, dimension = "id") {
|
||||
const { prefix } = PERIOD_MAP[period];
|
||||
const dimKey = dimension === "cell" ? "cell" : "id";
|
||||
|
||||
// 计算总申请次数(所有类型的申请次数之和)
|
||||
const types = [
|
||||
"id_pdl_allnum", // 线上小额现金贷
|
||||
"id_caon_allnum", // 线上现金分期
|
||||
"id_rel_allnum", // 信用卡(类信用卡)
|
||||
"id_caoff_allnum", // 线下现金分期
|
||||
"id_cooff_allnum", // 线下消费分期
|
||||
"id_af_allnum", // 汽车金融
|
||||
"id_coon_allnum", // 线上消费分期
|
||||
"id_oth_allnum", // 其他
|
||||
`${dimKey}_pdl_allnum`, // 线上小额现金贷
|
||||
`${dimKey}_caon_allnum`, // 线上现金分期
|
||||
`${dimKey}_rel_allnum`, // 信用卡(类信用卡)
|
||||
`${dimKey}_caoff_allnum`, // 线下现金分期
|
||||
`${dimKey}_cooff_allnum`, // 线下消费分期
|
||||
`${dimKey}_af_allnum`, // 汽车金融
|
||||
`${dimKey}_coon_allnum`, // 线上消费分期
|
||||
`${dimKey}_oth_allnum`, // 其他
|
||||
];
|
||||
|
||||
let total = 0;
|
||||
@@ -75,11 +76,12 @@ export function getApplicationCounts(variableValue, period) {
|
||||
});
|
||||
|
||||
// 银行机构申请次数
|
||||
const bankTotal = getValue(variableValue[`${prefix}_id_bank_allnum`]) || 0;
|
||||
const bankTotal =
|
||||
getValue(variableValue[`${prefix}_${dimKey}_bank_allnum`]) || 0;
|
||||
|
||||
// 非银机构申请次数
|
||||
const nbankTotal =
|
||||
getValue(variableValue[`${prefix}_id_nbank_allnum`]) || 0;
|
||||
getValue(variableValue[`${prefix}_${dimKey}_nbank_allnum`]) || 0;
|
||||
|
||||
// 如果计算出的total为0,则使用银行+非银的总和
|
||||
const finalTotal = total > 0 ? total : bankTotal + nbankTotal;
|
||||
@@ -94,17 +96,22 @@ export function getApplicationCounts(variableValue, period) {
|
||||
/**
|
||||
* 获取特殊时段(周末/夜间)申请次数(按时间段,银行+非银)
|
||||
*/
|
||||
export function getSpecialPeriodCounts(variableValue, period) {
|
||||
export function getSpecialPeriodCounts(
|
||||
variableValue,
|
||||
period,
|
||||
dimension = "id"
|
||||
) {
|
||||
const { prefix } = PERIOD_MAP[period];
|
||||
const dimKey = dimension === "cell" ? "cell" : "id";
|
||||
|
||||
const weekendBank =
|
||||
getValue(variableValue[`${prefix}_id_bank_week_allnum`]) || 0;
|
||||
getValue(variableValue[`${prefix}_${dimKey}_bank_week_allnum`]) || 0;
|
||||
const weekendNbank =
|
||||
getValue(variableValue[`${prefix}_id_nbank_week_allnum`]) || 0;
|
||||
getValue(variableValue[`${prefix}_${dimKey}_nbank_week_allnum`]) || 0;
|
||||
const nightBank =
|
||||
getValue(variableValue[`${prefix}_id_bank_night_allnum`]) || 0;
|
||||
getValue(variableValue[`${prefix}_${dimKey}_bank_night_allnum`]) || 0;
|
||||
const nightNbank =
|
||||
getValue(variableValue[`${prefix}_id_nbank_night_allnum`]) || 0;
|
||||
getValue(variableValue[`${prefix}_${dimKey}_nbank_night_allnum`]) || 0;
|
||||
|
||||
return {
|
||||
weekend: weekendBank + weekendNbank,
|
||||
@@ -115,88 +122,100 @@ export function getSpecialPeriodCounts(variableValue, period) {
|
||||
/**
|
||||
* 获取银行机构申请次数详情
|
||||
*/
|
||||
export function getBankApplicationDetails(variableValue, period) {
|
||||
export function getBankApplicationDetails(
|
||||
variableValue,
|
||||
period,
|
||||
dimension = "id"
|
||||
) {
|
||||
const { prefix } = PERIOD_MAP[period];
|
||||
const dimKey = dimension === "cell" ? "cell" : "id";
|
||||
|
||||
return {
|
||||
pdl: getValue(variableValue[`${prefix}_id_pdl_allnum`]), // 线上小额现金贷
|
||||
caon: getValue(variableValue[`${prefix}_id_caon_allnum`]), // 线上现金分期
|
||||
rel: getValue(variableValue[`${prefix}_id_rel_allnum`]), // 信用卡(类信用卡)
|
||||
caoff: getValue(variableValue[`${prefix}_id_caoff_allnum`]), // 线下现金分期
|
||||
cooff: getValue(variableValue[`${prefix}_id_cooff_allnum`]), // 线下消费分期
|
||||
af: getValue(variableValue[`${prefix}_id_af_allnum`]), // 汽车金融
|
||||
coon: getValue(variableValue[`${prefix}_id_coon_allnum`]), // 线上消费分期
|
||||
oth: getValue(variableValue[`${prefix}_id_oth_allnum`]), // 其他
|
||||
bank: getValue(variableValue[`${prefix}_id_bank_allnum`]), // 银行机构申请
|
||||
tra: getValue(variableValue[`${prefix}_id_bank_tra_allnum`]), // 传统银行申请
|
||||
ret: getValue(variableValue[`${prefix}_id_bank_ret_allnum`]), // 网络零售银行申请
|
||||
pdl: getValue(variableValue[`${prefix}_${dimKey}_pdl_allnum`]), // 线上小额现金贷
|
||||
caon: getValue(variableValue[`${prefix}_${dimKey}_caon_allnum`]), // 线上现金分期
|
||||
rel: getValue(variableValue[`${prefix}_${dimKey}_rel_allnum`]), // 信用卡(类信用卡)
|
||||
caoff: getValue(variableValue[`${prefix}_${dimKey}_caoff_allnum`]), // 线下现金分期
|
||||
cooff: getValue(variableValue[`${prefix}_${dimKey}_cooff_allnum`]), // 线下消费分期
|
||||
af: getValue(variableValue[`${prefix}_${dimKey}_af_allnum`]), // 汽车金融
|
||||
coon: getValue(variableValue[`${prefix}_${dimKey}_coon_allnum`]), // 线上消费分期
|
||||
oth: getValue(variableValue[`${prefix}_${dimKey}_oth_allnum`]), // 其他
|
||||
bank: getValue(variableValue[`${prefix}_${dimKey}_bank_allnum`]), // 银行机构申请
|
||||
tra: getValue(variableValue[`${prefix}_${dimKey}_bank_tra_allnum`]), // 传统银行申请
|
||||
ret: getValue(variableValue[`${prefix}_${dimKey}_bank_ret_allnum`]), // 网络零售银行申请
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取非银机构申请次数详情
|
||||
*/
|
||||
export function getNBankApplicationDetails(variableValue, period) {
|
||||
export function getNBankApplicationDetails(
|
||||
variableValue,
|
||||
period,
|
||||
dimension = "id"
|
||||
) {
|
||||
const { prefix } = PERIOD_MAP[period];
|
||||
const dimKey = dimension === "cell" ? "cell" : "id";
|
||||
|
||||
return {
|
||||
nbank: getValue(variableValue[`${prefix}_id_nbank_allnum`]), // 非银机构
|
||||
p2p: getValue(variableValue[`${prefix}_id_nbank_p2p_allnum`]), // 改制机构
|
||||
mc: getValue(variableValue[`${prefix}_id_nbank_mc_allnum`]), // 小贷机构
|
||||
ca: getValue(variableValue[`${prefix}_id_nbank_ca_allnum`]), // 现金类分期机构
|
||||
cf: getValue(variableValue[`${prefix}_id_nbank_cf_allnum`]), // 消费类分期机构
|
||||
com: getValue(variableValue[`${prefix}_id_nbank_com_allnum`]), // 代偿类分期机构
|
||||
oth: getValue(variableValue[`${prefix}_id_nbank_oth_allnum`]), // 其他申请
|
||||
nsloan: getValue(variableValue[`${prefix}_id_nbank_nsloan_allnum`]), // 持牌网络小贷机构
|
||||
autofin: getValue(variableValue[`${prefix}_id_nbank_autofin_allnum`]), // 持牌汽车金融机构
|
||||
sloan: getValue(variableValue[`${prefix}_id_nbank_sloan_allnum`]), // 持牌小贷机构
|
||||
cons: getValue(variableValue[`${prefix}_id_nbank_cons_allnum`]), // 持牌消费金融机构
|
||||
finlea: getValue(variableValue[`${prefix}_id_nbank_finlea_allnum`]), // 持牌融资租赁机构
|
||||
else: getValue(variableValue[`${prefix}_id_nbank_else_allnum`]), // 其他申请
|
||||
nbank: getValue(variableValue[`${prefix}_${dimKey}_nbank_allnum`]), // 非银机构
|
||||
p2p: getValue(variableValue[`${prefix}_${dimKey}_nbank_p2p_allnum`]), // 改制机构
|
||||
mc: getValue(variableValue[`${prefix}_${dimKey}_nbank_mc_allnum`]), // 小贷机构
|
||||
ca: getValue(variableValue[`${prefix}_${dimKey}_nbank_ca_allnum`]), // 现金类分期机构
|
||||
cf: getValue(variableValue[`${prefix}_${dimKey}_nbank_cf_allnum`]), // 消费类分期机构
|
||||
com: getValue(variableValue[`${prefix}_${dimKey}_nbank_com_allnum`]), // 代偿类分期机构
|
||||
oth: getValue(variableValue[`${prefix}_${dimKey}_nbank_oth_allnum`]), // 其他申请
|
||||
nsloan: getValue(variableValue[`${prefix}_${dimKey}_nbank_nsloan_allnum`]), // 持牌网络小贷机构
|
||||
autofin: getValue(variableValue[`${prefix}_${dimKey}_nbank_autofin_allnum`]), // 持牌汽车金融机构
|
||||
sloan: getValue(variableValue[`${prefix}_${dimKey}_nbank_sloan_allnum`]), // 持牌小贷机构
|
||||
cons: getValue(variableValue[`${prefix}_${dimKey}_nbank_cons_allnum`]), // 持牌消费金融机构
|
||||
finlea: getValue(variableValue[`${prefix}_${dimKey}_nbank_finlea_allnum`]), // 持牌融资租赁机构
|
||||
else: getValue(variableValue[`${prefix}_${dimKey}_nbank_else_allnum`]), // 其他申请
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取银行机构申请机构数详情
|
||||
*/
|
||||
export function getBankOrgDetails(variableValue, period) {
|
||||
export function getBankOrgDetails(variableValue, period, dimension = "id") {
|
||||
const { prefix } = PERIOD_MAP[period];
|
||||
const dimKey = dimension === "cell" ? "cell" : "id";
|
||||
|
||||
return {
|
||||
pdl: getValue(variableValue[`${prefix}_id_pdl_orgnum`]),
|
||||
caon: getValue(variableValue[`${prefix}_id_caon_orgnum`]),
|
||||
rel: getValue(variableValue[`${prefix}_id_rel_orgnum`]),
|
||||
caoff: getValue(variableValue[`${prefix}_id_caoff_orgnum`]),
|
||||
cooff: getValue(variableValue[`${prefix}_id_cooff_orgnum`]),
|
||||
af: getValue(variableValue[`${prefix}_id_af_orgnum`]),
|
||||
coon: getValue(variableValue[`${prefix}_id_coon_orgnum`]),
|
||||
oth: getValue(variableValue[`${prefix}_id_oth_orgnum`]),
|
||||
bank: getValue(variableValue[`${prefix}_id_bank_orgnum`]),
|
||||
tra: getValue(variableValue[`${prefix}_id_bank_tra_orgnum`]),
|
||||
ret: getValue(variableValue[`${prefix}_id_bank_ret_orgnum`]),
|
||||
pdl: getValue(variableValue[`${prefix}_${dimKey}_pdl_orgnum`]),
|
||||
caon: getValue(variableValue[`${prefix}_${dimKey}_caon_orgnum`]),
|
||||
rel: getValue(variableValue[`${prefix}_${dimKey}_rel_orgnum`]),
|
||||
caoff: getValue(variableValue[`${prefix}_${dimKey}_caoff_orgnum`]),
|
||||
cooff: getValue(variableValue[`${prefix}_${dimKey}_cooff_orgnum`]),
|
||||
af: getValue(variableValue[`${prefix}_${dimKey}_af_orgnum`]),
|
||||
coon: getValue(variableValue[`${prefix}_${dimKey}_coon_orgnum`]),
|
||||
oth: getValue(variableValue[`${prefix}_${dimKey}_oth_orgnum`]),
|
||||
bank: getValue(variableValue[`${prefix}_${dimKey}_bank_orgnum`]),
|
||||
tra: getValue(variableValue[`${prefix}_${dimKey}_bank_tra_orgnum`]),
|
||||
ret: getValue(variableValue[`${prefix}_${dimKey}_bank_ret_orgnum`]),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取非银机构申请机构数详情
|
||||
*/
|
||||
export function getNBankOrgDetails(variableValue, period) {
|
||||
export function getNBankOrgDetails(variableValue, period, dimension = "id") {
|
||||
const { prefix } = PERIOD_MAP[period];
|
||||
const dimKey = dimension === "cell" ? "cell" : "id";
|
||||
|
||||
return {
|
||||
nbank: getValue(variableValue[`${prefix}_id_nbank_orgnum`]),
|
||||
p2p: getValue(variableValue[`${prefix}_id_nbank_p2p_orgnum`]),
|
||||
mc: getValue(variableValue[`${prefix}_id_nbank_mc_orgnum`]),
|
||||
ca: getValue(variableValue[`${prefix}_id_nbank_ca_orgnum`]),
|
||||
cf: getValue(variableValue[`${prefix}_id_nbank_cf_orgnum`]),
|
||||
com: getValue(variableValue[`${prefix}_id_nbank_com_orgnum`]),
|
||||
oth: getValue(variableValue[`${prefix}_id_nbank_oth_orgnum`]),
|
||||
nsloan: getValue(variableValue[`${prefix}_id_nbank_nsloan_orgnum`]),
|
||||
autofin: getValue(variableValue[`${prefix}_id_nbank_autofin_orgnum`]),
|
||||
sloan: getValue(variableValue[`${prefix}_id_nbank_sloan_orgnum`]),
|
||||
cons: getValue(variableValue[`${prefix}_id_nbank_cons_orgnum`]),
|
||||
finlea: getValue(variableValue[`${prefix}_id_nbank_finlea_orgnum`]),
|
||||
else: getValue(variableValue[`${prefix}_id_nbank_else_orgnum`]),
|
||||
nbank: getValue(variableValue[`${prefix}_${dimKey}_nbank_orgnum`]),
|
||||
p2p: getValue(variableValue[`${prefix}_${dimKey}_nbank_p2p_orgnum`]),
|
||||
mc: getValue(variableValue[`${prefix}_${dimKey}_nbank_mc_orgnum`]),
|
||||
ca: getValue(variableValue[`${prefix}_${dimKey}_nbank_ca_orgnum`]),
|
||||
cf: getValue(variableValue[`${prefix}_${dimKey}_nbank_cf_orgnum`]),
|
||||
com: getValue(variableValue[`${prefix}_${dimKey}_nbank_com_orgnum`]),
|
||||
oth: getValue(variableValue[`${prefix}_${dimKey}_nbank_oth_orgnum`]),
|
||||
nsloan: getValue(variableValue[`${prefix}_${dimKey}_nbank_nsloan_orgnum`]),
|
||||
autofin: getValue(variableValue[`${prefix}_${dimKey}_nbank_autofin_orgnum`]),
|
||||
sloan: getValue(variableValue[`${prefix}_${dimKey}_nbank_sloan_orgnum`]),
|
||||
cons: getValue(variableValue[`${prefix}_${dimKey}_nbank_cons_orgnum`]),
|
||||
finlea: getValue(variableValue[`${prefix}_${dimKey}_nbank_finlea_orgnum`]),
|
||||
else: getValue(variableValue[`${prefix}_${dimKey}_nbank_else_orgnum`]),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user