File tree Expand file tree Collapse file tree 5 files changed +49
-22
lines changed Expand file tree Collapse file tree 5 files changed +49
-22
lines changed Original file line number Diff line number Diff line change @@ -19,22 +19,12 @@ export interface MailLogVO {
19
19
sendException : string
20
20
}
21
21
22
- export interface MailLogPageReqVO extends PageParam {
23
- userId ?: number
24
- userType ?: number
25
- toMail ?: string
26
- accountId ?: number
27
- templateId ?: number
28
- sendStatus ?: number
29
- sendTime ?: Date [ ]
30
- }
31
-
32
22
// 查询邮件日志列表
33
- export const getMailLogPageApi = async ( params : MailLogPageReqVO ) => {
23
+ export const getMailLogPage = async ( params : PageParam ) => {
34
24
return await request . get ( { url : '/system/mail-log/page' , params } )
35
25
}
36
26
37
27
// 查询邮件日志详情
38
- export const getMailLogApi = async ( id : number ) => {
28
+ export const getMailLog = async ( id : number ) => {
39
29
return await request . get ( { url : '/system/mail-log/get?id=' + id } )
40
30
}
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ export interface DescriptionsSchema {
8
8
labelAlign ?: 'left' | 'center' | 'right'
9
9
className ?: string
10
10
labelClassName ?: string
11
- dateFormat ?: string
12
- dictType ?: string
11
+ dateFormat ?: string // add by 星语:支持时间的格式化
12
+ dictType ?: string // add by 星语:支持 dict 字典数据
13
13
}
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <Dialog title =" 详情" v-model =" modelVisible" :scroll =" true" :max-height =" 500" >
3
+ <Descriptions :schema =" allSchemas.detailSchema" :data =" detailData" >
4
+ <!-- 展示 HTML 内容 -->
5
+ <template #templateContent =" { row } " >
6
+ <div v-html =" row.templateContent" ></div >
7
+ </template >
8
+ </Descriptions >
9
+ </Dialog >
10
+ </template >
11
+ <script setup lang="ts">
12
+ import * as MailLogApi from ' @/api/system/mail/log'
13
+ import { allSchemas } from ' ./log.data'
14
+
15
+ const modelVisible = ref (false ) // 弹窗的是否展示
16
+ const detailLoading = ref (false ) // 表单的加载中
17
+ const detailData = ref () // 详情数据
18
+
19
+ /** 打开弹窗 */
20
+ const openModal = async (id : number ) => {
21
+ modelVisible .value = true
22
+ // 设置数据
23
+ detailLoading .value = true
24
+ try {
25
+ detailData .value = await MailLogApi .getMailLog (id )
26
+ } finally {
27
+ detailLoading .value = false
28
+ }
29
+ }
30
+ defineExpose ({ openModal }) // 提供 openModal 方法,用于打开弹窗
31
+ </script >
Original file line number Diff line number Diff line change 20
20
<el-button
21
21
link
22
22
type =" primary"
23
- @click =" openModal('update', row.id)"
23
+ @click =" openModal(row.id)"
24
24
v-hasPermi =" ['system:mail-log:query']"
25
25
>
26
26
详情
30
30
</content-wrap >
31
31
32
32
<!-- 表单弹窗:添加/修改 -->
33
- <!-- < mail-account-form ref="modalRef" @success="getList" /> -- >
33
+ <mail-log-detail ref =" modalRef" @success =" getList" />
34
34
</template >
35
35
<script setup lang="ts" name="MailLog">
36
36
import { allSchemas } from ' ./log.data'
37
37
import * as MailLogApi from ' @/api/system/mail/log'
38
- // import MailAccountForm from './form .vue'
38
+ import MailLogDetail from ' ./detail .vue'
39
39
40
40
// tableObject:表格的属性对象,可获得分页大小、条数等属性
41
41
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
42
42
// 详细可见:https://kailong110120130.gitee.io/vue-element-plus-admin-doc/components/table.html#usetable
43
43
const { tableObject, tableMethods } = useTable ({
44
- getListApi: MailLogApi .getMailLogPageApi // 分页接口
44
+ getListApi: MailLogApi .getMailLogPage // 分页接口
45
45
})
46
46
// 获得表格的各种操作
47
47
const { getList, setSearchParams } = tableMethods
48
48
49
49
/** 添加/修改操作 */
50
50
const modalRef = ref ()
51
- const openModal = (type : string , id ? : number ) => {
52
- modalRef .value .openModal (type , id )
51
+ const openModal = (id : number ) => {
52
+ modalRef .value .openModal (id )
53
53
}
54
54
55
55
/** 初始化 **/
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ const crudSchemas = reactive<CrudSchema[]>([
23
23
type : 'daterange' ,
24
24
defaultTime : [ new Date ( '1 00:00:00' ) , new Date ( '1 23:59:59' ) ]
25
25
}
26
+ } ,
27
+ detail : {
28
+ dateFormat : 'YYYY-MM-DD HH:mm:ss'
26
29
}
27
30
} ,
28
31
{
@@ -116,12 +119,15 @@ const crudSchemas = reactive<CrudSchema[]>([
116
119
label : '创建时间' ,
117
120
field : 'createTime' ,
118
121
isTable : false ,
119
- formatter : dateFormatter
122
+ formatter : dateFormatter ,
123
+ detail : {
124
+ dateFormat : 'YYYY-MM-DD HH:mm:ss'
125
+ }
120
126
} ,
121
127
{
122
128
label : '操作' ,
123
129
field : 'action' ,
124
- isForm : false
130
+ isDetail : false
125
131
}
126
132
] )
127
133
export const { allSchemas } = useCrudSchemas ( crudSchemas )
You can’t perform that action at this time.
0 commit comments