Skip to content

Commit 0fdb4a6

Browse files
committed
fix: Error workspace id in resource manage
1 parent 17a60e4 commit 0fdb4a6

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

ui/src/components/resource-authorization-drawer/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ const handleSelectionChange = (val: any[]) => {
368368
}
369369
370370
const dialogVisible = ref(false)
371+
const rowWorkspaceId = ref<string | null>(null)
371372
const singleSelectDialogVisible = ref(false)
372373
const pendingPermissionChange = ref<{ val: any; row: any } | null>(null)
373374
const radioPermission = ref('')
@@ -431,7 +432,7 @@ function permissionsHandle(val: any, row: any) {
431432
}
432433
433434
function submitPermissions(obj: any) {
434-
const workspaceId = user.getWorkspaceId() || 'default'
435+
const workspaceId = rowWorkspaceId.value ?? user.getWorkspaceId() ?? 'default'
435436
loadSharedApi({ type: 'resourceAuthorization', systemType: apiType.value })
436437
.putResourceAuthorization(workspaceId, targetId.value, props.type, obj, loading)
437438
.then(() => {
@@ -440,7 +441,7 @@ function submitPermissions(obj: any) {
440441
})
441442
}
442443
const getPermissionList = () => {
443-
const workspaceId = user.getWorkspaceId() || 'default'
444+
const workspaceId = rowWorkspaceId.value ?? user.getWorkspaceId() ?? 'default'
444445
const params: any = {}
445446
if (searchForm.value[searchType.value]) {
446447
params[searchType.value] = searchForm.value[searchType.value]
@@ -466,9 +467,10 @@ const getPermissionList = () => {
466467
})
467468
}
468469
469-
const open = (id: string, folder_data?: any) => {
470+
const open = (id: string, folder_data?: any, workspace_id?: string) => {
470471
targetId.value = id
471472
folderData.value = folder_data
473+
rowWorkspaceId.value = workspace_id ?? null
472474
drawerVisible.value = true
473475
getPermissionList()
474476
}

ui/src/views/system-resource-management/ApplicationResourceIndex.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ const openTriggerDrawer = (data: any) => {
373373
const ResourceAuthorizationDrawerRef = ref()
374374
375375
function openAuthorization(item: any) {
376-
ResourceAuthorizationDrawerRef.value.open(item.id)
376+
ResourceAuthorizationDrawerRef.value.open(item.id, undefined, item.workspace_id)
377377
}
378378
379379
const apiInputParams = ref([])

ui/src/views/system-resource-management/KnowledgeResourceIndex.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ const paginationConfig = reactive({
377377
const ResourceAuthorizationDrawerRef = ref()
378378
379379
function openAuthorization(item: any) {
380-
ResourceAuthorizationDrawerRef.value.open(item.id)
380+
ResourceAuthorizationDrawerRef.value.open(item.id, undefined, item.workspace_id)
381381
}
382382
383383
const exportKnowledge = (item: any) => {

ui/src/views/system-resource-management/ModelResourceIndex.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ const MoreFilledPermission = () => {
319319
const ResourceAuthorizationDrawerRef = ref()
320320
321321
function openAuthorization(item: any) {
322-
ResourceAuthorizationDrawerRef.value.open(item.id)
322+
ResourceAuthorizationDrawerRef.value.open(item.id, undefined, item.workspace_id)
323323
}
324324
325325
const deleteModel = (row: any) => {

ui/src/views/system-resource-management/ToolResourceIndex.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ const openTriggerDrawer = (data: any) => {
558558
const ResourceAuthorizationDrawerRef = ref()
559559
560560
function openAuthorization(item: any) {
561-
ResourceAuthorizationDrawerRef.value.open(item.id)
561+
ResourceAuthorizationDrawerRef.value.open(item.id, undefined, item.workspace_id)
562562
}
563563
564564
function exportTool(row: any) {

0 commit comments

Comments
 (0)