1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-12 22:29:59 +08:00

fix: Lock record get values with router (#941)

This commit is contained in:
Edwin Betancourt 2021-06-26 21:24:31 -04:00 committed by GitHub
parent 548bb2f165
commit 69ba12d833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 29 deletions

View File

@ -17,8 +17,7 @@
--> -->
<template> <template>
<div> <span v-if="isFirstTab" key="withTooltip">
<span v-if="isFirstTab" key="tooltip">
<el-tooltip <el-tooltip
v-if="isFirstTab" v-if="isFirstTab"
:content="isLocked ? $t('data.lockRecord') : $t('data.unlockRecord')" :content="isLocked ? $t('data.lockRecord') : $t('data.unlockRecord')"
@ -31,15 +30,15 @@
/> />
</el-button> </el-button>
</el-tooltip> </el-tooltip>
<span :style="isLocked ? 'color: red;' :'color: #1890ff;'"> <span :style="isLocked ? 'color: red;' :'color: #1890ff;'">
{{ tabName }} {{ tabName }}
</span> </span>
</span> </span>
<template v-else> <span v-else key="onlyName">
{{ tabName }} {{ tabName }}
</template> </span>
</div>
</template> </template>
<script> <script>
@ -49,6 +48,10 @@ export default defineComponent({
name: 'LockRecord', name: 'LockRecord',
props: { props: {
tabUuid: {
type: String,
required: true
},
tabPosition: { tabPosition: {
type: Number, type: Number,
default: 0 default: 0
@ -56,12 +59,16 @@ export default defineComponent({
tabName: { tabName: {
type: String, type: String,
required: true required: true
},
tableName: {
type: String,
required: true
} }
}, },
setup(props, { root }) { setup(props, { root }) {
const { tabUuid: containerUuid } = root.$route.meta const containerUuid = props.tabUuid
const { tableName } = root.$route.params const tableName = props.tableName
const isFirstTab = computed(() => { const isFirstTab = computed(() => {
return props.tabPosition === 0 return props.tabPosition === 0

View File

@ -28,12 +28,13 @@
:disabled="Boolean(key > 0 && isCreateNew)" :disabled="Boolean(key > 0 && isCreateNew)"
:style="tabParentStyle" :style="tabParentStyle"
> >
<span slot="label">
<lock-record <lock-record
slot="label"
:tab-position="key" :tab-position="key"
:tab-uuid="tabAttributes.uuid"
:table-name="tabAttributes.tableName"
:tab-name="tabAttributes.name" :tab-name="tabAttributes.name"
/> />
</span>
<main-panel <main-panel
:parent-uuid="windowUuid" :parent-uuid="windowUuid"