From 4c838107c305b56f9adb349231ab2da76ae08164 Mon Sep 17 00:00:00 2001 From: fwb Date: Fri, 30 Aug 2024 09:57:22 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=9B=B4=E6=96=B0'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/components/messageContent.vue | 2 +- .../message/components/receiveContentList.vue | 11 +++- .../message/components/sendMessageList.vue | 10 +++- .../news/components/newsContentManage.vue | 20 +++---- src/views/news/index.vue | 57 ++++++++++--------- 5 files changed, 55 insertions(+), 45 deletions(-) diff --git a/src/views/message/components/messageContent.vue b/src/views/message/components/messageContent.vue index 5f4ef7a..e67dd39 100644 --- a/src/views/message/components/messageContent.vue +++ b/src/views/message/components/messageContent.vue @@ -196,7 +196,7 @@ li{ padding: 0 20px; /* 添加一些内边距以避免内容紧贴边缘 */ } .el-input{ - margin-bottom: 30px; + margin-bottom: 20px; } .content-container { display: flex; diff --git a/src/views/message/components/receiveContentList.vue b/src/views/message/components/receiveContentList.vue index 6ecc623..36046c8 100644 --- a/src/views/message/components/receiveContentList.vue +++ b/src/views/message/components/receiveContentList.vue @@ -17,11 +17,16 @@ 发送时间:{{ Message.sendTime }} 是否阅读:{{Message.isRead ? '已读' : '未读' }} +
标题:{{ Message.title }}
-
- 内容:{{ Message.content }} + + + + + + +
- diff --git a/src/views/message/components/sendMessageList.vue b/src/views/message/components/sendMessageList.vue index ad21410..63d1c35 100644 --- a/src/views/message/components/sendMessageList.vue +++ b/src/views/message/components/sendMessageList.vue @@ -17,10 +17,14 @@ 发送时间:{{ sendMessage.sendTime }} +
标题:{{ sendMessage.title }}
-
- 内容:{{ sendMessage.content }} -
+ + + + + + diff --git a/src/views/news/components/newsContentManage.vue b/src/views/news/components/newsContentManage.vue index c115619..6491380 100644 --- a/src/views/news/components/newsContentManage.vue +++ b/src/views/news/components/newsContentManage.vue @@ -5,10 +5,11 @@
-
- 栏目管理 -
+
+
+ 栏目管理 +
  • @@ -58,7 +59,7 @@ - + @@ -101,7 +102,7 @@ 栏目编辑
    - 添加 + 添加新闻栏目
    @@ -403,17 +404,15 @@ const addNewsContentConfirm = async (id)=>{ gap: 10px; background: white; margin-top: 20px; - height: 81vh; + height: 810px; overflow-y: auto; } .header-flex-container::-webkit-scrollbar { width: 0px; /* 滚动条宽度 */ } .header-list { - /*display: flex; !* 使li元素水平排列 *!*/ flex-wrap: wrap; /* 如果需要换行 */ - /*align-items: center; !* 如果需要,也可以使li元素垂直居中 *!*/ - margin: 0; /* 移除默认外边距 */ + margin-left: 40px; /* 移除默认外边距 */ padding: 0; /* 移除默认内边距 */ } .header-list span{ @@ -461,8 +460,7 @@ const addNewsContentConfirm = async (id)=>{ } .button-container_column{ position:absolute; - margin-top: 30px; - margin-left: 200px; + margin-left: 180px; } .news-flex-container { display: flex; /* 使用 Flexbox 布局 */ diff --git a/src/views/news/index.vue b/src/views/news/index.vue index 9a71b26..1f707e6 100644 --- a/src/views/news/index.vue +++ b/src/views/news/index.vue @@ -32,7 +32,6 @@ -
    @@ -52,7 +51,6 @@ {{ nowTimeNewsData.content }} -
    @@ -65,6 +63,7 @@ import { queryEssay, } from "@/api/user/news.js" import {ref,onMounted} from 'vue'; +import {ElMessage} from 'element-plus' import useUserStore from "@/store/modules/user"; import {useRouter} from "vue-router"; const router = useRouter(); @@ -74,6 +73,13 @@ const column =ref([]) const CategoryList = async () => { const res = await queryCategory() column.value = res.data + console.log('栏目数组长度:',column.value.length) + // 初始化时加载第一个栏目的第一条新闻 + if (column.value.length > 0) { + await EssayList(column.value[0].id); + } else { + await ElMessage.warning('没有找到任何栏目!'); + } } // 渲染 onMounted(() => { @@ -81,10 +87,7 @@ onMounted(() => { }) const essay = ref([]) const nowTimeNewsData = ref({}) -//新闻详细信息获取 -const newViews = (listObject)=> { - nowTimeNewsData.value = { ...listObject } -} + //新闻文章查询 const EssayList = async (id)=>{ const response = await queryEssay(id) @@ -93,8 +96,11 @@ const EssayList = async (id)=>{ newViews(essay.value[0]); // 显示第一条新闻 } } +//新闻详细信息获取 +const newViews = (listObject)=> { + nowTimeNewsData.value = { ...listObject } +} - \ No newline at end of file