fix: 调整任务卡片操作,并让标题图标显示出来

This commit is contained in:
2026-10-25 08:36:38 +08:00
parent 946e4caefe
commit 8925ea5f1b
3 changed files with 30 additions and 14 deletions
@@ -2,7 +2,7 @@
import { computed, onMounted, onUnmounted, ref } from "vue";
import { NButton, NCheckbox, NEmpty, NIcon, NInputNumber, NProgress, NTag, NTooltip, useDialog, useMessage } from "naive-ui";
import { ChevronBackOutline, FolderOpenOutline, HelpCircleOutline, PauseOutline, PlayOutline, StopCircleOutline, TrashOutline } from "@vicons/ionicons5";
import { ApiError, openLocal, revealLocal } from "../../shared/http";
import { ApiError, revealLocal } from "../../shared/http";
import { cancelJob, deleteJob, loadDownloadSettings, loadJobs, pauseJob, resumeJob, saveDownloadSettings, updateConcurrency, type DownloadJob } from "./api";
const props = defineProps<{ focusId: string }>();
@@ -228,11 +228,6 @@ async function resume(job: DownloadJob) {
}
}
async function openFile(job: DownloadJob) {
const opened = await openLocal(job.csvPath).catch(() => false);
if (!opened) message.info(job.csvPath);
}
async function openDir(job: DownloadJob) {
const revealed = await revealLocal(job.csvPath).catch(() => false);
if (!revealed) message.info(job.csvPath);
@@ -377,7 +372,6 @@ async function removeJob(job: DownloadJob, files: boolean) {
<template #icon><n-icon><PlayOutline /></n-icon></template>
继续
</n-button>
<n-button size="small" quaternary @click="openFile(opened)">打开</n-button>
<n-button size="small" quaternary @click="openDir(opened)">
<template #icon><n-icon><FolderOpenOutline /></n-icon></template>
</n-button>
@@ -505,9 +499,6 @@ async function removeJob(job: DownloadJob, files: boolean) {
</div>
</div>
<div class="task-actions" @click.stop>
<n-tag size="small" :type="job.status === 'running' ? 'info' : job.status === 'done' ? 'success' : job.status === 'paused' ? 'warning' : 'default'">
{{ statusLabel(job) }}
</n-tag>
<template v-if="job.status === 'running'">
<n-button v-if="!job.stopping" size="small" @click="pause(job)">
<template #icon><n-icon><PauseOutline /></n-icon></template>
@@ -535,7 +526,6 @@ async function removeJob(job: DownloadJob, files: boolean) {
<template #icon><n-icon><PlayOutline /></n-icon></template>
继续
</n-button>
<n-button size="small" quaternary @click="openFile(job)">打开</n-button>
<n-button size="small" quaternary @click="openDir(job)">
<template #icon><n-icon><FolderOpenOutline /></n-icon></template>
</n-button>
@@ -553,7 +543,9 @@ async function removeJob(job: DownloadJob, files: boolean) {
:processing="job.status === 'running'"
/>
<div class="task-foot">
<span class="sub">{{ noteText(job) }}</span>
<n-tag size="small" :type="job.status === 'running' ? 'info' : job.status === 'done' ? 'success' : job.status === 'paused' ? 'warning' : 'default'">
{{ statusLabel(job) }}
</n-tag>
<span class="sub">失败 {{ job.failed }} · {{ formatSize(job.fileBytes) }}</span>
</div>
<ul v-if="job.failures?.length" class="fail-list">
+9 -1
View File
@@ -87,7 +87,15 @@ async function signOut() {
@expand="collapsed = false"
>
<div class="sider-body">
<div class="sider-title">{{ collapsed ? "N" : "NqiTools" }}</div>
<div class="sider-title" :class="{ compact: collapsed }">
<span class="brand-mark sider-mark" aria-hidden="true">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none">
<path d="M4 16.5 12 4l8 12.5" stroke="currentColor" stroke-width="1.8" />
<path d="M7.2 16.5h9.6M9.2 13.2h5.6" stroke="currentColor" stroke-width="1.8" />
</svg>
</span>
<span v-if="!collapsed">NqiTools</span>
</div>
<n-menu
v-model:expanded-keys="expanded"
:collapsed="collapsed"
+17 -1
View File
@@ -75,6 +75,7 @@ select {
display: flex;
gap: 14px;
align-items: center;
justify-content: center;
margin-bottom: 22px;
}
@@ -201,12 +202,27 @@ select {
}
.sider-title {
padding: 18px 16px 8px;
display: flex;
align-items: center;
gap: 10px;
padding: 16px 16px 8px;
font-weight: 650;
font-size: 16px;
white-space: nowrap;
}
.sider-title.compact {
justify-content: center;
padding-left: 0;
padding-right: 0;
}
.sider-mark {
width: 28px;
height: 28px;
border-radius: 8px;
}
.sider-user {
margin-top: auto;
padding: 12px;