邓洁 : 修改右上角铃铛通知详情弹窗
This commit is contained in:
@@ -29,15 +29,29 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
<el-dialog width="1200px" title="通知公告详情" v-model="visible" @close="visible=false">
|
||||
<el-form :model="viewForm" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24" class="title-block">
|
||||
<el-text class="title">{{ viewForm.noticeTitle }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-text v-if="viewForm.contentType == 'text'">{{ viewForm.noticeContent }}</el-text>
|
||||
<span v-else v-html="viewForm.noticeContent"></span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getNotifyList,readAllNotify, readSingleNotify} from "@/api/notice/notify";
|
||||
import {getNotifyList,getNotifyDetail, readAllNotify, readSingleNotify} from "@/api/notice/notify";
|
||||
import {getToken} from '@/utils/auth'
|
||||
import {ElMessage} from "element-plus";
|
||||
import {useRouter} from "vue-router";
|
||||
import {defineExpose} from "vue";
|
||||
// import {defineExpose} from "vue";
|
||||
|
||||
const router = useRouter()
|
||||
const pageInfo = reactive({
|
||||
pageNum: 1,
|
||||
@@ -46,10 +60,18 @@ const pageInfo = reactive({
|
||||
let send = {
|
||||
type: "ping"
|
||||
}
|
||||
|
||||
const viewForm = ref();
|
||||
const visible = ref(false);
|
||||
const showNotify = ref(false);
|
||||
const total = ref();
|
||||
const noticeList = ref();
|
||||
//查看详情
|
||||
const handleViewDetails = (noticeId) => {
|
||||
getNotifyDetail(noticeId).then(res => {
|
||||
visible.value = true
|
||||
viewForm.value = res.data
|
||||
})
|
||||
}
|
||||
const initWebSocket = () => {
|
||||
const socket = new WebSocket(import.meta.env.VITE_BASE_WSURL + '/notice-ws/notice')
|
||||
// 2. ws.send()给服务器发送信息
|
||||
@@ -105,10 +127,15 @@ const searchNotifyList = () => {
|
||||
searchNotifyList()
|
||||
|
||||
//点击名字跳转到详情页
|
||||
const handleToNotifyDetail = (notice,index) => {
|
||||
noticeList.value.splice(index,1)
|
||||
total.value-=1
|
||||
router.push({path: `/system/notice/inform/index/${notice.noticeId}`})
|
||||
const handleToNotifyDetail = (notice, index) => {
|
||||
noticeList.value.splice(index, 1)
|
||||
total.value -= 1
|
||||
viewForm.value={
|
||||
noticeTitle:'',
|
||||
noticeContent:''
|
||||
}
|
||||
// router.push({path: `/system/notice/inform/index/${notice.noticeId}`})
|
||||
handleViewDetails(notice.noticeId)
|
||||
}
|
||||
|
||||
//单个已读
|
||||
@@ -167,6 +194,15 @@ const handleNext = () => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title-block {
|
||||
text-align: center;
|
||||
padding-bottom: 30px;
|
||||
|
||||
.title {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
ul::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,15 @@ const tagPath = ref()
|
||||
watch(route, () => {
|
||||
init()
|
||||
})
|
||||
onMounted(() => {
|
||||
document.addEventListener('click', nullBlockClick)
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
document.removeEventListener('click', nullBlockClick)
|
||||
})
|
||||
const nullBlockClick = () => {
|
||||
visible.value = false
|
||||
}
|
||||
const init = () => {
|
||||
tagsViewStore.addVisitedViews(route)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user