移除QA预设角色并收紧角色模板编辑

This commit is contained in:
Cheng Zhou
2026-05-26 11:32:14 +08:00
parent 6c2f61eebd
commit 3c168565ce
26 changed files with 387 additions and 119 deletions
@@ -29,6 +29,13 @@ describe("PermissionAccessLogs", () => {
expect(source).not.toContain("fetchIpLocations");
});
it("does not expose QA in role filter presets", () => {
const source = readSource();
expect(source).not.toContain('label="QA" value="QA"');
expect(source).not.toContain('QA: "QA"');
});
it("uses narrow metric cards without helper subtitles", () => {
const source = readSource();
@@ -18,7 +18,6 @@
<el-option label="PV" value="PV" />
<el-option label="医学审核" value="MEDICAL_REVIEW" />
<el-option label="IMP" value="IMP" />
<el-option label="QA" value="QA" />
</el-select>
<el-select v-model="filters.allowed" placeholder="结果" clearable style="width: 100px" @change="onFilterChange">
<el-option label="允许" :value="true" />
@@ -230,7 +229,6 @@ const ROLE_LABELS: Record<string, string> = {
PV: "PV",
MEDICAL_REVIEW: "医学审核",
IMP: "药品管理",
QA: "QA",
};
const SECURITY_AUTH_LABELS: Record<string, string> = {
@@ -27,4 +27,11 @@ describe("PermissionTemplateSelector", () => {
expect(source).toContain("const perms = props.currentPermissions?.[role];");
expect(source).toContain("emit('edit-role', template.category!)");
});
it("does not define QA as a preset role label or icon", () => {
const source = readSource();
expect(source).not.toContain('QA: "QA"');
expect(source).not.toContain('QA: "✅"');
});
});
@@ -83,13 +83,13 @@ const templates = ref<PermissionTemplate[]>([]);
const ROLE_LABELS: Record<string, string> = {
PM: "项目负责人", CRA: "CRA", PV: "PV",
MEDICAL_REVIEW: "医学审核", IMP: "药品管理员", QA: "QA",
MEDICAL_REVIEW: "医学审核", IMP: "药品管理员",
};
const roleIcon = (category: string | null) => {
const icons: Record<string, string> = {
PM: "👑", CRA: "📋", PV: "🔍",
MEDICAL_REVIEW: "🏥", IMP: "📦", QA: "✅",
MEDICAL_REVIEW: "🏥", IMP: "📦",
};
return icons[category ?? ""] ?? "📄";
};