Merge branch 'main' of http://39.101.199.1:8888/gongjiale/gangkou
This commit is contained in:
commit
aff024c6f9
|
@ -49,20 +49,17 @@ export default {
|
|||
watch: {
|
||||
queryParam: {
|
||||
handler: function (newVal, oldVal) {
|
||||
this.refreshDebounce();
|
||||
this.refresh();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
selectedDept: {
|
||||
handler: function (newVal, oldVal) {
|
||||
this.refreshDebounce();
|
||||
this.refresh();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.refreshDebounce = debounce(this.refresh, 100);
|
||||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
if (this.selectedDept && this.selectedDept.sn && this.queryParam) {
|
||||
|
@ -81,12 +78,17 @@ export default {
|
|||
this.chartData.Xdata = axisData;
|
||||
this.chartData.Ydata = seriesData;
|
||||
} else {
|
||||
this.chartData.Xdata = [];
|
||||
this.chartData.Ydata = [];
|
||||
this.resetChart();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.resetChart();
|
||||
}
|
||||
},
|
||||
resetChart() {
|
||||
this.chartData.Xdata = [];
|
||||
this.chartData.Ydata = [];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -32,8 +32,8 @@ export default {
|
|||
computed: {
|
||||
position() {
|
||||
return {
|
||||
lng: parseFloat(this.selectedDept.longitude),
|
||||
lat: parseFloat(this.selectedDept.latitude),
|
||||
lng: parseFloat(this.selectedDept?.longitude),
|
||||
lat: parseFloat(this.selectedDept?.latitude),
|
||||
};
|
||||
},
|
||||
},
|
||||
|
|
|
@ -87,7 +87,12 @@ export default {
|
|||
refresh() {
|
||||
if (this.queryParam.deptId) {
|
||||
getDeviceList(this.queryParam.deptId, this.pager).then((res) => {
|
||||
if (res.code === 200 && res.rows.length > 0) {
|
||||
if (res.code === 200) {
|
||||
if (res.rows.length === 0) {
|
||||
this.tableData = [];
|
||||
this.deptSelect(null);
|
||||
return;
|
||||
}
|
||||
this.tableData = res.rows;
|
||||
this.radio = res.rows[0].id;
|
||||
this.pager.total = res.total;
|
||||
|
|
Loading…
Reference in New Issue