add feature print format selection in report viewer (#162)
* add feature print format selection in report viewer * add service implementation * add print format list to context menu actionspull/3759/head
parent
974c6a5139
commit
2564ce307f
|
@ -318,3 +318,7 @@ export function getDefaultValueFromServer(query) {
|
|||
export function getContextInfoValueFromServer({ uuid, query }) {
|
||||
return Instance.call(this).getContextInfoValue({ uuid: uuid, query: query })
|
||||
}
|
||||
|
||||
export function requestPrintFormats({ tableName, reportViewUuid, processUuid }) {
|
||||
return Instance.call(this).requestPrintFormats({ tableName: tableName, reportViewUuid: reportViewUuid, processUuid: processUuid })
|
||||
}
|
||||
|
|
|
@ -154,7 +154,9 @@ export default {
|
|||
unsupportedSorry: 'Sorry',
|
||||
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.',
|
||||
unsupportedButton: 'Back to dashboard'
|
||||
unsupportedButton: 'Back to dashboard',
|
||||
printFormat: 'Print Format',
|
||||
changePrintFormat: 'Change Print Format'
|
||||
},
|
||||
table: {
|
||||
ProcessActivity: {
|
||||
|
|
|
@ -154,7 +154,9 @@ export default {
|
|||
unsupportedSorry: 'Lo sentimos',
|
||||
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.',
|
||||
unsupportedButton: 'Volver al Panel de control'
|
||||
unsupportedButton: 'Volver al Panel de control',
|
||||
printFormat: 'Formato de Impresión',
|
||||
changePrintFormat: 'Cambiar Formato de Impresión'
|
||||
},
|
||||
table: {
|
||||
ProcessActivity: {
|
||||
|
|
|
@ -5,7 +5,8 @@ import {
|
|||
getRecentItems,
|
||||
getDefaultValueFromServer,
|
||||
convertValueFromGRPC,
|
||||
getContextInfoValueFromServer
|
||||
getContextInfoValueFromServer,
|
||||
requestPrintFormats
|
||||
} from '@/api/ADempiere'
|
||||
import { convertValuesMapToObject, isEmptyValue, showMessage, convertAction } from '@/utils/ADempiere'
|
||||
import language from '@/lang'
|
||||
|
@ -16,7 +17,8 @@ const data = {
|
|||
recordDetail: [],
|
||||
recentItems: [],
|
||||
inGetting: [],
|
||||
contextInfoField: []
|
||||
contextInfoField: [],
|
||||
printFormatList: []
|
||||
},
|
||||
mutations: {
|
||||
addInGetting(state, payload) {
|
||||
|
@ -89,6 +91,9 @@ const data = {
|
|||
},
|
||||
setContextInfoField(state, payload) {
|
||||
state.contextInfoField.push(payload)
|
||||
},
|
||||
setPrintFormatList(state, payload) {
|
||||
state.printFormatList.push(payload)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
@ -762,6 +767,27 @@ const data = {
|
|||
.catch(error => {
|
||||
console.warn(`Error ${error.code} getting context info value for field ${error.message}`)
|
||||
})
|
||||
},
|
||||
requestPrintFormats({ commit }, parameters) {
|
||||
return requestPrintFormats({ processUuid: parameters.processUuid })
|
||||
.then(response => {
|
||||
const printFormatList = response.getPrintformatsList().map(printFormat => {
|
||||
return {
|
||||
uuid: printFormat.getUuid(),
|
||||
name: printFormat.getName(),
|
||||
description: printFormat.getDescription(),
|
||||
isDefault: printFormat.getIsdefault()
|
||||
}
|
||||
})
|
||||
commit('setPrintFormatList', {
|
||||
containerUuid: parameters.processUuid,
|
||||
printFormatList: printFormatList
|
||||
})
|
||||
return printFormatList
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error)
|
||||
})
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
|
@ -887,6 +913,13 @@ const data = {
|
|||
info.contextInfoUuid === contextInfoUuid &&
|
||||
info.sqlStatement === sqlStatement
|
||||
)
|
||||
},
|
||||
getPrintFormatList: (state) => (containerUuid) => {
|
||||
var printFormatList = state.printFormatList.find(list => list.containerUuid === containerUuid)
|
||||
if (printFormatList) {
|
||||
return printFormatList.printFormatList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,6 +239,26 @@ const processControl = {
|
|||
if (reportType !== 'pdf' && reportType !== 'html') {
|
||||
link.click()
|
||||
}
|
||||
// Print formats to context menu
|
||||
var printFormatList = {
|
||||
name: language.t('views.printFormat'),
|
||||
type: 'summary',
|
||||
action: '',
|
||||
childs: [],
|
||||
option: 'printFormat'
|
||||
}
|
||||
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
||||
if (!printFormatList.childs.length) {
|
||||
dispatch('requestPrintFormats', {
|
||||
processUuid: processResult.processUuid
|
||||
})
|
||||
.then(response => {
|
||||
printFormatList.childs = response
|
||||
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
||||
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||
contextMenuMetadata.actions.push(printFormatList)
|
||||
})
|
||||
}
|
||||
}
|
||||
// assign new attributes
|
||||
Object.assign(processResult, {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<el-row type="flex" style="min-height: inherit;">
|
||||
<el-col :span="24">
|
||||
<div class="content">
|
||||
<h3 class="text-center">
|
||||
<h3 class="text-center" style="margin: 0 !important;">
|
||||
<el-popover
|
||||
v-if="!isEmptyValue(processMetadata.help)"
|
||||
placement="top-start"
|
||||
|
@ -86,7 +86,9 @@ export default {
|
|||
reportContent: '',
|
||||
reportHeader: '',
|
||||
isLoading: false,
|
||||
reportResult: {}
|
||||
reportResult: {},
|
||||
printFormatList: [],
|
||||
printFormat: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -156,7 +158,6 @@ export default {
|
|||
.content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 20px 0px;
|
||||
position: absolute;
|
||||
top: 0%;
|
||||
}
|
||||
|
@ -175,13 +176,10 @@ export default {
|
|||
height: inherit;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 20px;
|
||||
|
||||
.sub-content-html {
|
||||
min-height: inherit;
|
||||
height: inherit;
|
||||
height: -webkit-fill-available;
|
||||
max-height: -webkit-max-content;
|
||||
max-height: -moz-max-content;
|
||||
max-height: max-content;
|
||||
|
@ -200,7 +198,4 @@ export default {
|
|||
.container-report {
|
||||
width: 100%;
|
||||
}
|
||||
.scroll {
|
||||
max-height: -webkit-fill-available;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue