|
@@ -1,25 +1,60 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<i class="icon icon-chat-setting" @click="toggleShow"></i>
|
|
|
- <div class="manage" :class="[isH5 ? 'manage-h5' : '']" v-if="show" ref="dialog">
|
|
|
- <header :class="['manage-header', currentTab === 'onlyMute' ? 'currentModel' : '']">
|
|
|
- <i class="icon icon-back" v-if="isH5 && !currentTab" @click="toggleShow"></i>
|
|
|
-
|
|
|
+ <div
|
|
|
+ class="manage"
|
|
|
+ :class="[isH5 ? 'manage-h5' : '']"
|
|
|
+ v-if="show"
|
|
|
+ ref="dialog"
|
|
|
+ >
|
|
|
+ <header
|
|
|
+ :class="[
|
|
|
+ 'manage-header',
|
|
|
+ currentTab === 'onlyMute' ? 'currentModel' : '',
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="icon icon-back"
|
|
|
+ v-if="isH5 && !currentTab"
|
|
|
+ @click="toggleShow"
|
|
|
+ ></i>
|
|
|
+
|
|
|
<aside class="manage-header-left">
|
|
|
- <i class="icon icon-back" v-if="currentTab" @click="() =>{
|
|
|
- currentModel = 'not_mute'
|
|
|
- setTab('')
|
|
|
- }"></i>
|
|
|
+ <i
|
|
|
+ class="icon icon-back"
|
|
|
+ v-if="currentTab"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ currentModel = 'not_mute';
|
|
|
+ setTab('');
|
|
|
+ }
|
|
|
+ "
|
|
|
+ ></i>
|
|
|
<main v-if="currentTab !== 'onlyMute'">
|
|
|
- <h1>{{ TabName }} <span v-if="currentTab === 'member'"> {{ groupDetail.memberNum || 0 }}{{ $t(`TUIChat.manage.人`) }} </span></h1>
|
|
|
+ <h1>
|
|
|
+ {{ TabName }}
|
|
|
+ <span v-if="currentTab === 'member'">
|
|
|
+ {{ groupDetail.memberNum || 0 }}{{ $t(`TUIChat.manage.人`) }}
|
|
|
+ </span>
|
|
|
+ </h1>
|
|
|
</main>
|
|
|
- <n-tabs
|
|
|
+ <n-tabs
|
|
|
v-else
|
|
|
- justify-content="center"
|
|
|
- style="margin-left: -14Px;flex: 1; --n-tab-padding: 6px 0; --n-tab-gap: 34px; --n-tab-text-color: #000; --n-tab-text-color-hover: #0f0f0f; --n-tab-text-color-active: #000; --n-tab-font-weight-active: 600; --n-bar-color: #198cfe"
|
|
|
- :bar-width="20"
|
|
|
- :value="currentModel"
|
|
|
- @update:value="
|
|
|
+ justify-content="center"
|
|
|
+ style="
|
|
|
+ margin-left: -14px;
|
|
|
+ flex: 1;
|
|
|
+ --n-tab-padding: 6px 0;
|
|
|
+ --n-tab-gap: 34px;
|
|
|
+ --n-tab-text-color: #000;
|
|
|
+ --n-tab-text-color-hover: #0f0f0f;
|
|
|
+ --n-tab-text-color-active: #000;
|
|
|
+ --n-tab-font-weight-active: 600;
|
|
|
+ --n-bar-color: #198cfe;
|
|
|
+ "
|
|
|
+ :bar-width="20"
|
|
|
+ :value="currentModel"
|
|
|
+ @update:value="
|
|
|
(val: any) => {
|
|
|
currentModel = val;
|
|
|
mutePage = 1
|
|
@@ -27,43 +62,79 @@
|
|
|
getUserList()
|
|
|
}
|
|
|
"
|
|
|
- >
|
|
|
+ >
|
|
|
<n-tab-pane name="not_mute" tab="未禁言"></n-tab-pane>
|
|
|
<n-tab-pane name="mute" tab="已禁言"></n-tab-pane>
|
|
|
</n-tabs>
|
|
|
</aside>
|
|
|
- <span v-if="currentTab !== 'onlyMute'">
|
|
|
+ <span v-if="currentTab !== 'onlyMute'">
|
|
|
<i v-if="!isH5" class="icon icon-close" @click="toggleShow"></i>
|
|
|
</span>
|
|
|
</header>
|
|
|
- <main :class="['main']" style="background-color: #f4f5f9; height: 100%" v-if="!currentTab">
|
|
|
- <ManageName class="space-top" :isAuth="isAuth" :isH5="isH5" :data="conversation.groupProfile" @update="updateProfile" style="background-color: #fff" />
|
|
|
+ <main
|
|
|
+ :class="['main']"
|
|
|
+ style="background-color: #f4f5f9; height: 100%"
|
|
|
+ v-if="!currentTab"
|
|
|
+ >
|
|
|
+ <ManageName
|
|
|
+ class="space-top"
|
|
|
+ :isAuth="isAuth"
|
|
|
+ :isH5="isH5"
|
|
|
+ :data="conversation.groupProfile"
|
|
|
+ @update="updateProfile"
|
|
|
+ style="background-color: #fff"
|
|
|
+ />
|
|
|
<div class="userInfo space-top" style="background-color: #fff">
|
|
|
<header class="userInfo-header" @click="setTab('member')">
|
|
|
<label>{{ $t(`TUIChat.manage.群成员`) }}</label>
|
|
|
<p>
|
|
|
- <span> {{ groupDetail.memberNum || 0 }}{{ $t(`TUIChat.manage.人`) }} </span>
|
|
|
+ <span>
|
|
|
+ {{ groupDetail.memberNum || 0 }}{{ $t(`TUIChat.manage.人`) }}
|
|
|
+ </span>
|
|
|
<i class="icon icon-right"></i>
|
|
|
</p>
|
|
|
</header>
|
|
|
<ol>
|
|
|
<!-- @click="handleMemberProfileShow(item)" -->
|
|
|
- <dl v-for="(item, index) in userInfo?.list?.slice(0, showUserNum)" :key="index">
|
|
|
+ <dl
|
|
|
+ v-for="(item, index) in userInfo?.list?.slice(0, showUserNum)"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
<dt>
|
|
|
- <img class="avatar" :src="item?.avatar || 'https://oss.dayaedu.com/news-info/07/1690787574969.png'" onerror="this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'" />
|
|
|
+ <img
|
|
|
+ class="avatar"
|
|
|
+ :src="
|
|
|
+ item?.avatar ||
|
|
|
+ 'https://oss.dayaedu.com/news-info/07/1690787574969.png'
|
|
|
+ "
|
|
|
+ onerror="this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"
|
|
|
+ />
|
|
|
</dt>
|
|
|
<dd>{{ item?.nickname || item?.userID }}</dd>
|
|
|
</dl>
|
|
|
<!-- v-if="isShowAddMember" -->
|
|
|
<dl v-if="currentUserDetail.groupRoleType === 'Owner'">
|
|
|
- <dt class="avatar" @click="toggleMask('add')">+</dt>
|
|
|
+ <dt @click="toggleMask('add')" style="cursor: pointer">
|
|
|
+ <img src="../../../assets/icon/icon-add.png" class="avatar" />
|
|
|
+ </dt>
|
|
|
+ <dd>添加</dd>
|
|
|
+ </dl>
|
|
|
+ <dl v-if="currentUserDetail.groupRoleType === 'Owner'">
|
|
|
+ <dt @click="toggleMask('remove')" style="cursor: pointer">
|
|
|
+ <img
|
|
|
+ class="avatar"
|
|
|
+ src="../../../assets/icon/icon-remove2.png"
|
|
|
+ />
|
|
|
+ </dt>
|
|
|
+ <dd>移除</dd>
|
|
|
</dl>
|
|
|
- <!-- <dl v-if="conversation.groupProfile.selfInfo.role === 'Owner'">
|
|
|
- <dt class="avatar" @click="toggleMask('remove')">-</dt>
|
|
|
- </dl> -->
|
|
|
</ol>
|
|
|
</div>
|
|
|
- <ul class="content space-top" @click="editLableName = ''" style="background-color: #fff">
|
|
|
+ <ul
|
|
|
+ class="content space-top"
|
|
|
+ @click="editLableName = ''"
|
|
|
+ style="background-color: #fff"
|
|
|
+ >
|
|
|
<li @click.stop="setTab('notification')">
|
|
|
<aside>
|
|
|
<label>{{ $t(`TUIChat.manage.群公告`) }}</label>
|
|
@@ -119,45 +190,133 @@
|
|
|
</li> -->
|
|
|
</ul>
|
|
|
|
|
|
- <div v-if="currentUserDetail.groupRoleType === 'Owner' || currentUserDetail.groupRoleType === 'Admin'" class="admin-content space-top" style="background-color: #fff; padding-top: 12px;border-top: 1Px solid #f4f5f9;">
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ currentUserDetail.groupRoleType === 'Owner' ||
|
|
|
+ currentUserDetail.groupRoleType === 'Admin'
|
|
|
+ "
|
|
|
+ class="admin-content space-top"
|
|
|
+ style="
|
|
|
+ background-color: #fff;
|
|
|
+ padding-top: 12px;
|
|
|
+ border-top: 1px solid #f4f5f9;
|
|
|
+ "
|
|
|
+ >
|
|
|
<aside>
|
|
|
<label>学生禁言</label>
|
|
|
</aside>
|
|
|
- <Slider :open="groupDetail.configJson.mute" @change="setAllMuteTime" />
|
|
|
+ <Slider
|
|
|
+ :open="groupDetail.configJson.mute"
|
|
|
+ @change="setAllMuteTime"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <div v-if="currentUserDetail.groupRoleType === 'Owner' || currentUserDetail.groupRoleType === 'Admin'" class="admin-content space-top" style="background-color: #fff; padding-top: 12px;border-top: 1Px solid #f4f5f9;" @click.stop="() => {
|
|
|
- userInfo.muteList = []
|
|
|
- setTab('onlyMute')
|
|
|
- }">
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ currentUserDetail.groupRoleType === 'Owner' ||
|
|
|
+ currentUserDetail.groupRoleType === 'Admin'
|
|
|
+ "
|
|
|
+ class="admin-content space-top"
|
|
|
+ style="
|
|
|
+ background-color: #fff;
|
|
|
+ padding-top: 12px;
|
|
|
+ border-top: 1px solid #f4f5f9;
|
|
|
+ "
|
|
|
+ @click.stop="
|
|
|
+ () => {
|
|
|
+ userInfo.muteList = [];
|
|
|
+ setTab('onlyMute');
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
<aside>
|
|
|
<label>禁言名单</label>
|
|
|
</aside>
|
|
|
<i class="icon icon-right end"></i>
|
|
|
</div>
|
|
|
- <div v-if="currentUserDetail.groupRoleType === 'Owner' && userInfo?.list.length > 1" class="admin-content space-top" style="background-color: #fff;padding-top: 12px; border-top: 1Px solid #f4f5f9;" @click.stop="toggleMask('changeOwner')">
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ currentUserDetail.groupRoleType === 'Owner' &&
|
|
|
+ userInfo?.list.length > 1
|
|
|
+ "
|
|
|
+ class="admin-content space-top"
|
|
|
+ style="
|
|
|
+ background-color: #fff;
|
|
|
+ padding-top: 12px;
|
|
|
+ border-top: 1px solid #f4f5f9;
|
|
|
+ "
|
|
|
+ @click.stop="toggleMask('changeOwner')"
|
|
|
+ >
|
|
|
<aside>
|
|
|
<label>移交群主</label>
|
|
|
</aside>
|
|
|
<i class="icon icon-right end"></i>
|
|
|
</div>
|
|
|
- <ul class="footer space-top" style="overflow: hidden; background-color: #f4f5f9;">
|
|
|
+ <ul
|
|
|
+ class="footer space-top"
|
|
|
+ style="overflow: hidden; background-color: #f4f5f9"
|
|
|
+ >
|
|
|
<!-- <li v-if="currentUserDetail.groupRoleType === 'Owner' && userInfo?.list.length > 1" @click.stop="toggleMask('changeOwner')">移交群主</li> -->
|
|
|
- <li v-if="currentUserDetail.groupRoleType === 'Owner'" @click.stop="dismiss(conversation.groupProfile)">解散群聊</li>
|
|
|
+ <li
|
|
|
+ v-if="currentUserDetail.groupRoleType === 'Owner'"
|
|
|
+ @click.stop="dismiss(conversation.groupProfile)"
|
|
|
+ >
|
|
|
+ 解散群聊
|
|
|
+ </li>
|
|
|
<li v-else @click.stop="quit(conversation.groupProfile)">退出群组</li>
|
|
|
</ul>
|
|
|
</main>
|
|
|
- <ManageMember v-else-if="currentTab === 'member'" :self="conversation.groupProfile.selfInfo" :list="userInfo.list" :total="~~conversation.groupProfile.memberCount" @more="getMember('more')" @del="submit" @handleMemberProfileShow="handleMemberProfileShow" />
|
|
|
+ <ManageMember
|
|
|
+ v-else-if="currentTab === 'member'"
|
|
|
+ :self="conversation.groupProfile.selfInfo"
|
|
|
+ :list="userInfo.list"
|
|
|
+ :total="~~conversation.groupProfile.memberCount"
|
|
|
+ @more="getMember('more')"
|
|
|
+ @del="submit"
|
|
|
+ @handleMemberProfileShow="handleMemberProfileShow"
|
|
|
+ />
|
|
|
<!-- :isShowDel="conversation.groupProfile.selfInfo.role === 'Owner'" -->
|
|
|
- <MemeberProfile v-else-if="currentTab === 'profile'" :userInfo="currentMember" />
|
|
|
- <ManageNotification ref="manageNotificationRef" v-else-if="currentTab === 'notification' || currentTab === 'notificationAdd' || currentTab === 'notificationUpdate'" :isAuth="isAuth" :data="conversation.groupProfile" @update="updateProfile" @changeStatus="onNotificationChangeStatus" />
|
|
|
- <ManageNotificationDetail ref="manageNotificationDetailRef" v-else-if="currentTab === 'notificationDetail' || currentTab === 'notificationAddDetail' || currentTab === 'notificationUpdateDetail'" :noticeId="noticeId" :isAuth="isAuth" :data="conversation.groupProfile" @changeStatus="onNotificationChangeStatus" />
|
|
|
+ <MemeberProfile
|
|
|
+ v-else-if="currentTab === 'profile'"
|
|
|
+ :userInfo="currentMember"
|
|
|
+ />
|
|
|
+ <ManageNotification
|
|
|
+ ref="manageNotificationRef"
|
|
|
+ v-else-if="
|
|
|
+ currentTab === 'notification' ||
|
|
|
+ currentTab === 'notificationAdd' ||
|
|
|
+ currentTab === 'notificationUpdate'
|
|
|
+ "
|
|
|
+ :isAuth="isAuth"
|
|
|
+ :data="conversation.groupProfile"
|
|
|
+ @update="updateProfile"
|
|
|
+ @changeStatus="onNotificationChangeStatus"
|
|
|
+ />
|
|
|
+ <ManageNotificationDetail
|
|
|
+ ref="manageNotificationDetailRef"
|
|
|
+ v-else-if="
|
|
|
+ currentTab === 'notificationDetail' ||
|
|
|
+ currentTab === 'notificationAddDetail' ||
|
|
|
+ currentTab === 'notificationUpdateDetail'
|
|
|
+ "
|
|
|
+ :noticeId="noticeId"
|
|
|
+ :isAuth="isAuth"
|
|
|
+ :data="conversation.groupProfile"
|
|
|
+ @changeStatus="onNotificationChangeStatus"
|
|
|
+ />
|
|
|
<main class="admin" v-else-if="currentTab === 'admin'">
|
|
|
<div class="admin-list" v-if="isAdmin">
|
|
|
<label>{{ $t(`TUIChat.manage.群管理员`) }}</label>
|
|
|
<ol>
|
|
|
<dl v-for="(item, index) in member.admin" :key="index">
|
|
|
<dt>
|
|
|
- <img class="avatar" :src="item?.avatar || 'https://oss.dayaedu.com/news-info/07/1690787574969.png'" onerror="this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'" />
|
|
|
+ <img
|
|
|
+ class="avatar"
|
|
|
+ :src="
|
|
|
+ item?.avatar ||
|
|
|
+ 'https://oss.dayaedu.com/news-info/07/1690787574969.png'
|
|
|
+ "
|
|
|
+ onerror="this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"
|
|
|
+ />
|
|
|
</dt>
|
|
|
<dd>{{ item?.nick || item?.userID }}</dd>
|
|
|
</dl>
|
|
@@ -165,7 +324,13 @@
|
|
|
<dt class="avatar" @click="toggleMask('addAdmin')">+</dt>
|
|
|
</dl>
|
|
|
<dl>
|
|
|
- <dt class="avatar" v-if="member.admin.length > 0" @click="toggleMask('removeAdmin')">-</dt>
|
|
|
+ <dt
|
|
|
+ class="avatar"
|
|
|
+ v-if="member.admin.length > 0"
|
|
|
+ @click="toggleMask('removeAdmin')"
|
|
|
+ >
|
|
|
+ -
|
|
|
+ </dt>
|
|
|
</dl>
|
|
|
</ol>
|
|
|
</div>
|
|
@@ -173,17 +338,29 @@
|
|
|
<aside>
|
|
|
<label>{{ $t(`TUIChat.manage.学生禁言`) }}</label>
|
|
|
<p>
|
|
|
- {{ $t(`TUIChat.manage.学生禁言开启后,只允许群主和管理员发言。`) }}
|
|
|
+ {{
|
|
|
+ $t(`TUIChat.manage.学生禁言开启后,只允许群主和管理员发言。`)
|
|
|
+ }}
|
|
|
</p>
|
|
|
</aside>
|
|
|
- <Slider :open="conversation.groupProfile.muteAllMembers" @change="setAllMuteTime" />
|
|
|
+ <Slider
|
|
|
+ :open="conversation.groupProfile.muteAllMembers"
|
|
|
+ @change="setAllMuteTime"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="admin-list last" v-if="isSetMuteTime">
|
|
|
<label>{{ $t(`TUIChat.manage.单独禁言人员`) }}</label>
|
|
|
<ol>
|
|
|
<dl v-for="(item, index) in member.muteMember" :key="index">
|
|
|
<dt>
|
|
|
- <img class="avatar" :src="item?.avatar || 'https://oss.dayaedu.com/news-info/07/1690787574969.png'" onerror="this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'" />
|
|
|
+ <img
|
|
|
+ class="avatar"
|
|
|
+ :src="
|
|
|
+ item?.avatar ||
|
|
|
+ 'https://oss.dayaedu.com/news-info/07/1690787574969.png'
|
|
|
+ "
|
|
|
+ onerror="this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"
|
|
|
+ />
|
|
|
</dt>
|
|
|
<dd>{{ item?.nick || item?.userID }}</dd>
|
|
|
</dl>
|
|
@@ -191,34 +368,65 @@
|
|
|
<dt class="avatar" @click="toggleMask('addMute')">+</dt>
|
|
|
</dl>
|
|
|
<dl>
|
|
|
- <dt class="avatar" v-if="member.muteMember.length > 0" @click="toggleMask('removeMute')">-</dt>
|
|
|
+ <dt
|
|
|
+ class="avatar"
|
|
|
+ v-if="member.muteMember.length > 0"
|
|
|
+ @click="toggleMask('removeMute')"
|
|
|
+ >
|
|
|
+ -
|
|
|
+ </dt>
|
|
|
</dl>
|
|
|
</ol>
|
|
|
</div>
|
|
|
</main>
|
|
|
- <ManageMute v-else-if="currentTab === 'onlyMute'" :currentModel="currentModel"
|
|
|
- :total="muteTotal"
|
|
|
- :self="conversation.groupProfile.selfInfo" :list="userInfo.muteList"
|
|
|
- :conversation="conversation"
|
|
|
+ <ManageMute
|
|
|
+ v-else-if="currentTab === 'onlyMute'"
|
|
|
+ :currentModel="currentModel"
|
|
|
+ :total="muteTotal"
|
|
|
+ :self="conversation.groupProfile.selfInfo"
|
|
|
+ :list="userInfo.muteList"
|
|
|
+ :conversation="conversation"
|
|
|
:muteLoading="muteLoading"
|
|
|
- @more="getUserList('more')"
|
|
|
- @del="submit"
|
|
|
- @back="() => {
|
|
|
- setTab('');
|
|
|
- currentModel = 'not_mute'
|
|
|
- }"
|
|
|
- @search="(keyword) => {
|
|
|
- mutePage = 1
|
|
|
- muteSearch = keyword
|
|
|
- userInfo.muteList = []
|
|
|
- getUserList()
|
|
|
- }"
|
|
|
- @handleMemberProfileShow="handleMemberProfileShow" />
|
|
|
-
|
|
|
+ @more="getUserList('more')"
|
|
|
+ @del="submit"
|
|
|
+ @back="
|
|
|
+ () => {
|
|
|
+ setTab('');
|
|
|
+ currentModel = 'not_mute';
|
|
|
+ }
|
|
|
+ "
|
|
|
+ @search="
|
|
|
+ (keyword) => {
|
|
|
+ mutePage = 1;
|
|
|
+ muteSearch = keyword;
|
|
|
+ userInfo.muteList = [];
|
|
|
+ getUserList();
|
|
|
+ }
|
|
|
+ "
|
|
|
+ @handleMemberProfileShow="handleMemberProfileShow"
|
|
|
+ />
|
|
|
<MaskTUI :show="mask" @update:show="(e) => (mask = e)">
|
|
|
- <Transfer :title="$t(`TUIChat.manage.${transferTitle}`)" :list="transferList" :isSearch="isSearch" :isRadio="isRadio" :selectedList="selectedList" @submit="submit" @cancel="cancel" @search="handleSearchMember" :isH5="isH5" />
|
|
|
+ <Transfer
|
|
|
+ :title="transferTitle"
|
|
|
+ :list="transferList"
|
|
|
+ :isSearch="isSearch"
|
|
|
+ :isRadio="isRadio"
|
|
|
+ :selectedList="selectedList"
|
|
|
+ @submit="submit"
|
|
|
+ @cancel="cancel"
|
|
|
+ @search="handleSearchMember"
|
|
|
+ :isH5="isH5"
|
|
|
+ />
|
|
|
</MaskTUI>
|
|
|
- <DialogTUI :title="$t(`TUIChat.manage.删除成员`)" :show="delDialogShow" :isH5="isH5" :center="true" :isHeaderShow="!isH5" @submit="handleManage(userList, 'remove')" @update:show="(e) => (delDialogShow = e)">
|
|
|
+ <DialogTUI
|
|
|
+ :title="$t(`TUIChat.manage.删除成员`)"
|
|
|
+ :show="delDialogShow"
|
|
|
+ :isH5="isH5"
|
|
|
+ :center="true"
|
|
|
+ :isHeaderShow="!isH5"
|
|
|
+ @submit="handleManage(userList, 'remove')"
|
|
|
+ @update:show="(e) => (delDialogShow = e)"
|
|
|
+ >
|
|
|
<p v-if="userList.length === 1" class="delDialog-title">
|
|
|
{{ $t(`TUIChat.manage.确定从群聊中删除该成员?`) }}
|
|
|
</p>
|
|
@@ -227,10 +435,26 @@
|
|
|
</p>
|
|
|
</DialogTUI>
|
|
|
|
|
|
- <DialogTUI title="退出群聊" :show="quitDialogShow" :isH5="isH5" :center="true" :isHeaderShow="!isH5" @submit="handleManage([], 'quit')" @update:show="(e) => (quitDialogShow = e)">
|
|
|
+ <DialogTUI
|
|
|
+ title="退出群聊"
|
|
|
+ :show="quitDialogShow"
|
|
|
+ :isH5="isH5"
|
|
|
+ :center="true"
|
|
|
+ :isHeaderShow="!isH5"
|
|
|
+ @submit="handleManage([], 'quit')"
|
|
|
+ @update:show="(e) => (quitDialogShow = e)"
|
|
|
+ >
|
|
|
<p class="delDialog-title">是否退出群聊?</p>
|
|
|
</DialogTUI>
|
|
|
- <DialogTUI title="解散群聊" :show="dimmisDialogShow" :isH5="isH5" :center="true" :isHeaderShow="!isH5" @submit="handleManage([], 'dismiss')" @update:show="(e) => (dimmisDialogShow = e)">
|
|
|
+ <DialogTUI
|
|
|
+ title="解散群聊"
|
|
|
+ :show="dimmisDialogShow"
|
|
|
+ :isH5="isH5"
|
|
|
+ :center="true"
|
|
|
+ :isHeaderShow="!isH5"
|
|
|
+ @submit="handleManage([], 'dismiss')"
|
|
|
+ @update:show="(e) => (dimmisDialogShow = e)"
|
|
|
+ >
|
|
|
<p class="delDialog-title">是否解散群聊?</p>
|
|
|
</DialogTUI>
|
|
|
</div>
|
|
@@ -239,7 +463,16 @@
|
|
|
|
|
|
<script lang="ts">
|
|
|
import TUIMessage from "../../../components/messageTUI/index";
|
|
|
-import { defineComponent, watchEffect, reactive, toRefs, computed, watch, ref, onMounted } from "vue";
|
|
|
+import {
|
|
|
+ defineComponent,
|
|
|
+ watchEffect,
|
|
|
+ reactive,
|
|
|
+ toRefs,
|
|
|
+ computed,
|
|
|
+ watch,
|
|
|
+ ref,
|
|
|
+ onMounted,
|
|
|
+} from "vue";
|
|
|
import { onClickOutside } from "@vueuse/core";
|
|
|
import MaskTUI from "../../../components/maskTUI/mask.vue";
|
|
|
import Transfer from "../../../components/transferTUI/index.vue";
|
|
@@ -249,9 +482,20 @@ import ManageNotification from "./manage-notification.vue";
|
|
|
import ManageNotificationDetail from "./manage-notification-detail.vue";
|
|
|
import ManageMember from "./manage-member.vue";
|
|
|
import MemeberProfile from "./member-profile.vue";
|
|
|
-import ManageMute from './manage-mute.vue'
|
|
|
+import ManageMute from "./manage-mute.vue";
|
|
|
import DialogTUI from "../../../components/dialogTUi/index.vue";
|
|
|
-import { imGroupChangeGroupOwner, imGroupDetail, imGroupDismiss, imGroupMemberPage, imGroupMemberSaveImAll, imGroupMemberUserDetail, imGroupMuteAll, imGroupQuit, imUserFriendPage } from "../../../../api";
|
|
|
+import {
|
|
|
+ imGroupChangeGroupOwner,
|
|
|
+ imGroupDetail,
|
|
|
+ imGroupDismiss,
|
|
|
+ imGroupMemberPage,
|
|
|
+ imGroupMemberRemoveMemberList,
|
|
|
+ imGroupMemberSaveImAll,
|
|
|
+ imGroupMemberUserDetail,
|
|
|
+ imGroupMuteAll,
|
|
|
+ imGroupQuit,
|
|
|
+ imUserFriendPage,
|
|
|
+} from "../../../../api";
|
|
|
import Vuex from "vuex";
|
|
|
import { handleErrorPrompts } from "../../utils";
|
|
|
import useClipboard from "vue-clipboard3";
|
|
@@ -301,7 +545,7 @@ const manage = defineComponent({
|
|
|
userInfo: {
|
|
|
isGroup: false,
|
|
|
list: [],
|
|
|
- muteList: []
|
|
|
+ muteList: [],
|
|
|
},
|
|
|
isShowMuteTimeInput: false,
|
|
|
editLableName: "",
|
|
@@ -309,7 +553,7 @@ const manage = defineComponent({
|
|
|
currentTab: "",
|
|
|
noticeId: "", // 查看公告详情时
|
|
|
transferType: "",
|
|
|
- isSearch: false,
|
|
|
+ isSearch: true,
|
|
|
isRadio: false,
|
|
|
transferList: [],
|
|
|
selectedList: [],
|
|
@@ -330,6 +574,7 @@ const manage = defineComponent({
|
|
|
userList: [],
|
|
|
transferTitle: "",
|
|
|
member: {
|
|
|
+ friendList: [],
|
|
|
admin: [],
|
|
|
member: [],
|
|
|
muteMember: [],
|
|
@@ -339,16 +584,16 @@ const manage = defineComponent({
|
|
|
page: 1, // 当前默认查询第一页数据
|
|
|
currentUserDetail: {} as any, // 用户信息
|
|
|
mutePage: 1,
|
|
|
- muteSearch: '',
|
|
|
+ muteSearch: "",
|
|
|
muteLoading: false,
|
|
|
muteTotal: 0,
|
|
|
groupDetail: {} as any,
|
|
|
- currentModel: 'not_mute'
|
|
|
+ currentModel: "not_mute",
|
|
|
});
|
|
|
|
|
|
const dialog: any = ref();
|
|
|
- const manageNotificationRef: any = ref()
|
|
|
- const manageNotificationDetailRef: any = ref()
|
|
|
+ const manageNotificationRef: any = ref();
|
|
|
+ const manageNotificationDetailRef: any = ref();
|
|
|
|
|
|
watchEffect(() => {
|
|
|
data.conversation = props.conversation;
|
|
@@ -356,7 +601,10 @@ const manage = defineComponent({
|
|
|
data.show = props.show;
|
|
|
});
|
|
|
|
|
|
- const VuexStore = ((window as any)?.TUIKitTUICore?.isOfficial && (Vuex as any)?.useStore()) || {};
|
|
|
+ const VuexStore =
|
|
|
+ ((window as any)?.TUIKitTUICore?.isOfficial &&
|
|
|
+ (Vuex as any)?.useStore()) ||
|
|
|
+ {};
|
|
|
|
|
|
const TabName = computed(() => {
|
|
|
let name = "";
|
|
@@ -365,17 +613,17 @@ const manage = defineComponent({
|
|
|
name = "群公告";
|
|
|
break;
|
|
|
case "notificationAdd":
|
|
|
- case "notificationAddDetail":
|
|
|
- name = '新建群公告';
|
|
|
+ case "notificationAddDetail":
|
|
|
+ name = "新建群公告";
|
|
|
break;
|
|
|
case "notificationUpdate":
|
|
|
case "notificationUpdateDetail":
|
|
|
- name = '编辑群公告';
|
|
|
+ name = "编辑群公告";
|
|
|
break;
|
|
|
case "notificationDetail":
|
|
|
name = "公告详情";
|
|
|
break;
|
|
|
- case "member":
|
|
|
+ case "member":
|
|
|
name = "群成员";
|
|
|
break;
|
|
|
case "profile":
|
|
@@ -413,7 +661,9 @@ const manage = defineComponent({
|
|
|
return item;
|
|
|
});
|
|
|
const time: number = new Date().getTime();
|
|
|
- data.member.muteMember = newValue.filter((item: any) => item?.muteUntil * 1000 - time > 0);
|
|
|
+ data.member.muteMember = newValue.filter(
|
|
|
+ (item: any) => item?.muteUntil * 1000 - time > 0
|
|
|
+ );
|
|
|
},
|
|
|
{ deep: true }
|
|
|
);
|
|
@@ -522,10 +772,10 @@ const manage = defineComponent({
|
|
|
const options: any = {
|
|
|
groupId: conversation?.groupProfile?.groupID,
|
|
|
rows: 100,
|
|
|
- groupMute: data.currentModel === 'not_mute' ? false : true,
|
|
|
- groupRoleTypes: ['Member'],
|
|
|
+ groupMute: data.currentModel === "not_mute" ? false : true,
|
|
|
+ groupRoleTypes: ["Member"],
|
|
|
page: type && type === "more" ? data.mutePage + 1 : data.mutePage,
|
|
|
- keyword: data.muteSearch
|
|
|
+ keyword: data.muteSearch,
|
|
|
};
|
|
|
await imGroupMemberPage(options).then((res: any) => {
|
|
|
const rows = res.data.rows || [];
|
|
@@ -649,20 +899,34 @@ const manage = defineComponent({
|
|
|
};
|
|
|
await GroupServer.setGroupMemberMuteTime(options);
|
|
|
if (type === "add") {
|
|
|
- (window as any)?.TUIKitTUICore?.isOfficial && VuexStore?.commit && VuexStore?.commit("handleTask", 4);
|
|
|
+ (window as any)?.TUIKitTUICore?.isOfficial &&
|
|
|
+ VuexStore?.commit &&
|
|
|
+ VuexStore?.commit("handleTask", 4);
|
|
|
}
|
|
|
getMember();
|
|
|
};
|
|
|
|
|
|
+ /** 移除成员 */
|
|
|
const kickedOut = async (userIDList: any) => {
|
|
|
+ console.log("🚀 ~ :909 ~ kickedOut ~ userIDList:", userIDList)
|
|
|
const { conversation } = data;
|
|
|
- const options: any = {
|
|
|
- groupID: conversation.groupProfile.groupID,
|
|
|
- userIDList,
|
|
|
- reason: "",
|
|
|
- };
|
|
|
- await GroupServer.deleteGroupMember(options);
|
|
|
- getMember();
|
|
|
+ // const options: any = {
|
|
|
+ // groupID: conversation.groupProfile.groupID,
|
|
|
+ // userIDList,
|
|
|
+ // reason: "",
|
|
|
+ // };
|
|
|
+ // await GroupServer.deleteGroupMember(options);
|
|
|
+
|
|
|
+ try {
|
|
|
+ const options: any = {
|
|
|
+ groupId: conversation.groupProfile.groupID,
|
|
|
+ imUserIds: userIDList,
|
|
|
+ };
|
|
|
+ await imGroupMemberRemoveMemberList(options)
|
|
|
+
|
|
|
+ getGroupDetail()
|
|
|
+ getMember();
|
|
|
+ } catch {}
|
|
|
};
|
|
|
|
|
|
const edit = (labelName: string) => {
|
|
@@ -671,22 +935,22 @@ const manage = defineComponent({
|
|
|
|
|
|
/** 群公告修改 */
|
|
|
const onNotificationChangeStatus = (type: string) => {
|
|
|
- if(type === "add") {
|
|
|
- data.currentTab = 'notificationAdd'
|
|
|
- } else if(type === "edit") {
|
|
|
- data.currentTab = 'notificationUpdate'
|
|
|
- } else if(type === "submit") {
|
|
|
- data.currentTab = 'notification'
|
|
|
- } else if(type === "addDetail") {
|
|
|
- data.currentTab = 'notificationAddDetail'
|
|
|
- } else if(type === "editDetail") {
|
|
|
- data.currentTab = 'notificationUpdateDetail'
|
|
|
- } else if(type === "submitDetail") {
|
|
|
- data.currentTab = 'notificationDetail'
|
|
|
- } else if(type === "deleteDetail") {
|
|
|
- data.currentTab = ""
|
|
|
+ if (type === "add") {
|
|
|
+ data.currentTab = "notificationAdd";
|
|
|
+ } else if (type === "edit") {
|
|
|
+ data.currentTab = "notificationUpdate";
|
|
|
+ } else if (type === "submit") {
|
|
|
+ data.currentTab = "notification";
|
|
|
+ } else if (type === "addDetail") {
|
|
|
+ data.currentTab = "notificationAddDetail";
|
|
|
+ } else if (type === "editDetail") {
|
|
|
+ data.currentTab = "notificationUpdateDetail";
|
|
|
+ } else if (type === "submitDetail") {
|
|
|
+ data.currentTab = "notificationDetail";
|
|
|
+ } else if (type === "deleteDetail") {
|
|
|
+ data.currentTab = "";
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
const updateProfile = async (params: any) => {
|
|
|
const { key, value } = params;
|
|
@@ -703,19 +967,25 @@ const manage = defineComponent({
|
|
|
};
|
|
|
|
|
|
const setTab = (tabName: string) => {
|
|
|
- if(data.currentTab === "notificationAdd" || data.currentTab === "notificationUpdate") {
|
|
|
- manageNotificationRef.value?.onCloseEdit()
|
|
|
- data.currentTab = 'notification'
|
|
|
- return
|
|
|
+ if (
|
|
|
+ data.currentTab === "notificationAdd" ||
|
|
|
+ data.currentTab === "notificationUpdate"
|
|
|
+ ) {
|
|
|
+ manageNotificationRef.value?.onCloseEdit();
|
|
|
+ data.currentTab = "notification";
|
|
|
+ return;
|
|
|
}
|
|
|
- if(data.currentTab === "notificationAddDetail" || data.currentTab === "notificationUpdateDetail") {
|
|
|
- manageNotificationDetailRef.value?.onCloseEdit()
|
|
|
- data.currentTab = 'notificationDetail'
|
|
|
- return
|
|
|
+ if (
|
|
|
+ data.currentTab === "notificationAddDetail" ||
|
|
|
+ data.currentTab === "notificationUpdateDetail"
|
|
|
+ ) {
|
|
|
+ manageNotificationDetailRef.value?.onCloseEdit();
|
|
|
+ data.currentTab = "notificationDetail";
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
- if(tabName === 'onlyMute') {
|
|
|
- getUserList()
|
|
|
+ if (tabName === "onlyMute") {
|
|
|
+ getUserList();
|
|
|
}
|
|
|
data.currentTab = tabName;
|
|
|
data.editLableName = "";
|
|
@@ -725,56 +995,47 @@ const manage = defineComponent({
|
|
|
if (!data.currentTab) {
|
|
|
data.transferType = "";
|
|
|
}
|
|
|
-
|
|
|
};
|
|
|
|
|
|
const handleSearchMember = async (value: string) => {
|
|
|
- let imResponse: any = {};
|
|
|
- let imMemberResponse: any = {};
|
|
|
- const options: any = {
|
|
|
- groupID: data.conversation.groupProfile.groupID,
|
|
|
- userIDList: [value],
|
|
|
- };
|
|
|
+ // let imResponse: any = {};
|
|
|
+ // let imMemberResponse: any = {};
|
|
|
+ // const options: any = {
|
|
|
+ // groupID: data.conversation.groupProfile.groupID,
|
|
|
+ // userIDList: [],
|
|
|
+ // };
|
|
|
+ console.log(data.transferType, "data.transferType");
|
|
|
switch (data.transferType) {
|
|
|
case "add":
|
|
|
- try {
|
|
|
- imMemberResponse = await GroupServer.getGroupMemberProfile(options);
|
|
|
- data.transferList = data.transferList.filter((item: any) => item.userID !== imResponse.data[0]?.userID);
|
|
|
- data.transferList = [...data.transferList, ...imResponse.data];
|
|
|
- if (imMemberResponse?.data?.memberList.length > 0) {
|
|
|
- data.transferList = data.transferList.map((item: any) => {
|
|
|
- if (item.userID === imMemberResponse?.data?.memberList[0].userID) {
|
|
|
- item.isDisabled = true;
|
|
|
- }
|
|
|
- return item;
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- const message = t("TUIChat.manage.该用户不存在");
|
|
|
- handleErrorPrompts(message, props);
|
|
|
- }
|
|
|
+ const list = data.member.friendList.filter((item: any) =>
|
|
|
+ item?.nick.includes(value)
|
|
|
+ );
|
|
|
+ data.transferList = list;
|
|
|
break;
|
|
|
case "remove":
|
|
|
try {
|
|
|
- imResponse = await GroupServer.getGroupMemberProfile(options);
|
|
|
- if (imResponse.data.memberList.length === 0) {
|
|
|
- const message = t("TUIChat.manage.该用户不在群组内");
|
|
|
- return handleErrorPrompts(message, props);
|
|
|
- }
|
|
|
- data.transferList = data.transferList.filter(
|
|
|
+ const transferList = data.userInfo.list.filter(
|
|
|
(item: any) =>
|
|
|
// eslint-disable-next-line no-unsafe-optional-chaining
|
|
|
- item.userID !== imResponse?.data?.memberList[0]?.userID
|
|
|
+ item.imUserId !==
|
|
|
+ data.conversation?.groupProfile?.selfInfo.userID &&
|
|
|
+ item?.nick.includes(value)
|
|
|
);
|
|
|
- data.transferList = [
|
|
|
- ...data.transferList,
|
|
|
- // eslint-disable-next-line no-unsafe-optional-chaining
|
|
|
- ...imResponse?.data?.memberList,
|
|
|
- ];
|
|
|
- } catch (error) {
|
|
|
- const message = t("TUIChat.manage.该用户不存在");
|
|
|
- handleErrorPrompts(message, props);
|
|
|
- }
|
|
|
+ data.transferList = transferList;
|
|
|
+ } catch (error) {}
|
|
|
+ break;
|
|
|
+ case "changeOwner":
|
|
|
+ const transferList = [
|
|
|
+ ...data.member.admin,
|
|
|
+ ...data.member.member,
|
|
|
+ ].filter(
|
|
|
+ (item) => item.roleType !== "STUDENT" && item?.nick.includes(value)
|
|
|
+ );
|
|
|
+ console.log(transferList, "transferList", value, [
|
|
|
+ ...data.member.admin,
|
|
|
+ ...data.member.member,
|
|
|
+ ])
|
|
|
+ data.transferList = transferList;
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -782,9 +1043,7 @@ const manage = defineComponent({
|
|
|
};
|
|
|
|
|
|
const submit = (userList: any) => {
|
|
|
- console.log(userList, data.transferType, " data.transferType");
|
|
|
- if(userList.length <= 0) return
|
|
|
-
|
|
|
+ if (userList.length <= 0) return;
|
|
|
if (data.transferType === "remove") {
|
|
|
data.userList = userList;
|
|
|
data.delDialogShow = !data.delDialogShow;
|
|
@@ -796,12 +1055,16 @@ const manage = defineComponent({
|
|
|
|
|
|
const friendList = async () => {
|
|
|
const list = await imUserFriendPage({ page: 1, rows: 999 });
|
|
|
- console.log(list, "lits");
|
|
|
const fristList = list.data.rows || [];
|
|
|
fristList.forEach((item: any) => {
|
|
|
item.nick = item.friendNickname;
|
|
|
});
|
|
|
- return fristList.filter((item: any) => !data.userInfo.list.some((infoItem: any) => infoItem.imUserId === item.imUserId));
|
|
|
+ return fristList.filter(
|
|
|
+ (item: any) =>
|
|
|
+ !data.userInfo.list.some(
|
|
|
+ (infoItem: any) => infoItem.imUserId === item.imUserId
|
|
|
+ )
|
|
|
+ );
|
|
|
};
|
|
|
|
|
|
const cancel = () => {
|
|
@@ -813,17 +1076,19 @@ const manage = defineComponent({
|
|
|
switch (type) {
|
|
|
case "add":
|
|
|
data.isRadio = false;
|
|
|
- data.transferList = await friendList();
|
|
|
- data.transferTitle = "添加成员";
|
|
|
+ const list = await friendList();
|
|
|
+ data.member.friendList = list;
|
|
|
+ data.transferList = list;
|
|
|
+ data.transferTitle = "添加群成员";
|
|
|
break;
|
|
|
case "remove":
|
|
|
data.isRadio = false;
|
|
|
data.transferList = data.userInfo.list.filter(
|
|
|
(item: any) =>
|
|
|
// eslint-disable-next-line no-unsafe-optional-chaining
|
|
|
- item.userID !== data.conversation?.groupProfile?.selfInfo.userID
|
|
|
+ item.imUserId !== data.conversation?.groupProfile?.selfInfo.userID
|
|
|
);
|
|
|
- data.transferTitle = "删除成员";
|
|
|
+ data.transferTitle = "移除群成员";
|
|
|
break;
|
|
|
case "addAdmin":
|
|
|
data.isRadio = true;
|
|
@@ -837,9 +1102,11 @@ const manage = defineComponent({
|
|
|
break;
|
|
|
case "changeOwner":
|
|
|
data.isRadio = true;
|
|
|
- data.transferList = [...data.member.admin, ...data.member.member].filter(item => item.roleType !== "STUDENT");
|
|
|
+ data.transferList = [
|
|
|
+ ...data.member.admin,
|
|
|
+ ...data.member.member,
|
|
|
+ ].filter((item) => item.roleType !== "STUDENT");
|
|
|
data.transferTitle = "转让群组";
|
|
|
- console.log(data.transferList, "data.transferList");
|
|
|
break;
|
|
|
case "addMute":
|
|
|
data.isRadio = true;
|
|
@@ -928,8 +1195,13 @@ const manage = defineComponent({
|
|
|
imGroupQuit({
|
|
|
id: data.conversation.groupProfile.groupID,
|
|
|
}).then(() => {
|
|
|
- eventGlobal.emit("removeGroup", data.conversation.groupProfile.groupID);
|
|
|
- manage.TUIServer.deleteConversation(data.conversation.conversationID);
|
|
|
+ eventGlobal.emit(
|
|
|
+ "removeGroup",
|
|
|
+ data.conversation.groupProfile.groupID
|
|
|
+ );
|
|
|
+ manage.TUIServer.deleteConversation(
|
|
|
+ data.conversation.conversationID
|
|
|
+ );
|
|
|
manage.TUIServer.store.conversation = {};
|
|
|
toggleShow();
|
|
|
});
|
|
@@ -940,8 +1212,13 @@ const manage = defineComponent({
|
|
|
id: data.conversation.groupProfile.groupID,
|
|
|
})
|
|
|
.then(() => {
|
|
|
- eventGlobal.emit("removeGroup", data.conversation.groupProfile.groupID);
|
|
|
- manage.TUIServer.deleteConversation(data.conversation.conversationID);
|
|
|
+ eventGlobal.emit(
|
|
|
+ "removeGroup",
|
|
|
+ data.conversation.groupProfile.groupID
|
|
|
+ );
|
|
|
+ manage.TUIServer.deleteConversation(
|
|
|
+ data.conversation.conversationID
|
|
|
+ );
|
|
|
manage.TUIServer.store.conversation = {};
|
|
|
toggleShow();
|
|
|
})
|
|
@@ -980,7 +1257,6 @@ const manage = defineComponent({
|
|
|
});
|
|
|
|
|
|
data.currentUserDetail = res.data;
|
|
|
-
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -989,7 +1265,9 @@ const manage = defineComponent({
|
|
|
/** 获取群详情 */
|
|
|
const getGroupDetail = async () => {
|
|
|
try {
|
|
|
- const res = await imGroupDetail({ id: data?.conversation?.groupProfile?.groupID });
|
|
|
+ const res = await imGroupDetail({
|
|
|
+ id: data?.conversation?.groupProfile?.groupID,
|
|
|
+ });
|
|
|
const tdata = res.data;
|
|
|
tdata.configJson = tdata.configJson ? JSON.parse(tdata.configJson) : {};
|
|
|
data.groupDetail = tdata;
|
|
@@ -1009,20 +1287,20 @@ const manage = defineComponent({
|
|
|
//
|
|
|
}
|
|
|
} else {
|
|
|
- data.currentTab = ''
|
|
|
+ data.currentTab = "";
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
|
|
|
onMounted(() => {
|
|
|
- eventGlobal.on('handleNotice', (id: any) => {
|
|
|
+ eventGlobal.on("handleNotice", (id: any) => {
|
|
|
data.show = !data.show;
|
|
|
- data.noticeId = id
|
|
|
- data.currentTab = "notificationDetail"
|
|
|
+ data.noticeId = id;
|
|
|
+ data.currentTab = "notificationDetail";
|
|
|
if (data.show) {
|
|
|
getMember();
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
try {
|
|
|
getGroupDetail();
|
|
|
getGroupMemberUserDetail();
|