1
This commit is contained in:
65
src/ui/CQCXG7A2B.vue
Normal file
65
src/ui/CQCXG7A2B.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<div class="card">
|
||||
<!-- 名下车辆信息展示 -->
|
||||
<div class="bg-yellow-100 text-yellow-700 p-4 rounded-lg">
|
||||
<h3 class="text-xl font-semibold">名下车辆</h3>
|
||||
<p class="text-sm">此人名下拥有车辆:{{ data?.carNum }} 辆</p>
|
||||
</div>
|
||||
|
||||
<!-- 校验对象展示 -->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps, watch, computed } from 'vue';
|
||||
import { useRiskNotifier } from '@/composables/useRiskNotifier';
|
||||
|
||||
// 接收父组件传入的 props
|
||||
const props = defineProps({
|
||||
data: Object,
|
||||
params: Object,
|
||||
apiId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
notifyRiskStatus: {
|
||||
type: Function,
|
||||
default: () => { },
|
||||
},
|
||||
});
|
||||
|
||||
// 脱敏函数:姓名脱敏(保留首位)
|
||||
const maskName = (name) => {
|
||||
if (!name) return '';
|
||||
return name.length > 1 ? name[0] + "*".repeat(name.length - 1) : "*";
|
||||
};
|
||||
|
||||
// 脱敏函数:身份证号脱敏(保留前6位和最后4位)
|
||||
const maskIdCard = (idCard) => {
|
||||
if (!idCard) return '';
|
||||
return idCard.replace(/^(.{6})(?:\d+)(.{4})$/, "$1****$2");
|
||||
};
|
||||
|
||||
// 计算风险评分(0-100分,分数越高越安全)
|
||||
const riskScore = computed(() => {
|
||||
// 名下车辆不算风险,始终返回100分(最安全)
|
||||
return 100;
|
||||
});
|
||||
|
||||
// 使用 composable 通知父组件风险评分
|
||||
useRiskNotifier(props, riskScore);
|
||||
|
||||
// 暴露给父组件
|
||||
defineExpose({
|
||||
riskScore
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 自定义样式 */
|
||||
</style>
|
||||
Reference in New Issue
Block a user