fix(admin): 重构知识库配置布局
This commit is contained in:
1 parent
70d7435b5f
commit
25876f94bd
18 files changed
+556
-229
No files matched your search
@@ -41,6 +41,7 @@ const {
|
||||
chatLogsColumns,
|
||||
chatLogsSortRules,
|
||||
isChatLogsTable,
|
||||
showReportTable,
|
||||
visibleReportKeys,
|
||||
allReportRowsSelected,
|
||||
paginatedSortedTableData,
|
||||
@@ -240,10 +241,10 @@ onMounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="tableData.length === 0" class="text-center text-muted py-20 bg-surface-soft rounded-2xl border border-dashed border-default">
|
||||
<div v-if="!showReportTable" class="text-center text-muted py-20 bg-surface-soft rounded-2xl border border-dashed border-default">
|
||||
<p>{{ t('admin.report.noData', { table: getReportTableLabel(currentTable) }) }}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-else class="admin-report-table-wrap">
|
||||
<table class="admin-report-table w-full border-collapse">
|
||||
<thead>
|
||||
@@ -289,6 +290,14 @@ onMounted(() => {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-if="paginatedSortedTableData.length === 0">
|
||||
<td
|
||||
:colspan="visibleReportKeys.length + (isChatLogsTable && showChatLogsSelection ? 1 : 0)"
|
||||
class="text-center text-muted py-12"
|
||||
>
|
||||
{{ t('admin.report.noFilterResults') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-for="(row, idx) in paginatedSortedTableData" :key="idx">
|
||||
<td v-if="isChatLogsTable && showChatLogsSelection" class="px-4 py-3">
|
||||
<input
|
||||
@@ -314,7 +323,7 @@ onMounted(() => {
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div v-if="tableData.length > 0" class="flex flex-col gap-3 rounded-2xl border border-default bg-surface px-4 py-3 md:flex-row md:items-center md:justify-between">
|
||||
<div v-if="showReportTable" class="flex flex-col gap-3 rounded-2xl border border-default bg-surface px-4 py-3 md:flex-row md:items-center md:justify-between">
|
||||
<div class="text-sm text-secondary">
|
||||
{{ t('admin.report.paginationSummary', { total: reportTotalRows, page: reportCurrentPage, pages: reportTotalPages }) }}
|
||||
</div>
|
||||
|
||||
@@ -344,6 +344,10 @@ const handleFilterChange = () => {
|
||||
};
|
||||
|
||||
const isChatLogsTable = computed(() => currentTable.value === 'chat_logs');
|
||||
/** 列已初始化后(含筛选无结果)仍展示表头与筛选框,避免用户无法修改条件 */
|
||||
const showReportTable = computed(
|
||||
() => tableData.value.length > 0 || chatLogsColumns.value.length > 0,
|
||||
);
|
||||
const visibleReportKeys = computed(() => {
|
||||
let keys: string[];
|
||||
if (chatLogsColumns.value.length === 0) {
|
||||
@@ -782,6 +786,7 @@ const batchDeleteChatLogs = async () => {
|
||||
|
||||
watch(currentTable, async () => {
|
||||
columnFilters.value = {}; // Reset filters on table change
|
||||
chatLogsColumns.value = [];
|
||||
selectedReportRowIds.value = [];
|
||||
showChatLogsColumnPanel.value = false;
|
||||
showChatLogsSelection.value = false;
|
||||
@@ -880,6 +885,7 @@ watch([reportPageSize, sortedTableData], () => {
|
||||
reportHeaderSort,
|
||||
draggingColumnKey,
|
||||
isChatLogsTable,
|
||||
showReportTable,
|
||||
visibleReportKeys,
|
||||
allReportRowsSelected,
|
||||
sortedTableData,
|
||||
|
||||
Reference in new issue
Block a user