@@ -613,7 +620,8 @@ export default {
options: [],
getSensorList: [], // 传感器列表
checkList: "",
- checkList2: "",
+ checkList2: {},
+ firstSelect: "",
dateTime: [],
searchDate: 1,
pointList: [],
@@ -658,7 +666,7 @@ export default {
relaId: this.relaId,
projectSn: this.projectSn,
startTime: this.dateTime != null ? this.dateTime[0] : "",
- endTime: this.dateTime != null ? this.dateTime[1] : "",
+ endTime: this.dateTime != null ? this.dateTime[1] : ""
}).then(res => {
console.log("有数据吗", res);
if (res.code == 200 && res.result) {
@@ -1716,22 +1724,29 @@ export default {
// this.createdEchart7()
},
checkNum(val) {
+ this.firstSelect = val;
console.log("当前选择", val);
- getSensorListApi({ measurePointNumber: val }).then(res => {
+ getSensorListApi({ measurePointNumber: this.firstSelect }).then(res => {
if (res.code == 200 && res.result) {
+ console.log("---------", res);
this.getSensorList = res.result;
+ if (this.getSensorList.length != 0) {
+ this.checkList2 = this.getSensorList[0].sensorSn;
+ this.getEchartsData();
+ }
}
});
},
+
getEchartsData(val) {
console.log("第二个选择", val);
selectDeepExcavationCurrentDataListApi({
measurePointNumber: this.checkList,
relaId: this.relaId,
- sensorSn : val,
+ sensorSn: val,
projectSn: this.projectSn,
startTime: this.dateTime != null ? this.dateTime[0] : "",
- endTime: this.dateTime != null ? this.dateTime[1] : "",
+ endTime: this.dateTime != null ? this.dateTime[1] : ""
}).then(res => {
// console.log("有数据吗", res);
if (res.code == 200 && res.result) {
@@ -1755,15 +1770,25 @@ export default {
});
},
checkDateTime(val) {
- if(this.checkList == '' || this.checkList2 == '' ){
- this.$message({
- message: '请先选择传感器名称和编号哦!',
- type: 'warning'
+ if (this.checkList == "" || this.checkList2 == "") {
+ this.$message({
+ message: "请先选择传感器名称和编号哦!",
+ type: "warning"
});
- }
+ }
console.log(val);
this.selectDeepExcavationCurrentDataList();
}
+ },
+ watch: {
+ firstSelect: {
+ handler(newval, oldval) {
+ if (newval != oldval) {
+ (this.checkList2 = ""), this.getEchartsData();
+ }
+ },
+ immediate: true
+ }
}
};