浏览代码

导入导出

seimin 1 年之前
父节点
当前提交
4e431b6988

+ 7 - 0
src/app/services/main.service.ts

@@ -798,4 +798,11 @@ export class MainService {
798 798
       headers: this.headers,
799 799
     });
800 800
   }
801
+  // 模板导出
802
+  exportExcel(model, data): any {
803
+    return this.http.post(host.host + "/user/data/exportExcel/" + model, data, {
804
+      headers: this.exportHeader,
805
+      responseType: "arraybuffer",
806
+    });
807
+  }
801 808
 }

+ 6 - 0
src/app/services/tool.service.ts

@@ -101,6 +101,12 @@ export class ToolService {
101 101
         case "export":
102 102
           coopBtns.export = true; //导出
103 103
           break;
104
+        case "import":
105
+          coopBtns.import = true; //导入
106
+          break;
107
+        case "templateDownload":
108
+          coopBtns.templateDownload = true; //模板下载
109
+          break;
104 110
         case "isStartUp":
105 111
           coopBtns.isStartUp = true; //是否启用
106 112
           break;

+ 36 - 0
src/app/share/excel-import/excel-import.component.html

@@ -0,0 +1,36 @@
1
+<div
2
+  class="save add display_flex align-items_center justify-content_flex-center excelUpload"
3
+  *ngIf="isShow"
4
+>
5
+  <div class="modalBody">
6
+    <div class="title"> 选择导入的文件<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
7
+    </div>
8
+    <div class="content">
9
+      <div>
10
+        <nz-upload [(nzFileList)]="fileList" [nzBeforeUpload]="beforeUpload" nzType="drag" nzFileType="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
11
+          <p class="ant-upload-drag-icon">
12
+            <i nz-icon nzType="inbox"></i>
13
+          </p>
14
+          <p class="ant-upload-text">单击或将文件拖到此区域以上传</p>
15
+        </nz-upload>
16
+      </div>
17
+    </div>
18
+    <div class="display_flex justify-content_flex-center">
19
+      <button
20
+        nzType="primary"
21
+        nz-button
22
+        (click)="submitForm()"
23
+      >
24
+        确认导入
25
+      </button>
26
+      <button
27
+        class="btn cancel"
28
+        nz-button
29
+        nzType="default"
30
+        (click)="hideModal()"
31
+      >
32
+        取消
33
+      </button>
34
+    </div>
35
+  </div>
36
+</div>

+ 76 - 0
src/app/share/excel-import/excel-import.component.less

@@ -0,0 +1,76 @@
1
+.save {
2
+  position: fixed;
3
+  left: 0;
4
+  top: 0;
5
+  width: 100%;
6
+  height: 100%;
7
+  background: rgba(0, 0, 0, 0.4);
8
+  z-index: 999;
9
+  &.excelUpload ::ng-deep .ant-upload-list-item .anticon-close{
10
+    opacity: 1!important;
11
+    transition: all 0.2s;
12
+  }
13
+  .modalBody {
14
+    width: 350px;
15
+    background: #fff;
16
+    border-radius: 5px;
17
+    padding: 10px 20px;
18
+    color: #333;
19
+
20
+    .title {
21
+      width: 100%;
22
+      text-align: center;
23
+      font-size: 18px;
24
+      position: relative;
25
+
26
+      i {
27
+        position: absolute;
28
+        right: 0;
29
+        top: 0;
30
+        font-size: 20px;
31
+        color: #666;
32
+        cursor: pointer;
33
+        padding: 0 5px;
34
+      }
35
+    }
36
+
37
+    .content {
38
+      width: 100%;
39
+      height: 117px;
40
+      background: #f9fafb;
41
+      border: 1px solid #e5e9ed;
42
+      border-radius: 5px;
43
+      overflow: hidden;
44
+      margin-top: 12px;
45
+    }
46
+
47
+    button {
48
+      margin-top: 10px;
49
+
50
+      &.btn {
51
+        margin-left: 8px;
52
+      }
53
+    }
54
+  }
55
+
56
+  // 新增
57
+  &.add {
58
+    .modalBody {
59
+      width: 480px;
60
+      height: auto;
61
+
62
+      .content {
63
+        width: 100%;
64
+        padding: 14px;
65
+        height: 200px;
66
+        .isNumOrIntegral {
67
+          margin: 24px 0;
68
+        }
69
+      }
70
+
71
+      button:nth-child(1) {
72
+        margin-right: 20px;
73
+      }
74
+    }
75
+  }
76
+}

+ 39 - 0
src/app/share/excel-import/excel-import.component.ts

@@ -0,0 +1,39 @@
1
+import { Component, OnInit, Output, Input } from "@angular/core";
2
+import { EventEmitter } from "@angular/core";
3
+import { UploadFile, NzMessageService} from 'ng-zorro-antd';
4
+
5
+
6
+@Component({
7
+  selector: "app-excel-import",
8
+  templateUrl: "./excel-import.component.html",
9
+  styleUrls: ["./excel-import.component.less"],
10
+})
11
+export class ExcelImportComponent implements OnInit {
12
+  @Output() submitFormHand = new EventEmitter();
13
+  @Output() hideFormHand = new EventEmitter();
14
+  @Input() isShow: boolean = false; //模态框
15
+  fileList: UploadFile[] = [];
16
+
17
+  constructor(private message: NzMessageService) {}
18
+
19
+  beforeUpload = (file: UploadFile): boolean => {
20
+    if(this.fileList.length === 0){
21
+      this.fileList = this.fileList.concat(file);
22
+    }
23
+    return false;
24
+  };
25
+
26
+  ngOnInit() {}
27
+  // 隐藏模态框
28
+  hideModal() {
29
+    this.hideFormHand.emit();
30
+  }
31
+  // 表单提交
32
+  submitForm(): void {
33
+    if(this.fileList.length === 0){
34
+      this.message.warning('请选择一个文件');
35
+      return;
36
+    }
37
+    this.submitFormHand.emit({fileList: this.fileList});
38
+  }
39
+}

+ 3 - 0
src/app/share/share.module.ts

@@ -28,6 +28,7 @@ import { CollapsePanelComponent } from './collapse-panel/collapse-panel.componen
28 28
 import { HtmlTransformPipe } from '../pipes/html-transform.pipe';
29 29
 import { BxPromptModalComponent } from './bx-prompt-modal/bx-prompt-modal.component';
30 30
 import { ExcelExportComponent } from './excel-export/excel-export.component';
31
+import { ExcelImportComponent } from './excel-import/excel-import.component';
31 32
 import { FilterSelfPipe } from '../pipes/filter-self.pipe';
32 33
 import { LogPromptModalComponent } from './log-prompt-modal/log-prompt-modal.component';
33 34
 import { DetailBxComponent } from './detail-bx/detail-bx.component';
@@ -74,6 +75,7 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
74 75
     HtmlTransformPipe,
75 76
     FilterSelfPipe,
76 77
     ExcelExportComponent,
78
+    ExcelImportComponent,
77 79
     LogPromptModalComponent,
78 80
     DetailBxComponent,
79 81
     IncidentDetailsComponent,
@@ -130,6 +132,7 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
130 132
     HtmlTransformPipe,
131 133
     FilterSelfPipe,
132 134
     ExcelExportComponent,
135
+    ExcelImportComponent,
133 136
     LogPromptModalComponent,
134 137
     DetailBxComponent,
135 138
     IncidentDetailsComponent,

+ 12 - 1
src/app/views/building-floor/building-floor.component.html

@@ -1,6 +1,12 @@
1 1
 <div class="groupManagement">
2 2
   <div class="groupInfo">
3
-    <div class="title">楼栋楼层</div>
3
+    <div class="title">
4
+      楼栋楼层
5
+      <div>
6
+        <button nz-button nzType="primary" *ngIf="coopBtns.templateDownload" nzSize="small"  (click)="excelExport()">模板下载</button>
7
+        <button class="ml8" nz-button nzType="primary" *ngIf="coopBtns.import" nzSize="small" (click)="excelImport()">导入</button>
8
+      </div>
9
+    </div>
4 10
     <div class="operate">
5 11
       <div *ngIf="coopBtns.add" class="add item" (click)="showCoopModal('add')">新增</div>
6 12
       <div *ngIf="coopBtns.edit" class="edit item" (click)="showCoopModal('edit')">编辑</div>
@@ -131,3 +137,8 @@
131 137
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
132 138
   [info]="promptInfo">
133 139
 </app-prompt-modal>
140
+
141
+<!-- 遮罩 -->
142
+<app-mask *ngIf="maskFlag"></app-mask>
143
+
144
+<app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>

+ 4 - 0
src/app/views/building-floor/building-floor.component.less

@@ -29,10 +29,14 @@
29 29
       height: 40px;
30 30
       line-height: 40px;
31 31
       padding-left: 16px;
32
+      padding-right: 16px;
32 33
       border-bottom: 1px solid #e5e9ed;
33 34
       position: relative;
34 35
       background: #fff;
35 36
       z-index: 2;
37
+      display: flex;
38
+      justify-content: space-between;
39
+      align-items: center;
36 40
     }
