Skip to content

Commit 8dfa241

Browse files
committed
fix: 批量导出的一些问题
1 parent 69f60c9 commit 8dfa241

6 files changed

Lines changed: 66 additions & 8 deletions

File tree

MaiChartManager/Front/src/global.sass

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ pre
8181
.n-anchor .n-anchor-link
8282
line-height: 1.7 !important
8383

84+
.n-button__border, .n-button__state-border, .n-base-wave
85+
display: none !important
86+
87+
.n-button
88+
color: #303133 !important
89+
8490
.absolute-full
8591
position: absolute
8692
top: 0
@@ -100,4 +106,4 @@ pre
100106
transition: background 0.2s
101107

102108
&:hover
103-
background: #666
109+
background: #666

MaiChartManager/Front/src/locales/en.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ common:
2020
management: Management
2121
dismiss: Dismiss
2222
longMusic: LongMusic
23+
error: Error
2324
assetDir:
2425
title: Opt Management
2526
create: Create Directory
@@ -163,6 +164,9 @@ music:
163164
editFailed: Batch edit failed
164165
currentProgress: Current Progress
165166
currentProcessing: Currently Processing
167+
exportFailed: Failed to export
168+
exportSuccess: Export successful
169+
deleteSuccess: Deleted successfully
166170
delete:
167171
confirm: Confirm
168172
confirmDelete: Confirm Delete
@@ -304,6 +308,13 @@ mod:
304308
loaded: Loaded
305309
killGameProcess: Kill Game Process
306310
needInstallOrUpdate: AquaMai not installed or needs update
311+
ioKeyMap:
312+
disabled: Disabled
313+
select: Select
314+
select1P: 1P Select
315+
select2P: 2P Select
316+
service: Service
317+
test: Test
307318
adxHid:
308319
disabled: Disabled
309320
select1P: 1P Select
@@ -430,11 +441,16 @@ mod:
430441
Button2p: 2P Buttons
431442
Led1p: 1P LEDs
432443
Led2p: 2P LEDs
444+
Touch: Touchscreen
445+
Button: Buttons
446+
Led: LEDs
433447
P1: Enable 1P
434448
P2: Enable 2P
435449
tip: If mixing Maimoller with other protocols, disable this for the non-Maimoller side
436450
on: 'On'
437451
off: 'Off'
452+
enable: Enable
453+
disable: Disable
438454
stableChannel: "Stable Channel"
439455
fastChannel: "Fast Channel"
440456
mumod: "MuMod"

MaiChartManager/Front/src/locales/zh-TW.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ common:
2020
management: 管理
2121
dismiss: 放棄
2222
longMusic: LongMusic
23+
error: 錯誤
2324
assetDir:
2425
title: Opt 管理
2526
create: 建立目錄
@@ -156,6 +157,9 @@ music:
156157
editFailed: 批次修改失敗
157158
currentProgress: 目前進度
158159
currentProcessing: 目前處理
160+
exportFailed: 匯出失敗
161+
exportSuccess: 匯出成功
162+
deleteSuccess: 刪除成功
159163
delete:
160164
confirm: 確認
161165
confirmDelete: 確認刪除
@@ -282,6 +286,13 @@ mod:
282286
loaded: 已載入
283287
killGameProcess: 關閉遊戲處理程序
284288
needInstallOrUpdate: AquaMai 未安裝或需要更新
289+
ioKeyMap:
290+
disabled: 停用
291+
select: 選擇
292+
select1P: 1P 選擇
293+
select2P: 2P 選擇
294+
service: 服務
295+
test: 測試
285296
adxHid:
286297
disabled: 停用
287298
select1P: 1P 選擇
@@ -393,11 +404,16 @@ mod:
393404
Button2p: 2P 按鍵
394405
Led1p: 1P 燈光
395406
Led2p: 2P 燈光
407+
Touch: 觸屏
408+
Button: 按鍵
409+
Led: 燈光
396410
P1: 啟用 1P
397411
P2: 啟用 2P
398412
tip: 如果混用 Maimoller 與其他協議,請對不是 Maimoller 的一侧停用
399413
on:
400414
off:
415+
enable: 啟用
416+
disable: 停用
401417
stableChannel: "穩定通道"
402418
fastChannel: "快速通道"
403419
mumod: "MuMod"
@@ -426,6 +442,9 @@ mod:
426442
refresh: "重新整理設備狀態"
427443
unavailable: "PDX 驅動工具不可用"
428444
selectDevice: "選擇設備"
445+
path1P: "1P 設備路徑"
446+
path2P: "2P 設備路徑"
447+
pathDesc: "USB 連接埠路徑,例如 2.2。請使用設定工具中顯示的路徑。留空則使用第一個偵測到的設備作為 1P"
429448
tools:
430449
title: 工具
431450
audioConvert: 音訊轉換(ACB + AWB)

