This commit is contained in:
parent
bc1042a7a7
commit
a11fa7618e
|
@ -501,7 +501,7 @@ const sfType = reactive({
|
|||
});
|
||||
const tableType = reactive({
|
||||
url: `/api/ggfwyth/pg/fwjgqdxq`,
|
||||
url1: `/api/ggfwyth/pg/spypqyxq`,//许可证编号详情
|
||||
url1: `/api/ggfwyth/pg/spypqyxq`, //许可证编号详情
|
||||
title: "服务详情",
|
||||
name: "",
|
||||
typeId: "",
|
||||
|
@ -610,10 +610,44 @@ const showList = (val) => {
|
|||
message: `该服务内容暂无推送记录!`,
|
||||
});
|
||||
} else {
|
||||
function maskName(name) {
|
||||
if (name.length === 2) {
|
||||
// 两个字的姓名,第二个字替换为 *
|
||||
return name[0] + "*";
|
||||
} else if (name.length > 2) {
|
||||
// 三个字或更多的姓名,替换中间的字符
|
||||
return (
|
||||
name[0] + "*".repeat(name.length - 2) + name[name.length - 1]
|
||||
);
|
||||
}
|
||||
return name; // 返回原名
|
||||
}
|
||||
function maskYwfzr(ywfzr) {
|
||||
// 处理包含冒号和逗号的姓名
|
||||
if (ywfzr.includes(":")) {
|
||||
// 处理包含冒号的情况
|
||||
return ywfzr.replace(/([^:]+:[^,]+)/g, (match) => {
|
||||
const parts = match.split(":"); // 分割冒号前后的部分
|
||||
const maskedNames = parts[1]
|
||||
.split(",")
|
||||
.map((name) => maskName(name.trim()))
|
||||
.join(", "); // 对姓名部分进行掩码
|
||||
return `${parts[0]}:${maskedNames}`; // 返回冒号和掩码后的姓名
|
||||
});
|
||||
} else {
|
||||
// 不包含冒号,直接处理逗号分隔的姓名或单个姓名
|
||||
return ywfzr
|
||||
.split(",")
|
||||
.map((name) => maskName(name.trim()))
|
||||
.join(", ");
|
||||
}
|
||||
}
|
||||
push.data = push.data.map((item, index1) => {
|
||||
return {
|
||||
...item,
|
||||
index: index1 + 1,
|
||||
xm: maskYwfzr(item.xm),
|
||||
adminName: maskYwfzr(item.adminName),
|
||||
};
|
||||
});
|
||||
dialogShowPush.value = true;
|
||||
|
|
Loading…
Reference in New Issue