Merge branch 'wyfMain-dev'
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run
This commit is contained in:
commit
383abed2e8
1
components.d.ts
vendored
1
components.d.ts
vendored
@ -43,6 +43,7 @@ declare module 'vue' {
|
||||
SysGroupMemberKickedMessage: typeof import('./src/components/talk/message/system/SysGroupMemberKickedMessage.vue')['default']
|
||||
SysGroupMemberMutedMessage: typeof import('./src/components/talk/message/system/SysGroupMemberMutedMessage.vue')['default']
|
||||
SysGroupMemberQuitMessage: typeof import('./src/components/talk/message/system/SysGroupMemberQuitMessage.vue')['default']
|
||||
SysGroupMemberRemovedMessage: typeof import('./src/components/talk/message/system/SysGroupMemberRemovedMessage.vue')['default']
|
||||
SysGroupMutedMessage: typeof import('./src/components/talk/message/system/SysGroupMutedMessage.vue')['default']
|
||||
SysGroupTransferMessage: typeof import('./src/components/talk/message/system/SysGroupTransferMessage.vue')['default']
|
||||
SysTextMessage: typeof import('./src/components/talk/message/system/SysTextMessage.vue')['default']
|
||||
|
@ -14,7 +14,8 @@ defineProps({
|
||||
<div class="im-message-sys-text">
|
||||
<div class="sys-text">
|
||||
<a @click="showUserInfoModal(data.user_id)">
|
||||
{{ data.nickname }}
|
||||
<!-- {{ data.nickname }} -->
|
||||
管理员
|
||||
</a>
|
||||
<span>修改群名为</span>
|
||||
<span>"{{ extra.group_name }}"</span>
|
||||
|
@ -0,0 +1,23 @@
|
||||
<script setup>
|
||||
import './sys-message.less'
|
||||
import { useInject } from '@/hooks'
|
||||
|
||||
const { showUserInfoModal } = useInject()
|
||||
|
||||
defineProps({
|
||||
extra: Object,
|
||||
data: Object,
|
||||
})
|
||||
</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>
|
@ -60,7 +60,7 @@ export const ChatMsgTypeMapping = {
|
||||
[ChatMsgSysGroupTransfer]: '[转让群主]',
|
||||
[ChatMsgSysGroupAdmin]: '[设置管理员]',
|
||||
[ChatMsgSysGroupMemberRemoved]: '[移出群成员消息]',
|
||||
[ChatMsgSysGroupInfoChange]: '[修改群名称]'
|
||||
[ChatMsgSysGroupInfoChange]: '[群信息更新]'
|
||||
}
|
||||
|
||||
// 消息类型 - 消息组件 映射关系
|
||||
|
@ -167,7 +167,6 @@
|
||||
@click="showConfirmPrompt(3)"
|
||||
class="clear-chat-record-btn-each"
|
||||
v-if="
|
||||
groupParams?.groupInfo?.is_manager === false &&
|
||||
dialogueParams.type === 2 &&
|
||||
(groupParams?.groupInfo?.group_type === 1 ||
|
||||
groupParams?.groupInfo?.group_type === 3)
|
||||
@ -226,6 +225,7 @@ const dialogueParams = reactive({
|
||||
keyboard: computed(() => dialogueStore.keyboard),
|
||||
num: computed(() => dialogueStore.members.length),
|
||||
memberList: computed(() => dialogueStore.members),
|
||||
adminList: computed(() => dialogueStore.getAdminList),
|
||||
})
|
||||
const talkParams = reactive({
|
||||
topItems: computed(() => talkStore.topItems),
|
||||
@ -562,16 +562,22 @@ const showConfirmPrompt = (flag) => {
|
||||
//清空聊天记录
|
||||
confirmContent = t('ok') + t('chat.settings.clearChatRecord')
|
||||
} else if (flag === 2) {
|
||||
//解散群聊
|
||||
confirmContent = t('group.dismiss.confirm')
|
||||
} else if (flag === 3) {
|
||||
//最后一个管理员退群就解散群聊
|
||||
if (dialogueParams.adminList.length === 1 && dialogueParams.adminList[0].id === dialogueParams.uid) {
|
||||
//解散群聊
|
||||
confirmContent = t('ok') + t('group.quit.btn')
|
||||
subContent = t('groupManage.disband.hint')
|
||||
subContentColor = '#CF3050'
|
||||
} else if (flag === 3) {
|
||||
} else {
|
||||
//退出群聊
|
||||
confirmContent = t('ok') + t('group.quit.btn')
|
||||
subContent = t('groupManage.quit.hint')
|
||||
subContentColor = '#B4B4B4'
|
||||
}
|
||||
}
|
||||
showConfirm({
|
||||
subContent: subContent,
|
||||
subContentColor: subContentColor,
|
||||
@ -597,6 +603,23 @@ const showConfirmPrompt = (flag) => {
|
||||
})
|
||||
}
|
||||
} else if (flag === 3) {
|
||||
//最后一个管理员退群就解散群聊
|
||||
if (dialogueParams.adminList.length === 1 && dialogueParams.adminList[0].id === dialogueParams.uid) {
|
||||
//解散群聊
|
||||
let params = {
|
||||
group_id: dialogueParams.receiver_id, //群id
|
||||
}
|
||||
console.log(params)
|
||||
const res = await ServeDismissGroup(params)
|
||||
if (res.code === 200) {
|
||||
dialogueStore.updateGroupMembers()
|
||||
groupStore.ServeGroupDetail()
|
||||
uni.navigateBack({
|
||||
delta: 2,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
//退出群聊
|
||||
ServeSecedeGroup({
|
||||
group_id: dialogueParams.receiver_id,
|
||||
}).then(({ code, message }) => {
|
||||
@ -606,6 +629,7 @@ const showConfirmPrompt = (flag) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
onCancel: () => {},
|
||||
})
|
||||
|
@ -26,7 +26,7 @@
|
||||
<template #right>
|
||||
<div
|
||||
class="mr-[36rpx] toChatSetting_btn"
|
||||
v-if="!talkParams.isDismiss"
|
||||
v-if="!talkParams.isDismiss && !talkParams.isQuit"
|
||||
>
|
||||
<tm-icon
|
||||
color="rgb(51, 51, 51)"
|
||||
@ -542,6 +542,7 @@ const talkParams = reactive({
|
||||
keyboard: computed(() => dialogueStore.keyboard),
|
||||
num: computed(() => dialogueStore.members.length),
|
||||
isDismiss: computed(() => dialogueStore.isDismiss),
|
||||
isQuit: computed(() => dialogueStore.isQuit),
|
||||
adminList: computed(() => dialogueStore.getAdminList),
|
||||
})
|
||||
|
||||
@ -877,6 +878,9 @@ const editorOption = {
|
||||
return el
|
||||
},
|
||||
source: function (searchTerm, renderList, mentionChar) {
|
||||
if (talkParams.type === 1) {
|
||||
return
|
||||
}
|
||||
// 在失焦前保存光标位置
|
||||
const quill = getQuill()
|
||||
const range = quill.getSelection()
|
||||
@ -1107,11 +1111,14 @@ watch(
|
||||
newValue[newValue.length - 1]?.sequence ===
|
||||
dialogueList?.records?.[0]?.sequence
|
||||
) {
|
||||
//相同意味着分页加载缓存中的聊天记录完毕
|
||||
state.value.localPageLoadDone = true
|
||||
if (dialogueList?.records?.[0]?.sequence !== 1) {
|
||||
if (
|
||||
dialogueList?.records?.[0]?.sequence !== 1 &&
|
||||
!state.value.localPageLoadDone
|
||||
) {
|
||||
loadConfig.status = 1
|
||||
}
|
||||
//相同意味着分页加载缓存中的聊天记录完毕
|
||||
state.value.localPageLoadDone = true
|
||||
} else {
|
||||
state.value.localPageLoadDone = false
|
||||
}
|
||||
@ -1149,8 +1156,10 @@ const onScrollToLower = async () => {
|
||||
}))
|
||||
|
||||
virtualList.value = formattedMoreRecords.concat(tempVirtualList).reverse()
|
||||
|
||||
console.log(virtualList.value)
|
||||
loadConfig.status =
|
||||
dialogueList?.records?.[0]?.sequence > 1 && moreRecords.length > 0
|
||||
? 1
|
||||
: 2
|
||||
} else {
|
||||
if (tempVirtualList[0].sequence > dialogueList.records[0].sequence) {
|
||||
virtualList.value = dialogueList.records
|
||||
@ -1224,8 +1233,8 @@ const onScrollToUpper = async () => {
|
||||
.concat(
|
||||
dialogueList.records.slice(
|
||||
recordIndex + 1,
|
||||
Math.min(recordIndex + 11, dialogueList.records.length)
|
||||
)
|
||||
Math.min(recordIndex + 11, dialogueList.records.length),
|
||||
),
|
||||
)
|
||||
.reverse()
|
||||
|
||||
@ -1330,7 +1339,7 @@ const getMentionSelectLists = (mentionSelectList) => {
|
||||
{
|
||||
id: mentionSelectItem?.id,
|
||||
denotationChar: '@',
|
||||
value: mentionSelectItem?.nickname,
|
||||
value: mentionSelectItem?.nickname + ' ',
|
||||
},
|
||||
true,
|
||||
)
|
||||
@ -1401,7 +1410,8 @@ const queryRecordsByMsgInfo = async (msgInfo) => {
|
||||
|
||||
nextTick(() => {
|
||||
zpagingRef.value.complete(recordsList.reverse())
|
||||
loadConfig.status = dialogueList?.records?.[0]?.sequence > 1 ? 1 : 2
|
||||
loadConfig.status =
|
||||
dialogueList?.records?.[0]?.sequence > 1 && recordsList.length > 0 ? 1 : 2
|
||||
nextTick(() => {
|
||||
let offset = uni.getSystemInfoSync().windowHeight
|
||||
const navBarAreaQuery = uni.createSelectorQuery()
|
||||
@ -1492,8 +1502,11 @@ const findTalkRecords = (record, isMiddle, sequence, appointParams) => {
|
||||
resolve(JSON.parse(JSON.stringify(state.value.serveFindRecord)))
|
||||
state.value.serveFindRecord = []
|
||||
}
|
||||
} else {
|
||||
resolve([])
|
||||
}
|
||||
} else {
|
||||
resolve([])
|
||||
}
|
||||
})
|
||||
resp.catch(() => {})
|
||||
|
@ -317,6 +317,8 @@ const queryAllSearch = (pageNum, searchResultPageSize) => {
|
||||
data.last_id,
|
||||
data.last_group_id,
|
||||
data.last_member_id,
|
||||
data.last_receiver_user_name,
|
||||
data.last_receiver_group_name,
|
||||
)
|
||||
let total = data.count
|
||||
if (props.searchRecordDetail) {
|
||||
|
@ -62,6 +62,8 @@ onLoad((options) => {
|
||||
receiver_id: 0, //查详情的时候需传入
|
||||
last_group_id: 0, //最后一条群id
|
||||
last_member_id: 0, //最后一条用户id
|
||||
last_receiver_user_name: '', //最后一条用户名
|
||||
last_receiver_group_name: '', //最后一条群名
|
||||
}),
|
||||
)
|
||||
state.apiRequest = ServeTalkRecord
|
||||
@ -73,11 +75,13 @@ onLoad((options) => {
|
||||
})
|
||||
|
||||
//分页查询时,最后一条id变化
|
||||
const lastIdChange = (last_id, last_group_id, last_member_id) => {
|
||||
const lastIdChange = (last_id, last_group_id, last_member_id, last_receiver_user_name, last_receiver_group_name) => {
|
||||
let idChanges = {
|
||||
last_id,
|
||||
last_group_id,
|
||||
last_member_id,
|
||||
last_receiver_user_name,
|
||||
last_receiver_group_name,
|
||||
}
|
||||
state.apiParams = encodeURIComponent(
|
||||
JSON.stringify(
|
||||
|
@ -51,6 +51,9 @@ export const useDialogueStore = defineStore('dialogue', {
|
||||
//是否已被解散
|
||||
isDismiss: false,
|
||||
|
||||
//是否退群/移出群
|
||||
isQuit: false,
|
||||
|
||||
// 群成员列表
|
||||
members: [],
|
||||
|
||||
@ -102,6 +105,7 @@ export const useDialogueStore = defineStore('dialogue', {
|
||||
this.isShowEditor = data?.is_robot === 0
|
||||
|
||||
this.isDismiss = data?.is_dismiss === 1 ? true : false
|
||||
this.isQuit = data?.is_quit === 1 ? true : false
|
||||
|
||||
this.members = []
|
||||
if (data.talk_type == 2) {
|
||||
|
@ -41,6 +41,7 @@ export const useDialogueListStore = createGlobalState(() => {
|
||||
isShowEditor: dialogue.isShowEditor,
|
||||
isShowSessionList: dialogue.isShowSessionList,
|
||||
isDismiss: dialogue.isDismiss,
|
||||
isQuit: dialogue.isQuit,
|
||||
members: dialogue.members.map(member => ({
|
||||
id: member.id,
|
||||
nickname: member.nickname,
|
||||
|
@ -154,5 +154,6 @@
|
||||
"chat.mention.select": "选择提醒的人",
|
||||
"do.phone.call": "拨打",
|
||||
"popup.title.phone": "电话",
|
||||
"pageTitle.view.deps": "查看部门"
|
||||
"pageTitle.view.deps": "查看部门",
|
||||
"group.dismiss.confirm": "确定解散本群"
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ export function formatTalkItem(params) {
|
||||
is_top: 0,
|
||||
is_online: 0,
|
||||
is_dismiss: 0,
|
||||
is_quit: 0,
|
||||
is_robot: 0,
|
||||
unread_num: 0,
|
||||
content: '......',
|
||||
|
Loading…
Reference in New Issue
Block a user