|
|
@@ -2,7 +2,7 @@
|
|
|
<xn-form-container title="详情" :width="700" :visible="visible" :destroy-on-close="true" @close="onClose">
|
|
|
<a-descriptions :column="1" size="middle" bordered class="mb-2">
|
|
|
<a-descriptions-item label="主题">{{ formData.subject }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="发送时间">{{ formData.createTime }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="发送时间">{{ formatDateTime(formData.createTime) }}</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
|
<a-form ref="formRef" :model="formData" layout="vertical">
|
|
|
<a-form-item label="内容:" name="content">
|
|
|
@@ -17,7 +17,7 @@
|
|
|
:showPagination="false"
|
|
|
bordered
|
|
|
:row-key="(record) => record.id"
|
|
|
- :scroll="{x:'auto'}"
|
|
|
+ :scroll="{ x: 'auto' }"
|
|
|
>
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.dataIndex === 'read'">
|
|
|
@@ -33,9 +33,15 @@
|
|
|
|
|
|
<script setup name="inSiteMessageDetail">
|
|
|
import userCenterApi from '@/api/sys/userCenterApi'
|
|
|
+ import classCentre from '@/api/student/classCentre'
|
|
|
import EventBus from '@/utils/EventBus'
|
|
|
const emits = defineEmits(['refresh'])
|
|
|
const receiveInfoList = ref([])
|
|
|
+ import { parseTime } from '@/utils/exam'
|
|
|
+ function formatDateTime(val) {
|
|
|
+ if (!val) return ''
|
|
|
+ return parseTime(val, '{y}-{m}-{d} {h}:{i}:{s}')
|
|
|
+ }
|
|
|
|
|
|
// 默认是关闭状态
|
|
|
let visible = $ref(false)
|
|
|
@@ -65,10 +71,12 @@
|
|
|
id: record.id
|
|
|
}
|
|
|
userCenterApi.userLoginUnreadMessageDetail(param).then((data) => {
|
|
|
- Object.assign(record, data)
|
|
|
- formData.value = record
|
|
|
+ formData.value = Object.assign(record, data)
|
|
|
receiveInfoList.value = data.receiveInfoList
|
|
|
table.value.refresh(true)
|
|
|
+ if (!formData.value.read) {
|
|
|
+ addRead()
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
const loadData = () => {
|
|
|
@@ -76,6 +84,9 @@
|
|
|
resolve(receiveInfoList.value)
|
|
|
})
|
|
|
}
|
|
|
+ const addRead = () => {
|
|
|
+ classCentre.readAdd({ funcType: 2, mainId: formData.value.id })
|
|
|
+ }
|
|
|
// 关闭抽屉
|
|
|
const onClose = () => {
|
|
|
receiveInfoList.value = []
|