add feature report view selection in report viewer (#165)
* add feature report view selection in report viewer * add report view list service implementationpull/3759/head
parent
2564ce307f
commit
dbaf0ec966
|
@ -319,6 +319,10 @@ export function getContextInfoValueFromServer({ uuid, query }) {
|
||||||
return Instance.call(this).getContextInfoValue({ uuid: uuid, query: query })
|
return Instance.call(this).getContextInfoValue({ uuid: uuid, query: query })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function requestReportViews({ tableName, processUuid }) {
|
||||||
|
return Instance.call(this).requestReportViews({ tableName: tableName, processUuid: processUuid })
|
||||||
|
}
|
||||||
|
|
||||||
export function requestPrintFormats({ tableName, reportViewUuid, processUuid }) {
|
export function requestPrintFormats({ tableName, reportViewUuid, processUuid }) {
|
||||||
return Instance.call(this).requestPrintFormats({ tableName: tableName, reportViewUuid: reportViewUuid, processUuid: processUuid })
|
return Instance.call(this).requestPrintFormats({ tableName: tableName, reportViewUuid: reportViewUuid, processUuid: processUuid })
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,8 +155,8 @@ export default {
|
||||||
unsupportedHeadline: 'This view is currently unavailable',
|
unsupportedHeadline: 'This view is currently unavailable',
|
||||||
unsupportedInfo: 'Please check that the view is supported in this version, or click the button below to return to the homepage.',
|
unsupportedInfo: 'Please check that the view is supported in this version, or click the button below to return to the homepage.',
|
||||||
unsupportedButton: 'Back to dashboard',
|
unsupportedButton: 'Back to dashboard',
|
||||||
printFormat: 'Print Format',
|
reportView: 'Report Views',
|
||||||
changePrintFormat: 'Change Print Format'
|
printFormat: 'Print Formats'
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
ProcessActivity: {
|
ProcessActivity: {
|
||||||
|
|
|
@ -155,8 +155,8 @@ export default {
|
||||||
unsupportedHeadline: 'Esta vista no está disponible actualmente',
|
unsupportedHeadline: 'Esta vista no está disponible actualmente',
|
||||||
unsupportedInfo: 'Verifique que la vista sea compatible con esta versión, o haga clic en el botón a continuación para volver a la página de inicio.',
|
unsupportedInfo: 'Verifique que la vista sea compatible con esta versión, o haga clic en el botón a continuación para volver a la página de inicio.',
|
||||||
unsupportedButton: 'Volver al Panel de control',
|
unsupportedButton: 'Volver al Panel de control',
|
||||||
printFormat: 'Formato de Impresión',
|
reportView: 'Vistas de Reporte',
|
||||||
changePrintFormat: 'Cambiar Formato de Impresión'
|
printFormat: 'Formatos de Impresión'
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
ProcessActivity: {
|
ProcessActivity: {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { runProcess, requestProcessActivity } from '@/api/ADempiere'
|
import { runProcess, requestProcessActivity, requestReportViews } from '@/api/ADempiere'
|
||||||
import { showNotification } from '@/utils/ADempiere/notification'
|
import { showNotification } from '@/utils/ADempiere/notification'
|
||||||
import { isEmptyValue, convertMapToArrayPairs } from '@/utils/ADempiere'
|
import { isEmptyValue, convertMapToArrayPairs } from '@/utils/ADempiere'
|
||||||
import language from '@/lang'
|
import language from '@/lang'
|
||||||
|
@ -14,7 +14,8 @@ const processControl = {
|
||||||
process: [], // process to run finish
|
process: [], // process to run finish
|
||||||
sessionProcess: [],
|
sessionProcess: [],
|
||||||
notificationProcess: [],
|
notificationProcess: [],
|
||||||
inRequestMetadata: []
|
inRequestMetadata: [],
|
||||||
|
reportViewList: []
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
// Add process in execution
|
// Add process in execution
|
||||||
|
@ -73,6 +74,9 @@ const processControl = {
|
||||||
state.sessionProcess = []
|
state.sessionProcess = []
|
||||||
state.notificationProcess = []
|
state.notificationProcess = []
|
||||||
state.inRequestMetadata = []
|
state.inRequestMetadata = []
|
||||||
|
},
|
||||||
|
setReportViewsList(state, payload) {
|
||||||
|
state.reportViewList.push(payload)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -239,6 +243,28 @@ const processControl = {
|
||||||
if (reportType !== 'pdf' && reportType !== 'html') {
|
if (reportType !== 'pdf' && reportType !== 'html') {
|
||||||
link.click()
|
link.click()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Report views List to context menu
|
||||||
|
var reportViewList = {
|
||||||
|
name: language.t('views.reportView'),
|
||||||
|
type: 'summary',
|
||||||
|
action: '',
|
||||||
|
childs: [],
|
||||||
|
option: 'reportView'
|
||||||
|
}
|
||||||
|
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
||||||
|
if (!reportViewList.childs.length) {
|
||||||
|
dispatch('requestReportViews', {
|
||||||
|
processUuid: processResult.processUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
reportViewList.childs = response
|
||||||
|
// Get contextMenu metadata and concat print report views with contextMenu actions
|
||||||
|
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(reportViewList)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Print formats to context menu
|
// Print formats to context menu
|
||||||
var printFormatList = {
|
var printFormatList = {
|
||||||
name: language.t('views.printFormat'),
|
name: language.t('views.printFormat'),
|
||||||
|
@ -443,6 +469,27 @@ const processControl = {
|
||||||
},
|
},
|
||||||
clearProcessControl({ commit }) {
|
clearProcessControl({ commit }) {
|
||||||
commit('clearProcessControl')
|
commit('clearProcessControl')
|
||||||
|
},
|
||||||
|
requestReportViews({ commit }, parameters) {
|
||||||
|
return requestReportViews({ processUuid: parameters.processUuid })
|
||||||
|
.then(response => {
|
||||||
|
const reportViewList = response.getReportviewsList().map(reportView => {
|
||||||
|
return {
|
||||||
|
uuid: reportView.getUuid(),
|
||||||
|
name: reportView.getName(),
|
||||||
|
tableName: reportView.getTablename(),
|
||||||
|
description: reportView.getDescription()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
commit('setReportViewsList', {
|
||||||
|
containerUuid: parameters.processUuid,
|
||||||
|
viewList: reportViewList
|
||||||
|
})
|
||||||
|
return reportViewList
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
|
@ -487,6 +534,13 @@ const processControl = {
|
||||||
return state.reportList.find(
|
return state.reportList.find(
|
||||||
item => item.instanceUuid === instanceUuid
|
item => item.instanceUuid === instanceUuid
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
getReportViewList: (state) => (containerUuid) => {
|
||||||
|
var reportViewList = state.reportViewList.find(list => list.containerUuid === containerUuid)
|
||||||
|
if (reportViewList) {
|
||||||
|
return reportViewList.viewList
|
||||||
|
}
|
||||||
|
return []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,9 +86,7 @@ export default {
|
||||||
reportContent: '',
|
reportContent: '',
|
||||||
reportHeader: '',
|
reportHeader: '',
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
reportResult: {},
|
reportResult: {}
|
||||||
printFormatList: [],
|
|
||||||
printFormat: null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
Loading…
Reference in New Issue