feat: 管理端用户列表显示姓名和公司

This commit is contained in:
Nixevol
2026-11-18 11:53:05 +08:00
parent 032c5280e7
commit 199960276a
8 changed files with 86 additions and 1 deletions
+8
View File
@@ -9,6 +9,8 @@ import { isRecord, textOf } from "../../shared/text";
interface UserRow {
employee_id: string;
user_name: string;
company: string;
has_credential: boolean;
refresh_paused: boolean;
last_refresh_at: string | null;
@@ -164,6 +166,8 @@ function asUser(value: unknown): UserRow | null {
if (!isRecord(value) || (typeof value.employee_id !== "string" && typeof value.employee_id !== "number")) return null;
return {
employee_id: String(value.employee_id),
user_name: textOf(value.user_name),
company: textOf(value.company),
has_credential: value.has_credential === true,
refresh_paused: value.refresh_paused === true,
last_refresh_at: typeof value.last_refresh_at === "string" && value.last_refresh_at ? value.last_refresh_at : null,
@@ -892,6 +896,8 @@ onMounted(() => {
<n-checkbox aria-label="选择全部账号" :checked="allPicked" :indeterminate="somePicked" @update:checked="toggleAll" />
</th>
<th>工号</th>
<th>用户名称</th>
<th>公司</th>
<th>凭据</th>
<th>有效</th>
<th>本月学时</th>
@@ -908,6 +914,8 @@ onMounted(() => {
<n-checkbox aria-label="选择该账号" :checked="Boolean(picked[row.employee_id])" @update:checked="(checked: boolean) => (picked = { ...picked, [row.employee_id]: checked })" />
</td>
<td class="employee">{{ row.employee_id }}</td>
<td class="name">{{ row.user_name || "—" }}</td>
<td class="company">{{ row.company || "—" }}</td>
<td>{{ row.has_credential ? "已保存凭据" : "未保存凭据" }}</td>
<td :class="validityClass(validityText(row))">{{ validityText(row) }}</td>
<td class="when">{{ monthHoursText(row) }}</td>
+6 -1
View File
@@ -1569,7 +1569,7 @@ select {
}
.admin-table { width: 100%;
min-width: 820px;
min-width: 980px;
border-collapse: collapse;
}
@@ -1597,11 +1597,16 @@ select {
}
.admin-table .employee,
.admin-table .name,
.admin-table .when {
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.admin-table .company {
max-width: 240px;
}
.admin-table .ok {
color: var(--accent);
}