mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
es lint fix
This commit is contained in:
@@ -1,54 +1,56 @@
|
||||
<script setup lang="ts">
|
||||
import api from "@/api";
|
||||
import { MediaStatistic } from "@/api/types";
|
||||
import api from '@/api'
|
||||
import type { MediaStatistic } from '@/api/types'
|
||||
|
||||
const statistics = ref([
|
||||
{
|
||||
title: "",
|
||||
stats: "",
|
||||
icon: "",
|
||||
color: "",
|
||||
title: '',
|
||||
stats: '',
|
||||
icon: '',
|
||||
color: '',
|
||||
},
|
||||
]);
|
||||
])
|
||||
|
||||
// 调用API加载媒体统计数据
|
||||
const loadMediaStatistic = async () => {
|
||||
async function loadMediaStatistic() {
|
||||
try {
|
||||
const res: MediaStatistic = await api.get("dashboard/statistic");
|
||||
const res: MediaStatistic = await api.get('dashboard/statistic')
|
||||
|
||||
statistics.value = [
|
||||
{
|
||||
title: "电影",
|
||||
title: '电影',
|
||||
stats: res.movie_count.toLocaleString(),
|
||||
icon: "mdi-movie-roll",
|
||||
color: "primary",
|
||||
icon: 'mdi-movie-roll',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
title: "电视剧",
|
||||
title: '电视剧',
|
||||
stats: res.tv_count.toLocaleString(),
|
||||
icon: "mdi-television-box",
|
||||
color: "success",
|
||||
icon: 'mdi-television-box',
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
title: "剧集",
|
||||
title: '剧集',
|
||||
stats: res.episode_count.toLocaleString(),
|
||||
icon: "mdi-television-classic",
|
||||
color: "warning",
|
||||
icon: 'mdi-television-classic',
|
||||
color: 'warning',
|
||||
},
|
||||
{
|
||||
title: "用户",
|
||||
title: '用户',
|
||||
stats: res.user_count.toLocaleString(),
|
||||
icon: "mdi-account",
|
||||
color: "info",
|
||||
icon: 'mdi-account',
|
||||
color: 'info',
|
||||
},
|
||||
];
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
]
|
||||
}
|
||||
};
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadMediaStatistic();
|
||||
});
|
||||
loadMediaStatistic()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -59,11 +61,24 @@ onMounted(() => {
|
||||
|
||||
<VCardText>
|
||||
<VRow>
|
||||
<VCol v-for="item in statistics" :key="item.title" cols="6" sm="3">
|
||||
<VCol
|
||||
v-for="item in statistics"
|
||||
:key="item.title"
|
||||
cols="6"
|
||||
sm="3"
|
||||
>
|
||||
<div class="d-flex align-center">
|
||||
<div class="me-3">
|
||||
<VAvatar :color="item.color" rounded size="42" class="elevation-1">
|
||||
<VIcon size="24" :icon="item.icon" />
|
||||
<VAvatar
|
||||
:color="item.color"
|
||||
rounded
|
||||
size="42"
|
||||
class="elevation-1"
|
||||
>
|
||||
<VIcon
|
||||
size="24"
|
||||
:icon="item.icon"
|
||||
/>
|
||||
</VAvatar>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user