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

fix: Reset parameters after run Process. (#415)

* fix: Reset panel after run Process.

* Minimal changes.
This commit is contained in:
Edwin Betancourt 2020-03-27 16:36:28 -04:00 committed by GitHub
parent f47dea22df
commit c0c758d7ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 44 deletions

View File

@ -341,6 +341,7 @@ const panel = {
})
}
}
dispatch('notifyPanelChange', {
parentUuid,
containerUuid,
@ -352,6 +353,21 @@ const panel = {
isSendCallout: isNewRecord,
isPrivateAccess: false
})
.then(() => {
if (['process', 'report'].includes(panelType)) {
const fieldsUser = panel.fieldList.filter(itemField => {
return itemField.isShowedFromUserDefault || !isEmptyValue(itemField.value)
}).map(itemField => {
return itemField.columnName
})
dispatch('changeFieldShowedFromUser', {
containerUuid,
fieldsUser,
groupField: ''
})
}
})
resolve(defaultAttributes)
})
},
@ -440,6 +456,7 @@ const panel = {
Promise.all(promisessList)
.then(response => {
resolve()
const calloutsToExecute = []
if (isSendCallout) {
response.forEach(item => {

View File

@ -188,48 +188,45 @@ const processControl = {
})
}
const timeInitialized = (new Date()).getTime()
let processResult
let processResult = {
// panel attributes from where it was executed
parentUuid,
containerUuid,
panelType,
lastRun: timeInitialized,
parametersList,
logs: [],
isError: false,
isProcessing: true,
summary: '',
resultTableName: '',
output: {
uuid: '',
name: '',
description: '',
fileName: '',
output: '',
outputStream: '',
reportType: ''
}
}
if (!isEmptyValue(isActionDocument)) {
processResult = {
// panel attributes from where it was executed
parentUuid,
containerUuid,
panelType,
lastRun: timeInitialized,
...processResult,
processUuid: action.uuid,
processId: action.id,
processName: 'Procesar Orden',
parameters: parametersList,
parametersList,
isError: false,
isProcessing: true,
summary: '',
resultTableName: '',
logs: [],
output: {
uuid: '',
name: '',
description: '',
fileName: '',
output: '',
outputStream: '',
reportType: ''
}
parameters: parametersList
}
} else {
const timeInitialized = (new Date()).getTime()
// Run process on server and wait for it for notify
// uuid of process
processResult = {
// panel attributes from where it was executed
parentUuid,
containerUuid,
panelType,
...processResult,
menuParentUuid,
processIdPath: routeToDelete.path,
printFormatUuid: action.printFormatUuid,
// process attributes
lastRun: timeInitialized,
action: processDefinition.name,
name: processDefinition.name,
description: processDefinition.description,
@ -238,21 +235,7 @@ const processControl = {
processId: processDefinition.id,
processName: processDefinition.processName,
parameters: finalParameters,
isError: false,
isProcessing: true,
isReport: processDefinition.isReport,
summary: '',
resultTableName: '',
logs: [],
output: {
uuid: '',
name: '',
description: '',
fileName: '',
output: '',
outputStream: '',
reportType: ''
}
isReport: processDefinition.isReport
}
}
commit('addInExecution', processResult)
@ -272,6 +255,14 @@ const processControl = {
// close view if is process, report.
router.push({ path: '/dashboard' })
dispatch('tagsView/delView', routeToDelete)
// reset panel and set defalt isShowedFromUser
if (!processDefinition.isReport) {
dispatch('resetPanelToNew', {
containerUuid,
panelType
})
}
}
if (isProcessTableSelection) {
const windowSelectionProcess = getters.getProcessSelect
@ -853,7 +844,8 @@ const processControl = {
},
/**
* Show modal dialog with process/report, tab (sequence) metadata
* @param {object} params
* @param {String} type of panel or panelType ('process', 'report', 'window')
* @param {Object} action
*/
setShowDialog({ state, commit, dispatch, rootGetters }, {
type,

View File

@ -175,6 +175,7 @@ export function generateField({
// TODO: Add support on server
// app attributes
isShowedFromUser,
isShowedFromUserDefault: isShowedFromUser, // set this value when reset panel
isShowedTableFromUser: fieldToGenerate.isDisplayed,
isFixedTableColumn: false,
isSQLValue,