Commit 6d70fe34 authored by dxw's avatar dxw

导出

parent d0b77647
...@@ -50,6 +50,14 @@ ...@@ -50,6 +50,14 @@
@click="getDataList()" @click="getDataList()"
>查询</el-button >查询</el-button
> >
<el-button
type="primary"
style="margin-left: 10px"
size="mini"
icon="el-icon-upload"
@click="excel()"
>导出</el-button
>
<!-- <el-form-item label="时间范围:"> <!-- <el-form-item label="时间范围:">
<el-button <el-button
size="mini" size="mini"
...@@ -150,8 +158,8 @@ export default { ...@@ -150,8 +158,8 @@ export default {
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
resourceType: this.activetap, //资源点类型 resourceType: this.activetap, //资源点类型
startTime: this.startTime, startTime: this.startTime==null?'':this.startTime,
endTime: this.endTime endTime: this.endTime==null?'':this.endTime
}) })
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
...@@ -160,6 +168,12 @@ export default { ...@@ -160,6 +168,12 @@ export default {
} }
}) })
}, },
excel() {
console.log('startTime:' , this.startTime)
let paramts = "resourceType=" + this.activetap + "&startTime=" + (this.startTime==null?'':this.startTime) + "&endTime=" + (this.endTime==null?'':this.endTime);
console.log('paramts:' , paramts)
window.location.href = window.CONFIG.requestPath + "/admin/analysis/export/toExcelFx?" + paramts;
},
// 开始时间change事件 // 开始时间change事件
startChangeHandle(val) { startChangeHandle(val) {
if (val) { if (val) {
......
...@@ -73,8 +73,8 @@ export default { ...@@ -73,8 +73,8 @@ export default {
url: this.$http.adornUrl('/analysis/getFaultAlarmList'), url: this.$http.adornUrl('/analysis/getFaultAlarmList'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
startTime: this.startTime, startTime: this.startTime==null?'':this.startTime,
endTime: this.endTime endTime: this.endTime==null?'':this.endTime
}) })
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
......
...@@ -86,8 +86,8 @@ export default { ...@@ -86,8 +86,8 @@ export default {
params: this.$http.adornParams({ params: this.$http.adornParams({
resourceId: '', resourceId: '',
region: Number(this.activeName), //区域类型 region: Number(this.activeName), //区域类型
startTime: this.startTime, startTime: this.startTime==null?'':this.startTime,
endTime: this.endTime endTime: this.endTime==null?'':this.endTime
}) })
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
......
...@@ -78,8 +78,8 @@ export default { ...@@ -78,8 +78,8 @@ export default {
url: this.$http.adornUrl('/analysis/getSwqxzInfoTj'), url: this.$http.adornUrl('/analysis/getSwqxzInfoTj'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
startTime: this.startTime, startTime: this.startTime==null?'':this.startTime,
endTime: this.endTime endTime: this.endTime==null?'':this.endTime
}) })
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期") placeholder="选择日期")
el-button( type="primary" style='margin-left:10px;' size="mini" icon="el-icon-search" @click="getList()") 查询 el-button( type="primary" style='margin-left:10px;' size="mini" icon="el-icon-search" @click="getList()") 查询
el-button( type="primary" style="margin-left: 10px" size="mini" icon="el-icon-upload" @click="excel()") 导出
span(v-if="type==1") span(v-if="type==1")
el-table( :data='dataList' size="mini" ,style='width: 100%;' :header-cell-style="{ background: '#EEF8FF', color: '#333333' }") el-table( :data='dataList' size="mini" ,style='width: 100%;' :header-cell-style="{ background: '#EEF8FF', color: '#333333' }")
el-table-column( :resizable="false" type='index', header-align='center', align='center', label='序号') el-table-column( :resizable="false" type='index', header-align='center', align='center', label='序号')
...@@ -115,8 +116,8 @@ export default { ...@@ -115,8 +116,8 @@ export default {
params: this.$http.adornParams({ params: this.$http.adornParams({
resourceId: this.dataForm.id, resourceId: this.dataForm.id,
resourceType: this.dataForm.type, resourceType: this.dataForm.type,
startTime: this.startTime, startTime: this.startTime==null?'':this.startTime,
endTime: this.endTime, endTime: this.endTime==null?'':this.endTime,
page: page || this.pageIndex, page: page || this.pageIndex,
rows: size || this.pageSize rows: size || this.pageSize
}) })
...@@ -131,6 +132,10 @@ export default { ...@@ -131,6 +132,10 @@ export default {
} }
}) })
}, },
excel() {
let paramts = "resourceId=" + this.dataForm.id + "&resourceType=" + this.dataForm.type + "&startTime=" + (this.startTime==null?'':this.startTime) + "&endTime=" + (this.endTime==null?'':this.endTime);
window.location.href = window.CONFIG.requestPath + "/admin/kanban/export/toExcel?" + paramts;
},
getDataListTb() { getDataListTb() {
this.$http({ this.$http({
url: this.$http.adornUrl('/analysis/getSnqxzInfoTj'), url: this.$http.adornUrl('/analysis/getSnqxzInfoTj'),
......
...@@ -45,6 +45,11 @@ el-dialog( ...@@ -45,6 +45,11 @@ el-dialog(
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期") placeholder="选择日期")
el-button( type="primary" style='margin-left:10px;' size="mini" icon="el-icon-search" @click="getList()") 查询 el-button( type="primary" style='margin-left:10px;' size="mini" icon="el-icon-search" @click="getList()") 查询
el-button(type="primary"
style="margin-left: 10px"
size="mini"
icon="el-icon-upload"
@click="excel()") 导出
span(v-if="type == 1") span(v-if="type == 1")
el-table( el-table(
:data="dataList", :data="dataList",
...@@ -252,8 +257,8 @@ export default { ...@@ -252,8 +257,8 @@ export default {
params: this.$http.adornParams({ params: this.$http.adornParams({
resourceId: this.dataForm.id, resourceId: this.dataForm.id,
resourceType: this.dataForm.type, //室外气象站 resourceType: this.dataForm.type, //室外气象站
startTime: this.startTime, startTime: this.startTime==null?'':this.startTime,
endTime: this.endTime, endTime: this.endTime==null?'':this.endTime,
page: page || this.pageIndex, page: page || this.pageIndex,
rows: size || this.pageSize rows: size || this.pageSize
}) })
...@@ -268,6 +273,10 @@ export default { ...@@ -268,6 +273,10 @@ export default {
} }
}) })
}, },
excel() {
let paramts = "resourceId=" + this.dataForm.id + "&resourceType=" + this.dataForm.type + "&startTime=" + (this.startTime==null?'':this.startTime) + "&endTime=" + (this.endTime==null?'':this.endTime);
window.location.href = window.CONFIG.requestPath + "/admin/kanban/export/toExcel?" + paramts;
},
getDataListTb() { getDataListTb() {
this.$http({ this.$http({
url: this.$http.adornUrl('/analysis/getSwqxzInfoTj'), url: this.$http.adornUrl('/analysis/getSwqxzInfoTj'),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:visible.sync="visible" :visible.sync="visible"
:append-to-body="true" :append-to-body="true"
@close="cancelhandle" @close="cancelhandle"
width="1200px" width="70%"
> >
<el-form :inline="true" :model="dataForm"> <el-form :inline="true" :model="dataForm">
<el-form-item label="设备名称:" prop="name" style="margin-bottom: 0"> <el-form-item label="设备名称:" prop="name" style="margin-bottom: 0">
...@@ -89,7 +89,7 @@ const tableColums = [ ...@@ -89,7 +89,7 @@ const tableColums = [
{ {
label: '用电量', label: '用电量',
prop: 'electric_energy', prop: 'electric_energy',
width: 200, width: 400,
align: 'center' align: 'center'
}, },
// { // {
...@@ -136,6 +136,10 @@ export default { ...@@ -136,6 +136,10 @@ export default {
methods: { methods: {
init(data) { init(data) {
this.visible = true this.visible = true
this.startTime = ''
this.endTime = ''
this.startPickerOptions = {}
this.endPickerOptions = {}
this.dataForm = data this.dataForm = data
this.currentActive = 1 this.currentActive = 1
this.getDataList() //获取历史数据列表 this.getDataList() //获取历史数据列表
...@@ -147,8 +151,8 @@ export default { ...@@ -147,8 +151,8 @@ export default {
params: this.$http.adornParams({ params: this.$http.adornParams({
resourceId: this.dataForm.id, //资源点id resourceId: this.dataForm.id, //资源点id
resourceType: this.dataForm.type, //资源点类型 resourceType: this.dataForm.type, //资源点类型
startTime: this.startTime, startTime: this.startTime==null?'':this.startTime,
endTime: this.endTime, endTime: this.endTime==null?'':this.endTime,
page: page || this.pageIndex, page: page || this.pageIndex,
rows: size || this.pageSize rows: size || this.pageSize
}) })
...@@ -162,15 +166,16 @@ export default { ...@@ -162,15 +166,16 @@ export default {
} }
}) })
}, },
excel(){ excel() {
let paramts="resourceId="+this.dataForm.id+"&resourceType=" + this.dataForm.type + "&startTime=" + this.startTime + "&endTime=" + this.endTime; let paramts = "resourceId=" + this.dataForm.id + "&resourceType=" + this.dataForm.type + "&startTime=" + (this.startTime==null?'':this.startTime) + "&endTime=" + (this.endTime==null?'':this.endTime);
console.log("/kanban/excel?"+paramts); window.location.href = window.CONFIG.requestPath + "/admin/kanban/export/toExcel?" + paramts;
window.open("/kanban/excel?"+paramts);
}, },
cancelhandle() { cancelhandle() {
this.visible = false this.visible = false
this.startTime='' this.startTime = ''
this.endTime='' this.endTime = ''
this.startPickerOptions = {}
this.endPickerOptions = {}
}, },
// 开始时间change事件 // 开始时间change事件
startChangeHandle(val) { startChangeHandle(val) {
......
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