diff --git a/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue b/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue index dfc655cc..5a985461 100644 --- a/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue +++ b/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue @@ -1,131 +1,125 @@ @@ -133,9 +127,181 @@ import contextMixin from './contextMenuMixin.js' export default { - name: 'ContextMenuDesktop', + name: 'ContextMenuMobile', mixins: [ contextMixin - ] + ], + data() { + return { + openedsMenu: [ + 'actions' + ] + } + }, + computed: { + isPanelTypeMobile() { + if (['process', 'report'].includes(this.$route.meta.type)) { + return true + } + return false + }, + isUndoAction() { + if (this.isWindow) { + if (!this.isWithRecord) { + return true + } + } + return false + }, + typeOfAction() { + if (this.isUndoAction) { + return 'warning' + } + return 'default' + }, + isPlain() { + if (this.isUndoAction) { + return true + } + return false + }, + defaultActionToRun() { + if (this.isUndoAction) { + return this.actions[2] + } + return this.actions[0] + }, + defaultActionName() { + if (this.isWindow) { + if (this.isWithRecord) { + return this.$t('window.newRecord') + } + return this.$t('data.undo') + } + return this.$t('components.RunProcess') + }, + iconDefault() { + if (this.isPanelTypeMobile) { + return 'component' + } + return 'skill' + } + }, + methods: { + clickRelation(item) { + this.$router.push({ + name: item.name, + query: { + tabParent: 0 + } + }, () => {}) + }, + clickRunAction(action) { + if (action === 'refreshData') { + this.refreshData() + } else { + this.runAction(action) + } + }, + clickReferences(reference) { + this.openReference(reference) + }, + iconAction(action) { + let icon + if (action.type === 'dataAction') { + switch (action.action) { + case 'setDefaultValues': + icon = 'el-icon-news' + break + case 'deleteEntity': + icon = 'el-icon-delete' + break + case 'undoModifyData': + icon = 'el-icon-refresh-left' + break + case 'lockRecord': + icon = 'el-icon-lock' + break + case 'unlockRecord': + icon = 'el-icon-unlock' + break + case 'recordAccess': + icon = 'el-icon-c-scale-to-original' + break + } + } else if (action.type === 'process') { + icon = 'el-icon-setting' + } else { + icon = 'el-icon-setting' + } + return icon + }, + styleLabelAction(value) { + if (value) { + return 'font-size: 14px;margin-top: 0% !important;margin-left: 0px;margin-bottom: 10%;display: contents;' + } else { + return 'font-size: 14px;margin-top: 1.5% !important;margin-left: 2%;margin-bottom: 5%;display: contents;' + } + } + } } + + diff --git a/src/components/ADempiere/ContextMenu/index.vue b/src/components/ADempiere/ContextMenu/index.vue index d6de5b1e..1bb1416c 100644 --- a/src/components/ADempiere/ContextMenu/index.vue +++ b/src/components/ADempiere/ContextMenu/index.vue @@ -77,6 +77,16 @@ export default { diff --git a/src/components/RightPanel/index.vue b/src/components/RightPanel/index.vue index 8def6d47..9367a549 100644 --- a/src/components/RightPanel/index.vue +++ b/src/components/RightPanel/index.vue @@ -1,5 +1,5 @@