<template>
|
<!-- <el-spin :spinning="loadSpinning"> -->
|
<el-form
|
ref="formRef"
|
:model="formData"
|
:rules="formRules"
|
layout="vertical"
|
>
|
<el-form-item label="发送邮箱号:" name="SNOWY_EMAIL_LOCAL_FROM">
|
<el-input v-model:value="formData.SNOWY_EMAIL_LOCAL_FROM" placeholder="请输入发送邮箱号" />
|
</el-form-item>
|
<el-form-item label="邮箱密钥:" name="SNOWY_EMAIL_LOCAL_PASSWORD">
|
<el-input v-model:value="formData.SNOWY_EMAIL_LOCAL_PASSWORD" placeholder="请输入邮箱密钥" />
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" :loading="submitLoading" @click="saveConfig">保存</el-button>
|
<el-button style="margin-left: 10px" @click="resetFields">重置</el-button>
|
</el-form-item>
|
</el-form>
|
<!-- </el-spin> -->
|
</template>
|
<style>
|
.el-tabs{
|
height: 400px!important;
|
}
|
</style>
|
<script>
|
import {edit,configList} from "@/api/peizhi/index";
|
export default {
|
name: "Role",
|
data() {
|
return {
|
loadSpinning: "true",
|
formData:{
|
SNOWY_EMAIL_LOCAL_FROM:'本地邮件发送邮箱号',
|
SNOWY_EMAIL_LOCAL_PASSWORD:'本地邮件密钥',
|
},
|
formRules: {
|
SNOWY_EMAIL_LOCAL_FROM: [
|
{ required: true, message: '请输本地邮件发送邮箱号', trigger: 'blur' }
|
]
|
},
|
submitLoading:false
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
/** 查询角色列表 */
|
getList() {
|
const param = {
|
category: 'EMAIL_LOCAL'
|
}
|
configList(param).then((res) =>{
|
if (res.code==200) {
|
res.data.forEach((item) => {
|
this.formData[item.configKey] = item.configValue
|
})
|
} else {
|
message.warning('表单项不存在,请初始化数据库')
|
}
|
// listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
|
// (response) => {
|
// this.roleList = response.rows;
|
// this.total = response.total;
|
// this.loading = false;
|
})
|
// );
|
},
|
saveConfig() {
|
this.submitLoading = true;
|
this.$refs["formRef"].validate(valid => {
|
if (valid) {
|
console.log(this.formData)
|
edit(this.formData).then(response => {
|
this.$modal.msgSuccess("保存成功");
|
this.submitLoading = false;
|
// this.open = false;
|
// this.getList();
|
});
|
}else{
|
alert(1)
|
}
|
});
|
},
|
resetFields(){
|
alert("重置");
|
}
|
},
|
};
|
</script>
|