Browse Source
refactor(frontend): 统一列表表格为 BaseTable 组件
refactor(frontend): 统一列表表格为 BaseTable 组件
新增 BaseTable 封装 t-table,统一下发小尺寸/悬浮/占满宽度/固定表头,操作列自动右固定,替换 13 个列表页 t-table,补齐缺失 loading;同步 UI 开发准则与组件声明Spring-AI-1.1.2
16 changed files with 89 additions and 46 deletions
-
9frontend/UI-DEV-GUIDE.md
-
2frontend/components.d.ts
-
40frontend/src/components/BaseTable.vue
-
9frontend/src/views/AccountManager.vue
-
4frontend/src/views/ApiKeyManager.vue
-
4frontend/src/views/AuditLogManager.vue
-
10frontend/src/views/ConversationManager.vue
-
2frontend/src/views/DashboardPanel.vue
-
4frontend/src/views/FaqManager.vue
-
4frontend/src/views/FeedbackOps.vue
-
10frontend/src/views/McpServerManager.vue
-
6frontend/src/views/ModelConfigManager.vue
-
14frontend/src/views/PromptTracePanel.vue
-
4frontend/src/views/SensitiveWordManager.vue
-
9frontend/src/views/UserManager.vue
-
4frontend/src/views/WebhookManager.vue
@ -0,0 +1,40 @@ |
|||
<script setup lang="ts"> |
|||
import { computed } from 'vue' |
|||
|
|||
defineOptions({ inheritAttrs: false }) |
|||
|
|||
const props = withDefaults( |
|||
defineProps<{ |
|||
columns?: any[] |
|||
/** 统一最大高度,传 '' 或 0 关闭固定表头 */ |
|||
maxHeight?: string | number |
|||
}>(), |
|||
{ |
|||
columns: () => [], |
|||
maxHeight: 'calc(100vh - 240px)', |
|||
}, |
|||
) |
|||
|
|||
// 操作列自动右固定:colKey === 'op' 且未显式 fixed 时补 fixed:'right' |
|||
const resolvedColumns = computed(() => |
|||
props.columns.map((col) => |
|||
col && col.colKey === 'op' && !col.fixed ? { ...col, fixed: 'right' } : col, |
|||
), |
|||
) |
|||
</script> |
|||
|
|||
<template> |
|||
<t-table |
|||
v-bind="$attrs" |
|||
size="small" |
|||
hover |
|||
table-layout="fixed" |
|||
:max-height="maxHeight" |
|||
:columns="resolvedColumns" |
|||
> |
|||
<!-- 动态透传所有具名插槽(op / title / fileType / ... 及作用域插槽) --> |
|||
<template v-for="(_, name) in $slots" #[name]="slotProps"> |
|||
<slot :name="name" v-bind="slotProps || {}" /> |
|||
</template> |
|||
</t-table> |
|||
</template> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue