From bc2747387df0693aa46a55bb556985aaf881d843 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期三, 24 八月 2022 19:18:32 +0800
Subject: [PATCH] 导入

---
 src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue b/src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue
index 377ace5..d8d178c 100644
--- a/src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue
+++ b/src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue
@@ -55,7 +55,7 @@
 
                <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="showRiskSourceForm('','新增')">新增</el-button>
-<!--               <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary"  @click="showImportDialog()">导入</el-button>-->
+               <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary"  @click="showImportDialog()">导入</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">
@@ -440,21 +440,28 @@
                         })
                     }
                     else{
-                        let allData = res.data.result
+                        let allData = res.data.result.map(item => {
+                            return {
+                                name:item.name,
+                                level:this.levelList.find(i =>i.id === item.level).name,
+                                depName:item.depName,
+                                location:item.location,
+                            }
+                        })
                         import('@/vendor/Export2Excel').then((excel) => {
                             const tHeader = [
                                 '生产装置名称',
                                 '风险等级',
-                                '可能导致的事故描述',
-                                '区域位置',
                                 '所属部门名称',
+                                '区域位置',
+
                             ]
                             const filterVal = [
                                 'name',
                                 'level',
-                                'accidentDesc',
-                                'location',
                                 'depName',
+                                'location',
+
                             ]
                             const data = this.formatJson(filterVal, allData)
                             excel.export_json_to_excel({

--
Gitblit v1.9.2