优化数据记录导出判断,重新查询之后再进行导出判断

This commit is contained in:
zhanghan11 2024-04-12 10:36:59 +08:00
parent 8709c3b610
commit 2559b597f5
3 changed files with 41 additions and 1 deletions

View File

@ -285,6 +285,26 @@ export default {
methods: {
/** 导出数据 */
exportData() {
this.queryParams.pageNum = 1;
this.queryParams.startTime = null;
this.queryParams.endTime = null;
if (this.queryParams.datetimerange && this.queryParams.datetimerange[0]) {
this.queryParams.startTime = this.dateToStr(
this.queryParams.datetimerange[0]
);
this.queryParams.endTime = this.dateToStr(
this.queryParams.datetimerange[1]
);
}
this.loading = true;
getPlcDataLog(this.queryParams).then((response) => {
this.dataList = response.data.rows;
this.total = response.data.total;
this.loading = false;
this.downloadFile();
});
},
downloadFile() {
if (this.total > 10000) {
this.$message({
showClose: true,

View File

@ -257,6 +257,26 @@ export default {
methods: {
/** 导出数据 */
exportData() {
this.queryParams.pageNum = 1;
this.queryParams.startTime = null;
this.queryParams.endTime = null;
if (this.queryParams.datetimerange && this.queryParams.datetimerange[0]) {
this.queryParams.startTime = this.dateToStr(
this.queryParams.datetimerange[0]
);
this.queryParams.endTime = this.dateToStr(
this.queryParams.datetimerange[1]
);
}
this.loading = true;
getSensorDataLog(this.queryParams).then((response) => {
this.dataList = response.data.rows;
this.total = response.data.total;
this.loading = false;
this.downloadFile();
});
},
downloadFile() {
if (this.total > 10000) {
this.$message({
showClose: true,

View File

@ -490,7 +490,7 @@ export default {
created() {
this.getMonitorPartList();
this.getPlcMonitorParamsList();
this.getSensorMonitorParamsList();
// this.getSensorMonitorParamsList();
this.getList();
},
methods: {