From ee2882cff02d3545b66c7591f88ed4800f730a9a Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 21 五月 2025 10:00:17 +0800 Subject: [PATCH] 消息通知数据自动筛选 --- src/components/view/notice-detail.vue | 58 +++++++++++++++++++++++++++++++++------------------------- 1 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/components/view/notice-detail.vue b/src/components/view/notice-detail.vue index 0c67cb0..9a79989 100644 --- a/src/components/view/notice-detail.vue +++ b/src/components/view/notice-detail.vue @@ -1,8 +1,11 @@ <template> <div class="notice-detail-page"> <div class="notice-detail-head"> - <h4 style="margin-bottom: 16px;">{{ noticeInfo.theme }} <el-tag style="margin-left: 10px;" :type="options.find(m=>m.value==noticeInfo.messageType).type" v-if="options.find(m=>m.value==noticeInfo.messageType)">{{ options.find(m=>m.value==noticeInfo.messageType).label }}</el-tag></h4> - <p style="font-size: 12px;color: #999;margin-bottom: 20px;"> + <h4 style="margin-bottom: 16px;text-align:left;" v-if="noticeInfo.theme">{{ noticeInfo.theme }} <el-tag + style="margin-left: 10px;" :type="options.find(m => m.value == noticeInfo.messageType).type" + v-if="options.find(m => m.value == noticeInfo.messageType)">{{ + options.find(m => m.value == noticeInfo.messageType).label }}</el-tag></h4> + <p style="font-size: 12px;color: #999;margin-bottom: 20px;text-align:left;"> <!-- <span>娑堟伅绫诲瀷锛氬鎵� </span> --> <span>鍙戦�佷汉锛歿{ noticeInfo.createUser }} </span> <span> </span> @@ -10,14 +13,15 @@ <span> </span> <span>鍙戜欢鏃堕棿锛歿{ noticeInfo.createTime }}</span> </p> - <div class="notice-detail-head-content"> + <div class="notice-detail-head-content" style="text-align:left;"> <label>鍐呭锛�</label> <div>{{ noticeInfo.content }}</div> </div> </div> <div class="info-box" v-if="noticeInfo.jumpPath"> - <component class="notice-content" :is="noticeInfo.jumpPath"> - </component> + <component class="notice-content" :is="noticeInfo.jumpPath" :entrustCodeNew="noticeInfo.entrustCode" + :laboratoryNew="noticeInfo.laboratory"> + </component> </div> </div> </template> @@ -36,24 +40,20 @@ export default { components: comObj, data() { - return{ - noticeInfo:{}, - options:[] + return { + noticeInfo: {}, + options: [] } }, - created(){ - this.noticeInfo = JSON.parse(sessionStorage.getItem("noticeInfo")); - }, - mounted(){ - this.noticeInfo = JSON.parse(sessionStorage.getItem("noticeInfo")); + mounted() { + this.noticeInfo = JSON.parse(localStorage.getItem("noticeInfo")); this.$bus.$on("change", (msg) => { this.noticeInfo = JSON.parse(msg); - console.log(this.noticeInfo); - sessionStorage.setItem("noticeInfo", msg); + localStorage.setItem("noticeInfo", msg); }); this.getTypeDicts() }, - methods:{ + methods: { getTypeDicts() { this.$axios.post(this.$api.enums.selectEnumByCategory, { category: "娑堟伅绫诲瀷" @@ -67,27 +67,35 @@ </script> <style scoped> -.notice-detail-page{ +.notice-detail-page { height: calc(100% - 30px); + overflow-y: auto; padding: 16px 0; } -.notice-detail-head{ + +.notice-detail-page::-webkit-scrollbar { + width: 0; +} + +.notice-detail-head { background: #fff; border-radius: 3px; box-sizing: border-box; padding: 16px; } -.info-box{ + +.info-box { margin-top: 16px; width: 100%; box-sizing: border-box; padding: 8px 20px 20px; - background: rgba(0,0,0, 0.03); - box-shadow: 0 0 10px 10px #fff; + background: rgba(0, 0, 0, 0.03); + /* box-shadow: 0 0 10px 10px #fff; */ border-radius: 4px; - height: calc(100% - 192px - 22px); + min-height: calc(100% - 192px - 22px); } -.notice-detail-head-content div{ + +.notice-detail-head-content div { border-radius: 8px; border: 1px solid #ccc; min-height: 60px; @@ -97,7 +105,7 @@ margin-top: 12px; } -.notice-content{ - height: 100%; +.notice-content { + height: 600px; } </style> -- Gitblit v1.9.3