diff --git a/reading-platform-frontend/openapi.json b/reading-platform-frontend/openapi.json index c622793..3b211bc 100644 --- a/reading-platform-frontend/openapi.json +++ b/reading-platform-frontend/openapi.json @@ -26910,8 +26910,9 @@ "description": "内容" }, "images": { - "type": "string", - "description": "图片(JSON 数组)" + "type": "array", + "items": { "type": "string", "description": "图片 URL" }, + "description": "图片 URL 列表" }, "recordDate": { "type": "string", @@ -30152,8 +30153,9 @@ "description": "内容" }, "images": { - "type": "string", - "description": "图片(JSON 数组)" + "type": "array", + "items": { "type": "string", "description": "图片 URL" }, + "description": "图片 URL 列表" }, "recordDate": { "type": "string", diff --git a/reading-platform-frontend/scripts/fetch-openapi.js b/reading-platform-frontend/scripts/fetch-openapi.js index a3b6926..ff4870f 100644 --- a/reading-platform-frontend/scripts/fetch-openapi.js +++ b/reading-platform-frontend/scripts/fetch-openapi.js @@ -31,6 +31,8 @@ async function fetchAndFix() { if (spec.components?.schemas) { delete spec.components.schemas['ResultObject[]']; } + // 修复成长记录 images 字段:统一为 array of string(避免 SpringDoc 误生成为 string) + fixGrowthRecordImagesSchema(spec.components?.schemas); writeFileSync(OUTPUT, JSON.stringify(spec, null, 2)); console.log('OpenAPI spec written to:', OUTPUT); @@ -61,6 +63,22 @@ function fixSchema(schema) { if (schema.items) fixSchema(schema.items); } +/** 将 GrowthRecordCreateRequest/GrowthRecordUpdateRequest 的 images 统一为 array of string */ +function fixGrowthRecordImagesSchema(schemas) { + if (!schemas) return; + const arrayOfString = { + type: 'array', + items: { type: 'string', description: '图片 URL' }, + description: '图片 URL 列表', + }; + for (const name of ['GrowthRecordCreateRequest', 'GrowthRecordUpdateRequest']) { + const s = schemas[name]; + if (s?.properties?.images?.type === 'string') { + schemas[name].properties.images = arrayOfString; + } + } +} + function inlineResultObjectArrayRef(paths) { const inlineSchema = { type: 'object', diff --git a/reading-platform-frontend/src/api/generated/model/growthRecordCreateRequest.ts b/reading-platform-frontend/src/api/generated/model/growthRecordCreateRequest.ts index 08d6821..d338b4f 100644 --- a/reading-platform-frontend/src/api/generated/model/growthRecordCreateRequest.ts +++ b/reading-platform-frontend/src/api/generated/model/growthRecordCreateRequest.ts @@ -18,8 +18,8 @@ export interface GrowthRecordCreateRequest { title: string; /** 内容 */ content?: string; - /** 图片(JSON 数组) */ - images?: string; + /** 图片 URL 列表 */ + images?: string[]; /** 记录日期 */ recordDate?: string; /** 标签 */ diff --git a/reading-platform-frontend/src/api/generated/model/growthRecordUpdateRequest.ts b/reading-platform-frontend/src/api/generated/model/growthRecordUpdateRequest.ts index 55c858e..6937d58 100644 --- a/reading-platform-frontend/src/api/generated/model/growthRecordUpdateRequest.ts +++ b/reading-platform-frontend/src/api/generated/model/growthRecordUpdateRequest.ts @@ -16,8 +16,8 @@ export interface GrowthRecordUpdateRequest { title?: string; /** 内容 */ content?: string; - /** 图片(JSON 数组) */ - images?: string; + /** 图片 URL 列表 */ + images?: string[]; /** 记录日期 */ recordDate?: string; /** 标签 */ diff --git a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.scss b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.scss index 2b218f9..bb63e4c 100644 --- a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.scss +++ b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.scss @@ -25,6 +25,26 @@ } } +.collection-selector { + margin-bottom: 20px; + padding: 16px; + background: #FAFAFA; + border-radius: 8px; + + .selector-label { + font-size: 14px; + font-weight: 500; + color: #333; + margin-bottom: 12px; + } + + .collection-radio-group { + display: flex; + flex-wrap: wrap; + gap: 8px; + } +} + .collection-option { .collection-name { font-weight: 500; diff --git a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue index 401a885..be49265 100644 --- a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue +++ b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue @@ -1,15 +1,7 @@