Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0f4c74fe
authored
Mar 18, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vue3 重构:邮件日志的列表
parent
3c75d606
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
22 deletions
+49
-22
src/api/system/mail/log/index.ts
+2
-12
src/types/descriptions.d.ts
+2
-2
src/views/system/mail/log/detail.vue
+31
-0
src/views/system/mail/log/index.vue
+6
-6
src/views/system/mail/log/log.data.ts
+8
-2
No files found.
src/api/system/mail/log/index.ts
View file @
0f4c74fe
...
@@ -19,22 +19,12 @@ export interface MailLogVO {
...
@@ -19,22 +19,12 @@ export interface MailLogVO {
sendException
:
string
sendException
:
string
}
}
export
interface
MailLogPageReqVO
extends
PageParam
{
userId
?:
number
userType
?:
number
toMail
?:
string
accountId
?:
number
templateId
?:
number
sendStatus
?:
number
sendTime
?:
Date
[]
}
// 查询邮件日志列表
// 查询邮件日志列表
export
const
getMailLogPage
Api
=
async
(
params
:
MailLogPageReqVO
)
=>
{
export
const
getMailLogPage
=
async
(
params
:
PageParam
)
=>
{
return
await
request
.
get
({
url
:
'/system/mail-log/page'
,
params
})
return
await
request
.
get
({
url
:
'/system/mail-log/page'
,
params
})
}
}
// 查询邮件日志详情
// 查询邮件日志详情
export
const
getMailLog
Api
=
async
(
id
:
number
)
=>
{
export
const
getMailLog
=
async
(
id
:
number
)
=>
{
return
await
request
.
get
({
url
:
'/system/mail-log/get?id='
+
id
})
return
await
request
.
get
({
url
:
'/system/mail-log/get?id='
+
id
})
}
}
src/types/descriptions.d.ts
View file @
0f4c74fe
...
@@ -8,6 +8,6 @@ export interface DescriptionsSchema {
...
@@ -8,6 +8,6 @@ export interface DescriptionsSchema {
labelAlign
?:
'left'
|
'center'
|
'right'
labelAlign
?:
'left'
|
'center'
|
'right'
className
?:
string
className
?:
string
labelClassName
?:
string
labelClassName
?:
string
dateFormat
?:
string
dateFormat
?:
string
// add by 星语:支持时间的格式化
dictType
?:
string
dictType
?:
string
// add by 星语:支持 dict 字典数据
}
}
src/views/system/mail/log/detail.vue
0 → 100644
View file @
0f4c74fe
<
template
>
<Dialog
title=
"详情"
v-model=
"modelVisible"
:scroll=
"true"
:max-height=
"500"
>
<Descriptions
:schema=
"allSchemas.detailSchema"
:data=
"detailData"
>
<!-- 展示 HTML 内容 -->
<template
#
templateContent=
"
{ row }">
<div
v-html=
"row.templateContent"
></div>
</
template
>
</Descriptions>
</Dialog>
</template>
<
script
setup
lang=
"ts"
>
import
*
as
MailLogApi
from
'@/api/system/mail/log'
import
{
allSchemas
}
from
'./log.data'
const
modelVisible
=
ref
(
false
)
// 弹窗的是否展示
const
detailLoading
=
ref
(
false
)
// 表单的加载中
const
detailData
=
ref
()
// 详情数据
/** 打开弹窗 */
const
openModal
=
async
(
id
:
number
)
=>
{
modelVisible
.
value
=
true
// 设置数据
detailLoading
.
value
=
true
try
{
detailData
.
value
=
await
MailLogApi
.
getMailLog
(
id
)
}
finally
{
detailLoading
.
value
=
false
}
}
defineExpose
({
openModal
})
// 提供 openModal 方法,用于打开弹窗
</
script
>
src/views/system/mail/log/index.vue
View file @
0f4c74fe
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<el-button
<el-button
link
link
type=
"primary"
type=
"primary"
@
click=
"openModal(
'update',
row.id)"
@
click=
"openModal(row.id)"
v-hasPermi=
"['system:mail-log:query']"
v-hasPermi=
"['system:mail-log:query']"
>
>
详情
详情
...
@@ -30,26 +30,26 @@
...
@@ -30,26 +30,26 @@
</content-wrap>
</content-wrap>
<!-- 表单弹窗:添加/修改 -->
<!-- 表单弹窗:添加/修改 -->
<
!-- <mail-account-form ref="modalRef" @success="getList" />--
>
<
mail-log-detail
ref=
"modalRef"
@
success=
"getList"
/
>
</template>
</template>
<
script
setup
lang=
"ts"
name=
"MailLog"
>
<
script
setup
lang=
"ts"
name=
"MailLog"
>
import
{
allSchemas
}
from
'./log.data'
import
{
allSchemas
}
from
'./log.data'
import
*
as
MailLogApi
from
'@/api/system/mail/log'
import
*
as
MailLogApi
from
'@/api/system/mail/log'
// import MailAccountForm from './form
.vue'
import
MailLogDetail
from
'./detail
.vue'
// tableObject:表格的属性对象,可获得分页大小、条数等属性
// tableObject:表格的属性对象,可获得分页大小、条数等属性
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
// 详细可见:https://kailong110120130.gitee.io/vue-element-plus-admin-doc/components/table.html#usetable
// 详细可见:https://kailong110120130.gitee.io/vue-element-plus-admin-doc/components/table.html#usetable
const
{
tableObject
,
tableMethods
}
=
useTable
({
const
{
tableObject
,
tableMethods
}
=
useTable
({
getListApi
:
MailLogApi
.
getMailLogPage
Api
// 分页接口
getListApi
:
MailLogApi
.
getMailLogPage
// 分页接口
})
})
// 获得表格的各种操作
// 获得表格的各种操作
const
{
getList
,
setSearchParams
}
=
tableMethods
const
{
getList
,
setSearchParams
}
=
tableMethods
/** 添加/修改操作 */
/** 添加/修改操作 */
const
modalRef
=
ref
()
const
modalRef
=
ref
()
const
openModal
=
(
type
:
string
,
id
?
:
number
)
=>
{
const
openModal
=
(
id
:
number
)
=>
{
modalRef
.
value
.
openModal
(
type
,
id
)
modalRef
.
value
.
openModal
(
id
)
}
}
/** 初始化 **/
/** 初始化 **/
...
...
src/views/system/mail/log/log.data.ts
View file @
0f4c74fe
...
@@ -23,6 +23,9 @@ const crudSchemas = reactive<CrudSchema[]>([
...
@@ -23,6 +23,9 @@ const crudSchemas = reactive<CrudSchema[]>([
type
:
'daterange'
,
type
:
'daterange'
,
defaultTime
:
[
new
Date
(
'1 00:00:00'
),
new
Date
(
'1 23:59:59'
)]
defaultTime
:
[
new
Date
(
'1 00:00:00'
),
new
Date
(
'1 23:59:59'
)]
}
}
},
detail
:
{
dateFormat
:
'YYYY-MM-DD HH:mm:ss'
}
}
},
},
{
{
...
@@ -116,12 +119,15 @@ const crudSchemas = reactive<CrudSchema[]>([
...
@@ -116,12 +119,15 @@ const crudSchemas = reactive<CrudSchema[]>([
label
:
'创建时间'
,
label
:
'创建时间'
,
field
:
'createTime'
,
field
:
'createTime'
,
isTable
:
false
,
isTable
:
false
,
formatter
:
dateFormatter
formatter
:
dateFormatter
,
detail
:
{
dateFormat
:
'YYYY-MM-DD HH:mm:ss'
}
},
},
{
{
label
:
'操作'
,
label
:
'操作'
,
field
:
'action'
,
field
:
'action'
,
is
Form
:
false
is
Detail
:
false
}
}
])
])
export
const
{
allSchemas
}
=
useCrudSchemas
(
crudSchemas
)
export
const
{
allSchemas
}
=
useCrudSchemas
(
crudSchemas
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment