|
1 | | -import { computed, defineComponent, PropType } from "vue"; |
| 1 | +import { computed, defineComponent, effect, PropType, watch } from "vue"; |
2 | 2 | import { NAlert, NButton, NCheckbox, NCollapse, NCollapseItem, NFlex, NForm, NFormItem, NInputNumber, NModal, NScrollbar, NSelect, SelectOption } from "naive-ui"; |
3 | 3 | import { ImportChartMessage, MessageLevel } from "@/client/apiGen"; |
4 | 4 | import { ImportChartMessageEx, ImportMeta } from "@/components/ImportChartButton/index"; |
5 | 5 | import noJacket from '@/assets/noJacket.webp'; |
6 | 6 | import { addVersionList, genreList } from "@/store/refs"; |
7 | 7 | import GenreInput from "@/components/GenreInput"; |
8 | 8 | import VersionInput from "@/components/VersionInput"; |
| 9 | +import { UTAGE_GENRE } from "@/consts"; |
9 | 10 |
|
10 | 11 | export default defineComponent({ |
11 | 12 | props: { |
@@ -46,14 +47,20 @@ export default defineComponent({ |
46 | 47 | set: (val) => emit('update:noShiftChart', val) |
47 | 48 | }) |
48 | 49 |
|
| 50 | + watch([() => genreId.value, () => show.value], ([val]) => { |
| 51 | + for (const meta of props.meta) { |
| 52 | + meta.id = meta.id % 1e5 + (val === UTAGE_GENRE ? 1e5 : 0); |
| 53 | + } |
| 54 | + }) |
| 55 | + |
49 | 56 | return () => <NModal |
50 | 57 | preset="card" |
51 | 58 | class="w-[min(50vw,50em)]" |
52 | 59 | title="导入提示" |
53 | 60 | v-model:show={show.value} |
54 | 61 | >{{ |
55 | 62 | default: () => <NFlex vertical size="large"> |
56 | | - <NScrollbar class="max-h-35vh"> |
| 63 | + <NScrollbar class="max-h-30vh"> |
57 | 64 | <NFlex vertical> |
58 | 65 | { |
59 | 66 | props.errors.map((error, i) => { |
@@ -91,7 +98,7 @@ export default defineComponent({ |
91 | 98 | </NScrollbar> |
92 | 99 | {!!props.meta.length && <> |
93 | 100 | 为新导入的歌曲指定 ID |
94 | | - <NScrollbar class="max-h-30vh"> |
| 101 | + <NScrollbar class="max-h-25vh"> |
95 | 102 | <NFlex vertical size="large"> |
96 | 103 | {props.meta.map((meta, i) => <MusicIdInput key={i} meta={meta}/>)} |
97 | 104 | </NFlex> |
@@ -130,7 +137,11 @@ const MusicIdInput = defineComponent({ |
130 | 137 | meta: {type: Object as PropType<ImportMeta>, required: true}, |
131 | 138 | }, |
132 | 139 | setup(props) { |
133 | | - const dxBase = computed(() => props.meta.id >= 1e4 ? 1e4 : 0); |
| 140 | + const dxBase = computed(() => { |
| 141 | + const dx = props.meta.id % 1e5 >= 1e4 ? 1e4 : 0 |
| 142 | + const utage = props.meta.id >= 1e5 ? 1e5 : 0 |
| 143 | + return dx + utage; |
| 144 | + }); |
134 | 145 | const img = computed(() => props.meta.bg ? URL.createObjectURL(props.meta.bg) : noJacket); |
135 | 146 |
|
136 | 147 | return () => <NFlex align="center" size="large"> |
|
0 commit comments