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

View File

@ -34,7 +34,7 @@
type="primary" type="primary"
text text
@click.stop="disassociation(item)" @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> <AppIcon iconName="app-quxiaoguanlian"></AppIcon>
</el-button> </el-button>