Skip to content

Commit 75f75f0

Browse files
committed
refactor: improve code formatting and update API call for workspace list
1 parent b011cd7 commit 75f75f0

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ui/src/views/system-shared/AuthorizedWorkspaceDialog.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272
<span class="ml-4 lighter">{{ ele.name }}</span>
7373
</div>
7474
<el-button link>
75-
<el-icon @click="clearWorkspace(ele)" :size="18"><Close /></el-icon>
75+
<el-icon @click="clearWorkspace(ele)" :size="18">
76+
<Close/>
77+
</el-icon>
7678
</el-button>
7779
</div>
7880
</template>
@@ -81,16 +83,18 @@
8183

8284
<template #footer>
8385
<el-button @click="centerDialogVisible = false"> {{ $t('common.cancel') }}</el-button>
84-
<el-button type="primary" @click="handleConfirm"> {{ $t('common.add') }} </el-button>
86+
<el-button type="primary" @click="handleConfirm"> {{ $t('common.add') }}</el-button>
8587
</template>
8688
</el-dialog>
8789
</template>
8890

8991
<script lang="ts" setup>
90-
import { ref, computed } from 'vue'
91-
import type { CheckboxValueType } from 'element-plus'
92+
import {ref, computed} from 'vue'
93+
import type {CheckboxValueType} from 'element-plus'
9294
import authorizationApi from '@/api/system-shared/authorization'
9395
import workspaceApi from '@/api/workspace/workspace'
96+
import {loadPermissionApi} from "@/utils/dynamics-api/permission-api.ts";
97+
9498
const checkAll = ref(false)
9599
const isIndeterminate = ref(true)
96100
const checkedWorkspace = ref<any[]>([])
@@ -118,13 +122,13 @@ const handleCheckedWorkspaceChange = (value: CheckboxValueType[]) => {
118122
isIndeterminate.value = checkedCount > 0 && checkedCount < workspace.value.length
119123
}
120124
121-
const open = async ({ id }: any, type = 'Knowledge') => {
125+
const open = async ({id}: any, type = 'Knowledge') => {
122126
knowledge_id = id
123127
loading.value = true
124128
currentType = type
125129
const [authList, systemWorkspaceList] = await Promise.all([
126130
authorizationApi[`getSharedAuthorization${type}`](id),
127-
workspaceApi.getSystemWorkspaceList(),
131+
loadPermissionApi('workspace').getSystemWorkspaceList(),
128132
])
129133
workspace.value = systemWorkspaceList.data as any
130134
listType.value = (authList.data || {}).authentication_type || 'WHITE_LIST'

0 commit comments

Comments
 (0)