From 95990a2a84a802fc164ab3c82b5bf54e0bc5a2e6 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 22 Oct 2025 11:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81=E8=84=B1=E6=95=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 3 ++- src/utils/bonus.js | 10 ++++++++++ .../entry-and-exit-manage/person-entry/config.js | 2 +- .../entry-and-exit-manage/person-entry/index.vue | 3 +++ .../entry-and-exit-manage/person-exit/config.js | 2 +- .../entry-and-exit-manage/person-exit/index.vue | 3 +++ .../red-green-light-mange/contract-witness/config.js | 2 +- .../red-green-light-mange/contract-witness/index.vue | 3 +++ .../red-green-light-mange/dishonesty-person/config.js | 2 +- .../red-green-light-mange/dishonesty-person/index.vue | 3 +++ .../red-green-light-mange/wage-card-witness/config.js | 2 +- .../red-green-light-mange/wage-card-witness/index.vue | 3 +++ src/views/synthesize-query/person-count/config.js | 2 +- src/views/synthesize-query/person-count/index.vue | 3 +++ 14 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/main.js b/src/main.js index cc8e483..9ae82f8 100644 --- a/src/main.js +++ b/src/main.js @@ -26,6 +26,7 @@ import { selectDictLabels, handleTree, indexContinuation, + desensitizeIdNumber, } from '@/utils/bonus' // 分页组件 import Pagination from '@/components/Pagination' @@ -58,7 +59,7 @@ Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree Vue.prototype.indexContinuation = indexContinuation - +Vue.prototype.desensitizeIdNumber = desensitizeIdNumber // 全局组件挂载 Vue.component('DictTag', DictTag) Vue.component('Pagination', Pagination) diff --git a/src/utils/bonus.js b/src/utils/bonus.js index f1fe388..7a07d92 100644 --- a/src/utils/bonus.js +++ b/src/utils/bonus.js @@ -259,3 +259,13 @@ export function blobValidate(data) { export function indexContinuation(num, size) { return (num - 1) * size + 1 } + +// 对身份证号码进行脱敏 +export function desensitizeIdNumber(idNumber) { + // 校验身份证格式(18位,前17位为数字,最后一位可为数字或Xx) + if (!/^\d{17}[\dXx]$/.test(idNumber)) { + return idNumber // 非有效格式返回原字符串 + } + // 保留前6位和最后4位(最后一位可为Xx),中间8位用*替换 + return idNumber.replace(/^(\d{6})\d{8}([\dXx]{4})$/, '$1********$2') +} diff --git a/src/views/construction-person/entry-and-exit-manage/person-entry/config.js b/src/views/construction-person/entry-and-exit-manage/person-entry/config.js index c63f209..2c71bee 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-entry/config.js +++ b/src/views/construction-person/entry-and-exit-manage/person-entry/config.js @@ -73,7 +73,7 @@ export const formLabel = [ export const columnsList = [ { t_props: 'name', t_label: '姓名' }, - { t_props: 'idNumber', t_label: '身份证' }, + { t_label: '身份证', t_slot: 'idNumber' }, { t_props: 'phone', t_label: '联系方式' }, { t_props: 'postName', t_label: '工种' }, { diff --git a/src/views/construction-person/entry-and-exit-manage/person-entry/index.vue b/src/views/construction-person/entry-and-exit-manage/person-entry/index.vue index 2c96abb..18ba12a 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-entry/index.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-entry/index.vue @@ -9,6 +9,9 @@ :columnsList="columnsList" :request-api="getEntryPersonListAPI" > +