refactor!: 升级 @nuxt/ui@3,重构所有页面和组件,调整配置,移除不在需求中的页面
This commit is contained in:
@@ -110,14 +110,14 @@ const onSystemTitlesDelete = (titles: TitlesTemplate) => {
|
||||
toast.add({
|
||||
title: '删除成功',
|
||||
description: '已删除系统片头模板',
|
||||
color: 'green',
|
||||
color: 'success',
|
||||
icon: 'i-tabler-check',
|
||||
})
|
||||
} else {
|
||||
toast.add({
|
||||
title: '删除失败',
|
||||
description: res.msg || '未知错误',
|
||||
color: 'red',
|
||||
color: 'error',
|
||||
icon: 'i-tabler-alert-triangle',
|
||||
})
|
||||
}
|
||||
@@ -126,7 +126,7 @@ const onSystemTitlesDelete = (titles: TitlesTemplate) => {
|
||||
toast.add({
|
||||
title: '删除失败',
|
||||
description: error instanceof Error ? error.message : '未知错误',
|
||||
color: 'red',
|
||||
color: 'error',
|
||||
icon: 'i-tabler-alert-triangle',
|
||||
})
|
||||
})
|
||||
@@ -153,14 +153,14 @@ const onUserTitlesDelete = (titles: TitlesTemplate) => {
|
||||
toast.add({
|
||||
title: '删除成功',
|
||||
description: '已删除片头素材',
|
||||
color: 'green',
|
||||
color: 'success',
|
||||
icon: 'i-tabler-check',
|
||||
})
|
||||
} else {
|
||||
toast.add({
|
||||
title: '删除失败',
|
||||
description: res.msg || '未知错误',
|
||||
color: 'red',
|
||||
color: 'error',
|
||||
icon: 'i-tabler-alert-triangle',
|
||||
})
|
||||
}
|
||||
@@ -188,14 +188,14 @@ const onUserTitlesSubmit = (event: FormSubmitEvent<UserTitlesSchema>) => {
|
||||
toast.add({
|
||||
title: '提交成功',
|
||||
description: '已提交片头制作请求',
|
||||
color: 'green',
|
||||
color: 'success',
|
||||
icon: 'i-tabler-check',
|
||||
})
|
||||
} else {
|
||||
toast.add({
|
||||
title: '提交失败',
|
||||
description: res.msg || '未知错误',
|
||||
color: 'red',
|
||||
color: 'error',
|
||||
icon: 'i-tabler-alert-triangle',
|
||||
})
|
||||
}
|
||||
@@ -217,7 +217,7 @@ const onUserTitlesSubmit = (event: FormSubmitEvent<UserTitlesSchema>) => {
|
||||
>
|
||||
<template #action>
|
||||
<UButton
|
||||
color="amber"
|
||||
color="warning"
|
||||
icon="tabler:plus"
|
||||
variant="soft"
|
||||
v-if="loginState.user.auth_code === 2"
|
||||
@@ -231,18 +231,18 @@ const onUserTitlesSubmit = (event: FormSubmitEvent<UserTitlesSchema>) => {
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<div
|
||||
class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5 gap-4"
|
||||
class="grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5"
|
||||
v-if="systemTitlesTemplateStatus === 'pending'"
|
||||
>
|
||||
<USkeleton
|
||||
class="w-full aspect-video"
|
||||
class="aspect-video w-full"
|
||||
v-for="i in systemPagination.pageSize"
|
||||
:key="i"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="systemTitlesTemplate?.data.items.length === 0"
|
||||
class="w-full py-20 flex flex-col justify-center items-center gap-2"
|
||||
class="flex w-full flex-col items-center justify-center gap-2 py-20"
|
||||
>
|
||||
<Icon
|
||||
class="text-7xl text-neutral-300 dark:text-neutral-700"
|
||||
@@ -253,7 +253,7 @@ const onUserTitlesSubmit = (event: FormSubmitEvent<UserTitlesSchema>) => {
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5 gap-4"
|
||||
class="grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5"
|
||||
v-else
|
||||
>
|
||||
<AigcGenerationTitlesTemplate
|
||||
@@ -298,18 +298,18 @@ const onUserTitlesSubmit = (event: FormSubmitEvent<UserTitlesSchema>) => {
|
||||
</template>
|
||||
</UAlert>
|
||||
<div
|
||||
class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5 gap-4"
|
||||
class="grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5"
|
||||
v-if="userTitlesTemplateStatus === 'pending'"
|
||||
>
|
||||
<USkeleton
|
||||
class="w-full aspect-video"
|
||||
class="aspect-video w-full"
|
||||
v-for="i in userPagination.pageSize"
|
||||
:key="i"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="userTitlesTemplate?.data.items.length === 0"
|
||||
class="w-full py-20 flex flex-col justify-center items-center gap-2"
|
||||
class="flex w-full flex-col items-center justify-center gap-2 py-20"
|
||||
>
|
||||
<Icon
|
||||
class="text-7xl text-neutral-300 dark:text-neutral-700"
|
||||
@@ -320,7 +320,7 @@ const onUserTitlesSubmit = (event: FormSubmitEvent<UserTitlesSchema>) => {
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5 gap-4"
|
||||
class="grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5"
|
||||
v-else
|
||||
>
|
||||
<AigcGenerationTitlesTemplate
|
||||
@@ -333,90 +333,87 @@ const onUserTitlesSubmit = (event: FormSubmitEvent<UserTitlesSchema>) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<UModal v-model="isUserTitlesRequestModalActive">
|
||||
<UCard
|
||||
:ui="{
|
||||
ring: '',
|
||||
divide: 'divide-y divide-gray-100 dark:divide-gray-800',
|
||||
}"
|
||||
>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<div
|
||||
class="text-base font-semibold leading-6 text-gray-900 dark:text-white overflow-hidden"
|
||||
>
|
||||
<p>使用模板</p>
|
||||
</div>
|
||||
<UButton
|
||||
class="-my-1"
|
||||
color="gray"
|
||||
icon="i-tabler-x"
|
||||
variant="ghost"
|
||||
@click="isUserTitlesRequestModalActive = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div>
|
||||
<UForm
|
||||
class="space-y-4"
|
||||
:schema="userTitlesSchema"
|
||||
:state="userTitlesState"
|
||||
@submit="onUserTitlesSubmit"
|
||||
>
|
||||
<UFormGroup
|
||||
label="课程名称"
|
||||
name="title"
|
||||
required
|
||||
>
|
||||
<UInput v-model="userTitlesState.title" />
|
||||
</UFormGroup>
|
||||
<UFormGroup
|
||||
label="主讲人"
|
||||
name="description"
|
||||
required
|
||||
>
|
||||
<UInput v-model="userTitlesState.description" />
|
||||
</UFormGroup>
|
||||
<UFormGroup
|
||||
label="备注"
|
||||
name="remark"
|
||||
help="可选,可以在此处填写学校、单位等额外信息"
|
||||
>
|
||||
<UTextarea v-model="userTitlesState.remark" />
|
||||
</UFormGroup>
|
||||
<UFormGroup name="title_id">
|
||||
<UInput
|
||||
type="hidden"
|
||||
v-model="userTitlesState.title_id"
|
||||
/>
|
||||
</UFormGroup>
|
||||
|
||||
<UAlert
|
||||
icon="tabler:info-circle"
|
||||
color="primary"
|
||||
variant="subtle"
|
||||
title="片头片尾模板"
|
||||
description="提交模板相应字段后,待工作人员制作好后即可使用"
|
||||
/>
|
||||
|
||||
<div class="flex justify-end gap-2">
|
||||
<UModal v-model:open="isUserTitlesRequestModalActive">
|
||||
<template #content>
|
||||
<UCard>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<div
|
||||
class="overflow-hidden text-base font-semibold leading-6 text-gray-900 dark:text-white"
|
||||
>
|
||||
<p>使用模板</p>
|
||||
</div>
|
||||
<UButton
|
||||
color="primary"
|
||||
variant="soft"
|
||||
label="取消"
|
||||
class="-my-1"
|
||||
color="neutral"
|
||||
icon="i-tabler-x"
|
||||
variant="ghost"
|
||||
@click="isUserTitlesRequestModalActive = false"
|
||||
/>
|
||||
<UButton
|
||||
color="primary"
|
||||
type="submit"
|
||||
>
|
||||
提交
|
||||
</UButton>
|
||||
</div>
|
||||
</UForm>
|
||||
</div>
|
||||
</UCard>
|
||||
</template>
|
||||
|
||||
<div>
|
||||
<UForm
|
||||
class="space-y-4"
|
||||
:schema="userTitlesSchema"
|
||||
:state="userTitlesState"
|
||||
@submit="onUserTitlesSubmit"
|
||||
>
|
||||
<UFormField
|
||||
label="课程名称"
|
||||
name="title"
|
||||
required
|
||||
>
|
||||
<UInput v-model="userTitlesState.title" />
|
||||
</UFormField>
|
||||
<UFormField
|
||||
label="主讲人"
|
||||
name="description"
|
||||
required
|
||||
>
|
||||
<UInput v-model="userTitlesState.description" />
|
||||
</UFormField>
|
||||
<UFormField
|
||||
label="备注"
|
||||
name="remark"
|
||||
help="可选,可以在此处填写学校、单位等额外信息"
|
||||
>
|
||||
<UTextarea v-model="userTitlesState.remark" />
|
||||
</UFormField>
|
||||
<UFormField name="title_id">
|
||||
<UInput
|
||||
type="hidden"
|
||||
v-model="userTitlesState.title_id"
|
||||
/>
|
||||
</UFormField>
|
||||
|
||||
<UAlert
|
||||
icon="tabler:info-circle"
|
||||
color="primary"
|
||||
variant="subtle"
|
||||
title="片头片尾模板"
|
||||
description="提交模板相应字段后,待工作人员制作好后即可使用"
|
||||
/>
|
||||
|
||||
<div class="flex justify-end gap-2">
|
||||
<UButton
|
||||
color="primary"
|
||||
variant="soft"
|
||||
label="取消"
|
||||
@click="isUserTitlesRequestModalActive = false"
|
||||
/>
|
||||
<UButton
|
||||
color="primary"
|
||||
type="submit"
|
||||
>
|
||||
提交
|
||||
</UButton>
|
||||
</div>
|
||||
</UForm>
|
||||
</div>
|
||||
</UCard>
|
||||
</template>
|
||||
</UModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user