Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
fix: Smart Browse table records. (#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Mar 8, 2024
1 parent c01a08b commit 62463ce
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 47 deletions.
4 changes: 2 additions & 2 deletions src/components/ADempiere/DataTable/Browser/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default defineComponent({
* custom method to handle change page
*/
function handleChangePage(pageNumber) {
props.containerManager.setPage({
props.containerManager.setPageNumber({
parentUuid: props.parentUuid,
containerUuid: props.containerUuid,
pageNumber,
Expand All @@ -354,7 +354,7 @@ export default defineComponent({
}

function handleChangeSizePage(pageSize) {
props.containerManager.setSizePage({
props.containerManager.setPageSize({
parentUuid: props.parentUuid,
containerUuid: props.containerUuid,
pageSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
:selection="selection"
:page-number="pageNumber"
:page-size="recordsList.length"
:handle-change-page-number="setPage"
:handle-change-page-number="setPageNumber"
/>
</el-col>

Expand Down Expand Up @@ -257,7 +257,7 @@ export default {
return {
...this.containerManager,
...containerManagerForm,
setPage: this.setPage
setPageNumber: this.setPageNumber
}
},
labelTable() {
Expand Down Expand Up @@ -463,7 +463,7 @@ export default {
show: false
})
},
setPage(pageNumber) {
setPageNumber(pageNumber) {
this.searchRecordsList(pageNumber)
},
subscribeChanges() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
:total="recordData.recordCount"
:current-page="pageNumber"
:container-manager="containerManagerSearchList"
:handle-change-page="setPage"
:handle-change-page="setPageNumber"
:records-page="recordsList.length"
:selection="selection"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
:selection="selection"
:page-number="pageNumber"
:page-size="recordsList.length"
:handle-change-page-number="setPage"
:handle-change-page-number="setPageNumber"
:handle-change-page-size="handleChangeSizePage"
/>
</el-col>
Expand Down Expand Up @@ -250,7 +250,7 @@ export default {
return {
...this.containerManager,
...containerManagerForm,
setPage: this.setPage
setPageNumber: this.setPageNumber
}
},
labelTable() {
Expand Down Expand Up @@ -380,7 +380,7 @@ export default {
show: false
})
},
setPage(pageNumber) {
setPageNumber(pageNumber) {
this.searchBPartnerList(pageNumber, this.pageSize)
},
subscribeChanges() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
:selection="selection"
:page-number="pageNumber"
:page-size="recordsList.length"
:handle-change-page-number="setPage"
:handle-change-page-number="setPageNumber"
:handle-change-page-size="handleChangeSizePage"
/>
</el-col>
Expand Down Expand Up @@ -255,7 +255,7 @@ export default {
isDisplayedDefault: () => { return true },
isReadOnlyColumn: ({ field, row }) => { return true },
setDefaultValues: () => {},
setPage: this.setPage
setPageNumber: this.setPageNumber
}
},
storedFieldsListQuery() {
Expand Down Expand Up @@ -371,7 +371,7 @@ export default {
show: false
})
},
setPage(pageNumber) {
setPageNumber(pageNumber) {
this.getListSearchRecords(pageNumber, this.pageSize)
},
subscribeChanges() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ADempiere/Form/TaskManager/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
@click="getListJobs"
/>
</div>
<el-card class="box-card" style="margin: 0px 10px;padding: : 0px 10px;">
<el-card class="box-card" style="margin: 0px 10px;padding: 0px 10px;">
<el-table
v-if="isEmptyValue(currentJob)"
:data="list"
Expand Down
6 changes: 3 additions & 3 deletions src/components/ADempiere/Form/TimeControl/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
:total-records="recordCount"
:page-size="tableData.length"
:selection="selection"
:handle-change-page-number="setPage"
:handle-change-page-number="setPageNumber"
/>
</el-col>
</el-row>
Expand Down Expand Up @@ -645,7 +645,7 @@ export default defineComponent({
}

// Get Record Control Table
function setPage(pageNumber) {
function setPageNumber(pageNumber) {
listResource(pageNumber)
}

Expand Down Expand Up @@ -700,7 +700,7 @@ export default defineComponent({
editChild,
listResource,
confirmResiurce,
setPage,
setPageNumber,
handleRowClick,
closeList
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ADempiere/Form/TimeControl/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
:total-records="totalRecords"
:selection="selection"
:page-size="tableData.length"
:handle-change-page-number="setPage"
:handle-change-page-number="setPageNumber"
/>
</el-col>

Expand Down Expand Up @@ -614,7 +614,7 @@ export default defineComponent({
})
}

function setPage(pageName) {
function setPageNumber(pageName) {
listResourcesAssignment(pageName)
}

Expand Down Expand Up @@ -671,7 +671,7 @@ export default defineComponent({
createOrder,
listResourcesAssignment,
setFieldsList,
setPage
setPageNumber
}
}
})
Expand Down
6 changes: 3 additions & 3 deletions src/components/ADempiere/Form/TimeRecord/tableData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<custom-pagination
:total-records="recordCount"
:page-size="tableData.length"
:handle-change-page-size="setPage"
:handle-change-page-size="setPageNumber"
/>
</el-col>

Expand Down Expand Up @@ -172,7 +172,7 @@ export default defineComponent({
}

// Get Record Control Table
function setPage(pageNumber) {
function setPageNumber(pageNumber) {
listResource(pageNumber)
}

Expand All @@ -192,7 +192,7 @@ export default defineComponent({
heardList,
// Methods
listResource,
setPage,
setPageNumber,
handleRowClick
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/ADempiere/Form/WorkflowActivity/index2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
:total-records="recordCount"
:page-number="currentPagePagination"
:page-size="activityList.length"
:handle-change-page-number="setPage"
:handle-change-page-number="setPageNumber"
:handle-change-page-size="handleChangeSizePage"
/>
</el-card>
Expand Down Expand Up @@ -227,7 +227,7 @@
:total-records="recordCount"
:page-number="currentPagePagination"
:page-size="activityList.length"
:handle-change-page-number="setPage"
:handle-change-page-number="setPageNumber"
:handle-change-page-size="handleChangeSizePage"
/>
</el-card>
Expand Down Expand Up @@ -509,7 +509,7 @@ export default {
getFieldsLit: () => {},
isReadOnlyColumn: ({ field, row }) => { return true },
setDefaultValues: () => {},
setPage: this.setPage
setPageNumber: this.setPageNumber
}
},
currentPagePagination() {
Expand Down Expand Up @@ -548,7 +548,7 @@ export default {
activity = this.activityList.find(activity => activity.node === this.currentActivity.node)
// this.$refs.WorkflowActivity.setCurrentRow(activity)
},
setPage(pageNumber) {
setPageNumber(pageNumber) {
this.$store.dispatch('serverListActivity', { pageNumber })
},
handleChangeSizePage(pageSize) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ADempiere/TabManager/TabPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export default defineComponent({
})

function handleChangePage(pageNumber) {
props.containerManager.setPage({
props.containerManager.setPageNumber({
parentUuid: props.parentUuid,
containerUuid: props.tabAttributes.uuid,
pageSize: store.getters.getTabPageSize({ containerUuid: props.tabAttributes.uuid }),
Expand All @@ -352,7 +352,7 @@ export default defineComponent({
* custom method to handle change size page
*/
function handleChangeSizePage(pageSize) {
props.containerManager.setSizePage({
props.containerManager.setPageSize({
parentUuid: props.parentUuid,
containerUuid: props.tabAttributes.uuid,
pageSize,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ADempiere/TabManager/TabPanel/modeDesktop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export default defineComponent({
})

function handleChangePage(pageNumber) {
props.containerManager.setPage({
props.containerManager.setPageNumber({
parentUuid: props.parentUuid,
containerUuid: props.tabAttributes.uuid,
pageSize: store.getters.getTabPageSize({ containerUuid: props.tabAttributes.uuid }),
Expand All @@ -344,7 +344,7 @@ export default defineComponent({
* custom method to handle change size page
*/
function handleChangeSizePage(pageSize) {
props.containerManager.setSizePage({
props.containerManager.setPageSize({
parentUuid: props.parentUuid,
containerUuid: props.tabAttributes.uuid,
pageSize,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ADempiere/TabManager/TabPanel/modeMobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export default defineComponent({
})

function handleChangePage(pageNumber) {
props.containerManager.setPage({
props.containerManager.setPageNumber({
parentUuid: props.parentUuid,
containerUuid: props.tabAttributes.uuid,
pageSize: store.getters.getTabPageSize({ containerUuid: props.tabAttributes.uuid }),
Expand All @@ -369,7 +369,7 @@ export default defineComponent({
* custom method to handle change size page
*/
function handleChangeSizePage(pageSize) {
props.containerManager.setSizePage({
props.containerManager.setPageSize({
parentUuid: props.parentUuid,
containerUuid: props.tabAttributes.uuid,
pageSize,
Expand Down
20 changes: 12 additions & 8 deletions src/utils/ADempiere/dictionary/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,6 @@ export const containerManager = {
})
},

getPageNumber({ containerUuid }) {
return store.getters.getBrowserPageNumber({
containerUuid
})
},

setRow: ({ containerUuid, rowIndex, row }) => {
return store.commit('setBrowserRow', {
containerUuid,
Expand Down Expand Up @@ -456,20 +450,30 @@ export const containerManager = {
})
},

setPage: ({ containerUuid, pageNumber, pageSize }) => {
setPageNumber: ({ containerUuid, pageNumber, pageSize }) => {
store.dispatch('getBrowserSearch', {
containerUuid,
pageSize,
pageNumber
})
},
setSizePage: ({ containerUuid, pageSize, pageNumber = 1 }) => {
getPageNumber({ containerUuid }) {
return store.getters.getBrowserPageNumber({
containerUuid
})
},
setPageSize: ({ containerUuid, pageSize, pageNumber = 1 }) => {
store.dispatch('getBrowserSearch', {
containerUuid,
pageNumber,
pageSize
})
},
getPageSize({ containerUuid }) {
return store.getters.getBrowserPageSize({
containerUuid
})
},

/**
* @returns Promisse with value and displayedValue
Expand Down
17 changes: 10 additions & 7 deletions src/utils/ADempiere/dictionary/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,7 @@ export const containerManager = {
},

// To Default Table
setPage: ({
setPageNumber: ({
parentUuid,
containerUuid,
pageSize,
Expand All @@ -2041,10 +2041,14 @@ export const containerManager = {
pageNumber
})
},
setSizePage: ({
getPageNumber({ containerUuid }) {
return store.getters.getTabPageNumber({
containerUuid
})
},
setPageSize: ({
parentUuid,
containerUuid,
pageNumber = 1,
pageSize = 15
}) => {
const filters = store.getters.getTabDataFilters({
Expand All @@ -2055,12 +2059,11 @@ export const containerManager = {
parentUuid,
containerUuid,
filters,
pageSize,
pageNumber
pageSize
})
},
getPageNumber({ containerUuid }) {
return store.getters.getTabPageNumber({
getPageSize({ containerUuid }) {
return store.getters.getTabPageSize({
containerUuid
})
},
Expand Down
1 change: 1 addition & 0 deletions src/views/ADempiere/Browser/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ export default defineComponent({
<style lang="scss">
// Browser View
.browser-view {
height: 90%;
.browser-collapse {
margin-bottom: 10px;
}
Expand Down

0 comments on commit 62463ce

Please sign in to comment.