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