fixbug: 🐛 修改邮件模板是否默认问题
This commit is contained in:
parent
c40b65cf66
commit
b799e097c2
|
@ -5,9 +5,7 @@ import { rules } from '@/views/configuration/emailTemplate/utils/columns';
|
||||||
import { FormProps } from '@/views/configuration/emailTemplate/utils/types';
|
import { FormProps } from '@/views/configuration/emailTemplate/utils/types';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { useEmailTemplateStore } from '@/store/configuration/emailTemplate';
|
import { useEmailTemplateStore } from '@/store/configuration/emailTemplate';
|
||||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
import { usePublicHooks } from '@/views/hooks';
|
||||||
import View from '@iconify-icons/ep/view';
|
|
||||||
import { viewTemplate } from '@/views/configuration/emailTemplate/utils/hooks';
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<FormProps>(), {
|
const props = withDefaults(defineProps<FormProps>(), {
|
||||||
formInline: () => ({
|
formInline: () => ({
|
||||||
|
@ -17,6 +15,8 @@ const props = withDefaults(defineProps<FormProps>(), {
|
||||||
emailUser: undefined,
|
emailUser: undefined,
|
||||||
// 主题
|
// 主题
|
||||||
subject: undefined,
|
subject: undefined,
|
||||||
|
// 是否默认
|
||||||
|
isDefault: false,
|
||||||
// 邮件内容
|
// 邮件内容
|
||||||
body: undefined,
|
body: undefined,
|
||||||
// 邮件类型
|
// 邮件类型
|
||||||
|
@ -24,6 +24,8 @@ const props = withDefaults(defineProps<FormProps>(), {
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 用户是否停用样式
|
||||||
|
const { switchStyle } = usePublicHooks();
|
||||||
const formRef = ref<FormInstance>();
|
const formRef = ref<FormInstance>();
|
||||||
const form = ref(props.formInline);
|
const form = ref(props.formInline);
|
||||||
const emailTemplateStore = useEmailTemplateStore();
|
const emailTemplateStore = useEmailTemplateStore();
|
||||||
|
@ -54,12 +56,14 @@ defineExpose({ formRef });
|
||||||
<el-input v-model="form.subject" autocomplete="off" type="text" />
|
<el-input v-model="form.subject" autocomplete="off" type="text" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 用户状态 -->
|
||||||
|
<el-form-item :label="$t('isDefault')" prop="isDefault">
|
||||||
|
<el-switch v-model="form.isDefault" :active-text="$t('enable')" :active-value="true" :inactive-text="$t('disable')" :inactive-value="false" :style="switchStyle" inline-prompt />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 配置邮件发送体 -->
|
<!-- 配置邮件发送体 -->
|
||||||
<el-form-item :label="$t('emailTemplate_body')" prop="body">
|
<el-form-item :label="$t('emailTemplate_body')" prop="body">
|
||||||
<el-input v-model="form.body" :autosize="{ minRows: 2, maxRows: 26 }" autocomplete="off" type="textarea" />
|
<el-input v-model="form.body" :autosize="{ minRows: 2, maxRows: 26 }" autocomplete="off" type="textarea" />
|
||||||
<el-button :icon="useRenderIcon(View)" class="reset-margin" link type="primary" @click="viewTemplate(form.body)">
|
|
||||||
{{ $t('viewTemplate') }}
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!--配置邮件类型-->
|
<!--配置邮件类型-->
|
||||||
|
|
|
@ -7,7 +7,6 @@ import PureTable from '@pureadmin/table';
|
||||||
import { onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, selectRows, viewTemplate } from '@/views/configuration/emailTemplate/utils/hooks';
|
import { onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, selectRows, viewTemplate } from '@/views/configuration/emailTemplate/utils/hooks';
|
||||||
import Delete from '@iconify-icons/ep/delete';
|
import Delete from '@iconify-icons/ep/delete';
|
||||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||||
import View from '@iconify-icons/ep/view';
|
|
||||||
import Refresh from '@iconify-icons/ep/refresh';
|
import Refresh from '@iconify-icons/ep/refresh';
|
||||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
|
@ -15,6 +14,7 @@ import { useEmailTemplateStore } from '@/store/configuration/emailTemplate.ts';
|
||||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||||
import { auth } from '@/views/configuration/emailTemplate/utils/auth';
|
import { auth } from '@/views/configuration/emailTemplate/utils/auth';
|
||||||
import { hasAuth } from '@/router/utils';
|
import { hasAuth } from '@/router/utils';
|
||||||
|
import View from '@iconify-icons/ep/view';
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
@ -67,7 +67,9 @@ onMounted(() => {
|
||||||
<el-input v-model="emailTemplateStore.form.type" :placeholder="`${$t('input')}${$t('emailTemplate_type')}`" class="!w-[180px]" clearable />
|
<el-input v-model="emailTemplateStore.form.type" :placeholder="`${$t('input')}${$t('emailTemplate_type')}`" class="!w-[180px]" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :icon="useRenderIcon('ri:search-line')" :loading="emailTemplateStore.loading" type="primary" @click="onSearch"> {{ $t('search') }} </el-button>
|
<el-button :icon="useRenderIcon('ri:search-line')" :loading="emailTemplateStore.loading" type="primary" @click="onSearch">
|
||||||
|
{{ $t('search') }}
|
||||||
|
</el-button>
|
||||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -123,8 +125,12 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #operation="{ row }">
|
<template #operation="{ row }">
|
||||||
<el-button :icon="useRenderIcon(View)" :size="size" class="reset-margin" link type="primary" @click="viewTemplate(row.body)"> {{ $t('viewTemplate') }} </el-button>
|
<el-button :icon="useRenderIcon(View)" :size="size" class="reset-margin" link type="primary" @click="viewTemplate(row.body)">
|
||||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)"> {{ $t('modify') }} </el-button>
|
{{ $t('view') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||||
|
{{ $t('modify') }}
|
||||||
|
</el-button>
|
||||||
<el-popconfirm v-if="hasAuth(auth.deleted)" :title="`${$t('delete')} ${row.templateName}?`" @confirm="onDelete(row)">
|
<el-popconfirm v-if="hasAuth(auth.deleted)" :title="`${$t('delete')} ${row.templateName}?`" @confirm="onDelete(row)">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
|
import { ElTag } from 'element-plus';
|
||||||
|
|
||||||
// 表格列
|
// 表格列
|
||||||
export const columns: TableColumnList = [
|
export const columns: TableColumnList = [
|
||||||
|
@ -14,12 +15,26 @@ export const columns: TableColumnList = [
|
||||||
// 邮件内容
|
// 邮件内容
|
||||||
{ label: $t('emailTemplate_body'), prop: 'body' },
|
{ label: $t('emailTemplate_body'), prop: 'body' },
|
||||||
// 邮件类型
|
// 邮件类型
|
||||||
{ label: $t('emailTemplate_type'), prop: 'type' },
|
{ label: $t('emailTemplate_type'), prop: 'summary' },
|
||||||
|
// 是否默认
|
||||||
|
{
|
||||||
|
label: $t('isDefault'),
|
||||||
|
prop: 'isDefault',
|
||||||
|
formatter({ isDefault }) {
|
||||||
|
return isDefault ? (
|
||||||
|
<ElTag type={'success'}>{$t('default')}</ElTag>
|
||||||
|
) : (
|
||||||
|
<ElTag size={'large'} type={'danger'}>
|
||||||
|
{$t('no_default')}
|
||||||
|
</ElTag>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
||||||
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
|
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
|
||||||
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130 },
|
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130 },
|
||||||
{ label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 130 },
|
{ label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 130 },
|
||||||
{ label: $t('table.operation'), fixed: 'right', width: 230, slot: 'operation' },
|
{ label: $t('table.operation'), fixed: 'right', width: 210, slot: 'operation' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 添加规则
|
// 添加规则
|
|
@ -29,6 +29,7 @@ export function onAdd() {
|
||||||
templateName: undefined,
|
templateName: undefined,
|
||||||
emailUser: undefined,
|
emailUser: undefined,
|
||||||
subject: undefined,
|
subject: undefined,
|
||||||
|
isDefault: undefined,
|
||||||
body: undefined,
|
body: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
},
|
},
|
||||||
|
@ -64,6 +65,7 @@ export function onUpdate(row: any) {
|
||||||
templateName: row.templateName,
|
templateName: row.templateName,
|
||||||
emailUser: row.emailUser,
|
emailUser: row.emailUser,
|
||||||
subject: row.subject,
|
subject: row.subject,
|
||||||
|
isDefault: row.isDefault,
|
||||||
body: row.body,
|
body: row.body,
|
||||||
type: row.type,
|
type: row.type,
|
||||||
},
|
},
|
||||||
|
@ -137,7 +139,7 @@ export const onDeleteBatch = async () => {
|
||||||
/** 查看模板 */
|
/** 查看模板 */
|
||||||
export const viewTemplate = (template: string) => {
|
export const viewTemplate = (template: string) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
title: $t('viewTemplate'),
|
title: $t('view'),
|
||||||
draggable: true,
|
draggable: true,
|
||||||
fullscreenIcon: true,
|
fullscreenIcon: true,
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
|
|
|
@ -6,6 +6,8 @@ export interface FormItemProps {
|
||||||
emailUser: string;
|
emailUser: string;
|
||||||
// 主题
|
// 主题
|
||||||
subject: string;
|
subject: string;
|
||||||
|
// 是否默认
|
||||||
|
isDefault: boolean;
|
||||||
// 邮件内容
|
// 邮件内容
|
||||||
body: string;
|
body: string;
|
||||||
// 邮件类型
|
// 邮件类型
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { ElTag } from 'element-plus';
|
import { ElTag, ElText } from 'element-plus';
|
||||||
|
|
||||||
// 表格列
|
// 表格列
|
||||||
export const columns: TableColumnList = [
|
export const columns: TableColumnList = [
|
||||||
|
@ -10,13 +10,20 @@ export const columns: TableColumnList = [
|
||||||
// 消息简介
|
// 消息简介
|
||||||
{ label: $t('summary'), prop: 'summary' },
|
{ label: $t('summary'), prop: 'summary' },
|
||||||
// 发送人昵称
|
// 发送人昵称
|
||||||
{ label: $t('sendNickname'), prop: 'sendNickname', slot: 'sendNickname' },
|
{ label: $t('sendNickname'), prop: 'sendNickname', slot: 'sendNickname', width: 130 },
|
||||||
// 接受人昵称
|
// 接受人昵称
|
||||||
{ label: $t('receivedUserNickname'), prop: 'receivedUserNickname', slot: 'receivedUserNickname' },
|
{ label: $t('receivedUserNickname'), prop: 'receivedUserNickname', slot: 'receivedUserNickname', width: 130 },
|
||||||
// 消息类型
|
// 消息类型
|
||||||
{ label: $t('messageType'), prop: 'messageType', slot: 'messageType' },
|
{ label: $t('messageType'), prop: 'messageType', slot: 'messageType', width: 130 },
|
||||||
// 编辑器类型
|
// 编辑器类型
|
||||||
{ label: $t('editorType'), prop: 'editorType' },
|
{
|
||||||
|
label: $t('editorType'),
|
||||||
|
prop: 'editorType',
|
||||||
|
width: 130,
|
||||||
|
formatter({ editorType }) {
|
||||||
|
return editorType === 'rich' ? <ElText type={'info'}>{editorType}</ElText> : <ElText type={'warning'}>{editorType}</ElText>;
|
||||||
|
},
|
||||||
|
},
|
||||||
// 封面
|
// 封面
|
||||||
{ label: $t('cover'), prop: 'cover', slot: 'cover', width: 80 },
|
{ label: $t('cover'), prop: 'cover', slot: 'cover', width: 80 },
|
||||||
// 消息等级
|
// 消息等级
|
||||||
|
@ -33,7 +40,7 @@ export const columns: TableColumnList = [
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
// 消息等级详情
|
// 消息等级详情
|
||||||
{ label: $t('extra'), prop: 'extra', slot: 'extra' },
|
{ label: $t('extra'), prop: 'extra', slot: 'extra', width: 130 },
|
||||||
// 0:未读 1:已读
|
// 0:未读 1:已读
|
||||||
{
|
{
|
||||||
label: $t('status'),
|
label: $t('status'),
|
||||||
|
|
|
@ -6,19 +6,19 @@ export const columns: TableColumnList = [
|
||||||
{ type: 'selection', align: 'left' },
|
{ type: 'selection', align: 'left' },
|
||||||
{ type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 },
|
{ type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 },
|
||||||
// 任务名称
|
// 任务名称
|
||||||
{ label: $t('quartzExecuteLog_jobName'), prop: 'jobName' },
|
{ label: $t('quartzExecuteLog_jobName'), prop: 'jobName', width: 100 },
|
||||||
// 任务分组
|
// 任务分组
|
||||||
{ label: $t('quartzExecuteLog_jobGroup'), prop: 'jobGroup' },
|
{ label: $t('quartzExecuteLog_jobGroup'), prop: 'jobGroup', width: 100 },
|
||||||
// 执行任务类名
|
// 执行任务类名
|
||||||
{ label: $t('quartzExecuteLog_jobClassName'), prop: 'jobClassName' },
|
{ label: $t('quartzExecuteLog_jobClassName'), prop: 'jobClassName', width: 100 },
|
||||||
// 执行任务core表达式
|
// 执行任务core表达式
|
||||||
{ label: $t('quartzExecuteLog_cronExpression'), prop: 'cronExpression' },
|
{ label: $t('quartzExecuteLog_cronExpression'), prop: 'cronExpression', width: 100 },
|
||||||
// 触发器名称
|
// 触发器名称
|
||||||
{ label: $t('quartzExecuteLog_triggerName'), prop: 'triggerName' },
|
{ label: $t('quartzExecuteLog_triggerName'), prop: 'triggerName', width: 100 },
|
||||||
// 执行结果
|
// 执行结果
|
||||||
{ label: $t('quartzExecuteLog_executeResult'), prop: 'executeResult', width: 410, slot: 'executeResult' },
|
{ label: $t('quartzExecuteLog_executeResult'), prop: 'executeResult', width: 410, slot: 'executeResult' },
|
||||||
// 执行时间
|
// 执行时间
|
||||||
{ label: $t('quartzExecuteLog_duration'), prop: 'duration' },
|
{ label: $t('quartzExecuteLog_duration'), prop: 'duration', width: 100 },
|
||||||
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
||||||
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
|
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
|
||||||
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130 },
|
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130 },
|
||||||
|
|
|
@ -12,7 +12,7 @@ export const columns: TableColumnList = [
|
||||||
// 登录Ip归属地
|
// 登录Ip归属地
|
||||||
{ label: $t('userLoginLog_ipRegion'), prop: 'ipRegion', width: 160 },
|
{ label: $t('userLoginLog_ipRegion'), prop: 'ipRegion', width: 160 },
|
||||||
// 登录时代理
|
// 登录时代理
|
||||||
{ label: $t('userLoginLog_userAgent'), prop: 'userAgent' },
|
{ label: $t('userLoginLog_userAgent'), prop: 'userAgent', width: 130 },
|
||||||
// 操作类型
|
// 操作类型
|
||||||
{ label: $t('userLoginLog_type'), prop: 'type', width: 130 },
|
{ label: $t('userLoginLog_type'), prop: 'type', width: 130 },
|
||||||
// 标识客户端是否是通过Ajax发送请求的
|
// 标识客户端是否是通过Ajax发送请求的
|
||||||
|
|
Loading…
Reference in New Issue