update 平台配置页面

This commit is contained in:
2024-04-23 16:09:56 +08:00
parent 866daa6121
commit 4bfe6acc49
3 changed files with 141 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container Input">
<el-tabs type="border-card">
<el-tab-pane label="密钥配置" name="order">
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="密钥配置" name="secret">
<el-form ref="form" :model="form" :rules="rules" label-width="300px">
<!-- -->
<el-col :span="24">
@@ -19,7 +19,7 @@
<!-- 左侧 -->
<el-col :span="12">
<el-card class="box-card" style="margin-right: 50px;">
<div slot="header" class="clearfix"></div>
<div slot="header" class="clearfix">对接平台密钥信息</div>
<el-form-item label="对接平台唯一识别密钥(OperatorSecret)" prop="theirOperatorSecret"
style="margin-top: 20px;">
<el-input v-model="form.theirOperatorSecret"
@@ -43,8 +43,8 @@
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span></span>
<el-button style="float: right; padding: 3px 0" type="text">生成密钥</el-button>
<span>我方生成密钥信息</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="generateSecret">生成密钥</el-button>
</div>
<el-form-item label="我方唯一识别密钥(OperatorSecret)" prop="ourOperatorSecret"
style="margin-top: 20px;">
@@ -71,7 +71,7 @@
</div>
</el-tab-pane>
<el-tab-pane label="同步数据" name="pile">
<el-tab-pane label="同步数据" name="notification">
</el-tab-pane>
@@ -82,13 +82,15 @@
<script>
import { getSecret } from "@/api/thirdParty/secret";
import {addSecret, getSecret, updateSecret} from "@/api/thirdParty/secret";
import {generateRandomID} from "@/utils/common";
export default {
dicts: ["third_party_type"],
components: {},
data() {
return {
activeName: "secret",
id: this.$route.params.id,
platformName: this.$route.params.platformName,
// 表单参数
@@ -100,9 +102,22 @@ export default {
},
created() {
this.updateTitle();
this.querySecretDetail();
},
methods: {
querySecretDetail(row) {
// 生成密钥
generateSecret() {
console.log("生成密钥");
this.form.ourOperatorSecret = generateRandomID(16);
this.form.ourDataSecret = generateRandomID(16);
this.form.ourDataSecretIv = generateRandomID(16);
this.form.ourSigSecret = generateRandomID(16);
},
handleClick(tab, event) {
console.log(tab, event);
// this.initializeData(tab.name);
},
querySecretDetail() {
getSecret(this.id).then(response => {
this.form = response.data;
this.open = true;
@@ -116,6 +131,25 @@ export default {
const route = Object.assign({}, this.$route, { title: `${title}` });
this.$store.dispatch("tagsView/updateVisitedView", route);
},
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSecret(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSecret(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
}
},
mounted() {