check page, fix some
This commit is contained in:
19
src/App.vue
19
src/App.vue
@@ -230,14 +230,17 @@ const appendLog = (msg: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleDeleteEmptyDirs = async () => {
|
const handleDeleteEmptyDirs = async () => {
|
||||||
checkLogs.value = [];
|
appendLog("---" + " 删除空目录操作 @ " + new Date().toLocaleString() + " ---");
|
||||||
appendLog("正在扫描并删除空目录...");
|
appendLog("正在扫描并删除空目录...");
|
||||||
try {
|
try {
|
||||||
const deleted = await invoke<string[]>('delete_empty_dirs', { path: currentDir.value });
|
const deleted = await invoke<string[]>('delete_empty_dirs', { path: currentDir.value });
|
||||||
if (deleted.length === 0) {
|
if (deleted.length === 0) {
|
||||||
appendLog("未发现空目录。");
|
appendLog("未发现空目录。");
|
||||||
} else {
|
} 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} 个空目录。`);
|
appendLog(`删除完毕,共删除 ${deleted.length} 个空目录。`);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -246,7 +249,7 @@ const handleDeleteEmptyDirs = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleCheckNaming = async () => {
|
const handleCheckNaming = async () => {
|
||||||
checkLogs.value = [];
|
appendLog("---" + " 检查命名操作 @ " + new Date().toLocaleString() + " ---");
|
||||||
appendLog(`正在检查文件命名,前缀要求: ${videoNamePrefix.value} ...`);
|
appendLog(`正在检查文件命名,前缀要求: ${videoNamePrefix.value} ...`);
|
||||||
try {
|
try {
|
||||||
const mismatches = await invoke<string[]>('check_file_naming', {
|
const mismatches = await invoke<string[]>('check_file_naming', {
|
||||||
@@ -347,7 +350,7 @@ const handleCopy = async () => {
|
|||||||
// Reactivity for Current Directory Prefix
|
// Reactivity for Current Directory Prefix
|
||||||
watch(currentDir, (newPath) => {
|
watch(currentDir, (newPath) => {
|
||||||
if (!newPath) return;
|
if (!newPath) return;
|
||||||
const dirName = newPath.split(/[/\\]/).pop();
|
const dirName = newPath.split(/[\/\\]/).pop();
|
||||||
if (!dirName) return;
|
if (!dirName) return;
|
||||||
|
|
||||||
const regex = /^(\d{2})(\d{2})视频$/;
|
const regex = /^(\d{2})(\d{2})视频$/;
|
||||||
@@ -523,7 +526,7 @@ watch(currentDir, (newPath) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Check Page -->
|
<!-- Check Page -->
|
||||||
<div v-else-if="activeMenu === 'check'">
|
<div v-else-if="activeMenu === 'check'" style="display: flex; flex-direction: column; height: 100%;">
|
||||||
<h2>检查</h2>
|
<h2>检查</h2>
|
||||||
|
|
||||||
<el-alert
|
<el-alert
|
||||||
@@ -535,7 +538,7 @@ watch(currentDir, (newPath) => {
|
|||||||
style="margin-bottom: 20px"
|
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">
|
<div class="check-actions">
|
||||||
<el-button type="danger" :icon="Delete" @click="handleDeleteEmptyDirs">删除空目录</el-button>
|
<el-button type="danger" :icon="Delete" @click="handleDeleteEmptyDirs">删除空目录</el-button>
|
||||||
<el-button type="primary" :icon="Refresh" @click="handleCheckNaming">检查命名</el-button>
|
<el-button type="primary" :icon="Refresh" @click="handleCheckNaming">检查命名</el-button>
|
||||||
@@ -687,7 +690,7 @@ body {
|
|||||||
background-color: var(--el-bg-color);
|
background-color: var(--el-bg-color);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 400px;
|
flex-grow: 1; /* Make it fill available height */
|
||||||
}
|
}
|
||||||
.log-header {
|
.log-header {
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
@@ -700,7 +703,7 @@ body {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 10px;
|
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;
|
font-size: 13px;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user