perf(worker-hall): 优化百单大厅加载与渲染性能

This commit is contained in:
yml2213
2026-10-24 20:41:58 +08:00
parent 72a758fd7c
commit 7fdef88ba6
11 changed files with 617 additions and 321 deletions
@@ -65,6 +65,28 @@ test('按工单号搜到的行,实时事件来了也不能被删掉,并且
assert.equal((itemsOf(updated)[0] as { status?: string }).status, 'in_progress')
})
test('大厅轻量快照就地更新时保留 myShare 等个性化字段', () => {
const envelope = buildEnvelope([
buildRow({ status: 'open', myShare: { quantity: 2 }, categoryName: '密钥' }),
])
const updated = patchWorkerWorkOrderListEnvelope(
envelope,
{
operation: 'upsert',
data: { workOrderId: 9001, status: 'open', productName: '新商品名' },
},
false,
)
const item = itemsOf(updated)[0] as {
productName?: string
myShare?: { quantity?: number }
categoryName?: string
}
assert.equal(item.productName, '新商品名')
assert.equal(item.myShare?.quantity, 2, '广播不带 myShare 时不能把已拼份额覆盖掉')
assert.equal(item.categoryName, '密钥')
})
test('不可证真的关键词下,快照只能就地更新:不插入、不删除', () => {
const envelope = buildEnvelope([buildRow()])
// 关键词没命中前端已知字段(unknown):既不该把它当"不匹配"删掉