1. 统一删除 dialog-footer,包括代码生成的模版

2. 查询参数列表,改下
3. 简化 formatDate
4. 看看是不是有部分新增的 plain 不对
5. modelVisible 改成 dialogVisible?modelTitle 改成 dialogTitle
This commit is contained in:
YunaiV
2023-04-02 23:52:56 +08:00
parent 87a5ddfd2c
commit 0d6ecfb45c
77 changed files with 363 additions and 341 deletions

View File

@ -1,9 +1,9 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<Form ref="formRef" :schema="allSchemas.formSchema" :rules="rules" v-loading="formLoading" />
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -14,16 +14,16 @@ import { rules, allSchemas } from './account.data'
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const modelVisible = ref(false) // 弹窗的是否展示
const modelTitle = ref('') // 弹窗的标题
const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中1修改时的数据加载2提交的按钮禁用
const formType = ref('') // 表单的类型create - 新增update - 修改
const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const openModal = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
// 修改时,设置数据
if (id) {
@ -56,7 +56,7 @@ const submitForm = async () => {
await MailAccountApi.updateMailAccount(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
// 发送操作成功的事件
emit('success')
} finally {

View File

@ -6,6 +6,7 @@
<template #actionMore>
<el-button
type="primary"
plain
@click="openModal('create')"
v-hasPermi="['system:mail-account:create']"
>

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="500">
<Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="500">
<Descriptions :schema="allSchemas.detailSchema" :data="detailData">
<!-- 展示 HTML 内容 -->
<template #templateContent="{ row }">
@ -12,13 +12,13 @@
import * as MailLogApi from '@/api/system/mail/log'
import { allSchemas } from './log.data'
const modelVisible = ref(false) // 弹窗的是否展示
const dialogVisible = ref(false) // 弹窗的是否展示
const detailLoading = ref(false) // 表单的加载中
const detailData = ref() // 详情数据
/** 打开弹窗 */
const openModal = async (id: number) => {
modelVisible.value = true
dialogVisible.value = true
// 设置数据
detailLoading.value = true
try {

View File

@ -1,9 +1,9 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible" :scroll="true" :width="800" :max-height="500">
<Dialog :title="dialogTitle" v-model="dialogVisible" :scroll="true" :width="800" :max-height="500">
<Form ref="formRef" :schema="allSchemas.formSchema" :rules="rules" v-loading="formLoading" />
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -14,16 +14,16 @@ import { rules, allSchemas } from './template.data'
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const modelVisible = ref(false) // 弹窗的是否展示
const modelTitle = ref('') // 弹窗的标题
const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中1修改时的数据加载2提交的按钮禁用
const formType = ref('') // 表单的类型create - 新增update - 修改
const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const openModal = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
// 修改时,设置数据
if (id) {
@ -56,7 +56,7 @@ const submitForm = async () => {
await MailTemplateApi.updateMailTemplate(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
// 发送操作成功的事件
emit('success')
} finally {

View File

@ -6,6 +6,7 @@
<template #actionMore>
<el-button
type="primary"
plain
@click="openModal('create')"
v-hasPermi="['system:mail-account:create']"
>

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="测试" v-model="modelVisible">
<Dialog title="测试" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -27,7 +27,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -36,7 +36,7 @@ import * as MailTemplateApi from '@/api/system/mail/template'
const message = useMessage() // 消息弹窗
const modelVisible = ref(false) // 弹窗的是否展示
const dialogVisible = ref(false) // 弹窗的是否展示
const formLoading = ref(false) // 表单的加载中1修改时的数据加载2提交的按钮禁用
const formData = ref({
content: '',
@ -54,7 +54,7 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const openModal = async (id: number) => {
modelVisible.value = true
dialogVisible.value = true
resetForm()
// 设置数据
formLoading.value = true
@ -92,7 +92,7 @@ const submitForm = async () => {
if (logId) {
message.success('提交发送成功!发送结果,见发送日志编号:' + logId)
}
modelVisible.value = false
dialogVisible.value = false
} finally {
formLoading.value = false
}