diff --git a/package.json b/package.json index 1386cdda..050b0c75 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "@adempiere/grpc-access-client": "^1.1.8", - "@adempiere/grpc-data-client": "^2.1.0", + "@adempiere/grpc-data-client": "^2.1.1", "@adempiere/grpc-dictionary-client": "^1.3.5", "@adempiere/grpc-enrollment-client": "^1.0.7", "autoprefixer": "^9.5.1", @@ -75,6 +75,7 @@ "vue-count-to": "1.0.13", "vue-i18n": "7.3.2", "vue-multipane": "^0.9.5", + "vue-resize": "^0.4.5", "vue-router": "3.0.4", "vue-shortkey": "^3.1.7", "vue-split-panel": "^1.0.4", diff --git a/src/api/ADempiere/data.js b/src/api/ADempiere/data.js index 25ba5a56..3f649656 100644 --- a/src/api/ADempiere/data.js +++ b/src/api/ADempiere/data.js @@ -520,3 +520,24 @@ export function requestListDocumentActions({ tableName, recordId, recordUuid, do pageToken }) } +/** + * Request Document Status List + * @param {string} tableName + * @param {number} recordId + * @param {string} recordUuid + * @param {string} documentStatus + * @param {string} documentAction + * @param {number} pageSize + * @param {string} pageToken + */ +export function requestListDocumentStatuses({ tableName, recordId, recordUuid, documentStatus, documentAction, pageSize, pageToken }) { + return Instance.call(this).requestListDocumentStatuses({ + tableName, + recordId, + recordUuid, + documentStatus, + documentAction, + pageSize, + pageToken + }) +} diff --git a/src/components/ADempiere/Field/FieldText.vue b/src/components/ADempiere/Field/FieldText.vue index a2a3d974..1cedb78f 100644 --- a/src/components/ADempiere/Field/FieldText.vue +++ b/src/components/ADempiere/Field/FieldText.vue @@ -22,6 +22,10 @@ export default { name: 'FieldText', mixins: [fieldMixin], props: { + inTable: { + type: Boolean, + default: false + }, pattern: { type: String, default: undefined diff --git a/src/components/ADempiere/Field/index.vue b/src/components/ADempiere/Field/index.vue index 519fa070..fa0118ed 100644 --- a/src/components/ADempiere/Field/index.vue +++ b/src/components/ADempiere/Field/index.vue @@ -60,6 +60,7 @@ :class="classField" :metadata="fieldAttributes" :value-model="recordDataFields" + :in-table="true" /> diff --git a/src/components/ADempiere/Panel/index.vue b/src/components/ADempiere/Panel/index.vue index 6ee6b074..00e13358 100644 --- a/src/components/ADempiere/Panel/index.vue +++ b/src/components/ADempiere/Panel/index.vue @@ -315,6 +315,7 @@ export default { }, created() { // get fields with uuid + this.$store.dispatch('listWorkflows', this.metadata.tableName) this.getPanel() }, methods: { @@ -614,6 +615,10 @@ export default { return groupsList }, setTagsViewTitle(actionValue) { + this.$store.dispatch('listDocumentStatus', { + recordUuid: this.$route.query.action, + recordId: this.$route.params.recordId + }) if (actionValue === 'create-new' || this.isEmptyValue(actionValue)) { this.tagTitle.action = this.$t('tagsView.newRecord') } else if (actionValue === 'advancedQuery') { diff --git a/src/components/ADempiere/WorkflowStatusBar/index.vue b/src/components/ADempiere/WorkflowStatusBar/index.vue new file mode 100644 index 00000000..d038c022 --- /dev/null +++ b/src/components/ADempiere/WorkflowStatusBar/index.vue @@ -0,0 +1,249 @@ + + + + + + + + + + {{ getValue.displayColumn }} + + + {{ labelDocumentActions }} + + {{ getValue.description }} + {{ descriptionDocumentActions }} + {{ node.name }} + + {{ node.name }} + + + + + + + + + diff --git a/src/main.js b/src/main.js index 1b0311ae..71a97707 100644 --- a/src/main.js +++ b/src/main.js @@ -7,6 +7,8 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets import Element from 'element-ui' import './styles/element-variables.scss' import VueSplit from 'vue-split-panel' +import 'vue-resize/dist/vue-resize.css' +import VueResize from 'vue-resize' /** * TODO: Waiting for PR to: * https://github.com/vue-extend/v-markdown/pull/4 @@ -43,6 +45,7 @@ if (process.env.NODE_ENV === 'production') { } Vue.use(VMarkdown) Vue.use(VueSplit) +Vue.use(VueResize) Vue.use(Element, { size: Cookies.get('size') || 'medium', // set element-ui default size i18n: (key, value) => i18n.t(key, value) diff --git a/src/store/modules/ADempiere/containerInfo.js b/src/store/modules/ADempiere/containerInfo.js index 146a3c05..a312e53e 100644 --- a/src/store/modules/ADempiere/containerInfo.js +++ b/src/store/modules/ADempiere/containerInfo.js @@ -17,7 +17,7 @@ const containerInfo = { state.listworkflowLog = payload }, addListWorkflows(state, payload) { - state.listworkflows = payload + state.listWorkflows = payload }, addListRecordLogs(state, payload) { state.listRecordLogs = payload @@ -124,9 +124,7 @@ const containerInfo = { const recordId = params.recordId const pageSize = 0 const pageToken = 0 - dispatch('listWorkflows', { - tableName: tableName - }) + dispatch('listWorkflows', tableName) return requestListWorkflowsLogs({ tableName, recordId, pageSize, pageToken }) .then(response => { var workflowLog = { @@ -140,13 +138,17 @@ const containerInfo = { console.warn(`Error getting List workflow: ${error.message}. Code: ${error.code}.`) }) }, - listWorkflows({ commit, state }, params) { - const tableName = params.tableName + listWorkflows({ commit, state }, tableName) { const pageSize = 0 const pageToken = 0 return requestListWorkflows({ tableName, pageSize, pageToken }) .then(response => { - commit('addListWorkflows', response) + var nodeWorflow = { + nextPageToken: response.nextPageToken, + recordCount: response.recordCount, + workflowsList: response.workflowsList + } + commit('addListWorkflows', nodeWorflow) }) .catch(error => { console.warn(`Error getting List workflow: ${error.message}. Code: ${error.code}.`) @@ -157,6 +159,9 @@ const containerInfo = { getWorkflow: (state) => { return state.listworkflowLog.workflowLogsList }, + getNodeWorkflow: (state) => { + return state.listWorkflows + }, getRecordLogs: (state) => { return state.listRecordLogs }, diff --git a/src/store/modules/ADempiere/contextMenu.js b/src/store/modules/ADempiere/contextMenu.js index 6c535b33..62aae0b6 100644 --- a/src/store/modules/ADempiere/contextMenu.js +++ b/src/store/modules/ADempiere/contextMenu.js @@ -1,5 +1,5 @@ import { recursiveTreeSearch } from '@/utils/ADempiere/valueUtils.js' -import { requestListDocumentActions } from '@/api/ADempiere/data' +import { requestListDocumentActions, requestListDocumentStatuses } from '@/api/ADempiere/data' // Store used for set all related to context menu // for Window, Process, Smart Browser andother customized component @@ -17,6 +17,12 @@ import { requestListDocumentActions } from '@/api/ADempiere/data' const contextMenu = { state: { contextMenu: [], + listDocumentStatus: { + defaultDocumentAction: undefined, + documentActionsList: [], + recordId: undefined, + recordUuid: undefined + }, listDocumentAction: { defaultDocumentAction: undefined, documentActionsList: [], @@ -33,6 +39,9 @@ const contextMenu = { }, listDocumentAction(state, payload) { state.listDocumentAction = payload + }, + addlistDocumentStatus(state, payload) { + state.listDocumentStatus = payload } }, actions: { @@ -74,6 +83,35 @@ const contextMenu = { .catch(error => { console.warn(error) }) + }, + listDocumentStatus({ commit }, { + tableName = 'C_Order', + recordId, + recordUuid, + documentAction, + documentStatus + }) { + requestListDocumentStatuses({ + tableName, + recordId, + recordUuid, + documentAction, + documentStatus, + pageSize: 0, + pageToken: '' + }) + .then(responseDocumentStatus => { + const documentStatus = { + documentActionsList: responseDocumentStatus.documentStatusesList, + recordId, + recordUuid + } + commit('addlistDocumentStatus', documentStatus) + return documentStatus + }) + .catch(error => { + console.warn(error) + }) } }, getters: { @@ -101,6 +139,9 @@ const contextMenu = { getListDocumentActions: (state) => { return state.listDocumentAction }, + getListDocumentStatus: (state) => { + return state.listDocumentStatus + }, getListDocumentActionByUuid: (state) => (recordUuid) => { return state.listDocumentAction.find(itemDocumentAction => itemDocumentAction.recordUuid === recordUuid) } diff --git a/src/store/modules/ADempiere/utils.js b/src/store/modules/ADempiere/utils.js index 61455325..21a39c00 100644 --- a/src/store/modules/ADempiere/utils.js +++ b/src/store/modules/ADempiere/utils.js @@ -28,7 +28,8 @@ const utils = { query: {}, isReaded: false, isLoaded: false - } + }, + panelRight: '' }, mutations: { setWidth(state, width) { @@ -88,6 +89,9 @@ const utils = { setReadRoute(state, payload) { Vue.set(state.openRoute, 'definedParameters', payload.parameters) Vue.set(state.openRoute, 'isLoaded', true) + }, + setPanelRight(state, payload) { + state.panelRight = payload } }, actions: { @@ -148,6 +152,9 @@ const utils = { }, setOrder({ commit }, params) { commit('setOrder', params) + }, + setPanelRight({ commit }, panelRight) { + commit('setPanelRight', panelRight) } }, getters: { @@ -217,6 +224,9 @@ const utils = { }, getMarkDown: (state) => { return state.markDown + }, + getPanelRight: (state) => { + return state.panelRight } } } diff --git a/src/views/ADempiere/Window/index.vue b/src/views/ADempiere/Window/index.vue index 7ac8c7c3..51630d03 100644 --- a/src/views/ADempiere/Window/index.vue +++ b/src/views/ADempiere/Window/index.vue @@ -54,18 +54,31 @@ - + + - - + + + + + + + + + {} + } }, data() { return { @@ -393,13 +416,40 @@ export default { splitAreaStyle() { if (this.isShowedTabsChildren || this.isMobile) { return { - overflow: 'auto' + overflowX: 'hidden', + overflowY: 'auto' } } return { overflow: 'hidden' } }, + styleStepsSimple() { + if (this.isShowedRecordNavigation) { + return { + paddingTop: '0px', + paddingBottom: '0px', + paddingLeft: '0px', + paddingRight: '0px', + borderRadius: '4px', + background: '#F5F7FA', + overflowX: 'auto', + overflowY: 'hidden', + width: this.$store.getters.getPanelRight + 'px' + } + } + return { + paddingTop: '0px', + paddingBottom: '0px', + paddingLeft: '0px', + paddingRight: '0px', + borderRadius: '4px', + background: '#F5F7FA', + overflowX: 'auto', + overflowY: 'hidden', + width: 'auto' + } + }, sizeAreaStyle() { if (this.isShowedTabsChildren) { return 50 @@ -494,13 +544,25 @@ export default { }, created() { this.getWindow() + if (this.isShowedRecordNavigation) { + this.handleResize() + } }, methods: { + handleResize() { + var PanelRight = document.getElementById('PanelRight') + var resizeWidth = PanelRight + if (!this.isEmptyValue(resizeWidth)) { + var widthPanel = PanelRight.clientWidth - 350 + this.$store.dispatch('setPanelRight', widthPanel) + } + }, conteInfo() { this.showContainerInfo = !this.showContainerInfo if (this.showContainerInfo) { this.$store.dispatch('listWorkflowLogs', { tableName: this.getTableName, + recordUuid: this.$route.query.action, recordId: this.getRecord[this.getTableName + '_ID'] }) this.$store.dispatch(this.activeInfo, { @@ -762,6 +824,22 @@ export default { }
{{ getValue.description }}
{{ descriptionDocumentActions }}