Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
frontend-yd-email
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
frontend-yd-email
Commits
19046586
Commit
19046586
authored
Sep 26, 2025
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调通发邮件
parent
70b9e0d4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
98 additions
and
63 deletions
+98
-63
src/api/api.ts
+24
-0
src/types/index.ts
+47
-32
src/utils/fileUpload.ts
+0
-0
src/utils/request.ts
+1
-1
src/views/ComposeEmail.vue
+0
-0
src/views/ContactSelector.vue
+1
-7
src/views/EmailManagement.vue
+24
-22
src/views/ImportRecordManager.vue
+0
-0
src/views/SenderManagement.vue
+1
-1
No files found.
src/api/api.ts
View file @
19046586
...
...
@@ -7,6 +7,8 @@ import type {
Sender
,
Variable
,
VariableTemplate
,
SubTask
,
EmailTask
,
}
from
'@/types/index'
import
type
{
ApiResponse
}
from
'@/utils/request'
...
...
@@ -129,6 +131,10 @@ export const importContactApi = {
getEmailContactImportList
:
(
params
:
EditContactImport
):
Promise
<
ApiResponse
>
=>
{
return
request
.
post
(
'/emailContactImport/page'
,
params
)
},
// 详情会话信息前端展示收件人,抄送人
getEmailContactImportDetail
:
(
id
:
string
):
Promise
<
ApiResponse
>
=>
{
return
request
.
get
(
'/emailContactImport/detail/sessionId?sessionId='
+
id
)
},
}
/**
* 发送邮件
...
...
@@ -142,4 +148,22 @@ export const sendEmailApi = {
testSendEmail
:
(
data
:
SendEmail
):
Promise
<
ApiResponse
>
=>
{
return
request
.
post
(
'/email/test/send'
,
data
)
},
// 发送任务列表查询
getEmailTaskList
:
(
params
:
SubTask
):
Promise
<
ApiResponse
>
=>
{
return
request
.
post
(
'/emailTaskRecipients/page'
,
params
)
},
// 主线任务列表查询
getEmailTaskMainList
:
(
params
:
EmailTask
):
Promise
<
ApiResponse
>
=>
{
return
request
.
post
(
'/emailTask/page'
,
params
)
},
}
/**
* 文件服务接口
*/
export
const
uploadApi
=
{
// 上传文件
uploadFile
:
(
data
:
FormData
):
Promise
<
ApiResponse
>
=>
{
return
request
.
post
(
'/oss/upload'
,
data
)
},
}
src/types/index.ts
View file @
19046586
...
...
@@ -9,7 +9,7 @@ export interface Pagination<T> {
}
// 联系人类型
export
interface
Contact
extends
Pagination
<
Contact
>
{
export
interface
Contact
<
T
>
extends
Pagination
<
Contact
>
{
contactBizId
?:
string
name
?:
string
type
?:
string
...
...
@@ -50,29 +50,6 @@ export interface VariableTemplate extends Pagination<VariableTemplate> {
variableNameEns
?:
string
[]
}
// 邮件类型
export
interface
Email
extends
Pagination
<
Email
>
{
id
?:
string
sender
?:
string
to
?:
string
[]
cc
?:
string
[]
subject
?:
string
content
?:
string
sendTime
?:
string
status
?:
'sent'
|
'scheduled'
|
'draft'
|
'failed'
attachments
?:
{
name
:
string
}[]
}
// 邮件表单类型
export
interface
EmailForm
extends
Pagination
<
EmailForm
>
{
to
:
string
cc
:
string
subject
:
string
content
:
string
scheduleSend
:
boolean
sendTime
:
string
}
// 忘记密码表单类型
export
interface
ForgotPasswordForm
{
email
:
string
...
...
@@ -81,18 +58,16 @@ export interface ForgotPasswordForm {
}
// 导入记录类型
export
interface
ImportRecord
{
id
:
string
to
:
string
cc
:
string
createdAt
:
string
updatedAt
:
string
export
interface
ImportRecord
extends
Contact
<
ImportRecord
>
{
sessionId
?:
string
receiveEmailList
?:
string
[]
ccEmailList
?:
string
[]
}
// 选择联系人时,调用接口,获取sessionId
export
interface
ContactSessionId
{
sessionId
?:
string
apiEmailContactDtoList
?:
Contact
[]
apiEmailContactDtoList
?:
Contact
<
unknown
>
[]
}
// 编辑-邮件联系人导入信息
...
...
@@ -104,11 +79,32 @@ export interface EditContactImport extends Pagination<EditContactImport> {
// 发送邮件
export
interface
SendEmail
{
senderBizId
?:
string
sendEmail
?:
string
subject
?:
string
content
?:
string
scheduleTime
?:
string
attachmentPath
?:
string
variableGroupBizId
?:
string
sessionId
?:
string
recipientEmailList
?:
string
[]
ccEmailList
?:
string
[]
bccEmailList
?:
string
[]
receiveEmailList
?:
string
[]
}
export
interface
EmailForm
{
senderBizId
?:
string
sendEmail
?:
string
variableGroupBizId
?:
string
receiveEmail
?:
string
ccEmailList
?:
string
[]
subject
?:
string
body
?:
string
content
?:
string
attachmentPath
?:
string
sessionId
?:
string
ccEmails
?:
string
scheduleSend
?:
boolean
scheduleTime
?:
string
}
//邮件服务商类型
export
interface
EmailProvider
extends
Pagination
<
EmailProvider
>
{
...
...
@@ -120,3 +116,22 @@ export interface EmailProvider extends Pagination<EmailProvider> {
active
?:
number
description
?:
string
}
// 发送任务列表查询参数
export
interface
SubTask
extends
Pagination
<
SubTask
>
{
taskBizId
?:
string
receiveEmail
?:
string
status
?:
string
}
// 主线任务列表查询参数
export
interface
EmailTask
extends
Pagination
<
EmailTask
>
{
queryContent
?:
string
status
?:
string
taskBizId
?:
string
taskName
?:
string
senderBizId
?:
string
sendEmail
?:
string
receiveEmails
?:
string
subject
?:
string
scheduleTime
?:
string
sendTime
?:
string
}
src/utils/fileUpload.ts
0 → 100644
View file @
19046586
src/utils/request.ts
View file @
19046586
...
...
@@ -17,7 +17,7 @@ const request = axios.create({
'Content-Type'
:
'application/json'
,
// Authorization: 'Bearer ' + localStorage.getItem('authToken'),
Authorization
:
'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ1c2VyXzEwMDEiLCJyb2xlcyI6W10sImlhdCI6MTc1OD
c4NTY3NCwiZXhwIjoxNzU4ODcyMDc0fQ.tjTO6vdpwLpNjVa1DhxRBdpjZsdhbx6g1TdtpAm7BZBRMwanM_ci7dsnbc8FNXpyfSb-ifXW7ccxwyQbtCaKiQ
'
,
'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ1c2VyXzEwMDEiLCJyb2xlcyI6W10sImlhdCI6MTc1OD
g3MjMyOSwiZXhwIjoxNzU4OTU4NzI5fQ.McyflIoI_ltve_uy2-mZTjOfxYfBGNMEuOoIVfeEtXdAuoycggGErq8yU3mc15npsIWJy2a8zJ5cNpx_NVtGIw
'
,
},
})
...
...
src/views/ComposeEmail.vue
View file @
19046586
This diff is collapsed.
Click to expand it.
src/views/ContactSelector.vue
View file @
19046586
...
...
@@ -99,12 +99,6 @@ const confirmSelection = () => {
const
selected
=
props
.
contacts
.
filter
((
contact
)
=>
selectedContacts
.
value
.
includes
(
contact
.
contactBizId
||
''
),
)
const
to
=
selected
.
map
((
contact
)
=>
contact
.
email
).
join
(
','
)
const
cc
=
selected
.
map
((
contact
)
=>
contact
.
ccEmailList
?.
join
(
','
)
||
''
)
.
filter
((
email
)
=>
email
)
.
join
(
','
)
emits
(
'confirm-selection'
,
{
to
,
cc
})
emits
(
'confirm-selection'
,
selected
)
}
</
script
>
src/views/EmailManagement.vue
View file @
19046586
...
...
@@ -65,9 +65,9 @@
</tr>
</thead>
<tbody
class=
"bg-white divide-y divide-gray-200"
>
<tr
v-for=
"email in
filteredEmails"
:key=
"email.i
d"
>
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{
email
.
send
er
}}
</td>
<td
class=
"px-6 py-4 whitespace-nowrap max-w-xs truncate"
>
{{
email
.
to
}}
</td>
<tr
v-for=
"email in
emails"
:key=
"email.taskBizI
d"
>
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{
email
.
send
Email
}}
</td>
<td
class=
"px-6 py-4 whitespace-nowrap max-w-xs truncate"
>
{{
email
.
receiveEmails
}}
</td>
<td
class=
"px-6 py-4 max-w-xs truncate"
>
{{
email
.
subject
}}
</td>
<td
class=
"px-6 py-4 whitespace-nowrap text-sm text-gray-500"
>
{{
formatDate
(
email
.
sendTime
)
}}
...
...
@@ -111,7 +111,7 @@
</tbody>
</table>
</div>
<div
v-if=
"
filteredE
mails.length === 0"
class=
"p-8 text-center text-gray-500"
>
<div
v-if=
"
e
mails.length === 0"
class=
"p-8 text-center text-gray-500"
>
<i
class=
"fas fa-history text-4xl mb-3 opacity-30"
></i>
<p>
暂无邮件发送记录
</p>
</div>
...
...
@@ -119,27 +119,17 @@
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
,
defineProps
,
defineEmits
}
from
'vue'
import
type
{
Email
}
from
'@/types/index'
import
{
ref
,
computed
,
onMounted
}
from
'vue'
import
type
{
EmailTask
}
from
'@/types/index'
import
{
sendEmailApi
}
from
'@/api/api'
// 状态
const
emails
=
ref
<
Email
[]
>
([])
const
emails
=
ref
<
Email
Task
[]
>
([])
const
searchTerm
=
ref
(
''
)
const
filterStatus
=
ref
(
''
)
// 计算属性
const
filteredEmails
=
computed
(()
=>
{
return
emails
.
value
.
filter
((
email
)
=>
{
const
matchesSearch
=
email
.
subject
.
toLowerCase
().
includes
(
searchTerm
.
value
.
toLowerCase
())
||
email
.
to
.
toLowerCase
().
includes
(
searchTerm
.
value
.
toLowerCase
())
const
matchesStatus
=
!
filterStatus
.
value
||
email
.
status
===
filterStatus
.
value
return
matchesSearch
&&
matchesStatus
})
.
sort
((
a
,
b
)
=>
new
Date
(
b
.
sendTime
).
getTime
()
-
new
Date
(
a
.
sendTime
).
getTime
())
onMounted
(()
=>
{
getEmailTaskMainList
()
})
// 方法
...
...
@@ -148,7 +138,7 @@ const formatDate = (dateString: string) => {
return
date
.
toLocaleString
()
}
const
viewEmailDetail
=
(
email
:
Email
)
=>
{
const
viewEmailDetail
=
(
email
:
Email
Task
)
=>
{
// 显示邮件详情
alert
(
`邮件主题:
${
email
.
subject
||
'无'
}
\n收件人:
${
email
.
to
||
'无'
}
\n发送时间:
${
formatDate
(
email
.
sendTime
||
''
)}
`
,
...
...
@@ -156,7 +146,19 @@ const viewEmailDetail = (email: Email) => {
// 实际项目中可以打开详情弹窗
}
const
reuseEmailContent
=
(
email
:
Email
)
=>
{
const
reuseEmailContent
=
(
email
:
Email
Task
)
=>
{
// 触发复用邮件内容事件
}
// 发送任务列表查询
const
getEmailTaskMainList
=
async
()
=>
{
const
params
:
EmailTask
=
{
pageNum
:
1
,
pageSize
:
100
,
}
const
res
=
await
sendEmailApi
.
getEmailTaskMainList
(
params
)
if
(
res
.
code
===
200
)
{
emails
.
value
=
res
.
data
.
records
||
[]
}
}
</
script
>
src/views/ImportRecordManager.vue
View file @
19046586
This diff is collapsed.
Click to expand it.
src/views/SenderManagement.vue
View file @
19046586
...
...
@@ -148,7 +148,7 @@
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
defineProps
,
defineEmits
,
onMounted
}
from
'vue'
import
{
ref
,
onMounted
}
from
'vue'
import
{
emailProviderApi
,
senderApi
,
getEmailSenderConfigList
}
from
'@/api/api'
import
type
{
Sender
}
from
'@/types/index'
// 引入弹窗组件
...
...
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