mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
Compare commits
4 Commits
684eb9f4cb
...
574a177f8e
| Author | SHA1 | Date | |
|---|---|---|---|
| 574a177f8e | |||
| 25597149fc | |||
| 21e9e0fa27 | |||
| 03c9bfe761 |
@@ -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);
|
||||
|
||||
@@ -645,7 +645,9 @@ onMounted(() => {
|
||||
<NDivider style="margin: 15px 0 15px 0" />
|
||||
</div>
|
||||
</Transition>
|
||||
<template v-if="isSelf">
|
||||
<NButton
|
||||
|
||||
:disabled="selectedColumn.length <= 1 && isSelf"
|
||||
type="info"
|
||||
size="small"
|
||||
@@ -654,6 +656,7 @@ onMounted(() => {
|
||||
批量编辑
|
||||
</NButton>
|
||||
<NDivider style="margin: 5px 0 5px 0" />
|
||||
</template>
|
||||
<NDataTable
|
||||
v-model:checked-row-keys="selectedColumn"
|
||||
size="small"
|
||||
|
||||
@@ -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 {
|
||||
// 如果需要,可以在此处添加基本的运行时验证。
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user