|
|
@@ -126,6 +126,10 @@ const handleFocusEditor = () => {
|
|
|
editorRef.value.focus()
|
|
|
}
|
|
|
|
|
|
+const emit = defineEmits<{
|
|
|
+ sendEmailSuccess: []
|
|
|
+}>()
|
|
|
+
|
|
|
const sendEmail = () => {
|
|
|
const html = editorRef.value.getHtml()
|
|
|
const text = editorRef.value.getText()
|
|
|
@@ -141,6 +145,7 @@ const sendEmail = () => {
|
|
|
if (res.code === 200) {
|
|
|
ElMessage.success('Email sent successfully')
|
|
|
emailRecords.value = res.data.emailRecords
|
|
|
+ emit('sendEmailSuccess')
|
|
|
}
|
|
|
})
|
|
|
.catch((err: any) => {
|
|
|
@@ -148,13 +153,24 @@ const sendEmail = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const clearData = () => {
|
|
|
+ valueHtml.value = ''
|
|
|
+}
|
|
|
+
|
|
|
defineExpose({
|
|
|
openDrawer
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <el-drawer v-model="drawer" :modal="false" :size="1000" title="Communication" direction="rtl">
|
|
|
+ <el-drawer
|
|
|
+ v-model="drawer"
|
|
|
+ @close="clearData"
|
|
|
+ :modal="false"
|
|
|
+ :size="1000"
|
|
|
+ title="Communication"
|
|
|
+ direction="rtl"
|
|
|
+ >
|
|
|
<div class="email-view">
|
|
|
<div class="email-path">
|
|
|
<span class="font_family icon-icon_email_b" style="font-size: 18px"></span>
|
|
|
@@ -202,7 +218,10 @@ defineExpose({
|
|
|
/>
|
|
|
</div>
|
|
|
<div style="border-bottom: 1px solid var(--color-border)">
|
|
|
- <el-button class="el-button--dark" style="float: right; margin: 8px 0 14px 0; height: 40px"
|
|
|
+ <el-button
|
|
|
+ @click="sendEmail"
|
|
|
+ class="el-button--dark"
|
|
|
+ style="float: right; margin: 8px 0 14px 0; height: 40px"
|
|
|
><span class="font_family icon-icon_submit_b" style="margin-right: 4px"></span> Send
|
|
|
Email</el-button
|
|
|
>
|