Commit b2958976 authored by xinzhedeai's avatar xinzhedeai

温度、风速、降雨、边坡监测 数据列表 导出功能添加

parent 06ed9355
......@@ -28,6 +28,9 @@
@click="clearSearch"
>重置</el-button
>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
<el-button :loading="exporting" class="filter-item" size="mini" type="info" plain icon="el-icon-download" @click="exportSubmit">导出</el-button>
</el-tooltip>
</div>
</div>
......@@ -89,6 +92,8 @@ import API from "@/api/newResource/data.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
import { downloadFile } from '@/utils'
import request from '@/utils/request'
export default {
name: "newResourceDisplaceMachine", // 本页面名
......@@ -104,6 +109,7 @@ export default {
size: 10,
// 当前页码
page: 1,
exporting:false
};
},
components: { DateRangePicker },
......@@ -111,6 +117,26 @@ export default {
this.search()
},
methods: {
exportSubmit() {
if(this.exporting){
return
}
this.exporting = true
request({
url: 'data/mp/download',
method: 'get',
params: {
time: this.datarealtime && this.datarealtime.join(',') || '',
sensorname: this.equipname,
},
responseType: 'blob'
}).then(response => {
downloadFile(response, '边坡监测', 'xlsx')
this.exporting = false
}).catch(() => {
this.exporting = false
})
},
getData() {
this.loading = true;
API.getDataList({
......
......@@ -28,6 +28,9 @@
@click="clearSearch"
>重置</el-button
>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
<el-button :loading="exporting" class="filter-item" size="mini" type="info" plain icon="el-icon-download" @click="exportSubmit">导出</el-button>
</el-tooltip>
</div>
</div>
......@@ -75,6 +78,8 @@
<script>
import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker'
import { downloadFile } from '@/utils'
import request from '@/utils/request'
export default {
name: "newResourceDisplaceMachine", // 本页面名
......@@ -90,6 +95,7 @@ export default {
size: 10,
// 当前页码
page: 1,
exporting:false
};
},
components: { DateRangePicker },
......@@ -97,6 +103,27 @@ export default {
this.search()
},
methods: {
exportSubmit() {
if(this.exporting){
return
}
this.exporting = true
request({
url: 'data/sz/download/wen',
method: 'get',
params: {
time: this.datarealtime && this.datarealtime.join(',') || '',
sensorname: this.equipname,
different: '温度'
},
responseType: 'blob'
}).then(response => {
downloadFile(response, '温度监测', 'xlsx')
this.exporting = false
}).catch(() => {
this.exporting = false
})
},
getData() {
this.loading = true;
API.getDataList4windSpeed({
......
......@@ -28,6 +28,9 @@
@click="clearSearch"
>重置</el-button
>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
<el-button :loading="exporting" class="filter-item" size="mini" type="info" plain icon="el-icon-download" @click="exportSubmit">导出</el-button>
</el-tooltip>
</div>
</div>
......@@ -75,6 +78,8 @@
<script>
import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker'
import { downloadFile } from '@/utils'
import request from '@/utils/request'
export default {
name: "newResourceDisplaceMachine", // 本页面名
......@@ -90,6 +95,7 @@ export default {
size: 10,
// 当前页码
page: 1,
exporting:false
};
},
components: { DateRangePicker },
......@@ -97,6 +103,27 @@ export default {
this.search()
},
methods: {
exportSubmit() {
if(this.exporting){
return
}
this.exporting = true
request({
url: 'data/sz/download/feng',
method: 'get',
params: {
time: this.datarealtime && this.datarealtime.join(',') || '',
sensorname: this.equipname,
different: '风速'
},
responseType: 'blob'
}).then(response => {
downloadFile(response, '风速监测', 'xlsx')
this.exporting = false
}).catch(() => {
this.exporting = false
})
},
getData() {
this.loading = true;
API.getDataList4windSpeed({
......
......@@ -28,6 +28,9 @@
@click="clearSearch"
>重置</el-button
>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
<el-button :loading="exporting" class="filter-item" size="mini" type="info" plain icon="el-icon-download" @click="exportSubmit">导出</el-button>
</el-tooltip>
</div>
</div>
......@@ -81,6 +84,8 @@
<script>
import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker'
import { downloadFile } from '@/utils'
import request from '@/utils/request'
export default {
name: "waterPrecipitation", // 本页面名
......@@ -96,6 +101,7 @@ export default {
size: 10,
// 当前页码
page: 1,
exporting:false
};
},
components: { DateRangePicker },
......@@ -103,6 +109,27 @@ export default {
this.search()
},
methods: {
exportSubmit() {
if(this.exporting){
return
}
this.exporting = true
request({
url: 'data/rg/download',
method: 'get',
params: {
time: this.datarealtime && this.datarealtime.join(',') || '',
sensorname: this.equipname,
different: '温度'
},
responseType: 'blob'
}).then(response => {
downloadFile(response, '降水监测', 'xlsx')
this.exporting = false
}).catch(() => {
this.exporting = false
})
},
getData() {
this.loading = true;
API.getDataList4waterPrecipitation({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment