寄卖手动匹配改走内部现货并统一展示与超时口径

- 手动匹配不再指派供货打手:停在待加好友,清空截止时间与超时分钟
- 物品名模板去掉「0 璀璨」残留;寄卖单号无提报号时回退库存编号
- 状态列按寄卖库存显示内部匹配,打手列保留供货打手标签
- 超时配置增加启用开关,默认关闭(不限时)
- 补充前后端回归测试
This commit is contained in:
2026-11-14 13:15:41 +08:00
parent a0c7c90edf
commit 0dff00de97
20 changed files with 631 additions and 91 deletions
+22 -4
View File
@@ -169,6 +169,27 @@ export function buildSpecText(
.join(' / ')
}
/**
* 物品名模板里跟在占位符后面的固定单位。
* 数值字段为 0 时 formatSpecValue 返回空串,单位必须一并省略,
* 否则会留下「2钻璀璨」这种没有数字的残句。
*/
const ITEM_NAME_UNIT_SUFFIX: Record<string, string> = {
brillianceCount: '璀璨',
diamondLevel: '钻',
}
function fillItemNameTemplate(template: string, tokens: Map<string, string>): string {
return template.replace(
/\{([a-zA-Z][a-zA-Z0-9_]*)\}(璀璨|钻)?/g,
(_, key: string, unit?: string) => {
const value = tokens.get(key) || ''
if (value) return unit ? `${value}${unit}` : value
return ITEM_NAME_UNIT_SUFFIX[key] === unit ? '' : unit || ''
},
)
}
export function buildSpecItemName(
template: string,
specs: ConsignmentSpecField[],
@@ -183,10 +204,7 @@ export function buildSpecItemName(
tokens.set('category', categoryName)
let result = String(template || '').trim()
if (result) {
result = result.replace(
/\{([a-zA-Z][a-zA-Z0-9_]*)\}/g,
(_, key: string) => tokens.get(key) || '',
)
result = fillItemNameTemplate(result, tokens)
} else {
result = specs
.filter((field) => field.showInItemName)