Compare commits
7 Commits
747653f54a
...
3fe60616a5
Author | SHA1 | Date | |
---|---|---|---|
3fe60616a5 | |||
98e3a0710a | |||
|
e6075849fe | ||
|
c7343a012a | ||
|
2d28872a12 | ||
|
659c2c3e12 | ||
|
be047f30c1 |
3
components.d.ts
vendored
3
components.d.ts
vendored
@ -30,12 +30,11 @@ declare module 'vue' {
|
|||||||
LoginMessage: typeof import('./src/components/talk/message/LoginMessage.vue')['default']
|
LoginMessage: typeof import('./src/components/talk/message/LoginMessage.vue')['default']
|
||||||
Message: typeof import('./src/components/x-message/message/index.vue')['default']
|
Message: typeof import('./src/components/x-message/message/index.vue')['default']
|
||||||
MixedMessage: typeof import('./src/components/talk/message/MixedMessage.vue')['default']
|
MixedMessage: typeof import('./src/components/talk/message/MixedMessage.vue')['default']
|
||||||
NButton: typeof import('naive-ui')['NButton']
|
|
||||||
NIcon: typeof import('naive-ui')['NIcon']
|
|
||||||
PageAnimation: typeof import('./src/components/page-animation/index.vue')['default']
|
PageAnimation: typeof import('./src/components/page-animation/index.vue')['default']
|
||||||
RevokeMessage: typeof import('./src/components/talk/message/RevokeMessage.vue')['default']
|
RevokeMessage: typeof import('./src/components/talk/message/RevokeMessage.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
|
SysGroupAdminMessage: typeof import('./src/components/talk/message/system/SysGroupAdminMessage.vue')['default']
|
||||||
SysGroupCancelMutedMessage: typeof import('./src/components/talk/message/system/SysGroupCancelMutedMessage.vue')['default']
|
SysGroupCancelMutedMessage: typeof import('./src/components/talk/message/system/SysGroupCancelMutedMessage.vue')['default']
|
||||||
SysGroupCreateMessage: typeof import('./src/components/talk/message/system/SysGroupCreateMessage.vue')['default']
|
SysGroupCreateMessage: typeof import('./src/components/talk/message/system/SysGroupCreateMessage.vue')['default']
|
||||||
SysGroupJoinMessage: typeof import('./src/components/talk/message/system/SysGroupJoinMessage.vue')['default']
|
SysGroupJoinMessage: typeof import('./src/components/talk/message/system/SysGroupJoinMessage.vue')['default']
|
||||||
|
@ -179,3 +179,11 @@ export const uploadImg = (data,onProgressFn) => {
|
|||||||
onUploadProgress:(progressEvent)=>onProgressFn(progressEvent,data.get('file'))
|
onUploadProgress:(progressEvent)=>onProgressFn(progressEvent,data.get('file'))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 根据msg_id获取消息
|
||||||
|
export const detailGetRecordsContext = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/talk/record/detail',
|
||||||
|
method: 'GET',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -21,13 +21,19 @@ defineProps({
|
|||||||
datetime: {
|
datetime: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
msg_id: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="im-message-revoke">
|
<div class="im-message-revoke">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<span v-if="login_uid == user_id"> 你撤回了一条消息 | {{ formatTime(datetime) }} </span>
|
<span v-if="login_uid == user_id"> 你撤回了一条消息 | {{ formatTime(datetime) }}
|
||||||
|
<slot></slot> <!-- 添加插槽用于放置重新编辑按钮 -->
|
||||||
|
</span>
|
||||||
<span v-else-if="talk_type == 1"> 对方撤回了一条消息 | {{ formatTime(datetime) }} </span>
|
<span v-else-if="talk_type == 1"> 对方撤回了一条消息 | {{ formatTime(datetime) }} </span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
"{{ nickname }}" 撤回了一条消息 |
|
"{{ nickname }}" 撤回了一条消息 |
|
||||||
|
25
src/components/talk/message/system/SysGroupAdminMessage.vue
Normal file
25
src/components/talk/message/system/SysGroupAdminMessage.vue
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<script setup>
|
||||||
|
import './sys-message.less'
|
||||||
|
import { useInject } from '@/hooks'
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
extra: Object,
|
||||||
|
data: Object
|
||||||
|
})
|
||||||
|
|
||||||
|
const { showUserInfoModal } = useInject()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="im-message-sys-text">
|
||||||
|
<div class="sys-text">
|
||||||
|
|
||||||
|
<template v-for="(user, index) in extra.members" :key="index">
|
||||||
|
<a @click="showUserInfoModal(user.user_id)">{{ user.nickname }}</a>
|
||||||
|
<em v-show="index < extra.members.length - 1">、</em>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<span>已成为管理员</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
@ -26,6 +26,7 @@ export const ChatMsgSysGroupMemberMuted = 1109 // 群成员禁言
|
|||||||
export const ChatMsgSysGroupMemberCancelMuted = 1110 // 群成员解除禁言
|
export const ChatMsgSysGroupMemberCancelMuted = 1110 // 群成员解除禁言
|
||||||
export const ChatMsgSysGroupNotice = 1111 // 编辑群公告
|
export const ChatMsgSysGroupNotice = 1111 // 编辑群公告
|
||||||
export const ChatMsgSysGroupTransfer = 1113 // 变更群主
|
export const ChatMsgSysGroupTransfer = 1113 // 变更群主
|
||||||
|
export const ChatMsgSysGroupAdmin = 1114 // 设置管理员
|
||||||
|
|
||||||
export const ChatMsgTypeMapping = {
|
export const ChatMsgTypeMapping = {
|
||||||
[ChatMsgTypeText]: '[文本消息]',
|
[ChatMsgTypeText]: '[文本消息]',
|
||||||
@ -53,7 +54,9 @@ export const ChatMsgTypeMapping = {
|
|||||||
[ChatMsgSysGroupCancelMuted]: '[群解除禁言消息]',
|
[ChatMsgSysGroupCancelMuted]: '[群解除禁言消息]',
|
||||||
[ChatMsgSysGroupMemberMuted]: '[群成员禁言消息]',
|
[ChatMsgSysGroupMemberMuted]: '[群成员禁言消息]',
|
||||||
[ChatMsgSysGroupMemberCancelMuted]: '[群成员解除禁言消息]',
|
[ChatMsgSysGroupMemberCancelMuted]: '[群成员解除禁言消息]',
|
||||||
[ChatMsgSysGroupNotice]: '[群公告]'
|
[ChatMsgSysGroupNotice]: '[群公告]',
|
||||||
|
[ChatMsgSysGroupTransfer]: '[转让群主]',
|
||||||
|
[ChatMsgSysGroupAdmin]: '[设置管理员]'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 消息类型 - 消息组件 映射关系
|
// 消息类型 - 消息组件 映射关系
|
||||||
@ -83,7 +86,8 @@ export const MessageComponents = {
|
|||||||
[ChatMsgSysGroupCancelMuted]: 'sys-group-cancel-muted-message',
|
[ChatMsgSysGroupCancelMuted]: 'sys-group-cancel-muted-message',
|
||||||
[ChatMsgSysGroupMemberMuted]: 'sys-group-member-muted-message',
|
[ChatMsgSysGroupMemberMuted]: 'sys-group-member-muted-message',
|
||||||
[ChatMsgSysGroupMemberCancelMuted]: 'sys-group-member-cancel-muted-message',
|
[ChatMsgSysGroupMemberCancelMuted]: 'sys-group-member-cancel-muted-message',
|
||||||
[ChatMsgSysGroupTransfer]: 'sys-group-transfer-message'
|
[ChatMsgSysGroupTransfer]: 'sys-group-transfer-message',
|
||||||
|
[ChatMsgSysGroupAdmin]:'sys-group-admin-message'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 可转发的消息类型
|
// 可转发的消息类型
|
||||||
|
@ -684,6 +684,8 @@ const confirmSelectMembers = () => {
|
|||||||
resp.then(({ code, data }) => {
|
resp.then(({ code, data }) => {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
|
// console.error(-selectedUserIds.split(',').length)
|
||||||
|
emits('updateSelectedMembersNum', -selectedUserIds.split(',').length)
|
||||||
useDialogueStore().updateGroupMembers()
|
useDialogueStore().updateGroupMembers()
|
||||||
groupStore.ServeGroupDetail()
|
groupStore.ServeGroupDetail()
|
||||||
} else {
|
} else {
|
||||||
|
@ -260,7 +260,9 @@ onLoad(async (options) => {
|
|||||||
console.log(options.groupId)
|
console.log(options.groupId)
|
||||||
state.groupId = Number(options.groupId)
|
state.groupId = Number(options.groupId)
|
||||||
await groupStore.ServeGroupDetail()
|
await groupStore.ServeGroupDetail()
|
||||||
await groupStore.ServeGetGroupNotices()
|
if (dialogueParams.type === 2) {
|
||||||
|
await groupStore.ServeGetGroupNotices()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (options.sessionId) {
|
if (options.sessionId) {
|
||||||
state.sessionId = Number(options.sessionId)
|
state.sessionId = Number(options.sessionId)
|
||||||
|
@ -115,7 +115,7 @@ const state = reactive({
|
|||||||
erpUserId: '', //erp用户id
|
erpUserId: '', //erp用户id
|
||||||
userInfo: null, //用户详情
|
userInfo: null, //用户详情
|
||||||
userBasicInfos: [], //用户基本信息
|
userBasicInfos: [], //用户基本信息
|
||||||
isShowPhoneCall: true, //是否显示电话拨号弹框
|
isShowPhoneCall: false, //是否显示电话拨号弹框
|
||||||
phoneNumber: '', //手机号
|
phoneNumber: '', //手机号
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -24,7 +24,10 @@
|
|||||||
<div class="text-[24rpx] text-[#999999]">公司群</div>
|
<div class="text-[24rpx] text-[#999999]">公司群</div>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<div class="mr-[36rpx] toChatSetting_btn">
|
<div
|
||||||
|
class="mr-[36rpx] toChatSetting_btn"
|
||||||
|
v-if="!talkParams.isDismiss"
|
||||||
|
>
|
||||||
<tm-icon
|
<tm-icon
|
||||||
color="rgb(51, 51, 51)"
|
color="rgb(51, 51, 51)"
|
||||||
:font-size="36"
|
:font-size="36"
|
||||||
@ -68,7 +71,21 @@
|
|||||||
:nickname="item.nickname"
|
:nickname="item.nickname"
|
||||||
:talk_type="item.talk_type"
|
:talk_type="item.talk_type"
|
||||||
:datetime="item.created_at"
|
:datetime="item.created_at"
|
||||||
/>
|
:msg_id="item.msg_id"
|
||||||
|
>
|
||||||
|
<template
|
||||||
|
v-if="
|
||||||
|
canEditRevokedMessage(item) && item.user_id === userStore.uid
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="edit-revoked-message"
|
||||||
|
@click="restoreRevokedMessage(item)"
|
||||||
|
>
|
||||||
|
重新编辑
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</revoke-message>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@ -128,7 +145,7 @@
|
|||||||
<deepBubble
|
<deepBubble
|
||||||
@clickMenu="(menuType) => onContextMenu(menuType, item)"
|
@clickMenu="(menuType) => onContextMenu(menuType, item)"
|
||||||
:isShowCopy="isShowCopy(item)"
|
:isShowCopy="isShowCopy(item)"
|
||||||
:isShowWithdraw="isRevoke(talkParams.uid, item)"
|
:isShowWithdraw="isRevoke(talkParams.uid, item) || isLeader"
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
class="component-content"
|
class="component-content"
|
||||||
@ -474,7 +491,7 @@ import useZPaging from '@/uni_modules/z-paging/components/z-paging/js/hooks/useZ
|
|||||||
import emojiPanel from './components/emojiPanel.vue'
|
import emojiPanel from './components/emojiPanel.vue'
|
||||||
import filePanel from './components/filePanel.vue'
|
import filePanel from './components/filePanel.vue'
|
||||||
import lodash from 'lodash'
|
import lodash from 'lodash'
|
||||||
import { ServePublishMessage } from '@/api/chat'
|
import { ServePublishMessage, detailGetRecordsContext } from '@/api/chat'
|
||||||
import copy07 from '@/static/image/chatList/copy07@2x.png'
|
import copy07 from '@/static/image/chatList/copy07@2x.png'
|
||||||
import multipleChoices from '@/static/image/chatList/multipleChoices@2x.png'
|
import multipleChoices from '@/static/image/chatList/multipleChoices@2x.png'
|
||||||
import cite from '@/static/image/chatList/cite@2x.png'
|
import cite from '@/static/image/chatList/cite@2x.png'
|
||||||
@ -517,6 +534,8 @@ const talkParams = reactive({
|
|||||||
online: computed(() => dialogueStore.online),
|
online: computed(() => dialogueStore.online),
|
||||||
keyboard: computed(() => dialogueStore.keyboard),
|
keyboard: computed(() => dialogueStore.keyboard),
|
||||||
num: computed(() => dialogueStore.members.length),
|
num: computed(() => dialogueStore.members.length),
|
||||||
|
isDismiss: computed(() => dialogueStore.isDismiss),
|
||||||
|
adminList: computed(() => dialogueStore.getAdminList),
|
||||||
})
|
})
|
||||||
|
|
||||||
const state = ref({
|
const state = ref({
|
||||||
@ -761,6 +780,13 @@ const onEditorChange = () => {
|
|||||||
}
|
}
|
||||||
onEditorEvent(emitCall('input_event', text))
|
onEditorEvent(emitCall('input_event', text))
|
||||||
// emit('editor-event', emitCall('input_event', text))
|
// emit('editor-event', emitCall('input_event', text))
|
||||||
|
// 清理过期的撤回消息(超过5分钟)
|
||||||
|
const now = new Date().getTime()
|
||||||
|
Object.keys(state.value.revokedMessages).forEach((msgId) => {
|
||||||
|
if (now - state.value.revokedMessages[msgId].revokeTime > 5 * 60 * 1000) {
|
||||||
|
delete state.value.revokedMessages[msgId]
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClipboardMatcher = (node, Delta) => {
|
const onClipboardMatcher = (node, Delta) => {
|
||||||
@ -918,6 +944,45 @@ const withdrawerConfirm = () => {
|
|||||||
state.value.showWin = false
|
state.value.showWin = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加检查是否可以重新编辑撤回消息的函数
|
||||||
|
const canEditRevokedMessage = (item) => {
|
||||||
|
console.log(item)
|
||||||
|
if (item.is_revoke === 1 && item.msg_type === 1) {
|
||||||
|
const now = new Date().getTime()
|
||||||
|
const revokeTime = new Date(item.created_at).getTime()
|
||||||
|
console.log(now)
|
||||||
|
// 检查是否在5分钟内
|
||||||
|
return now - revokeTime <= 5 * 60 * 1000
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加恢复撤回消息到输入框的函数
|
||||||
|
const restoreRevokedMessage = async (item) => {
|
||||||
|
// 接口拿数据,之后把查询的内容给输入框
|
||||||
|
const res = await detailGetRecordsContext({
|
||||||
|
msgId: item.msg_id,
|
||||||
|
})
|
||||||
|
console.log(res)
|
||||||
|
if (res.code == 200) {
|
||||||
|
const content = res.data.item?.extra?.content
|
||||||
|
const quill = getQuill()
|
||||||
|
quill.setText(content)
|
||||||
|
// 将光标设置到文本末尾
|
||||||
|
quill.setSelection(content.length, 0)
|
||||||
|
quill.focus()
|
||||||
|
}
|
||||||
|
/* const revokedMsg = state.value.revokedMessages[msgId]
|
||||||
|
|
||||||
|
// 根据消息类型处理
|
||||||
|
if (revokedMsg.msgType === 1) { // 文本消息
|
||||||
|
const quill = getQuill()
|
||||||
|
quill.setText(revokedMsg.content)
|
||||||
|
quill.focus()
|
||||||
|
} */
|
||||||
|
// 可以根据需要添加其他类型消息的处理
|
||||||
|
}
|
||||||
|
|
||||||
const actionDelete = (item) => {
|
const actionDelete = (item) => {
|
||||||
console.log('删除')
|
console.log('删除')
|
||||||
item.isCheck = true
|
item.isCheck = true
|
||||||
@ -1237,6 +1302,18 @@ const queryRecordsByMsgInfo = (msgInfo) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//是否是管理员
|
||||||
|
const isLeader = computed(() => {
|
||||||
|
if (talkParams.adminList.length > 0) {
|
||||||
|
return (
|
||||||
|
talkParams.adminList.filter(
|
||||||
|
(adminItem) => adminItem.erp_user_id === useAuth()?.userInfo?.value?.ID,
|
||||||
|
).length > 0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
state.value.mentionSelectHeight = pxTorPx(
|
state.value.mentionSelectHeight = pxTorPx(
|
||||||
@ -1285,6 +1362,17 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.edit-revoked-message {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
color: #46299d;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.searchRoot {
|
.searchRoot {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 22rpx 18rpx;
|
padding: 22rpx 18rpx;
|
||||||
|
@ -351,7 +351,7 @@ onMounted(() => {
|
|||||||
const ServeQueryTalkDate = (month) => {
|
const ServeQueryTalkDate = (month) => {
|
||||||
let params = {
|
let params = {
|
||||||
month: month,
|
month: month,
|
||||||
talk_type: 2, //1私聊2群聊
|
talk_type: dialogueParams.talk_type, //1私聊2群聊
|
||||||
receiver_id: state.receiver_id, //目标人id
|
receiver_id: state.receiver_id, //目标人id
|
||||||
}
|
}
|
||||||
const resp = ServeTalkDate(params)
|
const resp = ServeTalkDate(params)
|
||||||
@ -477,12 +477,14 @@ const queryAllSearch = () => {
|
|||||||
if (data?.items?.length > 0) {
|
if (data?.items?.length > 0) {
|
||||||
data.items.forEach((item) => {
|
data.items.forEach((item) => {
|
||||||
item.dateTime = parseTime(item?.created_at, '{m}/{d}')
|
item.dateTime = parseTime(item?.created_at, '{m}/{d}')
|
||||||
item.extra.fileSize = fileFormatSize(item?.extra?.size)
|
if (item?.extra) {
|
||||||
item.extra.typeText = item?.extra?.name
|
item.extra.fileSize = fileFormatSize(item?.extra?.size)
|
||||||
? fileSuffix(item?.extra?.name)
|
item.extra.typeText = item?.extra?.name
|
||||||
: ''
|
? fileSuffix(item?.extra?.name)
|
||||||
item.extra.file_avatar = fileTypeAvatar(item?.extra?.typeText)
|
: ''
|
||||||
console.log(item.extra.type)
|
item.extra.file_avatar = fileTypeAvatar(item?.extra?.typeText)
|
||||||
|
console.log(item.extra.type)
|
||||||
|
}
|
||||||
let year = new Date(item.created_at).getFullYear()
|
let year = new Date(item.created_at).getFullYear()
|
||||||
let month = new Date(item.created_at).getMonth() + 1
|
let month = new Date(item.created_at).getMonth() + 1
|
||||||
let dateMonth =
|
let dateMonth =
|
||||||
|
@ -48,6 +48,9 @@ export const useDialogueStore = defineStore('dialogue', {
|
|||||||
// 是否显示会话列表
|
// 是否显示会话列表
|
||||||
isShowSessionList: true,
|
isShowSessionList: true,
|
||||||
|
|
||||||
|
//是否已被解散
|
||||||
|
isDismiss: false,
|
||||||
|
|
||||||
// 群成员列表
|
// 群成员列表
|
||||||
members: [],
|
members: [],
|
||||||
|
|
||||||
@ -98,6 +101,8 @@ export const useDialogueStore = defineStore('dialogue', {
|
|||||||
this.unreadBubble = 0
|
this.unreadBubble = 0
|
||||||
this.isShowEditor = data?.is_robot === 0
|
this.isShowEditor = data?.is_robot === 0
|
||||||
|
|
||||||
|
this.isDismiss = data?.is_dismiss === 1 ? true : false
|
||||||
|
|
||||||
this.members = []
|
this.members = []
|
||||||
if (data.talk_type == 2) {
|
if (data.talk_type == 2) {
|
||||||
this.updateGroupMembers()
|
this.updateGroupMembers()
|
||||||
|
@ -38,13 +38,14 @@ export function formatTalkItem(params) {
|
|||||||
is_disturb: 0,
|
is_disturb: 0,
|
||||||
is_top: 0,
|
is_top: 0,
|
||||||
is_online: 0,
|
is_online: 0,
|
||||||
|
is_dismiss: 0,
|
||||||
is_robot: 0,
|
is_robot: 0,
|
||||||
unread_num: 0,
|
unread_num: 0,
|
||||||
content: '......',
|
content: '......',
|
||||||
draft_text: '',
|
draft_text: '',
|
||||||
msg_text: '',
|
msg_text: '',
|
||||||
index_name: '',
|
index_name: '',
|
||||||
updated_at: parseTime(new Date())
|
updated_at: parseTime(new Date()),
|
||||||
}
|
}
|
||||||
|
|
||||||
options = { ...options, ...params }
|
options = { ...options, ...params }
|
||||||
|
Loading…
Reference in New Issue
Block a user