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 <img
v-if="item.userType === 1" v-if="item.userType === 1"
:src="item.advisor ? item.advisor.avatar : defaultAvatar.teacher" :src="item.advisor ? item.advisor.avatar : defaultAvatar.teacher"
> />
<img v-else-if="item.userType === 3" :src="defaultAvatar.assistant"> <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 === 2" :src="defaultAvatar.student" />
<div class="news-info"> <div class="news-info">
<div class="news-info-top"> <div class="news-info-top">
<div class="news-user"> <div class="news-user">
@ -21,9 +21,13 @@
<label <label
v-if="[1, 3].includes(item.userType)" v-if="[1, 3].includes(item.userType)"
:class="[item.userType === 1 ? 'blue' : 'orange']" :class="[item.userType === 1 ? 'blue' : 'orange']"
>{{ item.userType === 1 ? "老师" : "助教" }}</label> >{{ item.userType === 1 ? "老师" : "助教" }}</label
>
<div v-if="item.userType !== 2"> <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> <span>已读</span>
</div> </div>
</div> </div>
@ -34,17 +38,20 @@
@click="setMessageRecommend(item)" @click="setMessageRecommend(item)"
>{{ >{{
item.isRecommend === 1 ? "取消精选" : "设为精选" item.isRecommend === 1 ? "取消精选" : "设为精选"
}}</el-link> }}</el-link
>
<el-link <el-link
v-if="item.userType === 2 && type !== 5" v-if="item.userType === 2 && type !== 5"
type="success" type="success"
@click="setReplyMsg(item)" @click="setReplyMsg(item)"
>引用</el-link> >引用</el-link
>
<el-link <el-link
v-if="item.userType === 2 && item.status === 1" v-if="item.userType === 2 && item.status === 1"
type="success" type="success"
@click="updateMessageStatus(item)" @click="updateMessageStatus(item)"
>通过审核</el-link> >通过审核</el-link
>
</div> </div>
</div> </div>
<p>{{ item.createTime }}</p> <p>{{ item.createTime }}</p>
@ -52,7 +59,7 @@
</div> </div>
<div class="new-content"> <div class="new-content">
<p v-if="item.contentType === 1">{{ item.content }}</p> <p v-if="item.contentType === 1">{{ item.content }}</p>
<img v-else :src="item.content" alt=""> <img v-else :src="item.content" alt="" />
</div> </div>
</li> </li>
</ul> </ul>
@ -119,7 +126,7 @@ export default {
Object.assign(this.msgIdsObj[msg.id], msg); Object.assign(this.msgIdsObj[msg.id], msg);
} else if ( } else if (
this.type === 1 || 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)
) { ) {
// 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-form-item> <el-form-item>
<el-button type="primary" @click="onSearch">搜索</el-button> <el-button type="primary" @click="onSearch">搜索</el-button>
<el-button type="success" @click="onRefresh">刷新</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -380,6 +381,10 @@ export default {
onSearch() { onSearch() {
this.$refs[`newsListRef${this.msgType}`][0].searchMsg(this.msgKeyWord); this.$refs[`newsListRef${this.msgType}`][0].searchMsg(this.msgKeyWord);
}, },
onRefresh() {
this.msgKeyWord = "";
this.onSearch();
},
handleGroupChatTopic(msg) { handleGroupChatTopic(msg) {
console.log("handleGroupChatTopic", msg); console.log("handleGroupChatTopic", msg);
const body = JSON.parse(msg.body); const body = JSON.parse(msg.body);