1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 23:20:12 +08:00

error requests when advanced query (#424)

* current record request in the container info

* Delete unnecessary console
This commit is contained in:
elsiosanchez 2020-04-02 04:03:06 -04:00 committed by GitHub
parent 24a2a09762
commit ee9feded0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 13 deletions

View File

@ -675,6 +675,8 @@ export default {
} }
this.setTagsViewTitle(uuidRecord) this.setTagsViewTitle(uuidRecord)
this.setFocus() this.setFocus()
const currentRecord = this.getterDataStore.record.find(record => record.UUID === uuidRecord)
this.$store.dispatch('currentRecord', currentRecord)
}, },
async setFocus() { async setFocus() {
return new Promise(resolve => { return new Promise(resolve => {

View File

@ -28,7 +28,8 @@ const initStateUtils = {
isReaded: false, isReaded: false,
isLoaded: false isLoaded: false
}, },
panelRight: '' panelRight: '',
currentRecord: {}
} }
const utils = { const utils = {
@ -97,6 +98,9 @@ const utils = {
}, },
resetStateUtils(state) { resetStateUtils(state) {
state = initStateUtils state = initStateUtils
},
setCurrentRecor(state, payload) {
state.currentRecord = payload
} }
}, },
actions: { actions: {
@ -160,6 +164,9 @@ const utils = {
}, },
setPanelRight({ commit }, panelRight) { setPanelRight({ commit }, panelRight) {
commit('setPanelRight', panelRight) commit('setPanelRight', panelRight)
},
currentRecord({ commit }, record) {
commit('setCurrentRecor', record)
} }
}, },
getters: { getters: {
@ -232,6 +239,9 @@ const utils = {
}, },
getPanelRight: (state) => { getPanelRight: (state) => {
return state.panelRight return state.panelRight
},
getCurrentRecord: (state) => {
return state.currentRecord
} }
} }
} }

View File

@ -289,12 +289,6 @@ const windowControl = {
} }
return true return true
}) })
// if (rootGetters.getShowContainerInfo) {
// dispatch('listRecordLogs', {
// tableName: panel.tableName,
// recordId
// })
// }
return updateEntity({ return updateEntity({
tableName: panel.tableName, tableName: panel.tableName,
recordUuid, recordUuid,
@ -327,12 +321,12 @@ const windowControl = {
recordUuid, recordUuid,
eventType: 'UPDATE' eventType: 'UPDATE'
}) })
// if (containerInfo) { if (rootGetters.getShowContainerInfo) {
dispatch('listRecordLogs', { dispatch('listRecordLogs', {
tableName: panel.tableName, tableName: panel.tableName,
recordId recordId
}) })
// } }
return newValues return newValues
}) })
.catch(error => { .catch(error => {

View File

@ -529,6 +529,12 @@ export default {
}) })
return record return record
}, },
getCurrentRecord() {
if (this.isEmptyValue(this.$store.getters.getCurrentRecord)) {
return this.getterDataRecords[0]
}
return this.$store.getters.getCurrentRecord
},
isWorkflowBarStatus() { isWorkflowBarStatus() {
const panel = this.$store.getters.getPanel(this.windowMetadata.currentTabUuid) const panel = this.$store.getters.getPanel(this.windowMetadata.currentTabUuid)
if (!this.isEmptyValue(panel) && panel.isDocument && this.$route.meta.type === 'window' && this.$route.query.action !== 'create-new') { if (!this.isEmptyValue(panel) && panel.isDocument && this.$route.meta.type === 'window' && this.$route.query.action !== 'create-new') {