37 41
 
38 42
     .operate {

+ 80 - 4
src/app/views/building-floor/building-floor.component.ts

@@ -8,6 +8,10 @@ import { ToolService } from "../../services/tool.service";
8 8
 import { GenerateFloorComponent } from "src/app/share/generate-floor/generate-floor.component";
9 9
 import { NzMessageService } from "ng-zorro-antd";
10 10
 
11
+import host from "../../../assets/js/http";
12
+import { HttpRequest, HttpResponse, HttpClient } from '@angular/common/http';
13
+import { filter } from 'rxjs/operators';
14
+
11 15
 @Component({
12 16
   selector: "app-building-floor",
13 17
   templateUrl: "./building-floor.component.html",
@@ -42,13 +46,15 @@ export class BuildingFloorComponent implements OnInit {
42 46
   isDelSingle: boolean = false; //是否单个删除楼层
43 47
   generateModal: boolean = false; //生成楼层的模态框
44 48
   isAllDisplayDataChecked = false; //当前页是否全选
49
+  maskFlag: any = false;
45 50
 
46 51
   constructor(
47 52
     private fb: FormBuilder,
48 53
     private route: ActivatedRoute,
49 54
     private mainService: MainService,
50
-    private msg: NzMessageService,
51
-    private tool: ToolService
55
+    private message: NzMessageService,
56
+    private tool: ToolService,
57
+    private http: HttpClient,
52 58
   ) {}
53 59
 
54 60
   @ViewChild("osComponentRef1", {
@@ -66,6 +72,76 @@ export class BuildingFloorComponent implements OnInit {
66 72
     this.tableHeight = document.body.clientHeight - 312;
67 73
   }
68 74
 
75
+  // 模板导出
76
+  excelExport(){
77
+    this.maskFlag = this.message.loading("下载模板中..", {
78
+      nzDuration: 0,
79
+    }).messageId;
80
+    this.mainService.exportExcel("building", {}).subscribe(
81
+      (data) => {
82
+        this.message.remove(this.maskFlag);
83
+        this.maskFlag = false;
84
+        this.message.success('下载模板成功');
85
+        var file = new Blob([data], {
86
+          type: "application/vnd.ms-excel",
87
+        });
88
+        //trick to download store a file having its URL
89
+        var fileURL = URL.createObjectURL(file);
90
+        var a = document.createElement("a");
91
+        a.href = fileURL;
92
+        a.target = "_blank";
93
+        a.download = "楼栋楼层导入模板.xls";
94
+        document.body.appendChild(a);
95
+        a.click();
96
+      },
97
+      (err) => {
98
+        this.message.remove(this.maskFlag);
99
+        this.maskFlag = false;
100
+        this.message.error('下载模板失败');
101
+      }
102
+    );
103
+  }
104
+
105
+  // 导入---start
106
+  // model-取消
107
+  isShow = false;
108
+  hideExcelImport() {
109
+    this.isShow = false;
110
+  }
111
+  // 触发
112
+  excelImport() {
113
+    this.isShow = true;
114
+  }
115
+  submitExcelImport({fileList}){
116
+    this.isShow = false;
117
+    const formData = new FormData();
118
+    fileList.forEach((file: any) => {
119
+      formData.append('file', file);
120
+    });
121
+    this.maskFlag = this.message.loading("正在导入中..", {
122
+      nzDuration: 0,
123
+    }).messageId;
124
+    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/building', formData, {
125
+      reportProgress: true
126
+    });
127
+    this.http
128
+      .request(req)
129
+      .pipe(filter(e => e instanceof HttpResponse))
130
+      .subscribe(
131
+        () => {
132
+          this.message.remove(this.maskFlag);
133
+          this.maskFlag = false;
134
+          this.message.success('导入成功');
135
+        },
136
+        () => {
137
+          this.message.remove(this.maskFlag);
138
+          this.maskFlag = false;
139
+          this.message.error('导入失败');
140
+        },
141
+      );
142
+  }
143
+  // 导入---end
144
+
69 145
   // 楼栋列表
70 146
   getBuildingList() {
71 147
     let postData = {
@@ -147,7 +223,7 @@ export class BuildingFloorComponent implements OnInit {
147 223
   // 新增/编辑楼栋模态框
148 224
   showCoopModal(type) {
149 225
     if (type == "edit" && !this.checkedBuilding.id) {
150
-      this.msg.create("warning", "请选择需要编辑的楼栋!");
226
+      this.message.create("warning", "请选择需要编辑的楼栋!");
151 227
       return;
152 228
     }
153 229
     this.coopModal = true;
@@ -320,7 +396,7 @@ export class BuildingFloorComponent implements OnInit {
320 396
   //删除楼栋
321 397
   showDelModal() {
322 398
     if (!this.checkedBuilding.id) {
323
-      this.msg.create("warning", "请选择需要删除的楼栋!");
399
+      this.message.create("warning", "请选择需要删除的楼栋!");
324 400
       return;
325 401
     }
326 402
     this.delModal = true;

+ 3 - 3
src/app/views/jurisdiction-management/jurisdiction-management.component.html

@@ -29,8 +29,8 @@
29 29
         信息权限
30 30
       </div>
31 31
     </div>
32
-    <div *ngIf="!loading2&&!loading3">
33
-      <overlay-scrollbars #osComponentRef1 class="views menuViews" *ngIf="menuType==1">
32
+    <div [hidden]="loading2 || loading3">
33
+      <overlay-scrollbars #osComponentRef1 class="views menuViews" [hidden]="menuType!=1">
34 34
         <div class="tree">
35 35
           <div nz-row class="checkedAll">
36 36
             <div nz-col nzSpan="8">
@@ -65,7 +65,7 @@
65 65
           <button nzType="primary" [nzLoading]="saveLoading" nz-button (click)="saveMenus()">保存</button>
66 66
         </div>
67 67
       </overlay-scrollbars>
68
-      <overlay-scrollbars #osComponentRef2 class="views infoViews" *ngIf="menuType==2">
68
+      <overlay-scrollbars #osComponentRef2 class="views infoViews" [hidden]="menuType!=2">
69 69
         <div class="con">
70 70
           <div class="hospital">
71 71
             <div class="title">

+ 3 - 0
src/app/views/office-management/office-management.component.html

@@ -48,6 +48,8 @@
48 48
           (click)="print($event,true)" *ngIf="coopBtns.print">批量打印</button>
49 49
         <button class="btn default ml8" nzType="primary" nz-button *ngIf="coopBtns.del"
50 50
           [disabled]="!checkedDepIds.length" (click)="showDelModal($event,true,checkedDepIds)">批量删除</button>
51
+        <button nz-button *ngIf="coopBtns.templateDownload" class="btn ml8 default" (click)="excelExport()">模板下载</button>
52
+        <button nz-button *ngIf="coopBtns.import" class="btn ml8 default" (click)="excelImport()">导入</button>
51 53
       </div>
52 54
     </div>
53 55
     <div class="list-template__bottom">
@@ -276,3 +278,4 @@
276 278
 <router-outlet></router-outlet>
277 279
 <!-- 遮罩 -->
278 280
 <app-mask *ngIf="maskFlag"></app-mask>
281
+<app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>

+ 74 - 2
src/app/views/office-management/office-management.component.ts

@@ -13,7 +13,9 @@ import { ToolService } from "../../services/tool.service";
13 13
 import { format } from "date-fns";
14 14
 import { NzMessageService } from "ng-zorro-antd";
15 15
 import { Subject } from "rxjs";
16
-import { debounceTime } from "rxjs/operators";
16
+import { debounceTime, filter } from "rxjs/operators";
17
+import host from "../../../assets/js/http";
18
+import { HttpRequest, HttpResponse, HttpClient } from '@angular/common/http';
17 19
 
18 20
 @Component({
19 21
   selector: "app-office-management",
@@ -32,7 +34,8 @@ export class OfficeManagementComponent implements OnInit {
32 34
     private route: ActivatedRoute,
33 35
     private router: Router,
34 36
     private mainService: MainService,
35
-    private tool: ToolService
37
+    private tool: ToolService,
38
+    private http: HttpClient,
36 39
   ) {}
37 40
 
38 41
   ngOnInit() {
@@ -79,6 +82,75 @@ export class OfficeManagementComponent implements OnInit {
79 82
   searchParentDeptSubject = new Subject();
80 83
   // 初始化增删改按钮
81 84
   coopBtns: any = {};
85
+  // 模板导出
86
+  excelExport(){
87
+    this.maskFlag = this.message.loading("下载模板中..", {
88
+      nzDuration: 0,
89
+    }).messageId;
90
+    this.mainService.exportExcel("department", {}).subscribe(
91
+      (data) => {
92
+        this.message.remove(this.maskFlag);
93
+        this.maskFlag = false;
94
+        this.message.success('下载模板成功');
95
+        var file = new Blob([data], {
96
+          type: "application/vnd.ms-excel",
97
+        });
98
+        //trick to download store a file having its URL
99
+        var fileURL = URL.createObjectURL(file);
100
+        var a = document.createElement("a");
101
+        a.href = fileURL;
102
+        a.target = "_blank";
103
+        a.download = "科室导入模板.xls";
104
+        document.body.appendChild(a);
105
+        a.click();
106
+      },
107
+      (err) => {
108
+        this.message.remove(this.maskFlag);
109
+        this.maskFlag = false;
110
+        this.message.error('下载模板失败');
111
+      }
112
+    );
113
+  }
114
+
115
+  // 导入---start
116
+  // model-取消
117
+  isShow = false;
118
+  hideExcelImport() {
119
+    this.isShow = false;
120
+  }
121
+  // 触发
122
+  excelImport() {
123
+    this.isShow = true;
124
+  }
125
+  submitExcelImport({fileList}){
126
+    this.isShow = false;
127
+    const formData = new FormData();
128
+    fileList.forEach((file: any) => {
129
+      formData.append('file', file);
130
+    });
131
+    this.maskFlag = this.message.loading("正在导入中..", {
132
+      nzDuration: 0,
133
+    }).messageId;
134
+    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/department', formData, {
135
+      reportProgress: true
136
+    });
137
+    this.http
138
+      .request(req)
139
+      .pipe(filter(e => e instanceof HttpResponse))
140
+      .subscribe(
141
+        () => {
142
+          this.message.remove(this.maskFlag);
143
+          this.maskFlag = false;
144
+          this.message.success('导入成功');
145
+        },
146
+        () => {
147
+          this.message.remove(this.maskFlag);
148
+          this.maskFlag = false;
149
+          this.message.error('导入失败');
150
+        },
151
+      );
152
+  }
153
+  // 导入---end
82 154
   //搜索父级科室
83 155
   changeInp(e) {
84 156
     this.isLoading = true;

+ 6 - 2
src/app/views/users-management/users-management.component.html

@@ -1,7 +1,7 @@
1 1
 <div class="list-template">
2 2
   <div class="list-template__content">
3 3
     <div class="list-template__top" nz-row>
4
-      <div nz-col nzXl='18' class="list-template__searchBox">
4
+      <div nz-col nzXl='16' class="list-template__searchBox">
5 5
         <div class="list-template__searchItem">
6 6
           <span class="label">用户类型</span>:
7 7
           <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear
@@ -39,10 +39,12 @@
39 39
           <input nz-input class="formItem" [(ngModel)]="name" placeholder="请输入姓名" nzSize="default" />
40 40
         </div>
41 41
       </div>
42
-      <div nz-col nzXl='6' class="list-template__btns">
42
+      <div nz-col nzXl='8' class="list-template__btns">
43 43
         <button nz-button class="btn default" (click)='search()'>搜索</button>
44 44
         <button nz-button class="btn ml8 default" (click)='reset()'>重置</button>
45 45
         <button nz-button *ngIf="coopBtns.add" class="btn ml8 default" (click)="showModal()">新增</button>
46
+        <button nz-button *ngIf="coopBtns.templateDownload" class="btn ml8 default" (click)="excelExport()">模板下载</button>
47
+        <button nz-button *ngIf="coopBtns.import" class="btn ml8 default" (click)="excelImport()">导入</button>
46 48
       </div>
47 49
     </div>
48 50
     <div class="list-template__bottom">
@@ -219,3 +221,5 @@
219 221
 
220 222
 <!-- 遮罩 -->
221 223
 <app-mask *ngIf="maskFlag"></app-mask>
224
+
225
+<app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>

+ 76 - 2
src/app/views/users-management/users-management.component.ts

@@ -6,9 +6,12 @@ import { MainService } from "../../services/main.service";
6 6
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
7 7
 import { ToolService } from "../../services/tool.service";
8 8
 import { forkJoin, Subject } from "rxjs";
9
-import { debounceTime } from "rxjs/operators";
9
+import { debounceTime, filter } from "rxjs/operators";
10 10
 import { NzMessageService } from "ng-zorro-antd";
11 11
 
12
+import host from "../../../assets/js/http";
13
+import { HttpRequest, HttpResponse, HttpClient } from '@angular/common/http';
14
+
12 15
 @Component({
13 16
   selector: "app-users-management",
14 17
   templateUrl: "./users-management.component.html",
@@ -26,7 +29,8 @@ export class UsersManagementComponent implements OnInit {
26 29
     private route: ActivatedRoute,
27 30
     private router: Router,
28 31
     private mainService: MainService,
29
-    private tool: ToolService
32
+    private tool: ToolService,
33
+    private http: HttpClient,
30 34
   ) {}
31 35
 
32 36
   listOfData: any[] = []; //表格数据
@@ -75,6 +79,76 @@ export class UsersManagementComponent implements OnInit {
75 79
 
76 80
   // 初始化增删改按钮
77 81
   coopBtns: any = {};
82
+
83
+  // 模板导出
84
+  excelExport(){
85
+    this.maskFlag = this.message.loading("下载模板中..", {
86
+      nzDuration: 0,
87
+    }).messageId;
88
+    this.mainService.exportExcel("user", {}).subscribe(
89
+      (data) => {
90
+        this.message.remove(this.maskFlag);
91
+        this.maskFlag = false;
92
+        this.message.success('下载模板成功');
93
+        var file = new Blob([data], {
94
+          type: "application/vnd.ms-excel",
95
+        });
96
+        //trick to download store a file having its URL
97
+        var fileURL = URL.createObjectURL(file);
98
+        var a = document.createElement("a");
99
+        a.href = fileURL;
100
+        a.target = "_blank";
101
+        a.download = "用户导入模板.xls";
102
+        document.body.appendChild(a);
103
+        a.click();
104
+      },
105
+      (err) => {
106
+        this.message.remove(this.maskFlag);
107
+        this.maskFlag = false;
108
+        this.message.error('下载模板失败');
109
+      }
110
+    );
111
+  }
112
+
113
+  // 导入---start
114
+  // model-取消
115
+  isShow = false;
116
+  hideExcelImport() {
117
+    this.isShow = false;
118
+  }
119
+  // 触发
120
+  excelImport() {
121
+    this.isShow = true;
122
+  }
123
+  submitExcelImport({fileList}){
124
+    this.isShow = false;
125
+    const formData = new FormData();
126
+    fileList.forEach((file: any) => {
127
+      formData.append('file', file);
128
+    });
129
+    this.maskFlag = this.message.loading("正在导入中..", {
130
+      nzDuration: 0,
131
+    }).messageId;
132
+    const req = new HttpRequest('Post', host.host + '/user/data/importExcel/user', formData, {
133
+      reportProgress: true
134
+    });
135
+    this.http
136
+      .request(req)
137
+      .pipe(filter(e => e instanceof HttpResponse))
138
+      .subscribe(
139
+        () => {
140
+          this.message.remove(this.maskFlag);
141
+          this.maskFlag = false;
142
+          this.message.success('导入成功');
143
+        },
144
+        () => {
145
+          this.message.remove(this.maskFlag);
146
+          this.maskFlag = false;
147
+          this.message.error('导入失败');
148
+        },
149
+      );
150
+  }
151
+  // 导入---end
78 152
   // 搜索
79 153
   search() {
80 154
     this.pageIndex = 1;