mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Knowledge document problem
This commit is contained in:
parent
8231ae66e4
commit
ec8f33df83
|
|
@ -35,6 +35,7 @@ const systemManage = {
|
|||
problem_create: () => false,
|
||||
problem_relate: () => false,
|
||||
problem_delete: () => false,
|
||||
problem_edit: () => false,
|
||||
|
||||
folderCreate: () => false,
|
||||
folderEdit: () => false,
|
||||
|
|
|
|||
|
|
@ -165,6 +165,14 @@ const share = {
|
|||
],
|
||||
'OR'
|
||||
),
|
||||
problem_edit: () =>
|
||||
hasPermission (
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.SHARED_KNOWLEDGE_PROBLEM_EDIT
|
||||
],
|
||||
'OR'
|
||||
),
|
||||
folderCreate: () => false,
|
||||
folderEdit: () => false,
|
||||
folderDelete: () => false,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const workspaceShare = {
|
|||
problem_create: () => false,
|
||||
problem_relate: () => false,
|
||||
problem_delete: () => false,
|
||||
problem_edit: () => false,
|
||||
|
||||
folderCreate: () => false,
|
||||
folderEdit: () => false,
|
||||
|
|
|
|||
|
|
@ -240,6 +240,16 @@ const workspace = {
|
|||
],
|
||||
'OR',
|
||||
),
|
||||
problem_edit: (source_id:string) =>
|
||||
hasPermission(
|
||||
[
|
||||
new ComplexPermission([RoleConst.USER],[PermissionConst.KNOWLEDGE.getKnowledgeWorkspaceResourcePermission(source_id)],[],'AND'),
|
||||
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
|
||||
PermissionConst.KNOWLEDGE_PROBLEM_EDIT.getKnowledgeWorkspaceResourcePermission(source_id),
|
||||
PermissionConst.KNOWLEDGE_PROBLEM_EDIT.getWorkspacePermissionWorkspaceManageRole,
|
||||
],
|
||||
'OR',
|
||||
),
|
||||
}
|
||||
|
||||
export default workspace
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<ReadWrite
|
||||
@change="editName"
|
||||
:data="currentContent"
|
||||
:showEditIcon="true"
|
||||
:showEditIcon="permissionPrecise.problem_edit(id as string)"
|
||||
:maxlength="256"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
:title="item.title || '-'"
|
||||
class="cursor mb-8"
|
||||
:showIcon="false"
|
||||
@click.stop="editParagraph(item)"
|
||||
@click.stop="permissionPrecise.doc_edit(id as string) && editParagraph(item)"
|
||||
style="height: 210px"
|
||||
>
|
||||
<template #tag>
|
||||
|
|
@ -30,7 +30,9 @@
|
|||
:content="$t('views.problem.setting.cancelRelated')"
|
||||
placement="top"
|
||||
>
|
||||
<el-button type="primary" text @click.stop="disassociation(item)">
|
||||
<el-button type="primary" text @click.stop="disassociation(item)"
|
||||
v-if="permissionPrecise.doc_edit(id as string)"
|
||||
>
|
||||
<AppIcon iconName="app-quxiaoguanlian"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
|
@ -65,7 +67,9 @@
|
|||
</div>
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button @click="relateProblem">{{
|
||||
<el-button @click="relateProblem"
|
||||
v-if="permissionPrecise.doc_edit(id as string)"
|
||||
>{{
|
||||
$t('views.problem.relateParagraph.title')
|
||||
}}</el-button>
|
||||
<el-button @click="pre" :disabled="pre_disable || loading">{{
|
||||
|
|
@ -86,6 +90,7 @@ import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
|||
import RelateProblemDialog from './RelateProblemDialog.vue'
|
||||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||
import permissionMap from '@/permission'
|
||||
import { t } from '@/locales'
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
|
@ -127,6 +132,10 @@ const apiType = computed(() => {
|
|||
}
|
||||
})
|
||||
|
||||
const permissionPrecise = computed(() => {
|
||||
return permissionMap['knowledge'][apiType.value]
|
||||
})
|
||||
|
||||
const RelateProblemDialogRef = ref()
|
||||
const ParagraphDialogRef = ref()
|
||||
const loading = ref(false)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
<ReadWrite
|
||||
@change="editName($event, row.id)"
|
||||
:data="row.content"
|
||||
:showEditIcon="row.id === currentMouseId"
|
||||
:showEditIcon="permissionPrecise.problem_edit(id) && row.id === currentMouseId"
|
||||
:maxlength="256"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue