From 8944054609913e1434ef93dfba7eac8fe4583958 Mon Sep 17 00:00:00 2001 From: R2m1liA <15258427350@163.com> Date: Wed, 20 Aug 2025 16:54:51 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E6=AD=A3=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E8=A7=84=E6=A0=BC=E5=8F=82=E6=95=B0=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/SpecTable.vue | 32 +++--------- app/pages/productions/[...slug].vue | 47 +++++++----------- app/pages/productions/index.vue | 77 +++++++++++++++++++++++------ app/types/strapi/common.ts | 36 +++++++------- app/types/strapi/production.ts | 24 ++++++--- 5 files changed, 123 insertions(+), 93 deletions(-) diff --git a/app/components/SpecTable.vue b/app/components/SpecTable.vue index 1e85218..dacd7c6 100644 --- a/app/components/SpecTable.vue +++ b/app/components/SpecTable.vue @@ -1,19 +1,10 @@ \ No newline at end of file diff --git a/app/types/strapi/common.ts b/app/types/strapi/common.ts index a6c1c52..6979b7e 100644 --- a/app/types/strapi/common.ts +++ b/app/types/strapi/common.ts @@ -1,19 +1,19 @@ export interface StrapiEntity { - id?: number; - documentId?: string; - createdAt?: string; - updatedAt?: string; - publishedAt?: string; - locale?: string; + id: number; + documentId: string; + createdAt: string; + updatedAt: string; + publishedAt: string; + locale: string; } export interface StrapiMedia { id: number; url: string; - ext?: string; - name?: string; - alternativeText?: string; - caption?: string; + ext: string; + name: string; + alternativeText: string; + caption: string; } export interface StrapiImageFormat { @@ -24,19 +24,19 @@ export interface StrapiImageFormat { } export interface StrapiImage extends StrapiMedia { - width?: number; - height?: number; - formats?: { - small?: StrapiImageFormat; - medium?: StrapiImageFormat; - thumbnail?: StrapiImageFormat; + width: number; + height: number; + formats: { + small: StrapiImageFormat; + medium: StrapiImageFormat; + thumbnail: StrapiImageFormat; } } export interface StrapiResponse { data: T; - meta?: { - pagination?: { + meta: { + pagination: { page: number; pageSize: number; pageCount: number; diff --git a/app/types/strapi/production.ts b/app/types/strapi/production.ts index 7addc89..84bf80e 100644 --- a/app/types/strapi/production.ts +++ b/app/types/strapi/production.ts @@ -4,13 +4,23 @@ export interface ProductionType extends StrapiEntity { type: string; } +export interface ProductionSpecItem { + label: string; + value: string; +} + +export interface ProductionSpecGroup { + title: string; + items: ProductionSpecItem[]; +} + export interface Production extends StrapiEntity { title: string; - summary?: string; - production_type?: ProductionType; - production_image?: StrapiImage; - production_details?: string; - production_specs?: string | object; - documents?: StrapiMedia[]; - show_in_production_list?: boolean; + summary: string; + production_type: ProductionType; + production_image: StrapiImage; + production_details: string; + production_specs: ProductionSpecGroup[]; + documents: StrapiMedia[]; + show_in_production_list: boolean; } \ No newline at end of file