mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-10-02 12:24:53 +08:00
redefine API to provide business data (#214)
* Change of main functions of api from the application to the grpc library * Create entity. * Update entity. * Delete entity. * Request entity. * Request entities list. * Rollback entity. * Run process. * Browser search. * Convert API functions to get values. * migrate CRUD and Browser Search. * migrate process control and callout control. * migrate print formats. * migrate recent items, references, context info value, private access * migrate pending documents, favorites, language and translations. * migrate lookups. * fix: Drill table empty name. * Change report output. * Refactor dashboard and language. * Fix dashboard component. * Fix dashboards unsupported, and refactor and remove getting values
This commit is contained in:
parent
683e0d250b
commit
fd6096b565
@ -45,7 +45,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@adempiere/grpc-access-client": "^1.1.8",
|
"@adempiere/grpc-access-client": "^1.1.8",
|
||||||
"@adempiere/grpc-data-client": "^1.8.5",
|
"@adempiere/grpc-data-client": "^1.8.7",
|
||||||
"@adempiere/grpc-dictionary-client": "^1.3.5",
|
"@adempiere/grpc-dictionary-client": "^1.3.5",
|
||||||
"@adempiere/grpc-enrollment-client": "^1.0.7",
|
"@adempiere/grpc-enrollment-client": "^1.0.7",
|
||||||
"autoprefixer": "^9.5.1",
|
"autoprefixer": "^9.5.1",
|
||||||
|
@ -26,239 +26,164 @@ export function convertValueFromGRPC(grpcValue) {
|
|||||||
* @param {string} parameters.tableName
|
* @param {string} parameters.tableName
|
||||||
* @param {array} parameters.attributesList
|
* @param {array} parameters.attributesList
|
||||||
*/
|
*/
|
||||||
export function createEntity(parameters) {
|
export function createEntity({ tableName, attributesList }) {
|
||||||
var entityRequest = Instance.call(this).getCreateEntityRequest()
|
return Instance.call(this).createEntity({
|
||||||
entityRequest.setTablename(parameters.tableName)
|
tableName,
|
||||||
if (parameters.attributesList && parameters.attributesList.length) {
|
attributesList
|
||||||
parameters.attributesList.forEach(attribute => {
|
})
|
||||||
const convertedAttribute = Instance.call(this).convertParameter(attribute)
|
|
||||||
entityRequest.addAttributes(convertedAttribute)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// Create Entity
|
|
||||||
return Instance.call(this).createEntity(entityRequest)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update entity
|
* Update entity
|
||||||
* @param {string} parameters.tableName
|
* @param {string} tableName
|
||||||
* @param {integer} parameters.recordId
|
* @param {number} recordId
|
||||||
* @param {string} parameters.recordUuid
|
* @param {string} recordUuid
|
||||||
* @param {array} parameters.attributesList
|
* @param {array} attributesList
|
||||||
*/
|
*/
|
||||||
export function updateEntity(parameters) {
|
export function updateEntity({ tableName, recordId, recordUuid, attributesList }) {
|
||||||
var entityRequest = Instance.call(this).getUpdateEntityRequest()
|
return Instance.call(this).updateEntity({
|
||||||
entityRequest.setTablename(parameters.tableName)
|
tableName,
|
||||||
if (parameters.recordId) {
|
recordId,
|
||||||
entityRequest.setRecordid(parameters.recordId)
|
recordUuid,
|
||||||
}
|
attributesList
|
||||||
entityRequest.setUuid(parameters.recordUuid)
|
})
|
||||||
if (parameters.attributesList && parameters.attributesList.length) {
|
|
||||||
parameters.attributesList.forEach(attribute => {
|
|
||||||
const convertedAttribute = Instance.call(this).convertParameter(attribute)
|
|
||||||
entityRequest.addAttributes(convertedAttribute)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// Update Entity
|
|
||||||
return Instance.call(this).updateEntity(entityRequest)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete entity
|
* Delete entity
|
||||||
* @param {string} parameters.tableName
|
* @param {string} tableName
|
||||||
* @param {integer} parameters.recordId
|
* @param {number} recordId
|
||||||
* @param {string} parameters.recordUuid
|
* @param {string} recordUuid
|
||||||
* @param {array} parameters.attributesList
|
|
||||||
*/
|
*/
|
||||||
export function deleteEntity(parameters) {
|
export function deleteEntity({ tableName, recordId, recordUuid }) {
|
||||||
var entityRequest = Instance.call(this).getUpdateEntityRequest()
|
return Instance.call(this).deleteEntity({
|
||||||
entityRequest.setTablename(parameters.tableName)
|
tableName,
|
||||||
if (parameters.recordId) {
|
recordId,
|
||||||
entityRequest.setRecordid(parameters.recordId)
|
recordUuid
|
||||||
}
|
})
|
||||||
entityRequest.setUuid(parameters.recordUuid)
|
|
||||||
|
|
||||||
// Delete Entity
|
|
||||||
return Instance.call(this).deleteEntity(entityRequest)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCriteria(tableName) {
|
export function getEntity({ tableName, recordId, recordUuid }) {
|
||||||
return Instance.call(this).getCriteria(tableName)
|
return Instance.call(this).requestEntity({
|
||||||
}
|
tableName,
|
||||||
|
recordId,
|
||||||
export function getObject(table, uuid = false, id = false) {
|
recordUuid
|
||||||
return Instance.call(this).getEntity(
|
})
|
||||||
Instance.call(this).getEntityRequest(table, uuid, id)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object List from window
|
* Object List from window
|
||||||
* @param {string} object.tableName
|
* @param {string} tableName
|
||||||
* @param {string} object.query
|
* @param {string} query
|
||||||
* @param {string} object.whereClause
|
* @param {string} whereClause
|
||||||
* @param {string} object.orderByClause
|
* @param {array} conditions
|
||||||
|
* @param {string} orderByClause
|
||||||
|
* @param {string} nextPageToken
|
||||||
*/
|
*/
|
||||||
export function getObjectListFromCriteria(object) {
|
export function getEntitiesList({ tableName, query, whereClause, conditions = [], orderByClause, nextPageToken }) {
|
||||||
const criteriaForList = getCriteria(object.tableName)
|
return Instance.call(this).requestEntitiesList({
|
||||||
|
tableName,
|
||||||
criteriaForList.setQuery(object.query)
|
query,
|
||||||
|
whereClause,
|
||||||
if (object.whereClause) {
|
conditionsList: conditions,
|
||||||
criteriaForList.setWhereclause(object.whereClause)
|
orderByClause,
|
||||||
}
|
nextPageToken
|
||||||
if (object.orderByClause) {
|
})
|
||||||
criteriaForList.setOrderbyclause(object.orderByClause)
|
|
||||||
}
|
|
||||||
|
|
||||||
// add conditions
|
|
||||||
if (object.conditions && object.conditions.length) {
|
|
||||||
object.conditions.forEach(itemCondition => {
|
|
||||||
const convertCondition = Instance.call(this).convertCondition(itemCondition)
|
|
||||||
criteriaForList.addConditions(convertCondition)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var nextPageToken
|
|
||||||
if (object.nextPageToken) {
|
|
||||||
nextPageToken = object.nextPageToken
|
|
||||||
}
|
|
||||||
return Instance.call(this).requestObjectListFromCriteria(criteriaForList, nextPageToken)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rollback entity (Create, Update, Delete)
|
* Rollback entity (Create, Update, Delete)
|
||||||
* @param {string} parametersRollback.tableName
|
* @param {string} tableName
|
||||||
* @param {integer} parametersRollback.recordId
|
* @param {number} recordId
|
||||||
* @param {string} parametersRollback.eventType
|
* @param {string} eventType
|
||||||
*/
|
*/
|
||||||
export function rollbackEntity(parametersRollback) {
|
export function rollbackEntity({ tableName, recordId, eventType }) {
|
||||||
var rollbackRequest = Instance.call(this).getRollbackEntityRequest()
|
return Instance.call(this).rollbackEntityRequest({
|
||||||
rollbackRequest.setTablename(parametersRollback.tableName)
|
tableName,
|
||||||
rollbackRequest.setRecordid(parametersRollback.recordId)
|
recordId,
|
||||||
|
eventTypeExecuted: eventType
|
||||||
// set event type
|
})
|
||||||
var eventType = Instance.call(this).getEventType()
|
|
||||||
eventType = eventType[parametersRollback.eventType]
|
|
||||||
rollbackRequest.setEventtype(eventType)
|
|
||||||
|
|
||||||
return Instance.call(this).rollbackEntityRequest(rollbackRequest)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Request a Lookup list data from Reference
|
|
||||||
* The main attributes that function hope are:
|
|
||||||
* @param {string} reference.tableName
|
|
||||||
* @param {string} reference.query
|
|
||||||
*/
|
|
||||||
export function getLookupList(reference) {
|
|
||||||
return Instance.call(this).requestLookupListFromReference(reference)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request a Lookup data from Reference
|
* Request a Lookup data from Reference
|
||||||
* The main attributes that function hope are:
|
* The main attributes that function hope are:
|
||||||
* @param {string} reference.tableName
|
* @param {string} tableName
|
||||||
* @param {string} reference.directQuery
|
* @param {string} directQuery
|
||||||
* @param {string|number} value
|
* @param {string|number} value
|
||||||
*/
|
*/
|
||||||
export function getLookup(reference) {
|
export function getLookup({ tableName, directQuery, value }) {
|
||||||
return Instance.call(this).requestLookupFromReference({
|
return Instance.call(this).requestLookupFromReference({
|
||||||
tableName: reference.tableName,
|
tableName,
|
||||||
directQuery: reference.directQuery
|
directQuery,
|
||||||
}, reference.value)
|
value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request a Lookup list data from Reference
|
||||||
|
* The main attributes that function hope are:
|
||||||
|
* @param {string} tableName
|
||||||
|
* @param {string} query
|
||||||
|
*/
|
||||||
|
export function getLookupList({ tableName, query }) {
|
||||||
|
return Instance.call(this).requestLookupListFromReference({
|
||||||
|
tableName,
|
||||||
|
query
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request a process
|
* Request a process
|
||||||
* This function allows follow structure:
|
* This function allows follow structure:
|
||||||
* @param {object} process
|
* @param {string} uuid, uuid from process to run
|
||||||
* @param {string} process.uuid, uuid from process to run
|
* @param {number} reportType
|
||||||
* @param {integer} process.tableName, table name of tab, used only window
|
* @param {number} tableName, table name of tab, used only window
|
||||||
* @param {integer} process.recordId, record identifier, used only window
|
* @param {number} recordId, record identifier, used only window
|
||||||
* @param {array} process.parameters, parameters from process
|
* @param {array} parameters, parameters from process [{ columnName, value }]
|
||||||
[ { columnName, value } ]
|
* @param {array} selection, selection records, used only browser
|
||||||
* @param {array} process.selection, selection records, used only browser
|
[{
|
||||||
[ {
|
|
||||||
selectionId,
|
selectionId,
|
||||||
selectionValues [
|
selectionValues: [{ columnName, value }]
|
||||||
{ columnName, value }
|
}]
|
||||||
]
|
* @param {string} printFormatUuid
|
||||||
} ]
|
|
||||||
*/
|
*/
|
||||||
export function runProcess(process) {
|
export function runProcess({ uuid, reportType, tableName, recordId, parameters: parametersList = [], selection = [], printFormatUuid }) {
|
||||||
var processRequest = Instance.call(this).getProcessRequest()
|
|
||||||
// Fill Request process
|
|
||||||
processRequest.setUuid(process.uuid)
|
|
||||||
// report export type
|
|
||||||
if (process.reportType) {
|
|
||||||
processRequest.setReporttype(process.reportType)
|
|
||||||
}
|
|
||||||
// process params
|
|
||||||
if (process.parameters && process.parameters.length) {
|
|
||||||
process.parameters.forEach(parameter => {
|
|
||||||
const convertedParameter = Instance.call(this).convertParameter(parameter)
|
|
||||||
processRequest.addParameters(convertedParameter)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// record in window
|
|
||||||
if (process.tableName) {
|
|
||||||
processRequest.setTablename(process.tableName)
|
|
||||||
processRequest.setRecordid(process.recordId)
|
|
||||||
}
|
|
||||||
|
|
||||||
// browser selection list records
|
|
||||||
if (process.selection && process.selection.length) {
|
|
||||||
process.selection.forEach(record => {
|
|
||||||
// selection format = { selectionId: integer, selectionValues: array }
|
|
||||||
const convertedRecord = Instance.call(this).convertSelection(record)
|
|
||||||
processRequest.addSelections(convertedRecord)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.printFormatUuid) {
|
|
||||||
processRequest.setPrintformatuuid(process.printFormatUuid)
|
|
||||||
}
|
|
||||||
// Run Process
|
// Run Process
|
||||||
return Instance.call(this).requestProcess(processRequest)
|
return Instance.call(this).requestRunProcess({
|
||||||
|
uuid,
|
||||||
|
reportType,
|
||||||
|
tableName,
|
||||||
|
recordId,
|
||||||
|
parametersList,
|
||||||
|
selectionsList: selection,
|
||||||
|
printFormatUuid
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request a browser search
|
* Request a browser search
|
||||||
* This function allows follow structure:
|
* @param {string} uuid
|
||||||
* @param {string} browser.uuid
|
* @param {string} query
|
||||||
* @param {string} browser.query
|
* @param {string} whereClause
|
||||||
* @param {string} browser.whereClause
|
* @param {string} orderByClause
|
||||||
* @param {string} browser.orderByClause
|
* @param {string} nextPageToken
|
||||||
* @param {array} browser.parameters
|
* @param {array} parameters, This allows follow structure:
|
||||||
* [{
|
* [{
|
||||||
* columnName,
|
* columnName,
|
||||||
* value
|
* value
|
||||||
* }]
|
* }]
|
||||||
*/
|
*/
|
||||||
export function getBrowserSearch(browser) {
|
export function getBrowserSearch({ uuid, parameters: parametersList = [], query, whereClause, orderByClause, nextPageToken }) {
|
||||||
var browserRequest = Instance.call(this).getBrowserRequest()
|
|
||||||
var criteria = Instance.call(this).getCriteria('')
|
|
||||||
// Fill Request browser
|
|
||||||
browserRequest.setUuid(browser.uuid)
|
|
||||||
criteria.setQuery(browser.query)
|
|
||||||
criteria.setWhereclause(browser.whereClause)
|
|
||||||
criteria.setOrderbyclause(browser.orderByClause)
|
|
||||||
|
|
||||||
if (browser.nextPageToken) {
|
|
||||||
browserRequest.setPageToken(browser.nextPageToken)
|
|
||||||
}
|
|
||||||
browserRequest.setCriteria(criteria)
|
|
||||||
/* isQueryCriteria fields parameters */
|
|
||||||
if (browser.parameters !== undefined) {
|
|
||||||
browser.parameters.forEach(parameter => {
|
|
||||||
const convertedParameter = Instance.call(this).convertParameter(parameter)
|
|
||||||
browserRequest.addParameters(convertedParameter)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// Run browser
|
// Run browser
|
||||||
return Instance.call(this).requestBrowser(browserRequest)
|
return Instance.call(this).requestBrowserSearch({
|
||||||
|
uuid,
|
||||||
|
parametersList,
|
||||||
|
query,
|
||||||
|
whereClause,
|
||||||
|
orderByClause,
|
||||||
|
nextPageToken
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request a Process Activity list
|
// Request a Process Activity list
|
||||||
@ -270,48 +195,48 @@ export function requestProcessActivity() {
|
|||||||
export function getRecentItems() {
|
export function getRecentItems() {
|
||||||
return Instance.call(this).requestRecentItems()
|
return Instance.call(this).requestRecentItems()
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* forget password
|
|
||||||
* @param {string} parameters.forgetPassword
|
|
||||||
*/
|
|
||||||
export function getForgetPassword(parameters) {
|
|
||||||
return Instance.call(this).requestForgetPassword(parameters)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reference List from Window
|
* Reference List from Window
|
||||||
* @param {string} parameters.tableName
|
* @param {string} tableName
|
||||||
* @param {string} parameters.windowUuid
|
* @param {string} windowUuid
|
||||||
* @param {string} parameters.recordUuid
|
* @param {string} recordUuid
|
||||||
* @param {integer} parameters.recordId
|
* @param {number} recordId
|
||||||
*/
|
*/
|
||||||
export function getReferencesList(parameters) {
|
export function getReferencesList({ windowUuid, tableName, recordId, recordUuid }) {
|
||||||
var requestReference = Instance.call(this).getReferencesRequest()
|
return Instance.call(this).listReferencesRequest({
|
||||||
requestReference.setWindowuuid(parameters.windowUuid)
|
windowUuid,
|
||||||
requestReference.setTablename(parameters.tableName)
|
tableName,
|
||||||
requestReference.setUuid(parameters.recordUuid)
|
recordId,
|
||||||
if (parameters.recordId) {
|
recordUuid
|
||||||
requestReference.setRecordid(parameters.recordId)
|
})
|
||||||
}
|
|
||||||
|
|
||||||
return Instance.call(this).listReferencesRequest(requestReference)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run callout request
|
* Run callout request
|
||||||
* @param {string} parametersCallout.windowUuid
|
* @param {string} windowUuid
|
||||||
* @param {integer} parametersCallout.windowNo
|
* @param {number} windowNo
|
||||||
* @param {string} parametersCallout.tabUuid
|
* @param {string} tabUuid
|
||||||
* @param {string} parametersCallout.tableName
|
* @param {string} tableName
|
||||||
* @param {string} parametersCallout.columnName
|
* @param {string} columnName
|
||||||
* @param {mixed} parametersCallout.value
|
* @param {mixed} value
|
||||||
* @param {mixed} parametersCallout.oldValue
|
* @param {mixed} oldValue
|
||||||
* @param {string} parametersCallout.callout
|
* @param {string} callout
|
||||||
* @param {array} parametersCallout.attributesList
|
* @param {array} attributesList
|
||||||
* @returns {Map} Entity
|
* @returns {Map} Entity
|
||||||
*/
|
*/
|
||||||
export function runCallOutRequest(parametersCallout) {
|
export function runCallOutRequest({ windowUuid, windowNo, tabUuid, tableName, columnName, value, oldValue, callout, attributesList = [] }) {
|
||||||
return Instance.call(this).runCalloutRequest(parametersCallout)
|
return Instance.call(this).runCalloutRequest({
|
||||||
|
windowUuid,
|
||||||
|
windowNo,
|
||||||
|
tabUuid,
|
||||||
|
tableName,
|
||||||
|
columnName,
|
||||||
|
value,
|
||||||
|
oldValue,
|
||||||
|
callout,
|
||||||
|
attributesList
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDefaultValueFromServer(query) {
|
export function getDefaultValueFromServer(query) {
|
||||||
@ -322,32 +247,63 @@ 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 getPrivateAccessFromServer({ tableName: tableName, recordId: recordId, userUuid: userUuid }) {
|
export function getPrivateAccessFromServer({ tableName, recordId, userUuid }) {
|
||||||
return Instance.call(this).getPrivateAccess({ tableName: tableName, recordId: recordId, userUuid: userUuid })
|
return Instance.call(this).getPrivateAccess({
|
||||||
|
tableName,
|
||||||
|
recordId,
|
||||||
|
userUuid
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function lockPrivateAccessFromServer({ tableName: tableName, recordId: recordId, userUuid: userUuid }) {
|
export function lockPrivateAccessFromServer({ tableName, recordId, userUuid }) {
|
||||||
return Instance.call(this).lockPrivateAccess({ tableName: tableName, recordId: recordId, userUuid: userUuid })
|
return Instance.call(this).lockPrivateAccess({
|
||||||
|
tableName,
|
||||||
|
recordId,
|
||||||
|
userUuid
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function unlockPrivateAccessFromServer({ tableName: tableName, recordId: recordId, userUuid: userUuid }) {
|
export function unlockPrivateAccessFromServer({ tableName, recordId, userUuid }) {
|
||||||
return Instance.call(this).unlockPrivateAccess({ tableName: tableName, recordId: recordId, userUuid: userUuid })
|
return Instance.call(this).unlockPrivateAccess({
|
||||||
|
tableName,
|
||||||
|
recordId,
|
||||||
|
userUuid
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request Favorites List
|
||||||
|
* @param {string} userUuid
|
||||||
|
*/
|
||||||
export function getFavoritesFromServer(userUuid) {
|
export function getFavoritesFromServer(userUuid) {
|
||||||
return Instance.call(this).requestFavorites(userUuid)
|
return Instance.call(this).requestFavorites(userUuid)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPendingDocumentsFromServer(userUuid, roleUuid) {
|
export function getPendingDocumentsFromServer({ userUuid, roleUuid }) {
|
||||||
return Instance.call(this).requestPendingDocuments(userUuid, roleUuid)
|
return Instance.call(this).requestPendingDocuments({
|
||||||
|
userUuid,
|
||||||
|
roleUuid
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request Pending Documents List
|
||||||
|
* @param {string} tableName
|
||||||
|
* @param {string} processUuid
|
||||||
|
*/
|
||||||
export function requestReportViews({ tableName, processUuid }) {
|
export function requestReportViews({ tableName, processUuid }) {
|
||||||
return Instance.call(this).requestReportViews({ tableName: tableName, processUuid: processUuid })
|
return Instance.call(this).requestReportViews({
|
||||||
|
tableName,
|
||||||
|
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,
|
||||||
|
reportViewUuid,
|
||||||
|
processUuid
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function requestLisDashboards(roleUuid) {
|
export function requestLisDashboards(roleUuid) {
|
||||||
@ -363,29 +319,21 @@ export function requestDrillTables(tableName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getReportOutput({
|
export function getReportOutput({
|
||||||
criteria: criteria,
|
parametersList,
|
||||||
printFormatUuid: printFormatUuid,
|
tableName,
|
||||||
reportViewUuid: reportViewUuid,
|
printFormatUuid,
|
||||||
isSummary: isSummary,
|
reportViewUuid,
|
||||||
reportName: reportName,
|
isSummary,
|
||||||
reportType: reportType,
|
reportName,
|
||||||
tableName: tableName
|
reportType
|
||||||
}) {
|
}) {
|
||||||
const criteriaForReport = getCriteria(tableName)
|
return Instance.call(this).getReportOutput({
|
||||||
if (criteria && criteria.length) {
|
parametersList,
|
||||||
criteria.forEach(parameter => {
|
tableName,
|
||||||
var isAddCodition = true
|
printFormatUuid,
|
||||||
if (parameter.isRange && criteria.some(param => param.columnName === `${parameter.columnName}_To`)) {
|
reportViewUuid,
|
||||||
parameter.valueTo = criteria.find(param => param.columnName === `${parameter.columnName}_To`).value
|
isSummary,
|
||||||
}
|
reportName,
|
||||||
const convertedParameter = Instance.call(this).convertCondition(parameter)
|
reportType
|
||||||
if (parameter.isRange && !parameter.hasOwnProperty('valueTo')) {
|
})
|
||||||
isAddCodition = false
|
|
||||||
}
|
|
||||||
if (isAddCodition) {
|
|
||||||
criteriaForReport.addConditions(convertedParameter)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return Instance.call(this).getReportOutput({ criteria: criteriaForReport, printFormatUuid: printFormatUuid, reportViewUuid: reportViewUuid, isSummary: isSummary, reportName: reportName, reportType: reportType })
|
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ export const contextMixin = {
|
|||||||
containerUuid: this.containerUuid,
|
containerUuid: this.containerUuid,
|
||||||
recordUuid: this.recordUuid
|
recordUuid: this.recordUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(() => {
|
||||||
this.references = this.$store.getters.getReferencesList(this.parentUuid, this.recordUuid)
|
this.references = this.$store.getters.getReferencesList(this.parentUuid, this.recordUuid)
|
||||||
if (this.references.referencesList.length) {
|
if (this.references.referencesList.length) {
|
||||||
this.isReferencesLoaded = true
|
this.isReferencesLoaded = true
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
<el-collapse v-model="activeDocuments" accordion>
|
<el-collapse v-model="activeDocuments" accordion>
|
||||||
<el-collapse-item name="documents">
|
<el-collapse-item name="documents">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<i class="el-icon-document" style="margin-right: 4px;margin-left: 10px;" /> {{ $t('profile.PendingDocuments') }}
|
<i class="el-icon-document" style="margin-right: 4px;margin-left: 10px;" />
|
||||||
|
{{ $t('profile.PendingDocuments') }}
|
||||||
</template>
|
</template>
|
||||||
<el-card class="box-card" :body-style="{ padding: '0px' }" shadow="never">
|
<el-card class="box-card" :body-style="{ padding: '0px' }" shadow="never">
|
||||||
<div class="recent-items">
|
<div class="recent-items">
|
||||||
@ -32,7 +33,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getPendingDocumentsFromServer } from '@/api/ADempiere'
|
import { getPendingDocumentsFromServer } from '@/api/ADempiere/data'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PendingDocuments',
|
name: 'PendingDocuments',
|
||||||
data() {
|
data() {
|
||||||
@ -59,34 +61,20 @@ export default {
|
|||||||
const userUuid = this.$store.getters['user/getUserUuid']
|
const userUuid = this.$store.getters['user/getUserUuid']
|
||||||
const roleUuid = this.$store.getters.getRoleUuid
|
const roleUuid = this.$store.getters.getRoleUuid
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getPendingDocumentsFromServer(userUuid, roleUuid)
|
getPendingDocumentsFromServer({ userUuid, roleUuid })
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const documentsList = response.getPendingdocumentsList().map(document => {
|
const documentsList = response.pendingDocumentsList.map(documentItem => {
|
||||||
return {
|
return {
|
||||||
formUuid: document.getFormuuid(),
|
...documentItem,
|
||||||
name: document.getDocumentname(),
|
name: documentItem.documentName,
|
||||||
description: document.getDocumentdescription(),
|
description: documentItem.documentDescription
|
||||||
criteria: {
|
|
||||||
type: document.getCriteria().getConditionsList(),
|
|
||||||
limit: document.getCriteria().getLimit(),
|
|
||||||
orderbyclause: document.getCriteria().getOrderbyclause(),
|
|
||||||
orderbycolumnList: document.getCriteria().getOrderbycolumnList(),
|
|
||||||
query: document.getCriteria().getQuery(),
|
|
||||||
referenceUuid: document.getCriteria().getReferenceuuid(),
|
|
||||||
tableName: document.getCriteria().getTablename(),
|
|
||||||
valuesList: document.getCriteria().getValuesList(),
|
|
||||||
whereClause: document.getCriteria().getWhereclause()
|
|
||||||
},
|
|
||||||
recordCount: document.getRecordcount(),
|
|
||||||
sequence: document.getSequence(),
|
|
||||||
windowUuid: document.getWindowuuid()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.documents = documentsList
|
this.documents = documentsList
|
||||||
resolve(documentsList)
|
resolve(documentsList)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
reject(error)
|
console.warn(`Error getting pending documents: ${error.message}. Code: ${error.code}.`)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
<el-collapse v-model="activeFavorites" accordion>
|
<el-collapse v-model="activeFavorites" accordion>
|
||||||
<el-collapse-item name="favorites">
|
<el-collapse-item name="favorites">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<i class="el-icon-time" style="margin-right: 4px;margin-left: 10px;" /> {{ $t('profile.favorites') }}
|
<i class="el-icon-time" style="margin-right: 4px;margin-left: 10px;" />
|
||||||
|
{{ $t('profile.favorites') }}
|
||||||
</template>
|
</template>
|
||||||
<el-card class="box-card" :body-style="{ padding: '0px' }" shadow="never">
|
<el-card class="box-card" :body-style="{ padding: '0px' }" shadow="never">
|
||||||
<div class="recent-items">
|
<div class="recent-items">
|
||||||
@ -34,8 +35,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getFavoritesFromServer } from '@/api/ADempiere'
|
import { getFavoritesFromServer } from '@/api/ADempiere/data'
|
||||||
import { convertAction } from '@/utils/ADempiere/dictionaryUtils'
|
import { convertAction } from '@/utils/ADempiere/dictionaryUtils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Favorites',
|
name: 'Favorites',
|
||||||
data() {
|
data() {
|
||||||
@ -48,9 +50,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
getterFavoritesList() {
|
|
||||||
return this.$store.getters.getFavoritesList
|
|
||||||
},
|
|
||||||
cachedViews() {
|
cachedViews() {
|
||||||
return this.$store.getters.cachedViews
|
return this.$store.getters.cachedViews
|
||||||
}
|
}
|
||||||
@ -65,13 +64,13 @@ export default {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getFavoritesFromServer(userUuid)
|
getFavoritesFromServer(userUuid)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const favorites = response.getFavoritesList().map(favorite => {
|
const favorites = response.favoritesList.map(favoriteElement => {
|
||||||
const actionConverted = convertAction(favorite.getAction())
|
const actionConverted = convertAction(favoriteElement.action)
|
||||||
return {
|
return {
|
||||||
uuid: favorite.getMenuuuid(),
|
...favoriteElement,
|
||||||
name: favorite.getMenuname(),
|
uuid: favoriteElement.menuUuid,
|
||||||
description: favorite.getMenudescription(),
|
name: favoriteElement.menuName,
|
||||||
referenceUuid: favorite.getReferenceuuid(),
|
description: favoriteElement.menuDescription,
|
||||||
action: actionConverted.name,
|
action: actionConverted.name,
|
||||||
icon: actionConverted.icon
|
icon: actionConverted.icon
|
||||||
}
|
}
|
||||||
@ -80,7 +79,7 @@ export default {
|
|||||||
resolve(favorites)
|
resolve(favorites)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
reject(error)
|
console.warn(`Error getting favorites: ${error.message}. Code: ${error.code}.`)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -24,6 +24,11 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
// load the component that is indicated in the attributes of received property
|
// load the component that is indicated in the attributes of received property
|
||||||
renderDashboard() {
|
renderDashboard() {
|
||||||
|
// TODO: Add support to this list of currently unsupported dashboards
|
||||||
|
const unsupportedDashboards = ['activities', 'views', 'calendar', 'performance']
|
||||||
|
if (unsupportedDashboards.includes(this.metadata.fileName)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (this.metadata.fileName === 'userfavorites') {
|
if (this.metadata.fileName === 'userfavorites') {
|
||||||
return () => import('@/components/ADempiere/Dashboard/favourites')
|
return () => import('@/components/ADempiere/Dashboard/favourites')
|
||||||
}
|
}
|
||||||
@ -34,22 +39,22 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.dashboard-editor-container {
|
.dashboard-editor-container {
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
background-color: rgb(240, 242, 245);
|
background-color: rgb(240, 242, 245);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.github-corner {
|
.github-corner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
border: 0;
|
border: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-wrapper {
|
.chart-wrapper {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 16px 16px 0;
|
padding: 16px 16px 0;
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
<el-collapse v-model="activeRecentItems" accordion>
|
<el-collapse v-model="activeRecentItems" accordion>
|
||||||
<el-collapse-item name="recentItems">
|
<el-collapse-item name="recentItems">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<i class="el-icon-time" style="margin-right: 4px;margin-left: 10px;" /> {{ $t('profile.recentItems') }}
|
<i class="el-icon-time" style="margin-right: 4px;margin-left: 10px;" />
|
||||||
|
{{ $t('profile.recentItems') }}
|
||||||
</template>
|
</template>
|
||||||
<el-card class="box-card" :body-style="{ padding: '0px' }" shadow="never">
|
<el-card class="box-card" :body-style="{ padding: '0px' }" shadow="never">
|
||||||
<div class="recent-items">
|
<div class="recent-items">
|
||||||
@ -69,21 +70,17 @@ export default {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getRecentItemsFromServer()
|
getRecentItemsFromServer()
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const recentItems = response.getRecentitemsList().map(item => {
|
const recentItems = response.recentItemsList.map(item => {
|
||||||
const actionConverted = convertAction(item.getAction())
|
const actionConverted = convertAction(item.action)
|
||||||
return {
|
return {
|
||||||
|
...item,
|
||||||
action: actionConverted.name,
|
action: actionConverted.name,
|
||||||
icon: actionConverted.icon,
|
icon: actionConverted.icon,
|
||||||
displayName: item.getDisplayname(),
|
uuidRecord: item.recordUuid,
|
||||||
menuUuid: item.getMenuuuid(),
|
updated: new Date(item.updated),
|
||||||
menuName: item.getMenuname(),
|
uuid: item.menuUuid,
|
||||||
windowUuid: item.getWindowuuid(),
|
name: item.menuName,
|
||||||
tableId: item.getTableid(),
|
description: item.menuDescription
|
||||||
recordId: item.getRecordid(),
|
|
||||||
uuidRecord: item.getRecorduuid(),
|
|
||||||
tabUuid: item.getTabuuid(),
|
|
||||||
updated: new Date(item.getUpdated()),
|
|
||||||
description: item.getMenudescription()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.recentItems = recentItems
|
this.recentItems = recentItems
|
||||||
@ -91,7 +88,7 @@ export default {
|
|||||||
resolve(recentItems)
|
resolve(recentItems)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
reject(error)
|
console.warn(`Error getting recent items: ${error.message}. Code: ${error.code}.`)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -193,7 +193,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
parentUuid: {
|
parentUuid: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: undefined
|
||||||
},
|
},
|
||||||
containerUuid: {
|
containerUuid: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -251,7 +251,7 @@ export default {
|
|||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
getterFieldList() {
|
getterFieldList() {
|
||||||
var panel = this.$store.getters.getPanel(this.containerUuid, this.isAdvancedQuery)
|
const panel = this.$store.getters.getPanel(this.containerUuid, this.isAdvancedQuery)
|
||||||
if (panel) {
|
if (panel) {
|
||||||
return panel.fieldList
|
return panel.fieldList
|
||||||
}
|
}
|
||||||
@ -293,7 +293,8 @@ export default {
|
|||||||
// used if the first load contains a uuid
|
// used if the first load contains a uuid
|
||||||
isLoadRecord(value) {
|
isLoadRecord(value) {
|
||||||
// TODO: Validate UUID value
|
// TODO: Validate UUID value
|
||||||
if (value && this.isPanelWindow && this.uuidRecord !== 'create-new' && !this.isEmptyValue(this.uuidRecord)) {
|
if (value && this.isPanelWindow && this.uuidRecord !== 'create-new' &&
|
||||||
|
!this.isEmptyValue(this.uuidRecord)) {
|
||||||
this.setTagsViewTitle(this.uuidRecord)
|
this.setTagsViewTitle(this.uuidRecord)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -326,9 +327,9 @@ export default {
|
|||||||
* Get the tab object with all its attributes as well as the fields it contains
|
* Get the tab object with all its attributes as well as the fields it contains
|
||||||
*/
|
*/
|
||||||
getPanel() {
|
getPanel() {
|
||||||
var fieldList = this.getterFieldList
|
const fieldsList = this.getterFieldList
|
||||||
if (fieldList && Array.isArray(fieldList)) {
|
if (fieldsList && Array.isArray(fieldsList)) {
|
||||||
this.generatePanel(fieldList)
|
this.generatePanel(fieldsList)
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('getPanelAndFields', {
|
this.$store.dispatch('getPanelAndFields', {
|
||||||
parentUuid: this.parentUuid,
|
parentUuid: this.parentUuid,
|
||||||
@ -342,11 +343,11 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
generatePanel(fieldList) {
|
generatePanel(fieldsList) {
|
||||||
// order and assign groups
|
// order and assign groups
|
||||||
this.fieldList = fieldList
|
this.fieldList = fieldsList
|
||||||
if (fieldList.length) {
|
if (fieldsList.length) {
|
||||||
this.fieldGroups = this.sortAndGroup(fieldList)
|
this.fieldGroups = this.sortAndGroup(fieldsList)
|
||||||
}
|
}
|
||||||
var firstGroup
|
var firstGroup
|
||||||
if (this.fieldGroups[0] && this.fieldGroups[0].groupFinal === '') {
|
if (this.fieldGroups[0] && this.fieldGroups[0].groupFinal === '') {
|
||||||
@ -551,7 +552,7 @@ export default {
|
|||||||
if (arr === undefined) {
|
if (arr === undefined) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var res = [{
|
let res = [{
|
||||||
groupFinal: '',
|
groupFinal: '',
|
||||||
metadataFields: arr
|
metadataFields: arr
|
||||||
}]
|
}]
|
||||||
@ -650,7 +651,7 @@ export default {
|
|||||||
this.setFocus()
|
this.setFocus()
|
||||||
},
|
},
|
||||||
setFocus() {
|
setFocus() {
|
||||||
var isFocusEnabled = false
|
let isFocusEnabled = false
|
||||||
this.getterFieldList.forEach(fieldItem => {
|
this.getterFieldList.forEach(fieldItem => {
|
||||||
if (!isFocusEnabled) {
|
if (!isFocusEnabled) {
|
||||||
if (this.isFocusable(fieldItem) && this.$refs.hasOwnProperty(fieldItem.columnName)) {
|
if (this.isFocusable(fieldItem) && this.$refs.hasOwnProperty(fieldItem.columnName)) {
|
||||||
|
@ -2,11 +2,16 @@
|
|||||||
<el-collapse v-model="activeRecentItems" accordion>
|
<el-collapse v-model="activeRecentItems" accordion>
|
||||||
<el-collapse-item name="recentItems">
|
<el-collapse-item name="recentItems">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<i class="el-icon-time" style="margin-right: 4px;margin-left: 10px;" /> {{ $t('profile.recentItems') }}
|
<i class="el-icon-time" style="margin-right: 4px;margin-left: 10px;" />
|
||||||
|
{{ $t('profile.recentItems') }}
|
||||||
</template>
|
</template>
|
||||||
<el-card class="box-card" :body-style="{ padding: '0px' }" shadow="never">
|
<el-card class="box-card" :body-style="{ padding: '0px' }" shadow="never">
|
||||||
<div class="recent-items">
|
<div class="recent-items">
|
||||||
<el-table :data="search.length ? filterResult(search) : recentItems" max-height="455" @row-click="handleClick">
|
<el-table
|
||||||
|
:data="search.length ? filterResult(search) : recentItems"
|
||||||
|
max-height="455"
|
||||||
|
@row-click="handleClick"
|
||||||
|
>
|
||||||
<el-table-column width="40">
|
<el-table-column width="40">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
<svg-icon :icon-class="row.icon" class="icon-window" />
|
<svg-icon :icon-class="row.icon" class="icon-window" />
|
||||||
@ -36,8 +41,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getRecentItems as getRecentItemsFromServer } from '@/api/ADempiere'
|
|
||||||
import { convertAction } from '@/utils/ADempiere/dictionaryUtils'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RecentItems',
|
name: 'RecentItems',
|
||||||
data() {
|
data() {
|
||||||
@ -66,40 +69,24 @@ export default {
|
|||||||
return this.cachedViews.includes(uuid)
|
return this.cachedViews.includes(uuid)
|
||||||
},
|
},
|
||||||
getRecentItems() {
|
getRecentItems() {
|
||||||
return new Promise((resolve, reject) => {
|
this.$store.dispatch('getRecentItemsFromServer')
|
||||||
getRecentItemsFromServer()
|
.then(recentItemsResponse => {
|
||||||
.then(response => {
|
this.recentItems = recentItemsResponse
|
||||||
const recentItems = response.getRecentitemsList().map(item => {
|
})
|
||||||
const actionConverted = convertAction(item.getAction())
|
|
||||||
return {
|
|
||||||
action: actionConverted.name,
|
|
||||||
icon: actionConverted.icon,
|
|
||||||
displayName: item.getDisplayname(),
|
|
||||||
menuUuid: item.getMenuuuid(),
|
|
||||||
menuName: item.getMenuname(),
|
|
||||||
windowUuid: item.getWindowuuid(),
|
|
||||||
tableId: item.getTableid(),
|
|
||||||
recordId: item.getRecordid(),
|
|
||||||
uuidRecord: item.getRecorduuid(),
|
|
||||||
tabUuid: item.getTabuuid(),
|
|
||||||
updated: new Date(item.getUpdated()),
|
|
||||||
description: item.getMenudescription()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.recentItems = recentItems
|
|
||||||
this.isLoaded = false
|
|
||||||
resolve(recentItems)
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
handleClick(row) {
|
handleClick(row) {
|
||||||
if (!this.isEmptyValue(row.uuidRecord)) {
|
if (this.isEmptyValue(row.uuidRecord)) {
|
||||||
this.$router.push({ name: row.menuUuid, query: { action: row.uuidRecord, tabParent: 0 }})
|
this.$router.push({
|
||||||
|
name: row.menuUuid
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({ name: row.menuUuid })
|
this.$router.push({
|
||||||
|
name: row.menuUuid,
|
||||||
|
query: {
|
||||||
|
action: row.uuidRecord,
|
||||||
|
tabParent: 0
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
subscribeChanges() {
|
subscribeChanges() {
|
||||||
|
@ -175,9 +175,9 @@ export default {
|
|||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
ProcessActivity: {
|
ProcessActivity: {
|
||||||
name: 'Name',
|
Name: 'Name',
|
||||||
zoomIn: 'Zoom in',
|
zoomIn: 'Zoom in',
|
||||||
description: 'Description',
|
Description: 'Description',
|
||||||
actions: 'Action',
|
actions: 'Action',
|
||||||
status: 'Status',
|
status: 'Status',
|
||||||
Logs: 'Summary',
|
Logs: 'Summary',
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { getBrowserSearch } from '@/api/ADempiere/data'
|
import { getBrowserSearch } from '@/api/ADempiere/data'
|
||||||
import { convertValuesMapToObject, isEmptyValue, parseContext, showMessage } from '@/utils/ADempiere'
|
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
|
||||||
|
import { parseContext } from '@/utils/ADempiere/contextUtils'
|
||||||
|
import { showMessage } from '@/utils/ADempiere/notification'
|
||||||
import language from '@/lang'
|
import language from '@/lang'
|
||||||
|
|
||||||
const browserControl = {
|
const browserControl = {
|
||||||
@ -9,8 +11,10 @@ const browserControl = {
|
|||||||
* @param {string} containerUuid, browser to search record data
|
* @param {string} containerUuid, browser to search record data
|
||||||
* @param {boolean} isClearSelection, clear selection after search
|
* @param {boolean} isClearSelection, clear selection after search
|
||||||
*/
|
*/
|
||||||
getBrowserSearch({ dispatch, rootGetters }, parameters) {
|
getBrowserSearch({ dispatch, rootGetters }, {
|
||||||
const { containerUuid, isClearSelection = false } = parameters
|
containerUuid,
|
||||||
|
isClearSelection = false
|
||||||
|
}) {
|
||||||
showMessage({
|
showMessage({
|
||||||
title: language.t('notifications.loading'),
|
title: language.t('notifications.loading'),
|
||||||
message: language.t('notifications.searching'),
|
message: language.t('notifications.searching'),
|
||||||
@ -25,27 +29,27 @@ const browserControl = {
|
|||||||
const browser = rootGetters.getBrowser(containerUuid)
|
const browser = rootGetters.getBrowser(containerUuid)
|
||||||
// parameters isQueryCriteria
|
// parameters isQueryCriteria
|
||||||
const finalParameters = rootGetters.getParametersToServer({
|
const finalParameters = rootGetters.getParametersToServer({
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
fieldList: browser.fieldList
|
fieldList: browser.fieldList
|
||||||
})
|
})
|
||||||
|
|
||||||
var parsedQuery = browser.query
|
let parsedQuery = browser.query
|
||||||
if (!isEmptyValue(parsedQuery) && parsedQuery.includes('@')) {
|
if (!isEmptyValue(parsedQuery) && parsedQuery.includes('@')) {
|
||||||
parsedQuery = parseContext({
|
parsedQuery = parseContext({
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
value: parsedQuery
|
value: parsedQuery
|
||||||
}, true)
|
}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
var parsedWhereClause = browser.whereClause
|
let parsedWhereClause = browser.whereClause
|
||||||
if (!isEmptyValue(parsedWhereClause) && parsedWhereClause.includes('@')) {
|
if (!isEmptyValue(parsedWhereClause) && parsedWhereClause.includes('@')) {
|
||||||
parsedWhereClause = parseContext({
|
parsedWhereClause = parseContext({
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
value: parsedWhereClause
|
value: parsedWhereClause
|
||||||
}, true)
|
}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
var nextPageToken
|
let nextPageToken
|
||||||
if (!isEmptyValue(allData.nextPageToken)) {
|
if (!isEmptyValue(allData.nextPageToken)) {
|
||||||
nextPageToken = allData.nextPageToken + '-' + allData.pageNumber
|
nextPageToken = allData.nextPageToken + '-' + allData.pageNumber
|
||||||
}
|
}
|
||||||
@ -59,35 +63,34 @@ const browserControl = {
|
|||||||
parameters: finalParameters,
|
parameters: finalParameters,
|
||||||
nextPageToken: nextPageToken
|
nextPageToken: nextPageToken
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(browserSearchResponse => {
|
||||||
const recordList = response.getRecordsList()
|
const recordsList = browserSearchResponse.recordsList.map(itemRecord => {
|
||||||
const record = recordList.map(itemRecord => {
|
return {
|
||||||
var values = convertValuesMapToObject(itemRecord.getValuesMap())
|
...itemRecord.values,
|
||||||
|
// datatables attributes
|
||||||
// datatables attribute
|
isNew: false,
|
||||||
values.isNew = false
|
isEdit: false,
|
||||||
values.isEdit = false
|
isSelected: false,
|
||||||
values.isSelected = false
|
isReadOnlyFromRow: false
|
||||||
values.isReadOnlyFromRow = false
|
}
|
||||||
return values
|
|
||||||
})
|
})
|
||||||
|
|
||||||
var selection = allData.selection
|
let selection = allData.selection
|
||||||
if (isClearSelection) {
|
if (isClearSelection) {
|
||||||
selection = []
|
selection = []
|
||||||
}
|
}
|
||||||
|
|
||||||
var token = response.getNextPageToken()
|
let token = browserSearchResponse.nextPageToken
|
||||||
if (token !== undefined) {
|
if (token !== undefined) {
|
||||||
token = token.slice(0, -2)
|
token = token.slice(0, -2)
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch('setRecordSelection', {
|
dispatch('setRecordSelection', {
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
record: record,
|
record: recordsList,
|
||||||
pageNumber: rootGetters.getPageNumber(containerUuid),
|
pageNumber: rootGetters.getPageNumber(containerUuid),
|
||||||
selection: selection,
|
selection: selection,
|
||||||
recordCount: response.getRecordcount(),
|
recordCount: browserSearchResponse.recordCount,
|
||||||
nextPageToken: token
|
nextPageToken: token
|
||||||
})
|
})
|
||||||
showMessage({
|
showMessage({
|
||||||
@ -95,13 +98,13 @@ const browserControl = {
|
|||||||
message: language.t('notifications.succcessSearch'),
|
message: language.t('notifications.succcessSearch'),
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
return record
|
return recordsList
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
// Set default registry values so that the table does not say loading,
|
// Set default registry values so that the table does not say loading,
|
||||||
// there was already a response from the server
|
// there was already a response from the server
|
||||||
dispatch('setRecordSelection', {
|
dispatch('setRecordSelection', {
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
panelType: 'browser'
|
panelType: 'browser'
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -111,7 +114,7 @@ const browserControl = {
|
|||||||
summary: error.message,
|
summary: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn('Error getting browser search: ' + error.message + '. Code: ' + error.code)
|
console.warn(`Error getting browser search: ${error.message}. Code: ${error.code}`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,52 +1,60 @@
|
|||||||
import { runCallOutRequest } from '@/api/ADempiere/data'
|
import { runCallOutRequest } from '@/api/ADempiere/data'
|
||||||
import { convertValuesMapToObject, showMessage } from '@/utils/ADempiere'
|
import { showMessage } from '@/utils/ADempiere/notification'
|
||||||
|
|
||||||
const callOutControl = {
|
const callOutControl = {
|
||||||
actions: {
|
actions: {
|
||||||
getCallout({ rootGetters, dispatch }, parameters) {
|
getCallout({ rootGetters, dispatch }, {
|
||||||
const window = rootGetters.getWindow(parameters.parentUuid)
|
parentUuid,
|
||||||
var finalParameters = []
|
containerUuid,
|
||||||
if (parameters.inTable) {
|
callout,
|
||||||
finalParameters = rootGetters.getParametersToServer({
|
tableName,
|
||||||
containerUuid: parameters.containerUuid,
|
columnName,
|
||||||
row: parameters.row
|
withOutColumnNames = [],
|
||||||
|
inTable = false,
|
||||||
|
row,
|
||||||
|
value,
|
||||||
|
oldValue
|
||||||
|
}) {
|
||||||
|
const window = rootGetters.getWindow(parentUuid)
|
||||||
|
let attributesList = []
|
||||||
|
if (inTable) {
|
||||||
|
attributesList = rootGetters.getParametersToServer({
|
||||||
|
containerUuid,
|
||||||
|
row
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
finalParameters = rootGetters.getParametersToServer({
|
attributesList = rootGetters.getParametersToServer({
|
||||||
containerUuid: parameters.containerUuid
|
containerUuid
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return runCallOutRequest({
|
return runCallOutRequest({
|
||||||
windowUuid: parameters.parentUuid,
|
windowUuid: parentUuid,
|
||||||
tabUuid: parameters.containerUuid,
|
tabUuid: containerUuid,
|
||||||
tableName: parameters.tableName,
|
tableName,
|
||||||
columnName: parameters.columnName,
|
columnName,
|
||||||
value: parameters.value,
|
value,
|
||||||
oldValue: parameters.oldValue,
|
oldValue,
|
||||||
callout: parameters.callout,
|
callout,
|
||||||
attributesList: finalParameters,
|
attributesList,
|
||||||
windowNo: window.windowIndex
|
windowNo: window.windowIndex
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(calloutResponse => {
|
||||||
const values = convertValuesMapToObject(
|
if (inTable) {
|
||||||
response.getValuesMap()
|
|
||||||
)
|
|
||||||
if (parameters.inTable) {
|
|
||||||
dispatch('notifyRowTableChange', {
|
dispatch('notifyRowTableChange', {
|
||||||
parentUuid: parameters.parentUuid,
|
parentUuid,
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
row: values,
|
row: calloutResponse.values,
|
||||||
isEdit: true
|
isEdit: true
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
dispatch('notifyPanelChange', {
|
dispatch('notifyPanelChange', {
|
||||||
parentUuid: parameters.parentUuid,
|
parentUuid,
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
panelType: 'window',
|
panelType: 'window',
|
||||||
newValues: values,
|
newValues: calloutResponse.values,
|
||||||
isSendToServer: false,
|
isSendToServer: false,
|
||||||
withOutColumnNames: parameters.withOutColumnNames,
|
withOutColumnNames,
|
||||||
isSendCallout: false
|
isSendCallout: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -56,7 +64,7 @@ const callOutControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn(`Field ${parameters.name} error callout`, error.message)
|
console.warn(`Field ${columnName} error callout`, error.message)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
// Default store for handle dashboard refresh and other functionalities
|
// Default store for handle dashboard refresh and other functionalities
|
||||||
import { requestLisDashboards } from '@/api/ADempiere/data'
|
import { requestLisDashboards, getRecentItems } from '@/api/ADempiere/data'
|
||||||
|
import { convertAction } from '@/utils/ADempiere/dictionaryUtils'
|
||||||
|
|
||||||
const dashboard = {
|
const dashboard = {
|
||||||
state: {
|
state: {
|
||||||
dashboard: []
|
dashboard: [],
|
||||||
|
recentItems: []
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
addDashboard(state, payload) {
|
addDashboard(state, payload) {
|
||||||
@ -10,36 +13,22 @@ const dashboard = {
|
|||||||
},
|
},
|
||||||
notifyDashboardRefresh: (state, payload) => {
|
notifyDashboardRefresh: (state, payload) => {
|
||||||
|
|
||||||
|
},
|
||||||
|
setRecentItems(state, payload) {
|
||||||
|
state.recentItems = payload
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
refreshDashboard({ commit, getters }, parameters) {
|
refreshDashboard({ commit }, parameters) {
|
||||||
commit('notifyDashboardRefresh', parameters)
|
commit('notifyDashboardRefresh', parameters)
|
||||||
},
|
},
|
||||||
listDashboard({ commit }, roleUuid) {
|
listDashboard({ commit }, roleUuid) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
requestLisDashboards(roleUuid)
|
requestLisDashboards(roleUuid)
|
||||||
.then(response => {
|
.then(dashboardResponse => {
|
||||||
const dashboards = response.getDashboardsList().map(item => {
|
|
||||||
return {
|
|
||||||
windowUuid: item.getWindowuuid(),
|
|
||||||
browserUuid: item.getBrowseruuid(),
|
|
||||||
dashboardName: item.getDashboardname(),
|
|
||||||
dashboardDescription: item.getDashboarddescription(),
|
|
||||||
dashboardHtml: item.getDashboardhtml(),
|
|
||||||
columnNo: item.getColumnno(),
|
|
||||||
lineNo: item.getLineno(),
|
|
||||||
isCollapsible: item.getIscollapsible(),
|
|
||||||
isOpenByDefault: item.getIsopenbydefault(),
|
|
||||||
isEventRequired: item.getIseventrequired(),
|
|
||||||
fileName: item.getFilename()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const roleDashboards = {
|
const roleDashboards = {
|
||||||
roleUuid: roleUuid,
|
roleUuid: roleUuid,
|
||||||
recordCount: response.getRecordcount(),
|
...dashboardResponse
|
||||||
dashboardList: dashboards,
|
|
||||||
nextPageToken: response.getNextPageToken()
|
|
||||||
}
|
}
|
||||||
commit('addDashboard', roleDashboards)
|
commit('addDashboard', roleDashboards)
|
||||||
resolve(roleDashboards)
|
resolve(roleDashboards)
|
||||||
@ -48,6 +37,28 @@ const dashboard = {
|
|||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getRecentItemsFromServer({ commit }) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
getRecentItems()
|
||||||
|
.then(recentItemsResponse => {
|
||||||
|
const recentItems = recentItemsResponse.recentItemsList.map(item => {
|
||||||
|
const actionConverted = convertAction(item.action)
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
originalAction: item.action,
|
||||||
|
action: actionConverted.name,
|
||||||
|
icon: actionConverted.icon
|
||||||
|
}
|
||||||
|
})
|
||||||
|
commit('setRecentItems', recentItems)
|
||||||
|
resolve(recentItems)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`Error gettin recent items: ${error.message}. Code: ${error.code}`)
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@ -60,6 +71,9 @@ const dashboard = {
|
|||||||
return state.dashboard.find(
|
return state.dashboard.find(
|
||||||
item => item.roleUuid === roleUuid
|
item => item.roleUuid === roleUuid
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
getRecentItems: (state) => {
|
||||||
|
return state.recentItems
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,20 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import {
|
import {
|
||||||
getObject,
|
getEntity,
|
||||||
getObjectListFromCriteria,
|
getEntitiesList,
|
||||||
getRecentItems,
|
|
||||||
getDefaultValueFromServer,
|
getDefaultValueFromServer,
|
||||||
convertValueFromGRPC,
|
|
||||||
getContextInfoValueFromServer,
|
getContextInfoValueFromServer,
|
||||||
getFavoritesFromServer,
|
|
||||||
getPrivateAccessFromServer,
|
getPrivateAccessFromServer,
|
||||||
lockPrivateAccessFromServer,
|
lockPrivateAccessFromServer,
|
||||||
unlockPrivateAccessFromServer,
|
unlockPrivateAccessFromServer
|
||||||
getPendingDocumentsFromServer
|
} from '@/api/ADempiere/data'
|
||||||
} from '@/api/ADempiere'
|
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
|
||||||
import { convertValuesMapToObject, isEmptyValue } from '@/utils/ADempiere/valueUtils'
|
|
||||||
import { showMessage } from '@/utils/ADempiere/notification'
|
import { showMessage } from '@/utils/ADempiere/notification'
|
||||||
import { convertAction } from '@/utils/ADempiere/dictionaryUtils'
|
|
||||||
import language from '@/lang'
|
import language from '@/lang'
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
state: {
|
state: {
|
||||||
recordSelection: [], // record data and selection
|
recordSelection: [], // record data and selection
|
||||||
recordDetail: [],
|
|
||||||
recentItems: [],
|
|
||||||
favorites: [],
|
|
||||||
pendingDocuments: [],
|
|
||||||
inGetting: [],
|
inGetting: [],
|
||||||
contextInfoField: [],
|
contextInfoField: [],
|
||||||
recordPrivateAccess: {}
|
recordPrivateAccess: {}
|
||||||
@ -72,36 +63,12 @@ const data = {
|
|||||||
notifyRowTableChange: (state, payload) => {
|
notifyRowTableChange: (state, payload) => {
|
||||||
Object.assign(payload.row, payload.newRow)
|
Object.assign(payload.row, payload.newRow)
|
||||||
},
|
},
|
||||||
setRecentItems(state, payload) {
|
|
||||||
state.recentItems = payload
|
|
||||||
},
|
|
||||||
setFavorites(state, payload) {
|
|
||||||
state.favorites = payload
|
|
||||||
},
|
|
||||||
setPendingDocuments(state, payload) {
|
|
||||||
state.pendingDocuments = payload
|
|
||||||
},
|
|
||||||
setPageNumber(state, payload) {
|
setPageNumber(state, payload) {
|
||||||
payload.data.pageNumber = payload.pageNumber
|
payload.data.pageNumber = payload.pageNumber
|
||||||
},
|
},
|
||||||
setIsloadContext(state, payload) {
|
setIsloadContext(state, payload) {
|
||||||
payload.data.isLoadedContext = payload.isLoadedContext
|
payload.data.isLoadedContext = payload.isLoadedContext
|
||||||
},
|
},
|
||||||
setRecordDetail(state, payload) {
|
|
||||||
var isFinded = false
|
|
||||||
state.recordDetail = state.recordDetail.map(itemData => {
|
|
||||||
if (itemData.uuid === payload.uuid) {
|
|
||||||
isFinded = true
|
|
||||||
var newValues = Object.assign(itemData.data, payload.data)
|
|
||||||
payload.data = newValues
|
|
||||||
return payload
|
|
||||||
}
|
|
||||||
return itemData
|
|
||||||
})
|
|
||||||
if (!isFinded) {
|
|
||||||
state.recordDetail.push(payload)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addNewRow(state, payload) {
|
addNewRow(state, payload) {
|
||||||
payload.data = payload.data.unshift(payload.values)
|
payload.data = payload.data.unshift(payload.values)
|
||||||
},
|
},
|
||||||
@ -162,7 +129,7 @@ const data = {
|
|||||||
*/
|
*/
|
||||||
addNewRow({ commit, getters, rootGetters, dispatch }, parameters) {
|
addNewRow({ commit, getters, rootGetters, dispatch }, parameters) {
|
||||||
const { parentUuid, containerUuid, isPanelValues = false, isEdit = true, isNew = true } = parameters
|
const { parentUuid, containerUuid, isPanelValues = false, isEdit = true, isNew = true } = parameters
|
||||||
var { fieldList = [] } = parameters
|
let { fieldList = [] } = parameters
|
||||||
|
|
||||||
const tabPanel = rootGetters.getPanel(containerUuid)
|
const tabPanel = rootGetters.getPanel(containerUuid)
|
||||||
|
|
||||||
@ -170,7 +137,7 @@ const data = {
|
|||||||
fieldList = tabPanel.fieldList
|
fieldList = tabPanel.fieldList
|
||||||
}
|
}
|
||||||
|
|
||||||
var values = {}
|
let values = {}
|
||||||
// add row with default values to create new record
|
// add row with default values to create new record
|
||||||
if (isPanelValues) {
|
if (isPanelValues) {
|
||||||
// add row with values used from record in panel
|
// add row with values used from record in panel
|
||||||
@ -450,22 +417,21 @@ const data = {
|
|||||||
/**
|
/**
|
||||||
* @param {string} tableName
|
* @param {string} tableName
|
||||||
* @param {string} recordUuid
|
* @param {string} recordUuid
|
||||||
|
* @param {number} recordId
|
||||||
*/
|
*/
|
||||||
getEntity({ commit }, parameters) {
|
getEntity({ commit }, {
|
||||||
|
tableName,
|
||||||
|
recordUuid,
|
||||||
|
recordId
|
||||||
|
}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getObject(parameters.tableName, parameters.recordUuid)
|
getEntity({
|
||||||
.then(response => {
|
tableName,
|
||||||
var map = response.getValuesMap()
|
recordUuid,
|
||||||
var newValues = convertValuesMapToObject(map)
|
recordId
|
||||||
const responseConvert = {
|
})
|
||||||
data: newValues,
|
.then(responseGetEntity => {
|
||||||
id: response.getId(),
|
resolve(responseGetEntity.values)
|
||||||
uuid: response.getUuid(),
|
|
||||||
tableName: parameters.tableName
|
|
||||||
}
|
|
||||||
|
|
||||||
commit('setRecordDetail', responseConvert)
|
|
||||||
resolve(newValues)
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
@ -523,20 +489,17 @@ const data = {
|
|||||||
containerUuid: containerUuid,
|
containerUuid: containerUuid,
|
||||||
isGetServer: false
|
isGetServer: false
|
||||||
})
|
})
|
||||||
return getObjectListFromCriteria({
|
return getEntitiesList({
|
||||||
tableName: tableName,
|
tableName,
|
||||||
query: query,
|
query,
|
||||||
whereClause: whereClause,
|
whereClause,
|
||||||
conditions: conditions,
|
conditions,
|
||||||
orderByClause: orderByClause,
|
orderByClause,
|
||||||
nextPageToken: nextPageToken
|
nextPageToken
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(dataResponse => {
|
||||||
const recordList = response.getRecordsList()
|
const recordsList = dataResponse.recordsList.map(itemRecord => {
|
||||||
const record = recordList.map(itemRecord => {
|
const values = itemRecord.values
|
||||||
const values = convertValuesMapToObject(
|
|
||||||
itemRecord.getValuesMap()
|
|
||||||
)
|
|
||||||
|
|
||||||
// datatables attributes
|
// datatables attributes
|
||||||
values.isNew = false
|
values.isNew = false
|
||||||
@ -556,7 +519,7 @@ const data = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const originalNextPageToken = response.getNextPageToken()
|
const originalNextPageToken = dataResponse.nextPageToken
|
||||||
let token = originalNextPageToken
|
let token = originalNextPageToken
|
||||||
if (isEmptyValue(token)) {
|
if (isEmptyValue(token)) {
|
||||||
token = dataStore.nextPageToken
|
token = dataStore.nextPageToken
|
||||||
@ -568,7 +531,7 @@ const data = {
|
|||||||
}
|
}
|
||||||
if (isShowNotification) {
|
if (isShowNotification) {
|
||||||
let searchMessage = 'searchWithOutRecords'
|
let searchMessage = 'searchWithOutRecords'
|
||||||
if (record.length) {
|
if (recordsList.length) {
|
||||||
searchMessage = 'succcessSearch'
|
searchMessage = 'succcessSearch'
|
||||||
}
|
}
|
||||||
showMessage({
|
showMessage({
|
||||||
@ -578,20 +541,20 @@ const data = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
dispatch('setRecordSelection', {
|
dispatch('setRecordSelection', {
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
record: record,
|
record: recordsList,
|
||||||
selection: dataStore.selection,
|
selection: dataStore.selection,
|
||||||
recordCount: response.getRecordcount(),
|
recordCount: dataResponse.recordCount,
|
||||||
nextPageToken: token,
|
nextPageToken: token,
|
||||||
originalNextPageToken: originalNextPageToken,
|
originalNextPageToken: originalNextPageToken,
|
||||||
isAddRecord: isAddRecord,
|
isAddRecord,
|
||||||
pageNumber: dataStore.pageNumber,
|
pageNumber: dataStore.pageNumber,
|
||||||
tableName: tableName,
|
tableName,
|
||||||
query: query,
|
query,
|
||||||
whereClause: whereClause
|
whereClause
|
||||||
})
|
})
|
||||||
return record
|
return recordsList
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
// Set default registry values so that the table does not say loading,
|
// Set default registry values so that the table does not say loading,
|
||||||
@ -612,18 +575,19 @@ const data = {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
commit('deleteInGetting', {
|
commit('deleteInGetting', {
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
tableName: tableName
|
tableName
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getRecordBySQL({ dispatch }, parameters) {
|
getRecordBySQL({ dispatch }, parameters) {
|
||||||
const { query, field } = parameters
|
const { query, field } = parameters
|
||||||
|
// TODO: Change to promise all
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getDefaultValueFromServer(query)
|
getDefaultValueFromServer(query)
|
||||||
.then(response => {
|
.then(defaultValueResponse => {
|
||||||
var valueToReturn = {}
|
const valueToReturn = {}
|
||||||
valueToReturn['key'] = convertValueFromGRPC(response)
|
valueToReturn.key = defaultValueResponse
|
||||||
// add display Column for table
|
// add display Column for table
|
||||||
if (field.componentPath === 'FieldSelect') {
|
if (field.componentPath === 'FieldSelect') {
|
||||||
dispatch('getLookupItemFromServer', {
|
dispatch('getLookupItemFromServer', {
|
||||||
@ -634,7 +598,7 @@ const data = {
|
|||||||
value: valueToReturn.key
|
value: valueToReturn.key
|
||||||
})
|
})
|
||||||
.then(responseLookup => {
|
.then(responseLookup => {
|
||||||
valueToReturn['label'] = responseLookup.label
|
valueToReturn.label = responseLookup.label
|
||||||
dispatch('addDisplayColumn', {
|
dispatch('addDisplayColumn', {
|
||||||
containerUuid: field.containerUuid,
|
containerUuid: field.containerUuid,
|
||||||
columnName: field.columnName,
|
columnName: field.columnName,
|
||||||
@ -649,94 +613,6 @@ const data = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getRecentItemsFromServer({ commit }) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
getRecentItems()
|
|
||||||
.then(response => {
|
|
||||||
const recentItems = response.getRecentitemsList().map(item => {
|
|
||||||
const actionConverted = convertAction(item.getAction())
|
|
||||||
return {
|
|
||||||
action: actionConverted.name,
|
|
||||||
icon: actionConverted.icon,
|
|
||||||
displayName: item.getDisplayname(),
|
|
||||||
menuUuid: item.getMenuuuid(),
|
|
||||||
menuName: item.getMenuname(),
|
|
||||||
windowUuid: item.getWindowuuid(),
|
|
||||||
tableId: item.getTableid(),
|
|
||||||
recordId: item.getRecordid(),
|
|
||||||
uuidRecord: item.getRecorduuid(),
|
|
||||||
tabUuid: item.getTabuuid(),
|
|
||||||
updated: new Date(item.getUpdated()),
|
|
||||||
description: item.getMenudescription()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
commit('setRecentItems', recentItems)
|
|
||||||
resolve(recentItems)
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getFavoritesFromServer({ commit, rootGetters }) {
|
|
||||||
const userUuid = rootGetters['user/getUserUuid']
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
getFavoritesFromServer(userUuid)
|
|
||||||
.then(response => {
|
|
||||||
const favorites = response.getFavoritesList().map(favorite => {
|
|
||||||
const actionConverted = convertAction(favorite.getAction())
|
|
||||||
return {
|
|
||||||
uuid: favorite.getMenuuuid(),
|
|
||||||
name: favorite.getMenuname(),
|
|
||||||
description: favorite.getMenudescription(),
|
|
||||||
referenceUuid: favorite.getReferenceuuid(),
|
|
||||||
action: actionConverted.name,
|
|
||||||
icon: actionConverted.icon
|
|
||||||
}
|
|
||||||
})
|
|
||||||
commit('setFavorites', favorites)
|
|
||||||
resolve(favorites)
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getPendingDocumentsFromServer({ commit, getters, rootGetters }) {
|
|
||||||
const userUuid = rootGetters['user/getUserUuid']
|
|
||||||
const roleUuid = getters.getRoleUuid
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
getPendingDocumentsFromServer(userUuid, roleUuid)
|
|
||||||
.then(response => {
|
|
||||||
const documentsList = response.getPendingdocumentsList().map(document => {
|
|
||||||
return {
|
|
||||||
formUuid: document.getFormuuid(),
|
|
||||||
name: document.getDocumentname(),
|
|
||||||
description: document.getDocumentdescription(),
|
|
||||||
criteria: {
|
|
||||||
type: document.getCriteria().getConditionsList(),
|
|
||||||
limit: document.getCriteria().getLimit(),
|
|
||||||
orderbyclause: document.getCriteria().getOrderbyclause(),
|
|
||||||
orderbycolumnList: document.getCriteria().getOrderbycolumnList(),
|
|
||||||
query: document.getCriteria().getQuery(),
|
|
||||||
referenceUuid: document.getCriteria().getReferenceuuid(),
|
|
||||||
tableName: document.getCriteria().getTablename(),
|
|
||||||
valuesList: document.getCriteria().getValuesList(),
|
|
||||||
whereClause: document.getCriteria().getWhereclause()
|
|
||||||
},
|
|
||||||
recordCount: document.getRecordcount(),
|
|
||||||
sequence: document.getSequence(),
|
|
||||||
windowUuid: document.getWindowuuid()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
commit('setPendingDocuments', documentsList)
|
|
||||||
resolve(documentsList)
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* TODO: Add support to tab children
|
* TODO: Add support to tab children
|
||||||
* @param {object} objectParams
|
* @param {object} objectParams
|
||||||
@ -745,7 +621,7 @@ const data = {
|
|||||||
* @param {objec} objectParams.isEdit, if the row displayed to edit mode
|
* @param {objec} objectParams.isEdit, if the row displayed to edit mode
|
||||||
* @param {objec} objectParams.isNew, if insert data to new row
|
* @param {objec} objectParams.isNew, if insert data to new row
|
||||||
*/
|
*/
|
||||||
notifyRowTableChange({ commit, state, getters, rootGetters }, objectParams) {
|
notifyRowTableChange({ commit, getters, rootGetters }, objectParams) {
|
||||||
const { parentUuid, containerUuid, isEdit = true } = objectParams
|
const { parentUuid, containerUuid, isEdit = true } = objectParams
|
||||||
var currentValues = {}
|
var currentValues = {}
|
||||||
if (objectParams.hasOwnProperty('values')) {
|
if (objectParams.hasOwnProperty('values')) {
|
||||||
@ -797,18 +673,18 @@ const data = {
|
|||||||
return itemRecord[keyColumn] === rowKey
|
return itemRecord[keyColumn] === rowKey
|
||||||
})
|
})
|
||||||
commit('notifyCellTableChange', {
|
commit('notifyCellTableChange', {
|
||||||
row: row,
|
row,
|
||||||
value: newValue,
|
value: newValue,
|
||||||
columnName: columnName,
|
columnName,
|
||||||
displayColumn: displayColumn
|
displayColumn
|
||||||
})
|
})
|
||||||
|
|
||||||
if (panelType === 'browser') {
|
if (panelType === 'browser') {
|
||||||
commit('notifyCellSelectionChange', {
|
commit('notifyCellSelectionChange', {
|
||||||
row: rowSelection,
|
row: rowSelection,
|
||||||
value: newValue,
|
value: newValue,
|
||||||
columnName: columnName,
|
columnName,
|
||||||
displayColumn: displayColumn
|
displayColumn
|
||||||
})
|
})
|
||||||
} else if (panelType === 'window') {
|
} else if (panelType === 'window') {
|
||||||
// request callouts
|
// request callouts
|
||||||
@ -816,14 +692,14 @@ const data = {
|
|||||||
!isEmptyValue(newValue) && !isEmptyValue(field.callout)) {
|
!isEmptyValue(newValue) && !isEmptyValue(field.callout)) {
|
||||||
withOutColumnNames.push(field.columnName)
|
withOutColumnNames.push(field.columnName)
|
||||||
dispatch('getCallout', {
|
dispatch('getCallout', {
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
tableName: field.tableName,
|
tableName: field.tableName,
|
||||||
columnName: field.columnName,
|
columnName: field.columnName,
|
||||||
callout: field.callout,
|
callout: field.callout,
|
||||||
value: newValue,
|
value: newValue,
|
||||||
withOutColumnNames: withOutColumnNames,
|
withOutColumnNames,
|
||||||
row: row,
|
row,
|
||||||
inTable: true
|
inTable: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -833,28 +709,28 @@ const data = {
|
|||||||
if (!fieldNotReady) {
|
if (!fieldNotReady) {
|
||||||
if (!isEmptyValue(row.UUID)) {
|
if (!isEmptyValue(row.UUID)) {
|
||||||
dispatch('updateCurrentEntityFromTable', {
|
dispatch('updateCurrentEntityFromTable', {
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
row: row
|
row
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
dispatch('createEntityFromTable', {
|
dispatch('createEntityFromTable', {
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
row: row
|
row
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// refresh record list
|
// refresh record list
|
||||||
dispatch('getDataListTab', {
|
dispatch('getDataListTab', {
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid
|
containerUuid
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const fieldsEmpty = rootGetters.getFieldListEmptyMandatory({
|
const fieldsEmpty = rootGetters.getFieldListEmptyMandatory({
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
row: row
|
row
|
||||||
})
|
})
|
||||||
showMessage({
|
showMessage({
|
||||||
message: language.t('notifications.mandatoryFieldMissing') + fieldsEmpty,
|
message: language.t('notifications.mandatoryFieldMissing') + fieldsEmpty,
|
||||||
@ -864,76 +740,80 @@ const data = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getContextInfoValueFromServer({ commit, getters }, parameters) {
|
getContextInfoValueFromServer({ commit, getters }, {
|
||||||
var { sqlStatement, contextInfoUuid } = parameters
|
contextInfoUuid,
|
||||||
var contextInforField = getters.getContextInfoField(contextInfoUuid, sqlStatement)
|
sqlStatement
|
||||||
|
}) {
|
||||||
|
const contextInforField = getters.getContextInfoField(contextInfoUuid, sqlStatement)
|
||||||
if (contextInforField) {
|
if (contextInforField) {
|
||||||
return contextInforField
|
return contextInforField
|
||||||
}
|
}
|
||||||
return getContextInfoValueFromServer({ uuid: contextInfoUuid, query: sqlStatement })
|
return getContextInfoValueFromServer({
|
||||||
.then(response => {
|
uuid: contextInfoUuid,
|
||||||
const contextInfo = {
|
query: sqlStatement
|
||||||
messageText: response.getMessagetext(),
|
})
|
||||||
messageTip: response.getMessagetip()
|
.then(contextInfoResponse => {
|
||||||
}
|
|
||||||
commit('setContextInfoField', {
|
commit('setContextInfoField', {
|
||||||
contextInfoUuid: contextInfoUuid,
|
contextInfoUuid,
|
||||||
sqlStatement: sqlStatement,
|
sqlStatement,
|
||||||
messageText: contextInfo.messageText,
|
...contextInfoResponse
|
||||||
messageTip: contextInfo.messageTip
|
|
||||||
})
|
})
|
||||||
return contextInfo
|
return contextInfoResponse
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.warn(`Error ${error.code} getting context info value for field ${error.message}`)
|
console.warn(`Error ${error.code} getting context info value for field ${error.message}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getPrivateAccessFromServer({ commit, rootGetters }, parameters) {
|
getPrivateAccessFromServer({ rootGetters }, {
|
||||||
const { tableName, recordId } = parameters
|
tableName,
|
||||||
const userUuid = rootGetters['user/getUserUuid']
|
recordId,
|
||||||
|
userUuid
|
||||||
|
}) {
|
||||||
|
if (isEmptyValue(userUuid)) {
|
||||||
|
userUuid = rootGetters['user/getUserUuid']
|
||||||
|
}
|
||||||
return getPrivateAccessFromServer({
|
return getPrivateAccessFromServer({
|
||||||
tableName: tableName,
|
tableName,
|
||||||
recordId: recordId,
|
recordId,
|
||||||
userUuid: userUuid
|
userUuid
|
||||||
})
|
})
|
||||||
.then(privateAccess => {
|
.then(privateAccessResponse => {
|
||||||
if (privateAccess.getRecordid()) {
|
if (isEmptyValue(privateAccessResponse.recordId)) {
|
||||||
var recordPrivateAccess = {
|
return {
|
||||||
isLocked: true,
|
|
||||||
tableName: privateAccess.getTablename(),
|
|
||||||
recordId: privateAccess.getRecordid(),
|
|
||||||
userUuid: privateAccess.getUseruuid()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
recordPrivateAccess = {
|
|
||||||
isLocked: false,
|
isLocked: false,
|
||||||
tableName: parameters.tableName,
|
tableName,
|
||||||
recordId: parameters.recordId,
|
recordId,
|
||||||
userUuid: rootGetters['user/getUserUuid']
|
userUuid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return recordPrivateAccess
|
return {
|
||||||
|
...privateAccessResponse,
|
||||||
|
isLocked: true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error)
|
console.warn(`Error get private access: ${error.message}. Code: ${error.code}:`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
lockRecord({ commit, rootGetters }, parameters) {
|
lockRecord({ rootGetters }, {
|
||||||
const { tableName, recordId } = parameters
|
tableName,
|
||||||
const userUuid = rootGetters['user/getUserUuid']
|
recordId,
|
||||||
|
userUuid
|
||||||
|
}) {
|
||||||
|
if (isEmptyValue(userUuid)) {
|
||||||
|
userUuid = rootGetters['user/getUserUuid']
|
||||||
|
}
|
||||||
return lockPrivateAccessFromServer({
|
return lockPrivateAccessFromServer({
|
||||||
tableName: tableName,
|
tableName,
|
||||||
recordId: recordId,
|
recordId,
|
||||||
userUuid: userUuid
|
userUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(privateAccessResponse => {
|
||||||
if (response.getRecordid()) {
|
if (!isEmptyValue(privateAccessResponse.recordId)) {
|
||||||
const recordLocked = {
|
const recordLocked = {
|
||||||
isPrivateAccess: true,
|
isPrivateAccess: true,
|
||||||
isLocked: true,
|
isLocked: true,
|
||||||
tableName: response.getTablename(),
|
...privateAccessResponse
|
||||||
recordId: response.getRecordid(),
|
|
||||||
userUuid: response.getUseruuid()
|
|
||||||
}
|
}
|
||||||
showMessage({
|
showMessage({
|
||||||
title: language.t('notifications.succesful'),
|
title: language.t('notifications.succesful'),
|
||||||
@ -949,25 +829,28 @@ const data = {
|
|||||||
message: language.t('login.unexpectedError'),
|
message: language.t('login.unexpectedError'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.error(error)
|
console.warn(`Error lock private access: ${error.message}. Code: ${error.code}:`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
unlockRecord({ commit, rootGetters, state }, parameters) {
|
unlockRecord({ rootGetters }, {
|
||||||
const { tableName, recordId } = parameters
|
tableName,
|
||||||
const userUuid = rootGetters['user/getUserUuid']
|
recordId,
|
||||||
|
userUuid
|
||||||
|
}) {
|
||||||
|
if (isEmptyValue(userUuid)) {
|
||||||
|
userUuid = rootGetters['user/getUserUuid']
|
||||||
|
}
|
||||||
return unlockPrivateAccessFromServer({
|
return unlockPrivateAccessFromServer({
|
||||||
tableName: tableName,
|
tableName,
|
||||||
recordId: recordId,
|
recordId,
|
||||||
userUuid: userUuid
|
userUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(privateAccessResponse => {
|
||||||
if (response.getRecordid()) {
|
if (!isEmptyValue(privateAccessResponse.recordId)) {
|
||||||
const recordUnlocked = {
|
const recordUnlocked = {
|
||||||
isPrivateAccess: true,
|
isPrivateAccess: true,
|
||||||
isLocked: false,
|
isLocked: false,
|
||||||
tableName: response.getTablename(),
|
...privateAccessResponse
|
||||||
recordId: response.getRecordid(),
|
|
||||||
userUuid: response.getUseruuid()
|
|
||||||
}
|
}
|
||||||
showMessage({
|
showMessage({
|
||||||
title: language.t('notifications.succesful'),
|
title: language.t('notifications.succesful'),
|
||||||
@ -983,7 +866,7 @@ const data = {
|
|||||||
message: language.t('login.unexpectedError'),
|
message: language.t('login.unexpectedError'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.error(error)
|
console.warn(`Error unlock private access: ${error.message}. Code: ${error.code}:`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1035,56 +918,35 @@ const data = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* @returns {object}
|
|
||||||
*/
|
|
||||||
getRecordDetail: (state) => (parameters) => {
|
|
||||||
return state.recordDetail.find(itemData => {
|
|
||||||
if (itemData.uuid === parameters.recordUuid) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}) || {}
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Getter converter selection data record in format
|
* Getter converter selection data record in format
|
||||||
* @param {string} containerUuid
|
* @param {string} containerUuid
|
||||||
* [
|
* @param {array} selection
|
||||||
* {
|
* [{
|
||||||
* selectionId: keyColumn Value,
|
* selectionId: keyColumn Value,
|
||||||
* selectionValues: [
|
* selectionValues: [{ columname, value }]
|
||||||
* { columname, value },
|
* }]
|
||||||
* { columname, value },
|
|
||||||
* { columname, value }
|
|
||||||
* ]
|
|
||||||
* },
|
|
||||||
* {
|
|
||||||
* selectionId: keyColumn Value,
|
|
||||||
* selectionValues: [
|
|
||||||
* { columname, value },
|
|
||||||
* { columname, value }
|
|
||||||
* ]
|
|
||||||
* }
|
|
||||||
* ]
|
|
||||||
*/
|
*/
|
||||||
getSelectionToServer: (state, getters, rootState, rootGetters) => (parameters) => {
|
getSelectionToServer: (state, getters, rootState, rootGetters) => ({ containerUuid, selection = [] }) => {
|
||||||
var { containerUuid, selection = [] } = parameters
|
const selectionToServer = []
|
||||||
var selectionToServer = []
|
|
||||||
const withOut = ['isEdit', 'isSelected', 'isSendToServer']
|
const withOut = ['isEdit', 'isSelected', 'isSendToServer']
|
||||||
|
|
||||||
if (selection.length <= 0) {
|
if (selection.length <= 0) {
|
||||||
selection = getters.getDataRecordSelection(containerUuid)
|
selection = getters.getDataRecordSelection(containerUuid)
|
||||||
}
|
}
|
||||||
if (selection.length) {
|
if (selection.length) {
|
||||||
const panel = rootGetters.getPanel(containerUuid)
|
const { fieldList, keyColumn } = rootGetters.getPanel(containerUuid)
|
||||||
|
// reduce list
|
||||||
|
const fieldsList = fieldList.filter(itemField => itemField.isIdentifier || itemField.isUpdateable)
|
||||||
|
|
||||||
selection.forEach(itemRow => {
|
selection.forEach(itemRow => {
|
||||||
var records = []
|
const records = []
|
||||||
|
|
||||||
Object.keys(itemRow).forEach(key => {
|
Object.keys(itemRow).forEach(key => {
|
||||||
if (!key.includes('DisplayColumn') && !withOut.includes(key)) {
|
if (!key.includes('DisplayColumn') && !withOut.includes(key)) {
|
||||||
// evaluate metadata attributes before to convert
|
// evaluate metadata attributes before to convert
|
||||||
const field = panel.fieldList.find(itemField => itemField.columnName === key)
|
const field = fieldsList.find(itemField => itemField.columnName === key)
|
||||||
if (field && (field.isIdentifier || field.isUpdateable)) {
|
if (field) {
|
||||||
records.push({
|
records.push({
|
||||||
columnName: key,
|
columnName: key,
|
||||||
value: itemRow[key]
|
value: itemRow[key]
|
||||||
@ -1094,22 +956,13 @@ const data = {
|
|||||||
})
|
})
|
||||||
|
|
||||||
selectionToServer.push({
|
selectionToServer.push({
|
||||||
selectionId: itemRow[panel.keyColumn],
|
selectionId: itemRow[keyColumn],
|
||||||
selectionValues: records
|
selectionValues: records
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return selectionToServer
|
return selectionToServer
|
||||||
},
|
},
|
||||||
getRecentItems: (state) => {
|
|
||||||
return state.recentItems
|
|
||||||
},
|
|
||||||
getFavoritesList: (state) => {
|
|
||||||
return state.favorites
|
|
||||||
},
|
|
||||||
getPendingDocuments: (state) => {
|
|
||||||
return state.pendingDocuments
|
|
||||||
},
|
|
||||||
getContextInfoField: (state) => (contextInfoUuid, sqlStatement) => {
|
getContextInfoField: (state) => (contextInfoUuid, sqlStatement) => {
|
||||||
return state.contextInfoField.find(info =>
|
return state.contextInfoField.find(info =>
|
||||||
info.contextInfoUuid === contextInfoUuid &&
|
info.contextInfoUuid === contextInfoUuid &&
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { getLookup, getLookupList, convertValueFromGRPC } from '@/api/ADempiere/data'
|
import { getLookup, getLookupList } from '@/api/ADempiere/data'
|
||||||
import { isEmptyValue, getCurrentRole, parseContext } from '@/utils/ADempiere'
|
import { getCurrentRole } from '@/utils/ADempiere/auth'
|
||||||
|
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
|
||||||
|
import { parseContext } from '@/utils/ADempiere/contextUtils'
|
||||||
|
|
||||||
const lookup = {
|
const lookup = {
|
||||||
state: {
|
state: {
|
||||||
@ -33,24 +35,22 @@ const lookup = {
|
|||||||
let parsedDirectQuery = directQuery
|
let parsedDirectQuery = directQuery
|
||||||
if (parsedDirectQuery.includes('@')) {
|
if (parsedDirectQuery.includes('@')) {
|
||||||
parsedDirectQuery = parseContext({
|
parsedDirectQuery = parseContext({
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
value: directQuery
|
value: directQuery
|
||||||
}, true)
|
}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return getLookup({
|
return getLookup({
|
||||||
tableName: tableName,
|
tableName,
|
||||||
directQuery: parsedDirectQuery,
|
directQuery: parsedDirectQuery,
|
||||||
value: value
|
value: value
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const map = response.getValuesMap()
|
const label = response.values.DisplayColumn
|
||||||
const label = convertValueFromGRPC(map.get('DisplayColumn'))
|
|
||||||
const option = {
|
const option = {
|
||||||
label: isEmptyValue(label) ? ' ' : label,
|
label: isEmptyValue(label) ? ' ' : label,
|
||||||
// key: convertValueFromGRPC(map.get('KeyColumn'))
|
key: value // response.values.KeyColumn
|
||||||
key: value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
commit('addLoockupItem', {
|
commit('addLoockupItem', {
|
||||||
@ -64,7 +64,7 @@ const lookup = {
|
|||||||
return option
|
return option
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.warn('Get Lookup, Select Base - Error ' + error.code + ': ' + error.message)
|
console.warn(`Get Lookup, Select Base - Error ${error.code}: ${error.message}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -83,40 +83,35 @@ const lookup = {
|
|||||||
let parsedQuery = query
|
let parsedQuery = query
|
||||||
if (parsedQuery.includes('@')) {
|
if (parsedQuery.includes('@')) {
|
||||||
parsedQuery = parseContext({
|
parsedQuery = parseContext({
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
value: query
|
value: query
|
||||||
}, true)
|
}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return getLookupList({
|
return getLookupList({
|
||||||
tableName: tableName,
|
tableName,
|
||||||
query: parsedQuery
|
query: parsedQuery
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const recordList = response.getRecordsList()
|
const options = response.recordsList.map(itemLookup => {
|
||||||
const options = []
|
return {
|
||||||
recordList.forEach(element => {
|
label: itemLookup.values.DisplayColumn,
|
||||||
const map = element.getValuesMap()
|
key: itemLookup.values.KeyColumn
|
||||||
const name = convertValueFromGRPC(map.get('DisplayColumn'))
|
}
|
||||||
const key = convertValueFromGRPC(map.get('KeyColumn'))
|
|
||||||
options.push({
|
|
||||||
label: isEmptyValue(name) ? ' ' : name,
|
|
||||||
key: isEmptyValue(key) ? -1 : isNaN(key) ? key : parseInt(key)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
commit('addLoockupList', {
|
commit('addLoockupList', {
|
||||||
list: options,
|
list: options,
|
||||||
tableName: tableName,
|
tableName,
|
||||||
parsedQuery: parsedQuery,
|
parsedQuery,
|
||||||
roleUuid: getCurrentRole(),
|
roleUuid: getCurrentRole(),
|
||||||
clientId: rootGetters.getContextClientId
|
clientId: rootGetters.getContextClientId
|
||||||
})
|
})
|
||||||
return options
|
return options
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.warn('Get Lookup List, Select Base - Error ' + error.code + ': ' + error.message)
|
console.warn(`Get Lookup List, Select Base - Error ${error.code}: ${error.message}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteLookupList({ commit, state }, {
|
deleteLookupList({ commit, state }, {
|
||||||
|
@ -81,7 +81,7 @@ const process = {
|
|||||||
dispatch('setContextMenu', {
|
dispatch('setContextMenu', {
|
||||||
containerUuid: processDefinition.uuid,
|
containerUuid: processDefinition.uuid,
|
||||||
relations: [],
|
relations: [],
|
||||||
actions: actions,
|
actions,
|
||||||
references: []
|
references: []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import { runProcess, requestProcessActivity } from '@/api/ADempiere'
|
import {
|
||||||
|
runProcess,
|
||||||
|
requestProcessActivity
|
||||||
|
} from '@/api/ADempiere/data'
|
||||||
import { showNotification } from '@/utils/ADempiere/notification'
|
import { showNotification } from '@/utils/ADempiere/notification'
|
||||||
import { isEmptyValue, convertMapToArrayPairs } from '@/utils/ADempiere'
|
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
|
||||||
import language from '@/lang'
|
import language from '@/lang'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
@ -117,9 +120,11 @@ const processControl = {
|
|||||||
message: `In this process (${samePocessInExecution.name}) there is already an execution in progress.`
|
message: `In this process (${samePocessInExecution.name}) there is already an execution in progress.`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
var selection = []
|
|
||||||
var allData = {}
|
// additional attributes to send server, selection to browser, or table name and record id to window
|
||||||
var tab, tableName, recordId
|
let selection = []
|
||||||
|
let allData = {}
|
||||||
|
let tab, tableName, recordId
|
||||||
if (params.panelType) {
|
if (params.panelType) {
|
||||||
if (params.panelType === 'browser') {
|
if (params.panelType === 'browser') {
|
||||||
allData = getters.getDataRecordAndSelection(params.containerUuid)
|
allData = getters.getDataRecordAndSelection(params.containerUuid)
|
||||||
@ -160,7 +165,7 @@ const processControl = {
|
|||||||
}
|
}
|
||||||
// get info metadata process
|
// get info metadata process
|
||||||
const processDefinition = rootGetters.getProcess(params.action.uuid)
|
const processDefinition = rootGetters.getProcess(params.action.uuid)
|
||||||
var reportType = params.reportFormat
|
let reportType = params.reportFormat
|
||||||
const finalParameters = rootGetters.getParametersToServer({ containerUuid: processDefinition.uuid })
|
const finalParameters = rootGetters.getParametersToServer({ containerUuid: processDefinition.uuid })
|
||||||
|
|
||||||
showNotification({
|
showNotification({
|
||||||
@ -242,46 +247,22 @@ const processControl = {
|
|||||||
tableName: windowSelectionProcess.tableName,
|
tableName: windowSelectionProcess.tableName,
|
||||||
recordId: selection[windowSelectionProcess.tableName]
|
recordId: selection[windowSelectionProcess.tableName]
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(runProcessResponse => {
|
||||||
var output = {
|
const { instanceUuid, output } = runProcessResponse
|
||||||
uuid: '',
|
let logList = []
|
||||||
name: '',
|
if (runProcessResponse.logsList) {
|
||||||
description: '',
|
logList = runProcessResponse.logsList
|
||||||
fileName: '',
|
|
||||||
mimeType: '',
|
|
||||||
output: '',
|
|
||||||
outputStream: '',
|
|
||||||
reportType: ''
|
|
||||||
}
|
|
||||||
if (response.getOutput()) {
|
|
||||||
const responseOutput = response.getOutput()
|
|
||||||
output = {
|
|
||||||
uuid: responseOutput.getUuid(),
|
|
||||||
name: responseOutput.getName(),
|
|
||||||
description: responseOutput.getDescription(),
|
|
||||||
fileName: responseOutput.getFilename(),
|
|
||||||
mimeType: responseOutput.getMimetype(),
|
|
||||||
output: responseOutput.getOutput(),
|
|
||||||
outputStream: responseOutput.getOutputstream(),
|
|
||||||
reportType: responseOutput.getReporttype()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var logList = []
|
|
||||||
if (response.getLogsList()) {
|
|
||||||
logList = response.getLogsList().map(itemLog => {
|
|
||||||
return {
|
|
||||||
log: itemLog.getLog(),
|
|
||||||
recordId: itemLog.getRecordid()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var link = {
|
let link = {
|
||||||
href: undefined,
|
href: undefined,
|
||||||
download: undefined
|
download: undefined
|
||||||
}
|
}
|
||||||
if (processDefinition.isReport) {
|
if (processDefinition.isReport) {
|
||||||
const blob = new Blob([output.outputStream], { type: output.mimeType })
|
const blob = new Blob(
|
||||||
|
[output.outputStream],
|
||||||
|
{ type: output.mimeType }
|
||||||
|
)
|
||||||
link = document.createElement('a')
|
link = document.createElement('a')
|
||||||
link.href = window.URL.createObjectURL(blob)
|
link.href = window.URL.createObjectURL(blob)
|
||||||
link.download = output.fileName
|
link.download = output.fileName
|
||||||
@ -290,7 +271,7 @@ const processControl = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Report views List to context menu
|
// Report views List to context menu
|
||||||
var reportViewList = {
|
const reportViewList = {
|
||||||
name: language.t('views.reportView'),
|
name: language.t('views.reportView'),
|
||||||
type: 'summary',
|
type: 'summary',
|
||||||
action: '',
|
action: '',
|
||||||
@ -298,20 +279,27 @@ const processControl = {
|
|||||||
option: 'reportView'
|
option: 'reportView'
|
||||||
}
|
}
|
||||||
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
||||||
if (!reportViewList.childs.length) {
|
if (reportViewList && isEmptyValue(reportViewList.childs)) {
|
||||||
dispatch('requestReportViews', {
|
dispatch('requestReportViews', {
|
||||||
processUuid: processResult.processUuid
|
processUuid: processResult.processUuid,
|
||||||
|
instanceUuid,
|
||||||
|
processId: processDefinition.id,
|
||||||
|
tableName: output.tableName,
|
||||||
|
printFormatUuid: output.printFormatUuid,
|
||||||
|
reportViewUuid: output.reportViewUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(responseReportView => {
|
||||||
reportViewList.childs = response
|
reportViewList.childs = responseReportView
|
||||||
// Get contextMenu metadata and concat print report views with contextMenu actions
|
if (reportViewList.childs.length) {
|
||||||
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
// Get contextMenu metadata and concat print report views with contextMenu actions
|
||||||
contextMenuMetadata.actions.push(reportViewList)
|
const contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(reportViewList)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print formats to context menu
|
// Print formats to context menu
|
||||||
var printFormatList = {
|
const printFormatList = {
|
||||||
name: language.t('views.printFormat'),
|
name: language.t('views.printFormat'),
|
||||||
type: 'summary',
|
type: 'summary',
|
||||||
action: '',
|
action: '',
|
||||||
@ -319,30 +307,62 @@ const processControl = {
|
|||||||
option: 'printFormat'
|
option: 'printFormat'
|
||||||
}
|
}
|
||||||
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
||||||
if (!printFormatList.childs.length) {
|
if (printFormatList && isEmptyValue(printFormatList.childs.length)) {
|
||||||
dispatch('requestPrintFormats', {
|
dispatch('requestPrintFormats', {
|
||||||
processUuid: processResult.processUuid
|
processUuid: processResult.processUuid,
|
||||||
|
instanceUuid,
|
||||||
|
processId: processDefinition.id,
|
||||||
|
tableName: output.tableName,
|
||||||
|
printFormatUuid: output.printFormatUuid,
|
||||||
|
reportViewUuid: output.reportViewUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(printFormarResponse => {
|
||||||
printFormatList.childs = response
|
printFormatList.childs = printFormarResponse
|
||||||
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
if (printFormatList.childs.length) {
|
||||||
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
||||||
contextMenuMetadata.actions.push(printFormatList)
|
const contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(printFormatList)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Drill Tables to context menu
|
||||||
|
const drillTablesList = {
|
||||||
|
name: language.t('views.drillTable'),
|
||||||
|
type: 'summary',
|
||||||
|
action: '',
|
||||||
|
childs: [],
|
||||||
|
option: 'drillTable'
|
||||||
|
}
|
||||||
|
if (!isEmptyValue(output.tableName)) {
|
||||||
|
drillTablesList.childs = rootGetters.getDrillTablesList(processResult.processUuid)
|
||||||
|
if (drillTablesList && isEmptyValue(drillTablesList.childs)) {
|
||||||
|
dispatch('requestDrillTables', {
|
||||||
|
processUuid: processResult.processUuid,
|
||||||
|
instanceUuid,
|
||||||
|
processId: processDefinition.id,
|
||||||
|
tableName: output.tableName,
|
||||||
|
printFormatUuid: output.printFormatUuid,
|
||||||
|
reportViewUuid: output.reportViewUuid
|
||||||
|
})
|
||||||
|
.then(drillTablesResponse => {
|
||||||
|
drillTablesList.childs = drillTablesResponse
|
||||||
|
if (drillTablesList.childs.length) {
|
||||||
|
// Get contextMenu metadata and concat drill tables list with contextMenu actions
|
||||||
|
const contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(drillTablesList)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// assign new attributes
|
// assign new attributes
|
||||||
Object.assign(processResult, {
|
Object.assign(processResult, {
|
||||||
instanceUuid: response.getInstanceuuid(),
|
...runProcessResponse,
|
||||||
url: link.href,
|
url: link.href,
|
||||||
download: link.download,
|
download: link.download,
|
||||||
isError: response.getIserror(),
|
|
||||||
isProcessing: response.getIsprocessing(),
|
|
||||||
summary: response.getSummary(),
|
|
||||||
ResultTableName: response.getResulttablename(),
|
|
||||||
lastRun: response.getLastrun(),
|
|
||||||
logs: logList,
|
logs: logList,
|
||||||
output: output
|
output
|
||||||
})
|
})
|
||||||
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
||||||
commit('addNotificationProcess', processResult)
|
commit('addNotificationProcess', processResult)
|
||||||
@ -354,7 +374,7 @@ const processControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
isProcessing: false
|
isProcessing: false
|
||||||
})
|
})
|
||||||
console.log('Error running the process', error)
|
console.warn(`Error running the process ${error}`)
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@ -373,7 +393,7 @@ const processControl = {
|
|||||||
// message: language.t('notifications.totalProcess') + countResponse + language.t('notifications.error') + state.errorSelection + language.t('notifications.succesful') + state.successSelection + language.t('notifications.processExecuted'),
|
// message: language.t('notifications.totalProcess') + countResponse + language.t('notifications.error') + state.errorSelection + language.t('notifications.succesful') + state.successSelection + language.t('notifications.processExecuted'),
|
||||||
// type: 'success'
|
// type: 'success'
|
||||||
// })
|
// })
|
||||||
var processMessage = {
|
const processMessage = {
|
||||||
title: language.t('notifications.succesful'),
|
title: language.t('notifications.succesful'),
|
||||||
message: language.t('notifications.totalProcess') + countResponse + language.t('notifications.error') + state.errorSelection + language.t('notifications.succesful') + state.successSelection + language.t('notifications.processExecuted'),
|
message: language.t('notifications.totalProcess') + countResponse + language.t('notifications.error') + state.errorSelection + language.t('notifications.succesful') + state.successSelection + language.t('notifications.processExecuted'),
|
||||||
type: 'success'
|
type: 'success'
|
||||||
@ -401,71 +421,28 @@ const processControl = {
|
|||||||
runProcess({
|
runProcess({
|
||||||
uuid: processDefinition.uuid,
|
uuid: processDefinition.uuid,
|
||||||
id: processDefinition.id,
|
id: processDefinition.id,
|
||||||
reportType: reportType,
|
reportType,
|
||||||
parameters: finalParameters,
|
parameters: finalParameters,
|
||||||
selection: selection,
|
selection,
|
||||||
tableName: tableName,
|
tableName,
|
||||||
recordId: recordId
|
recordId
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(runProcessResponse => {
|
||||||
var output = {
|
const { instanceUuid, output } = runProcessResponse
|
||||||
uuid: '',
|
let logList = []
|
||||||
name: '',
|
if (runProcessResponse.logsList) {
|
||||||
description: '',
|
logList = runProcessResponse.logsList
|
||||||
fileName: '',
|
|
||||||
mimeType: '',
|
|
||||||
output: '',
|
|
||||||
outputStream: '',
|
|
||||||
reportType: ''
|
|
||||||
}
|
|
||||||
if (response.getOutput()) {
|
|
||||||
const responseOutput = response.getOutput()
|
|
||||||
output = {
|
|
||||||
uuid: responseOutput.getUuid(),
|
|
||||||
name: responseOutput.getName(),
|
|
||||||
description: responseOutput.getDescription(),
|
|
||||||
fileName: responseOutput.getFilename(),
|
|
||||||
mimeType: responseOutput.getMimetype(),
|
|
||||||
output: responseOutput.getOutput(),
|
|
||||||
outputStream: responseOutput.getOutputstream(),
|
|
||||||
reportType: responseOutput.getReporttype()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var logList = []
|
|
||||||
if (response.getLogsList()) {
|
|
||||||
logList = response.getLogsList().map(itemLog => {
|
|
||||||
return {
|
|
||||||
log: itemLog.getLog(),
|
|
||||||
recordId: itemLog.getRecordid()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
|
||||||
if (reportViewList && !reportViewList.childs.length) {
|
|
||||||
dispatch('requestReportViews', {
|
|
||||||
processUuid: processResult.processUuid,
|
|
||||||
instanceUuid: response.getInstanceuuid(),
|
|
||||||
processId: processDefinition.id,
|
|
||||||
tableName: output.tableName,
|
|
||||||
printFormatUuid: output.printFormatUuid,
|
|
||||||
reportViewUuid: output.reportViewUuid
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
reportViewList.childs = response
|
|
||||||
if (reportViewList.childs.length) {
|
|
||||||
// Get contextMenu metadata and concat print report views with contextMenu actions
|
|
||||||
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
|
||||||
contextMenuMetadata.actions.push(reportViewList)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var link = {
|
let link = {
|
||||||
href: undefined,
|
href: undefined,
|
||||||
download: undefined
|
download: undefined
|
||||||
}
|
}
|
||||||
if (processDefinition.isReport) {
|
if (processDefinition.isReport) {
|
||||||
const blob = new Blob([output.outputStream], { type: output.mimeType })
|
const blob = new Blob(
|
||||||
|
[output.outputStream],
|
||||||
|
{ type: output.mimeType }
|
||||||
|
)
|
||||||
link = document.createElement('a')
|
link = document.createElement('a')
|
||||||
link.href = window.URL.createObjectURL(blob)
|
link.href = window.URL.createObjectURL(blob)
|
||||||
link.download = output.fileName
|
link.download = output.fileName
|
||||||
@ -474,7 +451,7 @@ const processControl = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Report views List to context menu
|
// Report views List to context menu
|
||||||
var reportViewList = {
|
const reportViewList = {
|
||||||
name: language.t('views.reportView'),
|
name: language.t('views.reportView'),
|
||||||
type: 'summary',
|
type: 'summary',
|
||||||
action: '',
|
action: '',
|
||||||
@ -482,20 +459,27 @@ const processControl = {
|
|||||||
option: 'reportView'
|
option: 'reportView'
|
||||||
}
|
}
|
||||||
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
||||||
if (!reportViewList.childs.length) {
|
if (reportViewList && !reportViewList.childs.length) {
|
||||||
dispatch('requestReportViews', {
|
dispatch('requestReportViews', {
|
||||||
processUuid: processResult.processUuid
|
processUuid: processResult.processUuid,
|
||||||
|
instanceUuid,
|
||||||
|
processId: processDefinition.id,
|
||||||
|
tableName: output.tableName,
|
||||||
|
printFormatUuid: output.printFormatUuid,
|
||||||
|
reportViewUuid: output.reportViewUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(responseReportView => {
|
||||||
reportViewList.childs = response
|
reportViewList.childs = responseReportView
|
||||||
// Get contextMenu metadata and concat print report views with contextMenu actions
|
if (reportViewList.childs.length) {
|
||||||
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
// Get contextMenu metadata and concat print report views with contextMenu actions
|
||||||
contextMenuMetadata.actions.push(reportViewList)
|
const contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(reportViewList)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print formats to context menu
|
// Print formats to context menu
|
||||||
var printFormatList = {
|
const printFormatList = {
|
||||||
name: language.t('views.printFormat'),
|
name: language.t('views.printFormat'),
|
||||||
type: 'summary',
|
type: 'summary',
|
||||||
action: '',
|
action: '',
|
||||||
@ -503,20 +487,27 @@ const processControl = {
|
|||||||
option: 'printFormat'
|
option: 'printFormat'
|
||||||
}
|
}
|
||||||
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
||||||
if (!printFormatList.childs.length) {
|
if (printFormatList && !printFormatList.childs.length) {
|
||||||
dispatch('requestPrintFormats', {
|
dispatch('requestPrintFormats', {
|
||||||
processUuid: processResult.processUuid
|
processUuid: processResult.processUuid,
|
||||||
|
instanceUuid,
|
||||||
|
processId: processDefinition.id,
|
||||||
|
tableName: output.tableName,
|
||||||
|
printFormatUuid: output.printFormatUuid,
|
||||||
|
reportViewUuid: output.reportViewUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(printFormarResponse => {
|
||||||
printFormatList.childs = response
|
printFormatList.childs = printFormarResponse
|
||||||
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
if (printFormatList.childs.length) {
|
||||||
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
||||||
contextMenuMetadata.actions.push(printFormatList)
|
const contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(printFormatList)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drill Tables to context menu
|
// Drill Tables to context menu
|
||||||
var drillTablesList = {
|
const drillTablesList = {
|
||||||
name: language.t('views.drillTable'),
|
name: language.t('views.drillTable'),
|
||||||
type: 'summary',
|
type: 'summary',
|
||||||
action: '',
|
action: '',
|
||||||
@ -528,17 +519,17 @@ const processControl = {
|
|||||||
if (drillTablesList && isEmptyValue(drillTablesList.childs)) {
|
if (drillTablesList && isEmptyValue(drillTablesList.childs)) {
|
||||||
dispatch('requestDrillTables', {
|
dispatch('requestDrillTables', {
|
||||||
processUuid: processResult.processUuid,
|
processUuid: processResult.processUuid,
|
||||||
instanceUuid: response.getInstanceuuid(),
|
instanceUuid,
|
||||||
processId: processDefinition.id,
|
processId: processDefinition.id,
|
||||||
tableName: output.tableName,
|
tableName: output.tableName,
|
||||||
printFormatUuid: output.printFormatUuid,
|
printFormatUuid: output.printFormatUuid,
|
||||||
reportViewUuid: output.reportViewUuid
|
reportViewUuid: output.reportViewUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(drillTablesResponse => {
|
||||||
drillTablesList.childs = response
|
drillTablesList.childs = drillTablesResponse
|
||||||
if (drillTablesList.childs.length) {
|
if (drillTablesList.childs.length) {
|
||||||
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
||||||
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
const contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
contextMenuMetadata.actions.push(drillTablesList)
|
contextMenuMetadata.actions.push(drillTablesList)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -547,16 +538,11 @@ const processControl = {
|
|||||||
}
|
}
|
||||||
// assign new attributes
|
// assign new attributes
|
||||||
Object.assign(processResult, {
|
Object.assign(processResult, {
|
||||||
instanceUuid: response.getInstanceuuid(),
|
...runProcessResponse,
|
||||||
url: link.href,
|
url: link.href,
|
||||||
download: link.download,
|
download: link.download,
|
||||||
isError: response.getIserror(),
|
|
||||||
isProcessing: response.getIsprocessing(),
|
|
||||||
summary: response.getSummary(),
|
|
||||||
resultTableName: response.getResulttablename(),
|
|
||||||
lastRun: response.getLastrun(),
|
|
||||||
logs: logList,
|
logs: logList,
|
||||||
output: output
|
output
|
||||||
})
|
})
|
||||||
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
||||||
resolve(processResult)
|
resolve(processResult)
|
||||||
@ -567,7 +553,7 @@ const processControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
isProcessing: false
|
isProcessing: false
|
||||||
})
|
})
|
||||||
console.log('Error running the process', error)
|
console.warn(`Error running the process ${error.message}. Code: ${error.code}`)
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@ -715,7 +701,10 @@ const processControl = {
|
|||||||
download: undefined
|
download: undefined
|
||||||
}
|
}
|
||||||
if (processDefinition.isReport) {
|
if (processDefinition.isReport) {
|
||||||
const blob = new Blob([output.outputStream], { type: output.mimeType })
|
const blob = new Blob(
|
||||||
|
[output.outputStream],
|
||||||
|
{ type: output.mimeType }
|
||||||
|
)
|
||||||
link = document.createElement('a')
|
link = document.createElement('a')
|
||||||
link.href = window.URL.createObjectURL(blob)
|
link.href = window.URL.createObjectURL(blob)
|
||||||
link.download = output.fileName
|
link.download = output.fileName
|
||||||
@ -796,7 +785,7 @@ const processControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
isProcessing: false
|
isProcessing: false
|
||||||
})
|
})
|
||||||
console.log('Error running the process', error)
|
console.warn(`Error running the process ${error}`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -808,63 +797,31 @@ const processControl = {
|
|||||||
getSessionProcessFromServer({ commit, dispatch, getters, rootGetters }) {
|
getSessionProcessFromServer({ commit, dispatch, getters, rootGetters }) {
|
||||||
// process Activity
|
// process Activity
|
||||||
return requestProcessActivity()
|
return requestProcessActivity()
|
||||||
.then(response => {
|
.then(processActivityResponse => {
|
||||||
var responseList = response.getResponsesList().map(responseItem => {
|
const responseList = processActivityResponse.responsesList.map(businessProcessItem => {
|
||||||
var uuid = responseItem.getUuid()
|
const processMetadata = rootGetters.getProcess(businessProcessItem.uuid)
|
||||||
var responseOutput = responseItem.getOutput()
|
|
||||||
var output
|
|
||||||
if (responseOutput !== undefined) {
|
|
||||||
output = {
|
|
||||||
uuid: uuid,
|
|
||||||
name: responseOutput.getName(),
|
|
||||||
description: responseOutput.getDescription(),
|
|
||||||
fileName: responseOutput.getFilename(),
|
|
||||||
mimeType: responseOutput.getMimetype(),
|
|
||||||
output: responseOutput.getOutput(),
|
|
||||||
outputStream: responseOutput.getOutputstream(),
|
|
||||||
outputStream_asB64: responseOutput.getOutputstream_asB64(),
|
|
||||||
outputStream_asU8: responseOutput.getOutputstream_asU8(),
|
|
||||||
reportType: responseOutput.getReporttype()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var logList = responseItem.getLogsList().map(log => {
|
|
||||||
return {
|
|
||||||
recordId: log.getRecordid(),
|
|
||||||
log: log.getLog()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
var processMetadata = rootGetters.getProcess(uuid)
|
|
||||||
// if no exists metadata process in store and no request progess
|
// if no exists metadata process in store and no request progess
|
||||||
if (processMetadata === undefined && getters.getInRequestMetadata(uuid) === undefined) {
|
if (processMetadata === undefined && getters.getInRequestMetadata(businessProcessItem.uuid) === undefined) {
|
||||||
commit('addInRequestMetadata', uuid)
|
commit('addInRequestMetadata', businessProcessItem.uuid)
|
||||||
dispatch('getProcessFromServer', { containerUuid: uuid })
|
dispatch('getProcessFromServer', {
|
||||||
|
containerUuid: businessProcessItem.uuid
|
||||||
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
commit('deleteInRequestMetadata', uuid)
|
commit('deleteInRequestMetadata', businessProcessItem.uuid)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var process = {
|
const process = {
|
||||||
processUuid: responseItem.getUuid(),
|
...businessProcessItem,
|
||||||
instanceUuid: responseItem.getInstanceuuid(),
|
processUuid: businessProcessItem.uuid
|
||||||
isError: responseItem.getIserror(),
|
|
||||||
isProcessing: responseItem.getIsprocessing(),
|
|
||||||
logs: logList,
|
|
||||||
output: output,
|
|
||||||
lastRun: responseItem.getLastrun(),
|
|
||||||
parametersMap: responseItem.getParametersMap(),
|
|
||||||
parameters: convertMapToArrayPairs(
|
|
||||||
responseItem.getParametersMap()
|
|
||||||
),
|
|
||||||
ResultTableName: responseItem.getResulttablename(),
|
|
||||||
summary: responseItem.getSummary()
|
|
||||||
}
|
}
|
||||||
return process
|
return process
|
||||||
})
|
})
|
||||||
|
|
||||||
var processResponseList = {
|
const processResponseList = {
|
||||||
recordCount: response.getRecordcount(),
|
recordCount: processActivityResponse.recordCount,
|
||||||
processList: responseList,
|
processList: responseList,
|
||||||
nextPageToken: response.getNextPageToken()
|
nextPageToken: processActivityResponse.nextPageToken
|
||||||
}
|
}
|
||||||
commit('setSessionProcess', processResponseList)
|
commit('setSessionProcess', processResponseList)
|
||||||
return processResponseList
|
return processResponseList
|
||||||
@ -875,17 +832,19 @@ const processControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn('Error getting process activity:' + error.message + '. Code: ' + error.code)
|
console.warn(`Error getting process activity: ${error.message}. Code: ${error.code}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
*
|
* Show modal dialog with process/report, tab (sequence) metadata
|
||||||
* @param {object} params
|
* @param {object} params
|
||||||
*/
|
*/
|
||||||
setShowDialog({ state, commit, dispatch, rootGetters }, params) {
|
setShowDialog({ state, commit, dispatch, rootGetters }, params) {
|
||||||
const panels = ['process', 'report', 'window']
|
const panels = ['process', 'report', 'window']
|
||||||
if (params.action && (panels.includes(params.type) || panels.includes(params.action.panelType))) {
|
if (params.action && (panels.includes(params.type) || panels.includes(params.action.panelType))) {
|
||||||
if (state.metadata && state.metadata.containerUuid === params.action.containerUuid) {
|
// show some process loaded in store
|
||||||
|
if (state.metadata && !isEmptyValue(state.metadata.containerUuid) &&
|
||||||
|
state.metadata.containerUuid === params.action.containerUuid) {
|
||||||
commit('setShowDialog', true)
|
commit('setShowDialog', true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -893,7 +852,7 @@ const processControl = {
|
|||||||
if (panel === undefined) {
|
if (panel === undefined) {
|
||||||
dispatch('getPanelAndFields', {
|
dispatch('getPanelAndFields', {
|
||||||
parentUuid: params.action.parentUuid,
|
parentUuid: params.action.parentUuid,
|
||||||
containerUuid: params.action.containerUuid || params.action.uuid,
|
containerUuid: isEmptyValue(params.action.uuid) ? params.action.containerUuid : params.action.uuid,
|
||||||
panelType: params.action.panelType
|
panelType: params.action.panelType
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
@ -917,7 +876,7 @@ const processControl = {
|
|||||||
logs: parameters.processOutput.logs,
|
logs: parameters.processOutput.logs,
|
||||||
summary: parameters.processOutput.summary
|
summary: parameters.processOutput.summary
|
||||||
}
|
}
|
||||||
var errorMessage = !isEmptyValue(parameters.processOutput.message) ? parameters.processOutput.message : language.t('login.error')
|
var errorMessage = !isEmptyValue(parameters.processOutput.message) ? parameters.processOutput.message : language.t('notifications.error')
|
||||||
// TODO: Add isReport to type always 'success'
|
// TODO: Add isReport to type always 'success'
|
||||||
if (parameters.processOutput.isError || isEmptyValue(parameters.processOutput.processId) || isEmptyValue(parameters.processOutput.instanceUuid)) {
|
if (parameters.processOutput.isError || isEmptyValue(parameters.processOutput.processId) || isEmptyValue(parameters.processOutput.instanceUuid)) {
|
||||||
processMessage.title = language.t('notifications.error')
|
processMessage.title = language.t('notifications.error')
|
||||||
@ -931,7 +890,7 @@ const processControl = {
|
|||||||
parameters.processOutput.menuParentUuid = parameters.processOutput.processUuid
|
parameters.processOutput.menuParentUuid = parameters.processOutput.processUuid
|
||||||
}
|
}
|
||||||
|
|
||||||
var tableName
|
let tableName
|
||||||
if (parameters.processOutput.option && !isEmptyValue(parameters.processOutput.option)) {
|
if (parameters.processOutput.option && !isEmptyValue(parameters.processOutput.option)) {
|
||||||
if (parameters.processOutput.option === 'drillTable') {
|
if (parameters.processOutput.option === 'drillTable') {
|
||||||
tableName = parameters.processOutput.tableName
|
tableName = parameters.processOutput.tableName
|
||||||
|
@ -22,85 +22,93 @@ const contextMenu = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
requestPrintFormats({ commit }, parameters) {
|
requestPrintFormats({ commit }, {
|
||||||
return requestPrintFormats({ processUuid: parameters.processUuid })
|
processId,
|
||||||
.then(response => {
|
processUuid,
|
||||||
const printFormatList = response.getPrintformatsList().map(printFormat => {
|
instanceUuid
|
||||||
|
}) {
|
||||||
|
return requestPrintFormats({ processUuid })
|
||||||
|
.then(printFormatResponse => {
|
||||||
|
const printFormatList = printFormatResponse.printFormatsList.map(printFormatItem => {
|
||||||
return {
|
return {
|
||||||
printFormatUuid: printFormat.getUuid(),
|
...printFormatItem,
|
||||||
name: printFormat.getName(),
|
|
||||||
description: printFormat.getDescription(),
|
|
||||||
isDefault: printFormat.getIsdefault(),
|
|
||||||
tableName: printFormat.getTablename(),
|
|
||||||
reportViewUuid: printFormat.getReportviewuuid(),
|
|
||||||
type: 'updateReport',
|
type: 'updateReport',
|
||||||
option: 'printFormat',
|
option: 'printFormat',
|
||||||
instanceUuid: parameters.instanceUuid,
|
instanceUuid,
|
||||||
processUuid: parameters.processUuid,
|
processUuid,
|
||||||
processId: parameters.processId
|
processId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
commit('setReportFormatsList', {
|
commit('setReportFormatsList', {
|
||||||
containerUuid: parameters.processUuid,
|
containerUuid: processUuid,
|
||||||
printFormatList: printFormatList
|
printFormatList
|
||||||
})
|
})
|
||||||
return printFormatList
|
return printFormatList
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error)
|
console.warn(`Error getting print formats: ${error.message}. Code: ${error.code}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
requestReportViews({ commit }, parameters) {
|
requestReportViews({ commit }, {
|
||||||
return requestReportViews({ processUuid: parameters.processUuid })
|
processId,
|
||||||
.then(response => {
|
processUuid,
|
||||||
const reportViewList = response.getReportviewsList().map(reportView => {
|
instanceUuid,
|
||||||
|
printFormatUuid
|
||||||
|
}) {
|
||||||
|
return requestReportViews({ processUuid })
|
||||||
|
.then(reportViewResponse => {
|
||||||
|
const reportViewList = reportViewResponse.reportViewsList.map(reportViewItem => {
|
||||||
return {
|
return {
|
||||||
reportViewUuid: reportView.getUuid(),
|
...reportViewItem,
|
||||||
name: reportView.getName(),
|
|
||||||
tableName: reportView.getTablename(),
|
|
||||||
description: reportView.getDescription(),
|
|
||||||
type: 'updateReport',
|
type: 'updateReport',
|
||||||
option: 'reportView',
|
option: 'reportView',
|
||||||
instanceUuid: parameters.instanceUuid,
|
instanceUuid,
|
||||||
printFormatUuid: parameters.printFormatUuid,
|
printFormatUuid,
|
||||||
processUuid: parameters.processUuid,
|
processUuid,
|
||||||
processId: parameters.processId
|
processId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
commit('setReportViewsList', {
|
commit('setReportViewsList', {
|
||||||
containerUuid: parameters.processUuid,
|
containerUuid: processUuid,
|
||||||
viewList: reportViewList
|
viewList: reportViewList
|
||||||
})
|
})
|
||||||
return reportViewList
|
return reportViewList
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error)
|
console.warn(`Error getting report views: ${error.message}. Code: ${error.code}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
requestDrillTables({ commit }, parameters) {
|
requestDrillTables({ commit }, {
|
||||||
return requestDrillTables(parameters.tableName)
|
processId,
|
||||||
.then(response => {
|
processUuid,
|
||||||
const drillTablesList = response.getDrilltablesList().map(drillTable => {
|
instanceUuid,
|
||||||
|
printFormatUuid,
|
||||||
|
tableName,
|
||||||
|
reportViewUuid
|
||||||
|
}) {
|
||||||
|
return requestDrillTables(tableName)
|
||||||
|
.then(responseDrillTables => {
|
||||||
|
const drillTablesList = responseDrillTables.drillTablesList.map(drillTableItem => {
|
||||||
return {
|
return {
|
||||||
name: drillTable.getPrintname(),
|
...drillTableItem,
|
||||||
tableName: drillTable.getTablename(),
|
name: drillTableItem.printName,
|
||||||
type: 'updateReport',
|
type: 'updateReport',
|
||||||
option: 'drillTable',
|
option: 'drillTable',
|
||||||
instanceUuid: parameters.instanceUuid,
|
instanceUuid,
|
||||||
printFormatUuid: parameters.printFormatUuid,
|
printFormatUuid,
|
||||||
reportViewUuid: parameters.reportViewUuid,
|
reportViewUuid,
|
||||||
processUuid: parameters.processUuid,
|
processUuid,
|
||||||
processId: parameters.processId
|
processId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
commit('setDrillTablesList', {
|
commit('setDrillTablesList', {
|
||||||
containerUuid: parameters.processUuid,
|
containerUuid: processUuid,
|
||||||
drillTablesList: drillTablesList
|
drillTablesList
|
||||||
})
|
})
|
||||||
return drillTablesList
|
return drillTablesList
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error)
|
console.warn(`Error getting drill tables: ${error.message}. Code: ${error.code}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getReportOutputFromServer({ commit, getters, rootGetters }, parameters) {
|
getReportOutputFromServer({ commit, getters, rootGetters }, parameters) {
|
||||||
@ -119,33 +127,19 @@ const contextMenu = {
|
|||||||
instanceUuid,
|
instanceUuid,
|
||||||
option
|
option
|
||||||
} = parameters
|
} = parameters
|
||||||
const processParameters = rootGetters.getParametersToServer({ containerUuid: processUuid })
|
const parametersList = rootGetters.getParametersToServer({ containerUuid: processUuid })
|
||||||
return getReportOutput({
|
return getReportOutput({
|
||||||
criteria: processParameters,
|
parametersList,
|
||||||
printFormatUuid: printFormatUuid,
|
printFormatUuid,
|
||||||
reportViewUuid: reportViewUuid,
|
reportViewUuid,
|
||||||
isSummary: isSummary,
|
isSummary,
|
||||||
reportName: reportName,
|
reportName,
|
||||||
reportType: reportType,
|
reportType,
|
||||||
tableName: tableName
|
tableName
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const reportOutput = {
|
const reportOutput = {
|
||||||
uuid: response.getUuid(),
|
...response,
|
||||||
processName: response.getName(),
|
|
||||||
description: response.getDescription(),
|
|
||||||
fileName: response.getFilename(),
|
|
||||||
output: response.getOutput(),
|
|
||||||
mimeType: response.getMimetype(),
|
|
||||||
dataCols: response.getDatacols(),
|
|
||||||
dataRows: response.getDatarows(),
|
|
||||||
headerName: response.getHeadername(),
|
|
||||||
footerName: response.getFootername(),
|
|
||||||
printFormatUuid: response.getPrintformatuuid(),
|
|
||||||
reportViewUuid: response.getReportviewuuid(),
|
|
||||||
tableName: response.getTablename(),
|
|
||||||
outputStream: response.getOutputstream(),
|
|
||||||
reportType: response.getReporttype(),
|
|
||||||
processId: processId,
|
processId: processId,
|
||||||
processUuid: processUuid,
|
processUuid: processUuid,
|
||||||
isError: false,
|
isError: false,
|
||||||
@ -180,7 +174,7 @@ const contextMenu = {
|
|||||||
isReport: true,
|
isReport: true,
|
||||||
option: ''
|
option: ''
|
||||||
}
|
}
|
||||||
console.error(error)
|
console.warn(`Error getting report output: ${error.message}. Code: ${error.code}`)
|
||||||
return reportOutput
|
return reportOutput
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -107,22 +107,9 @@ const utils = {
|
|||||||
getLanguagesFromServer({ commit }) {
|
getLanguagesFromServer({ commit }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
requestLanguages()
|
requestLanguages()
|
||||||
.then(response => {
|
.then(languageResponse => {
|
||||||
const languageList = response.getLanguagesList().map(item => {
|
commit('setLanguageList', languageResponse.languagesList)
|
||||||
return {
|
resolve(languageResponse.languagesList)
|
||||||
language: item.getLanguage(),
|
|
||||||
languageName: item.getLanguagename(),
|
|
||||||
languageIso: item.getLanguageiso(),
|
|
||||||
countryCode: item.getCountrycode(),
|
|
||||||
isBaseLanguage: item.getIsbaselanguage(),
|
|
||||||
isSystemLanguage: item.getIssystemlanguage(),
|
|
||||||
isDecimalPoint: item.getIsdecimalpoint(),
|
|
||||||
datePattern: item.getDatepattern(),
|
|
||||||
timePattern: item.getTimepattern()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
commit('setLanguageList', languageList)
|
|
||||||
resolve(languageList)
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { createEntity, updateEntity, deleteEntity, getReferencesList, rollbackEntity } from '@/api/ADempiere/data'
|
import { createEntity, updateEntity, deleteEntity, getReferencesList, rollbackEntity } from '@/api/ADempiere/data'
|
||||||
import { convertObjectToArrayPairs, convertValuesMapToObject, isEmptyValue, parseContext, showMessage } from '@/utils/ADempiere'
|
import { convertObjectToArrayPairs, isEmptyValue } from '@/utils/ADempiere/valueUtils'
|
||||||
|
import { parseContext } from '@/utils/ADempiere/contextUtils'
|
||||||
|
import { showMessage } from '@/utils/ADempiere/notification'
|
||||||
import language from '@/lang'
|
import language from '@/lang'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
@ -69,36 +71,39 @@ const windowControl = {
|
|||||||
newValues: oldAttributes
|
newValues: oldAttributes
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createNewEntity({ commit, dispatch, getters, rootGetters }, parameters) {
|
createNewEntity({ commit, dispatch, getters, rootGetters }, {
|
||||||
|
parentUuid,
|
||||||
|
containerUuid
|
||||||
|
}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// exists some call to create new record with container uuid
|
// exists some call to create new record with container uuid
|
||||||
if (getters.getInCreate(parameters.containerUuid)) {
|
if (getters.getInCreate(containerUuid)) {
|
||||||
return reject({
|
return reject({
|
||||||
error: 0,
|
error: 0,
|
||||||
message: `In this panel (${parameters.containerUuid}) is a create new record in progress`
|
message: `In this panel (${containerUuid}) is a create new record in progress`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const panel = rootGetters.getPanel(parameters.containerUuid)
|
const { tableName, fieldList } = rootGetters.getPanel(containerUuid)
|
||||||
// delete key from attributes
|
// delete key from attributes
|
||||||
const finalAttributes = rootGetters.getColumnNamesAndValues({
|
const finalAttributes = rootGetters.getColumnNamesAndValues({
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
propertyName: 'value',
|
propertyName: 'value',
|
||||||
isEvaluateValues: true,
|
isEvaluateValues: true,
|
||||||
isAddDisplayColumn: true
|
isAddDisplayColumn: true
|
||||||
})
|
})
|
||||||
|
|
||||||
commit('addInCreate', {
|
commit('addInCreate', {
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
tableName: panel.tableName,
|
tableName,
|
||||||
attributesList: finalAttributes
|
attributesList: finalAttributes
|
||||||
})
|
})
|
||||||
createEntity({
|
createEntity({
|
||||||
tableName: panel.tableName,
|
tableName,
|
||||||
attributesList: finalAttributes
|
attributesList: finalAttributes
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(createEntityResponse => {
|
||||||
var newValues = convertValuesMapToObject(response.getValuesMap())
|
const newValues = createEntityResponse.values
|
||||||
finalAttributes.forEach(element => {
|
finalAttributes.forEach(element => {
|
||||||
if (element.columnName.includes('DisplayColumn')) {
|
if (element.columnName.includes('DisplayColumn')) {
|
||||||
newValues[element.columnName] = element.value
|
newValues[element.columnName] = element.value
|
||||||
@ -112,23 +117,23 @@ const windowControl = {
|
|||||||
|
|
||||||
// update fields with new values
|
// update fields with new values
|
||||||
dispatch('notifyPanelChange', {
|
dispatch('notifyPanelChange', {
|
||||||
parentUuid: parameters.parentUuid,
|
parentUuid,
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
newValues: newValues,
|
newValues,
|
||||||
isSendToServer: false
|
isSendToServer: false
|
||||||
})
|
})
|
||||||
dispatch('addNewRow', {
|
dispatch('addNewRow', {
|
||||||
parentUuid: parameters.parentUuid,
|
parentUuid,
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
isPanelValues: true,
|
isPanelValues: true,
|
||||||
isEdit: false
|
isEdit: false
|
||||||
})
|
})
|
||||||
|
|
||||||
// set data log to undo action
|
// set data log to undo action
|
||||||
const fieldId = panel.fieldList.find(itemField => itemField.isKey)
|
const fieldId = fieldList.find(itemField => itemField.isKey)
|
||||||
dispatch('setDataLog', {
|
dispatch('setDataLog', {
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
tableName: panel.tableName,
|
tableName,
|
||||||
recordId: fieldId.value, // TODO: Verify performance with tableName_ID
|
recordId: fieldId.value, // TODO: Verify performance with tableName_ID
|
||||||
recordUuid: newValues.UUID,
|
recordUuid: newValues.UUID,
|
||||||
eventType: 'INSERT'
|
eventType: 'INSERT'
|
||||||
@ -139,16 +144,16 @@ const windowControl = {
|
|||||||
name: oldRoute.name,
|
name: oldRoute.name,
|
||||||
query: {
|
query: {
|
||||||
...oldRoute.query,
|
...oldRoute.query,
|
||||||
action: response.getUuid()
|
action: createEntityResponse.uuid
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
dispatch('tagsView/delView', oldRoute, true)
|
dispatch('tagsView/delView', oldRoute, true)
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
data: newValues,
|
data: newValues,
|
||||||
recordUuid: response.getUuid(),
|
recordUuid: createEntityResponse.uuid,
|
||||||
recordId: response.getId(),
|
recordId: createEntityResponse.id,
|
||||||
tableName: response.getTablename()
|
tableName: createEntityResponse.tableName
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@ -156,20 +161,23 @@ const windowControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn('Create Entity error: ' + error.message)
|
console.warn(`Create Entity error: ${error.message}`)
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
commit('deleteInCreate', {
|
commit('deleteInCreate', {
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
tableName: panel.tableName,
|
tableName,
|
||||||
attributesList: finalAttributes
|
attributesList: finalAttributes
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createEntityFromTable({ commit, getters, rootGetters }, parameters) {
|
createEntityFromTable({ commit, getters, rootGetters }, {
|
||||||
const { containerUuid, row } = parameters
|
parentUuid,
|
||||||
|
containerUuid,
|
||||||
|
row
|
||||||
|
}) {
|
||||||
// exists some call to create new record with container uuid
|
// exists some call to create new record with container uuid
|
||||||
if (getters.getInCreate(containerUuid)) {
|
if (getters.getInCreate(containerUuid)) {
|
||||||
return {
|
return {
|
||||||
@ -177,13 +185,13 @@ const windowControl = {
|
|||||||
message: `In this panel (${containerUuid}) is a create new record in progress.`
|
message: `In this panel (${containerUuid}) is a create new record in progress.`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const panel = rootGetters.getPanel(containerUuid)
|
const { tableName, isParentTab } = rootGetters.getPanel(containerUuid)
|
||||||
|
|
||||||
// TODO: Add support to Binary columns (BinaryData)
|
// TODO: Add support to Binary columns (BinaryData)
|
||||||
const columnsToDontSend = ['BinaryData', 'isSendServer', 'isEdit']
|
const columnsToDontSend = ['BinaryData', 'isSendServer', 'isEdit']
|
||||||
|
|
||||||
// attributes or fields
|
// attributes or fields
|
||||||
var finalAttributes = convertObjectToArrayPairs(row)
|
let finalAttributes = convertObjectToArrayPairs(row)
|
||||||
finalAttributes = finalAttributes.filter(itemAttribute => {
|
finalAttributes = finalAttributes.filter(itemAttribute => {
|
||||||
if (isEmptyValue(itemAttribute.value)) {
|
if (isEmptyValue(itemAttribute.value)) {
|
||||||
return false
|
return false
|
||||||
@ -195,56 +203,51 @@ const windowControl = {
|
|||||||
})
|
})
|
||||||
|
|
||||||
commit('addInCreate', {
|
commit('addInCreate', {
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
tableName: panel.tableName,
|
tableName,
|
||||||
attributesList: finalAttributes
|
attributesList: finalAttributes
|
||||||
})
|
})
|
||||||
return createEntity({
|
return createEntity({
|
||||||
tableName: panel.tableName,
|
tableName,
|
||||||
attributesList: finalAttributes
|
attributesList: finalAttributes
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(createEntityResponse => {
|
||||||
const newValues = convertValuesMapToObject(response.getValuesMap())
|
|
||||||
|
|
||||||
const result = {
|
|
||||||
data: newValues,
|
|
||||||
recordUuid: response.getUuid(),
|
|
||||||
recordId: response.getId(),
|
|
||||||
tableName: response.getTablename()
|
|
||||||
}
|
|
||||||
showMessage({
|
showMessage({
|
||||||
message: language.t('data.createRecordSuccessful'),
|
message: language.t('data.createRecordSuccessful'),
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
if (panel.isParentTab) {
|
if (isParentTab) {
|
||||||
// redirect to create new record
|
// redirect to create new record
|
||||||
const oldRoute = router.app._route
|
const oldRoute = router.app._route
|
||||||
router.push({
|
router.push({
|
||||||
name: oldRoute.name,
|
name: oldRoute.name,
|
||||||
query: {
|
query: {
|
||||||
...oldRoute.query,
|
...oldRoute.query,
|
||||||
action: result.recordUuid
|
action: createEntityResponse.recordUuid
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return result
|
return {
|
||||||
|
data: createEntityResponse.values,
|
||||||
|
...createEntityResponse
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
showMessage({
|
showMessage({
|
||||||
message: error.message,
|
message: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn('Create Entity Table Error ' + error.code + ': ' + error.message)
|
console.warn(`Create Entity Table Error ${error.code}: ${error.message}`)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
commit('deleteInCreate', {
|
commit('deleteInCreate', {
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
tableName: panel.tableName,
|
tableName,
|
||||||
attributesList: finalAttributes
|
attributesList: finalAttributes
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateCurrentEntity({ commit, dispatch, rootGetters }, {
|
updateCurrentEntity({ dispatch, rootGetters }, {
|
||||||
containerUuid,
|
containerUuid,
|
||||||
recordUuid = null
|
recordUuid = null
|
||||||
}) {
|
}) {
|
||||||
@ -257,7 +260,7 @@ const windowControl = {
|
|||||||
const columnsToDontSend = ['Account_Acct']
|
const columnsToDontSend = ['Account_Acct']
|
||||||
|
|
||||||
// attributes or fields
|
// attributes or fields
|
||||||
var finalAttributes = rootGetters.getColumnNamesAndValues({
|
let finalAttributes = rootGetters.getColumnNamesAndValues({
|
||||||
containerUuid: containerUuid,
|
containerUuid: containerUuid,
|
||||||
isEvaluatedChangedValue: true
|
isEvaluatedChangedValue: true
|
||||||
})
|
})
|
||||||
@ -275,29 +278,38 @@ const windowControl = {
|
|||||||
|
|
||||||
return updateEntity({
|
return updateEntity({
|
||||||
tableName: panel.tableName,
|
tableName: panel.tableName,
|
||||||
recordUuid: recordUuid,
|
recordUuid,
|
||||||
attributesList: finalAttributes
|
attributesList: finalAttributes
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(updateEntityResponse => {
|
||||||
const newValues = convertValuesMapToObject(response.getValuesMap())
|
const newValues = updateEntityResponse.values
|
||||||
const responseConvert = {
|
|
||||||
data: newValues,
|
|
||||||
id: response.getId(),
|
|
||||||
uuid: recordUuid,
|
|
||||||
tableName: panel.tableName
|
|
||||||
}
|
|
||||||
|
|
||||||
// set data log to undo action
|
// set data log to undo action
|
||||||
const fieldId = panel.fieldList.find(itemField => itemField.isKey)
|
// TODO: Verify performance with tableName_ID
|
||||||
|
let recordId = updateEntityResponse.id
|
||||||
|
if (isEmptyValue(recordId)) {
|
||||||
|
recordId = newValues[`${panel.tableName}_ID`]
|
||||||
|
}
|
||||||
|
if (isEmptyValue(recordId)) {
|
||||||
|
const fieldId = panel.fieldList.find(itemField => itemField.isKey)
|
||||||
|
recordId = fieldId.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isEmptyValue(recordUuid)) {
|
||||||
|
recordUuid = updateEntityResponse.uuid
|
||||||
|
}
|
||||||
|
if (isEmptyValue(recordUuid)) {
|
||||||
|
recordUuid = newValues.UUID
|
||||||
|
}
|
||||||
|
|
||||||
dispatch('setDataLog', {
|
dispatch('setDataLog', {
|
||||||
containerUuid: containerUuid,
|
containerUuid,
|
||||||
tableName: panel.tableName,
|
tableName: panel.tableName,
|
||||||
recordId: fieldId.value, // TODO: Verify performance with tableName_ID
|
recordId,
|
||||||
recordUuid: newValues.UUID,
|
recordUuid,
|
||||||
eventType: 'UPDATE'
|
eventType: 'UPDATE'
|
||||||
})
|
})
|
||||||
|
|
||||||
commit('setRecordDetail', responseConvert)
|
|
||||||
return newValues
|
return newValues
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@ -305,22 +317,26 @@ const windowControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn('Update Entity Error ' + error.code + ': ' + error.message)
|
console.warn(`Update Entity Error ${error.code}: ${error.message}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateCurrentEntityFromTable({ rootGetters }, parameters) {
|
updateCurrentEntityFromTable({ rootGetters }, {
|
||||||
const panel = rootGetters.getPanel(parameters.containerUuid)
|
parentUuid,
|
||||||
|
containerUuid,
|
||||||
|
row
|
||||||
|
}) {
|
||||||
|
const { tableName, fieldList } = rootGetters.getPanel(containerUuid)
|
||||||
|
|
||||||
// TODO: Add support to Binary columns (BinaryData)
|
// TODO: Add support to Binary columns (BinaryData)
|
||||||
const columnsToDontSend = ['BinaryData', 'isSendServer', 'isEdit']
|
const columnsToDontSend = ['BinaryData', 'isSendServer', 'isEdit']
|
||||||
|
|
||||||
// attributes or fields
|
// attributes or fields
|
||||||
var finalAttributes = convertObjectToArrayPairs(parameters.row)
|
let finalAttributes = convertObjectToArrayPairs(row)
|
||||||
finalAttributes = finalAttributes.filter(itemAttribute => {
|
finalAttributes = finalAttributes.filter(itemAttribute => {
|
||||||
if (columnsToDontSend.includes(itemAttribute.columnName) || itemAttribute.columnName.includes('DisplayColumn')) {
|
if (columnsToDontSend.includes(itemAttribute.columnName) || itemAttribute.columnName.includes('DisplayColumn')) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const field = panel.fieldList.find(itemField => itemField.columnName === itemAttribute.columnName)
|
const field = fieldList.find(itemField => itemField.columnName === itemAttribute.columnName)
|
||||||
if (!field || !field.isUpdateable || !field.isDisplayed) {
|
if (!field || !field.isUpdateable || !field.isDisplayed) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -328,8 +344,8 @@ const windowControl = {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return updateEntity({
|
return updateEntity({
|
||||||
tableName: panel.tableName,
|
tableName,
|
||||||
recordUuid: parameters.row.UUID,
|
recordUuid: row.UUID,
|
||||||
attributesList: finalAttributes
|
attributesList: finalAttributes
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
@ -340,39 +356,42 @@ const windowControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn('Update Entity Table Error ' + error.code + ': ' + error.message)
|
console.warn(`Update Entity Table Error ${error.code}: ${error.message}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Update record after run process associated with window
|
* Update record after run process associated with window
|
||||||
* @param {object} parameters
|
* @param {string} parentUuid
|
||||||
* @param {string} parameters.parentUuid
|
* @param {string} containerUuid
|
||||||
* @param {string} parameters.containerUuid
|
* @param {object} tab
|
||||||
* @param {object} parameters.tab
|
|
||||||
*/
|
*/
|
||||||
updateRecordAfterRunProcess({ dispatch, rootGetters }, parameters) {
|
updateRecordAfterRunProcess({ dispatch, rootGetters }, {
|
||||||
const recordUuid = rootGetters.getUuid(parameters.containerUuid)
|
parentUuid,
|
||||||
|
containerUuid,
|
||||||
|
tab
|
||||||
|
}) {
|
||||||
|
const recordUuid = rootGetters.getUuid(containerUuid)
|
||||||
// get new values
|
// get new values
|
||||||
dispatch('getEntity', {
|
dispatch('getEntity', {
|
||||||
parentUuid: parameters.parentUuid,
|
parentUuid,
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
tableName: parameters.tab.tableName,
|
tableName: tab.tableName,
|
||||||
recordUuid: recordUuid
|
recordUuid: recordUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// update panel
|
// update panel
|
||||||
if (parameters.tab.isParentTab) {
|
if (tab.isParentTab) {
|
||||||
dispatch('notifyPanelChange', {
|
dispatch('notifyPanelChange', {
|
||||||
parentUuid: parameters.parentUuid,
|
parentUuid,
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
newValues: response,
|
newValues: response,
|
||||||
isSendToServer: false
|
isSendToServer: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// update row in table
|
// update row in table
|
||||||
dispatch('notifyRowTableChange', {
|
dispatch('notifyRowTableChange', {
|
||||||
parentUuid: parameters.parentUuid,
|
parentUuid,
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid,
|
||||||
row: response,
|
row: response,
|
||||||
isEdit: false
|
isEdit: false
|
||||||
})
|
})
|
||||||
@ -386,7 +405,7 @@ const windowControl = {
|
|||||||
tableName: panel.tableName,
|
tableName: panel.tableName,
|
||||||
recordUuid: parameters.recordUuid
|
recordUuid: parameters.recordUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(responseDeleteEntity => {
|
||||||
const oldRoute = router.app._route
|
const oldRoute = router.app._route
|
||||||
|
|
||||||
// refresh record list
|
// refresh record list
|
||||||
@ -394,9 +413,9 @@ const windowControl = {
|
|||||||
parentUuid: parameters.parentUuid,
|
parentUuid: parameters.parentUuid,
|
||||||
containerUuid: parameters.containerUuid
|
containerUuid: parameters.containerUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(responseDataList => {
|
||||||
// if response is void, go to new record
|
// if response is void, go to new record
|
||||||
if (response.length <= 0) {
|
if (responseDataList.length <= 0) {
|
||||||
dispatch('resetPanelToNew', {
|
dispatch('resetPanelToNew', {
|
||||||
parentUuid: parameters.parentUuid,
|
parentUuid: parameters.parentUuid,
|
||||||
containerUuid: parameters.containerUuid,
|
containerUuid: parameters.containerUuid,
|
||||||
@ -409,7 +428,7 @@ const windowControl = {
|
|||||||
name: oldRoute.name,
|
name: oldRoute.name,
|
||||||
query: {
|
query: {
|
||||||
...oldRoute.query,
|
...oldRoute.query,
|
||||||
action: response[0].UUID
|
action: responseDataList[0].UUID
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -429,14 +448,14 @@ const windowControl = {
|
|||||||
eventType: 'DELETE'
|
eventType: 'DELETE'
|
||||||
})
|
})
|
||||||
|
|
||||||
resolve(response)
|
resolve(responseDeleteEntity)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
showMessage({
|
showMessage({
|
||||||
message: language.t('data.deleteRecordError'),
|
message: language.t('data.deleteRecordError'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn('Delete Entity - Error ', error.message, ', Code:', error.code)
|
console.warn(`Delete Entity - Error ${error.message}, Code: ${error.code}`)
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -446,11 +465,13 @@ const windowControl = {
|
|||||||
* @param {string} containerUuid
|
* @param {string} containerUuid
|
||||||
* @param {string} parentUuid
|
* @param {string} parentUuid
|
||||||
*/
|
*/
|
||||||
deleteSelectionDataList({ dispatch, rootGetters }, parameters) {
|
deleteSelectionDataList({ dispatch, rootGetters }, {
|
||||||
const { parentUuid, containerUuid } = parameters
|
parentUuid,
|
||||||
const tab = rootGetters.getTab(parentUuid, containerUuid)
|
containerUuid
|
||||||
var allData = rootGetters.getDataRecordAndSelection(containerUuid)
|
}) {
|
||||||
var selectionLength = allData.selection.length
|
const { tableName, isParentTab } = rootGetters.getTab(parentUuid, containerUuid)
|
||||||
|
const allData = rootGetters.getDataRecordAndSelection(containerUuid)
|
||||||
|
let selectionLength = allData.selection.length
|
||||||
|
|
||||||
allData.selection.forEach((record, index) => {
|
allData.selection.forEach((record, index) => {
|
||||||
// validate if the registry row has no uuid before sending to the server
|
// validate if the registry row has no uuid before sending to the server
|
||||||
@ -459,17 +480,17 @@ const windowControl = {
|
|||||||
console.warn(`This row does not contain a record with UUID`, record)
|
console.warn(`This row does not contain a record with UUID`, record)
|
||||||
// refresh record list
|
// refresh record list
|
||||||
dispatch('getDataListTab', {
|
dispatch('getDataListTab', {
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid
|
containerUuid
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
deleteEntity({
|
deleteEntity({
|
||||||
tableName: tab.tableName,
|
tableName,
|
||||||
recordUuid: record.UUID
|
recordUuid: record.UUID
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (tab.isParentTab) {
|
if (isParentTab) {
|
||||||
// redirect to create new record
|
// redirect to create new record
|
||||||
const oldRoute = router.app._route
|
const oldRoute = router.app._route
|
||||||
if (record.UUID === oldRoute.query.action) {
|
if (record.UUID === oldRoute.query.action) {
|
||||||
@ -482,8 +503,8 @@ const windowControl = {
|
|||||||
})
|
})
|
||||||
// clear fields with default values
|
// clear fields with default values
|
||||||
dispatch('resetPanelToNew', {
|
dispatch('resetPanelToNew', {
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid
|
containerUuid
|
||||||
})
|
})
|
||||||
// delete view with uuid record delete
|
// delete view with uuid record delete
|
||||||
dispatch('tagsView/delView', oldRoute, true)
|
dispatch('tagsView/delView', oldRoute, true)
|
||||||
@ -493,8 +514,8 @@ const windowControl = {
|
|||||||
if ((index + 1) >= selectionLength) {
|
if ((index + 1) >= selectionLength) {
|
||||||
// refresh record list
|
// refresh record list
|
||||||
dispatch('getDataListTab', {
|
dispatch('getDataListTab', {
|
||||||
parentUuid: parentUuid,
|
parentUuid,
|
||||||
containerUuid: containerUuid
|
containerUuid
|
||||||
})
|
})
|
||||||
showMessage({
|
showMessage({
|
||||||
message: language.t('data.deleteRecordSuccessful'),
|
message: language.t('data.deleteRecordSuccessful'),
|
||||||
@ -504,11 +525,12 @@ const windowControl = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
undoModifyData({ getters }, parameters) {
|
undoModifyData({ getters }, {
|
||||||
const { containerUuid, recordUuid } = parameters
|
containerUuid,
|
||||||
|
recordUuid
|
||||||
|
}) {
|
||||||
return rollbackEntity(getters.getDataLog(containerUuid, recordUuid))
|
return rollbackEntity(getters.getDataLog(containerUuid, recordUuid))
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log('rollback successfull', response)
|
|
||||||
return response
|
return response
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@ -516,7 +538,7 @@ const windowControl = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn('Rollback Entity error: ' + error.message)
|
console.warn(`Rollback Entity error: ${error.message}`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setDataLog({ commit }, parameters) {
|
setDataLog({ commit }, parameters) {
|
||||||
@ -674,41 +696,39 @@ const windowControl = {
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Get references asociate to record
|
* Get references asociate to record
|
||||||
* @param {string} parameters.parentUuid
|
* @param {string} parentUuid
|
||||||
* @param {string} parameters.containerUuid
|
* @param {string} containerUuid
|
||||||
* @param {string} parameters.recordUuid
|
* @param {string} recordUuid
|
||||||
*/
|
*/
|
||||||
getReferencesListFromServer({ commit, rootGetters }, parameters) {
|
getReferencesListFromServer({ commit, rootGetters }, {
|
||||||
|
parentUuid,
|
||||||
|
containerUuid,
|
||||||
|
recordUuid
|
||||||
|
}) {
|
||||||
// TODO: check if you get better performance search only the window and get the current tab
|
// TODO: check if you get better performance search only the window and get the current tab
|
||||||
const tab = rootGetters.getTab(parameters.parentUuid, parameters.containerUuid)
|
const { tableName } = rootGetters.getTab(parentUuid, containerUuid)
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getReferencesList({
|
getReferencesList({
|
||||||
windowUuid: parameters.parentUuid,
|
windowUuid: parentUuid,
|
||||||
tableName: tab.tableName,
|
tableName,
|
||||||
recordUuid: parameters.recordUuid
|
recordUuid
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(referenceResponse => {
|
||||||
const referencesList = response.getReferencesList().map(item => {
|
const referencesList = referenceResponse.referencesList.map(item => {
|
||||||
return {
|
return {
|
||||||
uuid: item.getUuid(),
|
...item,
|
||||||
windowUuid: item.getWindowuuid(),
|
recordUuid,
|
||||||
displayName: item.getDisplayname(),
|
|
||||||
tableName: item.getTablename(),
|
|
||||||
whereClause: item.getWhereclause(),
|
|
||||||
recordCount: item.getRecordcount(),
|
|
||||||
recordUuid: parameters.recordUuid,
|
|
||||||
type: 'reference'
|
type: 'reference'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const references = {
|
const references = {
|
||||||
windowUuid: parameters.parentUuid,
|
...referenceResponse,
|
||||||
recordUuid: parameters.recordUuid,
|
windowUuid: parentUuid,
|
||||||
recordCount: response.getRecordcount(),
|
recordUuid,
|
||||||
referencesList: referencesList,
|
referencesList: referencesList
|
||||||
nextPageToken: response.getNextPageToken()
|
|
||||||
}
|
}
|
||||||
commit('addReferencesList', references)
|
commit('addReferencesList', references)
|
||||||
resolve(response)
|
resolve(referenceResponse)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
placement="top"
|
placement="top"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="large"
|
size="large"
|
||||||
:color="checkStatus(activity.isError, activity.isProcessing, activity.isReport).color"
|
:color="checkStatus(activity).color"
|
||||||
>
|
>
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
@ -39,6 +39,7 @@
|
|||||||
<!-- show only when it is error -->
|
<!-- show only when it is error -->
|
||||||
<el-popover
|
<el-popover
|
||||||
v-if="activity.isError && !activity.summary && !activity.isReport"
|
v-if="activity.isError && !activity.summary && !activity.isReport"
|
||||||
|
v-key="is-error"
|
||||||
placement="right"
|
placement="right"
|
||||||
width="700"
|
width="700"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
@ -46,13 +47,14 @@
|
|||||||
<div>
|
<div>
|
||||||
{{ activity.message }}
|
{{ activity.message }}
|
||||||
</div>
|
</div>
|
||||||
<el-tag slot="reference" :type="checkStatus(activity.isError, activity.isProcessing, activity.isReport).type">
|
<el-tag slot="reference" :type="checkStatus(activity).type">
|
||||||
{{ checkStatus(activity.isError, activity.isProcessing, activity.isReport).text }}
|
{{ checkStatus(activity).text }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<!-- show only when bring logs -->
|
<!-- show only when bring logs -->
|
||||||
<el-popover
|
<el-popover
|
||||||
v-else-if="activity.logs.length > 0 || activity.summary"
|
v-else-if="activity.logs.length > 0 || activity.summary"
|
||||||
|
v-key="is-logs"
|
||||||
placement="right"
|
placement="right"
|
||||||
width="500"
|
width="500"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
@ -61,18 +63,19 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li @click="zoomIn(activity)"> {{ activity.summary }} </li>
|
<li @click="zoomIn(activity)"> {{ activity.summary }} </li>
|
||||||
<el-scrollbar wrap-class="popover-scroll">
|
<el-scrollbar wrap-class="popover-scroll">
|
||||||
<li v-for="(item, key) in activity.logs" :key="key" @click="zoomIn(activity)">
|
<li v-for="(logItem, key) in activity.logsList" :key="key" @click="zoomIn(activity)">
|
||||||
{{ item.log }}
|
{{ logItem.log }}
|
||||||
</li>
|
</li>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</ul>
|
</ul>
|
||||||
<el-tag slot="reference" :type="checkStatus(activity.isError, activity.isProcessing, activity.isReport).type">
|
<el-tag slot="reference" :type="checkStatus(activity).type">
|
||||||
{{ checkStatus(activity.isError, activity.isProcessing, activity.isReport).text }}
|
{{ checkStatus(activity).text }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<!-- show only when bring output -->
|
<!-- show only when bring output -->
|
||||||
<el-popover
|
<el-popover
|
||||||
v-else-if="activity.isReport"
|
v-else-if="activity.isReport"
|
||||||
|
v-key="is-output"
|
||||||
placement="right"
|
placement="right"
|
||||||
width="700"
|
width="700"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
@ -86,20 +89,21 @@
|
|||||||
{{ $t('components.contextMenuDownload') }} <i class="el-icon-download" />
|
{{ $t('components.contextMenuDownload') }} <i class="el-icon-download" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<el-tag slot="reference" :type="checkStatus(activity.isError, activity.isProcessing, activity.isReport).type">
|
<el-tag slot="reference" :type="checkStatus(activity).type">
|
||||||
{{ checkStatus(activity.isError, activity.isProcessing, activity.isReport).text }}
|
{{ checkStatus(activity).text }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-else
|
v-else
|
||||||
|
v-key="is-other"
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:title="$t('table.ProcessActivity.Logs')"
|
:title="$t('table.ProcessActivity.Logs')"
|
||||||
width="200"
|
width="200"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
:content="activity.summary"
|
:content="activity.summary"
|
||||||
>
|
>
|
||||||
<el-tag slot="reference" :type="checkStatus(activity.isError, activity.isProcessing, activity.isReport).type">
|
<el-tag slot="reference" :type="checkStatus(activity).type">
|
||||||
{{ checkStatus(activity.isError, activity.isProcessing, activity.isReport).text }}
|
{{ checkStatus(activity).text }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -190,10 +194,11 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (activity.parameters && activity.parameters.length) {
|
if (!this.isEmptyValue(activity.parametersList)) {
|
||||||
activity.parameters.forEach(param => {
|
this.$route.query = {
|
||||||
this.$route.query[param.columnName] = param.value
|
...this.$route.query,
|
||||||
})
|
...activity.parametersList
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: activity.processIdPath,
|
path: activity.processIdPath,
|
||||||
@ -203,8 +208,8 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkStatus(isError, isProcessing, isReport) {
|
checkStatus({ isError, isProcessing, isReport }) {
|
||||||
var status = {
|
const status = {
|
||||||
text: this.$t('notifications.completed'),
|
text: this.$t('notifications.completed'),
|
||||||
type: 'success',
|
type: 'success',
|
||||||
color: '#67C23A'
|
color: '#67C23A'
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dashboard-editor-container">
|
<div class="dashboard-editor-container">
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<template v-for="(dashboard, index) in dashboardList">
|
<template v-for="(dashboardAttributes, index) in dashboardList">
|
||||||
<el-col :key="index" :xs="{span: 24}" :sm="{span: 24}" :md="{span: 24}" :lg="{span: 12}" :xl="{span: 12}" style="padding-right:8px;margin-bottom:30px;">
|
<el-col :key="index" :xs="{ span: 24 }" :sm="{ span: 24 }" :md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 12 }" style="padding-right:8px;margin-bottom:30px;">
|
||||||
<dashboard :metadata="dashboard" />
|
<dashboard :metadata="dashboardAttributes" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -36,11 +36,11 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getDashboardListFromServer() {
|
getDashboardListFromServer() {
|
||||||
if (this.getterDashboard) {
|
if (this.getterDashboard) {
|
||||||
this.dashboardList = this.getterDashboard
|
this.dashboardList = this.getterDashboard.dashboardList
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('listDashboard', this.roleUuid)
|
this.$store.dispatch('listDashboard', this.roleUuid)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.dashboardList = response.dashboardList
|
this.dashboardList = response.dashboardsList
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,8 +58,6 @@ export default {
|
|||||||
this.$store.dispatch('getRecentItemsFromServer')
|
this.$store.dispatch('getRecentItemsFromServer')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.recentItems = response
|
this.recentItems = response
|
||||||
}).catch(error => {
|
|
||||||
console.log(error)
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.recentItems = items
|
this.recentItems = items
|
||||||
|
Loading…
x
Reference in New Issue
Block a user