@@ -326,6 +344,8 @@ watch(drawerVisible, (bool) => {
searchType.value = 'nick_name'
searchForm.value = { nick_name: '', username: '', permission: undefined }
permissionData.value = []
+ targetResource.value = null
+ folderData.value = null
paginationConfig.current_page = 1
paginationConfig.total = 0
multipleSelection.value = []
@@ -336,6 +356,7 @@ watch(drawerVisible, (bool) => {
const loading = ref(false)
const targetId = ref('')
const folderData = ref(null)
+const targetResource = ref(null)
const permissionData = ref([])
const searchType = ref('nick_name')
const searchForm = ref({
@@ -374,6 +395,32 @@ const singleSelectDialogVisible = ref(false)
const pendingPermissionChange = ref<{ val: any; row: any } | null>(null)
const radioPermission = ref('')
const authAllChildren = ref(false)
+
+const resourceTypeLabelMap: Record = {
+ APPLICATION: t('views.application.title'),
+ KNOWLEDGE: t('views.knowledge.title'),
+ TOOL: t('views.tool.title'),
+ MODEL: t('views.model.title'),
+}
+
+const resourceTypeLabel = computed(() => {
+ return props.isFolder
+ ? '文件夹'
+ : resourceTypeLabelMap[props.type] || t('views.system.resourceAuthorization.title')
+})
+
+const targetResourceName = computed(() => {
+ return targetResource.value?.name || folderData.value?.name || targetId.value || '-'
+})
+
+const getPermissionLabel = (permission: string) => {
+ return (
+ getFolderPermissionOptions().find((item) => item.value === permission)?.label ||
+ permission ||
+ '-'
+ )
+}
+
function openMulConfigureDialog() {
if (multipleSelection.value.length === 0) {
return
@@ -458,9 +505,10 @@ const getPermissionList = () => {
})
}
-const open = (id: string, folder_data?: any) => {
+const open = (id: string, resource_data?: any) => {
targetId.value = id
- folderData.value = folder_data
+ folderData.value = props.isFolder ? resource_data : null
+ targetResource.value = resource_data || null
drawerVisible.value = true
getPermissionList()
}
diff --git a/ui/src/layout/layout-header/SystemHeader.vue b/ui/src/layout/layout-header/SystemHeader.vue
index 1bfd5a0a4..1a6c6d40f 100644
--- a/ui/src/layout/layout-header/SystemHeader.vue
+++ b/ui/src/layout/layout-header/SystemHeader.vue
@@ -7,10 +7,10 @@
@@ -18,10 +18,11 @@