统一项目角色展示与预设文案

This commit is contained in:
Cheng Zhou
2026-05-26 14:46:01 +08:00
parent 3c168565ce
commit 41bd423be0
25 changed files with 384 additions and 122 deletions
@@ -19,7 +19,7 @@
<div class="card-top">
<span class="card-icon">{{ roleIcon(template.category) }}</span>
<div class="card-title-wrap">
<span class="card-name">{{ template.category ? (ROLE_LABELS[template.category] || template.name) : template.name }}</span>
<span class="card-name">{{ template.name }}</span>
<span v-if="template.description" class="card-desc">{{ template.description }}</span>
</div>
<el-tag v-if="!template.is_system" size="small" effect="dark" round type="success" class="card-badge">自定义</el-tag>
@@ -62,7 +62,7 @@
</template>
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { ref, onMounted, watch } from "vue";
import { ElMessage } from "element-plus";
import {
fetchPermissionTemplates,
@@ -73,6 +73,7 @@ const props = defineProps<{
studyId: string;
currentPermissions?: Record<string, Record<string, boolean>>;
activeRoles?: string[];
refreshKey?: number;
}>();
const emit = defineEmits<{
@@ -81,11 +82,6 @@ const emit = defineEmits<{
const templates = ref<PermissionTemplate[]>([]);
const ROLE_LABELS: Record<string, string> = {
PM: "项目负责人", CRA: "CRA", PV: "PV",
MEDICAL_REVIEW: "医学审核", IMP: "药品管理员",
};
const roleIcon = (category: string | null) => {
const icons: Record<string, string> = {
PM: "👑", CRA: "📋", PV: "🔍",
@@ -144,6 +140,7 @@ const loadTemplates = async () => {
};
onMounted(loadTemplates);
watch(() => props.refreshKey, loadTemplates);
</script>
<style scoped>