Skip to content

Commit 009aed7

Browse files
committed
fix: Problem related permission
1 parent 1540fcd commit 009aed7

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

ui/src/views/paragraph/component/ProblemComponent.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<span class="flex align-center">
44
<span>{{ $t('views.paragraph.relatedProblem.title') }}</span>
55
<el-divider direction="vertical" class="mr-4" />
6-
<el-button text @click="addProblem">
6+
<el-button text @click="addProblem"
7+
v-if="permissionPrecise.problem_relate(id)"
8+
>
79
<el-icon><Plus /></el-icon>
810
</el-button>
911
</span>
@@ -43,7 +45,7 @@
4345
class="question-tag"
4446
type="info"
4547
effect="plain"
46-
closable
48+
v-bind="permissionPrecise.problem_relate(id) ? {closable:true} : {} "
4749
>
4850
<auto-tooltip :content="item.content">
4951
{{ item.content }}
@@ -55,9 +57,11 @@
5557
</div>
5658
</template>
5759
<script setup lang="ts">
58-
import { ref, nextTick, onMounted, onUnmounted, watch } from 'vue'
60+
import { ref, nextTick, onMounted, onUnmounted, watch, computed } from 'vue'
5961
import { useRoute } from 'vue-router'
6062
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
63+
import permissionMap from '@/permission'
64+
6165
6266
const props = defineProps<{
6367
paragraphId: String
@@ -71,6 +75,10 @@ const {
7175
params: { id, documentId }, // id为knowledgeId
7276
} = route as any
7377
78+
const permissionPrecise = computed(() => {
79+
return permissionMap['knowledge'][props.apiType]
80+
})
81+
7482
const inputRef = ref()
7583
const loading = ref(false)
7684
const isAddProblem = ref(false)

ui/src/views/problem/component/DetailProblemDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
type="primary"
3535
text
3636
@click.stop="disassociation(item)"
37-
v-if="permissionPrecise.doc_edit(id as string)"
37+
v-if="permissionPrecise.problem_relate(id as string)"
3838
>
3939
<AppIcon iconName="app-quxiaoguanlian"></AppIcon>
4040
</el-button>

0 commit comments

Comments
 (0)