Browse Source

fix:导出按钮导出的是全部数据

master
白凤吉 2 weeks ago
parent
commit
1a0b2bb73b
  1. 24
      src/components/setting/History.vue
  2. 2
      src/views/audit/index.vue

24
src/components/setting/History.vue

@ -72,18 +72,24 @@ const onDelHistory = () => {
})
}
const onExportHistory = () => {
if (!selectedRecords.value.length) {
FtMessage.warning('请选择要导出的数据')
return
}
// if (!selectedRecords.value.length) {
// FtMessage.warning('')
// return
// }
const exportParams = {
className: 'DisinfectionLogsService',
fnName: 'exportRecord',
params: {
logNames: selectedRecords.value.map(item => item.name),
},
fnName: 'exportAllRecord',
params: {},
}
syncSendCmd(exportParams)
.then((res) => {
if (res.ackcode === 0) {
FtMessage.success('导出成功')
}
})
.catch((error) => {
console.error('导出记录失败:', error)
})
}
const handleSelectionChange = (rows: Setting.History[]) => {
@ -101,7 +107,7 @@ const deleteBtnVisible = computed(() => {
<template>
<div>
<div class="history-export">
<bt-button type="primary" button-text="导出" @click="onExportHistory" />
<bt-button type="primary" button-text="全部导出" @click="onExportHistory" />
<bt-button v-if="deleteBtnVisible" type="primary" button-text="删除" @click="onDelHistory" />
</div>
<div class="history-table">

2
src/views/audit/index.vue

@ -98,7 +98,7 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
<div class="dashboard-container">
<main class="main-content">
<div class="audit-export">
<bt-button type="primary" button-text="导出" @click="onExportRecord" />
<bt-button type="primary" button-text="全部导出" @click="onExportRecord" />
</div>
<div class="audit-table">
<el-table :data="tableData" style="width: 100%" height="100%" @selection-change="handleSelectionChange">

Loading…
Cancel
Save