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

---
 src/api/riskLevelManage.js                                               |    6 +++---
 src/views/doublePreventAction/riskLevelManage/controlAction/index.vue    |    2 +-
 config/dev.env.js                                                        |    8 ++++----
 src/assets/example/riskAnaUnit.xlsx                                      |    0 
 src/assets/example/riskControlMeasure.xlsx                               |    0 
 src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue |   19 +++++++++++++------
 src/views/doublePreventAction/riskLevelManage/event/index.vue            |    2 +-
 src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue      |    2 +-
 src/assets/example/riskSource.xlsx                                       |    0 
 src/assets/example/riskEvent.xlsx                                        |    0 
 src/api/riskSource.js                                                    |    2 +-
 11 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/config/dev.env.js b/config/dev.env.js
index 463910d..17b1d1e 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -22,11 +22,11 @@
     // BASE_API: '"http://192.168.0.8:8006"',
     // IMG_API: '"http://192.168.0.8:8006/upload/"',
     //
-    BASE_API: '"http://192.168.0.69:8006"',
-    IMG_API: '"http://192.168.0.69:8006/upload/"',
+    // BASE_API: '"http://192.168.0.69:8006"',
+    // IMG_API: '"http://192.168.0.69:8006/upload/"',
 
-    // BASE_API: '"http://192.168.0.35:8006"',
-    // IMG_API: '"http://192.168.0.35:8006/upload/"',
+    BASE_API: '"http://192.168.0.35:8006"',
+    IMG_API: '"http://192.168.0.35:8006/upload/"',
     // BASE_API: '"http://192.168.0.62:8006"',
     // IMG_API: '"http://192.168.0.62:8006/upload/"',
     // BASE_API: '"http://222.92.213.22:8006/zhongtai"',
diff --git a/src/api/riskLevelManage.js b/src/api/riskLevelManage.js
index a490a6d..d942c86 100644
--- a/src/api/riskLevelManage.js
+++ b/src/api/riskLevelManage.js
@@ -69,7 +69,7 @@
         headers: {
             'Authorization': getToken()
         },
-        url: process.env.BASE_API + '/riskAnaUnit/import',
+        url: process.env.BASE_API + '/prevent/fileHandler/insert/riskUnitImport',
         method: 'post',
         data
     })
@@ -144,7 +144,7 @@
         headers: {
             'Authorization': getToken()
         },
-        url: process.env.BASE_API + '/riskEvent/import',
+        url: process.env.BASE_API + '/prevent/fileHandler/insert/eventImport',
         method: 'post',
         data
     })
@@ -222,7 +222,7 @@
         headers: {
             'Authorization': getToken()
         },
-        url: process.env.BASE_API + '/riskControlMeasure/import',
+        url: process.env.BASE_API + '/prevent/fileHandler/insert/measureImport',
         method: 'post',
         data
     })
diff --git a/src/api/riskSource.js b/src/api/riskSource.js
index 06f3457..2aa6e98 100644
--- a/src/api/riskSource.js
+++ b/src/api/riskSource.js
@@ -61,7 +61,7 @@
         headers: {
             'Authorization': getToken()
         },
-        url: process.env.BASE_API + '/riskSource/import',
+        url: process.env.BASE_API + '/prevent/fileHandler/insert/deviceImport',
         method: 'post',
         data
     })
diff --git a/src/assets/example/riskAnaUnit.xlsx b/src/assets/example/riskAnaUnit.xlsx
index 1c53302..db3597f 100644
--- a/src/assets/example/riskAnaUnit.xlsx
+++ b/src/assets/example/riskAnaUnit.xlsx
Binary files differ
diff --git a/src/assets/example/riskControlMeasure.xlsx b/src/assets/example/riskControlMeasure.xlsx
index 024f3a7..29cb1e5 100644
--- a/src/assets/example/riskControlMeasure.xlsx
+++ b/src/assets/example/riskControlMeasure.xlsx
Binary files differ
diff --git a/src/assets/example/riskEvent.xlsx b/src/assets/example/riskEvent.xlsx
index 30b4f03..3f1124a 100644
--- a/src/assets/example/riskEvent.xlsx
+++ b/src/assets/example/riskEvent.xlsx
Binary files differ
diff --git a/src/assets/example/riskSource.xlsx b/src/assets/example/riskSource.xlsx
index b9ff2ff..5213e65 100644
--- a/src/assets/example/riskSource.xlsx
+++ b/src/assets/example/riskSource.xlsx
Binary files differ
diff --git a/src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue b/src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue
index f9a9c1c..868c35f 100644
--- a/src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue
+++ b/src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue
@@ -31,7 +31,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="showAnalyseUnitForm('','新增')">新增</el-button>
 <!--            <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary"  @click="showDepartmentChart()">图表</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">
diff --git a/src/views/doublePreventAction/riskLevelManage/controlAction/index.vue b/src/views/doublePreventAction/riskLevelManage/controlAction/index.vue
index 34983e2..01377fa 100644
--- a/src/views/doublePreventAction/riskLevelManage/controlAction/index.vue
+++ b/src/views/doublePreventAction/riskLevelManage/controlAction/index.vue
@@ -20,7 +20,7 @@
             </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="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">
diff --git a/src/views/doublePreventAction/riskLevelManage/event/index.vue b/src/views/doublePreventAction/riskLevelManage/event/index.vue
index 5410776..9bf37f6 100644
--- a/src/views/doublePreventAction/riskLevelManage/event/index.vue
+++ b/src/views/doublePreventAction/riskLevelManage/event/index.vue
@@ -8,7 +8,7 @@
             </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="showRiskEvent('','新增')">新增</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">
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