1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 23:20:12 +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)) { if (!this.isEmptyValue(this.$route.params.recordId)) {
this.$store.dispatch('listDocumentStatus', { this.$store.dispatch('listDocumentStatus', {
recordUuid: this.$route.query.action, 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)) { if (actionValue === 'create-new' || this.isEmptyValue(actionValue)) {
@ -678,13 +679,11 @@ export default {
async setFocus() { async setFocus() {
return new Promise(resolve => { return new Promise(resolve => {
const fieldFocus = this.getterFieldList.find(itemField => { const fieldFocus = this.getterFieldList.find(itemField => {
if (itemField.componentPath !== 'FieldSelect' && itemField.isDisplayed) {
if (this.$refs.hasOwnProperty(itemField.columnName)) { if (this.$refs.hasOwnProperty(itemField.columnName)) {
if (fieldIsDisplayed(itemField) && !itemField.isReadOnly && itemField.isUpdateable) { if (fieldIsDisplayed(itemField) && !itemField.isReadOnly && itemField.isUpdateable) {
return true return true
} }
} }
}
}) })
if (fieldFocus) { if (fieldFocus) {
this.$refs[fieldFocus.columnName][0].focusField() this.$refs[fieldFocus.columnName][0].focusField()

View File

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

View File

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

View File

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

View File

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