fix: 重新正确构建选题管理页面,修复 HTML 结构
This commit is contained in:
@@ -90,7 +90,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="currentPage === 'topics'" style="margin-left: 160px; width: 100%; max-width: calc(100vw - 160px); box-sizing: border-box; overflow-x: auto;">
|
<div v-if="currentPage === 'topics'" style="margin-left: 160px; width: 100%; max-width: calc(100vw - 160px); box-sizing: border-box; overflow-x: auto;">
|
||||||
<div class="card" style="padding: 20px; margin-top: 20px;">
|
|
||||||
<div class="flex justify-between items-center mb-6" style="width: 100%;"><h2 class="text-2xl font-bold text-gray-800">📋 选题管理</h2></div>
|
<div class="flex justify-between items-center mb-6" style="width: 100%;"><h2 class="text-2xl font-bold text-gray-800">📋 选题管理</h2></div>
|
||||||
<div class="card mb-6" style="display: inline-block; min-width: fit-content;"><div class="flex flex-wrap gap-2 items-center">
|
<div class="card mb-6" style="display: inline-block; min-width: fit-content;"><div class="flex flex-wrap gap-2 items-center">
|
||||||
<el-button type="primary" size="small" @click="refreshAll">🔄 批量刷新</el-button>
|
<el-button type="primary" size="small" @click="refreshAll">🔄 批量刷新</el-button>
|
||||||
@@ -157,6 +156,50 @@
|
|||||||
<el-table-column label="操作" width="150"><template #default="scope"><el-button size="small" type="danger" @click="deleteUser(scope.row.id)" :disabled="scope.row.role === 'admin'">删除</el-button></template></el-table-column>
|
<el-table-column label="操作" width="150"><template #default="scope"><el-button size="small" type="danger" @click="deleteUser(scope.row.id)" :disabled="scope.row.role === 'admin'">删除</el-button></template></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card" style="padding: 20px; margin-top: 20px;">
|
||||||
|
<div class="flex justify-between items-center mb-6" style="width: 100%;"><h2 class="text-2xl font-bold text-gray-800">📋 选题管理</h2></div>
|
||||||
|
|
||||||
|
<div class="card mb-6" style="display: inline-block; min-width: fit-content;"><div class="flex flex-wrap gap-2 items-center">
|
||||||
|
<el-button type="primary" size="small" @click="refreshAll">🔄 批量刷新</el-button>
|
||||||
|
<el-button type="success" size="small" @click="triggerGenerateSelected" :disabled="selectedTopicIds.length === 0">▶ 批量创作</el-button>
|
||||||
|
<el-button type="warning" size="small" @click="triggerOptimizeSelected" :disabled="selectedTopicIds.length === 0">🔍 批量优化</el-button>
|
||||||
|
<span class="ml-auto text-sm text-gray-500" v-if="selectedTopicIds.length > 0">已选 {{ selectedTopicIds.length }} 项</span>
|
||||||
|
</div></div>
|
||||||
|
<div class="quick-filter mb-4">
|
||||||
|
<el-tag size="large" :type="filterStatus === '' ? 'primary' : ''" @click="filterStatus = ''">全部 ({{ topics.length }})</el-tag>
|
||||||
|
<el-tag size="large" :type="filterStatus === '待处理' ? 'primary' : ''" @click="filterStatus = '待处理'">待处理 ({{ countByStatus('待处理') }})</el-tag>
|
||||||
|
<el-tag size="large" :type="filterStatus === '待审查' ? 'primary' : ''" @click="filterStatus = '待审查'">待审查 ({{ countByStatus('待审查') }})</el-tag>
|
||||||
|
<el-tag size="large" :type="filterStatus === '待发布' ? 'primary' : ''" @click="filterStatus = '待发布'">待发布 ({{ countByStatus('待发布') }})</el-tag>
|
||||||
|
<el-tag size="large" :type="filterStatus === '已发布' ? 'primary' : ''" @click="filterStatus = '已发布'">已发布 ({{ countByStatus('已发布') }})</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="card" style="width: 100%; overflow-x: auto; box-sizing: border-box;">
|
||||||
|
<el-table :data="filteredTopics" style="width: 100%; overflow-x: auto; box-sizing: border-box;" stripe v-loading="loadingTable" :row-key="topic => topic.id" @selection-change="selectedTopicIds = $event">
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column prop="id" label="ID" width="70" fixed></el-table-column>
|
||||||
|
<el-table-column prop="title" label="标题" min-width="220"></el-table-column>
|
||||||
|
<el-table-column prop="field" label="领域" width="100"></el-table-column>
|
||||||
|
<el-table-column prop="priority_score" label="优先级" width="70"><template #default="scope"><el-tag :type="getPriorityType(scope.row.priority_score)" size="small">{{ scope.row.priority_score }}</el-tag></template></el-table-column>
|
||||||
|
<el-table-column prop="status" label="状态" width="90"><template #default="scope"><span class="status-badge"><span class="status-dot" :class="getStatusClass(scope.row.status)"></span>{{ scope.row.status }}</span></template></el-table-column>
|
||||||
|
<el-table-column prop="compliance_score" label="合规分" width="90"><template #default="scope"><el-progress :percentage="scope.row.compliance_score || 0" :format="() => scope.row.compliance_score || '- '" :stroke-width="15"></el-progress></template></el-table-column>
|
||||||
|
<el-table-column prop="created_at" label="创建时间" width="140"><template #default="scope">{{ formatDate(scope.row.created_at) }}</template></el-table-column>
|
||||||
|
<el-table-column prop="generated_at" label="创作时间" width="140"><template #default="scope">{{ scope.row.generated_at ? formatDate(scope.row.generated_at) : '- '}}< /template></el-table-column>
|
||||||
|
<el-table-column prop="published_at" label="发布时间" width="140"><template #default="scope">{{ scope.row.published_at ? formatDate(scope.row.published_at) : '- '}}< /template></el-table-column>
|
||||||
|
<el-table-column prop="updated_at" label="更新时间" width="140"><template #default="scope">{{ formatDate(scope.row.updated_at) }}</template></el-table-column>
|
||||||
|
<el-table-column label="操作" width="210" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<div class="flex flex-wrap gap-1" style="justify-content: flex-start;">
|
||||||
|
<el-button size="small" @click="openPreview(scope.row)" type="primary">预览</el-button>
|
||||||
|
<el-button size="small" type="success" :disabled="scope.row.status !== '待处理'" @click="createTopic(scope.row)">创作</el-button>
|
||||||
|
<el-button size="small" type="warning" :disabled="scope.row.status !== '待审查'" @click="optimizeTopic(scope.row)">审查</el-button>
|
||||||
|
<el-button v-if="scope.row.status === '待发布'" size="small" type="primary" @click="handlePublish(scope.row)">发布</el-button>
|
||||||
|
<el-button size="small" type="danger" @click="deleteTopic(scope.row.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user