Skip to content

Commit 51ec6d2

Browse files
committed
fix: 导入确认框
1 parent 9773064 commit 51ec6d2

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

MaiChartManager/Front/src/views/Charts/ImportCreateChartButton/ImportChartButton/ErrorDisplayIdInput.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { computed, defineComponent, effect, PropType, watch } from "vue";
2-
import { Button, Modal, NumberInput } from "@munet/ui";
2+
import { Button, Modal, NumberInput, Section } from "@munet/ui";
33
import { ImportChartMessage, MessageLevel, ShiftMethod } from "@/client/apiGen";
44
import { ImportChartMessageEx, ImportMeta, SavedOptions, TempOptions } from "./types";
55
import noJacket from '@/assets/noJacket.webp';
@@ -62,12 +62,9 @@ export default defineComponent({
6262
<div class="ml-1 text-sm">{t('music.edit.version')}</div>
6363
<VersionInput v-model:value={props.savedOptions.version}/>
6464
</div>
65-
<details>
66-
<summary class="cursor-pointer">{t('chart.import.option.advancedOptions')}</summary>
67-
<div class="flex flex-col gap-2 mt-2">
68-
<ShiftModeSelector tempOptions={props.tempOptions}></ShiftModeSelector>
69-
</div>
70-
</details>
65+
<Section title={t('chart.import.option.advancedOptions')}>
66+
<ShiftModeSelector tempOptions={props.tempOptions}></ShiftModeSelector>
67+
</Section>
7168
</>}
7269
</div>,
7370
actions: () => <>
@@ -91,7 +88,7 @@ const MusicIdInput = defineComponent({
9188
});
9289
const img = computed(() => props.meta.bg ? URL.createObjectURL(props.meta.bg) : noJacket);
9390

94-
return () => <div class="flex gap-3 items-center">
91+
return () => <div class="flex gap-3 items-center px of-hidden">
9592
<img src={img.value} class="h-16 w-16 object-fill shrink-0"/>
9693
<div class="w-0 grow">{props.meta.name}</div>
9794
<MusicIdConflictNotifier id={props.meta.id}/>

MaiChartManager/Front/src/views/Charts/ImportCreateChartButton/ImportChartButton/ShiftModeSelector.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, PropType } from "vue";
1+
import { computed, defineComponent, PropType } from "vue";
22
import { Popover, Radio } from "@munet/ui";
33
import { ShiftMethod } from "@/client/apiGen";
44
import { TempOptions } from "./types";
@@ -11,29 +11,34 @@ export default defineComponent({
1111
setup(props) {
1212
const {t} = useI18n();
1313

14+
const value = computed({
15+
get: () => props.tempOptions.shift,
16+
set: (v: ShiftMethod) => { if (!props.tempOptions.shiftLocked) props.tempOptions.shift = v }
17+
})
18+
1419
return () => <div>
1520
<div class="ml-1 text-sm">{t('chart.import.option.shiftMode')}</div>
1621
<div class="flex flex-col gap-2 w-full">
1722
<div class="flex gap-2 h-34px items-center">
1823
<Popover trigger="hover">
1924
{{
20-
trigger: () => <Radio value={ShiftMethod.Bar} checked={props.tempOptions.shift === ShiftMethod.Bar} onUpdate:checked={() => { if (!props.tempOptions.shiftLocked) props.tempOptions.shift = ShiftMethod.Bar }}>{t('chart.import.option.shiftByBar')}</Radio>,
25+
trigger: () => <Radio k={ShiftMethod.Bar} v-model:value={value.value}>{t('chart.import.option.shiftByBar')}</Radio>,
2126
default: () => <div>
2227
{props.tempOptions.shiftLocked ? t('chart.import.option.shiftModeLocked') : t('chart.import.option.shiftByBarDesc')}
2328
</div>
2429
}}
2530
</Popover>
2631
<Popover trigger="hover">
2732
{{
28-
trigger: () => <Radio value={ShiftMethod.Legacy} checked={props.tempOptions.shift === ShiftMethod.Legacy} onUpdate:checked={() => { if (!props.tempOptions.shiftLocked) props.tempOptions.shift = ShiftMethod.Legacy }}>{t('chart.import.option.shiftLegacy')}</Radio>,
33+
trigger: () => <Radio k={ShiftMethod.Legacy} v-model:value={value.value}>{t('chart.import.option.shiftLegacy')}</Radio>,
2934
default: () => <div>
3035
{props.tempOptions.shiftLocked ? t('chart.import.option.shiftModeLocked') : t('chart.import.option.shiftLegacyDesc')}
3136
</div>
3237
}}
3338
</Popover>
3439
<Popover trigger="hover">
3540
{{
36-
trigger: () => <Radio value={ShiftMethod.NoShift} checked={props.tempOptions.shift === ShiftMethod.NoShift} onUpdate:checked={() => { if (!props.tempOptions.shiftLocked) props.tempOptions.shift = ShiftMethod.NoShift }}>{t('chart.import.option.shiftNoMove')}</Radio>,
41+
trigger: () => <Radio k={ShiftMethod.NoShift} v-model:value={value.value}>{t('chart.import.option.shiftNoMove')}</Radio>,
3742
default: () => <div>
3843
{props.tempOptions.shiftLocked ? t('chart.import.option.shiftModeLocked') : t('chart.import.option.shiftNoMoveDesc')}
3944
</div>

0 commit comments

Comments
 (0)