|
@@ -191,7 +191,7 @@ import fullTimeStaffRecordDialog from './components/fullTimeStaffRecordDialog.vu
|
|
|
import communicationOfficerDialog from './components/communicationOfficerDialog.vue';
|
|
|
import boundMedicinesDialog from './components/boundMedicinesDialog.vue';
|
|
|
import UserCard from './components/UserCard.vue';
|
|
|
-import { addObj, delObj, fetchList, putObj, getUserDetails, batchChannelCert, getAuthInfo, getUserInfoApi, exportUserInfo, getExportUserResult } from '@/api/admin/user';
|
|
|
+import { addObj, delObj, fetchList, putObj, getUserDetails, batchChannelCert, getAuthInfo, getUserInfoApi, exportUserInfo, getExportResult } from '@/api/admin/user';
|
|
|
import store from '@/store';
|
|
|
import { getDictType } from '@/api/common';
|
|
|
import { filterCodes, extractPaths } from '@/util/treeUtils.js';
|
|
@@ -355,24 +355,37 @@ export default {
|
|
|
},
|
|
|
// 获取导出状态
|
|
|
async getExportInfoStatus() {
|
|
|
- const res = await getExportUserResult();
|
|
|
+ const timer = setInterval(async () => {
|
|
|
+ const res = await getExportResult({
|
|
|
+ type: 'USER'
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ const status = res.data.data.status;
|
|
|
|
|
|
- if (res.data.code === 0) {
|
|
|
- const timer = setInterval(() => {
|
|
|
- if (res.data.data.status == 'GENERATED') {
|
|
|
+ if (status === 'GENERATING') {
|
|
|
+ this.exportUserInfoText = '数据生成中';
|
|
|
+ this.exportUserInfoDisabled = true;
|
|
|
+ } else if (status === 'GENERATED') {
|
|
|
this.exportUrl = res.data.data.latestUrl;
|
|
|
this.exportUserInfoText = '下载数据';
|
|
|
this.exportUserInfoDisabled = false;
|
|
|
clearInterval(timer);
|
|
|
- } else if (res.data.data.status == 'GENERATING') {
|
|
|
- this.exportUserInfoText = '数据生成中';
|
|
|
- this.exportUserInfoDisabled = true;
|
|
|
-
|
|
|
- this.getExportInfoStatus();
|
|
|
+ } else {
|
|
|
+ // 可选:处理其他状态
|
|
|
+ this.exportUserInfoText = '导出失败';
|
|
|
+ this.exportUserInfoDisabled = false;
|
|
|
+ clearInterval(timer);
|
|
|
}
|
|
|
- }, 5000);
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ // 接口报错处理
|
|
|
+ this.exportUserInfoText = '获取状态失败';
|
|
|
+ this.exportUserInfoDisabled = false;
|
|
|
+ clearInterval(timer);
|
|
|
+ }
|
|
|
+ }, 5000);
|
|
|
},
|
|
|
+
|
|
|
downInfo() {
|
|
|
let link = document.createElement('a');
|
|
|
link.style.display = 'none';
|