From 137910cf4fc73a3a2787a3a02718f1e1f637c368 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期五, 14 六月 2024 16:01:17 +0800 Subject: [PATCH] bug修改 --- src/views/components/notice.vue | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/views/components/notice.vue b/src/views/components/notice.vue index d70ef98..1f7d7c6 100644 --- a/src/views/components/notice.vue +++ b/src/views/components/notice.vue @@ -2,23 +2,22 @@ <div class="container"> <div class="main-content"> <div class="list"> - <div v-for="item in state.dataList"> + <div v-for="item in state.dataList" @click="openDetails('通知公告',item.id)"> <div> - <div><img src="src/assets/images/article.png"></div> + <div><img :src="articlePng"></div> <div>{{item.title}}</div> </div> <span> - {{item.updateTime}} + {{(item.updateTime?item.updateTime:item.createTime).substring(0,16)}} </span> </div> </div> - <div class="pag-container"> + <div class="pag-container" v-if="state.total&&state.total>0"> <el-pagination - v-model:current-page="state.querys.pageNum" - v-model:page-size="state.querys.pageSize" - :page-sizes="[10,15,20,25]" + :page-sizes="[10,15,20]" layout="total, sizes, prev, pager, next, jumper" :total="state.total" + :current-page="state.querys.pageNum" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> @@ -28,11 +27,12 @@ </template> <script setup> -import {onMounted, ref, reactive, watch, onUnmounted, defineExpose} from "vue" +import {onMounted, ref, reactive, watch, onUnmounted, defineExpose, defineEmits} from "vue" import { getNotice } from '@/api/home/homePage' import useUserStore from '@/store/modules/user' import {ElMessage} from "element-plus"; - +import articlePng from "@/assets/images/article.png" +const emit = defineEmits(['openDetails']) const route = useRoute() const router = useRouter() @@ -62,6 +62,7 @@ }, { immediate: true }); const handleSizeChange = (val) => { + state.querys.pageNum = 1 state.querys.pageSize = val getData() } @@ -80,6 +81,10 @@ } } +const openDetails = (type,id)=>{ + emit('openDetails',type,id) +} + defineExpose({ getData }) @@ -91,11 +96,11 @@ width: 100%; display: flex; justify-content: center; - margin-top: 170px; + margin-top: 150px; .main-content{ width: 1200px; - margin: 20px 0; + margin: 15px 0; background: #fff; border-radius: 4px; box-shadow: 1px 1px 3px rgba(0,0,0,.04); @@ -104,7 +109,7 @@ .list{ padding: 15px 0; - max-height: calc(100vh - 350px); + height: calc(100vh - 280px); overflow-y: auto; &>div{ @@ -135,7 +140,7 @@ } } div:last-of-type{ - width: 1000px; + width: 900px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -157,7 +162,7 @@ .pag-container{ width: 100%; - height: 80px; + height: 60px; display: flex; align-items: center; justify-content: right; -- Gitblit v1.9.2