fix: bug修复

This commit is contained in:
kaizheng(郑凯) 2025-02-19 21:26:50 +08:00
parent 85e9de2ca5
commit d53555fe06
3 changed files with 26 additions and 14 deletions

View File

@ -11,9 +11,9 @@
<img
v-if="item.userType === 1"
:src="item.advisor ? item.advisor.avatar : defaultAvatar.teacher"
>
<img v-else-if="item.userType === 3" :src="defaultAvatar.assistant">
<img v-else-if="item.userType === 2" :src="defaultAvatar.student">
/>
<img v-else-if="item.userType === 3" :src="defaultAvatar.assistant" />
<img v-else-if="item.userType === 2" :src="defaultAvatar.student" />
<div class="news-info">
<div class="news-info-top">
<div class="news-user">
@ -21,9 +21,13 @@
<label
v-if="[1, 3].includes(item.userType)"
:class="[item.userType === 1 ? 'blue' : 'orange']"
>{{ item.userType === 1 ? "老师" : "助教" }}</label>
>{{ item.userType === 1 ? "老师" : "助教" }}</label
>
<div v-if="item.userType !== 2">
<span><i v-if="item.readCount">{{ item.readCount }}</i><i v-if="item.totalCount">{{ item.totalCount }}</i></span>
<span
><i v-if="item.readCount">{{ item.readCount }}</i
><i v-if="item.totalCount">{{ item.totalCount }}</i></span
>
<span>已读</span>
</div>
</div>
@ -32,19 +36,22 @@
v-if="type !== 5"
type="success"
@click="setMessageRecommend(item)"
>{{
item.isRecommend === 1 ? "取消精选" : "设为精选"
}}</el-link>
>{{
item.isRecommend === 1 ? "取消精选" : "设为精选"
}}</el-link
>
<el-link
v-if="item.userType === 2 && type !== 5"
type="success"
@click="setReplyMsg(item)"
>引用</el-link>
>引用</el-link
>
<el-link
v-if="item.userType === 2 && item.status === 1"
type="success"
@click="updateMessageStatus(item)"
>通过审核</el-link>
>通过审核</el-link
>
</div>
</div>
<p>{{ item.createTime }}</p>
@ -52,7 +59,7 @@
</div>
<div class="new-content">
<p v-if="item.contentType === 1">{{ item.content }}</p>
<img v-else :src="item.content" alt="">
<img v-else :src="item.content" alt="" />
</div>
</li>
</ul>
@ -119,7 +126,7 @@ export default {
Object.assign(this.msgIdsObj[msg.id], msg);
} else if (
this.type === 1 ||
(this.type === 2 && msg.userType === 1) ||
(this.type === 2 && msg.userType !== 2) ||
(this.type === 4 && msg.isRecommend === 1)
) {
// this.type === 4 && msg.isRecommend === 1

View File

@ -120,6 +120,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSearch">搜索</el-button>
<el-button type="success" @click="onRefresh">刷新</el-button>
</el-form-item>
</el-form>
</div>
@ -380,6 +381,10 @@ export default {
onSearch() {
this.$refs[`newsListRef${this.msgType}`][0].searchMsg(this.msgKeyWord);
},
onRefresh() {
this.msgKeyWord = "";
this.onSearch();
},
handleGroupChatTopic(msg) {
console.log("handleGroupChatTopic", msg);
const body = JSON.parse(msg.body);

View File

@ -22,8 +22,8 @@ export default {
process.env.NODE_ENV === "development"
? "ws://8.138.144.54:8080/tgim/chat"
: `${location.protocol === "http:" ? "ws://" : "wss://"}${
location.host
}/tgim/chat`;
location.host
}/tgim/chat`;
// 后端群组消息
const groupChatTopic = `/admin/group/topic/${id}`;
// 私聊消息