|
@@ -23,10 +23,7 @@
|
|
|
<el-container direction="vertical">
|
|
|
<h3 style="margin-bottom:20px">开发者设置:</h3>
|
|
|
<el-form label-width="120px" :model="formKey" :rules="ruleKey" ref="keyForm">
|
|
|
- <!-- <el-form-item label="余额预警:">
|
|
|
- {{alarm_amount}}
|
|
|
- </el-form-item> -->
|
|
|
- <el-form-item label="密钥设置:" :prop="useKey == '1' ? 'ReSecurityKey' : 'securityKey'" class="keySet">
|
|
|
+ <el-form-item label="密钥设置:" :prop="useKey == '1' ? 'ReSecurityKey' : 'securityKey'" class="keySet">
|
|
|
<el-input v-if="useKey == '1'" v-model="formKey.ReSecurityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
|
|
|
<el-input v-else v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
|
|
|
<el-button type="primary" size="small" @click="updateKey">{{useKey == '1' ? '重设' : '设置'}}</el-button>
|
|
@@ -41,17 +38,17 @@
|
|
|
<el-form-item label="ip白名单:" >
|
|
|
<div v-if="cIpList">
|
|
|
<el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" :value="ipFormData.name"></el-input>
|
|
|
- <i class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i>
|
|
|
+ <i class="el-icon-circle-plus-outline" style="color:#409EFF;font-size:22px;" @click="add"></i>
|
|
|
</div>
|
|
|
<template v-else>
|
|
|
<div v-for="(item, idx) in ipList" :key="item">
|
|
|
<el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" :value="item"></el-input>
|
|
|
<template v-if="idx == 0">
|
|
|
- <i class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i>
|
|
|
- <i class="el-icon-remove-outline" style="color:#F56C6C;margin-left:10px" @click="del(item)"></i>
|
|
|
+ <i class="el-icon-circle-plus-outline" style="color:#409EFF;font-size:22px;" @click="add"></i>
|
|
|
+ <i class="el-icon-remove-outline" style="color:#F56C6C;margin-left:10px;font-size:22px;" @click="del(item)"></i>
|
|
|
</template>
|
|
|
<!-- <i v-if="idx == 0" class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i> -->
|
|
|
- <i v-else class="el-icon-remove-outline" style="color:#F56C6C;" @click="del(item)"></i>
|
|
|
+ <i v-else class="el-icon-remove-outline" style="color:#F56C6C;font-size:22px;" @click="del(item)"></i>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
@@ -59,7 +56,7 @@
|
|
|
<!-- 添加ip弹层 -->
|
|
|
<el-dialog title="添加ip白名单" :visible="dialogFormVisible" @close="btnCancle">
|
|
|
<el-form :model="ipFormData" :rules="rules" ref="ipFormData" label-width="80px">
|
|
|
- <el-form-item label="ip" prop="name">
|
|
|
+ <el-form-item label="ip:" prop="name">
|
|
|
<el-input v-model="ipFormData.name" autocomplete="off" style="width: 300px"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -70,18 +67,56 @@
|
|
|
</el-dialog>
|
|
|
</el-container>
|
|
|
</el-card>
|
|
|
+ <!-- 余额预警电话设置 -->
|
|
|
+ <el-card>
|
|
|
+ <el-container direction="vertical">
|
|
|
+ <h3 style="margin-bottom:20px">余额预警电话设置:</h3>
|
|
|
+ <el-form label-width="120px" ref="formWarning">
|
|
|
+ <el-form-item label="余额预警电话:" >
|
|
|
+ <div v-if="cWarningList">
|
|
|
+ <el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" :value="addphone.phone"></el-input>
|
|
|
+ <i class="el-icon-circle-plus-outline" style="color:#409EFF;font-size:22px;" @click="addwphone"></i>
|
|
|
+ </div>
|
|
|
+ <template v-else>
|
|
|
+ <div v-for="(item, idx) in warningList" :key="item">
|
|
|
+ <el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" :value="item"></el-input>
|
|
|
+ <template v-if="idx == 0">
|
|
|
+ <i class="el-icon-circle-plus-outline" style="color:#409EFF;font-size:22px;" @click="addwphone"></i>
|
|
|
+ <i class="el-icon-remove-outline" style="color:#F56C6C;margin-left:10px;font-size:22px;" @click="delwphone(item)"></i>
|
|
|
+ </template>
|
|
|
+ <i v-else class="el-icon-remove-outline" style="color:#F56C6C;font-size:22px;" @click="delwphone(item)"></i>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <!-- 添加预警弹层 -->
|
|
|
+ <el-dialog title="添加预警电话" :visible="warningDialogVisible" @close="cancleWarning">
|
|
|
+ <el-form :model="addphone" :rules="ruleAddphone" ref="addphone" label-width="100px">
|
|
|
+ <el-form-item label="预警电话:" prop="phone">
|
|
|
+ <el-input v-model="addphone.phone" autocomplete="off" style="width: 300px"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancleWarning">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmitWarning('addphone')">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </el-container>
|
|
|
+ </el-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// getIpList获取Ip列表 delIpList-删除 addIp-添加 getUserInfo-用户信息 onSubUser-提交用户设置
|
|
|
+// getIpList获取Ip列表 delIpList-删除 addIp-添加 getUserInfo-用户信息 onSubUser-提交用户设置 addwphone-添加预警电话 delwphone-删除
|
|
|
import {
|
|
|
// getIpList,
|
|
|
delIpList,
|
|
|
addIp,
|
|
|
getUserInfo,
|
|
|
updateKey,
|
|
|
- onSubUser
|
|
|
+ onSubUser,
|
|
|
+ addwphone,
|
|
|
+ delwphone
|
|
|
} from "@/api";
|
|
|
export default {
|
|
|
name: 'pageView',
|
|
@@ -116,16 +151,6 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
repeatIp: false,
|
|
|
- // 商户号
|
|
|
- // merchantsCode: '',
|
|
|
- // 商户名称
|
|
|
- // merchantsName: '',
|
|
|
- // 余额预警
|
|
|
- // alarm_amount: '',
|
|
|
- // 余额
|
|
|
- // available_predeposit: '',
|
|
|
- // 密钥
|
|
|
- // securityKey: '',
|
|
|
// 密钥校验,只能是数字和字母
|
|
|
formKey: {
|
|
|
securityKey: '',
|
|
@@ -152,7 +177,21 @@ export default {
|
|
|
phone: [
|
|
|
{validator: checkPhone, trigger: 'blur'}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 预警电话列表
|
|
|
+ warningList: [],
|
|
|
+ // 添加预警
|
|
|
+ addphone: {
|
|
|
+ phone: ''
|
|
|
+ },
|
|
|
+ ruleAddphone: {
|
|
|
+ phone: [
|
|
|
+ { required: true, message: '请输入预警电话', trigger: 'blur' },
|
|
|
+ { pattern: /^1[3-9]\d{9}$/, message:'请输入正确的电话', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ warningDialogVisible: false,
|
|
|
+ repeatPhone: false
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -162,6 +201,9 @@ export default {
|
|
|
computed: {
|
|
|
cIpList() {
|
|
|
return this.ipList < 1
|
|
|
+ },
|
|
|
+ cWarningList() {
|
|
|
+ return this.warningList < 1
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -216,11 +258,11 @@ export default {
|
|
|
onSubmit(formName) {
|
|
|
this.$refs[formName].validate(async(valid) => {
|
|
|
if (valid) {
|
|
|
- console.log(valid);
|
|
|
+ // console.log(valid);
|
|
|
if (this.ipList.length > 0) {
|
|
|
- this.ipList.forEach(item => {
|
|
|
- this.repeatIp = item.ip == this.ipFormData.name
|
|
|
- })
|
|
|
+ // this.ipList.forEach(item => {
|
|
|
+ // this.repeatIp = item.ip == this.ipFormData.name
|
|
|
+ // })
|
|
|
this.repeatIp = this.ipList.find((item => item == this.ipFormData.name))
|
|
|
}
|
|
|
if (this.repeatIp) {
|
|
@@ -261,15 +303,11 @@ export default {
|
|
|
const res = await getUserInfo()
|
|
|
console.log('个人中心', res);
|
|
|
if (res && res.code == 200) {
|
|
|
- // this.merchantsCode = res.datas.mchid
|
|
|
- // this.merchantsName = res.datas.name
|
|
|
this.ipList = res.datas.ips
|
|
|
- // this.alarm_amount = res.datas.alarm_amount
|
|
|
this.useKey = res.datas.use_key
|
|
|
- // this.available_predeposit = res.datas.member.available_predeposit
|
|
|
- // this.userForm.name = res.datas.contact_name != 'null' ? res.datas.contact_name : ''
|
|
|
this.userForm.name = res.datas.contact_name != 'null' ? res.datas.contact_name : ''
|
|
|
this.userForm.phone = res.datas.contact_phone != 'null' ? res.datas.contact_phone : ''
|
|
|
+ this.warningList = res.datas.warning_phone
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
@@ -338,6 +376,93 @@ export default {
|
|
|
resetForm() {
|
|
|
this.userForm.name = ''
|
|
|
this.$refs.userForm.resetFields();
|
|
|
+ },
|
|
|
+ // 添加预警
|
|
|
+ addwphone() {
|
|
|
+ this.addphone.phone = ''
|
|
|
+ this.warningDialogVisible = true
|
|
|
+ },
|
|
|
+ // 关闭预警弹层
|
|
|
+ cancleWarning() {
|
|
|
+ this.warningDialogVisible = false
|
|
|
+ this.$refs.addphone.resetFields()
|
|
|
+ },
|
|
|
+ // 确认添加
|
|
|
+ onSubmitWarning(formName) {
|
|
|
+ this.$refs[formName].validate(async(valid) => {
|
|
|
+ if (valid) {
|
|
|
+ console.log(valid);
|
|
|
+ if (this.warningList.length > 0) {
|
|
|
+ this.repeatPhone = this.warningList.find((item => item == this.addphone.phone))
|
|
|
+ }
|
|
|
+ if (this.repeatPhone) {
|
|
|
+ this.$message.error('该预警电话已存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // console.log('校验通过');
|
|
|
+ try {
|
|
|
+ let param = new URLSearchParams()
|
|
|
+ param.append('phone', this.addphone.phone)
|
|
|
+ const res = await addwphone(param)
|
|
|
+ console.log('添加预警电话', res);
|
|
|
+ if (res && res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '添加预警电话成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.getUserInfo()
|
|
|
+ // this.dialogFormVisible = false
|
|
|
+ // this.ipFormData.name = ''
|
|
|
+ } else {
|
|
|
+ this.$message.error('添加预警电话失败')
|
|
|
+ }
|
|
|
+ this.warningDialogVisible = false
|
|
|
+ this.addphone.phone = ''
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ this.warningDialogVisible = false
|
|
|
+ this.addphone.phone = ''
|
|
|
+ this.$message.error('添加预警电话失败')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 删除预警电话
|
|
|
+ delwphone(phone) {
|
|
|
+ console.log('phone',phone);
|
|
|
+ // 提示
|
|
|
+ this.$confirm("确认删除该预警电话?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ // 调用删除接口
|
|
|
+ try {
|
|
|
+ let param = new URLSearchParams()
|
|
|
+ param.append('phone', phone)
|
|
|
+ // const res = await delIpList({ip: ip})
|
|
|
+ const res = await delwphone(param)
|
|
|
+ console.log('删除预警电话', res);
|
|
|
+ if (res && res.code == 200) {
|
|
|
+ // 提示
|
|
|
+ this.$message({
|
|
|
+ message: '删除预警电话成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ // 获取列表
|
|
|
+ this.getUserInfo()
|
|
|
+ } else {
|
|
|
+ this.$message.error('删除预警电话失败')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ this.$message.error('删除预警电话失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return false;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
};
|
|
@@ -367,6 +492,9 @@ export default {
|
|
|
.keySet .el-button {
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
+.el-card {
|
|
|
+ padding-bottom: 0px;
|
|
|
+}
|
|
|
</style>
|
|
|
<style>
|
|
|
.el-main {
|