From f08a81f01bc4a4104dd9ef04e071bb0bd0eb8afe Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 23 七月 2026 10:50:19 +0800
Subject: [PATCH] Merge branch 'dev_pro2.0' of http://114.132.189.42:9002/r/mom-pro2-before into dev_pro2.0

---
 src/views/im/manager/group/index.vue |  167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 167 insertions(+), 0 deletions(-)

diff --git a/src/views/im/manager/group/index.vue b/src/views/im/manager/group/index.vue
new file mode 100644
index 0000000..b234d21
--- /dev/null
+++ b/src/views/im/manager/group/index.vue
@@ -0,0 +1,167 @@
+<script lang="ts" setup>
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { ImManagerGroupApi } from '#/api/im/manager/group';
+
+import { ref } from 'vue';
+import { useRouter } from 'vue-router';
+
+import { confirm, Page, useVbenModal } from '#/packages/effects/common-ui/src';
+import { CommonStatusEnum, DICT_TYPE } from '#/packages/constants/src';
+
+import { Avatar, message, Tag, Tooltip } from 'ant-design-vue';
+
+import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import {
+  dissolveManagerGroup,
+  getManagerGroupPage,
+  unbanManagerGroup,
+} from '#/api/im/manager/group';
+import { DictTag } from '#/components/dict-tag';
+import { formatUserLabel } from '#/views/im/manager/utils/format';
+
+import { useGroupGridColumns, useGroupGridFormSchema } from './data';
+import BanForm from './modules/ban-form.vue';
+import Detail from './modules/detail.vue';
+
+defineOptions({ name: 'ImManagerGroup' });
+
+const router = useRouter();
+const detailRef = ref<InstanceType<typeof Detail>>();
+
+const [BanModal, banModalApi] = useVbenModal({
+  connectedComponent: BanForm,
+  destroyOnClose: true,
+});
+
+/** 鍒锋柊琛ㄦ牸 */
+function handleRefresh() {
+  gridApi.query();
+}
+
+/** 鎵撳紑璇︽儏 */
+function handleDetail(row: ImManagerGroupApi.Group) {
+  detailRef.value?.open(row);
+}
+
+/** 鏌ョ湅缇よ亰娑堟伅 */
+function handleConversation(row: ImManagerGroupApi.Group) {
+  router.push({
+    name: 'ImGroupMessage',
+    query: { groupId: row.id },
+  });
+}
+
+/** 鎵撳紑灏佺寮圭獥 */
+function handleBan(row: ImManagerGroupApi.Group) {
+  banModalApi.setData(row).open();
+}
+
+/** 瑙e皝缇� */
+async function handleUnban(row: ImManagerGroupApi.Group) {
+  await confirm(`纭瑙e皝缇ゃ��${row.name}銆嶅悧锛焋);
+  await unbanManagerGroup(row.id);
+  message.success('瑙e皝鎴愬姛');
+  handleRefresh();
+}
+
+/** 瑙f暎缇� */
+async function handleDissolve(row: ImManagerGroupApi.Group) {
+  await confirm(`纭瑙f暎缇ゃ��${row.name}銆嶅悧锛焋);
+  await dissolveManagerGroup(row.id);
+  message.success('瑙f暎鎴愬姛');
+  handleRefresh();
+}
+
+const [Grid, gridApi] = useVbenVxeGrid({
+  formOptions: {
+    schema: useGroupGridFormSchema(),
+  },
+  gridOptions: {
+    columns: useGroupGridColumns(),
+    height: 'auto',
+    keepSource: true,
+    proxyConfig: {
+      ajax: {
+        query: async ({ page }, formValues) => {
+          return await getManagerGroupPage({
+            pageNo: page.currentPage,
+            pageSize: page.pageSize,
+            ...formValues,
+          });
+        },
+      },
+    },
+    rowConfig: {
+      keyField: 'id',
+      isHover: true,
+    },
+    toolbarConfig: {
+      refresh: true,
+      search: true,
+    },
+  } as VxeTableGridOptions<ImManagerGroupApi.Group>,
+});
+</script>
+
+<template>
+  <Page auto-content-height>
+    <BanModal @success="handleRefresh" />
+    <Detail ref="detailRef" />
+    <Grid table-title="缇ゅ垪琛�">
+      <template #avatar="{ row }">
+        <Avatar :src="row.avatar" :size="40">
+          {{ row.name?.charAt(0) || '?' }}
+        </Avatar>
+      </template>
+      <template #owner="{ row }">
+        {{ formatUserLabel(row.ownerNickname, row.ownerUserId) }}
+      </template>
+      <template #banned="{ row }">
+        <Tooltip v-if="row.banned" :title="row.bannedReason">
+          <DictTag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.banned" />
+        </Tooltip>
+        <DictTag v-else :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.banned" />
+      </template>
+      <template #mutedAll="{ row }">
+        <Tag v-if="row.mutedAll" color="error">宸茬瑷�</Tag>
+        <Tag v-else>鏈瑷�</Tag>
+      </template>
+      <template #actions="{ row }">
+        <TableAction
+          :actions="[
+            {
+              label: '璇︽儏',
+              type: 'link',
+              icon: ACTION_ICON.VIEW,
+              auth: ['im:manager:group:query'],
+              onClick: handleDetail.bind(null, row),
+            },
+            {
+              label: '鏌ョ湅瀵硅瘽',
+              type: 'link',
+              icon: ACTION_ICON.VIEW,
+              onClick: handleConversation.bind(null, row),
+            },
+            {
+              label: row.banned ? '瑙e皝' : '灏佺',
+              type: 'link',
+              danger: !row.banned,
+              icon: ACTION_ICON.CLOSE,
+              auth: ['im:manager:group:ban'],
+              onClick: row.banned ? handleUnban.bind(null, row) : handleBan.bind(null, row),
+            },
+            {
+              label: '瑙f暎',
+              type: 'link',
+              danger: true,
+              icon: ACTION_ICON.DELETE,
+              auth: ['im:manager:group:dissolve'],
+              ifShow: row.status === CommonStatusEnum.ENABLE,
+              onClick: handleDissolve.bind(null, row),
+            },
+          ]"
+        />
+      </template>
+    </Grid>
+  </Page>
+</template>

--
Gitblit v1.9.3