瀏覽代碼

Merge branch 'lmm' into develop

seimin 3 年之前
父節點
當前提交
f4cf01919c

+ 20 - 20
package-lock.json

@@ -740,18 +740,18 @@
740 740
       "integrity": "sha1-NuVJ3T8TInQqOnOOfBE+vkgiGGA="
741 741
     },
742 742
     "@types/datatables.net": {
743
-      "version": "1.10.19",
744
-      "resolved": "https://registry.npm.taobao.org/@types/datatables.net/download/@types/datatables.net-1.10.19.tgz",
745
-      "integrity": "sha1-F8X5RDP3YQhhMcbI3AVaDhCZ0fk=",
743
+      "version": "1.10.20",
744
+      "resolved": "https://registry.nlark.com/@types/datatables.net/download/@types/datatables.net-1.10.20.tgz",
745
+      "integrity": "sha1-feV7OtTsfi7qXuXIF4MytiLiud4=",
746 746
       "dev": true,
747 747
       "requires": {
748 748
         "@types/jquery": "*"
749 749
       }
750 750
     },
751 751
     "@types/echarts": {
752
-      "version": "4.9.8",
753
-      "resolved": "https://registry.nlark.com/@types/echarts/download/@types/echarts-4.9.8.tgz?cache=0&sync_timestamp=1623209570564&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fecharts%2Fdownload%2F%40types%2Fecharts-4.9.8.tgz",
754
-      "integrity": "sha1-ppd5ykdV6ym2E4evThXsMkYj+GY=",
752
+      "version": "4.9.9",
753
+      "resolved": "https://registry.nlark.com/@types/echarts/download/@types/echarts-4.9.9.tgz?cache=0&sync_timestamp=1625599737693&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fecharts%2Fdownload%2F%40types%2Fecharts-4.9.9.tgz",
754
+      "integrity": "sha1-nCA6zF9wD+Rvz2vB7HSPyxKNjtA=",
755 755
       "dev": true,
756 756
       "requires": {
757 757
         "@types/zrender": "*"
@@ -774,18 +774,18 @@
774 774
       "dev": true
775 775
     },
776 776
     "@types/jasminewd2": {
777
-      "version": "2.0.9",
778
-      "resolved": "https://registry.nlark.com/@types/jasminewd2/download/@types/jasminewd2-2.0.9.tgz",
779
-      "integrity": "sha1-2zlGMUYF3uqdXHrqC2HYBwibp20=",
777
+      "version": "2.0.10",
778
+      "resolved": "https://registry.nlark.com/@types/jasminewd2/download/@types/jasminewd2-2.0.10.tgz",
779
+      "integrity": "sha1-rjHCN6pkIb3jDxBYsdIPRXflREM=",
780 780
       "dev": true,
781 781
       "requires": {
782 782
         "@types/jasmine": "*"
783 783
       }
784 784
     },
785 785
     "@types/jquery": {
786
-      "version": "3.5.5",
787
-      "resolved": "https://registry.npm.taobao.org/@types/jquery/download/@types/jquery-3.5.5.tgz?cache=0&sync_timestamp=1613379043957&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjquery%2Fdownload%2F%40types%2Fjquery-3.5.5.tgz",
788
-      "integrity": "sha1-LGP0fJyNlmk9Jy9UU2Aq/YM4yQM=",
786
+      "version": "3.5.6",
787
+      "resolved": "https://registry.nlark.com/@types/jquery/download/@types/jquery-3.5.6.tgz",
788
+      "integrity": "sha1-l6yONtzNitjtPz87SJM2FNn9jPA=",
789 789
       "dev": true,
790 790
       "requires": {
791 791
         "@types/sizzle": "*"
@@ -804,9 +804,9 @@
804 804
       "dev": true
805 805
     },
806 806
     "@types/overlayscrollbars": {
807
-      "version": "1.12.0",
808
-      "resolved": "https://registry.npm.taobao.org/@types/overlayscrollbars/download/@types/overlayscrollbars-1.12.0.tgz",
809
-      "integrity": "sha1-mEVsrOyorXO9W7VyYypYUHTnB2Q="
807
+      "version": "1.12.1",
808
+      "resolved": "https://registry.nlark.com/@types/overlayscrollbars/download/@types/overlayscrollbars-1.12.1.tgz",
809
+      "integrity": "sha1-+2NwcbVFg0+xKuqU7jCaL/TNwKg="
810 810
     },
811 811
     "@types/q": {
812 812
       "version": "0.0.32",
@@ -822,7 +822,7 @@
822 822
     },
823 823
     "@types/sizzle": {
824 824
       "version": "2.3.3",
825
-      "resolved": "https://registry.nlark.com/@types/sizzle/download/@types/sizzle-2.3.3.tgz?cache=0&sync_timestamp=1619526734579&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fsizzle%2Fdownload%2F%40types%2Fsizzle-2.3.3.tgz",
825
+      "resolved": "https://registry.nlark.com/@types/sizzle/download/@types/sizzle-2.3.3.tgz?cache=0&sync_timestamp=1621243834244&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fsizzle%2Fdownload%2F%40types%2Fsizzle-2.3.3.tgz",
826 826
       "integrity": "sha1-/14vGQKWnTBSJaBHyKD9XJFc6+8=",
827 827
       "dev": true
828 828
     },
@@ -853,7 +853,7 @@
853 853
     },
854 854
     "@types/zrender": {
855 855
       "version": "4.0.0",
856
-      "resolved": "https://registry.npm.taobao.org/@types/zrender/download/@types/zrender-4.0.0.tgz",
856
+      "resolved": "https://registry.nlark.com/@types/zrender/download/@types/zrender-4.0.0.tgz",
857 857
       "integrity": "sha1-poBvEuxOzKrr2bDYFvBJrKYYj70=",
858 858
       "dev": true
859 859
     },
@@ -5589,9 +5589,9 @@
5589 5589
       }
