feat(consignment): 自动匹配改为发布前即时匹配,manual 保留内部等待
This commit is contained in:
@@ -1756,8 +1756,13 @@ export default function ConsignmentConfigPanel() {
|
||||
<Switch checkedChildren="优先" unCheckedChildren="不优先" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="内部匹配等待(分钟)"
|
||||
label="手动匹配等待(分钟)"
|
||||
name={['internalMatch', 'delayMinutes']}
|
||||
extra={
|
||||
matchingMode === 'auto'
|
||||
? '自动匹配在发布时立即匹配,未命中直接进大厅,不使用等待窗口'
|
||||
: '仅手动匹配生效:工单在内部池等待运营挑库存'
|
||||
}
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<InputNumber
|
||||
@@ -1765,6 +1770,24 @@ export default function ConsignmentConfigPanel() {
|
||||
precision={0}
|
||||
style={{ width: '100%' }}
|
||||
addonAfter="分钟"
|
||||
disabled={matchingMode === 'auto'}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="超时后回大厅"
|
||||
name={['internalMatch', 'fallbackToHall']}
|
||||
valuePropName="checked"
|
||||
extra={
|
||||
matchingMode === 'auto'
|
||||
? '自动匹配未命中直接进大厅,不涉及此策略'
|
||||
: '关闭后超时重新匹配(最多 3 次),仍未命中回大厅'
|
||||
}
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<Switch
|
||||
checkedChildren="回大厅"
|
||||
unCheckedChildren="重新匹配"
|
||||
disabled={matchingMode === 'auto'}
|
||||
/>
|
||||
</Form.Item>
|
||||
</>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import test from 'node:test'
|
||||
|
||||
function readPanelSource() {
|
||||
return readFileSync(
|
||||
fileURLToPath(new URL('../src/pages/admin/panels/ConsignmentConfigPanel.tsx', import.meta.url)),
|
||||
'utf8',
|
||||
).replace(/\r\n/g, '\n')
|
||||
}
|
||||
|
||||
test('自动匹配:手动等待与超时策略在 auto 下禁用并给出说明', () => {
|
||||
const source = readPanelSource()
|
||||
assert.ok(source.includes('label="手动匹配等待(分钟)"'), '等待时长文案必须明确只作用于手动匹配')
|
||||
assert.ok(source.includes('label="超时后回大厅"'), '必须提供超时回大厅开关')
|
||||
assert.ok(
|
||||
source.includes('自动匹配在发布时立即匹配,未命中直接进大厅,不使用等待窗口'),
|
||||
'auto 模式必须说明不使用等待窗口',
|
||||
)
|
||||
assert.ok(
|
||||
source.includes('关闭后超时重新匹配(最多 3 次),仍未命中回大厅'),
|
||||
'关闭回大厅时必须说明重试上限',
|
||||
)
|
||||
assert.ok(
|
||||
(source.match(/disabled=\{matchingMode === 'auto'\}/g) || []).length >= 2,
|
||||
'等待时长与超时策略在 auto 下都必须禁用',
|
||||
)
|
||||
assert.ok(!source.includes('label="内部匹配等待(分钟)"'), '旧文案必须移除')
|
||||
})
|
||||
@@ -35,7 +35,7 @@ test('寄卖配置面板:必须覆盖保证金/服务费/数量限制/匹配/
|
||||
'开启单人寄售上限',
|
||||
'匹配模式',
|
||||
'关闭匹配',
|
||||
'内部匹配等待(分钟)',
|
||||
'手动匹配等待(分钟)',
|
||||
'代练超时(小时)',
|
||||
'重新匹配并退还押金',
|
||||
'开启降价提示',
|
||||
|
||||
Reference in New Issue
Block a user