From cabf58ac1a2356a9f0296d957191fefde333f58b Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 13 十月 2023 09:38:40 +0800
Subject: [PATCH] 修改

---
 .env.development                                       |    4 +-
 src/views/login.vue                                    |    4 +-
 src/utils/filter.js                                    |    5 +-
 .env.production                                        |    2 
 src/views/coalMine/cJobRegistration/index.vue          |    6 ++
 src/views/notCoalMine/nPeopleManage/index.vue          |   16 +++++++-
 src/views/coalMine/cPeopleManage/index.vue             |   18 +++++++-
 src/views/notCoalMine/nBatchManage/index.vue           |   44 +++++++++++-----------
 src/views/coalMine/cViolationRegistration/index.vue    |    6 ++
 src/views/notCoalMine/nViolationRegistration/index.vue |    6 ++
 src/views/notCoalMine/nJobRegistration/index.vue       |    6 ++
 11 files changed, 78 insertions(+), 39 deletions(-)

diff --git a/.env.development b/.env.development
index 07da133..7bb0001 100644
--- a/.env.development
+++ b/.env.development
@@ -6,10 +6,10 @@
 
 # 若依管理系统/开发环境
 #黄镇
-#VUE_APP_BASE_API = 'http://192.168.0.47:8085'
+#VUE_APP_BASE_API = 'http://192.168.0.47:8085/api'
 
 #张凤
-VUE_APP_BASE_API = 'http://192.168.0.70:8085'
+VUE_APP_BASE_API = 'http://192.168.0.70:8085/api'
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/.env.production b/.env.production
index 58fb433..d56ef8c 100644
--- a/.env.production
+++ b/.env.production
@@ -5,4 +5,4 @@
 ENV = 'production'
 
 # 若依管理系统/生产环境
-VUE_APP_BASE_API = '/prod-api'
+VUE_APP_BASE_API = '/api'
diff --git a/src/utils/filter.js b/src/utils/filter.js
index f4e2138..933e858 100644
--- a/src/utils/filter.js
+++ b/src/utils/filter.js
@@ -32,11 +32,10 @@
   const month = String(date.getMonth() + 1).padStart(2, "0");
   const day = String(date.getDate()).padStart(2, "0");
   const hours = String(date.getHours()).padStart(2, "0");
-  const minutes = String(date.getMinutes()).padStart(2, "0");
-  const seconds = String(date.getSeconds()).padStart(2, "0");
+  const minutes = String(date.getMinutes()).padStart(2, "0")
 
   // 构建所需格式的字符串
