列表内高频操作直达-初稿(ID问题未解决)

This commit is contained in:
Cheng Zhou
2025-12-17 23:16:46 +08:00
parent ad4fa6ae7a
commit 7d2ae5658d
2840 changed files with 592 additions and 2020 deletions
+13 -1
View File
@@ -23,7 +23,11 @@
<el-card>
<el-table :data="subjects" v-loading="loading" style="width: 100%" @row-click="goDetail">
<el-table-column prop="subject_no" label="受试者编号" />
<el-table-column prop="site_id" label="中心ID" />
<el-table-column prop="site_id" label="中心">
<template #default="scope">
{{ siteName(scope.row.site_id) }}
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="120">
<template #default="scope">
<el-tag>{{ statusLabel(scope.row.status) }}</el-tag>
@@ -66,6 +70,12 @@ const loading = ref(false);
const total = ref(0);
const page = ref(1);
const pageSize = 10;
const siteMap = computed(() =>
sites.value.reduce<Record<string, string>>((acc, cur) => {
acc[cur.id] = cur.name || cur.id;
return acc;
}, {})
);
const statuses = ["SCREENING", "ENROLLED", "COMPLETED", "DROPPED"];
@@ -140,6 +150,8 @@ const statusLabel = (v: string) =>
COMPLETED: "已完成",
DROPPED: "已脱落",
}[v] || v);
const siteName = (id: string) => siteMap.value[id] || id || "-";
</script>
<style scoped>