From 1f64ffd8aa5ec9a0177543db3c722e34275510ab Mon Sep 17 00:00:00 2001 From: wwt Date: Thu, 20 Mar 2025 14:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=91=E8=B5=B7=E7=BE=A4?= =?UTF-8?q?=E8=81=8A=EF=BC=8C=E9=83=A8=E9=97=A8=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/deps/index.js | 8 +++++++ src/pages/chooseGroupType/index.vue | 26 ++++++++++++++++++++--- src/store/groupType/index.js | 33 ++++++++++++++++++++++++++--- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/src/api/deps/index.js b/src/api/deps/index.js index f7659f4..60bc0b9 100644 --- a/src/api/deps/index.js +++ b/src/api/deps/index.js @@ -34,6 +34,14 @@ export const departmentV2TreeAll2 = (data) => { data, }) } +// 查询是否有权限 +export const userHasPermission = (data) => { + return request({ + url: '/api/v1/contact/check/erp/rule', + method: 'POST', + data, + }) +} //获取指定部门下的所有岗位 export const v2TreePositionByDepartment = (data) => { diff --git a/src/pages/chooseGroupType/index.vue b/src/pages/chooseGroupType/index.vue index 90c3051..f7d908c 100644 --- a/src/pages/chooseGroupType/index.vue +++ b/src/pages/chooseGroupType/index.vue @@ -33,6 +33,7 @@
{ - + }) +const isHasPermission = ref(false) +onShow( async() =>{ + const isHasRes = await userHasPermission({ + erpUserId: userInfo?.value?.ID, + ruleUrl: [ + "auth_chat_app_create_all_dept", + "auth_chat_app_create_limit_dept" + ] + }) + if (isHasRes.code === 200) { + if (isHasRes.data.auth_chat_app_create_all_dept || isHasRes.data.auth_chat_app_create_limit_dept) { + isHasPermission.value = true + } else{ + isHasPermission.value = false + } + } +}) + const confirmBtnStatus = computed(() => { let disabledT = false switch (groupActiveIndex.value) { @@ -210,10 +230,10 @@ const handleConfirm = () => { border-radius: 12rpx; &.firstPanel { background-image: url('@/static/image/chatList/zu6033@2x.png'); + margin-bottom: 28rpx; } &.secondPanel { background-image: url('@/static/image/chatList/zu6031@2x.png'); - margin-top: 28rpx; margin-bottom: 28rpx; } &.thirdPanel { diff --git a/src/store/groupType/index.js b/src/store/groupType/index.js index 7ea9e78..2bd9b0b 100644 --- a/src/store/groupType/index.js +++ b/src/store/groupType/index.js @@ -11,10 +11,12 @@ import { groupCreateDept, departmentV2TreeAll, departmentV2TreeAll2, + userHasPermission, userV2List, v2TreePositionByDepartment, } from '@/api/deps/index.js' - +import { useAuth } from '@/store/auth' +const { userInfo } = useAuth() export const useGroupTypeStore = createGlobalState(() => { const groupName = ref('') const groupActiveIndex = ref(-1) // 当前激活的分组索引 @@ -35,9 +37,34 @@ export const useGroupTypeStore = createGlobalState(() => { depTreeMyList.value = res.data.nodes } } - +// userInfo?.value?.ID const getDepsTreeMy2 = async () => { - const res = await departmentV2TreeAll2() + const isHasRes = await userHasPermission({ + erpUserId: userInfo?.value?.ID, + ruleUrl: [ + "auth_chat_app_create_all_dept", + "auth_chat_app_create_limit_dept" + ] + }) + let pramas = { nowUserId : 0 } + if (isHasRes.code === 200) { + if (isHasRes.data.auth_chat_app_create_all_dept) { + pramas = { + nowUserId : 0 + } + } else{ + if (isHasRes.data.auth_chat_app_create_limit_dept) { + pramas = { + nowUserId : userInfo?.value?.ID + } + } else { + pramas = { + nowUserId : 0 + } + } + } + } + const res = await departmentV2TreeAll2(pramas) if (res.status === 0) { depTreeMyList.value = res.data.nodes }