Improve music processing robustness and workflow UX
Unify safe file-move behavior and richer progress semantics across backend tasks, while upgrading traditional-to-simplified conversion and refining the frontend multi-step panels for clearer execution feedback.
This commit is contained in:
@@ -10,13 +10,13 @@
|
||||
class="app-menu"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<el-menu-item index="aggregate">01 音频文件汇聚</el-menu-item>
|
||||
<el-menu-item index="convert">02 音频格式智能处理</el-menu-item>
|
||||
<el-menu-item index="dedup">03 音乐去重</el-menu-item>
|
||||
<el-menu-item index="zhconvert">04 元数据繁简转换</el-menu-item>
|
||||
<el-menu-item index="organize">05 音乐整理</el-menu-item>
|
||||
<el-menu-item index="merge">06 整理入库</el-menu-item>
|
||||
<el-menu-item index="settings">全局设置</el-menu-item>
|
||||
<el-menu-item
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
:index="tab.key"
|
||||
>
|
||||
{{ tab.menuLabel }}
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
<h1>{{ currentTitle }}</h1>
|
||||
<p>{{ currentSubtitle }}</p>
|
||||
</div>
|
||||
<div class="app-header-meta">
|
||||
<span class="app-header-index">{{ currentTab.badge }}</span>
|
||||
<span class="app-header-helper">执行面板</span>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="app-main">
|
||||
<component :is="currentComponent" />
|
||||
@@ -35,14 +39,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import AggregateTab from './components/AggregateTab.vue';
|
||||
import ConvertTab from './components/ConvertTab.vue';
|
||||
import DedupTab from './components/DedupTab.vue';
|
||||
import TraditionalFilterTab from './components/TraditionalFilterTab.vue';
|
||||
import RenameTab from './components/RenameTab.vue';
|
||||
import MergeTab from './components/MergeTab.vue';
|
||||
import SettingsTab from './components/SettingsTab.vue';
|
||||
import { computed, defineAsyncComponent, ref } from 'vue';
|
||||
import type { Component } from 'vue';
|
||||
|
||||
const AggregateTab = defineAsyncComponent(() => import('./components/AggregateTab.vue'));
|
||||
const ConvertTab = defineAsyncComponent(() => import('./components/ConvertTab.vue'));
|
||||
const DedupTab = defineAsyncComponent(() => import('./components/DedupTab.vue'));
|
||||
const TraditionalFilterTab = defineAsyncComponent(() => import('./components/TraditionalFilterTab.vue'));
|
||||
const RenameTab = defineAsyncComponent(() => import('./components/RenameTab.vue'));
|
||||
const MergeTab = defineAsyncComponent(() => import('./components/MergeTab.vue'));
|
||||
const SettingsTab = defineAsyncComponent(() => import('./components/SettingsTab.vue'));
|
||||
|
||||
type TabKey =
|
||||
| 'aggregate'
|
||||
@@ -53,70 +59,85 @@ type TabKey =
|
||||
| 'merge'
|
||||
| 'settings';
|
||||
|
||||
interface TabDefinition {
|
||||
key: TabKey;
|
||||
menuLabel: string;
|
||||
badge: string;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
component: Component;
|
||||
}
|
||||
|
||||
const tabs: TabDefinition[] = [
|
||||
{
|
||||
key: 'aggregate',
|
||||
menuLabel: '01 音频文件汇聚',
|
||||
badge: 'STEP 01',
|
||||
title: '01 · 音频文件汇聚',
|
||||
subtitle: '将分散音频扁平化汇聚,为后续处理统一入口。',
|
||||
component: AggregateTab
|
||||
},
|
||||
{
|
||||
key: 'convert',
|
||||
menuLabel: '02 音频格式智能处理',
|
||||
badge: 'STEP 02',
|
||||
title: '02 · 音频格式智能处理',
|
||||
subtitle: '智能识别无损/有损格式并统一转码为 FLAC。',
|
||||
component: ConvertTab
|
||||
},
|
||||
{
|
||||
key: 'dedup',
|
||||
menuLabel: '03 音乐去重',
|
||||
badge: 'STEP 03',
|
||||
title: '03 · 音乐去重',
|
||||
subtitle: '基于 MD5 与元数据的双重策略进行音乐去重。',
|
||||
component: DedupTab
|
||||
},
|
||||
{
|
||||
key: 'zhconvert',
|
||||
menuLabel: '04 元数据繁简转换',
|
||||
badge: 'STEP 04',
|
||||
title: '04 · 音乐元数据繁体转简体',
|
||||
subtitle: '批量检测并转换标签中的繁体中文。',
|
||||
component: TraditionalFilterTab
|
||||
},
|
||||
{
|
||||
key: 'organize',
|
||||
menuLabel: '05 音乐整理',
|
||||
badge: 'STEP 05',
|
||||
title: '05 · 音乐整理',
|
||||
subtitle: '按 Navidrome 规范重命名与整理目录结构。',
|
||||
component: RenameTab
|
||||
},
|
||||
{
|
||||
key: 'merge',
|
||||
menuLabel: '06 整理入库',
|
||||
badge: 'STEP 06',
|
||||
title: '06 · 整理入库',
|
||||
subtitle: '将整理好的 staging 目录智能合并入主库。',
|
||||
component: MergeTab
|
||||
},
|
||||
{
|
||||
key: 'settings',
|
||||
menuLabel: '全局设置',
|
||||
badge: 'CONFIG',
|
||||
title: '全局配置与路径设置',
|
||||
subtitle: '配置全局工作目录与各阶段标准子目录。',
|
||||
component: SettingsTab
|
||||
}
|
||||
];
|
||||
|
||||
const tabMap = tabs.reduce((acc, tab) => {
|
||||
acc[tab.key] = tab;
|
||||
return acc;
|
||||
}, {} as Record<TabKey, TabDefinition>);
|
||||
|
||||
const activeKey = ref<TabKey>('aggregate');
|
||||
|
||||
const currentComponent = computed(() => {
|
||||
switch (activeKey.value) {
|
||||
case 'aggregate':
|
||||
return AggregateTab;
|
||||
case 'convert':
|
||||
return ConvertTab;
|
||||
case 'dedup':
|
||||
return DedupTab;
|
||||
case 'zhconvert':
|
||||
return TraditionalFilterTab;
|
||||
case 'organize':
|
||||
return RenameTab;
|
||||
case 'merge':
|
||||
return MergeTab;
|
||||
case 'settings':
|
||||
return SettingsTab;
|
||||
default:
|
||||
return AggregateTab;
|
||||
}
|
||||
});
|
||||
|
||||
const currentTitle = computed(() => {
|
||||
switch (activeKey.value) {
|
||||
case 'aggregate':
|
||||
return '01 · 音频文件汇聚';
|
||||
case 'convert':
|
||||
return '02 · 音频格式智能处理';
|
||||
case 'dedup':
|
||||
return '03 · 音乐去重';
|
||||
case 'zhconvert':
|
||||
return '04 · 音乐元数据繁体转简体';
|
||||
case 'organize':
|
||||
return '05 · 音乐整理';
|
||||
case 'merge':
|
||||
return '06 · 整理入库';
|
||||
case 'settings':
|
||||
return '全局配置与路径设置';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
});
|
||||
|
||||
const currentSubtitle = computed(() => {
|
||||
switch (activeKey.value) {
|
||||
case 'aggregate':
|
||||
return '将分散音频扁平化汇聚,为后续处理统一入口。';
|
||||
case 'convert':
|
||||
return '智能识别无损/有损格式并统一转码为 FLAC。';
|
||||
case 'dedup':
|
||||
return '基于 MD5 与元数据的双重策略进行音乐去重。';
|
||||
case 'zhconvert':
|
||||
return '批量检测并转换标签中的繁体中文。';
|
||||
case 'organize':
|
||||
return '按 Navidrome 规范重命名与整理目录结构。';
|
||||
case 'merge':
|
||||
return '将整理好的 staging 目录智能合并入主库。';
|
||||
case 'settings':
|
||||
return '配置全局工作目录与各阶段标准子目录。';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
});
|
||||
const currentTab = computed(() => tabMap[activeKey.value] || tabs[0]);
|
||||
const currentComponent = computed(() => currentTab.value.component);
|
||||
const currentTitle = computed(() => currentTab.value.title);
|
||||
const currentSubtitle = computed(() => currentTab.value.subtitle);
|
||||
|
||||
function handleSelect(key: string) {
|
||||
activeKey.value = key as TabKey;
|
||||
@@ -125,59 +146,157 @@ function handleSelect(key: string) {
|
||||
|
||||
<style scoped>
|
||||
.app-root {
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
padding: 18px;
|
||||
background:
|
||||
radial-gradient(circle at 12% 12%, rgba(15, 118, 110, 0.13), transparent 45%),
|
||||
radial-gradient(circle at 78% 4%, rgba(14, 116, 144, 0.16), transparent 40%),
|
||||
linear-gradient(145deg, #f8fbff 0%, #f3f7fd 42%, #eef5fa 100%);
|
||||
}
|
||||
|
||||
.app-aside {
|
||||
border-right: 1px solid #e5e7eb;
|
||||
padding: 16px 0;
|
||||
margin-right: 14px;
|
||||
border: 1px solid rgba(148, 163, 184, 0.28);
|
||||
border-radius: 20px;
|
||||
padding: 18px 12px;
|
||||
background: rgba(255, 255, 255, 0.78);
|
||||
backdrop-filter: blur(12px);
|
||||
box-shadow:
|
||||
0 20px 45px -30px rgba(15, 23, 42, 0.45),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.6);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.app-logo {
|
||||
padding: 0 20px 12px;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
margin-bottom: 12px;
|
||||
padding: 2px 14px 16px;
|
||||
border-bottom: 1px solid rgba(148, 163, 184, 0.26);
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.app-logo-title {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.4px;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.app-logo-sub {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-top: 4px;
|
||||
font-size: 13px;
|
||||
letter-spacing: 1.3px;
|
||||
text-transform: uppercase;
|
||||
color: #475569;
|
||||
}
|
||||
|
||||
.app-menu {
|
||||
flex: 1;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.app-menu :deep(.el-menu-item) {
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
border-radius: 11px;
|
||||
margin: 2px 6px;
|
||||
color: #334155;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.app-menu :deep(.el-menu-item:hover) {
|
||||
color: #0f172a;
|
||||
background: rgba(15, 118, 110, 0.08);
|
||||
}
|
||||
|
||||
.app-menu :deep(.el-menu-item.is-active) {
|
||||
color: #0f766e;
|
||||
font-weight: 600;
|
||||
background: linear-gradient(95deg, rgba(15, 118, 110, 0.14), rgba(14, 116, 144, 0.07));
|
||||
}
|
||||
|
||||
.app-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
justify-content: space-between;
|
||||
min-height: 88px;
|
||||
padding: 0 26px;
|
||||
border: 1px solid rgba(148, 163, 184, 0.22);
|
||||
border-radius: 18px;
|
||||
background: rgba(255, 255, 255, 0.88);
|
||||
backdrop-filter: blur(10px);
|
||||
box-shadow: 0 16px 35px -30px rgba(15, 23, 42, 0.45);
|
||||
}
|
||||
|
||||
.app-header-title h1 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.app-header-title p {
|
||||
margin: 4px 0 0;
|
||||
margin: 6px 0 0;
|
||||
font-size: 14px;
|
||||
color: #475569;
|
||||
}
|
||||
|
||||
.app-header-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.app-header-index {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 30px;
|
||||
padding: 0 12px;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.8px;
|
||||
color: #0b5f59;
|
||||
background: rgba(15, 118, 110, 0.12);
|
||||
}
|
||||
|
||||
.app-header-helper {
|
||||
font-size: 13px;
|
||||
color: #6b7280;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.app-main {
|
||||
padding: 16px;
|
||||
background: #f3f4f6;
|
||||
margin-top: 14px;
|
||||
border-radius: 18px;
|
||||
padding: 20px;
|
||||
background: rgba(255, 255, 255, 0.66);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.app-root {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.app-aside {
|
||||
width: 100% !important;
|
||||
margin-right: 0;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.app-header {
|
||||
padding: 16px;
|
||||
min-height: auto;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.app-main {
|
||||
margin-top: 10px;
|
||||
padding: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user