fix: Administration模块添加禁止勾选操作admin等账号,去除日志模块中勾选操作

This commit is contained in:
刘洪洪
2023-06-07 14:52:24 +08:00
parent 2907f4485b
commit 878cbd066c
2 changed files with 10 additions and 9 deletions

View File

@@ -10,13 +10,9 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
:cell-style="{paddingLeft: '20px'}"
:header-cell-style="{paddingLeft: '20px'}"
>
<el-table-column
:resizable="false"
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
v-for="(item, index) in customTableTitles"
:key="item.prop+index"
@@ -39,10 +35,10 @@
{{scope.row[item.prop]}}ms
</span>
<span v-else-if="item.prop === 'state'">
<template v-if="scope.row[item.prop]==operationLogStateMapping.success">
<template v-if="scope.row[item.prop]===operationLogStateMapping.success">
{{$t('operationLog.state.success')}}
</template>
<template v-else-if="scope.row[item.prop]==operationLogStateMapping.fail">
<template v-else-if="scope.row[item.prop]===operationLogStateMapping.fail">
{{$t('operationLog.state.fail')}}
</template>
<template v-else>

View File

@@ -14,6 +14,7 @@
:resizable="false"
align="center"
type="selection"
:selectable="checkSelectable"
width="55">
</el-table-column>
<el-table-column
@@ -54,7 +55,7 @@
v-if="scope.row.id"
v-model="scope.row.status"
active-value="1"
:disabled="(scope.row.username === loginName) || (scope.row.username==='admin' && scope.row.id==1) "
:disabled="(scope.row.username === loginName) || (scope.row.username==='admin' && scope.row.id===1) "
inactive-value="0"
@change="()=>{statusChange(scope.row)}">
</el-switch>
@@ -144,6 +145,10 @@ export default {
}
this.$emit('reload')
})
},
// 禁止勾选buildIn为1的项即禁止修改、删除admin的账号
checkSelectable (row) {
return row.buildIn !== 1
}
}
}