Commit 793f4710 by jack

设备关系明细列表增加导出功能

1 parent 96824ea2
......@@ -524,4 +524,7 @@ export const LOGOUT = params => {
method: 'GET',
data: params
})
}
\ No newline at end of file
}
//设备管理-设备关系明细-导出excel
export const EXPORTDEVICEFILE = BASEURL + 'JXCDevice/exportDeviceFile';
\ No newline at end of file
......@@ -45,6 +45,9 @@
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-download" :loading="downloadLoading" @click="download()">导出excel</el-button>
</el-form-item>
</el-form>
</el-card>
......@@ -233,8 +236,10 @@ import {
GETMAXDEVICESTATISREPORT,
GETDEVICERELATIONDETAIL,
INITDEVICERELATION,
EXPORTDEVICEFILE
} from '@/http/interface'
import GlsxDialog from '@/components/dialog/index'
import { exportExcel } from '@/common/common'
export default {
components: {
'glsx-dialog': GlsxDialog,
......@@ -282,6 +287,7 @@ export default {
],
},
currentSn: '',
downloadLoading:false
}
},
created() {},
......@@ -470,6 +476,25 @@ export default {
})
})
},
/** 导出excel */
download(){
let _this = this
let oParams = _this.getParams()
let options = {}
let url = EXPORTDEVICEFILE;
options.fileName = '设备关系明细列表.xlsx'
options.method = 'POST'
options.url = url
options.data = oParams
options.success = function () {
_this.downloadLoading = false
}
_this.downloadLoading = true
exportExcel(options)
}
},
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!