Pārlūkot izejas kodu

Merge branch 'dev-1.1.4' into 'dev-1.1.4'

过号名字脱敏

See merge request lihong/thmz_system!66
huangshuhua 1 gadu atpakaļ
vecāks
revīzija
7eaf06c745

+ 13 - 1
src/main/resources/static/js/mz/pharmacy-cell-number.js

@@ -242,7 +242,7 @@ function refeshTable() {
         } else {
             //删除并返回数组的第一个元素
             let c = tempPastList.shift();
-            let name = c.name;
+            let name = noPassByName(c.name);
             if(name){
                 let flag = (!isEmpty(c.lineUp) && c.lineUp!==10000);
                 if(name.length > 3){
@@ -300,4 +300,16 @@ function currentListClear(data) {
             break;
         }
     }
+}
+
+function noPassByName(str) {
+    if (null != str && str !== '') {
+        if (str.length === 2) {
+            return str.replace(/.*(?=[\u4e00-\u9fa5])/, "*")
+        } else if (str.length > 2) {
+            return str.replace(/(?<=[\u4e00-\u9fa5]).*(?=[\u4e00-\u9fa5])/, "*")
+        }
+    } else {
+        return str
+    }
 }