1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

change tabs from the path (#376)

This commit is contained in:
elsiosanchez 2020-02-29 17:36:50 -04:00 committed by GitHub
parent c9b53bd536
commit 278fad1bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 11 deletions

View File

@ -618,7 +618,8 @@ export default {
if (!this.isEmptyValue(this.$route.params.recordId)) {
this.$store.dispatch('listDocumentStatus', {
recordUuid: this.$route.query.action,
recordId: this.$route.params.recordId
recordId: this.$route.params.recordId,
tableName: this.$route.params.tableName
})
}
if (actionValue === 'create-new' || this.isEmptyValue(actionValue)) {
@ -678,11 +679,9 @@ export default {
async setFocus() {
return new Promise(resolve => {
const fieldFocus = this.getterFieldList.find(itemField => {
if (itemField.componentPath !== 'FieldSelect' && itemField.isDisplayed) {
if (this.$refs.hasOwnProperty(itemField.columnName)) {
if (fieldIsDisplayed(itemField) && !itemField.isReadOnly && itemField.isUpdateable) {
return true
}
if (this.$refs.hasOwnProperty(itemField.columnName)) {
if (fieldIsDisplayed(itemField) && !itemField.isReadOnly && itemField.isUpdateable) {
return true
}
}
})

View File

@ -55,11 +55,12 @@ export default {
}
},
watch: {
// TODO: Remove watchers of action, and pased as props from window
'$route.query.action'(actionValue) {
'$route.query.tabParent'(actionValue) {
if (this.isEmptyValue(actionValue) || actionValue === 'create-new') {
this.currentTab = '0'
return
}
this.currentTab = actionValue
},
currentTab(newValue, oldValue) {
if (newValue !== oldValue) {

View File

@ -60,6 +60,13 @@ export default {
}
},
watch: {
'$route.query.tabChild'(actionValue) {
if (this.isEmptyValue(actionValue) || actionValue === 'create-new') {
this.currentTabChild = '0'
return
}
this.currentTabChild = actionValue
},
// Current TabChildren
currentTabChild(newValue, oldValue) {
if (newValue !== oldValue) {

View File

@ -83,12 +83,16 @@ export default {
return this.$store.getters.getPanel(this.containerUuid)
},
getValueStatus() {
if (!this.isEmptyValue(this.getterPanel)) {
var status = this.getterPanel.fieldList.find(field => {
const panel = this.getterPanel
var status
if (!this.isEmptyValue(panel)) {
status = panel.fieldList.find(field => {
if (field.columnName === 'DocStatus') {
return field
}
})
}
if (!this.isEmptyValue(status)) {
return status.value
}
return 'CL'

View File

@ -85,7 +85,7 @@ const contextMenu = {
})
},
listDocumentStatus({ commit }, {
tableName = 'C_Order',
tableName,
recordId,
recordUuid,
documentAction,