diff --git a/src/views/store/store_product/index.vue b/src/views/store/store_product/index.vue index 0ea0fcf..f296835 100644 --- a/src/views/store/store_product/index.vue +++ b/src/views/store/store_product/index.vue @@ -47,6 +47,11 @@ + + + {{ cMark(row.manufacturer_information) }} + + { editRef.value?.getTableLists({ product_id: data.product_id, store_id }) } +const cMark = (str: any) => { + if (str) { + return str.replace(/(\d{5,})/g, (match: string) => { + let replacement; + // 判断数字长度,执行不同替换逻辑 + if (match.length >= 11) { + // 对于11位以上的连续数字,替换倒数第四到倒数第八位为星号 + replacement = match.slice(0, -8) + "****" + match.slice(-4); + } else { + // 对于5到11位的数字,替换最后四位为星号 + replacement = match.slice(0, -4) + "****"; + } + return replacement; + }); + } + return '-'; +} const typeLists = reactive([]) @@ -135,5 +157,4 @@ const getTypeLists = async () => { // getTypeLists() getLists() - - \ No newline at end of file + \ No newline at end of file