This commit is contained in:
2023-10-27 15:12:24 +08:00
parent 558c9a047e
commit 3f70e399f2
6 changed files with 22 additions and 38 deletions

View File

@@ -227,15 +227,12 @@ onMounted(() => {
</NText>
</NSpace>
</NLayoutSider>
<NScrollbar style="height: calc(100vh - 50px);" >
<NLayout >
<NScrollbar style="height: calc(100vh - 50px)">
<NLayout>
<div style="box-sizing: border-box; padding: 20px; min-width: 300px">
<RouterView v-slot="{ Component }" v-if="accountInfo?.isEmailVerified">
<KeepAlive>
<Suspense>
<component :is="Component" />
<template #fallback> Loading... </template>
</Suspense>
<component :is="Component"/>
</KeepAlive>
</RouterView>
<template v-else>

View File

@@ -199,14 +199,10 @@ onMounted(async () => {
class="viewer-page-content"
:style="`box-shadow:${isDarkMode() ? 'rgb(28 28 28 / 9%) 5px 5px 6px inset, rgba(139, 139, 139, 0.09) -5px -5px 6px inset' : 'inset 5px 5px 6px #8b8b8b17, inset -5px -5px 6px #8b8b8b17;'}`"
>
<RouterView v-if="userInfo" v-slot="{ Component, route }">
<Transition name="fade" mode="out-in">
<RouterView v-if="userInfo" v-slot="{ Component }">
<KeepAlive>
<div :key="route.name">
<component :is="Component" :bili-info="biliUserInfo" :user-info="userInfo" />
</div>
</KeepAlive>
</Transition>
</RouterView>
<template v-else>
<NSpin show />

View File

@@ -5,22 +5,7 @@ import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import ScheduleList from '@/components/ScheduleList.vue'
import { SCHEDULE_API_URL } from '@/data/constants'
import { addWeeks, endOfWeek, endOfYear, format, isBefore, startOfWeek, startOfYear } from 'date-fns'
import {
NAlert,
NBadge,
NButton,
NColorPicker,
NDivider,
NInput,
NInputGroup,
NInputGroupLabel,
NModal,
NSelect,
NSpace,
NSpin,
NTimePicker,
useMessage,
} from 'naive-ui'
import { NAlert, NBadge, NButton, NColorPicker, NDivider, NInput, NInputGroup, NInputGroupLabel, NModal, NSelect, NSpace, NSpin, NTimePicker, useMessage } from 'naive-ui'
import { SelectMixedOption, SelectOption } from 'naive-ui/es/select/src/interface'
import { VNode, computed, h, onMounted, ref } from 'vue'
@@ -242,7 +227,10 @@ onMounted(() => {
</script>
<template>
<NSpace>
<NButton @click="showAddModal = true" type="primary"> 添加周程 </NButton>
<NButton @click="$router.push({ name: 'manage-index', query: { tab: 'template', template: 'schedule' } })"> 修改模板 </NButton>
</NSpace>
<NDivider />
<NModal v-model:show="showAddModal" style="width: 600px; max-width: 90vw" preset="card" title="添加周程">
<NSpace vertical>

View File

@@ -5,6 +5,7 @@ import { Ref, computed, h, onMounted, ref, defineAsyncComponent } from 'vue'
import { FunctionTypes, ScheduleWeekInfo, SongFrom, SongLanguage, SongsInfo } from '@/api/api-models'
import { QueryPostAPI } from '@/api/query'
import { ACCOUNT_API_URL, FETCH_API, IndexTemplateMap, ScheduleTemplateMap, SongListTemplateMap } from '@/data/constants'
import { useRoute } from 'vue-router'
interface TemplateDefineTypes {
TemplateMap: { [name: string]: { name: string; compoent: any } }
@@ -15,6 +16,7 @@ interface TemplateDefineTypes {
const accountInfo = useAccount()
const message = useMessage()
const route = useRoute()
const isSaving = ref(false)
@@ -167,8 +169,8 @@ const templateOptions = [
value: 'schedule',
},
] as SelectOption[]
const selectedOption = ref('index')
const selectedTab = ref('general')
const selectedOption = ref(route.query.template?.toString() ?? '')
const selectedTab = ref(route.query.tab?.toString() ?? 'general')
const selectedTemplateData = computed(() => templates[selectedOption.value])
@@ -259,15 +261,15 @@ function onOpenTemplateSettings() {
const buttonGroup = computed(() => {
return h(NSpace, () => [h(NButton, { type: 'primary', onClick: () => SaveTemplateSetting() }, () => '设为展示模板'), h(NButton, { type: 'info', onClick: onOpenTemplateSettings }, () => '模板设置')])
})
onMounted(() => {
RequestBiliUserData()
onMounted(async () => {
await RequestBiliUserData()
})
</script>
<template>
<NCard v-if="accountInfo" title="设置" :style="`${selectedTab === 'general' ? '' : 'min-height: 800px;'}`">
<NSpin :show="isSaving">
<NTabs>
<NTabs v-model:value="selectedTab">
<NTabPane tab="常规" name="general">
<NDivider style="margin: 0"> 启用功能 </NDivider>
<NCheckboxGroup v-model:value="accountInfo.settings.enableFunctions" @update:value="SaveComboGroupSetting">

View File

@@ -8,7 +8,7 @@ const width = window.innerWidth
const props = defineProps<{
userInfo: UserInfo | undefined
biliInfo: any | undefined
currentData: any
currentData?: any
}>()
function navigate(url: string) {
window.open(url, '_blank')

View File

@@ -88,6 +88,7 @@ onMounted(() => {
.schedule-template.pinky.container {
--pinky-font-color-dark: #dba2a2c9;
--pinky-border-color-dark: #eeb9b9;
margin: 0 auto;
width: 540px;
height: 700px;
border-radius: 20px;