|
@@ -1,32 +1,23 @@
|
|
|
<template>
|
|
|
<div class="page-container column-container">
|
|
|
<!-- 搜索区 -->
|
|
|
- <!-- <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"
|
|
|
+ <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"
|
|
|
label-width="68px">
|
|
|
- <el-form-item class="section-title" label="员工管理" />
|
|
|
- <el-form-item label="员工编码:" prop="userName">
|
|
|
- <el-input v-model.trim="queryParams.userName" placeholder="请输入员工编码" clearable style="width: 130px"
|
|
|
+ <el-form-item class="section-title" label="邮箱配置" />
|
|
|
+ <el-form-item label="邮箱地址:" prop="emailAddress">
|
|
|
+ <el-input v-model.trim="queryParams.emailAddress" placeholder="请输入邮箱地址" clearable style="width: 186px"
|
|
|
@keyup.enter="handleQueryUser" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="员工姓名:" prop="nickName">
|
|
|
- <el-input v-model.trim="queryParams.nickName" placeholder="请输入员工姓名" clearable style="width: 130px"
|
|
|
- @keyup.enter="handleQueryUser" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="手机号码:" prop="phoneNumber">
|
|
|
- <el-input v-model.trim="queryParams.phoneNumber" placeholder="请输入手机号码" clearable style="width: 130px"
|
|
|
- @keyup.enter="handleQueryUser" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="员工状态:">
|
|
|
- <el-select v-model="queryParams.status" placeholder="请选择" clearable style="width: 120px;">
|
|
|
- <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label"
|
|
|
- :value="dict.value"></el-option>
|
|
|
+ <el-form-item label="邮箱类型:" prop="type">
|
|
|
+ <el-select v-model="queryParams.type" placeholder="请选择" clearable style="width: 100%;">
|
|
|
+ <el-option v-for="dict in emailType" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="info" icon="Search" @click="handleQueryUser">搜索</el-button>
|
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
</el-form-item>
|
|
|
- </el-form> -->
|
|
|
+ </el-form>
|
|
|
<!-- 功能按钮区 -->
|
|
|
<div class="list-btns-container">
|
|
|
<el-button type="primary" icon="Plus" @click="handleShowUserDialog(null)"
|
|
@@ -53,7 +44,9 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="邮箱地址" align="center" prop="emailAddress" />
|
|
|
- <el-table-column label="授权码" align="center" prop="authCode" />
|
|
|
+ <el-table-column label="授权码" align="center" prop="authCode">
|
|
|
+ <template #default="scope">{{ scope.row.authCode ? '******' : '' }}</template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="端口" align="center" prop="port" />
|
|
|
<el-table-column label="发送协议" align="center" prop="protocol" />
|
|
|
<el-table-column label="协议服务地址" align="center" prop="host" />
|
|
@@ -102,7 +95,7 @@
|
|
|
</el-popover>
|
|
|
<div>授权码</div>
|
|
|
</template>
|
|
|
- <el-input v-model="form.authCode" placeholder="请输入授权码" />
|
|
|
+ <el-input v-model="form.authCode" type="password" placeholder="请输入授权码" show-password />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="端口" prop="port">
|
|
|
<template #label>
|
|
@@ -367,17 +360,41 @@ function handleShowUserDialog(id) {
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
function handleSave() {
|
|
|
- proxy.$refs["userRef"].validate((valid) => {
|
|
|
+ proxy.$refs["userRef"].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
console.log(form.value);
|
|
|
// 邮箱地址必填
|
|
|
if (form.value.emailAddress == null || form.value.emailAddress == '') {
|
|
|
- proxy.$modal.msgError("邮箱地址必填");
|
|
|
+ proxy.$modal.msgError("请填写邮箱地址");
|
|
|
return
|
|
|
}
|
|
|
// 判断是否是寄件邮箱 假设是寄件邮箱则寄件邮箱的必填项 需要填满
|
|
|
if (form.value.type === 0) {
|
|
|
- //
|
|
|
+ // 判断是否填写授权码
|
|
|
+ if (form.value.authCode == null || form.value.authCode == '') {
|
|
|
+ proxy.$modal.msgError("请填写授权码");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断是否填写端口
|
|
|
+ if (form.value.port == null || form.value.port == '') {
|
|
|
+ proxy.$modal.msgError("请填写端口");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断是否填写发送协议
|
|
|
+ if (form.value.protocol == null || form.value.protocol == '') {
|
|
|
+ proxy.$modal.msgError("请填写发送协议");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断是否填写协议服务器地址
|
|
|
+ if (form.value.host == null || form.value.host == '') {
|
|
|
+ proxy.$modal.msgError("请填写协议服务地址");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 假设已经有寄件邮箱则弹窗询问是否弃用前邮箱。
|
|
|
+ const res = await isExistEmail()
|
|
|
+ if (!res) {
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
if (form.value.id != undefined) {
|
|
|
updateEmail(form.value).then((response) => {
|
|
@@ -395,6 +412,17 @@ function handleSave() {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+// 判断是否已有寄件地址
|
|
|
+async function isExistEmail() {
|
|
|
+ const query = { type: 0, isStop: 0 }
|
|
|
+ const res = await listEmail(query)
|
|
|
+ if (res.code == 200 && res.rows.filter(e => e.id != form.value.id).length > 0) {
|
|
|
+ return await proxy.$modal
|
|
|
+ .confirm("已有寄件邮箱,确认替换?").then(_ => true).catch(_ => false)
|
|
|
+ } else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
getList();
|
|
|
</script>
|