From 04d84573a5259e40c46cb68235bd92dcf9675e70 Mon Sep 17 00:00:00 2001 From: liqi Date: Fri, 28 Nov 2025 14:04:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=8E=86=E5=8F=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/code-generation/api/index.ts | 7 + .../src/views/code-generation/index.vue | 363 +++++++++++++++++- 2 files changed, 368 insertions(+), 2 deletions(-) diff --git a/apps/web-antd/src/views/code-generation/api/index.ts b/apps/web-antd/src/views/code-generation/api/index.ts index 059871fb..3f3c7e7c 100644 --- a/apps/web-antd/src/views/code-generation/api/index.ts +++ b/apps/web-antd/src/views/code-generation/api/index.ts @@ -24,6 +24,13 @@ const prefix = 'code/'; // return requestClient.get(`${prefix}detail`, { params: { id } }); // } +/** + * 代码生成记录 + * @param data + */ +export async function getCodeGenerationListApi(data: Record = {}) { + return requestClient.get(`${prefix}list`, { params: data }); +} /** * 代码生成 * @param data diff --git a/apps/web-antd/src/views/code-generation/index.vue b/apps/web-antd/src/views/code-generation/index.vue index dfe949e2..6de16d6d 100644 --- a/apps/web-antd/src/views/code-generation/index.vue +++ b/apps/web-antd/src/views/code-generation/index.vue @@ -1,14 +1,17 @@ @@ -153,4 +348,168 @@ const handleGenerate = async (data: CodeGenData) => { opacity: 0; transform: translateX(20px); } + +/* 历史记录列表样式 - 简洁美观风格 */ +.history-list-clean { + display: flex; + flex-direction: column; + gap: 12px; +} + +.history-item-clean { + background: #ffffff; + border: 1px solid rgba(0, 0, 0, 0.08); + border-radius: 10px; + transition: all 0.2s ease; + overflow: hidden; +} + +.dark .history-item-clean { + background: #1f2937; + border-color: rgba(255, 255, 255, 0.1); +} + +.history-item-clean:hover { + border-color: rgba(24, 144, 255, 0.3); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); +} + +.dark .history-item-clean:hover { + border-color: rgba(24, 144, 255, 0.5); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); +} + +.history-item-wrapper { + display: flex; + align-items: flex-start; + justify-content: space-between; + padding: 18px 20px; + gap: 24px; +} + +.history-item-left { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + gap: 10px; +} + +.history-item-header { + margin-bottom: 0; +} + +.history-item-title { + font-size: 16px; + font-weight: 600; + color: #1f2937; + margin: 0; + line-height: 1.4; + word-break: break-word; +} + +.dark .history-item-title { + color: #f9fafb; +} + +.history-item-file-row { + display: flex; + align-items: center; + gap: 8px; +} + +.history-file-icon { + color: #1890ff; + width: 16px; + height: 16px; + flex-shrink: 0; + margin-top: 2px; +} + +.history-item-file { + font-size: 14px; + color: #6b7280; + word-break: break-all; + line-height: 1.5; +} + +.dark .history-item-file { + color: #9ca3af; +} + +.history-item-time-row { + display: flex; + align-items: center; + gap: 6px; + margin-top: 2px; +} + +.history-item-time-label { + font-size: 13px; + color: #9ca3af; + flex-shrink: 0; +} + +.dark .history-item-time-label { + color: #6b7280; +} + +.history-item-time { + font-size: 13px; + color: #6b7280; + word-break: break-word; +} + +.dark .history-item-time { + color: #9ca3af; +} + +.history-item-right { + display: flex; + align-items: center; + gap: 12px; + flex-shrink: 0; + padding-top: 2px; +} + +.history-btn-link { + height: auto; + padding: 0; + font-size: 13px; + display: flex; + align-items: center; + transition: all 0.2s ease; +} + +.history-btn-primary { + height: 32px; + padding: 0 16px; + border-radius: 6px; + font-size: 13px; + display: flex; + align-items: center; + transition: all 0.2s ease; +} + +.history-btn-primary:hover { + transform: translateY(-1px); +} + +/* JSON查看器样式 */ +.json-viewer-container { + max-height: 600px; + overflow: auto; + padding: 8px; + background: #fafafa; + border-radius: 8px; +} + +.dark .json-viewer-container { + background: #1f2937; +} + +/* 抽屉样式优化 */ +:deep(.history-drawer .ant-drawer-body) { + padding: 20px; +}