713 lines
21 KiB
Vue
713 lines
21 KiB
Vue
<template>
|
||
<div class="batch-email-container">
|
||
<div class="batch-email-card">
|
||
<div class="table-toolbar">
|
||
<div class="toolbar-left">
|
||
<a-space :size="8" wrap>
|
||
<a-button type="primary" class="toolbar-btn" @click="triggerImport">
|
||
{{ t('system.batchEmail.import') }}
|
||
</a-button>
|
||
<span class="toolbar-label">{{ t('system.batchEmail.template') }}</span>
|
||
<a-select
|
||
v-model="selectedTemplateName"
|
||
:style="{ width: '280px' }"
|
||
:placeholder="t('system.batchEmail.selectTemplate')"
|
||
allow-clear
|
||
@change="onTemplateChange"
|
||
>
|
||
<a-option v-for="name in templateNames" :key="name" :value="name">{{ name }}</a-option>
|
||
</a-select>
|
||
</a-space>
|
||
</div>
|
||
<div class="toolbar-right">
|
||
<a-button
|
||
type="primary"
|
||
class="toolbar-btn"
|
||
:loading="sending"
|
||
:disabled="sending"
|
||
@click="startBatchSend"
|
||
>
|
||
{{ t('system.batchEmail.send') }}
|
||
</a-button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="section-block">
|
||
<div class="section-title">{{ t('system.batchEmail.log') }}</div>
|
||
<a-textarea
|
||
v-model="logText"
|
||
:auto-size="{ minRows: 12, maxRows: 20 }"
|
||
readonly
|
||
class="log-textarea"
|
||
/>
|
||
</div>
|
||
|
||
<div class="section-block">
|
||
<div class="section-title">{{ t('system.batchEmail.preview') }}</div>
|
||
<div class="preview-toolbar">
|
||
<a-space :size="8" wrap>
|
||
<a-button class="toolbar-btn" @click="openSaveTemplateModal">{{ t('system.batchEmail.saveTpl') }}</a-button>
|
||
<a-button class="toolbar-btn" status="danger" @click="deleteCurrentTemplate">
|
||
{{ t('system.batchEmail.deleteTpl') }}
|
||
</a-button>
|
||
<span class="hint-text">{{ t('system.batchEmail.placeholderHint') }}</span>
|
||
</a-space>
|
||
</div>
|
||
<div class="subject-row">
|
||
<span class="subject-label">{{ t('system.batchEmail.subject') }}</span>
|
||
<a-input v-model="subjectDraft" :placeholder="t('system.batchEmail.subjectPlaceholder')" class="subject-input" />
|
||
</div>
|
||
<a-textarea
|
||
v-model="contentDraft"
|
||
:auto-size="{ minRows: 8, maxRows: 16 }"
|
||
:placeholder="t('system.batchEmail.contentPlaceholder')"
|
||
class="content-textarea"
|
||
/>
|
||
</div>
|
||
|
||
<div class="section-block section-config">
|
||
<div class="section-title">{{ t('system.batchEmail.emailConfig') }}</div>
|
||
<div class="config-row">
|
||
<a-space :size="8" wrap align="center">
|
||
<span class="config-label">{{ t('system.batchEmail.account') }}</span>
|
||
<a-input v-model="accountUsername" :style="{ width: '240px' }" allow-clear />
|
||
<span class="config-label">{{ t('system.batchEmail.password') }}</span>
|
||
<a-input-password v-model="accountPassword" :style="{ width: '240px' }" allow-clear />
|
||
<span class="config-label">{{ t('system.batchEmail.serverType') }}</span>
|
||
<a-select v-model="serverType" :style="{ width: '200px' }">
|
||
<a-option value="qiye">{{ t('system.batchEmail.server.qiye') }}</a-option>
|
||
<a-option value="qiye_ssl">{{ t('system.batchEmail.server.qiyeSsl') }}</a-option>
|
||
<a-option value="aliyun">{{ t('system.batchEmail.server.aliyun') }}</a-option>
|
||
<a-option value="aliyun_ssl">{{ t('system.batchEmail.server.aliyunSsl') }}</a-option>
|
||
<a-option value="mxhichina">{{ t('system.batchEmail.server.mxhichina') }}</a-option>
|
||
</a-select>
|
||
<a-button class="toolbar-btn" @click="saveAccountConfig">{{ t('system.batchEmail.saveConfig') }}</a-button>
|
||
<a-button class="toolbar-btn" :loading="testing" @click="testConnection">
|
||
{{ t('system.batchEmail.testConnection') }}
|
||
</a-button>
|
||
</a-space>
|
||
</div>
|
||
</div>
|
||
|
||
<input
|
||
ref="fileInputRef"
|
||
type="file"
|
||
accept=".xlsx,.xls"
|
||
class="file-input-hidden"
|
||
aria-hidden="true"
|
||
@change="onExcelSelected"
|
||
/>
|
||
</div>
|
||
|
||
<a-modal
|
||
v-model:visible="saveTplModalVisible"
|
||
:title="t('system.batchEmail.saveTplModalTitle')"
|
||
:ok-loading="saveTplLoading"
|
||
@before-ok="onBeforeSaveTemplateOk"
|
||
>
|
||
<a-input v-model="newTemplateName" :placeholder="t('system.batchEmail.saveTplNamePlaceholder')" />
|
||
</a-modal>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
defineOptions({ name: 'SystemBatchEmail' })
|
||
import { computed, onMounted, ref } from 'vue'
|
||
import { useI18n } from 'vue-i18n'
|
||
import * as XLSX from 'xlsx'
|
||
import dayjs from 'dayjs'
|
||
import { Message, Modal } from '@arco-design/web-vue'
|
||
import {
|
||
testBatchEmailConnection,
|
||
sendBatchEmailOne,
|
||
type BatchEmailServerType,
|
||
} from '@/api/system/batchEmail'
|
||
|
||
const { t } = useI18n()
|
||
|
||
const LS_TEMPLATES = 'oms_batch_email_templates_v1'
|
||
const LS_ACCOUNTS = 'oms_batch_email_accounts_v1'
|
||
|
||
interface OrderRow {
|
||
客户单号: string
|
||
最新轨迹: string
|
||
换单号: string
|
||
寄件人邮箱: string
|
||
}
|
||
|
||
interface TemplateData {
|
||
content: string
|
||
subject: string
|
||
}
|
||
|
||
const DEFAULT_TEMPLATE_NAME = '默认模板'
|
||
const DEFAULT_TEMPLATE: TemplateData = {
|
||
subject: '订单通知 - {客户单号}',
|
||
content: `尊敬的客户:您好!
|
||
|
||
感谢您选择阿里巴巴及我们的物流服务,衷心感谢您的信任与支持!
|
||
|
||
|
||
|
||
您的订单{客户单号},最新物流轨迹显示:{最新轨迹}。为避免包裹滞留或退回,烦请您及时联系收件人核实以下信息:
|
||
|
||
|
||
|
||
1.收件地址是否准确、完整(含邮编、门牌号等);
|
||
|
||
2.收件人联系方式是否畅通;
|
||
|
||
3.是否需协调二次派送时间。
|
||
|
||
|
||
|
||
后续如有物流疑问,可随时通过平台客服联系我们,我们将全力协助处理!
|
||
|
||
顺祝商祺!
|
||
|
||
|
||
|
||
Alibaba.com Logistics
|
||
|
||
一代国际深圳仓客户服务中心`,
|
||
}
|
||
|
||
const fileInputRef = ref<HTMLInputElement | null>(null)
|
||
const logText = ref('')
|
||
const orderData = ref<OrderRow[]>([])
|
||
const templates = ref<Record<string, TemplateData>>({})
|
||
const selectedTemplateName = ref<string>('')
|
||
const contentDraft = ref('')
|
||
const subjectDraft = ref('')
|
||
const accountUsername = ref('')
|
||
const accountPassword = ref('')
|
||
const serverType = ref<BatchEmailServerType>('qiye')
|
||
const sending = ref(false)
|
||
const testing = ref(false)
|
||
|
||
const saveTplModalVisible = ref(false)
|
||
const newTemplateName = ref('')
|
||
const saveTplLoading = ref(false)
|
||
|
||
const templateNames = computed(() => Object.keys(templates.value))
|
||
|
||
function appendLog(message: string) {
|
||
const line = `[${dayjs().format('YYYY-MM-DD HH:mm:ss')}] ${message}\n`
|
||
logText.value += line
|
||
}
|
||
|
||
function loadTemplates(): Record<string, TemplateData> {
|
||
try {
|
||
const raw = localStorage.getItem(LS_TEMPLATES)
|
||
if (!raw) return {}
|
||
const data = JSON.parse(raw) as { templates?: Record<string, TemplateData | string> }
|
||
const rawMap = data.templates ?? {}
|
||
const out: Record<string, TemplateData> = {}
|
||
Object.entries(rawMap).forEach(([name, v]) => {
|
||
if (typeof v === 'string') {
|
||
out[name] = { content: v, subject: name }
|
||
} else {
|
||
out[name] = {
|
||
content: v?.content ?? '',
|
||
subject: v?.subject ?? name,
|
||
}
|
||
}
|
||
})
|
||
return out
|
||
} catch {
|
||
return {}
|
||
}
|
||
}
|
||
|
||
function persistTemplates() {
|
||
localStorage.setItem(LS_TEMPLATES, JSON.stringify({ templates: templates.value }))
|
||
}
|
||
|
||
function loadAccounts() {
|
||
try {
|
||
const raw = localStorage.getItem(LS_ACCOUNTS)
|
||
if (!raw) return
|
||
const data = JSON.parse(raw) as { accounts?: { username?: string; password?: string; serverType?: BatchEmailServerType }[] }
|
||
const list = data.accounts ?? []
|
||
if (list.length) {
|
||
const a = list[0]
|
||
accountUsername.value = a.username ?? ''
|
||
accountPassword.value = a.password ?? ''
|
||
if (a.serverType) serverType.value = a.serverType
|
||
}
|
||
} catch {
|
||
/* ignore */
|
||
}
|
||
}
|
||
|
||
function persistAccounts() {
|
||
localStorage.setItem(
|
||
LS_ACCOUNTS,
|
||
JSON.stringify({
|
||
accounts: [
|
||
{
|
||
username: accountUsername.value.trim(),
|
||
password: accountPassword.value,
|
||
serverType: serverType.value,
|
||
},
|
||
],
|
||
})
|
||
)
|
||
}
|
||
|
||
function ensureDefaultTemplate() {
|
||
if (Object.keys(templates.value).length === 0) {
|
||
templates.value = {
|
||
[DEFAULT_TEMPLATE_NAME]: { ...DEFAULT_TEMPLATE },
|
||
}
|
||
persistTemplates()
|
||
}
|
||
}
|
||
|
||
function applyTemplateByName(name: string | undefined, silent?: boolean) {
|
||
if (!name || !templates.value[name]) return
|
||
const tpl = templates.value[name]
|
||
contentDraft.value = tpl.content
|
||
subjectDraft.value = tpl.subject
|
||
if (!silent) {
|
||
appendLog(`${t('system.batchEmail.logSelectTemplate')}: ${name}`)
|
||
appendLog(t('system.batchEmail.logTemplateBodyShown'))
|
||
}
|
||
}
|
||
|
||
function onTemplateChange(name: string | undefined) {
|
||
applyTemplateByName(name, false)
|
||
}
|
||
|
||
function triggerImport() {
|
||
fileInputRef.value?.click()
|
||
}
|
||
|
||
function detectColumns(rows: Record<string, unknown>[]) {
|
||
if (!rows.length) return { orderIdCol: null as string | null, trackCol: null as string | null, emailCol: null as string | null, changeCol: null as string | null }
|
||
const cols = Object.keys(rows[0])
|
||
let orderIdCol: string | null = null
|
||
let trackCol: string | null = null
|
||
let emailCol: string | null = null
|
||
let changeCol: string | null = null
|
||
for (const col of cols) {
|
||
const lower = String(col).toLowerCase()
|
||
if (orderIdCol == null && (String(col).includes('单号') || String(col).includes('订单') || lower.includes('order'))) {
|
||
orderIdCol = col
|
||
}
|
||
}
|
||
for (const col of cols) {
|
||
const lower = String(col).toLowerCase()
|
||
if (trackCol == null && (String(col).includes('轨迹') || lower.includes('track') || String(col).includes('物流'))) {
|
||
trackCol = col
|
||
}
|
||
}
|
||
for (const col of cols) {
|
||
const lower = String(col).toLowerCase()
|
||
if (
|
||
emailCol == null &&
|
||
(String(col).includes('邮箱') || lower.includes('email') || lower.includes('mail') || String(col).includes('寄件人'))
|
||
) {
|
||
emailCol = col
|
||
}
|
||
}
|
||
for (const col of cols) {
|
||
if (String(col).trim() === '换单号') {
|
||
changeCol = col
|
||
break
|
||
}
|
||
}
|
||
return { orderIdCol, trackCol, emailCol, changeCol }
|
||
}
|
||
|
||
function onExcelSelected(ev: Event) {
|
||
const input = ev.target as HTMLInputElement
|
||
const file = input.files?.[0]
|
||
input.value = ''
|
||
if (!file) return
|
||
|
||
const reader = new FileReader()
|
||
reader.onload = (e) => {
|
||
try {
|
||
const data = new Uint8Array(e.target?.result as ArrayBuffer)
|
||
const workbook = XLSX.read(data, { type: 'array' })
|
||
const sheetName = workbook.SheetNames[0]
|
||
const worksheet = workbook.Sheets[sheetName]
|
||
const jsonData = XLSX.utils.sheet_to_json<Record<string, unknown>>(worksheet)
|
||
const { orderIdCol, trackCol, emailCol, changeCol } = detectColumns(jsonData)
|
||
|
||
if (!orderIdCol || !emailCol) {
|
||
Message.error(t('system.batchEmail.errMissingColumns'))
|
||
appendLog(t('system.batchEmail.errMissingColumns'))
|
||
return
|
||
}
|
||
|
||
const list: OrderRow[] = []
|
||
jsonData.forEach((row) => {
|
||
const emailRaw = row[emailCol!]
|
||
const email = emailRaw != null && emailRaw !== '' ? String(emailRaw).trim() : ''
|
||
if (!email || !email.includes('@')) return
|
||
const order: OrderRow = {
|
||
客户单号: row[orderIdCol!] != null && row[orderIdCol!] !== '' ? String(row[orderIdCol!]) : '',
|
||
最新轨迹:
|
||
trackCol && row[trackCol] != null && row[trackCol] !== '' ? String(row[trackCol]) : '',
|
||
换单号:
|
||
changeCol && row[changeCol] != null && row[changeCol] !== '' ? String(row[changeCol]) : '',
|
||
寄件人邮箱: email,
|
||
}
|
||
list.push(order)
|
||
})
|
||
|
||
orderData.value = list
|
||
appendLog(`1: ${t('system.batchEmail.logImportOk', { name: file.name })}`)
|
||
appendLog(t('system.batchEmail.logImportCount', { n: list.length }))
|
||
Message.success(t('system.batchEmail.msgImportOk', { n: list.length }))
|
||
} catch (err) {
|
||
const msg = err instanceof Error ? err.message : String(err)
|
||
appendLog(`${t('system.batchEmail.errImport')}: ${msg}`)
|
||
Message.error(msg)
|
||
}
|
||
}
|
||
reader.readAsArrayBuffer(file)
|
||
}
|
||
|
||
function fillPlaceholders(text: string, order: OrderRow): string {
|
||
if (!text) return ''
|
||
return text
|
||
.replaceAll('{客户单号}', order.客户单号)
|
||
.replaceAll('{最新轨迹}', order.最新轨迹)
|
||
.replaceAll('{换单号}', order.换单号)
|
||
}
|
||
|
||
function openSaveTemplateModal() {
|
||
const c = contentDraft.value.trim()
|
||
if (!c) {
|
||
Message.warning(t('system.batchEmail.warnEmptyContent'))
|
||
return
|
||
}
|
||
newTemplateName.value = selectedTemplateName.value || ''
|
||
saveTplModalVisible.value = true
|
||
}
|
||
|
||
async function doSaveTemplate(name: string, content: string) {
|
||
saveTplLoading.value = true
|
||
try {
|
||
const subj = subjectDraft.value.trim() || name
|
||
templates.value = {
|
||
...templates.value,
|
||
[name]: { content, subject: subj },
|
||
}
|
||
persistTemplates()
|
||
selectedTemplateName.value = name
|
||
appendLog(t('system.batchEmail.logSaveTplOk', { name }))
|
||
Message.success(t('system.batchEmail.msgSaveTplOk', { name }))
|
||
saveTplModalVisible.value = false
|
||
} finally {
|
||
saveTplLoading.value = false
|
||
}
|
||
}
|
||
|
||
/** Arco Modal before-ok:返回 false 阻止关闭 */
|
||
async function onBeforeSaveTemplateOk(): Promise<boolean> {
|
||
const content = contentDraft.value.trim()
|
||
const name = newTemplateName.value.trim()
|
||
if (!content) {
|
||
Message.warning(t('system.batchEmail.warnEmptyContent'))
|
||
return false
|
||
}
|
||
if (!name) {
|
||
Message.warning(t('system.batchEmail.warnEmptyName'))
|
||
return false
|
||
}
|
||
if (templates.value[name] && name !== selectedTemplateName.value) {
|
||
return new Promise((resolve) => {
|
||
Modal.confirm({
|
||
title: t('system.batchEmail.confirmOverwriteTitle'),
|
||
content: t('system.batchEmail.confirmOverwriteBody', { name }),
|
||
okText: t('system.batchEmail.confirmOk'),
|
||
cancelText: t('system.batchEmail.confirmCancel'),
|
||
onOk: async () => {
|
||
await doSaveTemplate(name, content)
|
||
resolve(true)
|
||
},
|
||
onCancel: () => resolve(false),
|
||
})
|
||
})
|
||
}
|
||
await doSaveTemplate(name, content)
|
||
return true
|
||
}
|
||
|
||
function deleteCurrentTemplate() {
|
||
const name = selectedTemplateName.value
|
||
if (!name) {
|
||
Message.warning(t('system.batchEmail.warnSelectTplDelete'))
|
||
return
|
||
}
|
||
if (!templates.value[name]) {
|
||
Message.warning(t('system.batchEmail.warnTplMissing'))
|
||
return
|
||
}
|
||
Modal.confirm({
|
||
title: t('system.batchEmail.confirmDeleteTitle'),
|
||
content: t('system.batchEmail.confirmDeleteBody', { name }),
|
||
okText: t('system.batchEmail.confirmOk'),
|
||
cancelText: t('system.batchEmail.confirmCancel'),
|
||
onOk: () => {
|
||
const next = { ...templates.value }
|
||
delete next[name]
|
||
templates.value = next
|
||
if (!Object.keys(templates.value).length) {
|
||
templates.value = { [DEFAULT_TEMPLATE_NAME]: { ...DEFAULT_TEMPLATE } }
|
||
}
|
||
persistTemplates()
|
||
const keys = Object.keys(templates.value)
|
||
selectedTemplateName.value = keys[0] ?? ''
|
||
applyTemplateByName(keys[0], true)
|
||
appendLog(t('system.batchEmail.logDeleteTpl', { name }))
|
||
Message.success(t('system.batchEmail.msgDeleteTplOk', { name }))
|
||
},
|
||
})
|
||
}
|
||
|
||
function saveAccountConfig() {
|
||
const u = accountUsername.value.trim()
|
||
const p = accountPassword.value
|
||
if (!u || !p) {
|
||
Message.warning(t('system.batchEmail.warnAccount'))
|
||
return
|
||
}
|
||
persistAccounts()
|
||
Message.success(t('system.batchEmail.msgSaveConfigOk'))
|
||
}
|
||
|
||
async function testConnection() {
|
||
const u = accountUsername.value.trim()
|
||
const p = accountPassword.value
|
||
if (!u || !p) {
|
||
Message.warning(t('system.batchEmail.warnAccount'))
|
||
return
|
||
}
|
||
testing.value = true
|
||
appendLog(t('system.batchEmail.logTesting'))
|
||
try {
|
||
await testBatchEmailConnection({
|
||
smtpUsername: u,
|
||
smtpPassword: p,
|
||
serverType: serverType.value,
|
||
})
|
||
appendLog(t('system.batchEmail.logTestOk'))
|
||
Message.success(t('system.batchEmail.msgTestOk'))
|
||
} catch (e: unknown) {
|
||
const msg =
|
||
(e as { response?: { data?: { msg?: string; Msg?: string; message?: string } } })?.response?.data?.msg ??
|
||
(e as { response?: { data?: { Msg?: string } } })?.response?.data?.Msg ??
|
||
(e as Error)?.message ??
|
||
t('system.batchEmail.errUnknown')
|
||
appendLog(`${t('system.batchEmail.logTestFail')}: ${msg}`)
|
||
Message.error(msg)
|
||
} finally {
|
||
testing.value = false
|
||
}
|
||
}
|
||
|
||
async function startBatchSend() {
|
||
if (!orderData.value.length) {
|
||
Message.warning(t('system.batchEmail.warnNoOrders'))
|
||
return
|
||
}
|
||
const bodyContent = contentDraft.value.trim()
|
||
if (!bodyContent) {
|
||
Message.warning(t('system.batchEmail.warnNoTemplate'))
|
||
return
|
||
}
|
||
const u = accountUsername.value.trim()
|
||
const p = accountPassword.value
|
||
if (!u || !p) {
|
||
Message.error(t('system.batchEmail.errNoAccount'))
|
||
return
|
||
}
|
||
|
||
sending.value = true
|
||
appendLog('3: ' + t('system.batchEmail.logSendStart'))
|
||
let successCount = 0
|
||
let failCount = 0
|
||
const total = orderData.value.length
|
||
|
||
for (let i = 0; i < orderData.value.length; i += 1) {
|
||
const order = orderData.value[i]
|
||
const idx = i + 1
|
||
const email = order.寄件人邮箱?.trim() ?? ''
|
||
try {
|
||
if (!email || !email.includes('@')) {
|
||
appendLog(`${idx}/${total}: ${t('system.batchEmail.logSkipNoEmail')}`)
|
||
failCount += 1
|
||
continue
|
||
}
|
||
const body = fillPlaceholders(bodyContent, order)
|
||
if (!body) {
|
||
appendLog(`${idx}/${total}: ${email} ${t('system.batchEmail.logFailEmptyBody')}`)
|
||
failCount += 1
|
||
continue
|
||
}
|
||
const subjBase = subjectDraft.value.trim() || selectedTemplateName.value || t('system.batchEmail.fallbackSubject')
|
||
const subject = fillPlaceholders(subjBase, order)
|
||
await sendBatchEmailOne({
|
||
smtpUsername: u,
|
||
smtpPassword: p,
|
||
serverType: serverType.value,
|
||
to: email,
|
||
subject,
|
||
body,
|
||
bodyType: 'plain',
|
||
})
|
||
appendLog(`${idx}/${total}: ${email} ${t('system.batchEmail.logSendOk')}`)
|
||
successCount += 1
|
||
} catch (e: unknown) {
|
||
const msg =
|
||
(e as { response?: { data?: { msg?: string; Msg?: string } } })?.response?.data?.msg ??
|
||
(e as { response?: { data?: { Msg?: string } } })?.response?.data?.Msg ??
|
||
(e as Error)?.message ??
|
||
t('system.batchEmail.errUnknown')
|
||
appendLog(`${idx}/${total}: ${email || '-'} ${t('system.batchEmail.logSendFail', { msg })}`)
|
||
failCount += 1
|
||
}
|
||
}
|
||
|
||
appendLog(t('system.batchEmail.logSendDone', { total, successCount, failCount }))
|
||
Message.info(t('system.batchEmail.msgSendDone', { successCount, failCount }))
|
||
sending.value = false
|
||
}
|
||
|
||
onMounted(() => {
|
||
templates.value = loadTemplates()
|
||
ensureDefaultTemplate()
|
||
loadAccounts()
|
||
const names = templateNames.value
|
||
if (names.length) {
|
||
selectedTemplateName.value = names[0]
|
||
applyTemplateByName(names[0], true)
|
||
}
|
||
})
|
||
</script>
|
||
|
||
<style scoped lang="less">
|
||
.batch-email-container {
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
padding: 16px;
|
||
background-color: #f0f3f4;
|
||
flex: 1;
|
||
min-height: 0;
|
||
overflow: auto;
|
||
}
|
||
|
||
.batch-email-card {
|
||
background: #fff;
|
||
border-radius: 8px;
|
||
padding: 0 0 16px;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.table-toolbar {
|
||
padding: 16px 16px 0;
|
||
margin-bottom: 16px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
flex-wrap: wrap;
|
||
gap: 8px;
|
||
}
|
||
|
||
.toolbar-left,
|
||
.toolbar-right {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
|
||
.toolbar-label {
|
||
font-size: 14px;
|
||
color: #262626;
|
||
}
|
||
|
||
.toolbar-btn {
|
||
height: 32px;
|
||
border-radius: 4px;
|
||
}
|
||
|
||
.file-input-hidden {
|
||
position: fixed;
|
||
left: -100px;
|
||
top: 0;
|
||
width: 1px;
|
||
height: 1px;
|
||
opacity: 0;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.section-block {
|
||
padding: 0 16px;
|
||
margin-bottom: 16px;
|
||
}
|
||
|
||
.section-title {
|
||
font-size: 14px;
|
||
font-weight: 500;
|
||
color: #262626;
|
||
margin-bottom: 8px;
|
||
}
|
||
|
||
.preview-toolbar {
|
||
margin-bottom: 8px;
|
||
}
|
||
|
||
.hint-text {
|
||
font-size: 13px;
|
||
color: #86909c;
|
||
}
|
||
|
||
.log-textarea :deep(textarea) {
|
||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||
font-size: 13px;
|
||
}
|
||
|
||
.content-textarea {
|
||
margin-top: 4px;
|
||
}
|
||
|
||
.section-config {
|
||
border-top: 1px solid #f0f0f0;
|
||
padding-top: 16px;
|
||
}
|
||
|
||
.config-row {
|
||
margin-top: 8px;
|
||
}
|
||
|
||
.config-label {
|
||
font-size: 14px;
|
||
color: #262626;
|
||
}
|
||
|
||
.subject-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
margin-bottom: 8px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.subject-label {
|
||
flex: 0 0 96px;
|
||
font-size: 14px;
|
||
color: #262626;
|
||
}
|
||
|
||
.subject-input {
|
||
flex: 1;
|
||
min-width: 240px;
|
||
}
|
||
</style>
|