style: 增加公司审核状态
This commit is contained in:
@@ -110,6 +110,12 @@ const columns: TableColumnList = [
|
|||||||
width: "260",
|
width: "260",
|
||||||
slot: "status"
|
slot: "status"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "审核状态",
|
||||||
|
prop: "auditStatus",
|
||||||
|
width: "260",
|
||||||
|
slot: "auditStatus"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "创建时间",
|
label: "创建时间",
|
||||||
prop: "createTime",
|
prop: "createTime",
|
||||||
@@ -216,6 +222,18 @@ onMounted(() => {
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</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 }">
|
<template #operation="{ row }">
|
||||||
<el-button link type="primary" size="small" @click="handleEdit(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) => {
|
const saveSettings = async (key: string) => {
|
||||||
try {
|
try {
|
||||||
fullscreenLoading.value = true; // 显示遮罩层
|
// 如果是邮箱配置,先进行验证
|
||||||
|
if (key === "email_config" && !validateEmailConfig()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fullscreenLoading.value = true;
|
||||||
const params = {
|
const params = {
|
||||||
settingsKey: key,
|
settingsKey: key,
|
||||||
settingsContent: JSON.stringify(settingsData.value[key])
|
settingsContent: JSON.stringify(settingsData.value[key])
|
||||||
@@ -111,13 +170,21 @@ const saveSettings = async (key: string) => {
|
|||||||
console.error("保存系统设置失败:", error);
|
console.error("保存系统设置失败:", error);
|
||||||
ElMessage.error("保存系统设置失败");
|
ElMessage.error("保存系统设置失败");
|
||||||
} finally {
|
} finally {
|
||||||
fullscreenLoading.value = false; // 隐藏遮罩层
|
fullscreenLoading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 添加邮箱
|
// 添加邮箱
|
||||||
const handleAddEmail = () => {
|
const handleAddEmail = () => {
|
||||||
const email = newEmail.value.trim();
|
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 (email && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
||||||
if (!settingsData.value.email_config.toEmails.includes(email)) {
|
if (!settingsData.value.email_config.toEmails.includes(email)) {
|
||||||
settingsData.value.email_config.toEmails.push(email);
|
settingsData.value.email_config.toEmails.push(email);
|
||||||
@@ -210,6 +277,7 @@ onMounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="settings-container">
|
<div class="settings-container">
|
||||||
<div
|
<div
|
||||||
|
v-show="fullscreenLoading"
|
||||||
v-loading.fullscreen.lock="fullscreenLoading"
|
v-loading.fullscreen.lock="fullscreenLoading"
|
||||||
:element-loading-text="'保存中...'"
|
:element-loading-text="'保存中...'"
|
||||||
class="settings-container"
|
class="settings-container"
|
||||||
@@ -513,11 +581,13 @@ onMounted(() => {
|
|||||||
<el-button
|
<el-button
|
||||||
v-else
|
v-else
|
||||||
class="button-new-email"
|
class="button-new-email"
|
||||||
|
:disabled="settingsData.email_config.toEmails.length >= 10"
|
||||||
@click="showEmailInput = true"
|
@click="showEmailInput = true"
|
||||||
>
|
>
|
||||||
+ 添加邮箱
|
+ 添加邮箱
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-tip">最多可添加10个收件邮箱地址</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|||||||
Reference in New Issue
Block a user