This commit is contained in:
duanxiaohai 2024-10-18 15:26:02 +08:00
parent 660cf9e0ad
commit 1f08cce052
1 changed files with 10 additions and 5 deletions

View File

@ -184,7 +184,7 @@ const props = defineProps({
},
},
});
const emit = defineEmits(["close", "handle",'showList']);
const emit = defineEmits(["close", "handle", "showList"]);
const handleRowClick = (row, column, event) => {
emit("showList", row);
@ -267,20 +267,25 @@ watch(
data.title = props.tableData.title;
data.columns = props.tableData.columns;
data.tableData.length = 0;
function maskName(name) {
if (name.length === 2) {
// *
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];
} else if (name.length > 8) {
//
return maskYwfzr(name);
}
return name;
}
function maskYwfzr(ywfzr) {
// 使
return ywfzr.replace(
/([^,]+)/g,(match, name) => `${maskName(name.trim())}`
/([^,]+)/g,
(match, name) => `${maskName(name.trim())}`
);
}
if (props.tableData.data.wxs.length > 0) {
@ -292,7 +297,7 @@ watch(
bzlx: item.bzlx,
qtbm: item.qtbm,
zrks: item.zrks,
ywfzr: maskYwfzr(item.ywfzr),
ywfzr: maskName(item.ywfzr),
fgldsj: item.fgldsj.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"),
};
data.tableData.push(obj);
@ -308,7 +313,7 @@ watch(
bzlx: item.bzlx,
qtbm: item.qtbm,
zrks: item.zrks,
ywfzr: maskYwfzr(item.ywfzr),
ywfzr: maskName(item.ywfzr),
// fgldsj: item.fgldsj,
fgldsj: item.fgldsj.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"),
};