style: 增加公司审核状态
This commit is contained in:
@@ -110,6 +110,12 @@ const columns: TableColumnList = [
|
||||
width: "260",
|
||||
slot: "status"
|
||||
},
|
||||
{
|
||||
label: "审核状态",
|
||||
prop: "auditStatus",
|
||||
width: "260",
|
||||
slot: "auditStatus"
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
prop: "createTime",
|
||||
@@ -216,6 +222,18 @@ onMounted(() => {
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #auditStatus="{ row }">
|
||||
<el-tag :type="row.status === 1 ? 'success' : 'danger'" size="small">
|
||||
{{
|
||||
row.status === 0
|
||||
? "未审核"
|
||||
: row.status === 1
|
||||
? "审核通过"
|
||||
: "审核驳回"
|
||||
}}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" size="small" @click="handleEdit(row)">
|
||||
编辑
|
||||
|
||||
@@ -90,10 +90,69 @@ const loadSettings = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 保存设置
|
||||
// 验证邮箱配置信息
|
||||
const validateEmailConfig = (): boolean => {
|
||||
const {
|
||||
smtpServer,
|
||||
smtpPort,
|
||||
fromEmail,
|
||||
fromEmailPassword,
|
||||
fromEmailUser,
|
||||
fromEmailName,
|
||||
toEmails
|
||||
} = settingsData.value.email_config;
|
||||
|
||||
// 检查必填字段
|
||||
if (
|
||||
!smtpServer ||
|
||||
!smtpPort ||
|
||||
!fromEmail ||
|
||||
!fromEmailPassword ||
|
||||
!fromEmailUser ||
|
||||
!fromEmailName
|
||||
) {
|
||||
ElMessage.warning("请完整填写邮箱配置信息");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证发件邮箱格式
|
||||
if (!isValidEmail(fromEmail)) {
|
||||
ElMessage.warning("发件邮箱格式不正确");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证SMTP端口格式
|
||||
if (!/^\d+$/.test(smtpPort) || parseInt(smtpPort) <= 0) {
|
||||
ElMessage.warning("SMTP端口必须为有效的正整数");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证收件邮箱列表
|
||||
if (!toEmails || toEmails.length === 0) {
|
||||
ElMessage.warning("请至少添加一个收件邮箱");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证收件邮箱格式
|
||||
for (const email of toEmails) {
|
||||
if (!isValidEmail(email)) {
|
||||
ElMessage.warning(`收件邮箱 ${email} 格式不正确`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
// 修改保存设置函数
|
||||
const saveSettings = async (key: string) => {
|
||||
try {
|
||||
fullscreenLoading.value = true; // 显示遮罩层
|
||||
// 如果是邮箱配置,先进行验证
|
||||
if (key === "email_config" && !validateEmailConfig()) {
|
||||
return;
|
||||
}
|
||||
|
||||
fullscreenLoading.value = true;
|
||||
const params = {
|
||||
settingsKey: key,
|
||||
settingsContent: JSON.stringify(settingsData.value[key])
|
||||
@@ -111,13 +170,21 @@ const saveSettings = async (key: string) => {
|
||||
console.error("保存系统设置失败:", error);
|
||||
ElMessage.error("保存系统设置失败");
|
||||
} finally {
|
||||
fullscreenLoading.value = false; // 隐藏遮罩层
|
||||
fullscreenLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 添加邮箱
|
||||
const handleAddEmail = () => {
|
||||
const email = newEmail.value.trim();
|
||||
// 检查邮箱数量是否达到上限
|
||||
if (settingsData.value.email_config.toEmails.length >= 10) {
|
||||
ElMessage.warning("最多只能添加10个收件邮箱");
|
||||
newEmail.value = "";
|
||||
showEmailInput.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (email && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
||||
if (!settingsData.value.email_config.toEmails.includes(email)) {
|
||||
settingsData.value.email_config.toEmails.push(email);
|
||||
@@ -210,6 +277,7 @@ onMounted(() => {
|
||||
<template>
|
||||
<div class="settings-container">
|
||||
<div
|
||||
v-show="fullscreenLoading"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
:element-loading-text="'保存中...'"
|
||||
class="settings-container"
|
||||
@@ -513,11 +581,13 @@ onMounted(() => {
|
||||
<el-button
|
||||
v-else
|
||||
class="button-new-email"
|
||||
:disabled="settingsData.email_config.toEmails.length >= 10"
|
||||
@click="showEmailInput = true"
|
||||
>
|
||||
+ 添加邮箱
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="form-tip">最多可添加10个收件邮箱地址</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
Reference in New Issue
Block a user