🎨chore: 使用 oxlint, oxfmt&格式化代码

This commit is contained in:
2026-02-08 21:16:25 +08:00
parent 9d35c6a9d8
commit 3a801ba016
78 changed files with 3367 additions and 1468 deletions

View File

@@ -15,25 +15,24 @@ const pageCount = ref(15)
const searchInput = ref('')
const debounceSearch = refDebounced(searchInput, 1000)
watch(debounceSearch, () => page.value = 1)
watch(debounceSearch, () => (page.value = 1))
const {
data: videoList,
refresh: refreshVideoList,
} = useAsyncData(
() => useFetchWrapped<
req.gen.GBVideoList & AuthedRequest,
BaseResponse<PagedData<GBVideoItem>>
>('App.Digital_VideoTask.GetList', {
token: loginState.token!,
user_id: loginState.user.id,
to_user_id: loginState.user.id,
page: page.value,
perpage: pageCount.value,
title: debounceSearch.value,
}), {
const { data: videoList, refresh: refreshVideoList } = useAsyncData(
() =>
useFetchWrapped<
req.gen.GBVideoList & AuthedRequest,
BaseResponse<PagedData<GBVideoItem>>
>('App.Digital_VideoTask.GetList', {
token: loginState.token!,
user_id: loginState.user.id,
to_user_id: loginState.user.id,
page: page.value,
perpage: pageCount.value,
title: debounceSearch.value,
}),
{
watch: [page, pageCount, debounceSearch],
},
}
)
const onCreateCourseGreenClick = () => {
@@ -53,7 +52,7 @@ const onCourseGreenDelete = (task: GBVideoItem) => {
token: loginState.token!,
user_id: loginState.user.id,
task_id: task.task_id,
}).then(res => {
}).then((res) => {
if (res.data.code === 1) {
refreshVideoList()
toast.add({
@@ -74,8 +73,8 @@ const onCourseGreenDelete = (task: GBVideoItem) => {
}
const beforeLeave = (el: any) => {
el.style.width = `${ el.offsetWidth }px`
el.style.height = `${ el.offsetHeight }px`
el.style.width = `${el.offsetWidth}px`
el.style.height = `${el.offsetHeight}px`
}
const leave = (el: any, done: Function) => {
@@ -126,7 +125,11 @@ onMounted(() => {
<div class="p-4 pb-0">
<BubbleTitle
:subtitle="!debounceSearch ? 'GB VIDEOS' : 'SEARCH...'"
:title="!debounceSearch ? '我的绿幕视频' : `标题搜索:${debounceSearch.toLocaleUpperCase()}`"
:title="
!debounceSearch
? '我的绿幕视频'
: `标题搜索:${debounceSearch.toLocaleUpperCase()}`
"
>
<template #action>
<UButtonGroup size="md">
@@ -163,7 +166,7 @@ onMounted(() => {
/>
</template>
</BubbleTitle>
<GradientDivider/>
<GradientDivider />
</div>
<Transition name="loading-screen">
@@ -171,14 +174,17 @@ onMounted(() => {
v-if="videoList?.data.items.length === 0"
class="w-full py-20 flex flex-col justify-center items-center gap-2"
>
<Icon class="text-7xl text-neutral-300 dark:text-neutral-700" name="i-tabler-photo-hexagon"/>
<p class="text-sm text-neutral-500 dark:text-neutral-400">
没有记录
</p>
<Icon
class="text-7xl text-neutral-300 dark:text-neutral-700"
name="i-tabler-photo-hexagon"
/>
<p class="text-sm text-neutral-500 dark:text-neutral-400">没有记录</p>
</div>
<div v-else>
<div class="p-4">
<div class="relative grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-3 fhd:grid-cols-5 gap-4">
<div
class="relative grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-3 fhd:grid-cols-5 gap-4"
>
<TransitionGroup
name="card"
@beforeLeave="beforeLeave"
@@ -188,20 +194,22 @@ onMounted(() => {
v-for="(v, i) in videoList?.data.items"
:key="v.task_id"
:video="v"
@delete="v => onCourseGreenDelete(v)"
@delete="(v) => onCourseGreenDelete(v)"
/>
</TransitionGroup>
</div>
<div class="flex justify-end mt-4">
<UPagination v-model="page" :max="9" :page-count="pageCount" :total="videoList?.data.total || 0"/>
<UPagination
v-model="page"
:max="9"
:page-count="pageCount"
:total="videoList?.data.total || 0"
/>
</div>
</div>
</div>
</Transition>
</div>
</template>
<style scoped>
</style>
<style scoped></style>