Merge branch 'main' of https://git.cityme.com.cn/xiangshan/ggfwjsc
This commit is contained in:
commit
db72c7c983
|
@ -184,7 +184,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["close", "handle",'showList']);
|
const emit = defineEmits(["close", "handle", "showList"]);
|
||||||
|
|
||||||
const handleRowClick = (row, column, event) => {
|
const handleRowClick = (row, column, event) => {
|
||||||
emit("showList", row);
|
emit("showList", row);
|
||||||
|
@ -267,20 +267,25 @@ watch(
|
||||||
data.title = props.tableData.title;
|
data.title = props.tableData.title;
|
||||||
data.columns = props.tableData.columns;
|
data.columns = props.tableData.columns;
|
||||||
data.tableData.length = 0;
|
data.tableData.length = 0;
|
||||||
|
|
||||||
function maskName(name) {
|
function maskName(name) {
|
||||||
if (name.length === 2) {
|
if (name.length === 2) {
|
||||||
// 两个字的姓名,第二个字替换为 *
|
// 两个字的姓名,第二个字替换为 *
|
||||||
return name[0] + "*";
|
return name[0] + "*";
|
||||||
} else if (name.length > 2) {
|
} else if (name.length > 2 && name.length <= 8) {
|
||||||
// 三个字或更多的姓名,替换中间的字符
|
// 三个字或更多的姓名,替换中间的字符
|
||||||
return name[0] + "*".repeat(name.length - 2) + name[name.length - 1];
|
return name[0] + "*".repeat(name.length - 2) + name[name.length - 1];
|
||||||
|
} else if (name.length > 8) {
|
||||||
|
// 三个字或更多的姓名,替换中间的字符
|
||||||
|
return maskYwfzr(name);
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
function maskYwfzr(ywfzr) {
|
function maskYwfzr(ywfzr) {
|
||||||
// 使用正则匹配每个名字并进行替换
|
// 使用正则匹配每个名字并进行替换
|
||||||
return ywfzr.replace(
|
return ywfzr.replace(
|
||||||
/:([^,]+)/g,(match, name) => `:${maskName(name.trim())}`
|
/:([^,]+)/g,
|
||||||
|
(match, name) => `:${maskName(name.trim())}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (props.tableData.data.wxs.length > 0) {
|
if (props.tableData.data.wxs.length > 0) {
|
||||||
|
@ -292,7 +297,7 @@ watch(
|
||||||
bzlx: item.bzlx,
|
bzlx: item.bzlx,
|
||||||
qtbm: item.qtbm,
|
qtbm: item.qtbm,
|
||||||
zrks: item.zrks,
|
zrks: item.zrks,
|
||||||
ywfzr: maskYwfzr(item.ywfzr),
|
ywfzr: maskName(item.ywfzr),
|
||||||
fgldsj: item.fgldsj.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"),
|
fgldsj: item.fgldsj.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"),
|
||||||
};
|
};
|
||||||
data.tableData.push(obj);
|
data.tableData.push(obj);
|
||||||
|
@ -308,7 +313,7 @@ watch(
|
||||||
bzlx: item.bzlx,
|
bzlx: item.bzlx,
|
||||||
qtbm: item.qtbm,
|
qtbm: item.qtbm,
|
||||||
zrks: item.zrks,
|
zrks: item.zrks,
|
||||||
ywfzr: maskYwfzr(item.ywfzr),
|
ywfzr: maskName(item.ywfzr),
|
||||||
// fgldsj: item.fgldsj,
|
// fgldsj: item.fgldsj,
|
||||||
fgldsj: item.fgldsj.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"),
|
fgldsj: item.fgldsj.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"),
|
||||||
};
|
};
|
||||||
|
|
|
@ -327,9 +327,9 @@ const getRegisteredDB = () => {
|
||||||
ElMessage.warning({
|
ElMessage.warning({
|
||||||
message: res.message,
|
message: res.message,
|
||||||
});
|
});
|
||||||
router.replace({
|
// router.replace({
|
||||||
path: "/error/403",
|
// path: "/error/403",
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue