Skip to content

Commit cbdaa47

Browse files
elsiosanchezelsiosanchez
andauthored
Close popover of field options (#847)
* fix close popover the field * delete route Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
1 parent e433b98 commit cbdaa47

File tree

7 files changed

+34
-12
lines changed

7 files changed

+34
-12
lines changed

src/components/ADempiere/Field/contextMenuField/calculator/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
along with this program. If not, see <https:www.gnu.org/licenses/>.
1717
-->
1818
<template>
19-
<el-card class="box-card">
19+
<el-card class="box-card" style="padding: 1%;">
2020
<div slot="header" class="clearfix">
2121
<span>
2222
{{ $t('field.field') }}
@@ -217,6 +217,7 @@ export default {
217217
this.clearVariables()
218218
this.$children[0].visible = false
219219
this.$store.commit('changeShowRigthPanel', false)
220+
this.$store.commit('changeShowOptionField', false)
220221
if (!this.isEmptyValue(this.$route.query.fieldColumnName)) {
221222
this.$router.push({
222223
name: this.$route.name,

src/components/ADempiere/Field/contextMenuField/contextInfo/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
-->
1818
<template>
1919
<div>
20-
<el-card class="box-card">
20+
<el-card class="box-card" style="padding: 1%;">
2121
<div slot="header" class="clearfix">
2222
<span>
2323
{{ $t('field.field') }}
@@ -93,7 +93,7 @@ export default {
9393
}
9494
},
9595
created() {
96-
if (this.isEmptyValue(this.messageText)) {
96+
if (!this.isEmptyValue(this.fieldAttributes.contextInfo.sqlStatement)) {
9797
const sqlParse = parseContext({
9898
parentUuid: this.fieldAttributes.parentUuid,
9999
containerUuid: this.fieldAttributes.containerUuid,

src/components/ADempiere/Field/contextMenuField/preference/index.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<el-card
2020
v-if="!isEmptyValue(metadataList)"
2121
class="box-card"
22+
style="padding: 1%;"
2223
>
2324
<div slot="header" class="clearfix">
2425
<span>
@@ -209,8 +210,6 @@ export default {
209210
methods: {
210211
createFieldFromDictionary,
211212
close() {
212-
this.$children[0].visible = false
213-
this.$store.commit('changeShowRigthPanel', false)
214213
if (!this.isEmptyValue(this.$route.query.fieldColumnName)) {
215214
this.$router.push({
216215
name: this.$route.name,
@@ -220,6 +219,9 @@ export default {
220219
fieldColumnName: ''
221220
}
222221
}, () => {})
222+
this.$children[0].visible = false
223+
this.$store.commit('changeShowRigthPanel', false)
224+
this.$store.commit('changeShowOptionField', false)
223225
}
224226
},
225227
remove() {

src/components/ADempiere/Field/contextMenuField/translated/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
along with this program. If not, see <https:www.gnu.org/licenses/>.
1717
-->
1818
<template>
19-
<el-card class="box-card">
19+
<el-card class="box-card" style="padding: 1%;">
2020
<div slot="header" class="clearfix">
2121
<span>
2222
{{ $t('field.field') }}
@@ -190,6 +190,7 @@ export default {
190190
close() {
191191
this.$children[0].visible = false
192192
this.$store.commit('changeShowRigthPanel', false)
193+
this.$store.commit('changeShowOptionField', false)
193194
}
194195
}
195196
}

src/components/ADempiere/Field/index.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@
131131
width="400"
132132
trigger="click"
133133
style="padding: 0px;"
134-
:hide="visibleForDesktop"
134+
@hide="closePopover"
135135
>
136136
<component
137137
:is="optionFieldFComponentRender"
138-
v-if="visibleForDesktop"
138+
v-if="visibleForDesktop && showPanelFieldOption"
139139
:field-attributes="contextMenuField.fieldAttributes"
140140
:source-field="contextMenuField.fieldAttributes"
141141
:field-value="contextMenuField.valueField"
@@ -266,6 +266,9 @@ export default {
266266
},
267267
computed: {
268268
// load the component that is indicated in the attributes of received property
269+
showPanelFieldOption() {
270+
return this.$store.state.contextMenu.isShowOptionField
271+
},
269272
labelStyle() {
270273
if (this.field.name.length >= 25) {
271274
return '35'
@@ -688,6 +691,16 @@ export default {
688691
},
689692
methods: {
690693
recursiveTreeSearch,
694+
closePopover() {
695+
this.$router.push({
696+
name: this.$route.name,
697+
query: {
698+
...this.$route.query,
699+
typeAction: '',
700+
fieldColumnName: ''
701+
}
702+
}, () => {})
703+
},
691704
handleOpen(key, keyPath) {
692705
this.triggerMenu = 'hover'
693706
},
@@ -703,6 +716,7 @@ export default {
703716
if (this.isMobile) {
704717
this.$store.commit('changeShowRigthPanel', true)
705718
} else {
719+
this.$store.commit('changeShowOptionField', true)
706720
this.visibleForDesktop = true
707721
this.$router.push({
708722
name: this.$route.name,

src/store/modules/ADempiere/contextMenu.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { requestListDocumentActions, requestListDocumentStatuses } from '@/api/A
1414
// ]
1515
const initStateContextMenu = {
1616
isShowRightPanel: false,
17+
isShowOptionField: true,
1718
isShowPopoverField: false,
1819
optionField: {},
1920
contextMenu: [],
@@ -56,6 +57,9 @@ const contextMenu = {
5657
}
5758
state.isShowRightPanel = params
5859
},
60+
changeShowOptionField(state, params) {
61+
state.isShowOptionField = params
62+
},
5963
changeShowPopoverField(state) {
6064
state.isShowPopoverField = !state.isShowPopoverField
6165
},

src/views/ADempiere/Window/windowLogicComponent.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ export default {
252252
return this.$store.getters.getWindow(this.windowUuid)
253253
},
254254
isShowedTabsChildren() {
255-
if (this.windowMetadata && this.windowMetadata.isShowedTabsChildren && this.isEmptyValue(this.$route.query.typeAction)) {
256-
return this.windowMetadata.isShowedTabsChildren
257-
}
258-
return false
255+
// if (this.windowMetadata && this.windowMetadata.isShowedTabsChildren && this.isEmptyValue(this.$route.query.typeAction)) {
256+
// return this.windowMetadata.isShowedTabsChildren
257+
// }
258+
return this.windowMetadata.isShowedTabsChildren
259259
},
260260
isShowedRecordNavigation() {
261261
if (this.windowMetadata && this.windowMetadata.isShowedRecordNavigation) {

0 commit comments

Comments
 (0)