新增两组件
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,29 +1,56 @@
|
||||
<template>
|
||||
<div class="card rounded-lg border border-gray-200 pb-2 mb-2">
|
||||
<div class="flex items-center mb-4 p-4">
|
||||
<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 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>
|
||||
</div>
|
||||
|
||||
<!-- 风险汇总 -->
|
||||
<div class="px-4 pb-4 mt-4">
|
||||
<LTitle title="风险汇总" />
|
||||
<div class="space-y-2 mt-3">
|
||||
<div v-for="risk in riskSummary" :key="risk.label" class="flex justify-between items-center text-sm">
|
||||
<span class="text-gray-600">{{ risk.label }}</span>
|
||||
<span class="font-semibold" :class="getRiskClass(risk.value)">{{ risk.value }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 风险汇总解读 -->
|
||||
<Remark :content="riskRemark" title="风险解读" :default-expanded="true" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { getApplicationCounts, getBankOrgDetails, getNBankOrgDetails } from '../utils/dataParser'
|
||||
import LTitle from '@/components/LTitle.vue'
|
||||
import Remark from '@/components/Remark.vue'
|
||||
import { getApplicationCounts, getBankOrgDetails, getNBankOrgDetails, getRiskSummary, generateRiskRemark } from '../utils/dataParser'
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
@@ -31,26 +58,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: '次' },
|
||||
@@ -61,6 +96,32 @@ const items = computed(() => {
|
||||
{ label: '周末申请次数', value: weekendTotal || 0, unit: '次' },
|
||||
]
|
||||
})
|
||||
|
||||
// 风险汇总
|
||||
const riskSummary = computed(() => {
|
||||
return getRiskSummary(props.data || {}, props.dimension)
|
||||
})
|
||||
|
||||
// 风险汇总解读文本
|
||||
const riskRemark = computed(() => {
|
||||
return generateRiskRemark(riskSummary.value)
|
||||
})
|
||||
|
||||
// 根据风险等级返回对应的样式类
|
||||
const getRiskClass = (level) => {
|
||||
switch (level) {
|
||||
case '无风险':
|
||||
return 'text-green-600'
|
||||
case '低风险':
|
||||
return 'text-blue-600'
|
||||
case '中风险':
|
||||
return 'text-amber-600'
|
||||
case '高风险':
|
||||
return 'text-red-600'
|
||||
default:
|
||||
return 'text-gray-600'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -68,5 +129,3 @@ const items = computed(() => {
|
||||
background: #ffffff;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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`]),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -235,3 +254,112 @@ export const FIELD_LABELS = {
|
||||
else: "其他申请",
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据申请次数计算风险等级
|
||||
* @param {number} count 申请次数
|
||||
* @returns {string} 风险等级:无风险、低风险、中风险、高风险
|
||||
*/
|
||||
export function calculateRiskLevel(count) {
|
||||
const num = Number(count) || 0;
|
||||
if (num === 0) {
|
||||
return '无风险';
|
||||
} else if (num >= 1 && num <= 3) {
|
||||
return '低风险';
|
||||
} else if (num >= 4 && num <= 8) {
|
||||
return '中风险';
|
||||
} else {
|
||||
return '高风险';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取各机构类型的风险汇总(近12个月)
|
||||
* @param {Object} variableValue 数据对象
|
||||
* @param {string} dimension 维度:id(身份证) / cell(手机号)
|
||||
* @returns {Array} 风险汇总列表,格式:[{label: '机构类型风险等级', value: '风险等级'}]
|
||||
*/
|
||||
export function getRiskSummary(variableValue, dimension = 'id') {
|
||||
const dimKey = dimension === 'cell' ? 'cell' : 'id';
|
||||
const prefix = 'als_m12'; // 近12个月
|
||||
|
||||
// 银行类机构申请次数
|
||||
const bankCount = getValue(variableValue[`${prefix}_${dimKey}_bank_allnum`]) || 0;
|
||||
|
||||
// 非银行类机构申请次数
|
||||
const nbankCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_allnum`]) || 0;
|
||||
|
||||
// 持牌网络小贷机构申请次数
|
||||
const nsloanCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_nsloan_allnum`]) || 0;
|
||||
|
||||
// 持牌小贷机构申请次数
|
||||
const sloanCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_sloan_allnum`]) || 0;
|
||||
|
||||
// 持牌消费金融机构申请次数
|
||||
const consCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_cons_allnum`]) || 0;
|
||||
|
||||
// 持牌融资租赁机构申请次数
|
||||
const finleaCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_finlea_allnum`]) || 0;
|
||||
|
||||
// 持牌汽车金融机构申请次数
|
||||
const autofinCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_autofin_allnum`]) || 0;
|
||||
|
||||
// 其他非银机构申请次数(包括 p2p, mc, ca, cf, com, oth, else)
|
||||
const p2pCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_p2p_allnum`]) || 0;
|
||||
const mcCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_mc_allnum`]) || 0;
|
||||
const caCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_ca_allnum`]) || 0;
|
||||
const cfCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_cf_allnum`]) || 0;
|
||||
const comCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_com_allnum`]) || 0;
|
||||
const othCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_oth_allnum`]) || 0;
|
||||
const elseCount = getValue(variableValue[`${prefix}_${dimKey}_nbank_else_allnum`]) || 0;
|
||||
const otherNbankCount = p2pCount + mcCount + caCount + cfCount + comCount + othCount + elseCount;
|
||||
|
||||
return [
|
||||
{ label: '银行类机构风险等级', value: calculateRiskLevel(bankCount), count: bankCount },
|
||||
{ label: '非银行类机构风险等级', value: calculateRiskLevel(nbankCount), count: nbankCount },
|
||||
{ label: '持牌网络小贷机构风险等级', value: calculateRiskLevel(nsloanCount), count: nsloanCount },
|
||||
{ label: '持牌小贷机构风险等级', value: calculateRiskLevel(sloanCount), count: sloanCount },
|
||||
{ label: '持牌消费金融机构风险等级', value: calculateRiskLevel(consCount), count: consCount },
|
||||
{ label: '持牌融资租赁机构风险等级', value: calculateRiskLevel(finleaCount), count: finleaCount },
|
||||
{ label: '持牌汽车金融机构风险等级', value: calculateRiskLevel(autofinCount), count: autofinCount },
|
||||
{ label: '其他非银机构风险等级', value: calculateRiskLevel(otherNbankCount), count: otherNbankCount },
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成风险汇总解读文本
|
||||
* @param {Array} riskSummary 风险汇总列表
|
||||
* @returns {string} 解读文本
|
||||
*/
|
||||
export function generateRiskRemark(riskSummary) {
|
||||
if (!riskSummary || riskSummary.length === 0) {
|
||||
return '暂无风险数据。';
|
||||
}
|
||||
|
||||
// 按风险等级优先级排序:高风险 > 中风险 > 低风险 > 无风险
|
||||
const riskPriority = { '高风险': 4, '中风险': 3, '低风险': 2, '无风险': 1 };
|
||||
const sortedRisks = riskSummary
|
||||
.filter(r => r.value !== '无风险')
|
||||
.sort((a, b) => (riskPriority[b.value] || 0) - (riskPriority[a.value] || 0));
|
||||
|
||||
if (sortedRisks.length === 0) {
|
||||
return '经大数据分析,您在各机构类型的风险等级均为无风险,信用状况良好。请您继续保持良好的借还款履约行为,维护个人信用。';
|
||||
}
|
||||
|
||||
// 取最高风险的机构类型
|
||||
const highestRisk = sortedRisks[0];
|
||||
const orgType = highestRisk.label.replace('风险等级', ''); // 去掉"风险等级"后缀
|
||||
const riskLevel = highestRisk.value;
|
||||
const count = highestRisk.count || 0;
|
||||
|
||||
// 生成解读文本
|
||||
let remark = `经大数据分析,您命中${orgType}风险等级的${riskLevel}名单`;
|
||||
|
||||
if (count > 0) {
|
||||
remark += `,历史命中 ${count} 次`;
|
||||
}
|
||||
|
||||
remark += `,最近一次进入${orgType}风险等级的${riskLevel}名单在近 1 年内。请您注意对应机构的正常借还款履约行为,提高信用评价。`;
|
||||
|
||||
return remark;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user