fix: Knowledge document problem
This commit is contained in:
parent
8231ae66e4
commit
ec8f33df83
@ -35,6 +35,7 @@ const systemManage = {
|
|||||||
problem_create: () => false,
|
problem_create: () => false,
|
||||||
problem_relate: () => false,
|
problem_relate: () => false,
|
||||||
problem_delete: () => false,
|
problem_delete: () => false,
|
||||||
|
problem_edit: () => false,
|
||||||
|
|
||||||
folderCreate: () => false,
|
folderCreate: () => false,
|
||||||
folderEdit: () => false,
|
folderEdit: () => false,
|
||||||
|
|||||||
@ -165,6 +165,14 @@ const share = {
|
|||||||
],
|
],
|
||||||
'OR'
|
'OR'
|
||||||
),
|
),
|
||||||
|
problem_edit: () =>
|
||||||
|
hasPermission (
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.SHARED_KNOWLEDGE_PROBLEM_EDIT
|
||||||
|
],
|
||||||
|
'OR'
|
||||||
|
),
|
||||||
folderCreate: () => false,
|
folderCreate: () => false,
|
||||||
folderEdit: () => false,
|
folderEdit: () => false,
|
||||||
folderDelete: () => false,
|
folderDelete: () => false,
|
||||||
|
|||||||
@ -26,6 +26,7 @@ const workspaceShare = {
|
|||||||
problem_create: () => false,
|
problem_create: () => false,
|
||||||
problem_relate: () => false,
|
problem_relate: () => false,
|
||||||
problem_delete: () => false,
|
problem_delete: () => false,
|
||||||
|
problem_edit: () => false,
|
||||||
|
|
||||||
folderCreate: () => false,
|
folderCreate: () => false,
|
||||||
folderEdit: () => false,
|
folderEdit: () => false,
|
||||||
|
|||||||
@ -240,6 +240,16 @@ const workspace = {
|
|||||||
],
|
],
|
||||||
'OR',
|
'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
|
export default workspace
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<ReadWrite
|
<ReadWrite
|
||||||
@change="editName"
|
@change="editName"
|
||||||
:data="currentContent"
|
:data="currentContent"
|
||||||
:showEditIcon="true"
|
:showEditIcon="permissionPrecise.problem_edit(id as string)"
|
||||||
:maxlength="256"
|
:maxlength="256"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
:title="item.title || '-'"
|
:title="item.title || '-'"
|
||||||
class="cursor mb-8"
|
class="cursor mb-8"
|
||||||
:showIcon="false"
|
:showIcon="false"
|
||||||
@click.stop="editParagraph(item)"
|
@click.stop="permissionPrecise.doc_edit(id as string) && editParagraph(item)"
|
||||||
style="height: 210px"
|
style="height: 210px"
|
||||||
>
|
>
|
||||||
<template #tag>
|
<template #tag>
|
||||||
@ -30,7 +30,9 @@
|
|||||||
:content="$t('views.problem.setting.cancelRelated')"
|
:content="$t('views.problem.setting.cancelRelated')"
|
||||||
placement="top"
|
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>
|
<AppIcon iconName="app-quxiaoguanlian"></AppIcon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -65,7 +67,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div>
|
<div>
|
||||||
<el-button @click="relateProblem">{{
|
<el-button @click="relateProblem"
|
||||||
|
v-if="permissionPrecise.doc_edit(id as string)"
|
||||||
|
>{{
|
||||||
$t('views.problem.relateParagraph.title')
|
$t('views.problem.relateParagraph.title')
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
<el-button @click="pre" :disabled="pre_disable || loading">{{
|
<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 RelateProblemDialog from './RelateProblemDialog.vue'
|
||||||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
|
import permissionMap from '@/permission'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@ -127,6 +132,10 @@ const apiType = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const permissionPrecise = computed(() => {
|
||||||
|
return permissionMap['knowledge'][apiType.value]
|
||||||
|
})
|
||||||
|
|
||||||
const RelateProblemDialogRef = ref()
|
const RelateProblemDialogRef = ref()
|
||||||
const ParagraphDialogRef = ref()
|
const ParagraphDialogRef = ref()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
<ReadWrite
|
<ReadWrite
|
||||||
@change="editName($event, row.id)"
|
@change="editName($event, row.id)"
|
||||||
:data="row.content"
|
:data="row.content"
|
||||||
:showEditIcon="row.id === currentMouseId"
|
:showEditIcon="permissionPrecise.problem_edit(id) && row.id === currentMouseId"
|
||||||
:maxlength="256"
|
:maxlength="256"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user