5590 5590
     },
5591 5591
     "karma-jasmine-html-reporter": {
5592
-      "version": "1.6.0",
5593
-      "resolved": "https://registry.nlark.com/karma-jasmine-html-reporter/download/karma-jasmine-html-reporter-1.6.0.tgz",
5594
-      "integrity": "sha1-WG4XAlobQSjp+6VdXx6JIb/DvB4=",
5592
+      "version": "1.7.0",
5593
+      "resolved": "https://registry.nlark.com/karma-jasmine-html-reporter/download/karma-jasmine-html-reporter-1.7.0.tgz",
5594
+      "integrity": "sha1-UsSJp012CTShCJv6XqSo/LhMwos=",
5595 5595
       "dev": true
5596 5596
     },
5597 5597
     "karma-source-map-support": {

+ 5 - 5
package.json

@@ -23,7 +23,7 @@
23 23
     "@angular/platform-browser-dynamic": "~8.1.1",
24 24
     "@angular/router": "~8.1.1",
25 25
     "@types/crypto-js": "^3.1.47",
26
-    "@types/overlayscrollbars": "^1.9.0",
26
+    "@types/overlayscrollbars": "^1.12.1",
27 27
     "core-js": "^3.15.2",
28 28
     "crypto-js": "^4.0.0",
29 29
     "datatables.net": "^1.10.25",
@@ -45,10 +45,10 @@
45 45
     "@angular/cli": "~8.1.1",
46 46
     "@angular/compiler-cli": "~8.1.1",
47 47
     "@angular/language-service": "~8.1.1",
48
-    "@types/datatables.net": "^1.10.18",
49
-    "@types/echarts": "^4.9.8",
48
+    "@types/datatables.net": "^1.10.20",
49
+    "@types/echarts": "^4.9.9",
50 50
     "@types/jasmine": "~3.3.8",
51
-    "@types/jasminewd2": "~2.0.3",
51
+    "@types/jasminewd2": "^2.0.10",
52 52
     "@types/node": "~8.9.4",
53 53
     "babel-polyfill": "^6.26.0",
54 54
     "codelyzer": "^5.0.0",
@@ -58,7 +58,7 @@
58 58
     "karma-chrome-launcher": "~2.2.0",
59 59
     "karma-coverage-istanbul-reporter": "~2.0.1",
60 60
     "karma-jasmine": "~2.0.1",
61
-    "karma-jasmine-html-reporter": "^1.4.0",
61
+    "karma-jasmine-html-reporter": "^1.7.0",
62 62
     "protractor": "~5.4.0",
63 63
     "shelljs": "^0.8.4",
64 64
     "ssh2-sftp-client": "^6.0.1",

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

@@ -502,4 +502,14 @@ export class MainService {
502 502
       headers: this.headers,
503 503
     });
504 504
   }
505
+  //删除用户(包含企业微信用户)
506
+  rmvDataAndWeChatNum(data, flag) {
507
+    return this.http.post(
508
+      host.host + "/user/data/rmvDataAndWeChatNum/" + flag,
509
+      data,
510
+      {
511
+        headers: this.headers,
512
+      }
513
+    );
514
+  }
505 515
 }

+ 1 - 1
src/app/share/dialog-delete/dialog-delete.component.html

@@ -9,7 +9,7 @@
9 9
     </div>
10 10
     <div class="operate">
11 11
       <button nz-button nzType="primary" (click)="confirmDel()" [nzLoading]="btnLoading">{{confirmTxt}}</button>
12
-      <button class="btn cancel ml8" nz-button nzType="default" (click)="hideDelModal('cancel')" [nzLoading]="cancenlLoading">{{cancelTxt}}</button>
12
+      <button class="btn cancel ml8" nz-button nzType="default" (click)="cancel(cancelTxt=='否'?'no':'cancel')" [nzLoading]="cancenlLoading">{{cancelTxt}}</button>
13 13
     </div>
14 14
   </div>
15 15
 </div>

+ 21 - 13
src/app/share/dialog-delete/dialog-delete.component.ts

