Skip to content

Commit e1a270a

Browse files
committed
feat: 支持别名搜索
1 parent a840ac1 commit e1a270a

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

MaiChartManager/Front/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"@fontsource/nerko-one": "^5.1.0",
14+
"@gekichumai/dxdata": "https://gitpkg.now.sh/gekichumai/dxrating/packages/dxdata?2bf234befeca795cf5f78e59d42d911e5c4edf08",
1415
"@iconify/json": "^2.2.308",
1516
"@microsoft/fetch-event-source": "^2.0.1",
1617
"@modyfi/vite-plugin-yaml": "^1.1.0",

MaiChartManager/Front/pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MaiChartManager/Front/src/components/MusicList/BatchActionButton/MusicSelector.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { GenreOption } from "@/components/GenreInput";
77
import { LEVEL_COLOR, LEVELS } from "@/consts";
88
import _ from "lodash";
99
import { watchDebounced } from "@vueuse/core";
10+
import { dxdata } from '@gekichumai/dxdata';
1011

1112
export default defineComponent({
1213
props: {
@@ -22,7 +23,8 @@ export default defineComponent({
2223
filter: (value, row) => {
2324
if (!value) return true;
2425
value = value.toString().toLowerCase();
25-
return row.name!.toLowerCase().includes(value) || row.artist!.toLowerCase().includes(value) || row.charts!.some(chart => chart.designer?.toLowerCase().includes(value));
26+
return row.name!.toLowerCase().includes(value) || row.artist!.toLowerCase().includes(value) || row.charts!.some(chart => chart.designer?.toLowerCase().includes(value)) ||
27+
dxdata.songs.find(it => it.title.toLowerCase() === row.name?.toLowerCase())?.searchAcronyms?.some(acronym => acronym.toLowerCase().includes(value)) || false;
2628
}
2729
} satisfies DataTableBaseColumn<MusicXmlWithABJacket>)
2830
const columns = computed(() => [
@@ -111,7 +113,7 @@ export default defineComponent({
111113
() => {
112114
nameColumn.filterOptionValue = filter.value
113115
},
114-
{ debounce: 200 },
116+
{ debounce: 500 },
115117
)
116118

117119
const selectedMusicIds = computed<string[]>({
@@ -128,7 +130,7 @@ export default defineComponent({
128130
{/* emit('update:selectedMusicIds', musicListAll.value.filter(it => !props.selectedMusicIds!.includes(it)));*/}
129131
{/* }}>反选</NButton>*/}
130132
{/*</NFlex>*/}
131-
<NInput placeholder="搜索" v-model:value={filter.value}/>
133+
<NInput placeholder="搜索名称 / 作曲 / 谱师 / 别名" v-model:value={filter.value}/>
132134
<NDataTable
133135
columns={columns.value}
134136
data={musicListAll.value}

0 commit comments

Comments
 (0)