1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 07:04:21 +08:00
Edwin Betancourt 0800511177
feat: Remove context (#508)
* Change definition for v-model of fields using reactive store

* change custom validateValue to custom and overwrite parsedValue.

* Delete unused parameters.

* Add queue for persistence

* fix: Create entity.

* Add return value as array for persistence

* Add multiple commit for panel

* remove commnets

* Change context session to preference.

* fix: Load window.

* Add support to seekrecord for panel

* Set default value to isActive columnName.

* set default values.

* Separate template mobile and panel desktop with mixin.

* set values into panel with first load of records.

* fix lookups value and display value.

* change `DisplayColumn_${columnName}` to `displayColumnName` property.

* fix create entity with default values.

* Set default values and fix browser search.

* fix context values from SmartBrowser.

* fix: Associated process.

* set context values to process associated.

* fix set values.

* fix style field components.

* fix send values to server.

Co-authored-by: Yamel Senih <ysenih@erpya.com>
2020-06-12 12:07:24 -04:00

119 lines
2.4 KiB
JavaScript

// Get Instance for connection
import { BusinessDataInstance as Instance } from '@/api/ADempiere/instances.js'
/**
* Create entity
* @param {string} tableName
* @param {array} attributesList
*/
export function createEntity({ tableName, attributes }) {
return Instance.call(this).requestCreateEntity({
tableName,
attributesList: attributes
})
}
/**
* Update entity
* @param {string} tableName
* @param {number} recordId
* @param {string} recordUuid
* @param {array} attributesList
*/
export function updateEntity({ tableName, recordId, recordUuid, attributes }) {
return Instance.call(this).requestUpdateEntity({
tableName,
recordId,
recordUuid,
attributesList: attributes
})
}
/**
* Delete entity
* @param {string} tableName
* @param {number} recordId
* @param {string} recordUuid
*/
export function deleteEntity({ tableName, recordId, recordUuid }) {
return Instance.call(this).requestDeleteEntity({
tableName,
recordId,
recordUuid
})
}
/**
* Rollback entity (Create, Update, Delete)
* @param {string} tableName
* @param {number} recordId
* @param {string} eventType
*/
export function rollbackEntity({
tableName,
recordId,
eventType
}) {
return Instance.call(this).requestRollbackEntity({
tableName,
recordId,
eventTypeExecuted: eventType
})
}
// Get entity from table name and record id or record uuid
export function getEntity({ tableName, recordId, recordUuid }) {
return Instance.call(this).requestGetEntity({
tableName,
recordId,
recordUuid
})
}
/**
* Object List from window
* @param {string} tableName
* @param {string} query
* @param {string} whereClause
* @param {array} conditionsList
* @param {string} orderByClause
* @param {string} pageToken
*/
export function getEntitiesList({
tableName,
query,
whereClause,
conditionsList = [],
orderByClause,
pageToken,
pageSize
}) {
return Instance.call(this).requestListEntities({
tableName,
query,
whereClause,
conditionsList,
orderByClause,
pageToken,
pageSize
})
}
/**
* Request translations
* @param {string} tableName
* @param {string} language
* @param {string} recordUuid
* @param {integer} recordId
*/
export function requestTranslations({ tableName, language, recordUuid, recordId, pageToken, pageSize }) {
return Instance.call(this).requestListTranslations({
tableName,
recordUuid,
recordId,
language,
pageToken,
pageSize
})
}