From 530802000377f752bfe7df6a09cb95252ae703b9 Mon Sep 17 00:00:00 2001 From: Seven Date: Fri, 9 Jan 2026 00:26:46 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=91=98=E8=A6=81=E5=92=8C=E6=8E=92=E5=BA=8F=E9=A1=BA=E5=BA=8F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E4=BC=98=E5=8C=96=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.js | 3 +- package.json | 2 +- pnpm-lock.yaml | 12 ++--- src/components/upload/index.vue | 2 +- src/views/news/components/add.vue | 81 ++++++++++++++++++++++-------- src/views/news/components/edit.vue | 81 ++++++++++++++++++++++-------- src/views/news/index.vue | 13 ++++- 7 files changed, 144 insertions(+), 50 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index fcf803d..5c08d67 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -20,7 +20,8 @@ export default defineConfig( ], 'vue/no-duplicate-attr-inheritance': 'off', 'unocss/order-attributify': 'off', - '@typescript-eslint/no-unused-vars': 'off' + '@typescript-eslint/no-unused-vars': 'off', + 'consistent-return': 'off' } } ); diff --git a/package.json b/package.json index e071346..ea9094e 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@better-scroll/core": "2.5.1", "@elysiajs/eden": "^1.4.5", "@iconify/vue": "5.0.0", - "@riwa/api-types": "http://192.168.1.7:9527/api/riwa-eden-0.0.108.tgz", + "@riwa/api-types": "http://192.168.1.7:9527/api/riwa-eden-0.0.109.tgz", "@sa/axios": "workspace:*", "@sa/color": "workspace:*", "@sa/hooks": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 33e5404..08d610a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: specifier: 5.0.0 version: 5.0.0(vue@3.5.25(typescript@5.9.3)) '@riwa/api-types': - specifier: http://192.168.1.7:9527/api/riwa-eden-0.0.108.tgz - version: '@riwa/eden@http://192.168.1.7:9527/api/riwa-eden-0.0.108.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))' + specifier: http://192.168.1.7:9527/api/riwa-eden-0.0.109.tgz + version: '@riwa/eden@http://192.168.1.7:9527/api/riwa-eden-0.0.109.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))' '@sa/axios': specifier: workspace:* version: link:packages/axios @@ -1230,9 +1230,9 @@ packages: '@quansync/fs@0.1.6': resolution: {integrity: sha512-zoA8SqQO11qH9H8FCBR7NIbowYARIPmBz3nKjgAaOUDi/xPAAu1uAgebtV7KXHTc6CDZJVRZ1u4wIGvY5CWYaw==} - '@riwa/eden@http://192.168.1.7:9527/api/riwa-eden-0.0.108.tgz': - resolution: {tarball: http://192.168.1.7:9527/api/riwa-eden-0.0.108.tgz} - version: 0.0.108 + '@riwa/eden@http://192.168.1.7:9527/api/riwa-eden-0.0.109.tgz': + resolution: {tarball: http://192.168.1.7:9527/api/riwa-eden-0.0.109.tgz} + version: 0.0.109 peerDependencies: '@elysiajs/eden': ^1.4.5 @@ -5651,7 +5651,7 @@ snapshots: dependencies: quansync: 0.3.0 - '@riwa/eden@http://192.168.1.7:9527/api/riwa-eden-0.0.108.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))': + '@riwa/eden@http://192.168.1.7:9527/api/riwa-eden-0.0.109.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))': dependencies: '@elysiajs/eden': 1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)) diff --git a/src/components/upload/index.vue b/src/components/upload/index.vue index 0b23c6d..6863587 100644 --- a/src/components/upload/index.vue +++ b/src/components/upload/index.vue @@ -55,7 +55,7 @@ async function handleCustomRequest({ file, onProgress, onFinish, onError }: Uplo } // 验证文件数量 - if (fileList.value.length >= props.maxFiles) { + if (fileList.value.length > props.maxFiles) { window.$message?.error(`最多只能上传 ${props.maxFiles} 个文件`); onError(); return; diff --git a/src/views/news/components/add.vue b/src/views/news/components/add.vue index d5c58f0..35da2f0 100644 --- a/src/views/news/components/add.vue +++ b/src/views/news/components/add.vue @@ -96,6 +96,19 @@ const rules: FormRules = { trigger: ['blur', 'input'] } ], + summary: [ + { + required: true, + message: '请输入新闻摘要', + trigger: ['blur', 'input'] + }, + { + min: 10, + max: 200, + message: '摘要长度应在10-200个字符之间', + trigger: ['blur', 'input'] + } + ], content: [ { required: true, @@ -144,24 +157,42 @@ async function handleSubmit() { require-mark-placement="left" > - + - - - - + + + + + + + + + + + + + + @@ -178,12 +209,22 @@ async function handleSubmit() { /> - - - - - - + + + + + + + + + + + + + + 取消 diff --git a/src/views/news/components/edit.vue b/src/views/news/components/edit.vue index 4a09169..06b3f06 100644 --- a/src/views/news/components/edit.vue +++ b/src/views/news/components/edit.vue @@ -98,6 +98,19 @@ const rules: FormRules = { trigger: ['blur', 'input'] } ], + summary: [ + { + required: true, + message: '请输入新闻摘要', + trigger: ['blur', 'input'] + }, + { + min: 10, + max: 200, + message: '摘要长度应在10-200个字符之间', + trigger: ['blur', 'input'] + } + ], content: [ { required: true, @@ -149,23 +162,41 @@ async function handleSubmit() { - - - - + + + + + + + + + + + + + + - + @@ -180,12 +211,22 @@ async function handleSubmit() { /> - - - - - - + + + + + + + + + + + + + + 取消 diff --git a/src/views/news/index.vue b/src/views/news/index.vue index b7343dd..45bbfad 100644 --- a/src/views/news/index.vue +++ b/src/views/news/index.vue @@ -41,6 +41,12 @@ const columns: TableBaseColumns = [ key: 'category.name', width: 120 }, + { + title: '摘要', + key: 'summary', + width: 300, + ellipsis: { tooltip: true } + }, { title: '内容预览', key: 'content', @@ -64,6 +70,11 @@ const columns: TableBaseColumns = [ { default: () => (row.isPinned ? '是' : '否') } ) }, + { + title: '排序顺序', + key: 'sortOrder', + width: 80 + }, { title: '创建时间', key: 'createdAt', @@ -150,7 +161,7 @@ function handleEdit(row: any) { tableInst.value?.reload(); } }), - style: { width: '800px' }, + style: { width: '1200px' }, showIcon: false }); }