style: 统一内容区卡片、表单和对话框排版

This commit is contained in:
2026-11-02 10:07:36 +08:00
parent 08b2cb35be
commit d6c328a8d2
9 changed files with 388 additions and 238 deletions
+40 -29
View File
@@ -34,6 +34,13 @@ function statusLabel(status: string) {
return "失败";
}
function statusClass(status: string) {
if (status === "done") return "status-ok";
if (status === "running") return "status-run";
if (status === "failed") return "status-bad";
return "status-wait";
}
function rangeLabel(row: Task) {
if (row.start && row.end) return `${row.start} 至 ${row.end}`;
return "全部时间";
@@ -138,37 +145,41 @@ onUnmounted(stopPoll);
<n-button type="primary" @click="show = true">提交任务</n-button>
</header>
<div class="admin-scroll">
<table v-if="tasks.length" class="admin-table">
<thead>
<tr>
<th>小区</th>
<th>时间</th>
<th>提交时间</th>
<th>格式</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr v-for="row in tasks" :key="row.id">
<td>{{ row.cellKey || "全部" }}</td>
<td>{{ rangeLabel(row) }}</td>
<td>{{ submittedLabel(row.createdAt) }}</td>
<td>{{ row.format }}</td>
<td>
<div :class="row.status === 'failed' ? 'late' : ''">{{ statusLabel(row.status) }}</div>
<div v-if="row.error" class="late">{{ row.error }}</div>
</td>
<td>
<n-button v-if="row.status === 'done'" type="primary" size="small" @click="download(row)">下载结果</n-button>
</td>
</tr>
</tbody>
</table>
<p v-else class="admin-status">还没有任务</p>
<div v-if="tasks.length" class="surface table-card">
<table class="admin-table">
<thead>
<tr>
<th>小区</th>
<th>时间</th>
<th>提交时间</th>
<th class="col-format">格式</th>
<th>状态</th>
<th class="col-actions">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="row in tasks" :key="row.id">
<td>{{ row.cellKey || "全部" }}</td>
<td>{{ rangeLabel(row) }}</td>
<td>{{ submittedLabel(row.createdAt) }}</td>
<td class="col-format">{{ row.format }}</td>
<td>
<div :class="statusClass(row.status)">{{ statusLabel(row.status) }}</div>
<div v-if="row.error" class="status-bad">{{ row.error }}</div>
</td>
<td class="col-actions">
<n-button v-if="row.status === 'done'" type="primary" size="small" @click="download(row)">下载结果</n-button>
</td>
</tr>
</tbody>
</table>
</div>
<div v-else class="surface empty-card">
<p class="admin-status">还没有任务</p>
</div>
</div>
</section>
<n-modal v-model:show="show" preset="dialog" title="提交任务" positive-text="提交" negative-text="取消" @positive-click="submit">
<n-modal v-model:show="show" class="app-dialog" preset="dialog" :show-icon="false" title="提交任务" positive-text="提交" negative-text="取消" @positive-click="submit">
<div class="form-row"><label>格式</label><n-select v-model:value="format" :options="formats" /></div>
<div class="form-row"><label>小区</label><n-input v-model:value="cellKey" placeholder="留空则导出全部" /></div>
<div class="form-row">