添加表格导出功能

This commit is contained in:
GGJ
2024-12-26 15:56:32 +08:00
parent aed771578a
commit 46dc032c4c
14 changed files with 2453 additions and 2827 deletions

View File

@@ -20,6 +20,8 @@
</el-button>
<el-button @click="onComSearch" v-if="showSearch" type="primary" :icon="Search">查询</el-button>
<el-button @click="onResetForm" v-if="showSearch && showReset" :icon="RefreshLeft">重置</el-button>
<el-button @click="onExport" v-if="showExport" :loading="tableStore.table.loading" type="primary"
icon="el-icon-Download">导出</el-button>
</template>
<slot name="operation"></slot>
</div>
@@ -55,6 +57,7 @@ interface Props {
nextFlag?: boolean //控制时间是否可以往后推
theCurrentTime?: boolean //控制时间前3天展示上个月时间
showReset?: boolean //是否显示重置
showExport?: boolean //导出控制
}
const props = withDefaults(defineProps<Props>(), {
@@ -63,7 +66,8 @@ const props = withDefaults(defineProps<Props>(), {
showSearch: true,
nextFlag: false,
theCurrentTime: true,
showReset: true
showReset: true,
showExport:false
})
// 动态计算table高度
let resizeObserver = new ResizeObserver(entries => {
@@ -169,7 +173,10 @@ const onResetForm = () => {
const setInterval = (val: any) => {
datePickerRef.value.setInterval(val)
}
// 导出
const onExport = () => {
tableStore.onTableAction('export', {showAllFlag:true})
}
defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef, showSelectChange, computedSearchRow })
</script>