| | |
| | | params = opts.getBeginListFunc!(params) |
| | | } |
| | | pageF.loading = true; |
| | | const queryParams = filterEmptyParams(opts.queryParams.value); |
| | | opts.getListApi!({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...Object.assign(params ? params : {}, opts.queryParams.value) |
| | | ...Object.assign(params ? params : {}, queryParams) |
| | | }).then((res: any) => { |
| | | tableData.value = res.rows || []; |
| | | pageF.loading = false; |
| | |
| | | * 导出 |
| | | */ |
| | | const handleExport =()=>{ |
| | | console.log(opts.queryParams.value) |
| | | opts.exportApi!(opts.queryParams.value); |
| | | const queryParams = filterEmptyParams(opts.queryParams.value); |
| | | opts.exportApi!(queryParams); |
| | | } |
| | | const handleDelete = () =>{ |
| | | if ( !(pageF?.ids)|| pageF?.ids?.length === 0) { |
| | |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 过滤空字符串参数 |
| | | */ |
| | | const filterEmptyParams = (params: any) => { |
| | | const result: any = {}; |
| | | for (const key in params) { |
| | | const val = params[key]; |
| | | // 过滤空字符串、null、undefined |
| | | if (val !== '' && val !== null && val !== undefined) { |
| | | result[key] = val; |
| | | } |
| | | } |
| | | return result; |
| | | }; |
| | | return { |
| | | pageF, |
| | | tableData, |