feature:表格导出支持配置limit order和where条件 (#1665)

* feature:导出功能可携带条件

* feature:组件增加导出入参

* 带条件导出Excel功能
This commit is contained in:
奇淼(piexlmax
2024-03-05 23:29:59 +08:00
committed by GitHub
parent 1e4970469f
commit 35e2c2cfe8
7 changed files with 207 additions and 84 deletions
@@ -11,6 +11,10 @@ const props = defineProps({
templateId: {
type: String,
required: true
},
condition: {
type: Object,
default: () => ({})
}
})
@@ -22,7 +26,11 @@ const exportExcelFunc = async() => {
return
}
const baseUrl = import.meta.env.VITE_BASE_API
const url = `${baseUrl}/sysExportTemplate/exportExcel?templateID=${props.templateId}`
const params = Object.entries(props.condition)
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
.join('&')
const url = `${baseUrl}/sysExportTemplate/exportExcel?templateID=${props.templateId}${params ? '&' + params : ''}`
window.open(url, '_blank')
}
</script>