update 平台配置页面

This commit is contained in:
2024-04-24 17:08:14 +08:00
parent bf0e3f5334
commit 9ed65fbd23
13 changed files with 375 additions and 42 deletions

View File

@@ -81,7 +81,80 @@
</el-tab-pane>
<el-tab-pane label="同步数据" name="notification">
<template v-if="stationList.length > 0">
<el-row :gutter="20">
<div v-for="s in stationList" :key="s" class="text item">
<el-col :span="8">
<el-card class="box-card" style="margin-right: 50px;" shadow="hover">
<el-descriptions title="站点">
<el-descriptions-item label="站点id">{{ s.stationId }}</el-descriptions-item>
<el-descriptions-item label="站点名称">{{ s.stationName }}</el-descriptions-item>
<el-descriptions-item>
<el-button @click="clickDrawer(s.stationId, s.stationName)" type="primary" style="margin-left: 16px;">
打开通知菜单
</el-button>
</el-descriptions-item>
</el-descriptions>
</el-card>
</el-col>
</div>
</el-row>
</template>
<el-empty description="暂无数据" v-else></el-empty>
<el-drawer
:title="drawerTitle"
:visible.sync="drawer"
:direction="direction">
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark">
<span>推送充电站信息变化</span>
<el-form ref="form" :model="form" label-width="20%">
<el-form-item label="活动名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">推送</el-button>
</el-form-item>
</el-form>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark">
<span>推送设备状态</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark">
<span>推送设备充电中状态</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark">
<span>推送充电订单信息</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark">
<span>推送站点费率</span>
</div>
</el-col>
</el-row>
</el-drawer>
</el-tab-pane>
</el-tabs>
@@ -91,12 +164,13 @@
<script>
import {addSecret, getSecret, updateSecret} from "@/api/thirdParty/secret";
import {addSecret, getSecret, selectStationList, updateSecret} from "@/api/thirdParty/secret";
import {generateRandomID, isEmptyString} from "@/utils/common";
import Template from "@/views/billing/template";
export default {
dicts: ["third_party_type"],
components: {},
components: {Template},
data() {
return {
activeName: "secret",
@@ -105,14 +179,45 @@ export default {
// 表单参数
form: {},
// 表单校验
rules: {}
rules: {},
stationList: [],
platformType: null,
drawer: false,
direction: 'rtl',
drawerTitle: null,
};
},
created() {
this.updateTitle();
this.querySecretDetail();
},
methods: {
// 提交
onSubmit() {
},
clickDrawer(stationId, stationName) {
console.log("站点id", stationId);
this.drawerTitle = "同步【" + stationName + "】站点的数据到【" + this.platformName + "】";
this.drawer = true;
},
// Drawer :before-close="handleClose"
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
// 查询站点列表
queryStationList() {
const param = {
platformType: this.platformType
};
selectStationList(param).then(response => {
this.stationList = response.data;
console.log(this.stationList);
});
},
// 生成密钥
clickGenerateSecret() {
// 是否有值默认false
@@ -145,14 +250,20 @@ export default {
this.form.ourSigSecret = generateRandomID(16);
},
handleClick(tab, event) {
console.log(tab, event);
// this.initializeData(tab.name);
// console.log("handleClick", tab, event);
this.initializeData(tab.name);
},
initializeData(name) {
if (name === "secret") {
this.querySecretDetail();
} else if (name === "notification") {
this.queryStationList();
}
},
querySecretDetail() {
getSecret(this.id).then(response => {
this.form = response.data;
this.open = true;
// this.title = "修改对接三方平台配置";
this.platformType = response.data.platformType;
});
},
// 更新页面title显示
@@ -183,7 +294,7 @@ export default {
}
},
mounted() {
this.initializeData(this.activeName);
},
};
</script>