From 0970806dca34af69bbf662d2ff02a2f9f8d5b9ce Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 20 Jun 2026 09:56:29 -0700 Subject: [PATCH] =?UTF-8?q?fix(ts):=20=E8=A1=A5=E5=85=A8=E9=9F=B3=E4=B9=90?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=99=A8=E8=BF=9B=E5=BA=A6=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E5=A4=8D=E4=BD=8E=E9=A3=8E=E9=99=A9=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 音乐列表改用 typed provide/inject + MusicSong,audioBar 接真实 audio 状态(进度/时长/seek/换源重载) - 修复 SocialLogin 验证码因布尔误判而从不显示 - getBoolDictOptions 返回类型收窄为 boolean,:key 统一 String() - CRM/售后 tab.paneName 判空 + String() 后写入查询参数 - demo03 子表入参字段名对齐接口(demo03courses/demo03grade)等单点修复 ts:check 829 → 795,无新增类型错误 --- src/utils/dict.ts | 8 ++- src/views/Login/SocialLogin.vue | 2 +- src/views/ai/image/manager/index.vue | 4 +- src/views/ai/model/chatRole/ChatRoleForm.vue | 4 +- src/views/ai/model/chatRole/index.vue | 2 +- .../ai/music/index/list/audioBar/index.vue | 71 ++++++++++++++++--- src/views/ai/music/index/list/index.vue | 11 +-- .../ai/music/index/list/songCard/index.vue | 11 ++- .../ai/music/index/list/songInfo/index.vue | 4 +- src/views/ai/music/index/list/types.ts | 14 ++++ src/views/ai/music/manager/index.vue | 4 +- src/views/bpm/model/form/BasicInfo.vue | 2 +- src/views/crm/business/index.vue | 5 +- src/views/crm/clue/index.vue | 5 +- src/views/crm/contact/ContactForm.vue | 2 +- src/views/crm/contact/index.vue | 5 +- src/views/crm/contract/index.vue | 5 +- src/views/crm/receivable/index.vue | 5 +- src/views/crm/receivable/plan/index.vue | 5 +- .../erp/product/unit/ProductUnitForm.vue | 4 +- src/views/infra/config/ConfigForm.vue | 2 +- .../demo/demo03/inner/Demo03StudentForm.vue | 4 +- .../demo/demo03/normal/Demo03StudentForm.vue | 4 +- .../mall/promotion/article/ArticleForm.vue | 6 +- .../point/components/PointTableSelect.vue | 2 +- src/views/mall/trade/afterSale/index.vue | 5 +- .../mes/md/unitmeasure/UnitMeasureForm.vue | 2 +- src/views/mp/draft/index.vue | 2 +- .../system/mail/account/MailAccountForm.vue | 4 +- src/views/system/notify/my/index.vue | 2 +- 30 files changed, 148 insertions(+), 58 deletions(-) create mode 100644 src/views/ai/music/index/list/types.ts diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 6ed10e4bb..8294bcd93 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -28,6 +28,10 @@ export interface StringDictDataType extends DictDataType { value: string } +export interface BooleanDictDataType extends DictDataType { + value: boolean +} + export const getDictOptions = (dictType: string) => { return dictStore.getDictByType(dictType) || [] } @@ -62,8 +66,8 @@ export const getStrDictOptions = (dictType: string) => { return dictOption } -export const getBoolDictOptions = (dictType: string) => { - const dictOption: DictDataType[] = [] +export const getBoolDictOptions = (dictType: string): BooleanDictDataType[] => { + const dictOption: BooleanDictDataType[] = [] const dictOptions: DictDataType[] = getDictOptions(dictType) dictOptions.forEach((dict: DictDataType) => { dictOption.push({ diff --git a/src/views/Login/SocialLogin.vue b/src/views/Login/SocialLogin.vue index 3d96c2467..87e4d3aad 100644 --- a/src/views/Login/SocialLogin.vue +++ b/src/views/Login/SocialLogin.vue @@ -133,7 +133,7 @@ @@ -59,7 +59,7 @@ > diff --git a/src/views/ai/model/chatRole/ChatRoleForm.vue b/src/views/ai/model/chatRole/ChatRoleForm.vue index 8f5c0ef52..92db6bc67 100644 --- a/src/views/ai/model/chatRole/ChatRoleForm.vue +++ b/src/views/ai/model/chatRole/ChatRoleForm.vue @@ -51,7 +51,7 @@ @@ -61,7 +61,7 @@ {{ dict.label }} diff --git a/src/views/ai/model/chatRole/index.vue b/src/views/ai/model/chatRole/index.vue index 0ba0d79df..257ed3300 100644 --- a/src/views/ai/model/chatRole/index.vue +++ b/src/views/ai/model/chatRole/index.vue @@ -37,7 +37,7 @@ > diff --git a/src/views/ai/music/index/list/audioBar/index.vue b/src/views/ai/music/index/list/audioBar/index.vue index fe573f451..9c579e055 100644 --- a/src/views/ai/music/index/list/audioBar/index.vue +++ b/src/views/ai/music/index/list/audioBar/index.vue @@ -9,8 +9,8 @@ class="w-[45px]" />
-
{{ currentSong.name }}
-
{{ currentSong.singer }}
+
{{ currentSong.title || '暂无音乐' }}
+
{{ currentSong.singer || currentSong.desc }}
@@ -26,19 +26,26 @@
{{ audioProps.currentTime }} - + {{ audioProps.duration }}
+ @loadedmetadata="audioLoadedMetadata" + > @@ -55,15 +62,17 @@ diff --git a/src/views/ai/music/index/list/index.vue b/src/views/ai/music/index/list/index.vue index d21834b58..57f72f822 100644 --- a/src/views/ai/music/index/list/index.vue +++ b/src/views/ai/music/index/list/index.vue @@ -33,6 +33,7 @@ import songCard from './songCard/index.vue' import songInfo from './songInfo/index.vue' import audioBar from './audioBar/index.vue' +import { currentSongKey, type MusicSong } from './types' defineOptions({ name: 'Index' }) @@ -40,12 +41,12 @@ const currentType = ref('mine') // loading 状态 const loading = ref(false) // 当前音乐 -const currentSong = ref({}) +const currentSong = ref({}) -const mySongList = ref([]) -const squareSongList = ref([]) +const mySongList = ref([]) +const squareSongList = ref([]) -provide('currentSong', currentSong) +provide(currentSongKey, currentSong) /* *@Description: 调接口生成音乐列表 @@ -86,7 +87,7 @@ function generateMusic(formData: Recordable) { *@MethodAuthor: xiaohong *@Date: 2024-07-19 11:22:33 */ -function setCurrentSong(music: Recordable) { +function setCurrentSong(music: MusicSong) { currentSong.value = music } diff --git a/src/views/ai/music/index/list/songCard/index.vue b/src/views/ai/music/index/list/songCard/index.vue index 548fa2f67..f11ad4fb9 100644 --- a/src/views/ai/music/index/list/songCard/index.vue +++ b/src/views/ai/music/index/list/songCard/index.vue @@ -25,18 +25,17 @@ diff --git a/src/views/ai/music/index/list/types.ts b/src/views/ai/music/index/list/types.ts new file mode 100644 index 000000000..969183372 --- /dev/null +++ b/src/views/ai/music/index/list/types.ts @@ -0,0 +1,14 @@ +import type { InjectionKey, Ref } from 'vue' + +export interface MusicSong { + id?: number + title?: string + singer?: string + imageUrl?: string + audioUrl?: string + desc?: string + date?: string + lyric?: string +} + +export const currentSongKey: InjectionKey> = Symbol('currentSong') diff --git a/src/views/ai/music/manager/index.vue b/src/views/ai/music/manager/index.vue index 27daf1353..4ea694507 100644 --- a/src/views/ai/music/manager/index.vue +++ b/src/views/ai/music/manager/index.vue @@ -43,7 +43,7 @@ > @@ -84,7 +84,7 @@ > diff --git a/src/views/bpm/model/form/BasicInfo.vue b/src/views/bpm/model/form/BasicInfo.vue index b937b61a1..c450cfc10 100644 --- a/src/views/bpm/model/form/BasicInfo.vue +++ b/src/views/bpm/model/form/BasicInfo.vue @@ -62,7 +62,7 @@ {{ dict.label }} diff --git a/src/views/crm/business/index.vue b/src/views/crm/business/index.vue index 84e447c00..bc7a8f15c 100644 --- a/src/views/crm/business/index.vue +++ b/src/views/crm/business/index.vue @@ -219,7 +219,10 @@ const resetQuery = () => { /** tab 切换 */ const handleTabClick = (tab: TabsPaneContext) => { - queryParams.sceneType = tab.paneName + if (tab.paneName === undefined) { + return + } + queryParams.sceneType = String(tab.paneName) handleQuery() } diff --git a/src/views/crm/clue/index.vue b/src/views/crm/clue/index.vue index f90d497b0..9bd219f10 100644 --- a/src/views/crm/clue/index.vue +++ b/src/views/crm/clue/index.vue @@ -219,7 +219,10 @@ const resetQuery = () => { /** tab 切换 */ const handleTabClick = (tab: TabsPaneContext) => { - queryParams.sceneType = tab.paneName + if (tab.paneName === undefined) { + return + } + queryParams.sceneType = String(tab.paneName) handleQuery() } diff --git a/src/views/crm/contact/ContactForm.vue b/src/views/crm/contact/ContactForm.vue index 0c90b06c3..df10b2b13 100644 --- a/src/views/crm/contact/ContactForm.vue +++ b/src/views/crm/contact/ContactForm.vue @@ -89,7 +89,7 @@ {{ dict.label }} diff --git a/src/views/crm/contact/index.vue b/src/views/crm/contact/index.vue index ec26f1e9d..63c3ccfaa 100644 --- a/src/views/crm/contact/index.vue +++ b/src/views/crm/contact/index.vue @@ -275,7 +275,10 @@ const resetQuery = () => { /** tab 切换 */ const handleTabClick = (tab: TabsPaneContext) => { - queryParams.sceneType = tab.paneName + if (tab.paneName === undefined) { + return + } + queryParams.sceneType = String(tab.paneName) handleQuery() } diff --git a/src/views/crm/contract/index.vue b/src/views/crm/contract/index.vue index 0c9d7286e..dbda419f9 100644 --- a/src/views/crm/contract/index.vue +++ b/src/views/crm/contract/index.vue @@ -294,7 +294,10 @@ const customerList = ref([]) // 客户列表 /** tab 切换 */ const handleTabClick = (tab: TabsPaneContext) => { - queryParams.sceneType = tab.paneName + if (tab.paneName === undefined) { + return + } + queryParams.sceneType = String(tab.paneName) handleQuery() } diff --git a/src/views/crm/receivable/index.vue b/src/views/crm/receivable/index.vue index 6928942f1..d93f9a43e 100644 --- a/src/views/crm/receivable/index.vue +++ b/src/views/crm/receivable/index.vue @@ -235,7 +235,10 @@ const customerList = ref([]) // 客户列表 /** tab 切换 */ const handleTabClick = (tab: TabsPaneContext) => { - queryParams.sceneType = tab.paneName + if (tab.paneName === undefined) { + return + } + queryParams.sceneType = String(tab.paneName) handleQuery() } diff --git a/src/views/crm/receivable/plan/index.vue b/src/views/crm/receivable/plan/index.vue index 43abe154d..b7bff39a1 100644 --- a/src/views/crm/receivable/plan/index.vue +++ b/src/views/crm/receivable/plan/index.vue @@ -247,7 +247,10 @@ const customerList = ref([]) // 客户列表 /** tab 切换 */ const handleTabClick = (tab: TabsPaneContext) => { - queryParams.sceneType = tab.paneName + if (tab.paneName === undefined) { + return + } + queryParams.sceneType = String(tab.paneName) handleQuery() } diff --git a/src/views/erp/product/unit/ProductUnitForm.vue b/src/views/erp/product/unit/ProductUnitForm.vue index bced5db83..413a45378 100644 --- a/src/views/erp/product/unit/ProductUnitForm.vue +++ b/src/views/erp/product/unit/ProductUnitForm.vue @@ -29,7 +29,7 @@