From d40e467183d96c4e18b58a7f01eb070869641f2d Mon Sep 17 00:00:00 2001 From: SunWuyuan Date: Sun, 11 May 2025 12:03:56 +0800 Subject: [PATCH] Refactor MigrationTool.vue for improved code readability and consistency. Update template formatting, enhance button click handling, and streamline data display logic. Ensure consistent use of quotation marks and spacing throughout the component. --- src/components/MigrationTool.vue | 707 ++++++++++++++++++++++--------- 1 file changed, 496 insertions(+), 211 deletions(-) diff --git a/src/components/MigrationTool.vue b/src/components/MigrationTool.vue index d42fca0..917f0d8 100644 --- a/src/components/MigrationTool.vue +++ b/src/components/MigrationTool.vue @@ -46,8 +46,8 @@ variant="outlined" class="mt-2" > - 服务器接口格式:
- - 配置接口:域名/班号/config
+ 服务器接口格式:
+ - 配置接口:域名/班号/config
- 作业数据接口:域名/班号/homework?date=YYYY-MM-DD @@ -82,14 +82,20 @@ - {{ migrationType === 'local' ? '本地数据库内容' : '服务器数据内容' }} + {{ + migrationType === "local" ? "本地数据库内容" : "服务器数据内容" + }} - {{ migrationType === 'local' ? '扫描数据' : '加载数据' }} + {{ migrationType === "local" ? "扫描数据" : "加载数据" }} @@ -97,9 +103,10 @@ v-if="displayItems.length === 0 && !loading && !scanning" type="info" > - {{ migrationType === 'local' - ? '尚未扫描本地数据或未找到可迁移的数据。点击"扫描数据"按钮开始扫描。' - : '尚未预览服务器数据或未找到可迁移的数据。点击"加载数据"按钮开始查询。' + {{ + migrationType === "local" + ? '尚未扫描本地数据或未找到可迁移的数据。点击"扫描数据"按钮开始扫描。' + : '尚未预览服务器数据或未找到可迁移的数据。点击"加载数据"按钮开始查询。' }} @@ -112,8 +119,11 @@ class="elevation-1" > @@ -131,7 +141,10 @@ 系统将迁移表格中显示的所有数据项,迁移前请确认数据完整性。 - + @@ -169,34 +182,33 @@ - - {{ migrationSuccess ? 'mdi-check-circle' : 'mdi-alert-circle' }} + + {{ migrationSuccess ? "mdi-check-circle" : "mdi-alert-circle" }} - {{ migrationSuccess ? '迁移成功' : '迁移失败' }} + {{ migrationSuccess ? "迁移成功" : "迁移失败" }} - + {{ migrationError }}
-

成功迁移 {{ migrationStats.success }} 项数据到 {{ targetStorage === 'kv-local' ? '本地' : '服务器' }} KV 存储。

+

+ 成功迁移 {{ migrationStats.success }} 项数据到 + {{ targetStorage === "kv-local" ? "本地" : "服务器" }} KV 存储。 +

迁移详情 - + {{ item.key }} - {{ item.success ? '成功' : '失败' }} {{ item.message }} + {{ item.success ? "成功" : "失败" }} {{ item.message }} @@ -204,12 +216,7 @@ - - 关闭 - + 关闭 @@ -217,21 +224,23 @@ \ No newline at end of file +