-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- {{ formatBytes(item.received) }} / {{ formatBytes(item.total) }} ({{ item.percent }}%)
+ {{ formatBytes(item.received) }} / {{ formatBytes(item.total) }} ({{ item.percent }}%)
{{ formatBytes(item.total) }}
@@ -135,7 +157,10 @@
data() {
return {
query: '',
+
items: [],
+ waiting: false,
+
lang: {
// 语言设置
locale: 'zh-CN',
@@ -193,8 +218,9 @@
this.getList();
// 监听下载任务列表
- electron?.listener('download-items', (items) => {
+ electron?.listener('download-items', ({items, waiting}) => {
this.items = items
+ this.waiting = waiting
});
// 接收主题
@@ -251,6 +277,7 @@
try {
const data = await this.sendAsync('get');
this.items = data.items || [];
+ this.waiting = data.waiting || false;
} catch (e) {
console.error('加载下载任务失败:', e);
}
diff --git a/electron/render/download/style.css b/electron/render/download/style.css
index 2c37c87a5..45f1aa6bc 100644
--- a/electron/render/download/style.css
+++ b/electron/render/download/style.css
@@ -286,6 +286,82 @@ body {
color: var(--color-empty-text);
}
+/* 骨架屏样式 */
+.skeleton-item {
+ opacity: 0.7;
+}
+
+.skeleton-item:last-child {
+ border-bottom: none;
+}
+
+/* 骨架元素基础动画 */
+@keyframes skeleton-shimmer {
+ 0% {
+ background-position: -200px 0;
+ }
+ 100% {
+ background-position: calc(200px + 100%) 0;
+ }
+}
+
+.skeleton-file-icon,
+.skeleton-name,
+.skeleton-size,
+.skeleton-time,
+.skeleton-status,
+.skeleton-btn {
+ background: linear-gradient(90deg, var(--color-task-item-border) 25%, var(--color-task-item-hover-bg) 50%, var(--color-task-item-border) 75%);
+ background-size: 200px 100%;
+ animation: skeleton-shimmer 1.5s infinite linear;
+ border-radius: 4px;
+}
+
+/* 骨架文件图标 */
+.skeleton-file-icon {
+ width: 32px;
+ height: 32px;
+ margin: 0 4px;
+ border-radius: 4px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+/* 骨架文件名 */
+.skeleton-name {
+ height: 13px;
+ width: 60%;
+ margin: 4px 0 6px;
+ max-width: 200px;
+}
+
+/* 骨架元信息 */
+.skeleton-size {
+ height: 12px;
+ width: 80px;
+}
+
+.skeleton-time {
+ height: 12px;
+ width: 100px;
+}
+
+.skeleton-status {
+ height: 12px;
+ width: 60px;
+ padding: 2px 8px;
+ border-radius: 12px;
+}
+
+/* 骨架操作按钮 */
+.skeleton-btn {
+ width: 22px;
+ height: 22px;
+ border-radius: 50%;
+ margin-right: 8px;
+}
+
/* 任务列表 */
.task-list {
padding: 0;
@@ -294,7 +370,8 @@ body {
.task-item {
display: flex;
align-items: center;
- padding: 16px 24px;
+ height: 72px;
+ padding: 0 24px;
background: var(--color-task-item-bg);
border-bottom: 1px solid var(--color-task-item-border);
transition: background-color 0.15s;
@@ -353,8 +430,7 @@ body {
flex: 1;
display: flex;
flex-direction: column;
- justify-content: center;
- gap: 6px;
+ justify-content: space-between;
min-width: 0;
}
diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js
index a92aff363..b707e5de2 100644
--- a/resources/assets/js/store/actions.js
+++ b/resources/assets/js/store/actions.js
@@ -465,6 +465,11 @@ export default {
url = $A.urlAddParams(url, params);
}
if ($A.Electron) {
+ $A.Electron.request({
+ action: 'openDownloadWindow',
+ language: languageName,
+ theme: state.themeName,
+ });
$A.Electron.request({
action: 'createDownload',
url