Merge branch '20220510-委托推送的标段名称包含特殊字符导致weboffice文件创建失败' of http://10.124.128.2:8888/eshop/fe_service_ebtp_frontend into 20220413-zjl-公共服务平台

This commit is contained in:
jl-zhoujl2
2022-05-20 14:46:22 +08:00
11 changed files with 67 additions and 46 deletions

View File

@ -313,4 +313,14 @@ export const scrollToAnchor = (anchorName: string) => {
// 如果对应id的锚点存在就跳转到锚点
if (anchorElement) { anchorElement.scrollIntoView({ block: 'start', behavior: 'smooth' }); }
}
}
/**
* 删除行首行尾的空白字符方法(包括空格、制表符、换页符等等)
* @param str
* @returns
*/
export const trim = (str: string | undefined) => {
let _str = str?.replace(/(^\s*)|(\s*$)/g, "");
_str = _str?.replace(/[<>|\\/?:*""“”\s\r\n\t]/, "");
return _str;
}