冀北项目添加表格导出功能 技术监督添加下载模版上传功能

This commit is contained in:
GGJ
2025-03-28 16:05:03 +08:00
parent 76f41e9a24
commit ef04022f14
153 changed files with 4208 additions and 3480 deletions

View File

@@ -8,6 +8,7 @@ import { filtration } from './tableMethod'
interface TableStoreParams {
url: string // 请求地址
pk?: string
filename?: any // 导出文件名
column: TableColumn[]
params?: anyObj
method?: Method // 请求方式
@@ -18,12 +19,14 @@ interface TableStoreParams {
publicHeight?: number //计算高度
resetCallback?: () => void // 重置
loadCallback?: () => void // 接口调用后的回调
exportProcessingData?:() => void //导出处理数据
beforeSearchFun?: () => void // 接口调用前的回调
}
export default class TableStore {
public url
public pk
public filename: any = null
public method: Method
public initData: any = null
public isWebPaging = false
@@ -42,9 +45,11 @@ export default class TableStore {
pageNum: 1,
pageSize: 20
},
filename:null,
loading: true,
column: [],
loadCallback: null,
exportProcessingData: null,
resetCallback: null,
beforeSearchFun: null,
height: '',
@@ -57,12 +62,14 @@ export default class TableStore {
this.paramsPOST = options.paramsPOST || false
this.isWebPaging = options.isWebPaging || false
this.method = options.method || 'GET'
this.table.filename = options.filename || null
this.table.column = options.column
this.showPage = options.showPage !== false
this.table.publicHeight = options.publicHeight || 0
this.table.resetCallback = options.resetCallback || null
this.table.loadCallback = options.loadCallback || null
this.table.exportProcessingData = options.exportProcessingData || null
this.table.beforeSearchFun = options.beforeSearchFun || null
Object.assign(this.table.params, options.params)
this.table.height = mainHeight(20 + (this.showPage ? 58 : 0) + this.table.publicHeight).height as string
@@ -206,6 +213,7 @@ export default class TableStore {
)
).then(res => {
this.table.allData = filtration(res.data.records || res.data)
this.table.exportProcessingData && this.table.exportProcessingData()
this.table.allFlag = data.showAllFlag || true
})
}