|
|
@ -4,6 +4,14 @@ |
|
|
|
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:route-name="routeName" |
|
|
|
:allSchemas="allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table |
|
|
@ -35,11 +43,17 @@ |
|
|
|
</template> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { allSchemas } from './log.data' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as MailLogApi from '@/api/system/mail/log' |
|
|
|
import MailLogDetail from './MailLogDetail.vue' |
|
|
|
|
|
|
|
import download from '@/utils/download' |
|
|
|
defineOptions({ name: 'SystemMailLog' }) |
|
|
|
const message = useMessage() |
|
|
|
const exportLoading = ref(false) |
|
|
|
|
|
|
|
const route = useRoute() //路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
// tableObject:表格的属性对象,可获得分页大小、条数等属性 |
|
|
|
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作 |
|
|
|
// 详细可见:https://doc.iocoder.cn/vue3/crud-schema/ |
|
|
@ -49,7 +63,12 @@ const { tableObject, tableMethods } = useTable({ |
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:''}), // 导出 |
|
|
|
] |
|
|
|
|
|
|
|
/** 详情操作 */1 |
|
|
|
const detailRef = ref() |
|
|
|
const openDetail = (id: number) => { |
|
|
|
detailRef.value.open(id) |
|
|
@ -59,4 +78,30 @@ const openDetail = (id: number) => { |
|
|
|
onMounted(() => { |
|
|
|
getList() |
|
|
|
}) |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'export') { // 导出 |
|
|
|
handleExport() |
|
|
|
} else { // 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const handleExport = async () => { |
|
|
|
try { |
|
|
|
// 导出的二次确认 |
|
|
|
await message.exportConfirm() |
|
|
|
exportLoading.value = true |
|
|
|
// 发起导出 |
|
|
|
const data = await MailLogApi.exportMailLog(tableObject.params) |
|
|
|
download.excel(data, '邮箱记录.xlsx') |
|
|
|
} catch { |
|
|
|
// 错误处理 |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|