2023-02-11 00:44:00 +08:00
|
|
|
|
<template>
|
2023-03-18 00:42:25 +08:00
|
|
|
|
<!-- 搜索工作栏 -->
|
|
|
|
|
<content-wrap>
|
|
|
|
|
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams">
|
|
|
|
|
<!-- 新增等操作按钮 -->
|
|
|
|
|
<template #actionMore>
|
|
|
|
|
<el-button
|
2023-02-11 00:44:00 +08:00
|
|
|
|
type="primary"
|
2023-03-18 00:42:25 +08:00
|
|
|
|
@click="openModal('create')"
|
|
|
|
|
v-hasPermi="['system:mail-account:create']"
|
|
|
|
|
>
|
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
|
|
</el-button>
|
2023-02-11 00:44:00 +08:00
|
|
|
|
</template>
|
2023-03-18 00:42:25 +08:00
|
|
|
|
</Search>
|
|
|
|
|
</content-wrap>
|
2023-02-11 00:44:00 +08:00
|
|
|
|
|
2023-03-18 00:42:25 +08:00
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<content-wrap>
|
|
|
|
|
<Table
|
|
|
|
|
:columns="allSchemas.tableColumns"
|
|
|
|
|
:data="tableObject.tableList"
|
|
|
|
|
:loading="tableObject.loading"
|
|
|
|
|
:pagination="{
|
|
|
|
|
total: tableObject.total
|
|
|
|
|
}"
|
|
|
|
|
v-model:pageSize="tableObject.pageSize"
|
|
|
|
|
v-model:currentPage="tableObject.currentPage"
|
2023-02-11 00:44:00 +08:00
|
|
|
|
>
|
2023-03-18 00:42:25 +08:00
|
|
|
|
<template #action="{ row }">
|
2023-03-18 11:40:55 +08:00
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openSend(row.id)"
|
|
|
|
|
v-hasPermi="['system:mail-template:send-mail']"
|
|
|
|
|
>
|
|
|
|
|
测试
|
|
|
|
|
</el-button>
|
2023-03-18 00:42:25 +08:00
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openModal('update', row.id)"
|
|
|
|
|
v-hasPermi="['system:mail-template:update']"
|
|
|
|
|
>
|
|
|
|
|
编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="danger"
|
|
|
|
|
v-hasPermi="['system:mail-template:delete']"
|
|
|
|
|
@click="handleDelete(row.id)"
|
|
|
|
|
>
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
2023-02-11 00:44:00 +08:00
|
|
|
|
</template>
|
2023-03-18 00:42:25 +08:00
|
|
|
|
</Table>
|
|
|
|
|
</content-wrap>
|
2023-02-11 00:44:00 +08:00
|
|
|
|
|
2023-03-18 00:42:25 +08:00
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
2023-03-18 10:39:19 +08:00
|
|
|
|
<mail-template-form ref="modalRef" @success="getList" />
|
2023-03-18 11:40:55 +08:00
|
|
|
|
|
|
|
|
|
<!-- 表单弹窗:发送测试 -->
|
|
|
|
|
<mail-template-send ref="sendRef" />
|
2023-02-11 00:44:00 +08:00
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts" name="MailTemplate">
|
2023-03-18 00:42:25 +08:00
|
|
|
|
import { allSchemas } from './template.data'
|
2023-02-11 00:44:00 +08:00
|
|
|
|
import * as MailTemplateApi from '@/api/system/mail/template'
|
2023-03-18 10:39:19 +08:00
|
|
|
|
import MailTemplateForm from './form.vue'
|
2023-03-18 11:40:55 +08:00
|
|
|
|
import MailTemplateSend from './send.vue'
|
2023-02-11 00:44:00 +08:00
|
|
|
|
|
2023-03-18 00:42:25 +08:00
|
|
|
|
// tableObject:表格的属性对象,可获得分页大小、条数等属性
|
|
|
|
|
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
|
|
|
|
|
// 详细可见:https://kailong110120130.gitee.io/vue-element-plus-admin-doc/components/table.html#usetable
|
|
|
|
|
const { tableObject, tableMethods } = useTable({
|
2023-03-18 10:39:19 +08:00
|
|
|
|
getListApi: MailTemplateApi.getMailTemplatePage, // 分页接口
|
|
|
|
|
delListApi: MailTemplateApi.deleteMailTemplate // 删除接口
|
2023-02-11 00:44:00 +08:00
|
|
|
|
})
|
2023-03-18 00:42:25 +08:00
|
|
|
|
// 获得表格的各种操作
|
|
|
|
|
const { getList, setSearchParams } = tableMethods
|
2023-02-11 00:44:00 +08:00
|
|
|
|
|
2023-03-18 00:42:25 +08:00
|
|
|
|
/** 添加/修改操作 */
|
2023-03-18 10:39:19 +08:00
|
|
|
|
const modalRef = ref()
|
|
|
|
|
const openModal = (type: string, id?: number) => {
|
|
|
|
|
modalRef.value.openModal(type, id)
|
|
|
|
|
}
|
2023-02-11 00:44:00 +08:00
|
|
|
|
|
2023-03-18 00:42:25 +08:00
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
const handleDelete = (id: number) => {
|
|
|
|
|
tableMethods.delList(id, false)
|
2023-02-11 00:44:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-03-18 11:40:55 +08:00
|
|
|
|
/** 发送测试操作 */
|
|
|
|
|
const sendRef = ref()
|
|
|
|
|
const openSend = (id: number) => {
|
|
|
|
|
sendRef.value.openModal(id)
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-18 00:42:25 +08:00
|
|
|
|
/** 初始化 **/
|
2023-02-11 00:44:00 +08:00
|
|
|
|
onMounted(() => {
|
2023-03-18 00:42:25 +08:00
|
|
|
|
getList()
|
2023-02-11 00:44:00 +08:00
|
|
|
|
})
|
|
|
|
|
</script>
|