IM 设置
parent
fbf2b6a6fa
commit
edde94af69
|
@ -0,0 +1,87 @@
|
||||||
|
<template>
|
||||||
|
<div class="layout">
|
||||||
|
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||||
|
<FormItem label="云IM地址" prop="httpUrl">
|
||||||
|
<Input v-model="formValidate.httpUrl"/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="平台ID" class="label-item" prop="tenantId">
|
||||||
|
<Input v-model="formValidate.tenantId"/>
|
||||||
|
</FormItem>
|
||||||
|
<div class="label-btns">
|
||||||
|
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {setSetting} from "@/api/index";
|
||||||
|
import {handleSubmit} from "./validate";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ruleValidate: {}, // 验证规则
|
||||||
|
formValidate: { // 表单数据
|
||||||
|
httpUrl: "",
|
||||||
|
tenantId: ""
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: ["res", "type"],
|
||||||
|
created() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 保存
|
||||||
|
submit(name) {
|
||||||
|
let that = this;
|
||||||
|
if (handleSubmit(that, name)) {
|
||||||
|
this.setupSetting()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 保存设置
|
||||||
|
setupSetting() {
|
||||||
|
setSetting(this.type, this.formValidate).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("保存成功!");
|
||||||
|
} else {
|
||||||
|
this.$Message.error("保存失败!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 实例化数据
|
||||||
|
init() {
|
||||||
|
this.res = JSON.parse(this.res);
|
||||||
|
|
||||||
|
this.$set(this, "formValidate", {...this.res});
|
||||||
|
Object.keys(this.formValidate).forEach((item) => {
|
||||||
|
this.ruleValidate[item] = [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请填写必填项",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./style.scss";
|
||||||
|
|
||||||
|
.label-item {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ivu-input {
|
||||||
|
width: 300px !important;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ivu-input-wrapper {
|
||||||
|
width: 300px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -57,6 +57,11 @@ export default {
|
||||||
type: "SMS_SETTING",
|
type: "SMS_SETTING",
|
||||||
name: "阿里短信配置",
|
name: "阿里短信配置",
|
||||||
},
|
},
|
||||||
|
//阿里短信配置
|
||||||
|
{
|
||||||
|
type: "IM_SETTING",
|
||||||
|
name: "客服设置",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
authLogin: [
|
authLogin: [
|
||||||
// 微信设置
|
// 微信设置
|
||||||
|
|
Loading…
Reference in New Issue