|
@@ -56,12 +56,13 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
-import { computed, defineComponent, onMounted, reactive, toRefs } from "vue";
|
|
|
+import { computed, defineComponent, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
|
|
import { caculateTimeago } from "../utils";
|
|
|
import { handleAvatar, handleName, handleAt } from "../TUIChat/utils/utils";
|
|
|
import { imGroupPage, imGroupDetail } from "../../../api";
|
|
|
import { useThrottleFn } from "@vueuse/core";
|
|
|
import DialogTUI from "../../components/dialogTUi/index.vue";
|
|
|
+import { eventGlobal } from "@/helpers";
|
|
|
const TUIGroup = defineComponent({
|
|
|
name: "TUIGroup",
|
|
|
components: { DialogTUI },
|
|
@@ -150,8 +151,23 @@ const TUIGroup = defineComponent({
|
|
|
data.loading = false;
|
|
|
};
|
|
|
|
|
|
+ /** 删除移除的组和退出的群 */
|
|
|
+ const onRemoveGroup = (groupId: any) => {
|
|
|
+ const index = data.groupList.findIndex((group: any) => group.groupId == groupId);
|
|
|
+
|
|
|
+ data.groupList.splice(index, 1);
|
|
|
+ };
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
+
|
|
|
+ eventGlobal.on("removeGroup", (groupId: any) => {
|
|
|
+ onRemoveGroup(groupId);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ onUnmounted(() => {
|
|
|
+ eventGlobal.off("removeGroup", onRemoveGroup);
|
|
|
});
|
|
|
|
|
|
const noSearch = (val: string) => {
|