| | |
| | | opts.getListApi!({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...Object.assign(params ? params : {}, queryParams) |
| | | ...Object.assign(params ? params : {}, opts.queryParams.value) |
| | | }).then((res: any) => { |
| | | tableData.value = res.rows || []; |
| | | pageF.loading = false; |
| | |
| | | * 2. 新增:手动触发搜索逻辑 (用于回车搜索) |
| | | */ |
| | | const manualSearch = () => { |
| | | if (!opts.queryParams || !opts.queryParams.value) return; // 容错处理 |
| | | opts.page.currentPage = 1; // 回车搜索默认切回第一页 |
| | | if (opts.handleQueryFunc) { |
| | | opts.handleQueryFunc(); |
| | |
| | | |
| | | /** 清空搜索回调方法 */ |
| | | const searchReset = () => { |
| | | opts.queryParams = {}; // 修改为操作 .value |
| | | // opts.queryParams = {}; // 修改为操作 .value |
| | | // ✅ 正确写法:清空 ref 内部的值 |
| | | if (opts.queryParams && opts.queryParams.value) { |
| | | // 方案 A:直接清空对象内部属性 |
| | | Object.keys(opts.queryParams.value).forEach(key => { |
| | | delete opts.queryParams.value[key]; |
| | | }); |
| | | |
| | | } |
| | | if (opts.handleQueryFunc) { |
| | | opts.handleQueryFunc(); |
| | | } |
| | |
| | | */ |
| | | const handleExport =()=>{ |
| | | const queryParams = filterEmptyParams(opts.queryParams.value); |
| | | opts.exportApi!(queryParams); |
| | | opts.exportApi!( opts.queryParams.value); |
| | | } |
| | | const handleDelete = () =>{ |
| | | if ( !(pageF?.ids)|| pageF?.ids?.length === 0) { |