mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-11 18:10:49 +08:00
fix types
This commit is contained in:
117
src/api/types.ts
Normal file
117
src/api/types.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
// 订阅
|
||||
export interface Subscribe {
|
||||
id: number;
|
||||
// 订阅名称
|
||||
name: string;
|
||||
// 订阅年份
|
||||
year: string;
|
||||
// 订阅类型 电影/电视剧
|
||||
type: string;
|
||||
// 搜索关键字
|
||||
keyword?: string;
|
||||
tmdbid: number;
|
||||
doubanid?: string;
|
||||
// 季号
|
||||
season?: number;
|
||||
// 海报
|
||||
poster?: string;
|
||||
// 背景图
|
||||
backdrop?: string;
|
||||
// 评分
|
||||
vote?: number;
|
||||
// 描述
|
||||
description?: string;
|
||||
// 过滤规则
|
||||
filter?: string;
|
||||
// 包含
|
||||
include?: string;
|
||||
// 排除
|
||||
exclude?: string;
|
||||
// 总集数
|
||||
total_episode?: number;
|
||||
// 开始集数
|
||||
start_episode?: number;
|
||||
// 缺失集数
|
||||
lack_episode?: number;
|
||||
// 附加信息
|
||||
note?: string;
|
||||
// 状态:N-新建, R-订阅中
|
||||
state: string;
|
||||
}
|
||||
|
||||
// 历史记录
|
||||
export interface TransferHistory {
|
||||
// ID
|
||||
id: number;
|
||||
// 源目录
|
||||
src?: string;
|
||||
// 目的目录
|
||||
dest?: string;
|
||||
// 转移模式link/copy/move/softlink
|
||||
mode?: string;
|
||||
// 类型:电影、电视剧
|
||||
type?: string;
|
||||
// 二级分类
|
||||
category?: string;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 年份
|
||||
year?: string;
|
||||
// TMDBID
|
||||
tmdbid?: number;
|
||||
// IMDBID
|
||||
imdbid?: string;
|
||||
// TVDBID
|
||||
tvdbid?: number;
|
||||
// 豆瓣ID
|
||||
doubanid?: string;
|
||||
// 季Sxx
|
||||
seasons?: string;
|
||||
// 集Exx
|
||||
episodes?: string;
|
||||
// 海报
|
||||
image?: string;
|
||||
// 下载器Hash
|
||||
download_hash?: string;
|
||||
// 状态 1-成功,0-失败
|
||||
status: boolean;
|
||||
// 失败原因
|
||||
errmsg?: string;
|
||||
// 日期
|
||||
date?: string;
|
||||
}
|
||||
|
||||
|
||||
// 媒体信息
|
||||
export interface MediaInfo {
|
||||
// 类型 电影、电视剧
|
||||
type?: string
|
||||
// 媒体标题
|
||||
title?: string
|
||||
// 年份
|
||||
year?: string
|
||||
// TMDB ID
|
||||
tmdb_id?: number
|
||||
// IMDB ID
|
||||
imdb_id?: string
|
||||
// TVDB ID
|
||||
tvdb_id?: string
|
||||
// 豆瓣ID
|
||||
douban_id?: string
|
||||
// 媒体原语种
|
||||
original_language?: string
|
||||
// 媒体原发行标题
|
||||
original_title?: string
|
||||
// 媒体发行日期
|
||||
release_date?: string
|
||||
// 背景图片
|
||||
backdrop_path?: string
|
||||
// 海报图片
|
||||
poster_path?: string
|
||||
// 评分
|
||||
vote_average: number
|
||||
// 描述
|
||||
overview?: string
|
||||
// 二级分类
|
||||
category?: string
|
||||
}
|
||||
20
src/components/cards/MediaCard.vue
Normal file
20
src/components/cards/MediaCard.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<script lang="ts" setup>
|
||||
import { MediaInfo } from "@/api/types";
|
||||
|
||||
// 输入参数
|
||||
const props = defineProps({
|
||||
media: Object as PropType<MediaInfo>
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VResponsive aspect-ratio="1/2" max-width="11rem">
|
||||
<VCard>
|
||||
<VImg
|
||||
:src="props.media?.poster_path"
|
||||
cover
|
||||
/>
|
||||
</VCard>
|
||||
</VResponsive>
|
||||
</template>
|
||||
@@ -10,23 +10,5 @@ import MediaCardListView from '@/views/discover/MediaCardListView.vue';
|
||||
|
||||
<MediaCardListView apipath="/tmdb/movies"/>
|
||||
|
||||
<p class="text-2xl font-weight-medium my-5">
|
||||
TMDB电视剧
|
||||
</p>
|
||||
|
||||
<MediaCardListView apipath="/tmdb/tvs"/>
|
||||
|
||||
<p class="text-2xl font-weight-medium my-5">
|
||||
豆瓣电影
|
||||
</p>
|
||||
|
||||
<MediaCardListView apipath="/douban/movies"/>
|
||||
|
||||
<p class="text-2xl font-weight-medium my-5">
|
||||
豆瓣电视剧
|
||||
</p>
|
||||
|
||||
<MediaCardListView apipath="/douban/tvs"/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,39 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import api from "@/api";
|
||||
|
||||
// 定义订阅字典结构
|
||||
interface MediaInfo {
|
||||
// 类型 电影、电视剧
|
||||
type?: string
|
||||
// 媒体标题
|
||||
title?: string
|
||||
// 年份
|
||||
year?: string
|
||||
// TMDB ID
|
||||
tmdb_id?: number
|
||||
// IMDB ID
|
||||
imdb_id?: string
|
||||
// TVDB ID
|
||||
tvdb_id?: string
|
||||
// 豆瓣ID
|
||||
douban_id?: string
|
||||
// 媒体原语种
|
||||
original_language?: string
|
||||
// 媒体原发行标题
|
||||
original_title?: string
|
||||
// 媒体发行日期
|
||||
release_date?: string
|
||||
// 背景图片
|
||||
backdrop_path?: string
|
||||
// 海报图片
|
||||
poster_path?: string
|
||||
// 评分
|
||||
vote_average: number
|
||||
// 描述
|
||||
overview?: string
|
||||
// 二级分类
|
||||
category?: string
|
||||
}
|
||||
import { MediaInfo } from "@/api/types";
|
||||
import MediaCard from "@/components/cards/MediaCard.vue";
|
||||
|
||||
// 输入参数
|
||||
const props = defineProps({
|
||||
@@ -63,12 +31,8 @@ onMounted(fetchData);
|
||||
<template>
|
||||
<VRow>
|
||||
<VCol v-for="data in dataList" :key="data.tmdb_id" cols="6" md="3" lg="2">
|
||||
<VCard>
|
||||
<VImg
|
||||
:src="data.poster_path"
|
||||
cover
|
||||
/>
|
||||
</VCard>
|
||||
<MediaCard :media="data">
|
||||
</MediaCard>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
||||
|
||||
@@ -1,48 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import api from "@/api";
|
||||
import type { TransferHistory } from "@/api/types";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
interface TransferHistory {
|
||||
// ID
|
||||
id: number;
|
||||
// 源目录
|
||||
src?: string;
|
||||
// 目的目录
|
||||
dest?: string;
|
||||
// 转移模式link/copy/move/softlink
|
||||
mode?: string;
|
||||
// 类型:电影、电视剧
|
||||
type?: string;
|
||||
// 二级分类
|
||||
category?: string;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 年份
|
||||
year?: string;
|
||||
// TMDBID
|
||||
tmdbid?: number;
|
||||
// IMDBID
|
||||
imdbid?: string;
|
||||
// TVDBID
|
||||
tvdbid?: number;
|
||||
// 豆瓣ID
|
||||
doubanid?: string;
|
||||
// 季Sxx
|
||||
seasons?: string;
|
||||
// 集Exx
|
||||
episodes?: string;
|
||||
// 海报
|
||||
image?: string;
|
||||
// 下载器Hash
|
||||
download_hash?: string;
|
||||
// 状态 1-成功,0-失败
|
||||
status: boolean;
|
||||
// 失败原因
|
||||
errmsg?: string;
|
||||
// 日期
|
||||
date?: string;
|
||||
}
|
||||
|
||||
// 表头
|
||||
const headers = [
|
||||
{ title: "标题", key: "title" },
|
||||
|
||||
@@ -1,47 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import api from "@/api";
|
||||
import { formatSeason } from "@core/utils/formatters";
|
||||
|
||||
// 定义订阅字典结构
|
||||
interface Subscribe {
|
||||
id: number;
|
||||
// 订阅名称
|
||||
name: string;
|
||||
// 订阅年份
|
||||
year: string;
|
||||
// 订阅类型 电影/电视剧
|
||||
type: string;
|
||||
// 搜索关键字
|
||||
keyword?: string;
|
||||
tmdbid: number;
|
||||
doubanid?: string;
|
||||
// 季号
|
||||
season?: number;
|
||||
// 海报
|
||||
poster?: string;
|
||||
// 背景图
|
||||
backdrop?: string;
|
||||
// 评分
|
||||
vote?: number;
|
||||
// 描述
|
||||
description?: string;
|
||||
// 过滤规则
|
||||
filter?: string;
|
||||
// 包含
|
||||
include?: string;
|
||||
// 排除
|
||||
exclude?: string;
|
||||
// 总集数
|
||||
total_episode?: number;
|
||||
// 开始集数
|
||||
start_episode?: number;
|
||||
// 缺失集数
|
||||
lack_episode?: number;
|
||||
// 附加信息
|
||||
note?: string;
|
||||
// 状态:N-新建, R-订阅中
|
||||
state: string;
|
||||
}
|
||||
import type { Subscribe } from "@/api/types";
|
||||
|
||||
// 输入参数
|
||||
const props = defineProps({
|
||||
|
||||
Reference in New Issue
Block a user