修改cmdid

ds1.0
fanluyan 2 years ago
parent 928a738eb6
commit aecda13102

@ -186,19 +186,19 @@
> >
<el-form-item label="CMD_ID"> <el-form-item label="CMD_ID">
<el-input <el-input
v-model="idParameter.newcmdid" v-model="idParameter.newCmdId"
disabled="disabled" disabled="disabled"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="杆塔ID"> <el-form-item label="杆塔ID">
<el-input <el-input
v-model="idParameter.compid" v-model="idParameter.componentId"
disabled="disabled" disabled="disabled"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="原始ID"> <el-form-item label="原始ID">
<el-input <el-input
v-model="idParameter.orgid" v-model="idParameter.originalId"
disabled="disabled" disabled="disabled"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -216,14 +216,14 @@
label-width="124px" label-width="124px"
> >
<el-form-item label="CMD_ID"> <el-form-item label="CMD_ID">
<el-input v-model="idParameter.newcmdid"></el-input> <el-input v-model="idParameter.newCmdId"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="杆塔ID"> <el-form-item label="杆塔ID">
<el-input v-model="idParameter.compid"></el-input> <el-input v-model="idParameter.componentId"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="原始ID"> <el-form-item label="原始ID">
<el-input <el-input
v-model="idParameter.orgid" v-model="idParameter.originalId"
disabled="disabled" disabled="disabled"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -391,16 +391,17 @@ export default {
}, },
//id //id
idParameter: { idParameter: {
newcmdid: "", newCmdId: "",
compid: "", componentId: "",
orgid: "", originalId: "",
}, },
runStatusForm: {}, runStatusForm: {},
gpsForm: {}, //gps gpsForm: {}, //gps
tabsActive: "first", tabsActive: "first",
rowData: {}, rowData: {},
requestid: "", requestid: "",
uptimer: null,
timer: null,
i: 0, i: 0,
}; };
}, },
@ -410,6 +411,9 @@ export default {
methods: { methods: {
//tab //tab
handleClick(tab, event) { handleClick(tab, event) {
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
console.log(tab, event); console.log(tab, event);
// //
this.tabsActive = "first"; this.tabsActive = "first";
@ -431,22 +435,22 @@ export default {
samphandleClick() { samphandleClick() {
this.samplingForm = {}; this.samplingForm = {};
this.i = 0; this.i = 0;
clearInterval(this.uptimer); this.timer = null;
this.uptimer = null; clearInterval(this.timer);
}, },
// //
uphandleClick() { uphandleClick() {
this.upperComputer = {}; this.upperComputer = {};
this.i = 0; this.i = 0;
clearInterval(this.uptimer); this.timer = null;
this.uptimer = null; clearInterval(this.timer);
}, },
//id //id
idhandleClick() { idhandleClick() {
this.idParameter = {}; this.idParameter = {};
this.i = 0; this.i = 0;
clearInterval(this.uptimer); this.timer = null;
this.uptimer = null; clearInterval(this.timer);
}, },
// //
// -act=sampling [0xA4 ] --flag=[Request Set Flag, default is set=1, 0: request] --rf=[Request Flag] --reqtype=[Request Type] --maintime=[Main Time] --samplecount=[Sample Count] --samplingfreq=[Sample Frequency] --heartbeat=[Heartbeat Time] // -act=sampling [0xA4 ] --flag=[Request Set Flag, default is set=1, 0: request] --rf=[Request Flag] --reqtype=[Request Type] --maintime=[Main Time] --samplecount=[Sample Count] --samplingfreq=[Sample Frequency] --heartbeat=[Heartbeat Time]
@ -677,15 +681,15 @@ export default {
}, },
{ {
name: "newcmdid", name: "newcmdid",
value: this.idParameter.newcmdid, value: this.idParameter.newCmdId,
}, },
{ {
name: "compid", name: "compid",
value: this.idParameter.compid, value: this.idParameter.componentId,
}, },
{ {
name: "orgid", name: "orgid",
value: this.idParameter.orgid, value: this.idParameter.originalId,
}, },
]; ];
this.setTermFn(params); this.setTermFn(params);
@ -718,44 +722,60 @@ export default {
.then((res) => { .then((res) => {
console.log(res); console.log(res);
this.requestid = res.data.requestId; this.requestid = res.data.requestId;
this.getinfo(); //this.getinfo1();
this.uptimer = window.setInterval(() => {
clearInterval(this.timer);
this.timer = window.setInterval(() => {
this.getinfo(); this.getinfo();
this.i++; this.i++;
}, 1000); }, 1000);
// this.timer = setInterval(() => {
// this.getinfo();
// this.i++;
// }, 1000);
}) })
.catch((err) => {}); .catch((err) => {});
}, },
getinfo1() {
console.log("jinlaile");
if (this.i > 10) {
console.log(this.i);
// console.log(this.i);
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
}
},
getinfo() { getinfo() {
getTermCameraRequest({ requestid: this.requestid }) getTermCameraRequest({ requestid: this.requestid })
.then((res) => { .then((res) => {
if (res.data.success == 1) { if (res.data.success == 1) {
window.clearInterval(this.timer);
this.timer = null;
this.i = 0; this.i = 0;
clearInterval(this.uptimer);
this.uptimer = null;
console.log("终止轮询"); console.log("终止轮询");
// && res.data.result == 255 // && res.data.result == 255
console.log(JSON.parse(res.data.data)); console.log(JSON.parse(res.data.data));
this.samplingForm = JSON.parse(res.data.data); this.samplingForm = JSON.parse(res.data.data);
console.log(this.tabsActive); //ip
this.upperComputer = JSON.parse(res.data.data); this.upperComputer = JSON.parse(res.data.data);
console.log(this.upperComputer); //cmdid
this.idParameter = JSON.parse(res.data.data);
let hexArray = this.upperComputer.ip let hexArray = this.upperComputer.ip
.toString(16) .toString(16)
.match(/.{1,2}/g) .match(/.{1,2}/g)
.reverse(); .reverse();
console.log(hexArray); console.log(hexArray);
for (let j = 0; j < hexArray.length; j++) {
for (let i = 0; i < hexArray.length; i++) { console.log(hexArray[j]);
console.log(hexArray[i]); console.log(parseInt(hexArray[j], 16));
console.log(parseInt(hexArray[i], 16)); hexArray[j] = parseInt(hexArray[j], 16);
hexArray[i] = parseInt(hexArray[i], 16);
} }
console.log(hexArray); console.log(hexArray);
this.upperComputer.ip = hexArray.join("."); this.upperComputer.ip = hexArray.join(".");
//ip
this.idParameter = JSON.parse(res.data.data); console.log(this.idParameter);
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
@ -763,10 +783,9 @@ export default {
type: "success", type: "success",
}); });
} else if (this.i > 9) { } else if (this.i > 9) {
this.loading = false; window.clearInterval(this.timer);
this.timer = null;
this.i = 0; this.i = 0;
clearInterval(this.uptimer);
this.uptimer = null;
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
@ -850,10 +869,18 @@ export default {
this.idParameter = {}; this.idParameter = {};
this.gpsForm = {}; this.gpsForm = {};
this.i = 0; this.i = 0;
clearInterval(this.uptimer); clearInterval(this.timer);
this.uptimer = null; this.timer = null;
}, },
}, },
destroyed() {
if (this.timer) {
console.log(this.timer);
clearInterval(this.timer);
this.timer = null;
this.i = 0;
} //vue
},
}; };
</script> </script>
<style lang="less"> <style lang="less">

Loading…
Cancel
Save