mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Problem related permission
This commit is contained in:
parent
1540fcd0de
commit
5901e7fc02
|
|
@ -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 }, // id为knowledgeId
|
||||
} = route as any
|
||||
|
||||
const permissionPrecise = computed(() => {
|
||||
return permissionMap['knowledge'][props.apiType]
|
||||
})
|
||||
|
||||
const inputRef = ref()
|
||||
const loading = ref(false)
|
||||
const isAddProblem = ref(false)
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue