fix: bug修复
This commit is contained in:
parent
25f4bc6923
commit
03e84eab94
@ -15,7 +15,7 @@ const props = defineProps({
|
||||
},
|
||||
createdAt: {
|
||||
type: String,
|
||||
required: false
|
||||
required: false
|
||||
},
|
||||
modalTitle: {
|
||||
type: String,
|
||||
@ -50,13 +50,12 @@ const dropdown=ref({
|
||||
options:[] as any,
|
||||
item:{} as ITalkRecord,
|
||||
})
|
||||
const onConvertText =async (data: ITalkRecord) => {
|
||||
const onConvertText = async (data: ITalkRecord) => {
|
||||
data.is_convert_text = 1
|
||||
const res = await voiceToText({msgId:data.msg_id,voiceUrl:data.extra.url})
|
||||
if(res.code == 200){
|
||||
const res = await voiceToText({ msgId: data.msg_id, voiceUrl: data.extra.url })
|
||||
if (res.code == 200) {
|
||||
data.extra.content = res.data.convText
|
||||
|
||||
}
|
||||
}else data.is_convert_text = 0
|
||||
}
|
||||
const onloseConvertText=(data: ITalkRecord)=>{
|
||||
data.is_convert_text = 0
|
||||
@ -87,7 +86,7 @@ const onContextMenu = (e:any,item: ITalkRecord) => {
|
||||
}else{
|
||||
dropdown.value.options=[{ label: '转文字', key: 'convertText' }]
|
||||
}
|
||||
|
||||
|
||||
dropdown.value.item=item
|
||||
}
|
||||
</script>
|
||||
@ -96,29 +95,29 @@ const onContextMenu = (e:any,item: ITalkRecord) => {
|
||||
<customModal :closable="false" customCloseBtn v-model:show="isShow" :title="title" style="width: 997px;background-color: #F9F9FD;" :on-after-leave="onMaskClick">
|
||||
<template #content>
|
||||
<div class="main-box bg-#fff me-scrollbar me-scrollbar-thumb">
|
||||
<Loading v-if="items.length === 0" />
|
||||
<Loading v-if="items.length === 0" />
|
||||
|
||||
<div v-for="item in items" :key="item.msg_id" class="message-item">
|
||||
<div class="left-box pointer" @click="showUserInfoModal(item.erp_user_id)">
|
||||
<im-avatar :src="item.avatar" :size="38" :username="item.nickname" />
|
||||
</div>
|
||||
|
||||
<div class="right-box">
|
||||
<div class="msg-header">
|
||||
<span class="name">{{ item.nickname }}</span>
|
||||
<span class="time"> {{ item.created_at }}</span>
|
||||
<div v-for="item in items" :key="item.msg_id" class="message-item">
|
||||
<div class="left-box pointer" @click="showUserInfoModal(item.erp_user_id)">
|
||||
<im-avatar :src="item.avatar" :size="38" :username="item.nickname" />
|
||||
</div>
|
||||
|
||||
<component
|
||||
<div class="right-box">
|
||||
<div class="msg-header">
|
||||
<span class="name">{{ item.nickname }}</span>
|
||||
<span class="time"> {{ item.created_at }}</span>
|
||||
</div>
|
||||
|
||||
<component
|
||||
@contextmenu.prevent="onContextMenu($event,item)"
|
||||
:is="MessageComponents[item.msg_type] || 'unknown-message'"
|
||||
:extra="item.extra"
|
||||
:data="item"
|
||||
/>
|
||||
:is="MessageComponents[item.msg_type] || 'unknown-message'"
|
||||
:extra="item.extra"
|
||||
:data="item"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右键菜单 -->
|
||||
<!-- 右键菜单 -->
|
||||
<n-dropdown :show="dropdown.show" :x="dropdown.x" :y="dropdown.y" style="width: 142px;" :options="dropdown.options"
|
||||
@select="onContextMenuHandle" @clickoutside="closeDropdownMenu" />
|
||||
</template>
|
||||
|
@ -246,10 +246,10 @@ class Talk extends Base {
|
||||
updated_at: parseTime(new Date())
|
||||
})
|
||||
|
||||
if (this.talk_type == 1 && this.getAccountId() !== this.sender_id) {
|
||||
if (this.getAccountId() !== this.sender_id) {
|
||||
ServeClearTalkUnreadNum({
|
||||
talk_type: 1,
|
||||
receiver_id: this.sender_id
|
||||
talk_type: this.talk_type,
|
||||
receiver_id: this.talk_type == 1 ? this.sender_id : this.receiver_id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -77,11 +77,11 @@ export function useSessionMenu() {
|
||||
// key: 'delete_contact'
|
||||
// })
|
||||
} else {
|
||||
options.push({
|
||||
// options.push({
|
||||
|
||||
label: '退出群聊',
|
||||
key: 'signout_group'
|
||||
})
|
||||
// label: '退出群聊',
|
||||
// key: 'signout_group'
|
||||
// })
|
||||
}
|
||||
|
||||
dropdown.options = [...options]
|
||||
|
@ -150,7 +150,7 @@ export const useUploadsStore = defineStore('uploads', {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("初始化分片上传失败:", error);
|
||||
message.error("初始化上传失败,请重试")
|
||||
message.error("上传失败,请重试")
|
||||
this.handleUploadError(upload_id, clientUploadId)
|
||||
}
|
||||
},
|
||||
|
@ -325,7 +325,7 @@ const onConvertText = async (data: ITalkRecord) => {
|
||||
const res = await voiceToText({ msgId: data.msg_id, voiceUrl: data.extra.url })
|
||||
if (res.code == 200) {
|
||||
data.extra.content = res.data.convText
|
||||
}
|
||||
} else data.is_convert_text = 0
|
||||
}
|
||||
const onloseConvertText = (data: ITalkRecord) => {
|
||||
data.is_convert_text = 0
|
||||
@ -354,6 +354,10 @@ const onRowClick = (item: ITalkRecord) => {
|
||||
if (!isOneMonthBefore(item.created_at.split(' ')[0])) {
|
||||
return useMessage.info('只支持转发近一个月内的消息')
|
||||
}
|
||||
// 语音消息和群公告不支持转发
|
||||
if ([4, 13].includes(item.msg_type)) {
|
||||
return useMessage.info('语音消息和群公告不支持转发')
|
||||
}
|
||||
console.log('item.msg_type', item.msg_type)
|
||||
if (ForwardableMessageType.includes(item.msg_type)) {
|
||||
item.isCheck = !item.isCheck
|
||||
@ -435,12 +439,15 @@ const retry = (item: any) => {
|
||||
confirmBox({
|
||||
content: '确定重发吗'
|
||||
}).then(() => {
|
||||
item.extra.percentage = 0
|
||||
uploadsStore.retryCommonUpload(item.extra.upload_id)
|
||||
})
|
||||
}
|
||||
|
||||
const onContextMenuAvatar = (e: any, item: any) => {
|
||||
e.preventDefault()
|
||||
// 单聊不需要@
|
||||
if (+props.talk_type === 1) return
|
||||
if (item.float !== 'right') {
|
||||
bus.emit(EditorConst.Mention, {
|
||||
id: item.user_id,
|
||||
@ -940,7 +947,13 @@ const onCustomSkipBottomEvent = () => {
|
||||
</div>
|
||||
|
||||
<!-- 已读回执 -->
|
||||
<div class="talk_read_num" v-if="item.user_id === props.uid">
|
||||
<!-- item.user_id:发送这条消息的人id -->
|
||||
<!-- props.uid:当前登录人id -->
|
||||
<!-- props.receiver_id:当前消息要发送的人id -->
|
||||
<div
|
||||
class="talk_read_num"
|
||||
v-if="item.user_id === props.uid && props.uid !== props.receiver_id"
|
||||
>
|
||||
<span v-if="props.talk_type === 1">{{
|
||||
item.read_total_num > 0 ? '已读' : '未读'
|
||||
}}</span>
|
||||
|
@ -71,11 +71,14 @@ export function useMenu() {
|
||||
dropdown.options.push({ label: '复制', key: 'copy' })
|
||||
}
|
||||
|
||||
if (isOneMonthBefore(new Date(item.created_at.split(' ')[0]))) {
|
||||
// 根据时间判断只有近一个月内的消息才能支持多选
|
||||
if (isOneMonthBefore(new Date(item.created_at.split(' ')[0])) && ![4,13].includes(item.msg_type)) {
|
||||
// 根据时间判断只有近一个月内的消息才能支持多选 // 语音消息和群公告不支持转发
|
||||
dropdown.options.push({ label: '多选', key: 'multiSelect' })
|
||||
}
|
||||
dropdown.options.push({ label: '引用', key: 'quote' })
|
||||
if (isOneMonthBefore(new Date(item.created_at.split(' ')[0]))) {
|
||||
// 根据时间判断只有近一个月内的消息才能支持引用
|
||||
dropdown.options.push({ label: '引用', key: 'quote' })
|
||||
}
|
||||
if (canAddRevokeOption(uid, item, (dialogueStore.groupInfo as any).is_manager)) {
|
||||
dropdown.options.push({ label: '撤回', key: 'revoke' });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user