调整发起群聊,部门创建的权限
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run

This commit is contained in:
wwt 2025-03-20 14:39:57 +08:00
parent 8eb0f0b4f2
commit 1f64ffd8aa
3 changed files with 61 additions and 6 deletions

View File

@ -34,6 +34,14 @@ export const departmentV2TreeAll2 = (data) => {
data, data,
}) })
} }
// 查询是否有权限
export const userHasPermission = (data) => {
return request({
url: '/api/v1/contact/check/erp/rule',
method: 'POST',
data,
})
}
//获取指定部门下的所有岗位 //获取指定部门下的所有岗位
export const v2TreePositionByDepartment = (data) => { export const v2TreePositionByDepartment = (data) => {

View File

@ -33,6 +33,7 @@
</div> </div>
</div> </div>
<div <div
v-if="isHasPermission"
@click="groupActiveIndex = 1" @click="groupActiveIndex = 1"
class="groupCard secondPanel" class="groupCard secondPanel"
:class="groupActiveIndex === 1 ? 'activePanel' : ''" :class="groupActiveIndex === 1 ? 'activePanel' : ''"
@ -136,11 +137,30 @@ import { useChatList } from '@/store/chatList/index.js'
import { useAuth } from '@/store/auth' import { useAuth } from '@/store/auth'
import { useTalkStore, useUserStore } from '@/store' import { useTalkStore, useUserStore } from '@/store'
import { useGroupTypeStore } from '@/store/groupType' import { useGroupTypeStore } from '@/store/groupType'
import { userHasPermission } from '@/api/deps/index.js'
const { groupActiveIndex, depCheckedKeys } = useGroupTypeStore() const { groupActiveIndex, depCheckedKeys } = useGroupTypeStore()
const { userInfo } = useAuth()
onUnload(()=> { onUnload(()=> {
}) })
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(() => { const confirmBtnStatus = computed(() => {
let disabledT = false let disabledT = false
switch (groupActiveIndex.value) { switch (groupActiveIndex.value) {
@ -210,10 +230,10 @@ const handleConfirm = () => {
border-radius: 12rpx; border-radius: 12rpx;
&.firstPanel { &.firstPanel {
background-image: url('@/static/image/chatList/zu6033@2x.png'); background-image: url('@/static/image/chatList/zu6033@2x.png');
margin-bottom: 28rpx;
} }
&.secondPanel { &.secondPanel {
background-image: url('@/static/image/chatList/zu6031@2x.png'); background-image: url('@/static/image/chatList/zu6031@2x.png');
margin-top: 28rpx;
margin-bottom: 28rpx; margin-bottom: 28rpx;
} }
&.thirdPanel { &.thirdPanel {

View File

@ -11,10 +11,12 @@ import {
groupCreateDept, groupCreateDept,
departmentV2TreeAll, departmentV2TreeAll,
departmentV2TreeAll2, departmentV2TreeAll2,
userHasPermission,
userV2List, userV2List,
v2TreePositionByDepartment, v2TreePositionByDepartment,
} from '@/api/deps/index.js' } from '@/api/deps/index.js'
import { useAuth } from '@/store/auth'
const { userInfo } = useAuth()
export const useGroupTypeStore = createGlobalState(() => { export const useGroupTypeStore = createGlobalState(() => {
const groupName = ref('') const groupName = ref('')
const groupActiveIndex = ref(-1) // 当前激活的分组索引 const groupActiveIndex = ref(-1) // 当前激活的分组索引
@ -35,9 +37,34 @@ export const useGroupTypeStore = createGlobalState(() => {
depTreeMyList.value = res.data.nodes depTreeMyList.value = res.data.nodes
} }
} }
// userInfo?.value?.ID
const getDepsTreeMy2 = async () => { 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) { if (res.status === 0) {
depTreeMyList.value = res.data.nodes depTreeMyList.value = res.data.nodes
} }