Compare commits

..

4 Commits

7 changed files with 1116 additions and 1233 deletions

View File

@@ -49,7 +49,7 @@
public: 'true',
});
if (resp.code == 200) {
message.success('已保存至服务器');
message.success('已保存设置');
props.config?.forEach(item => {
if (item.type === 'render') {
item.onUploaded?.(props.configData[item.key], props.configData);

View File

@@ -645,15 +645,18 @@ onMounted(() => {
<NDivider style="margin: 15px 0 15px 0" />
</div>
</Transition>
<NButton
:disabled="selectedColumn.length <= 1 && isSelf"
type="info"
size="small"
@click="showBatchModal = true"
>
批量编辑
</NButton>
<NDivider style="margin: 5px 0 5px 0" />
<template v-if="isSelf">
<NButton
:disabled="selectedColumn.length <= 1 && isSelf"
type="info"
size="small"
@click="showBatchModal = true"
>
批量编辑
</NButton>
<NDivider style="margin: 5px 0 5px 0" />
</template>
<NDataTable
v-model:checked-row-keys="selectedColumn"
size="small"

View File

@@ -195,7 +195,7 @@ export type ExtractConfigData<
* @param items 一个只读的配置项定义数组。
* @returns 类型被保留的同一个只读数组。
*/
export function defineItems<
export function defineTemplateConfig<
const Items extends readonly ConfigItemDefinition[] // 使用 'const' 泛型进行推断
>(items: Items): Items {
// 如果需要,可以在此处添加基本的运行时验证。

View File

@@ -611,6 +611,13 @@ onMounted(async () => {
>
添加歌曲
</NButton>
<NButton
secondary
type="primary"
@click="$router.push({ name: 'manage-index', query: { tab: 'setting', setting: 'template', template: 'songlist' } })"
>
修改展示模板
</NButton>
<NButton
type="primary"
secondary
@@ -640,11 +647,6 @@ onMounted(async () => {
>
刷新
</NButton>
<NButton
@click="$router.push({ name: 'manage-index', query: { tab: 'setting', setting: 'template', template: 'songlist' } })"
>
修改模板
</NButton>
</NSpace>
<NDivider
style="margin: 16px 0 16px 0"

View File

@@ -78,7 +78,7 @@ import { computed, onMounted, ref, watch } from 'vue';
if (componentType.value) {
return SongListTemplateMap[componentType.value];
}
return undefined;
return SongListTemplateMap[''];
});
const currentConfig = ref();
watch(

View File

@@ -1,13 +1,13 @@
<script lang="ts" setup>
import { isDarkMode } from '@/Utils'
import { useAccount } from '@/api/account'
import { ResponseUserIndexModel, UserInfo } from '@/api/api-models'
import { QueryGetAPI } from '@/api/query'
import SimpleVideoCard from '@/components/SimpleVideoCard.vue'
import { TemplateConfig } from '@/data/VTsuruTypes'
import { USER_INDEX_API_URL } from '@/data/constants'
import { NAlert, NAvatar, NButton, NCard, NDivider, NFlex, NSpace, NText, useMessage } from 'naive-ui'
import { ref } from 'vue'
import { isDarkMode } from '@/Utils';
import { useAccount } from '@/api/account';
import { ResponseUserIndexModel, UserInfo } from '@/api/api-models';
import { QueryGetAPI } from '@/api/query';
import SimpleVideoCard from '@/components/SimpleVideoCard.vue';
import { defineTemplateConfig, ExtractConfigData } from '@/data/VTsuruTypes';
import { USER_INDEX_API_URL } from '@/data/constants';
import { NAvatar, NButton, NCard, NDivider, NFlex, NSpace, NText, useMessage } from 'naive-ui';
import { ref } from 'vue';
defineExpose({ Config, DefaultConfig })
const width = window.innerWidth
@@ -46,13 +46,9 @@ function navigate(url: string) {
</script>
<script lang="ts">
export type ConfigType = {
test: string
}
export type ConfigType = ExtractConfigData<typeof Config>
export const DefaultConfig = {} as ConfigType
export const Config: TemplateConfig<ConfigType> = {
name: 'Template.Index.Simple',
items: [
export const Config = defineTemplateConfig([
{
name: '封面',
type: 'image',
@@ -64,8 +60,7 @@ export const Config: TemplateConfig<ConfigType> = {
type: 'string',
key: 'test',
},
],
}
])
</script>
<template>
@@ -96,8 +91,8 @@ export const Config: TemplateConfig<ConfigType> = {
vertical
>
<NAvatar
v-if="accountInfo.streamerInfo"
:src="accountInfo.streamerInfo.faceUrl"
v-if="userInfo.streamerInfo"
:src="userInfo.streamerInfo.faceUrl"
:size="width > 750 ? 175 : 100"
round
bordered

File diff suppressed because it is too large Load Diff