mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-30 09:42:48 +00:00
perf: Morefield paragraph tool
This commit is contained in:
parent
42a4ab4e9a
commit
f6b271e929
|
|
@ -14,6 +14,7 @@ const systemManage = {
|
|||
),
|
||||
delete: () => false,
|
||||
create: () => false,
|
||||
import: () => false,
|
||||
switch: () => false,
|
||||
edit: () => false,
|
||||
copy: () => false,
|
||||
|
|
|
|||
|
|
@ -11,6 +11,14 @@ const share = {
|
|||
],
|
||||
'OR',
|
||||
),
|
||||
import: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.SHARED_TOOL_IMPORT,
|
||||
],
|
||||
'OR',
|
||||
),
|
||||
delete: () =>
|
||||
hasPermission(
|
||||
[
|
||||
|
|
|
|||
|
|
@ -20,6 +20,16 @@ const workspace = {
|
|||
],
|
||||
'OR'
|
||||
),
|
||||
import: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
|
||||
RoleConst.USER.getWorkspaceRole,
|
||||
PermissionConst.TOOL_IMPORT.getWorkspacePermission,
|
||||
PermissionConst.TOOL_IMPORT.getWorkspacePermissionWorkspaceManageRole
|
||||
],
|
||||
'OR'
|
||||
),
|
||||
folderCreate: () =>
|
||||
hasPermission(
|
||||
[
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
shadow="always"
|
||||
style="--el-card-padding: 8px 12px; --el-card-border-radius: 8px"
|
||||
@click.stop
|
||||
v-if="MoreFieldPermission(id)"
|
||||
>
|
||||
<el-switch
|
||||
:loading="changeStateloading"
|
||||
|
|
@ -42,7 +43,9 @@
|
|||
</el-icon>
|
||||
</el-button>
|
||||
</span>
|
||||
<el-dropdown trigger="click" :teleported="false">
|
||||
<el-dropdown trigger="click" :teleported="false"
|
||||
v-if="MoreFieldPermission(id)"
|
||||
>
|
||||
<el-button text>
|
||||
<el-icon><MoreFilled /></el-icon>
|
||||
</el-button>
|
||||
|
|
@ -154,6 +157,11 @@ const permissionPrecise = computed (() => {
|
|||
return permissionMap['knowledge'][apiType.value]
|
||||
})
|
||||
|
||||
const MoreFieldPermission = (id:any) => {
|
||||
return permissionPrecise.value.doc_generate(id) ||
|
||||
permissionPrecise.value.doc_edit(id)
|
||||
}
|
||||
|
||||
const emit = defineEmits(['dialogVisibleChange','clickCard','changeState', 'deleteParagraph', 'refresh', 'refreshMigrateParagraph','move'])
|
||||
const loading = ref(false)
|
||||
const changeStateloading = ref(false)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,9 @@
|
|||
:on-change="(file: any, fileList: any) => importTool(file)"
|
||||
class="import-button"
|
||||
>
|
||||
<el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="permissionPrecise.import()"
|
||||
>
|
||||
<div class="flex align-center w-full">
|
||||
<el-avatar shape="square" class="mt-4" :size="36" style="background: none">
|
||||
<img src="@/assets/icon_import.svg" alt="" />
|
||||
|
|
@ -195,7 +197,8 @@
|
|||
</div>
|
||||
</template>
|
||||
<template #mouseEnter>
|
||||
<div @click.stop v-if="!isShared">
|
||||
<div @click.stop v-if="!isShared &&
|
||||
MoreFieldPermission(item.id)">
|
||||
<el-switch
|
||||
v-model="item.is_active"
|
||||
:before-change="() => changeState(item)"
|
||||
|
|
@ -350,6 +353,12 @@ const permissionPrecise = computed(() => {
|
|||
return permissionMap['tool'][apiType.value]
|
||||
})
|
||||
|
||||
const MoreFieldPermission = (id: any) => {
|
||||
return (permissionPrecise.value.edit(id) ||
|
||||
permissionPrecise.value.export(id) ||
|
||||
permissionPrecise.value.delete(id) || isSystemShare.value)
|
||||
}
|
||||
|
||||
const InitParamDrawerRef = ref()
|
||||
const search_type = ref('name')
|
||||
const search_form = ref<any>({
|
||||
|
|
|
|||
Loading…
Reference in New Issue