|
@@ -2,10 +2,16 @@
|
|
|
<a-spin :spinning="state.loading" >
|
|
<a-spin :spinning="state.loading" >
|
|
|
<a-row :gutter="[16, 16]">
|
|
<a-row :gutter="[16, 16]">
|
|
|
<a-col span="6" >
|
|
<a-col span="6" >
|
|
|
- <a-card title="邮箱配置">
|
|
|
|
|
|
|
+ <a-card
|
|
|
|
|
+ title="邮箱配置"
|
|
|
|
|
+
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-slot:extra >
|
|
|
|
|
+ <a-button type="primary" @click="openModal" >{{modelRef.id ? '修改邮箱' : '创建邮箱'}}</a-button>
|
|
|
|
|
+ </template>
|
|
|
<a-row>
|
|
<a-row>
|
|
|
<a-col span="24" class="email" >
|
|
<a-col span="24" class="email" >
|
|
|
- <a-form>
|
|
|
|
|
|
|
+ <a-form v-if="modelRef.id" >
|
|
|
<a-form-item label="邮件地址📧" >
|
|
<a-form-item label="邮件地址📧" >
|
|
|
{{ state.sys.mailConf?.host }}
|
|
{{ state.sys.mailConf?.host }}
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -20,19 +26,18 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-form>
|
|
</a-form>
|
|
|
|
|
|
|
|
- </a-col>
|
|
|
|
|
- <a-col span="24" class="center" >
|
|
|
|
|
- <a-button type="primary" @click="openModal" >修改邮箱</a-button>
|
|
|
|
|
|
|
+ <a-empty v-else description="暂无邮箱信息" />
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
</a-card>
|
|
</a-card>
|
|
|
|
|
+
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col span="18" >
|
|
<a-col span="18" >
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
</a-spin>
|
|
</a-spin>
|
|
|
<modal-pro
|
|
<modal-pro
|
|
|
- label="修改邮箱"
|
|
|
|
|
|
|
+ :label="modalTitle"
|
|
|
:open="state.visible"
|
|
:open="state.visible"
|
|
|
ok-text="确定"
|
|
ok-text="确定"
|
|
|
cancel-text="取消"
|
|
cancel-text="取消"
|
|
@@ -61,7 +66,7 @@
|
|
|
|
|
|
|
|
<script lang="ts" setup >
|
|
<script lang="ts" setup >
|
|
|
import { SysController } from '@/controller'
|
|
import { SysController } from '@/controller'
|
|
|
-import { onMounted, reactive } from 'vue'
|
|
|
|
|
|
|
+import { computed, onMounted, reactive } from 'vue'
|
|
|
import { Form } from 'ant-design-vue'
|
|
import { Form } from 'ant-design-vue'
|
|
|
|
|
|
|
|
const state = reactive<{
|
|
const state = reactive<{
|
|
@@ -74,7 +79,10 @@ const state = reactive<{
|
|
|
loading: false
|
|
loading: false
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const modalTitle = computed(() => modelRef.id ? '修改邮箱' : '创建邮箱')
|
|
|
|
|
+
|
|
|
const modelRef = reactive({
|
|
const modelRef = reactive({
|
|
|
|
|
+ id: '',
|
|
|
host: '',
|
|
host: '',
|
|
|
port: '',
|
|
port: '',
|
|
|
protocol: '',
|
|
protocol: '',
|
|
@@ -94,10 +102,12 @@ const { resetFields, validate, validateInfos } = useForm(modelRef, reactive({
|
|
|
|
|
|
|
|
const ok = () => {
|
|
const ok = () => {
|
|
|
validate().then(async () => {
|
|
validate().then(async () => {
|
|
|
- await SysController.updateSysConf({
|
|
|
|
|
- ...state.sys,
|
|
|
|
|
- mailConf: modelRef
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (modelRef.id) {
|
|
|
|
|
+ await SysController.updateSysConf({ ...state.sys, mailConf: modelRef })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ await SysController.addSysConf({ ...state.sys, mailConf: modelRef })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
state.visible = false
|
|
state.visible = false
|
|
|
getLogo()
|
|
getLogo()
|
|
|
})
|
|
})
|
|
@@ -112,6 +122,7 @@ const getLogo = async () => {
|
|
|
const { data } = await SysController.sysConf()
|
|
const { data } = await SysController.sysConf()
|
|
|
state.loading = false
|
|
state.loading = false
|
|
|
state.sys = data || { mailConf: {} }
|
|
state.sys = data || { mailConf: {} }
|
|
|
|
|
+ modelRef.id = data ? data.id : ''
|
|
|
resetFields(data || { mailConf: {} })
|
|
resetFields(data || { mailConf: {} })
|
|
|
}
|
|
}
|
|
|
|
|
|