|
|
@@ -0,0 +1,174 @@
|
|
|
+<template>
|
|
|
+<a-spin :spinning="state.loading" >
|
|
|
+ <a-row :gutter="[16, 16]">
|
|
|
+ <a-col span="6" >
|
|
|
+ <a-card>
|
|
|
+ <a-row>
|
|
|
+ <!-- <a-col span="24" class="logo-box" >
|
|
|
+ <img class="logo" :src="logoPng" />
|
|
|
+ <div class="label center" >{{ state.sys.sysLabel}}</div>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="24" style="margin-top: 20px;" >
|
|
|
+ <a-row justify="center" >
|
|
|
+ <a-space>
|
|
|
+ <a-tag color="pink" >蛟龙</a-tag>
|
|
|
+ <a-tag color="red" >云联</a-tag>
|
|
|
+ <a-tag color="orange" >快速</a-tag>
|
|
|
+ <a-tag color="green" >简洁</a-tag>
|
|
|
+ <a-tag color="cyan" >智慧</a-tag>
|
|
|
+ </a-space>
|
|
|
+ </a-row>
|
|
|
+ </a-col> -->
|
|
|
+ <a-col span="24" class="email" >
|
|
|
+ <a-form>
|
|
|
+ <a-form-item label="邮件地址📧" >
|
|
|
+ {{ state.sys.mailConf?.host }}
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="邮件协议🔗" >
|
|
|
+ {{ state.sys.mailConf?.protocol }}
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="邮件账号🔢" >
|
|
|
+ {{ state.sys.mailConf?.username }}
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="邮件密码🫥" >
|
|
|
+ {{ state.sys.mailConf?.password }}
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+
|
|
|
+ </a-col>
|
|
|
+ <a-col span="24" class="center" >
|
|
|
+ <a-button type="primary" @click="openModal" >修改</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-card>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="18" >
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+</a-spin>
|
|
|
+ <modal-pro
|
|
|
+ label="修改邮箱"
|
|
|
+ :visible="state.visible"
|
|
|
+ ok-text="确定"
|
|
|
+ cancel-text="取消"
|
|
|
+ @cancel="state.visible = false"
|
|
|
+ @ok="ok"
|
|
|
+ >
|
|
|
+ <a-form :label-col="{span: 4}" :wrapper-col="{span: 14}">
|
|
|
+ <a-form-item label="邮件地址" v-bind="validateInfos.host">
|
|
|
+ <a-input v-model:value="modelRef.host" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="邮件端口" v-bind="validateInfos.port">
|
|
|
+ <a-input v-model:value="modelRef.port" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="邮件协议" v-bind="validateInfos.protocol">
|
|
|
+ <a-input v-model:value="modelRef.protocol" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="邮件账号" v-bind="validateInfos.username">
|
|
|
+ <a-input v-model:value="modelRef.username" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="邮件密码" v-bind="validateInfos.password">
|
|
|
+ <a-input v-model:value="modelRef.password" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </modal-pro>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup >
|
|
|
+import { SysController } from '@/controller'
|
|
|
+import { onMounted, reactive } from 'vue'
|
|
|
+import { Form } from 'ant-design-vue'
|
|
|
+
|
|
|
+const logoPng = require('@/assets/logo.png')
|
|
|
+
|
|
|
+const state = reactive<{
|
|
|
+ sys: Partial<IOT.API.SYS.Sys>,
|
|
|
+ visible: boolean
|
|
|
+ loading: boolean
|
|
|
+}>({
|
|
|
+ sys: {},
|
|
|
+ visible: false,
|
|
|
+ loading: false
|
|
|
+})
|
|
|
+
|
|
|
+const modelRef = reactive({
|
|
|
+ host: '',
|
|
|
+ port: '',
|
|
|
+ protocol: '',
|
|
|
+ username: '',
|
|
|
+ password: ''
|
|
|
+})
|
|
|
+
|
|
|
+const useForm = Form.useForm
|
|
|
+
|
|
|
+const { resetFields, validate, validateInfos } = useForm(modelRef, reactive({
|
|
|
+ host: [{ required: true, message: '请填写邮件地址' }],
|
|
|
+ port: [{ required: true, message: '请填写邮件端口' }],
|
|
|
+ protocol: [{ required: true, message: '请填写邮件协议' }],
|
|
|
+ username: [{ required: true, message: '请填写邮件账号' }],
|
|
|
+ password: [{ required: true, message: '请填写邮件密码' }]
|
|
|
+}))
|
|
|
+
|
|
|
+const ok = () => {
|
|
|
+ validate().then(async () => {
|
|
|
+ await SysController.updateSysConf({
|
|
|
+ ...state.sys,
|
|
|
+ mailConf: modelRef
|
|
|
+ })
|
|
|
+ state.visible = false
|
|
|
+ getLogo()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const openModal = () => {
|
|
|
+ state.visible = true
|
|
|
+}
|
|
|
+
|
|
|
+const getLogo = async () => {
|
|
|
+ state.loading = true
|
|
|
+ const { data } = await SysController.sysConf()
|
|
|
+ state.loading = false
|
|
|
+ state.sys = data
|
|
|
+ resetFields(data.mailConf)
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getLogo()
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped >
|
|
|
+.logo-box {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ .logo {
|
|
|
+ width: 200px;
|
|
|
+ height: 200px;
|
|
|
+ border-radius: 50%;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+.email {
|
|
|
+ display: flex;
|
|
|
+ // justify-content: center;
|
|
|
+ margin-left: 70px;
|
|
|
+ margin-top: 20px;
|
|
|
+ font-size: 22px;
|
|
|
+}
|
|
|
+
|
|
|
+.label {
|
|
|
+ font-size: 32px;
|
|
|
+ margin-top: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.center {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+</style>
|