添加预览图片功能

This commit is contained in:
2026-07-19 19:15:22 +08:00
parent 164e658e5b
commit 3c6b142098
11 changed files with 196 additions and 113 deletions

View File

@@ -142,11 +142,9 @@ const syncTargetDescription = computed(() => {
});
const syncFileDetails = computed(() => {
const files = syncFeedback.value?.result?.files || [];
return [...files].sort((left, right) => {
if (left.action === "skip" && right.action !== "skip") return 1;
if (left.action !== "skip" && right.action === "skip") return -1;
return left.path.localeCompare(right.path);
});
return files
.filter((file) => file.action !== "skip")
.sort((left, right) => left.path.localeCompare(right.path));
});
const menuItems: Array<{
@@ -875,7 +873,7 @@ onBeforeUnmount(() => {
<div class="settings-sync-file-section">
<div class="settings-sync-file-heading">
<strong>文件明细</strong>
<strong>变更文件</strong>
<span>{{ syncFileDetails.length }} 个文件</span>
</div>
<div v-if="syncFileDetails.length" class="settings-sync-file-list">
@@ -887,7 +885,7 @@ onBeforeUnmount(() => {
<span class="settings-sync-file-size">{{ formatFileSize(file.size) }}</span>
</div>
</div>
<p v-else class="settings-sync-file-empty">工作目录与远端都没有文件</p>
<p v-else class="settings-sync-file-empty">本次同步没有文件变更</p>
</div>
</template>
</section>