feat: 人工补充资料的系统字段改为选填

系统(安卓/苹果)与区服均改为选填,仅游戏编号、游戏昵称必填;
同步更新默认字段模板单元测试
This commit is contained in:
yml2213
2026-08-15 09:55:47 +08:00
parent b87886c688
commit f078c75378
2 changed files with 3 additions and 3 deletions
@@ -533,7 +533,7 @@ export function normalizeRequirementFields(value: unknown) {
return [ return [
{ key: 'gameId', label: '游戏编号', required: true, type: 'text', options: [], mockValue: 'test_uid' }, { key: 'gameId', label: '游戏编号', required: true, type: 'text', options: [], mockValue: 'test_uid' },
{ key: 'gameNickname', label: '游戏昵称', required: true, type: 'text', options: [], mockValue: '测试角色' }, { key: 'gameNickname', label: '游戏昵称', required: true, type: 'text', options: [], mockValue: '测试角色' },
{ key: 'system', label: '系统', required: true, type: 'select', options: ['安卓', '苹果'], mockValue: '安卓' }, { key: 'system', label: '系统', required: false, type: 'select', options: ['安卓', '苹果'], mockValue: '安卓' },
{ key: 'serverZone', label: '区服', required: false, type: 'select', options: ['QQ区', '微信区'], mockValue: 'QQ区' }, { key: 'serverZone', label: '区服', required: false, type: 'select', options: ['QQ区', '微信区'], mockValue: 'QQ区' },
] ]
} }
@@ -83,11 +83,11 @@ test('normalizeRequirementFields default template keeps gameId/gameNickname as t
assert.equal(gameNickname?.required, true) assert.equal(gameNickname?.required, true)
}) })
test('normalizeRequirementFields default template renders system as single-select 安卓/苹果', () => { test('normalizeRequirementFields default template renders system as single-select 安卓/苹果 (optional)', () => {
const fields = normalizeRequirementFields([]) const fields = normalizeRequirementFields([])
const system = fields.find((field) => field.key === 'system') const system = fields.find((field) => field.key === 'system')
assert.equal(system?.type, 'select') assert.equal(system?.type, 'select')
assert.equal(system?.required, true) assert.equal(system?.required, false)
assert.deepEqual(system?.options, ['安卓', '苹果']) assert.deepEqual(system?.options, ['安卓', '苹果'])
}) })