refactor: improve code formatting and update API call for workspace list

v3.2
wxg0103 2025-07-02 18:38:41 +08:00
parent b011cd7d26
commit 75f75f0111
1 changed files with 10 additions and 6 deletions

View File

@ -72,7 +72,9 @@
<span class="ml-4 lighter">{{ ele.name }}</span> <span class="ml-4 lighter">{{ ele.name }}</span>
</div> </div>
<el-button link> <el-button link>
<el-icon @click="clearWorkspace(ele)" :size="18"><Close /></el-icon> <el-icon @click="clearWorkspace(ele)" :size="18">
<Close/>
</el-icon>
</el-button> </el-button>
</div> </div>
</template> </template>
@ -91,6 +93,8 @@ import { ref, computed } from 'vue'
import type {CheckboxValueType} from 'element-plus' import type {CheckboxValueType} from 'element-plus'
import authorizationApi from '@/api/system-shared/authorization' import authorizationApi from '@/api/system-shared/authorization'
import workspaceApi from '@/api/workspace/workspace' import workspaceApi from '@/api/workspace/workspace'
import {loadPermissionApi} from "@/utils/dynamics-api/permission-api.ts";
const checkAll = ref(false) const checkAll = ref(false)
const isIndeterminate = ref(true) const isIndeterminate = ref(true)
const checkedWorkspace = ref<any[]>([]) const checkedWorkspace = ref<any[]>([])
@ -124,7 +128,7 @@ const open = async ({ id }: any, type = 'Knowledge') => {
currentType = type currentType = type
const [authList, systemWorkspaceList] = await Promise.all([ const [authList, systemWorkspaceList] = await Promise.all([
authorizationApi[`getSharedAuthorization${type}`](id), authorizationApi[`getSharedAuthorization${type}`](id),
workspaceApi.getSystemWorkspaceList(), loadPermissionApi('workspace').getSystemWorkspaceList(),
]) ])
workspace.value = systemWorkspaceList.data as any workspace.value = systemWorkspaceList.data as any
listType.value = (authList.data || {}).authentication_type || 'WHITE_LIST' listType.value = (authList.data || {}).authentication_type || 'WHITE_LIST'