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"
>
-
+
-
-
-
-
-
-
-
-
- 新增分类
-
-
-
-
+
+ (form.thumbnailId = evt.length > 0 ? evt[0] : undefined)"
+ />
+
+
+
+
+
+
+
+
+
+ 新增分类
+
+
+
+
+
+
+
+
+
+
+
@@ -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() {
-
-
-
-
-
-
-
-
- 新增分类
-
-
-
-
+
+ (form.thumbnailId = evt[0] || '')"
+ />
+
+
+
+
+
+
+
+
+
+ 新增分类
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -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
});
}