|
@@ -22,11 +22,17 @@
|
|
|
@handle="handleItem"
|
|
|
:types="types"
|
|
|
/>
|
|
|
+
|
|
|
+ <DialogTUI title="提示" :show="quitDialogShow" :isH5="isH5" :center="true" :isHeaderShow="!isH5" @submit="handleManage()" @update:show="(e) => (quitDialogShow = e)">
|
|
|
+ <p class="delDialog-title">该用户已注销,是否删除会话?</p>
|
|
|
+ </DialogTUI>
|
|
|
</ul>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, reactive, ref, toRefs, watch, watchEffect } from "vue";
|
|
|
import LiteItem from "../list-item";
|
|
|
+import DialogTUI from "../../../../components/dialogTUi/index.vue";
|
|
|
+import { api_getMessageUser } from '../../../../../api'
|
|
|
const TUIConversationList: any = defineComponent({
|
|
|
props: {
|
|
|
data: {
|
|
@@ -50,10 +56,12 @@ const TUIConversationList: any = defineComponent({
|
|
|
default: () => new Map(),
|
|
|
},
|
|
|
},
|
|
|
- components: { LiteItem },
|
|
|
+ components: { LiteItem, DialogTUI },
|
|
|
setup(props: any, ctx: any) {
|
|
|
const TUIServer: any = TUIConversationList?.TUIServer;
|
|
|
const obj = reactive({
|
|
|
+ quitDialogShow: false,
|
|
|
+ tempConversation: {},
|
|
|
data: {},
|
|
|
currentID: "",
|
|
|
toggleID: "",
|
|
@@ -78,9 +86,25 @@ const TUIConversationList: any = defineComponent({
|
|
|
{ deep: true }
|
|
|
);
|
|
|
|
|
|
- const handleListItem = (item: any) => {
|
|
|
- ctx.emit("handleItem", item);
|
|
|
+ const handleListItem = async (item: any) => {
|
|
|
+ try {
|
|
|
+ const {data} = await api_getMessageUser({
|
|
|
+ id: item.userProfile.userID
|
|
|
+ })
|
|
|
+ if(data.delFlag) {
|
|
|
+ obj.tempConversation = item
|
|
|
+ obj.quitDialogShow = true
|
|
|
+ } else {
|
|
|
+ ctx.emit("handleItem", item);
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
};
|
|
|
+ const handleManage = async () => {
|
|
|
+ handleDeleteConversation(obj.tempConversation);
|
|
|
+ }
|
|
|
|
|
|
const handleItem = (params: any) => {
|
|
|
const { name, conversation } = params;
|
|
@@ -160,6 +184,7 @@ const TUIConversationList: any = defineComponent({
|
|
|
|
|
|
return {
|
|
|
...toRefs(obj),
|
|
|
+ handleManage,
|
|
|
handleListItem,
|
|
|
handleItem,
|
|
|
handleToggleListItem,
|