1111 <ReadWrite
1212 @change =" editName "
1313 :data =" currentContent "
14- :showEditIcon =" true "
14+ :showEditIcon =" permissionPrecise . problem_edit ( id as string ) "
1515 :maxlength =" 256 "
1616 />
1717 </el-form-item >
2121 :title =" item .title || ' -' "
2222 class="cursor mb-8"
2323 :showIcon =" false "
24- @click .stop =" editParagraph (item )"
24+ @click .stop =" permissionPrecise . doc_edit ( id as string ) && editParagraph (item )"
2525 style =" height : 210px "
2626 >
2727 <template #tag >
3030 :content =" $t('views.problem.setting.cancelRelated')"
3131 placement =" top"
3232 >
33- <el-button type =" primary" text @click.stop =" disassociation(item)" >
33+ <el-button type =" primary" text @click.stop =" disassociation(item)"
34+ v-if =" permissionPrecise.doc_edit(id as string)"
35+ >
3436 <AppIcon iconName="app-quxiaoguanlian"></AppIcon >
3537 </el-button >
3638 </el-tooltip >
6567 </div >
6668 <template #footer >
6769 <div >
68- <el-button @click =" relateProblem" >{{
70+ <el-button @click =" relateProblem"
71+ v-if =" permissionPrecise.doc_edit(id as string)"
72+ >{{
6973 $t('views.problem.relateParagraph.title')
7074 }}</el-button >
7175 <el-button @click =" pre" :disabled =" pre_disable || loading" >{{
@@ -86,6 +90,7 @@ import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
8690import RelateProblemDialog from ' ./RelateProblemDialog.vue'
8791import { MsgSuccess , MsgConfirm , MsgError } from ' @/utils/message'
8892import { loadSharedApi } from ' @/utils/dynamics-api/shared-api'
93+ import permissionMap from ' @/permission'
8994import { t } from ' @/locales'
9095const props = withDefaults (
9196 defineProps <{
@@ -127,6 +132,10 @@ const apiType = computed(() => {
127132 }
128133})
129134
135+ const permissionPrecise = computed (() => {
136+ return permissionMap [' knowledge' ][apiType .value ]
137+ })
138+
130139const RelateProblemDialogRef = ref ()
131140const ParagraphDialogRef = ref ()
132141const loading = ref (false )
0 commit comments