check page, fix some

This commit is contained in:
Julian Freeman
2025-12-07 20:33:32 -04:00
parent f42ee4ec9e
commit 785931ef65

View File

@@ -230,14 +230,17 @@ const appendLog = (msg: string) => {
}
const handleDeleteEmptyDirs = async () => {
checkLogs.value = [];
appendLog("---" + " 删除空目录操作 @ " + new Date().toLocaleString() + " ---");
appendLog("正在扫描并删除空目录...");
try {
const deleted = await invoke<string[]>('delete_empty_dirs', { path: currentDir.value });
if (deleted.length === 0) {
appendLog("未发现空目录。");
} else {
deleted.forEach(path => appendLog(`已删除: ${path}`));
for (const path of deleted) {
appendLog(`已删除: ${path}`);
await new Promise(resolve => setTimeout(resolve, 50)); // Small delay for buffering effect
}
appendLog(`删除完毕,共删除 ${deleted.length} 个空目录。`);
}
} catch (e) {
@@ -246,7 +249,7 @@ const handleDeleteEmptyDirs = async () => {
}
const handleCheckNaming = async () => {
checkLogs.value = [];
appendLog("---" + " 检查命名操作 @ " + new Date().toLocaleString() + " ---");
appendLog(`正在检查文件命名,前缀要求: ${videoNamePrefix.value} ...`);
try {
const mismatches = await invoke<string[]>('check_file_naming', {
@@ -347,7 +350,7 @@ const handleCopy = async () => {
// Reactivity for Current Directory Prefix
watch(currentDir, (newPath) => {
if (!newPath) return;
const dirName = newPath.split(/[/\\]/).pop();
const dirName = newPath.split(/[\/\\]/).pop();
if (!dirName) return;
const regex = /^(\d{2})(\d{2})视频$/;
@@ -523,7 +526,7 @@ watch(currentDir, (newPath) => {
</div>
<!-- Check Page -->
<div v-else-if="activeMenu === 'check'">
<div v-else-if="activeMenu === 'check'" style="display: flex; flex-direction: column; height: 100%;">
<h2>检查</h2>
<el-alert
@@ -535,7 +538,7 @@ watch(currentDir, (newPath) => {
style="margin-bottom: 20px"
/>
<div :class="{ 'disabled-area': isReviewDisabled }">
<div :class="{ 'disabled-area': isReviewDisabled }" style="display: flex; flex-direction: column; flex-grow: 1;">
<div class="check-actions">
<el-button type="danger" :icon="Delete" @click="handleDeleteEmptyDirs">删除空目录</el-button>
<el-button type="primary" :icon="Refresh" @click="handleCheckNaming">检查命名</el-button>
@@ -687,7 +690,7 @@ body {
background-color: var(--el-bg-color);
display: flex;
flex-direction: column;
height: 400px;
flex-grow: 1; /* Make it fill available height */
}
.log-header {
padding: 10px 15px;
@@ -700,7 +703,7 @@ body {
flex: 1;
overflow-y: auto;
padding: 10px;
font-family: monospace;
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif; /* Matched body font */
font-size: 13px;
white-space: pre-wrap;
}