统一项目角色展示与预设文案
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user