@@ -1,31 +1,39 @@
1
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
1
+import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
2 2
 
3 3
 @Component({
4
-  selector: 'app-dialog-delete',
5
-  templateUrl: './dialog-delete.component.html',
6
-  styleUrls: ['./dialog-delete.component.less']
4
+  selector: "app-dialog-delete",
5
+  templateUrl: "./dialog-delete.component.html",
6
+  styleUrls: ["./dialog-delete.component.less"],
7 7
 })
8 8
 export class DialogDeleteComponent implements OnInit {
9 9
   @Output() hideDelModalEvent = new EventEmitter<any>();
10 10
   @Output() confirmDelEvent = new EventEmitter<any>();
11
+  @Output() cancelDelEvent = new EventEmitter<any>();
11 12
   @Input() btnLoading: boolean = false;
12 13
   @Input() cancenlLoading: boolean = false;
13 14
   @Input() delModal: boolean = false;
14
-  @Input() content: string = '您确定要删除吗?';
15
-  @Input() tips: string = '';
16
-  @Input() confirmTxt: string = '确定';
17
-  @Input() cancelTxt: string = '取消';
18
-  constructor() { }
15
+  @Input() content: string = "您确定要删除吗?";
16
+  @Input() tips: string = "";
17
+  @Input() confirmTxt: string = "确定";
18
+  @Input() cancelTxt: string = "取消";
19
+  constructor() {}
19 20
 
20
-  ngOnInit() {
21
-  }
21
+  ngOnInit() {}
22 22
   // 隐藏
23
-  hideDelModal(e:string) {
23
+  hideDelModal(e: string) {
24 24
     this.hideDelModalEvent.emit(e);
25 25
   }
26 26
   // 确认删除
27 27
   confirmDel() {
28 28
     this.confirmDelEvent.emit();
29 29
   }
30
-
30
+  cancel(type: string) {
31
+    if (type == "cancel") {
32
+      //取消
33
+      this.hideDelModal("cancel");
34
+    } else if (type == "no") {
35
+      //否
36
+      this.cancelDelEvent.emit();
37
+    }
38
+  }
31 39
 }

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

@@ -202,8 +202,9 @@
202 202
   </div>
203 203
 </div>
204 204
 <!-- 删除模态框 -->
205
-<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
206
-  (confirmDelEvent)="confirmDel()" content="您确认要删除此用户吗?"></app-dialog-delete>
205
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" [cancenlLoading]="cancenlLoading"
206
+  (confirmDelEvent)="confirmDel()" (cancelDelEvent)="cancelDel()" content="是否删除企业微信同用户?" confirmTxt="是" cancelTxt="否">
207
+</app-dialog-delete>
207 208
 <!-- 操作成功/失败提示框 -->
208 209
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
209 210
   [info]="promptInfo"></app-prompt-modal>

+ 28 - 4
src/app/views/users-management/users-management.component.ts

@@ -413,16 +413,40 @@ export class UsersManagementComponent implements OnInit {
413 413
     that.coopId = data.id;
414 414
     that.delModal = true;
415 415
   }
416
-  // 确认删除
416
+  // 确认删除(删除企业微信用户)
417 417
   confirmDel() {
418 418
     let that = this;
419 419
     that.btnLoading = true;
420 420
     that.mainService
421
-      .coopData("rmvData", "user", [that.coopId])
421
+      .rmvDataAndWeChatNum([that.coopId], true)
422 422
       .subscribe((data) => {
423 423
         that.btnLoading = false;
424 424
         that.hideDelModal();
425
-        if (data.status == 200) {
425
+        if (data["status"] == 200) {
426
+          if (
427
+            that.listOfData.length == 1 &&
428
+            that.pageIndex == Math.ceil(that.listLength / that.pageSize)
429
+          ) {
430
+            that.listLength--;
431
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize);
432
+          }
433
+          that.showPromptModal("删除", true, "");
434
+        } else {
435
+          that.showPromptModal("删除", false, data["msg"]);
436
+        }
437
+      });
438
+  }
439
+  // 确认删除(不删除企业用户)
440
+  cancenlLoading = false;
441
+  cancelDel() {
442
+    let that = this;
443
+    that.cancenlLoading = true;
444
+    that.mainService
445
+      .rmvDataAndWeChatNum([that.coopId], false)
446
+      .subscribe((data) => {
447
+        that.cancenlLoading = false;
448
+        that.hideDelModal();
449
+        if (data["status"] == 200) {
426 450
           if (
427 451
             that.listOfData.length == 1 &&
428 452
             that.pageIndex == Math.ceil(that.listLength / that.pageSize)
@@ -432,7 +456,7 @@ export class UsersManagementComponent implements OnInit {
432 456
           }
433 457
           that.showPromptModal("删除", true, "");
434 458
         } else {
435
-          that.showPromptModal("删除", false, data.msg);
459
+          that.showPromptModal("删除", false, data["msg"]);
436 460
         }
437 461
       });
438 462
   }