소스 검색

页面文案修改

yuwenjun1997 2 년 전
부모
커밋
34e608b5e7
3개의 변경된 파일63개의 추가작업 그리고 10개의 파일을 삭제
  1. 11 0
      src/utils/tools.js
  2. 49 7
      src/views/normal/club/index.vue
  3. 3 3
      src/views/normal/personnel/training/index.vue

+ 11 - 0
src/utils/tools.js

@@ -111,6 +111,17 @@ export function downLoadWithATag(href) {
   downLink.click()
 }
 
+export function downloadWithUrl(url, name) {
+  return fetch(url)
+    .then((data) => data.blob())
+    .then((res) => {
+      const a = document.createElement('a')
+      a.href = URL.createObjectURL(res)
+      a.download = name
+      a.click()
+    })
+}
+
 // 通知
 export function notify(self, title, duration = 3000) {
   const h = self.$createElement

+ 49 - 7
src/views/normal/club/index.vue

@@ -107,7 +107,7 @@
           <permission-button type="primary" size="mini" @click="$_navigationTo(`device-list?id=${row.authId}`)">
             设备认证
           </permission-button>
-          <permission-button type="primary" size="mini" @click="createClubQrcode(row)"> 二维码 </permission-button>
+          <permission-button type="primary" size="mini" :disabled="row.status !== 1" @click="createClubQrcode(row)"> 二维码 </permission-button>
           <permission-button type="primary" size="mini" @click="cotyClubLink($event, row)">
             复制链接
           </permission-button>
@@ -185,7 +185,7 @@ import Qrcode from '@/components/qrcode/club-qrcode.vue'
 import { fecthAuthList, saveBrandAuth, changeAuthStatus, removeAuth, authImportExcel } from '@/api/auth'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 import { mapGetters } from 'vuex'
-import { debounce, downLoadWithATag } from '@/utils/tools'
+import { debounce, downloadWithUrl } from '@/utils/tools'
 import handleClipboard from '@/utils/clipboard'
 export default {
   name: 'ComplexTable',
@@ -317,15 +317,43 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
+
+      let notification = null
+      notification = this.$notify({
+        title: '提示',
+        message: `正在下载${confirmText},请勿重复操作!`,
+        duration: 0
+      })
+
       // 使用a链接下载
-      downLoadWithATag(`${process.env.VUE_APP_BASE_API}/download/shop/image?authUserId=${this.authUserId}&type=${type}`)
+      const downUrl = `${process.env.VUE_APP_BASE_API}/download/shop/image?authUserId=${this.authUserId}&type=${type}`
+      downloadWithUrl(downUrl, confirmText)
+        .catch((err) => {
+          console.log(err)
+          this.$message.error(`下载${confirmText}失败`)
+        })
+        .finally(() => {
+          notification.close()
+        })
     },
 
     // 下载模板
     downLoadExportExcel() {
-      downLoadWithATag(
-        `${process.env.VUE_APP_BASE_API}/download/file?ossName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx&fileName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`
-      )
+      const downUrl = `${process.env.VUE_APP_BASE_API}/download/file?ossName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx&fileName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`
+      let notification = null
+      notification = this.$notify({
+        title: '提示',
+        message: '正在下载机构导入模板,请勿重复操作!',
+        duration: 0
+      })
+      downloadWithUrl(downUrl, '机构导入模板.xlsx')
+        .catch((err) => {
+          console.log(err)
+          this.$message.error(`下载机构导入模板失败`)
+        })
+        .finally(() => {
+          notification.close()
+        })
     },
 
     // 导出为Excel
@@ -338,8 +366,22 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
+      let notification = null
+      notification = this.$notify({
+        title: '提示',
+        message: '正在导出机构信息,请勿重复操作!',
+        duration: 0
+      })
       // 使用a链接下载
-      downLoadWithATag(`${process.env.VUE_APP_BASE_API}/auth/export/excel?authUserId=${this.authUserId}`)
+      const downUrl = `${process.env.VUE_APP_BASE_API}/auth/export/excel?authUserId=${this.authUserId}`
+      downloadWithUrl(downUrl, '机构数据.xlsx')
+        .catch((err) => {
+          console.log(err)
+          this.$message.error(`导出机构数据失败`)
+        })
+        .finally(() => {
+          notification.close()
+        })
     },
 
     // 导入Excel 并提交

+ 3 - 3
src/views/normal/personnel/training/index.vue

@@ -2,8 +2,8 @@
   <div class="app-container">
     <div class="filter-container">
       <div class="filter-control">
-        <span>操作师姓名:</span>
-        <el-input v-model="listQuery.doctorName" placeholder="操作师姓名" @keyup.enter.native="handleFilter" />
+        <span>培训师姓名:</span>
+        <el-input v-model="listQuery.doctorName" placeholder="培训师姓名" @keyup.enter.native="handleFilter" />
       </div>
       <div class="filter-control">
         <span>审核状态:</span>
@@ -40,7 +40,7 @@
       header-row-class-name="tableHeader"
     >
       <el-table-column label="序号" :index="indexMethod" type="index" align="center" width="80" />
-      <el-table-column label="操作师姓名" align="center" prop="doctorName" />
+      <el-table-column label="培训师姓名" align="center" prop="doctorName" />
       <el-table-column label="从业资格证编号" align="center" prop="certificateNo" />
 
       <el-table-column label="审核状态" width="120px" align="center">