全局添加导出表格配置

This commit is contained in:
GGJ
2024-12-27 08:47:47 +08:00
parent 1f94ac5267
commit 0994a52699
28 changed files with 3264 additions and 200 deletions

View File

@@ -21,6 +21,9 @@
:icon="Search">查询</el-button>
<el-button @click="onResetForm" v-if="showSearch && showReset" :loading="tableStore.table.loading"
: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 +58,8 @@ interface Props {
nextFlag?: boolean //控制时间是否可以往后推
theCurrentTime?: boolean //控制时间前3天展示上个月时间
showReset?: boolean //控制时间前3天展示上个月时间
showExport?: boolean //导出控制
}
const props = withDefaults(defineProps<Props>(), {
@@ -63,7 +68,8 @@ const props = withDefaults(defineProps<Props>(), {
showSearch: true,
nextFlag: false,
theCurrentTime: false,
showReset: true
showReset: true,
showExport:false
})
// 动态计算table高度
const resizeObserver = new ResizeObserver(entries => {
@@ -169,6 +175,10 @@ const onResetForm = () => {
const setTheDate = (val: any) => {
datePickerRef.value.setTheDate(val)
}
// 导出
const onExport = () => {
tableStore.onTableAction('export', {showAllFlag:true})
}
defineExpose({ onComSearch, areaRef, setDatePicker, setTheDate, datePickerRef, showSelectChange })
</script>