添加消息类型枚举和相关字段,优化消息记录服务的添加方法,更新多个组件以支持新增分类对话框
This commit is contained in:
@@ -49,7 +49,9 @@
|
||||
height="50%"
|
||||
:closeable="true"
|
||||
>
|
||||
<div class="detail-content">
|
||||
<div v-if="currentMessage.messageType === 2" class="detail-content" v-html="currentMessage.content">
|
||||
</div>
|
||||
<div v-else class="detail-content">
|
||||
{{ currentMessage.content }}
|
||||
</div>
|
||||
</PopupContainer>
|
||||
@@ -126,9 +128,6 @@ const onRefresh = () => {
|
||||
};
|
||||
|
||||
const viewDetail = async (item) => {
|
||||
currentMessage.value = item;
|
||||
detailVisible.value = true;
|
||||
|
||||
if (!item.isRead) {
|
||||
try {
|
||||
await markAsRead(item.id);
|
||||
@@ -138,6 +137,18 @@ const viewDetail = async (item) => {
|
||||
console.error('标记已读失败', error);
|
||||
}
|
||||
}
|
||||
|
||||
if (item.messageType === 1) {
|
||||
if (item.content.startsWith('http')) {
|
||||
window.open(item.content, '_blank');
|
||||
} else {
|
||||
showToast('无效的URL');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
currentMessage.value = item;
|
||||
detailVisible.value = true;
|
||||
};
|
||||
|
||||
const handleDelete = (item) => {
|
||||
|
||||
Reference in New Issue
Block a user