diff --git a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/committeeFiling/index.html b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/committeeFiling/index.html index 62ac6d0d..06adc3fe 100644 --- a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/committeeFiling/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/committeeFiling/index.html @@ -250,14 +250,26 @@ layout("/layouts/platform.html"){ } } catch (e) { } - return text.split(/[,,、]/).map(v => v.trim()).filter(Boolean) + // Unit names may contain "、" (e.g. in parentheses), so split only by comma. + return text.split(/[,,]/).map(v => v.trim()).filter(Boolean) + }, + normalizeUnitName(name) { + return (name || "") + .toString() + .replace(/\s+/g, "") + .replace(/(/g, "(") + .replace(/)/g, ")") + .trim() }, mapSuggestUnitsToIds(suggestUnits) { const unitValues = this.parseSuggestUnits(suggestUnits) if (!unitValues.length || !this.underTakeOptions.length) return [] const result = [] unitValues.forEach(unitVal => { - const matched = this.underTakeOptions.find(item => item.id === unitVal || item.name === unitVal) + const normalizedVal = this.normalizeUnitName(unitVal) + const matched = this.underTakeOptions.find(item => { + return item.id === unitVal || this.normalizeUnitName(item.name) === normalizedVal + }) if (matched && !result.includes(matched.id)) { result.push(matched.id) }