mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
cancel no payment
This commit is contained in:
23
src/data/TemplateTypes.ts
Normal file
23
src/data/TemplateTypes.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
ScheduleWeekInfo,
|
||||
Setting_LiveRequest,
|
||||
SongRequestInfo,
|
||||
SongsInfo,
|
||||
UserInfo
|
||||
} from '@/api/api-models'
|
||||
|
||||
export interface SongListConfigType {
|
||||
userInfo: UserInfo | undefined
|
||||
biliInfo: any | undefined
|
||||
songRequestSettings: Setting_LiveRequest
|
||||
songRequestActive: SongRequestInfo[]
|
||||
data: SongsInfo[] | undefined
|
||||
}
|
||||
export interface SongListConfigTypeWithConfig<T> extends SongListConfigType {
|
||||
config?: T
|
||||
}
|
||||
export interface ScheduleConfigType {
|
||||
userInfo: UserInfo | undefined
|
||||
biliInfo: any | undefined
|
||||
data: ScheduleWeekInfo[] | undefined
|
||||
}
|
||||
@@ -23,10 +23,11 @@ type DataAccessor<T, V> = {
|
||||
}
|
||||
|
||||
// 扩展 CommonProps 以包含额外的共有属性
|
||||
export type TemplateConfigItemWithType<T, V> = CommonProps & { data: DataAccessor<T, V> }
|
||||
export type TemplateConfigItemWithType<T, V> = CommonProps & { data?: DataAccessor<T, V> }
|
||||
|
||||
export type TemplateConfigStringItem<T> = TemplateConfigItemWithType<T, string> & {
|
||||
type: 'string'
|
||||
key: string //将被保存到指定key中
|
||||
}
|
||||
export type TemplateConfigStringArrayItem<T> = TemplateConfigItemWithType<T, string[]> & {
|
||||
type: 'stringArray'
|
||||
@@ -42,8 +43,19 @@ export type TemplateConfigRenderItem<T> = TemplateConfigBase & {
|
||||
type: 'render'
|
||||
render: (arg0: T) => VNode
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @template T - The type of the associated data model.
|
||||
*/
|
||||
export type TemplateConfigImageItem<T> = TemplateConfigBase & {
|
||||
type: 'image'
|
||||
imageLimit: number
|
||||
onUploaded: (arg0: string | string[], arg1: T) => void
|
||||
type: 'image' // Specifies the type of configuration item as 'image'.
|
||||
imageLimit: number // The maximum number of images allowed.
|
||||
key: string //图片将被保存到指定key中, 类型为字符串数组
|
||||
/**
|
||||
* Callback function triggered upon image upload.
|
||||
* @param {string[]} uploadedImages - The uploaded image or array of images.
|
||||
* @param {T} config - The configuration data model.
|
||||
*/
|
||||
onUploaded?: (uploadedImages: string[], config: T) => void
|
||||
}
|
||||
|
||||
@@ -70,6 +70,10 @@ export const SongListTemplateMap = {
|
||||
name: '简单',
|
||||
compoent: defineAsyncComponent(() => import('@/views/view/songListTemplate/SimpleSongListTemplate.vue')),
|
||||
},
|
||||
traditional: {
|
||||
name: '传统',
|
||||
compoent: defineAsyncComponent(() => import('@/views/view/songListTemplate/TraditionalSongListTemplate.vue')),
|
||||
},
|
||||
} as { [key: string]: { name: string; compoent: any } }
|
||||
export const IndexTemplateMap = {
|
||||
'': { name: '默认', compoent: DefaultIndexTemplateVue },
|
||||
|
||||
Reference in New Issue
Block a user