邮箱账号,增加详情弹窗

This commit is contained in:
YunaiV 2023-04-05 20:45:19 +08:00
parent 37ffc2bf37
commit 06e1e27652
3 changed files with 49 additions and 2 deletions

View File

@ -0,0 +1,26 @@
<template>
<Dialog title="详情" v-model="dialogVisible">
<Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
</Dialog>
</template>
<script setup lang="ts">
import * as MailAccountApi from '@/api/system/mail/account'
import { allSchemas } from './account.data'
const dialogVisible = ref(false) //
const detailLoading = ref(false) //
const detailData = ref() //
/** 打开弹窗 */
const open = async (id: number) => {
dialogVisible.value = true
//
detailLoading.value = true
try {
detailData.value = await MailAccountApi.getMailAccount(id)
} finally {
detailLoading.value = false
}
}
defineExpose({ open }) // open
</script>

View File

@ -61,12 +61,16 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
isForm: false, isForm: false,
formatter: dateFormatter formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
}
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false isForm: false,
isDetail: false
} }
]) ])
export const { allSchemas } = useCrudSchemas(crudSchemas) export const { allSchemas } = useCrudSchemas(crudSchemas)

View File

@ -39,6 +39,14 @@
> >
编辑 编辑
</el-button> </el-button>
<el-button
link
type="primary"
@click="openDetail(row.id)"
v-hasPermi="['system:mail-account:query']"
>
详情
</el-button>
<el-button <el-button
link link
type="danger" type="danger"
@ -53,11 +61,14 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<MailAccountForm ref="formRef" @success="getList" /> <MailAccountForm ref="formRef" @success="getList" />
<!-- 详情弹窗 -->
<MailAccountDetail ref="detailRef" />
</template> </template>
<script setup lang="ts" name="MailAccount"> <script setup lang="ts" name="MailAccount">
import { allSchemas } from './account.data' import { allSchemas } from './account.data'
import * as MailAccountApi from '@/api/system/mail/account' import * as MailAccountApi from '@/api/system/mail/account'
import MailAccountForm from './MailAccountForm.vue' import MailAccountForm from './MailAccountForm.vue'
import MailAccountDetail from './MailAccountDetail.vue'
// tableObject // tableObject
// tableMethods // tableMethods
@ -75,6 +86,12 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id) formRef.value.open(type, id)
} }
/** 详情操作 */
const detailRef = ref()
const openDetail = (id: number) => {
detailRef.value.open(id)
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = (id: number) => { const handleDelete = (id: number) => {
tableMethods.delList(id, false) tableMethods.delList(id, false)