Commit b2958976 authored by xinzhedeai's avatar xinzhedeai

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

parent 06ed9355
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
@click="clearSearch" @click="clearSearch"
>重置</el-button >重置</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>
</div> </div>
...@@ -89,6 +92,8 @@ import API from "@/api/newResource/data.js"; ...@@ -89,6 +92,8 @@ import API from "@/api/newResource/data.js";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import { downloadFile } from '@/utils'
import request from '@/utils/request'
export default { export default {
name: "newResourceDisplaceMachine", // 本页面名 name: "newResourceDisplaceMachine", // 本页面名
...@@ -104,6 +109,7 @@ export default { ...@@ -104,6 +109,7 @@ export default {
size: 10, size: 10,
// 当前页码 // 当前页码
page: 1, page: 1,
exporting:false
}; };
}, },
components: { DateRangePicker }, components: { DateRangePicker },
...@@ -111,6 +117,26 @@ export default { ...@@ -111,6 +117,26 @@ export default {
this.search() this.search()
}, },
methods: { 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() { getData() {
this.loading = true; this.loading = true;
API.getDataList({ API.getDataList({
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
@click="clearSearch" @click="clearSearch"
>重置</el-button >重置</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>
</div> </div>
...@@ -75,6 +78,8 @@ ...@@ -75,6 +78,8 @@
<script> <script>
import API from "@/api/newResource/data.js"; import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import { downloadFile } from '@/utils'
import request from '@/utils/request'
export default { export default {
name: "newResourceDisplaceMachine", // 本页面名 name: "newResourceDisplaceMachine", // 本页面名
...@@ -90,6 +95,7 @@ export default { ...@@ -90,6 +95,7 @@ export default {
size: 10, size: 10,
// 当前页码 // 当前页码
page: 1, page: 1,
exporting:false
}; };
}, },
components: { DateRangePicker }, components: { DateRangePicker },
...@@ -97,6 +103,27 @@ export default { ...@@ -97,6 +103,27 @@ export default {
this.search() this.search()
}, },
methods: { 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() { getData() {
this.loading = true; this.loading = true;
API.getDataList4windSpeed({ API.getDataList4windSpeed({
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
@click="clearSearch" @click="clearSearch"
>重置</el-button >重置</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>
</div> </div>
...@@ -75,6 +78,8 @@ ...@@ -75,6 +78,8 @@
<script> <script>
import API from "@/api/newResource/data.js"; import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import { downloadFile } from '@/utils'
import request from '@/utils/request'
export default { export default {
name: "newResourceDisplaceMachine", // 本页面名 name: "newResourceDisplaceMachine", // 本页面名
...@@ -90,6 +95,7 @@ export default { ...@@ -90,6 +95,7 @@ export default {
size: 10, size: 10,
// 当前页码 // 当前页码
page: 1, page: 1,
exporting:false
}; };
}, },
components: { DateRangePicker }, components: { DateRangePicker },
...@@ -97,6 +103,27 @@ export default { ...@@ -97,6 +103,27 @@ export default {
this.search() this.search()
}, },
methods: { 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() { getData() {
this.loading = true; this.loading = true;
API.getDataList4windSpeed({ API.getDataList4windSpeed({
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
@click="clearSearch" @click="clearSearch"
>重置</el-button >重置</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>
</div> </div>
...@@ -81,6 +84,8 @@ ...@@ -81,6 +84,8 @@
<script> <script>
import API from "@/api/newResource/data.js"; import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import { downloadFile } from '@/utils'
import request from '@/utils/request'
export default { export default {
name: "waterPrecipitation", // 本页面名 name: "waterPrecipitation", // 本页面名
...@@ -96,6 +101,7 @@ export default { ...@@ -96,6 +101,7 @@ export default {
size: 10, size: 10,
// 当前页码 // 当前页码
page: 1, page: 1,
exporting:false
}; };
}, },
components: { DateRangePicker }, components: { DateRangePicker },
...@@ -103,6 +109,27 @@ export default { ...@@ -103,6 +109,27 @@ export default {
this.search() this.search()
}, },
methods: { 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() { getData() {
this.loading = true; this.loading = true;
API.getDataList4waterPrecipitation({ 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