mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-23 23:35:06 +08:00
1. 统一化代码
2. 增加 DocAlert 关联文档
This commit is contained in:
@ -10,7 +10,6 @@
|
||||
<script setup lang="ts">
|
||||
import * as MailAccountApi from '@/api/system/mail/account'
|
||||
import { rules, allSchemas } from './account.data'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@ -21,7 +20,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const openModal = async (type: string, id?: number) => {
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
@ -36,7 +35,7 @@ const openModal = async (type: string, id?: number) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
@ -1,6 +1,5 @@
|
||||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
// 表单校验
|
||||
|
@ -1,23 +1,25 @@
|
||||
<template>
|
||||
<doc-alert title="邮件配置" url="https://doc.iocoder.cn/mail" />
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<content-wrap>
|
||||
<ContentWrap>
|
||||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams">
|
||||
<!-- 新增等操作按钮 -->
|
||||
<template #actionMore>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openModal('create')"
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['system:mail-account:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
</template>
|
||||
</Search>
|
||||
</content-wrap>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<content-wrap>
|
||||
<ContentWrap>
|
||||
<Table
|
||||
:columns="allSchemas.tableColumns"
|
||||
:data="tableObject.tableList"
|
||||
@ -32,7 +34,7 @@
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openModal('update', row.id)"
|
||||
@click="openForm('update', row.id)"
|
||||
v-hasPermi="['system:mail-account:update']"
|
||||
>
|
||||
编辑
|
||||
@ -47,15 +49,15 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</Table>
|
||||
</content-wrap>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<mail-account-form ref="modalRef" @success="getList" />
|
||||
<MailAccountForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts" name="MailAccount">
|
||||
import { allSchemas } from './account.data'
|
||||
import * as MailAccountApi from '@/api/system/mail/account'
|
||||
import MailAccountForm from './form.vue'
|
||||
import MailAccountForm from './MailAccountForm.vue'
|
||||
|
||||
// tableObject:表格的属性对象,可获得分页大小、条数等属性
|
||||
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
|
||||
@ -68,9 +70,9 @@ const { tableObject, tableMethods } = useTable({
|
||||
const { getList, setSearchParams } = tableMethods
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const modalRef = ref()
|
||||
const openModal = (type: string, id?: number) => {
|
||||
modalRef.value.openModal(type, id)
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
@ -17,7 +17,7 @@ const detailLoading = ref(false) // 表单的加载中
|
||||
const detailData = ref() // 详情数据
|
||||
|
||||
/** 打开弹窗 */
|
||||
const openModal = async (id: number) => {
|
||||
const open = async (id: number) => {
|
||||
dialogVisible.value = true
|
||||
// 设置数据
|
||||
detailLoading.value = true
|
||||
@ -27,5 +27,5 @@ const openModal = async (id: number) => {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
</script>
|
@ -1,11 +1,13 @@
|
||||
<template>
|
||||
<doc-alert title="邮件配置" url="https://doc.iocoder.cn/mail" />
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<content-wrap>
|
||||
<ContentWrap>
|
||||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
|
||||
</content-wrap>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<content-wrap>
|
||||
<ContentWrap>
|
||||
<Table
|
||||
:columns="allSchemas.tableColumns"
|
||||
:data="tableObject.tableList"
|
||||
@ -20,22 +22,22 @@
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openModal(row.id)"
|
||||
@click="openDetail(row.id)"
|
||||
v-hasPermi="['system:mail-log:query']"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</Table>
|
||||
</content-wrap>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:详情 -->
|
||||
<mail-log-detail ref="modalRef" />
|
||||
<mail-log-detail ref="detailRef" />
|
||||
</template>
|
||||
<script setup lang="ts" name="MailLog">
|
||||
import { allSchemas } from './log.data'
|
||||
import * as MailLogApi from '@/api/system/mail/log'
|
||||
import MailLogDetail from './detail.vue'
|
||||
import MailLogDetail from './MailLogDetail.vue'
|
||||
|
||||
// tableObject:表格的属性对象,可获得分页大小、条数等属性
|
||||
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
|
||||
@ -47,9 +49,9 @@ const { tableObject, tableMethods } = useTable({
|
||||
const { getList, setSearchParams } = tableMethods
|
||||
|
||||
/** 详情操作 */
|
||||
const modalRef = ref()
|
||||
const openModal = (id: number) => {
|
||||
modalRef.value.openModal(id)
|
||||
const detailRef = ref()
|
||||
const openDetail = (id: number) => {
|
||||
detailRef.value.open(id)
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
|
@ -3,7 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as MailAccountApi from '@/api/system/mail/account'
|
||||
|
||||
// 邮箱账号的列表
|
||||
const accounts = await MailAccountApi.getSimpleMailAccountList()
|
||||
const accountList = await MailAccountApi.getSimpleMailAccountList()
|
||||
|
||||
// CrudSchema:https://kailong110120130.gitee.io/vue-element-plus-admin-doc/hooks/useCrudSchemas.html
|
||||
const crudSchemas = reactive<CrudSchema[]>([
|
||||
@ -74,7 +74,7 @@ const crudSchemas = reactive<CrudSchema[]>([
|
||||
search: {
|
||||
show: true,
|
||||
component: 'Select',
|
||||
api: () => accounts,
|
||||
api: () => accountList,
|
||||
componentProps: {
|
||||
optionsAlias: {
|
||||
labelField: 'mail',
|
||||
|
@ -16,7 +16,6 @@
|
||||
<script setup lang="ts">
|
||||
import * as MailTemplateApi from '@/api/system/mail/template'
|
||||
import { allSchemas, rules } from './template.data'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@ -27,7 +26,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const openModal = async (type: string, id?: number) => {
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
@ -42,7 +41,7 @@ const openModal = async (type: string, id?: number) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
@ -33,7 +33,6 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as MailTemplateApi from '@/api/system/mail/template'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
@ -53,7 +52,7 @@ const formRules = reactive({
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const openModal = async (id: number) => {
|
||||
const open = async (id: number) => {
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
// 设置数据
|
||||
@ -76,7 +75,7 @@ const openModal = async (id: number) => {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = async () => {
|
@ -1,23 +1,25 @@
|
||||
<template>
|
||||
<doc-alert title="邮件配置" url="https://doc.iocoder.cn/mail" />
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<content-wrap>
|
||||
<ContentWrap>
|
||||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams">
|
||||
<!-- 新增等操作按钮 -->
|
||||
<template #actionMore>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openModal('create')"
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['system:mail-account:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
</template>
|
||||
</Search>
|
||||
</content-wrap>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<content-wrap>
|
||||
<ContentWrap>
|
||||
<Table
|
||||
:columns="allSchemas.tableColumns"
|
||||
:data="tableObject.tableList"
|
||||
@ -32,7 +34,7 @@
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openSend(row.id)"
|
||||
@click="openSendForm(row.id)"
|
||||
v-hasPermi="['system:mail-template:send-mail']"
|
||||
>
|
||||
测试
|
||||
@ -40,7 +42,7 @@
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openModal('update', row.id)"
|
||||
@click="openForm('update', row.id)"
|
||||
v-hasPermi="['system:mail-template:update']"
|
||||
>
|
||||
编辑
|
||||
@ -55,19 +57,19 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</Table>
|
||||
</content-wrap>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<mail-template-form ref="modalRef" @success="getList" />
|
||||
<MailTemplateForm ref="formRef" @success="getList" />
|
||||
|
||||
<!-- 表单弹窗:发送测试 -->
|
||||
<mail-template-send ref="sendRef" />
|
||||
<MailTemplateSendForm ref="sendFormRef" />
|
||||
</template>
|
||||
<script setup lang="ts" name="MailTemplate">
|
||||
import { allSchemas } from './template.data'
|
||||
import * as MailTemplateApi from '@/api/system/mail/template'
|
||||
import MailTemplateForm from './form.vue'
|
||||
import MailTemplateSend from './send.vue'
|
||||
import MailTemplateForm from './MailTemplateForm.vue'
|
||||
import MailTemplateSendForm from './MailTemplateSendForm.vue'
|
||||
|
||||
// tableObject:表格的属性对象,可获得分页大小、条数等属性
|
||||
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
|
||||
@ -80,9 +82,9 @@ const { tableObject, tableMethods } = useTable({
|
||||
const { getList, setSearchParams } = tableMethods
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const modalRef = ref()
|
||||
const openModal = (type: string, id?: number) => {
|
||||
modalRef.value.openModal(type, id)
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
@ -91,9 +93,9 @@ const handleDelete = (id: number) => {
|
||||
}
|
||||
|
||||
/** 发送测试操作 */
|
||||
const sendRef = ref()
|
||||
const openSend = (id: number) => {
|
||||
sendRef.value.openModal(id)
|
||||
const sendFormRef = ref()
|
||||
const openSendForm = (id: number) => {
|
||||
sendFormRef.value.open(id)
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
|
@ -4,7 +4,7 @@ import { TableColumn } from '@/types/table'
|
||||
import * as MailAccountApi from '@/api/system/mail/account'
|
||||
|
||||
// 邮箱账号的列表
|
||||
const accounts = await MailAccountApi.getSimpleMailAccountList()
|
||||
const accountList = await MailAccountApi.getSimpleMailAccountList()
|
||||
|
||||
// 表单校验
|
||||
export const rules = reactive({
|
||||
@ -49,12 +49,12 @@ const crudSchemas = reactive<CrudSchema[]>([
|
||||
field: 'accountId',
|
||||
width: '200px',
|
||||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
|
||||
return accounts.find((account) => account.id === cellValue)?.mail
|
||||
return accountList.find((account) => account.id === cellValue)?.mail
|
||||
},
|
||||
search: {
|
||||
show: true,
|
||||
component: 'Select',
|
||||
api: () => accounts,
|
||||
api: () => accountList,
|
||||
componentProps: {
|
||||
optionsAlias: {
|
||||
labelField: 'mail',
|
||||
@ -64,7 +64,7 @@ const crudSchemas = reactive<CrudSchema[]>([
|
||||
},
|
||||
form: {
|
||||
component: 'Select',
|
||||
api: () => accounts,
|
||||
api: () => accountList,
|
||||
componentProps: {
|
||||
optionsAlias: {
|
||||
labelField: 'mail',
|
||||
|
Reference in New Issue
Block a user