@@ -99,7 +99,6 @@ import { hasPermission } from '@/utils/permission/index'
9999import WorkspaceApi from ' @/api/workspace/workspace.ts'
100100import type { WorkspaceItem } from ' @/api/type/workspace'
101101
102- const PermissionSettingRef = ref ()
103102const loading = ref (false )
104103const rLoading = ref (false )
105104const memberList = ref <any []>([]) // 全部成员
@@ -162,8 +161,8 @@ function submitPermissions() {
162161 auth_type: item .isRole ? ' ROLE' : ' RESOURCE_PERMISSION_GROUP' ,
163162 }
164163 })
165- . reduce (( pre : any , next : any ) => [ ... pre , ... next ], [])
166- })
164+
165+ }). reduce (( pre : any , next : any ) => [ ... pre , ... next ], [])
167166
168167 AuthorizationApi .putResourceAuthorization (
169168 currentWorkspaceId .value || ' default' ,
@@ -295,6 +294,7 @@ const getWholeTree = async (user_id: string) => {
295294 let folderIdMap = []
296295 const folderTree = cloneDeep ((parentRes as unknown as any ).data )
297296 if (Object .keys (childrenRes .data ).indexOf (item .value ) !== - 1 ) {
297+ item .isRole = childrenRes .data [item .value ].length > 0 && childrenRes .data [item .value ][0 ].permission .ROLE
298298 folderIdMap = getFolderIdMap (childrenRes .data [item .value ])
299299 dfsFolder (folderTree , folderIdMap )
300300 const permissionHalf = {
@@ -337,34 +337,16 @@ const getFolderIdMap = (arr: any = []) => {
337337 return pre
338338 }, {})
339339}
340- function ResourcePermissions(user_id : string ) {
341- AuthorizationApi .getResourceAuthorization (
342- currentWorkspaceId .value || ' default' ,
343- user_id ,
344- rLoading ,
345- ).then ((res ) => {
346- if (! res .data || Object .keys (res .data ).length > 0 ) {
347- settingTags .map ((item : any ) => {
348- if (Object .keys (res .data ).indexOf (item .value ) !== - 1 ) {
349- item .data = res .data [item .value ]
350- getFolderIdMap (item .data )
351- }
352- })
353- }
354- })
355- }
356340
357341const workspaceList = ref <WorkspaceItem []>([])
358342const currentWorkspaceId = ref <string | undefined >(' ' )
359343const currentWorkspace = computed (() => {
360344 return workspaceList .value .find ((w ) => w .id == currentWorkspaceId .value )
361345})
362346async function getWorkspaceList() {
363- if (user .isEE ()) {
364- const res = await WorkspaceApi .getSystemWorkspaceList (loading )
365- workspaceList .value = res .data
366- currentWorkspaceId .value = ' default'
367- }
347+ const res = await WorkspaceApi .getSystemWorkspaceList (loading )
348+ workspaceList .value = res .data
349+ currentWorkspaceId .value = ' default'
368350}
369351
370352function changeWorkspace(item : WorkspaceItem ) {
@@ -380,7 +362,9 @@ onMounted(() => {
380362 tableHeight .value = window .innerHeight - 330
381363 })()
382364 }
383- getWorkspaceList ()
365+ if (user .isEE ()) {
366+ getWorkspaceList ()
367+ }
384368 getMember ()
385369})
386370 </script >
0 commit comments