优化通知公告气泡框显示,SignalR接受消息格式修改

This commit is contained in:
YUN-PC5\user 2023-10-20 17:12:17 +08:00
parent 3550f07731
commit 7297634be5
4 changed files with 19 additions and 13 deletions

View File

@ -21,11 +21,11 @@
<el-icon :size="30" color="#409EFF"><bell /></el-icon>
<div class="content">
<div class="title">{{ item.noticeTitle }}</div>
<div class="content-box-time">{{ formatDate(item.create_time) }}</div>
<el-text class="content-box-time" type="info">{{ formatDate(item.create_time) }}</el-text>
</div>
</div>
</template>
<el-empty v-if="unreadNoticeList.length <= 0" :image-size="60" description="暂无通知公告"></el-empty></div
<el-empty v-if="unreadNoticeList.length <= 0" :image-size="60" description="暂无未读通知公告"></el-empty></div
></el-tab-pane>
<el-tab-pane name="aimMsg">
<template #label>
@ -37,11 +37,11 @@
<el-icon :size="30" color="#409EFF"><bell /></el-icon>
<div class="content">
<div class="title">{{ item.noticeTitle }}</div>
<div class="content-box-time">{{ formatDate(item.create_time) }}</div>
<el-text class="content-box-time" type="info">{{ formatDate(item.create_time) }}</el-text>
</div>
</div>
</template>
<el-empty v-if="unreadAimList.length <= 0" :image-size="60" description="暂无业务信息"></el-empty>
<el-empty v-if="unreadAimList.length <= 0" :image-size="60" description="暂无未读业务信息"></el-empty>
</div>
</el-tab-pane>
</el-tabs>
@ -194,7 +194,7 @@ const formatDate = (dateTime) => {
}
.content {
margin-left: 8px;
width: 100%;
.name {
color: var(--el-color-primary);
}
@ -206,6 +206,8 @@ const formatDate = (dateTime) => {
}
.content-box-time {
margin-top: 3px;
text-align: right;
display: block;
}
}
.content-box-empty {

View File

@ -22,11 +22,11 @@ export default {
webNotify({ title: title, body: data })
})
// 接受系统通知/公告
connection.on(MsgType.M004, (data1, data2) => {
// if (data.code == 200) {
useSocketStore().setUnreadNoticeList(data1)
useSocketStore().setReadNoticeList(data2)
// }
connection.on(MsgType.M004, (data) => {
if (data.code == 200) {
useSocketStore().setUnreadNoticeList(data.data.unReadNotifications)
useSocketStore().setReadNoticeList(data.data.readNotifications)
}
})
// 接受聊天数据
connection.on(MsgType.M005, (data) => {
@ -49,7 +49,7 @@ export default {
connection.invoke('AllReadNotice')
},
ReadNotice(connection, noticeId) {
connection.invoke('ReadNotice', noticeId)
connection.invoke('ReadNotice', noticeId.toString())
}
}
const MsgType = {

View File

@ -5,7 +5,7 @@
<template #content></template>
</el-page-header>
<el-divider />
<el-table v-loading="loading" :data="ipRateLimitLogList" border>
<el-table v-loading="loading" :data="ipRateLimitLogList" height="600" border>
<el-table-column label="请求方式" prop="httpVerb" width="90" show-overflow-tooltip />
<el-table-column label="路径" prop="path" width="250" show-overflow-tooltip />
<el-table-column label="客户端IP" prop="clientIp" show-overflow-tooltip />

View File

@ -102,7 +102,7 @@
</el-form>
<template #footer>
<el-button text @click="cancel">{{ $t('btn.cancel') }}</el-button>
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
<el-button type="primary" @click="submitForm" :loading="submitBtnLoading">{{ $t('btn.submit') }}</el-button>
</template>
</el-dialog>
</div>
@ -125,6 +125,7 @@ const multiple = ref(true)
const total = ref(0)
const title = ref('')
const noticeRef = ref()
const submitBtnLoading = ref(false)
const data = reactive({
form: {},
@ -195,6 +196,7 @@ function handleSelectionChange(selection) {
/** 新增按钮操作 */
function handleAdd() {
reset()
submitBtnLoading.value = false
open.value = true
title.value = '添加公告'
}
@ -204,6 +206,7 @@ function handleUpdate(row) {
const noticeId = row.noticeId || ids.value
getNotice(noticeId).then((response) => {
form.value = response.data
submitBtnLoading.value = false
open.value = true
title.value = '修改公告'
})
@ -212,6 +215,7 @@ function handleUpdate(row) {
function submitForm() {
proxy.$refs['noticeRef'].validate((valid) => {
if (valid) {
submitBtnLoading.value = true
if (form.value.noticeId != undefined) {
updateNotice(form.value).then((response) => {
proxy.$modal.msgSuccess('修改成功')