-  const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+  const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`;
 
   return formattedDate;
 })
diff --git a/src/views/coalMine/cJobRegistration/index.vue b/src/views/coalMine/cJobRegistration/index.vue
index 4cbbf46..979d91b 100644
--- a/src/views/coalMine/cJobRegistration/index.vue
+++ b/src/views/coalMine/cJobRegistration/index.vue
@@ -54,7 +54,11 @@
     <el-table v-loading="loading" :data="dataList">
       <el-table-column label="发生时间" align="center" prop="workTime" />
       <el-table-column label="姓名" align="center" prop="name" />
-      <el-table-column label="身份证号" align="center" prop="idCard" />
+      <el-table-column label="身份证号" align="center" prop="idCard">
+        <template #default="scope">
+          {{scope.row.idCard | peridcardtm}}
+        </template>
+      </el-table-column>
       <el-table-column label="IC卡编号" align="center" prop="icNum"/>
       <el-table-column label="电子证编号" align="center" prop="electNum"/>
       <el-table-column label="所属单位" align="center" prop="dept"/>
diff --git a/src/views/coalMine/cPeopleManage/index.vue b/src/views/coalMine/cPeopleManage/index.vue
index 39cf608..e1635f7 100644
--- a/src/views/coalMine/cPeopleManage/index.vue
+++ b/src/views/coalMine/cPeopleManage/index.vue
@@ -44,7 +44,11 @@
           {{ scope.row.sex == 0?'男':'女' }}
         </template>
       </el-table-column>
-      <el-table-column label="身份证号" align="center" prop="code" />
+      <el-table-column label="身份证号" align="center" prop="code">
+        <template #default="scope">
+          {{scope.row.code | peridcardtm}}
+        </template>
+      </el-table-column>
       <el-table-column label="电话" align="center" prop="mobilePhone"/>
       <el-table-column label="民族" align="center" prop="nationCode">
         <template #default="scope">
@@ -224,15 +228,23 @@
       this.getPage()
     },
     viewFile(file){
+      const t = this
       axios.get(process.env.VUE_APP_BASE_API + file.fileUrl,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob'}).then(res=>{
-        if (res) {
+        if (res && res.data) {
           const link = document.createElement('a')
           let blob = new Blob([res.data],{type: res.data.type})
           link.style.display = "none";
           link.href = URL.createObjectURL(blob); // 创建URL
           window.open(link.href)
         } else {
-          this.$message.error('获取文件失败')
+          t.$message.error('获取文件失败')
+        }
+      }).catch(function(err){
+        if(err == 'Error: Network Error'){
+          t.$message.error('获取文件失败,请重新上传')
+        }
+        if(err == 'Error: Request failed with status code 404'){
+          t.$message.error('获取文件失败,请重新上传')
         }
       })
     },
diff --git a/src/views/coalMine/cViolationRegistration/index.vue b/src/views/coalMine/cViolationRegistration/index.vue
index 0b35b9a..8ac3806 100644
--- a/src/views/coalMine/cViolationRegistration/index.vue
+++ b/src/views/coalMine/cViolationRegistration/index.vue
@@ -54,7 +54,11 @@
     <el-table v-loading="loading" :data="dataList">
       <el-table-column label="发生时间" align="center" prop="violationTime" />
       <el-table-column label="姓名" align="center" prop="name" />
-      <el-table-column label="身份证号" align="center" prop="idCard" />
+      <el-table-column label="身份证号" align="center" prop="idCard">
+        <template #default="scope">
+          {{scope.row.idCard | peridcardtm}}
+        </template>
+      </el-table-column>
       <el-table-column label="IC卡编号" align="center" prop="icNum"/>
       <el-table-column label="电子证编号" align="center" prop="electNum"/>
       <el-table-column label="所属单位" align="center" prop="dept"/>
diff --git a/src/views/login.vue b/src/views/login.vue
index 93ae70d..f418855 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -72,8 +72,8 @@
     return {
       codeUrl: "",
       loginForm: {
-        username: "admin",
-        password: "admin123",
+        username: "",
+        password: "",
         rememberMe: false,
         code: "",
         uuid: ""
diff --git a/src/views/notCoalMine/nBatchManage/index.vue b/src/views/notCoalMine/nBatchManage/index.vue
index a73ed0c..2ded24a 100644
--- a/src/views/notCoalMine/nBatchManage/index.vue
+++ b/src/views/notCoalMine/nBatchManage/index.vue
@@ -9,24 +9,24 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="开始日期">
-        <el-date-picker
-          v-model="queryParams.startTime"
-          type="date"
-          format="yyyy-MM-dd"
-          value-format="yyyy-MM-dd"
-          placeholder="开始日期">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="结束日期">
-        <el-date-picker
-          v-model="queryParams.endTime"
-          type="date"
-          format="yyyy-MM-dd"
-          value-format="yyyy-MM-dd"
-          placeholder="结束日期">
-        </el-date-picker>
-      </el-form-item>
+<!--      <el-form-item label="开始日期">-->
+<!--        <el-date-picker-->
+<!--          v-model="queryParams.startTime"-->
+<!--          type="date"-->
+<!--          format="yyyy-MM-dd"-->
+<!--          value-format="yyyy-MM-dd"-->
+<!--          placeholder="开始日期">-->
+<!--        </el-date-picker>-->
+<!--      </el-form-item>-->
+<!--      <el-form-item label="结束日期">-->
+<!--        <el-date-picker-->
+<!--          v-model="queryParams.endTime"-->
+<!--          type="date"-->
+<!--          format="yyyy-MM-dd"-->
+<!--          value-format="yyyy-MM-dd"-->
+<!--          placeholder="结束日期">-->
+<!--        </el-date-picker>-->
+<!--      </el-form-item>-->
 <!--      <el-form-item label="资格类型">-->
 <!--        <el-select v-model="value" placeholder="请选择">-->
 <!--          <el-option-->
@@ -152,12 +152,12 @@
       </el-table-column>
       <el-table-column label="理论考试时间" align="center">
         <template #default="scope">
-          {{scope.row.theoryExamStartTime | formatDate }}~{{ scope.row.theoryExamEndTime  | formatDate }}
+          {{scope.row.theoryExamStartTime | formatDate }} 至 {{ scope.row.theoryExamEndTime  | formatDate }}
         </template>
       </el-table-column>
       <el-table-column label="理论补考时间" align="center">
         <template #default="scope">
-          {{scope.row.theoryExamMakeupStartTime | formatDate }}~{{ scope.row.theoryExamMakeupEndTime  | formatDate }}
+          {{scope.row.theoryExamMakeupStartTime | formatDate }} 至 {{ scope.row.theoryExamMakeupEndTime  | formatDate }}
         </template>
       </el-table-column>
       <el-table-column label="实操考点" align="center" prop="practicalExamPlaceName" />
@@ -168,12 +168,12 @@
       </el-table-column>
       <el-table-column label="实操考试时间" align="center">
         <template #default="scope">
-          {{scope.row.practicalExamStartTime | formatDate }}~{{ scope.row.practicalExamEndTime  | formatDate }}
+          {{scope.row.practicalExamStartTime | formatDate }} 至 {{ scope.row.practicalExamEndTime  | formatDate }}
         </template>
       </el-table-column>
       <el-table-column label="实操补考时间" align="center">
         <template #default="scope">
-          {{scope.row.practicalExamMakeupStartTime | formatDate }}~{{ scope.row.practicalExamMakeupEndTime  | formatDate }}
+          {{scope.row.practicalExamMakeupStartTime | formatDate }} 至 {{ scope.row.practicalExamMakeupEndTime  | formatDate }}
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
diff --git a/src/views/notCoalMine/nJobRegistration/index.vue b/src/views/notCoalMine/nJobRegistration/index.vue
index 5061edf..a315ddf 100644
--- a/src/views/notCoalMine/nJobRegistration/index.vue
+++ b/src/views/notCoalMine/nJobRegistration/index.vue
@@ -54,7 +54,11 @@
     <el-table v-loading="loading" :data="dataList">
       <el-table-column label="发生时间" align="center" prop="workTime" />
       <el-table-column label="姓名" align="center" prop="name" />
-      <el-table-column label="身份证号" align="center" prop="idCard" />
+      <el-table-column label="身份证号" align="center" prop="idCard">
+        <template #default="scope">
+          {{scope.row.idCard | peridcardtm}}
+        </template>
+      </el-table-column>
       <el-table-column label="IC卡编号" align="center" prop="icNum"/>
       <el-table-column label="电子证编号" align="center" prop="electNum"/>
       <el-table-column label="所属单位" align="center" prop="dept"/>
diff --git a/src/views/notCoalMine/nPeopleManage/index.vue b/src/views/notCoalMine/nPeopleManage/index.vue
index afb5110..65c81d8 100644
--- a/src/views/notCoalMine/nPeopleManage/index.vue
+++ b/src/views/notCoalMine/nPeopleManage/index.vue
@@ -44,7 +44,11 @@
           {{ scope.row.sex == 0?'男':'女' }}
         </template>
       </el-table-column>
-      <el-table-column label="身份证号" align="center" prop="idCardNum" />
+      <el-table-column label="身份证号" align="center" prop="idCardNum">
+        <template #default="scope">
+          {{scope.row.idCardNum | peridcardtm}}
+        </template>
+      </el-table-column>
       <el-table-column label="电话" align="center" prop="phone"/>
       <el-table-column label="民族" align="center" prop="nationCode">
         <template #default="scope">
@@ -173,6 +177,7 @@
 
     },
     viewFile(file){
+      const t = this
       axios.get(process.env.VUE_APP_BASE_API + file,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob'}).then(res=>{
         if (res) {
           const link = document.createElement('a')
@@ -181,7 +186,14 @@
           link.href = URL.createObjectURL(blob); // 创建URL
           window.open(link.href)
         } else {
-          this.$message.error('获取文件失败')
+          t.$message.error('获取文件失败')
+        }
+      }).catch(function(err){
+        if(err == 'Error: Network Error'){
+          t.$message.error('获取文件失败')
+        }
+        if(err == 'Error: Request failed with status code 404'){
+          t.$message.error('获取文件失败')
         }
       })
     }
diff --git a/src/views/notCoalMine/nViolationRegistration/index.vue b/src/views/notCoalMine/nViolationRegistration/index.vue
index 1a16bb0..3c5de80 100644
--- a/src/views/notCoalMine/nViolationRegistration/index.vue
+++ b/src/views/notCoalMine/nViolationRegistration/index.vue
@@ -54,7 +54,11 @@
     <el-table v-loading="loading" :data="dataList">
       <el-table-column label="发生时间" align="center" prop="violationTime" />
       <el-table-column label="姓名" align="center" prop="name" />
-      <el-table-column label="身份证号" align="center" prop="idCard" />
+      <el-table-column label="身份证号" align="center" prop="idCard">
+        <template #default="scope">
+          {{scope.row.idCard | peridcardtm}}
+        </template>
+      </el-table-column>
       <el-table-column label="IC卡编号" align="center" prop="icNum"/>
       <el-table-column label="电子证编号" align="center" prop="electNum"/>
       <el-table-column label="所属单位" align="center" prop="dept"/>

--
Gitblit v1.9.2