Преглед изворни кода

Merge remote-tracking branch 'refs/remotes/origin/红德堂' into 红德堂-test

# Conflicts:
#	src/views/course/courseTrafficLog/indexhdt.vue
wangxy пре 1 недеља
родитељ
комит
238b7919f4
1 измењених фајлова са 34 додато и 11 уклоњено
  1. 34 11
      src/views/member/list.vue

+ 34 - 11
src/views/member/list.vue

@@ -137,16 +137,17 @@
       <!--          v-hasPermi="['user:fsUser:remove']"-->
       <!--        >删除</el-button>-->
       <!--      </el-col>-->
-      <!--      <el-col :span="1.5">-->
-      <!--        <el-button-->
-      <!--          type="warning"-->
-      <!--          plain-->
-      <!--          icon="el-icon-download"-->
-      <!--          size="mini"-->
-      <!--          @click="handleExport"-->
-      <!--          v-hasPermi="['user:fsUser:export']"-->
-      <!--        >导出</el-button>-->
-      <!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['user:fsUser:export']"
+        >导出</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -318,6 +319,7 @@
 import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
 import {getUserList} from "@/api/company/companyUser";
 import userDetails from '@/views/store/components/userDetails.vue';
+import { getTask } from '@/api/common'
 export default {
   name: "FsUser",
   components: {userDetails},
@@ -338,6 +340,8 @@ export default {
       },
       // 遮罩层
       loading: true,
+      // 导出遮罩层
+      exportLoading: false,
       // 选中数组
       ids: [],
       // 非单个禁用
@@ -625,15 +629,34 @@ export default {
 
     /** 导出按钮操作 */
     handleExport() {
+      const that = this
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有用户数据项?', "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
+        this.exportLoading = true;
         return exportUser(queryParams);
       }).then(response => {
-        this.download(response.msg);
+        if (response.code === 200){
+          that.msgSuccess(response.msg);
+          that.taskId = response.data;
+          that.time = setInterval(function(){
+            //查订单
+            getTask(that.taskId).then(res => {
+              if(res.data.status === 1){
+                that.exportLoading = false;
+                clearTimeout(that.time)
+                that.time = null;
+                that.download(res.data.fileUrl);
+              }
+            });
+          },10000);
+        } else {
+          that.msgError(response.msg)
+          that.exportLoading = false
+        }
       }).catch(() => {});
     },