From cd9cbea7d6e829685776e386ed18ed1a4ea4adc4 Mon Sep 17 00:00:00 2001 From: zhx Date: Fri, 12 Jun 2026 19:35:51 +0800 Subject: [PATCH] 1 --- .../components/team-manager-form-modal.vue | 49 +++++++++++++++++++ apps/src/views/team/manager-list.vue | 24 +++++++++ 2 files changed, 73 insertions(+) diff --git a/apps/src/views/team/components/team-manager-form-modal.vue b/apps/src/views/team/components/team-manager-form-modal.vue index 1cdd64b..364dbaf 100644 --- a/apps/src/views/team/components/team-manager-form-modal.vue +++ b/apps/src/views/team/components/team-manager-form-modal.vue @@ -13,6 +13,7 @@ import { FormItem, Input, Modal, + Switch, message, } from 'antdv-next'; @@ -30,6 +31,10 @@ const emit = defineEmits<{ const saving = ref(false); const form = reactive({ + canAddBdLeader: true, + canBanUser: true, + canGiftProps: true, + canUnbanUser: true, contact: '', id: '', regionId: '', @@ -51,6 +56,10 @@ watch( form.sysOrigin = props.row?.sysOrigin || props.sysOrigin || 'LIKEI'; form.contact = props.row?.contact || ''; form.regionId = String(props.row?.regionId || ''); + form.canAddBdLeader = props.row?.canAddBdLeader !== false; + form.canGiftProps = props.row?.canGiftProps !== false; + form.canBanUser = props.row?.canBanUser !== false; + form.canUnbanUser = props.row?.canUnbanUser !== false; }, { immediate: true }, ); @@ -67,6 +76,10 @@ async function handleSubmit() { saving.value = true; try { const payload = { + canAddBdLeader: form.canAddBdLeader, + canBanUser: form.canBanUser, + canGiftProps: form.canGiftProps, + canUnbanUser: form.canUnbanUser, contact: form.contact.trim(), id: form.id || undefined, regionId: form.regionId, @@ -114,6 +127,42 @@ async function handleSubmit() { + +
+ + + + +
+
+ + diff --git a/apps/src/views/team/manager-list.vue b/apps/src/views/team/manager-list.vue index d64bec9..594d88a 100644 --- a/apps/src/views/team/manager-list.vue +++ b/apps/src/views/team/manager-list.vue @@ -23,6 +23,7 @@ import { Pagination, Space, Table, + Tag, message, } from 'antdv-next'; @@ -55,12 +56,20 @@ const columns = [ { dataIndex: 'userProfile', key: 'userProfile', title: '经理', width: 240 }, { dataIndex: 'regionName', key: 'regionName', title: '区域', width: 140 }, { dataIndex: 'contact', key: 'contact', title: '联系方式', width: 180 }, + { dataIndex: 'features', key: 'features', title: '功能开关', width: 280 }, { dataIndex: 'createUserName', key: 'createUserName', title: '创建人', width: 140 }, { dataIndex: 'updateUserName', key: 'updateUserName', title: '修改人', width: 140 }, { dataIndex: 'createTime', key: 'createTime', title: '创建时间', width: 180 }, { dataIndex: 'actions', key: 'actions', title: '操作', width: 120 }, ]; +const managerFeatureSwitches = [ + { key: 'canAddBdLeader', label: '加BD Leader' }, + { key: 'canGiftProps', label: '赠送道具' }, + { key: 'canBanUser', label: '封禁用户' }, + { key: 'canUnbanUser', label: '解封用户' }, +]; + function hasPermission(code: string) { const codes = accessStore.accessCodes || []; return codes.length === 0 || codes.includes(code); @@ -75,6 +84,10 @@ function getUserShortId(profile?: Record | null) { return profile?.actualAccount || profile?.account || profile?.id || '-'; } +function isFeatureEnabled(record: Record, key: string) { + return record?.[key] !== false; +} + async function loadData(reset = false) { if (reset) { query.cursor = 1; @@ -186,6 +199,17 @@ loadData(true); +