|
@@ -201,13 +201,12 @@ var rationLibObj = {
|
|
|
*/
|
|
|
//@param {String}sectionName(章节名称) {Array}datas(定额数据)
|
|
|
function simplifyName(sectionName, datas){
|
|
|
- debugger;
|
|
|
if (!sectionName || !datas || datas.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
//提取需要匹配的章节名称
|
|
|
// 去掉后缀
|
|
|
- const suffixReg = /[((]编码[::]\w+[))]/;
|
|
|
+ const suffixReg = /[((]编码[::][\w、]+[))]/;
|
|
|
const tempName = sectionName.split(suffixReg)[0];
|
|
|
// 获取第一个空格后的内容
|
|
|
const sReg = /\s(.+)/;
|
|
@@ -227,7 +226,9 @@ var rationLibObj = {
|
|
|
continue;
|
|
|
}
|
|
|
let matchName = nameArr[0];
|
|
|
- if (matchName === target) {
|
|
|
+ const matchNameWithoutSpace = matchName.replace(/\s/g, '');
|
|
|
+ const targetWithoutSpace = target.replace(/\s/g, '');
|
|
|
+ if (matchNameWithoutSpace === targetWithoutSpace) {
|
|
|
nameArr.shift();
|
|
|
data.name = nameArr.join(' ');
|
|
|
}
|