fix: Problem related permission

This commit is contained in:
zhangzhanwei 2025-08-01 10:59:37 +08:00 committed by zhanweizhang7
parent 1540fcd0de
commit 5901e7fc02
2 changed files with 12 additions and 4 deletions

View File

@ -3,7 +3,9 @@
<span class="flex align-center">
<span>{{ $t('views.paragraph.relatedProblem.title') }}</span>
<el-divider direction="vertical" class="mr-4" />
<el-button text @click="addProblem">
<el-button text @click="addProblem"
v-if="permissionPrecise.problem_relate(id)"
>
<el-icon><Plus /></el-icon>
</el-button>
</span>
@ -43,7 +45,7 @@
class="question-tag"
type="info"
effect="plain"
closable
v-bind="permissionPrecise.problem_relate(id) ? {closable:true} : {} "
>
<auto-tooltip :content="item.content">
{{ item.content }}
@ -55,9 +57,11 @@
</div>
</template>
<script setup lang="ts">
import { ref, nextTick, onMounted, onUnmounted, watch } from 'vue'
import { ref, nextTick, onMounted, onUnmounted, watch, computed } from 'vue'
import { useRoute } from 'vue-router'
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
import permissionMap from '@/permission'
const props = defineProps<{
paragraphId: String
@ -71,6 +75,10 @@ const {
params: { id, documentId }, // idknowledgeId
} = route as any
const permissionPrecise = computed(() => {
return permissionMap['knowledge'][props.apiType]
})
const inputRef = ref()
const loading = ref(false)
const isAddProblem = ref(false)

View File

@ -34,7 +34,7 @@
type="primary"
text
@click.stop="disassociation(item)"
v-if="permissionPrecise.doc_edit(id as string)"
v-if="permissionPrecise.problem_relate(id as string)"
>
<AppIcon iconName="app-quxiaoguanlian"></AppIcon>
</el-button>