|
@@ -266,7 +266,7 @@ function refeshTable() {
|
|
|
tempCurrentList = tempCurrentList.filter((x) => !tempPastList.some((item) => x.patient_id === item.patient_id));
|
|
|
//删除并返回数组的第一个元素
|
|
|
let c = tempCurrentList.shift();
|
|
|
- let name = c.name;
|
|
|
+ let name = noPassByName(c.name);
|
|
|
let flag = (!isEmpty(c.lineUp) && c.lineUp!==10000);
|
|
|
if(name.length > 3){
|
|
|
$("#current" + i).html((flag?'<span style="font-size:32px; "><span class="number-name"> '+c.lineUp+' </span> ':'')+name+"</span>");
|
|
@@ -304,11 +304,15 @@ function currentListClear(data) {
|
|
|
|
|
|
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])/, "*")
|
|
|
- }
|
|
|
+ return str.replace(/(^.{1})(.+)$/g, function (...args) {
|
|
|
+ let tempStr = ''
|
|
|
+ if (args[2] && args[2].length) {
|
|
|
+ tempStr = Array.from({
|
|
|
+ length: args[2].length
|
|
|
+ }).join('*')
|
|
|
+ }
|
|
|
+ return str.length === 2 ? (args[1] + '*') : (args[1] + tempStr + str.slice(-1))
|
|
|
+ })
|
|
|
} else {
|
|
|
return str
|
|
|
}
|