Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
gzydong committed Aug 10, 2021
1 parent 3b47edf commit ce8d675
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/components/chat/TalkSearchRecord.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,10 @@
<el-container class="full-height">
<el-header height="40px" class="type-items">
<span
:class="{ active: query.msg_type == 0 }"
@click="triggerLoadType(0)"
>全部
</span>
<span
:class="{ active: query.msg_type == 2 }"
@click="triggerLoadType(2)"
>文件
</span>
<span
:class="{ active: query.msg_type == 3 }"
@click="triggerLoadType(3)"
>会话记录
</span>
<span
:class="{ active: query.msg_type == 4 }"
@click="triggerLoadType(4)"
>代码块
v-for="tab in tabType"
:class="{ active: query.msg_type == tab.type }"
@click="triggerLoadType(tab.type)"
>{{ tab.name }}
</span>
</el-header>

Expand Down Expand Up @@ -197,6 +183,13 @@
:lang="record.code_block.code_lang"
/>

<!-- 投票消息 -->
<vote-message
v-else-if="record.msg_type == 5"
:record_id="record.id"
:vote="record.vote"
/>

<div v-else class="other-message">未知消息类型</div>
</div>
</div>
Expand Down Expand Up @@ -269,6 +262,14 @@ export default {
showBox: 0,
tabType: [
{ name: '全部', type: 0 },
{ name: '文件', type: 2 },
{ name: '会话记录', type: 3 },
{ name: '代码块', type: 4 },
{ name: '群投票', type: 5 },
],
search: {
keyword: '', // 关键字查询
date: '', // 时间查询
Expand Down
1 change: 1 addition & 0 deletions src/components/chat/panel/TalkPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
@contextmenu.native="onCopy(idx, item, $event)"
/>

<!-- 投票消息 -->
<vote-message
v-else-if="item.msg_type == 5"
:record_id="item.id"
Expand Down
8 changes: 8 additions & 0 deletions src/components/note/NoteTagBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ export default {
}
})
} else {
if (this.ids.length >= 5) {
this.$notify.info({
title: '消息',
message: '最多只能选择5个标签!',
})
return
}
this.ids.push(tag_id)
}
Expand Down

0 comments on commit ce8d675

Please sign in to comment.