File tree Expand file tree Collapse file tree 3 files changed +49
-2
lines changed
src/views/system/mail/account Expand file tree Collapse file tree 3 files changed +49
-2
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <Dialog title =" 详情" v-model =" dialogVisible" >
3
+ <Descriptions :schema =" allSchemas.detailSchema" :data =" detailData" />
4
+ </Dialog >
5
+ </template >
6
+ <script setup lang="ts">
7
+ import * as MailAccountApi from ' @/api/system/mail/account'
8
+ import { allSchemas } from ' ./account.data'
9
+
10
+ const dialogVisible = ref (false ) // 弹窗的是否展示
11
+ const detailLoading = ref (false ) // 表单的加载中
12
+ const detailData = ref () // 详情数据
13
+
14
+ /** 打开弹窗 */
15
+ const open = async (id : number ) => {
16
+ dialogVisible .value = true
17
+ // 设置数据
18
+ detailLoading .value = true
19
+ try {
20
+ detailData .value = await MailAccountApi .getMailAccount (id )
21
+ } finally {
22
+ detailLoading .value = false
23
+ }
24
+ }
25
+ defineExpose ({ open }) // 提供 open 方法,用于打开弹窗
26
+ </script >
Original file line number Diff line number Diff line change @@ -61,12 +61,16 @@ const crudSchemas = reactive<CrudSchema[]>([
61
61
label : '创建时间' ,
62
62
field : 'createTime' ,
63
63
isForm : false ,
64
- formatter : dateFormatter
64
+ formatter : dateFormatter ,
65
+ detail : {
66
+ dateFormat : 'YYYY-MM-DD HH:mm:ss'
67
+ }
65
68
} ,
66
69
{
67
70
label : '操作' ,
68
71
field : 'action' ,
69
- isForm : false
72
+ isForm : false ,
73
+ isDetail : false
70
74
}
71
75
] )
72
76
export const { allSchemas } = useCrudSchemas ( crudSchemas )
Original file line number Diff line number Diff line change 39
39
>
40
40
编辑
41
41
</el-button >
42
+ <el-button
43
+ link
44
+ type =" primary"
45
+ @click =" openDetail(row.id)"
46
+ v-hasPermi =" ['system:mail-account:query']"
47
+ >
48
+ 详情
49
+ </el-button >
42
50
<el-button
43
51
link
44
52
type =" danger"
53
61
54
62
<!-- 表单弹窗:添加/修改 -->
55
63
<MailAccountForm ref =" formRef" @success =" getList" />
64
+ <!-- 详情弹窗 -->
65
+ <MailAccountDetail ref =" detailRef" />
56
66
</template >
57
67
<script setup lang="ts" name="MailAccount">
58
68
import { allSchemas } from ' ./account.data'
59
69
import * as MailAccountApi from ' @/api/system/mail/account'
60
70
import MailAccountForm from ' ./MailAccountForm.vue'
71
+ import MailAccountDetail from ' ./MailAccountDetail.vue'
61
72
62
73
// tableObject:表格的属性对象,可获得分页大小、条数等属性
63
74
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
@@ -75,6 +86,12 @@ const openForm = (type: string, id?: number) => {
75
86
formRef .value .open (type , id )
76
87
}
77
88
89
+ /** 详情操作 */
90
+ const detailRef = ref ()
91
+ const openDetail = (id : number ) => {
92
+ detailRef .value .open (id )
93
+ }
94
+
78
95
/** 删除按钮操作 */
79
96
const handleDelete = (id : number ) => {
80
97
tableMethods .delList (id , false )
You can’t perform that action at this time.
0 commit comments