Skip to content

Commit

Permalink
Fix: Field Zoom on Windows, Process and Browser (PanJiaChen#2347)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsiosanchez authored Jun 13, 2024
1 parent 32d8745 commit 9dc81e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
21 changes: 18 additions & 3 deletions src/components/ADempiere/FieldDefinition/FieldOptions/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,22 @@ export default defineComponent({
}
})

const { parentUuid, containerUuid, columnName } = props.metadata
const zoomField = computed({
get() {
return store.getters.getZoomField({
containerUuid: containerUuid + '_' + columnName
})
},
set(zoom) {
store.commit('setZoomField', {
containerUuid: containerUuid + '_' + columnName,
zoom
})
}
})

const valueField = computed(() => {
const { parentUuid, containerUuid, columnName } = props.metadata
return store.getters.getValueOfFieldOnContainer({
parentUuid,
containerUuid,
Expand Down Expand Up @@ -316,7 +330,7 @@ export default defineComponent({
tabTableName: field.tabTableName,
valueField: valueField.value
}).then(response => {
zoom.value = response
zoomField.value = response
}).finally(() => {
return false
})
Expand Down Expand Up @@ -428,7 +442,7 @@ export default defineComponent({
containerManager: props.containerManager,
fieldAttributes: props.metadata,
value: valueField.value,
zoom: zoom.value
zoom: zoomField.value
})

if (isMobile.value) {
Expand Down Expand Up @@ -480,6 +494,7 @@ export default defineComponent({
valueField,
triggerMenu,
shortsKey,
zoomField,
showPanelFieldOption,
// methods
closePopover,
Expand Down
12 changes: 11 additions & 1 deletion src/store/modules/ADempiere/fieldDefinition.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const initStateLookup = {
fieldsList: [],
validationRuleList: [],
defaultSizeField: {},
isShowNewSequence: false
isShowNewSequence: false,
zoomAttributes: {}
}

const field = {
Expand Down Expand Up @@ -72,6 +73,12 @@ const field = {
},
setShowNewSequence(state, isShowed = false) {
state.isShowNewSequence = isShowed
},
setZoomField(state, {
containerUuid,
zoom
}) {
Vue.set(state.zoomAttributes, containerUuid, zoom)
}
},

Expand Down Expand Up @@ -245,6 +252,9 @@ const field = {
},
getShowNewSequence(state) {
return state.isShowNewSequence
},
getZoomField: (state) => ({ containerUuid }) => {
return state.zoomAttributes[containerUuid]
}
}
}
Expand Down

0 comments on commit 9dc81e4

Please sign in to comment.