this.table.

This commit is contained in:
仲么了
2024-01-17 09:53:00 +08:00
parent 7da7f5d803
commit 88208911cf
9 changed files with 558 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ interface TableStoreParams {
publicHeight?: number
resetCallback?: () => void
loadCallback?: () => void
beforeSearchFun?: () => void
}
export default class TableStore {
@@ -37,6 +38,7 @@ export default class TableStore {
column: [],
loadCallback: null,
resetCallback: null,
beforeSearchFun: null,
height: mainHeight(20 + (this.showPage ? 58 : 0)).height as string,
publicHeight: 0
})
@@ -51,6 +53,7 @@ export default class TableStore {
this.table.publicHeight = options.publicHeight || 0
this.table.resetCallback = options.resetCallback || null
this.table.loadCallback = options.loadCallback || null
this.table.beforeSearchFun = options.beforeSearchFun || null
Object.assign(this.table.params, options.params)
}
@@ -91,6 +94,7 @@ export default class TableStore {
[
'search',
() => {
this.table.beforeSearchFun && this.table.beforeSearchFun()
this.table.params.pageNum = 1
this.index()
}