CN-1468 fix: 补充一些开关的权限控制
This commit is contained in:
@@ -52,13 +52,17 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'status'">
|
<template v-else-if="item.prop === 'status'">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-if="scope.row.id"
|
v-if="scope.row.id && hasPermission('editUser')"
|
||||||
v-model="scope.row.status"
|
v-model="scope.row.status"
|
||||||
active-value="1"
|
active-value="1"
|
||||||
:disabled="(scope.row.username === loginName) || (scope.row.username==='admin' && scope.row.id===1) || scope.row.buildIn === 1"
|
:disabled="(scope.row.username === loginName) || (scope.row.username==='admin' && scope.row.id===1) || scope.row.buildIn === 1"
|
||||||
inactive-value="0"
|
inactive-value="0"
|
||||||
@change="()=>{statusChange(scope.row)}">
|
@change="()=>{statusChange(scope.row)}">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
|
<template v-else>
|
||||||
|
<span v-if="scope.row.status === '1'">{{$t('detection.create.enabled')}}</span>
|
||||||
|
<span v-else>{{$t('detection.create.disabled')}}</span>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>{{scope.row[item.prop] || '-'}}</span>
|
<span v-else>{{scope.row[item.prop] || '-'}}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'status'">
|
<template v-else-if="item.prop === 'status'">
|
||||||
<el-switch v-model="scope.row.status"
|
<el-switch v-model="scope.row.status"
|
||||||
|
v-if="hasPermission('editUserDefinedLibrary')"
|
||||||
active-color="#38ACD2"
|
active-color="#38ACD2"
|
||||||
inactive-color="#C0CEDB"
|
inactive-color="#C0CEDB"
|
||||||
:active-value="1"
|
:active-value="1"
|
||||||
@@ -105,6 +106,10 @@
|
|||||||
@change="changeStatus($event,scope.row.knowledgeId)"
|
@change="changeStatus($event,scope.row.knowledgeId)"
|
||||||
>
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
|
<template v-else>
|
||||||
|
<span v-if="scope.row.status === 1">{{$t('detection.create.enabled')}}</span>
|
||||||
|
<span v-else>{{$t('detection.create.disabled')}}</span>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'color'">
|
<template v-else-if="item.prop === 'color'">
|
||||||
<div class="knowledge-color">
|
<div class="knowledge-color">
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="card-operate">
|
<div class="card-operate">
|
||||||
<el-switch v-model="data.status"
|
<el-switch v-model="data.status"
|
||||||
|
v-if="hasPermission('editBuiltInKnowledgeBase')"
|
||||||
class="card-enable"
|
class="card-enable"
|
||||||
active-color="#38ACD2"
|
active-color="#38ACD2"
|
||||||
inactive-color="#C0CEDB"
|
inactive-color="#C0CEDB"
|
||||||
@@ -85,7 +86,7 @@
|
|||||||
:active-value="1"
|
:active-value="1"
|
||||||
:inactive-value="0"
|
:inactive-value="0"
|
||||||
:before-change="(knowledgeId) => confirmSwitchLearning(updateKnowledge.knowledgeId)"
|
:before-change="(knowledgeId) => confirmSwitchLearning(updateKnowledge.knowledgeId)"
|
||||||
v-if="updateKnowledge.source === 'cn_psiphon3_ip'"
|
v-if="updateKnowledge.source === 'cn_psiphon3_ip' && hasPermission('editBuiltInKnowledgeBase')"
|
||||||
>
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user