1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +08:00

Fix Message Record Access (#835)

* Support Lock Record

* fix Record Acces

Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-05-11 19:30:35 -04:00 committed by GitHub
parent 430535ca9e
commit c7b94523c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 8 deletions

View File

@ -29,12 +29,14 @@
:style="tabParentStyle"
>
<span v-if="key === 0" slot="label">
<el-tooltip v-if="key === 0" :content="!lock ? $t('data.lockRecord') : $t('data.unlockRecord')" placement="top">
<el-tooltip v-if="key === 0" :content="lock ? $t('data.lockRecord') : $t('data.unlockRecord')" placement="top">
<el-button type="text" @click="lockRecord()">
<i :class="lock ? 'el-icon-unlock' : 'el-icon-lock'" style="font-size: 15px;color: black;" />
</el-button>
</el-tooltip>
{{ tabAttributes.name }}
<span :style="lock ? 'color: #1890ff;': 'color: red;'">
{{ tabAttributes.name }}
</span>
</span>
<span v-else slot="label">
{{ tabAttributes.name }}
@ -126,26 +128,26 @@ export default {
},
methods: {
lockRecord() {
this.lock = !this.lock
const tableName = this.windowMetadata.firstTab.tableName
const action = this.lock ? 'lockRecord' : 'unlockRecord'
const message = !this.lock ? 'lockRecord' : 'unlockRecord'
this.$store.dispatch(action, {
tableName,
recordId: this.record[tableName + '_ID'],
recordUuid: this.record.UUID
})
.then(() => {
this.lock = !this.lock
this.$message({
type: 'success',
message: this.$t('data.' + message),
message: this.$t('data.notification.' + action),
showClose: true
})
})
.catch(() => {
this.lock = !this.lock
this.$message({
type: 'error',
message: this.$t('data.isError') + this.$t('data.' + message),
message: this.$t('data.isError') + this.$t('data.' + action),
showClose: true
})
})

View File

@ -366,7 +366,11 @@ export default {
},
selectionRequired: 'You must select a record',
undo: 'Undo',
unlockRecord: 'Unlock Record'
unlockRecord: 'Unlock Record',
notification: {
lockRecord: 'The Registry was Locked',
unlockRecord: 'Registry was Unlocked'
}
},
sequence: {
available: 'Available',

View File

@ -342,7 +342,12 @@ export default {
},
selectionRequired: 'Debe seleccionar un registro',
undo: 'Deshacer',
unlockRecord: 'Registro Desbloqueado'
unlockRecord: 'Desbloquear Registro',
notification: {
lockRecord: 'El Registro fue Bloqueado',
unlockRecord: 'El Registro fue Desbloqueado'
}
},
sequence: {
available: 'Disponibles',