From d24442380048d82474f40cf6f5a423e11c9d438d Mon Sep 17 00:00:00 2001 From: BTMuli Date: Tue, 18 Nov 2025 22:02:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20=E8=B0=83=E6=95=B4=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=B5=AE=E7=AA=97ui=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=BF=9B=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/userGacha/ugo-uid.vue | 2 ++ src/plugins/Sqlite/modules/userGacha.ts | 34 ++++++++++++++++++++----- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/components/userGacha/ugo-uid.vue b/src/components/userGacha/ugo-uid.vue index 3cca6866..6ecbf3cc 100644 --- a/src/components/userGacha/ugo-uid.vue +++ b/src/components/userGacha/ugo-uid.vue @@ -234,6 +234,7 @@ async function handleExport(): Promise { position: relative; display: flex; width: 100%; + flex-wrap: wrap; align-items: flex-end; justify-content: space-between; column-gap: 10px; @@ -249,6 +250,7 @@ async function handleExport(): Promise { color: var(--tgc-od-white); cursor: pointer; font-size: 12px; + word-break: break-all; } .ugo-header { diff --git a/src/plugins/Sqlite/modules/userGacha.ts b/src/plugins/Sqlite/modules/userGacha.ts index 2bb3dbd4..57addbe2 100644 --- a/src/plugins/Sqlite/modules/userGacha.ts +++ b/src/plugins/Sqlite/modules/userGacha.ts @@ -1,9 +1,9 @@ /** - * @file plugins/Sqlite/modules/userGacha.ts - * @description 用户祈愿模块 - * @since Beta v0.7.5 + * 用户祈愿模块 + * @since Beta v0.8.6 */ +import showLoading from "@comp/func/loading.js"; import showSnackbar from "@comp/func/snackbar.js"; import { path } from "@tauri-apps/api"; import { exists, mkdir, readDir } from "@tauri-apps/plugin-fs"; @@ -198,33 +198,53 @@ async function cleanGachaRecords( } /** - * @description 合并祈愿数据 - * @since Beta v0.4.7 + * 合并祈愿数据 + * @since Beta v0.8.6 * @param {string} uid - UID * @param {TGApp.Plugins.UIGF.GachaItem[]} data - UIGF数据 * @return {Promise} */ async function mergeUIGF(uid: string, data: TGApp.Plugins.UIGF.GachaItem[]): Promise { const db = await TGSqlite.getDB(); + let cnt = 0; + const len = data.length; + let progress = 0; for (const gacha of data) { const trans = transGacha(gacha); + if (cnt % 20 === 0) { + progress = Math.round((cnt / len) * 100 * 100) / 100; + await showLoading.update( + `[${progress}%][${trans.time}] ${"⭐".repeat(Number(trans.rank_type))}-${trans.name}`, + ); + cnt++; + } const sql = getInsertSql(uid, trans); await db.execute(sql); } } /** - * @description 合并祈愿数据(v4.0) - * @since Beta v0.5.0 + * 合并祈愿数据(v4.0) + * @since Beta v0.8.6 * @param {TGApp.Plugins.UIGF.GachaHk4e} data - UIGF数据 * @return {Promise} */ async function mergeUIGF4(data: TGApp.Plugins.UIGF.GachaHk4e): Promise { const db = await TGSqlite.getDB(); + let cnt: number = 0; + const len = data.list.length; + let progress: number = 0; for (const gacha of data.list) { const trans = transGacha(gacha, data.timezone); + if (cnt % 20 === 0) { + progress = Math.round((cnt / len) * 100 * 100) / 100; + await showLoading.update( + `[${progress}%][${trans.time}] ${"⭐".repeat(Number(trans.rank_type))}-${trans.name}`, + ); + } const sql = getInsertSql(data.uid.toString(), trans); await db.execute(sql); + cnt++; } }