add 后管推送站点信息到联联平台

This commit is contained in:
Lemon
2023-05-26 08:58:42 +08:00
parent fd84575155
commit 7c53e44830
9 changed files with 235 additions and 106 deletions

View File

@@ -31,72 +31,87 @@
<billing ref="billing" :stationId="stationId"/>
</el-tab-pane>
<!-- <el-tab-pane label="客户管理" name="member">-->
<!-- 角色管理-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="客户管理" name="member">-->
<!-- 角色管理-->
<!-- </el-tab-pane>-->
<el-tab-pane label="运营管理" name="operation">
<el-card style="margin-bottom:10px">
<h2>二维码配置</h2>
<el-form label-position="right" label-width="200px" style="margin-top:10px">
<el-row>
<el-col span="12">
<el-form-item label="当前配置二维码规则:">
<el-input v-model="stationDetail.qrcodePrefix" maxlength="100px" :disabled="true"/>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item>
<el-button icon="el-icon-setting" size="big" @click="handleCreate" v-has-permi = "['pile:station:edit']">配置参数</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card style="margin-bottom:10px">
<h2>二维码配置</h2>
<el-form label-position="right" label-width="200px" style="margin-top:10px">
<el-row>
<el-col span="12">
<el-form-item label="当前配置二维码规则:">
<el-input v-model="stationDetail.qrcodePrefix" maxlength="100px" :disabled="true"/>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item>
<el-button icon="el-icon-setting" size="big" @click="handleCreate"
v-has-permi="['pile:station:edit']">配置参数
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card>
<h2>互联互通配置</h2>
<el-button icon="el-icon-edit" size="big" @click="openEdit" v-has-permi = "['pile:station:edit']" >编辑参数</el-button>
<el-form ref="stationSettingForm" :model="stationSettingInfo" label-position="right" label-width="200px" style="margin-top:10px">
<el-row>
<el-col :span="12">
<el-form-item label="运营商ID" prop="operatorId">
<el-input placeholder="请输入" v-model="stationSettingInfo.operatorId" :disabled="disableFlag"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="运营商密钥" prop="operatorSecret">
<el-input placeholder="请输入" v-model="stationSettingInfo.operatorSecret" :disabled="disableFlag"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="消息Data密钥:" prop="dataSecret">
<el-input placeholder="请输入" v-model="stationSettingInfo.dataSecret" :disabled="disableFlag"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="签名密钥" prop="signSecret">
<el-input placeholder="请输入" v-model="stationSettingInfo.signSecret" :disabled="disableFlag"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="消息Data密钥初始化向量" prop="dataSecretIv">
<el-input placeholder="请输入" v-model="stationSettingInfo.dataSecretIv" :disabled="disableFlag"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item>
<el-button size="big" @click="submitConfigForm" v-has-permi = "['pile:station:edit']">提交</el-button>
<!-- <el-button icon="el-icon-edit" size="big" @click="openEdit" v-has-permi = "['pile:station:edit']" >编辑参数</el-button>-->
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card>
<h2>互联互通配置</h2>
<el-button icon="el-icon-edit" size="big" @click="openEdit" v-has-permi="['pile:station:edit']">编辑参数
</el-button>
<el-form ref="stationSettingForm" :model="stationSettingInfo" label-position="right" label-width="200px"
style="margin-top:10px">
<el-row>
<el-col :span="12">
<el-form-item label="对接平台名称" prop="type">
<el-input placeholder="请输入" v-model="stationSettingInfo.type" :disabled="disableFlag"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="对接平台url地址" prop="urlAddress">
<el-input placeholder="请输入" v-model="stationSettingInfo.urlAddress" :disabled="disableFlag"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="运营商ID" prop="operatorId">
<el-input placeholder="请输入" v-model="stationSettingInfo.operatorId" :disabled="disableFlag"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="运营商密钥" prop="operatorSecret">
<el-input placeholder="请输入" v-model="stationSettingInfo.operatorSecret" :disabled="disableFlag"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="消息Data密钥:" prop="dataSecret">
<el-input placeholder="请输入" v-model="stationSettingInfo.dataSecret" :disabled="disableFlag"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="签名密钥" prop="signSecret">
<el-input placeholder="请输入" v-model="stationSettingInfo.signSecret" :disabled="disableFlag"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="消息Data密钥初始化向量" prop="dataSecretIv">
<el-input placeholder="请输入" v-model="stationSettingInfo.dataSecretIv" :disabled="disableFlag"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item>
<el-button size="big" @click="submitConfigForm" v-has-permi="['pile:station:edit']">提交</el-button>
<el-button size="big" @click="pushStation" v-has-permi="['pile:station:edit']">推送站点信息</el-button>
<!-- <el-button icon="el-icon-edit" size="big" @click="openEdit" v-has-permi = "['pile:station:edit']" >编辑参数</el-button>-->
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-tab-pane>
<el-tab-pane label="站点白名单" name="whitelist">
@@ -126,7 +141,13 @@ import pileList from "./pileList.vue";
import MapContainer from "../../../components/MapContainer/MapContainer.vue";
import stationOrderList from "@/views/pile/station/stationOrderList";
import stationWhiteList from "@/views/pile/station/stationWhiteList";
import {getStationInfo, updateStationQRCodePrefix, getSettingByStationId, updateSettingByStationId} from "@/api/pile/station";
import {
getStationInfo,
updateStationQRCodePrefix,
getSettingByStationId,
updateSettingByStationId,
pushStationInfo
} from "@/api/pile/station";
import Whitelist from "@/views/pile/station/stationWhiteList";
export default {
@@ -152,8 +173,8 @@ export default {
stationId: this.$route.params.id,
stationName: this.$route.params.stationName,
stationDetail: {},
stationLat:null,
stationLng:null,
stationLat: null,
stationLng: null,
stationSettingInfo: {},
disableFlag: true,
};
@@ -163,7 +184,7 @@ export default {
// const stationId = this.stationId;
const stationName = this.stationName;
const title = "【" + stationName + "】站点详情";
const route = Object.assign({}, this.$route, { title: `${title}` })
const route = Object.assign({}, this.$route, {title: `${title}`})
this.$store.dispatch('tagsView/updateVisitedView', route);
this.queryStationInfo();
this.getStationSettingInfo();
@@ -199,13 +220,13 @@ export default {
this.stationDetail = res.data;
this.stationLat = res.data.stationLat
this.stationLng = res.data.stationLng
console.log(this.stationLat,this.stationLng,"父组件里面的经纬度")
console.log(this.stationLat, this.stationLng, "父组件里面的经纬度")
});
console.log("queryStationInfo==", this.stationDetail);
},
// 查询站点互联互通配置信息
getStationSettingInfo() {
getSettingByStationId(this.stationId).then((res) =>{
getSettingByStationId(this.stationId).then((res) => {
console.log("stationId:", this.stationId)
console.log("getSettingByStationId==", res)
this.stationSettingInfo = res.data;
@@ -213,7 +234,7 @@ export default {
},
// 开放编辑按钮
openEdit(){
openEdit() {
this.disableFlag = false;
},
@@ -221,6 +242,7 @@ export default {
submitConfigForm() {
const param = {
stationId: this.stationId,
urlAddress: this.stationSettingInfo.urlAddress,
operatorId: this.stationSettingInfo.operatorId,
operatorSecret: this.stationSettingInfo.operatorSecret,
dataSecret: this.stationSettingInfo.dataSecret,
@@ -229,16 +251,27 @@ export default {
}
console.log("param:", param);
this.$refs.stationSettingForm.validate((valid) => {
if(valid){
if (valid) {
updateSettingByStationId(param).then((response) => {
this.$modal.msgSuccess('修改成功')
this.disableFlag = true;
})
} else{
} else {
return false
}
})
},
// 推送站点
pushStation() {
const param = {
stationId: this.stationId,
}
pushStationInfo(param).then((response) => {
this.$modal.msgSuccess('推送成功')
this.disableFlag = true;
})
},
// 配置参数按钮
handleCreate() {
this.dialogTitle = '配置参数';
@@ -256,12 +289,12 @@ export default {
console.log("form:", this.form);
console.log("param:", param);
this.$refs.form.validate((valid) => {
if(valid){
if (valid) {
updateStationQRCodePrefix(param).then((response) => {
this.$modal.msgSuccess('修改成功')
this.dialogFormVisible = false
})
} else{
} else {
return false
}
})