完善配送端资源搜索与资质导航
This commit is contained in:
@@ -24,6 +24,7 @@ const creatable = new Set([
|
||||
const editable = new Set([
|
||||
'staff_account', 'staff_credential', 'user_account', 'user_address', 'gasorder_contract',
|
||||
]);
|
||||
const resourcesByName = new Map(contract.resources.map((resource) => [resource.name, resource]));
|
||||
|
||||
/** 在条件不成立时中止检查,并给出可直接定位的原因。 */
|
||||
function assert(condition, message) {
|
||||
@@ -72,5 +73,20 @@ assert(listPage.includes('avatarLoader.reset()'), '列表刷新未清理头像
|
||||
const avatarLoader = read('src/views/shared/protected-list-avatar-loader.ts');
|
||||
assert(avatarLoader.includes('MAX_CONCURRENT_REQUESTS = 6'), '头像请求并发上限未与 5173 对齐');
|
||||
assert(avatarLoader.includes("new Set(['staff_account', 'user_account'])"), '头像列表资源白名单不正确');
|
||||
assert(
|
||||
resourcesByName.get('staff_credential').searchFields.map((field) => field.key).join(',') ===
|
||||
'credential_type,credential_no',
|
||||
'人员资质搜索契约必须包含资质类型和资质编号',
|
||||
);
|
||||
for (const name of ['delivery_profile', 'user_address', 'wallet_bank']) {
|
||||
assert(!(resourcesByName.get(name).searchFields?.length), `${name} 不应显示无效搜索`);
|
||||
}
|
||||
assert(listPage.includes('v-if="searchEnabled"'), '列表搜索区域未按后端契约控制显示');
|
||||
assert(listPage.includes('label="模糊搜索"'), '列表搜索标签未明确说明模糊匹配');
|
||||
assert(!listPage.includes('label="关键字"'), '列表仍使用含义不清的关键字标签');
|
||||
assert(!listPage.includes('placeholder="关键字段模糊搜索"'), '列表仍使用无意义的通用搜索提示');
|
||||
assert(listPage.includes('ensureCredentialContext'), '人员资质列表缺少服务端人员上下文校验');
|
||||
assert(listPage.includes("field.key === 'staff_account_identity'"), '人员范围资质列表未隐藏重复人员列');
|
||||
assert(recordPage.includes('已锁定,不可更换'), '人员资质独立页未锁定所属配送人员');
|
||||
|
||||
console.log(`独立资源页面契约通过:详情 ${listResources.length},新建 ${creatable.size},编辑 ${editable.size}`);
|
||||
|
||||
Reference in New Issue
Block a user