| | |
| | | </div> |
| | | <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-refresh" @click="refreshHandle">搜索</el-button> |
| | | <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-plus" @click="showRiskControlMeasureForm('','新增')" v-show="showCurrent">新增</el-button> |
| | | <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" @click="exportToExcel">导出</el-button> |
| | | </div> |
| | | <div class="table_content"> |
| | | <el-table |
| | |
| | | import { mapGetters } from 'vuex' |
| | | import { computePageCount } from '@/utils' |
| | | import { addRiskControlMeasure, deleteRiskControlMeasure, getRiskControlMeasureList, updateRiskControlMeasure } from '@/api/riskLevelManage' |
| | | import {getClassify, getRiskEventList} from "../../../../api/riskLevelManage"; |
| | | import { |
| | | exportRiskControlMeasure, |
| | | exportRiskEvent, |
| | | getClassify, |
| | | getRiskEventList |
| | | } from "../../../../api/riskLevelManage"; |
| | | import {dictionaryAllItems} from "../../../../api/dictionary"; |
| | | export default { |
| | | name: 'index', |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | exportToExcel() { |
| | | exportRiskControlMeasure(this.listQuery.filter).then(res=>{ |
| | | if (res.data.code === '200') { |
| | | if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'无数据可导出' |
| | | }) |
| | | } |
| | | else{ |
| | | let allData = res.data.result |
| | | import('@/vendor/Export2Excel').then((excel) => { |
| | | const tHeader = [ |
| | | '安全风险事件名称', |
| | | '管控方式', |
| | | '管控方式描述', |
| | | '管控措施分类1', |
| | | '管控措施分类2', |
| | | '管控措施分类3', |
| | | '隐患排查内容', |
| | | ] |
| | | const filterVal = [ |
| | | 'riskEventName', |
| | | 'dataSrc', |
| | | 'riskMeasureDesc', |
| | | 'classify1', |
| | | 'classify2', |
| | | 'classify3', |
| | | 'troubleshootContent', |
| | | ] |
| | | const data = this.formatJson(filterVal, allData) |
| | | excel.export_json_to_excel({ |
| | | header: tHeader, |
| | | data, |
| | | filename: '安全风险管控措施数据' |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | formatJson(filterVal, jsonData) { |
| | | return jsonData.map(v => filterVal.map(j => v[j])) |
| | | }, |
| | | |
| | | refreshHandle(){ |
| | | this.getRiskControlMeasureData() |
| | | }, |