Vue3 重构:基本完善完 邮件账号 的重构

This commit is contained in:
YunaiV 2023-03-17 23:24:21 +08:00
parent a784bc7db2
commit e42a9aa60c
3 changed files with 8 additions and 9 deletions

View File

@ -23,7 +23,7 @@ export const rules = reactive({
sslEnable: [required] sslEnable: [required]
}) })
// CrudSchema // CrudSchemahttps://kailong110120130.gitee.io/vue-element-plus-admin-doc/hooks/useCrudSchemas.html
const crudSchemas = reactive<CrudSchema[]>([ const crudSchemas = reactive<CrudSchema[]>([
{ {
label: '邮箱', label: '邮箱',

View File

@ -1,7 +1,6 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="modelTitle" v-model="modelVisible">
<!-- TODO 芋艿loading --> <Form ref="formRef" :schema="allSchemas.formSchema" :rules="rules" v-loading="formLoading" />
<Form ref="formRef" :schema="allSchemas.formSchema" :rules="rules" :isCol="false" />
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button> <el-button @click="modelVisible = false"> </el-button>
@ -12,7 +11,6 @@
import * as MailAccountApi from '@/api/system/mail/account' import * as MailAccountApi from '@/api/system/mail/account'
import { rules, allSchemas } from './account.data' import { rules, allSchemas } from './account.data'
const formRef = ref() // Ref
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -20,6 +18,7 @@ const modelVisible = ref(false) // 弹窗的是否展示
const modelTitle = ref('') // const modelTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formRef = ref() // Ref
/** 打开弹窗 */ /** 打开弹窗 */
const openModal = async (type: string, id?: number) => { const openModal = async (type: string, id?: number) => {

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <content-wrap>
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams"> <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams">
<!-- 新增等操作按钮 --> <!-- 新增等操作按钮 -->
<template #actionMore> <template #actionMore>
@ -13,10 +13,10 @@
</el-button> </el-button>
</template> </template>
</Search> </Search>
</ContentWrap> </content-wrap>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <content-wrap>
<Table <Table
:columns="allSchemas.tableColumns" :columns="allSchemas.tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
@ -46,10 +46,10 @@
</el-button> </el-button>
</template> </template>
</Table> </Table>
</ContentWrap> </content-wrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<MailAccountForm ref="modalRef" @success="getList" /> <mail-account-form ref="modalRef" @success="getList" />
</template> </template>
<script setup lang="ts" name="MailAccount"> <script setup lang="ts" name="MailAccount">
import { allSchemas } from './account.data' import { allSchemas } from './account.data'