mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-07 18:25:45 +08:00
add record access to the route (#816)
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
5110f7c2a9
commit
ad57b8bd27
@ -296,6 +296,13 @@ export default {
|
||||
this.$store.commit('changeShowRigthPanel', true)
|
||||
this.$store.commit('setRecordAccess', true)
|
||||
this.$store.commit('attributeEmbedded', action)
|
||||
this.$router.push({
|
||||
name: this.$route.name,
|
||||
query: {
|
||||
...this.$route.query,
|
||||
typeAction: this.$store.getters.getAttributeEmbedded.action
|
||||
}
|
||||
}, () => {})
|
||||
this.runAction(action)
|
||||
} else {
|
||||
this.runAction(action)
|
||||
|
@ -17,7 +17,7 @@
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible="isVisibleDialog"
|
||||
:visible="isVisibleDialog || showRecordAccess"
|
||||
show-close
|
||||
:before-close="closeDialog"
|
||||
:width="width + '%'"
|
||||
@ -27,7 +27,7 @@
|
||||
close-on-click-modal
|
||||
>
|
||||
<span slot="title">
|
||||
{{ attributeEmbedded.name }}
|
||||
{{ $t('data.recordAccess.actions') }}
|
||||
<el-tooltip :content="lock ? $t('data.lockRecord') : $t('data.unlockRecord')" placement="top">
|
||||
<el-button type="text" @click="lock = !lock">
|
||||
<i :class="lock ? 'el-icon-unlock' : 'el-icon-lock'" style="font-size: 25px;color: black;" />
|
||||
@ -66,6 +66,10 @@ export default {
|
||||
recordId: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
},
|
||||
visible: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -130,6 +134,13 @@ export default {
|
||||
name: ''
|
||||
}
|
||||
})
|
||||
this.$router.push({
|
||||
name: this.$route.name,
|
||||
query: {
|
||||
...this.$route.query,
|
||||
typeAction: ''
|
||||
}
|
||||
}, () => {})
|
||||
this.$store.commit('setRecordAccess', false)
|
||||
},
|
||||
runAction(action) {
|
||||
|
@ -159,25 +159,29 @@ export default {
|
||||
}
|
||||
// Create Message
|
||||
var expl = language.t('components.preference.for')// components.preference.for
|
||||
if (forCurrentClient.value && forCurrentOrganization.value) {
|
||||
expl = expl.concat(language.t('components.preference.clientAndOrganization'))// components.preference.clientAndOrganization
|
||||
} else if (forCurrentClient.value && !forCurrentOrganization.value) {
|
||||
expl = expl.concat(language.t('components.preference.allOrganizationOfClient'))// components.preference.allOrganizationOfClient
|
||||
} else if (!forCurrentClient.value && forCurrentOrganization.value) {
|
||||
forCurrentOrganization.value = false
|
||||
expl = expl.concat(language.t('components.preference.entireSystem'))// components.preference.entireSystem
|
||||
} else {
|
||||
expl = expl.concat(language.t('components.preference.entireSystem'))// components.preference.entireSystem
|
||||
if (forCurrentOrganization && forCurrentClient) {
|
||||
if (forCurrentClient.value && forCurrentOrganization.value) {
|
||||
expl = expl.concat(language.t('components.preference.clientAndOrganization'))// components.preference.clientAndOrganization
|
||||
} else if (forCurrentClient.value && !forCurrentOrganization.value) {
|
||||
expl = expl.concat(language.t('components.preference.allOrganizationOfClient'))// components.preference.allOrganizationOfClient
|
||||
} else if (!forCurrentClient.value && forCurrentOrganization.value) {
|
||||
forCurrentOrganization.value = false
|
||||
expl = expl.concat(language.t('components.preference.entireSystem'))// components.preference.entireSystem
|
||||
} else {
|
||||
expl = expl.concat(language.t('components.preference.entireSystem'))// components.preference.entireSystem
|
||||
}
|
||||
}
|
||||
if (forCurrentUser.value) {
|
||||
expl = expl.concat(language.t('components.preference.thisUser'))// components.preference.thisUser
|
||||
} else {
|
||||
expl = expl.concat(language.t('components.preference.allUsers'))// components.preference.allUsers
|
||||
}
|
||||
if (forCurrentContainer.value) {
|
||||
expl = expl.concat(language.t('components.preference.thisWindow'))// components.preference.thisWindow
|
||||
} else {
|
||||
expl = expl.concat(language.t('components.preference.allWindows'))// components.preference.allWindows
|
||||
if (forCurrentUser && forCurrentContainer) {
|
||||
if (forCurrentUser.value) {
|
||||
expl = expl.concat(language.t('components.preference.thisUser'))// components.preference.thisUser
|
||||
} else {
|
||||
expl = expl.concat(language.t('components.preference.allUsers'))// components.preference.allUsers
|
||||
}
|
||||
if (forCurrentContainer.value) {
|
||||
expl = expl.concat(language.t('components.preference.thisWindow'))// components.preference.thisWindow
|
||||
} else {
|
||||
expl = expl.concat(language.t('components.preference.allWindows'))// components.preference.allWindows
|
||||
}
|
||||
}
|
||||
return expl
|
||||
}
|
||||
|
@ -199,6 +199,13 @@ export default {
|
||||
type: 'window',
|
||||
action: undefined
|
||||
})
|
||||
this.$router.push({
|
||||
name: this.$route.name,
|
||||
query: {
|
||||
...this.$route.query,
|
||||
typeAction: ''
|
||||
}
|
||||
}, () => {})
|
||||
this.$store.commit('setRecordAccess', false)
|
||||
this.$store.commit('changeShowRigthPanel', false)
|
||||
}
|
||||
|
@ -30,7 +30,9 @@ const initStateContextMenu = {
|
||||
recordUuid: undefined
|
||||
},
|
||||
recordAccess: false,
|
||||
embedded: {}
|
||||
embedded: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
|
||||
const contextMenu = {
|
||||
|
@ -353,9 +353,17 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getRecord(value) {
|
||||
if (!this.isEmptyValue(this.windowMetadata.currentTab.tableName) && !this.isEmptyValue(value) && (!this.isEmptyValue(this.$route.query) && this.$route.query.typeAction === 'recordAccess')) {
|
||||
this.$store.commit('setRecordAccess', true)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.isEmptyValue(this.currentRecord) && (!this.isEmptyValue(this.$route.query) && this.$route.query.typeAction === 'recordAccess')) {
|
||||
this.$store.commit('setRecordAccess', true)
|
||||
}
|
||||
this.getWindow()
|
||||
if (this.isShowedRecordNavigation) {
|
||||
this.handleResize()
|
||||
|
Loading…
x
Reference in New Issue
Block a user