MaiChartManager/Front/src/locales/zh.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ common:
2020
management: 管理
2121
dismiss: 放弃
2222
longMusic: 长乐曲
23+
error: 错误
2324
assetDir:
2425
title: Opt 管理
2526
create: 创建目录
@@ -156,6 +157,9 @@ music:
156157
editFailed: 批量修改失败
157158
currentProgress: 当前进度
158159
currentProcessing: 当前处理
160+
exportFailed: 导出失败
161+
exportSuccess: 导出成功
162+
deleteSuccess: 删除成功
159163
delete:
160164
confirm: 确认
161165
confirmDelete: 确认删除

MaiChartManager/Front/src/views/BatchAction/ChooseAction.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, PropType, ref } from "vue";
22
import { MusicXmlWithABJacket } from "@/client/apiGen";
3-
import { Button, Radio, Select, Popover } from "@munet/ui";
3+
import { Button, Radio, Select, Popover, addToast } from "@munet/ui";
44
import { STEP } from "@/views/BatchAction/index";
55
import api, { isWebView } from "@/client/api";
66
import { showNeedPurchaseDialog, updateMusicList, version } from "@/store/refs";
@@ -47,19 +47,22 @@ export default defineComponent({
4747
load.value = true;
4848
await api.BatchDeleteMusic(props.selectedMusic!);
4949
await updateMusicList();
50-
props.continue(STEP.None);
50+
addToast({message: t('music.batch.deleteSuccess'), type: 'success'});
51+
props.continue(STEP.Select);
5152
break;
5253
case OPTIONS.CreateNewOpt:
5354
case OPTIONS.CreateNewOptCompatible:
5455
if (isWebView) {
55-
props.continue(STEP.None);
56+
props.continue(STEP.Select);
5657
await api.RequestCopyTo({music: props.selectedMusic, removeEvents: selectedOption.value === OPTIONS.CreateNewOptCompatible, legacyFormat: false});
58+
addToast({message: t('music.batch.exportSuccess'), type: 'success'});
5759
break;
5860
}
5961
case OPTIONS.CreateNewOptMa2_103:
6062
if (isWebView) {
61-
props.continue(STEP.None);
63+
props.continue(STEP.Select);
6264
await api.RequestCopyTo({music: props.selectedMusic, removeEvents: true, legacyFormat: true});
65+
addToast({message: t('music.batch.exportSuccess'), type: 'success'});
6366
break;
6467
}
6568
case OPTIONS.ConvertToMaidata:

MaiChartManager/Front/src/views/BatchAction/remoteExport.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ export default async (
123123
const entries = zipReader.getEntriesGenerator();
124124
for await (const entry of entries) {
125125
try {
126-
if (entry.filename.endsWith("/") || !entry.getData) {
126+
if (entry.filename.endsWith("/")) {
127+
continue;
128+
}
129+
130+
if (!('getData' in entry)) {
127131
continue;
128132
}
129133

@@ -185,8 +189,14 @@ export default async (
185189

186190
try {
187191
await Promise.all(Array.from({ length: workerCount }, () => worker()));
188-
} finally {
192+
addToast({message: t('music.batch.exportSuccess'), type: 'success'});
193+
}
194+
catch (e) {
195+
console.error(e);
196+
addToast({ type: 'error', message: `${t('error.exportFailed')}` });
197+
}
198+
finally {
189199
currentProcessItem.value = "";
190-
setStep(STEP.None);
200+
setStep(STEP.Select);
191201
}
192202
};

0 commit comments

Comments
 (0)