From a17f7f42e1ef3bc8d4aecdef069131e2d64a2135 Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Wed, 22 Feb 2023 13:53:36 +0800
Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E8=BF=98=E5=8E=9F=E7=94=A8?=
 =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../user/edituser/edituser.component.html     |  6 +-
 .../user/user.component.html                  |  6 +-
 .../system-management/user/user.component.ts  | 95 +++++++++----------
 3 files changed, 53 insertions(+), 54 deletions(-)

diff --git a/src/app/system-management/user/edituser/edituser.component.html b/src/app/system-management/user/edituser/edituser.component.html
index 0f69168..b069993 100644
--- a/src/app/system-management/user/edituser/edituser.component.html
+++ b/src/app/system-management/user/edituser/edituser.component.html
@@ -71,10 +71,10 @@
   </form>
   <div class="btnbox">
     <button [nzLoading]="isLoading" nz-button nzType="default" (click)="cancel()">取消</button>
-    <button [nzLoading]="isLoading" nz-button nzType="primary" (click)="ok()" [disabled]="data.auditStatus == 1">确定</button>
-    <button [nzLoading]="isLoading" nz-button nzType="primary" (click)="audit(true)"
+    <button [nzLoading]="isLoading" nz-button nzType="primary" (click)="ok()">确定</button>
+    <!-- <button [nzLoading]="isLoading" nz-button nzType="primary" (click)="audit(true)"
       *ngIf="data.auditStatus == 0 || data.auditStatus == 3 || data.auditStatus == 4 || data.auditStatus == 5">提交审核</button>
     <button [nzLoading]="isLoading" nz-button nzType="primary" (click)="audit(false)"
-      *ngIf="data.auditStatus == 1">撤销审核</button>
+      *ngIf="data.auditStatus == 1">撤销审核</button> -->
   </div>
 </div>
\ No newline at end of file
diff --git a/src/app/system-management/user/user.component.html b/src/app/system-management/user/user.component.html
index 1ade58b..b72b940 100644
--- a/src/app/system-management/user/user.component.html
+++ b/src/app/system-management/user/user.component.html
@@ -95,7 +95,7 @@
             <th>姓名</th>
             <th>角色/预警接收级别</th>
             <th [width]="'13%'">所属机构</th>
-            <th [width]="'10%'" *ngIf="level == 2">审核状态</th>
+            <!-- <th [width]="'10%'" *ngIf="level == 2">审核状态</th> -->
             <th [width]="'8%'">用户状态</th>
             <th [width]="'8%'">备注</th>
             <th [width]="'10%'">操作</th>
@@ -112,9 +112,9 @@
             <td>
               {{data.organizationName}}
             </td>
-            <td *ngIf="level == 2">
+            <!-- <td *ngIf="level == 2">
               {{data.auditStatus | auditStatus}}
-            </td>
+            </td> -->
             <td>
               <ng-container *ngIf="data.isActive; else elseTemplate">
                 <span class="greenColor2">已启用</span>
diff --git a/src/app/system-management/user/user.component.ts b/src/app/system-management/user/user.component.ts
index 04678b3..503f64a 100644
--- a/src/app/system-management/user/user.component.ts
+++ b/src/app/system-management/user/user.component.ts
@@ -53,21 +53,21 @@ export class UserComponent implements OnInit {
     this.level = JSON.parse(
       sessionStorage.getItem("userdata")
     ).organization.level;
-    if (this.level == 1) {
-      this.getAllUrl = "/api/services/app/User/GetAll";
-      this.addUrl = "/api/services/app/User/Create";
-      this.editUrl = "/api/services/app/User/Update";
-      this.deleteUrl = "/api/services/app/User/Delete";
-      this.CountsByOrganizations =
-        "/api/services/app/User/GetCountsByOrganizations";
-    } else {
-      this.getAllUrl = "/api/services/app/EdittingUser/GetAll";
-      this.addUrl = "/api/services/app/EdittingUser/Create";
-      this.editUrl = "/api/services/app/EdittingUser/Update";
-      this.deleteUrl = "/api/services/app/EdittingUser/Delete";
-      this.CountsByOrganizations =
-        "/api/services/app/EdittingUser/GetCountsByOrganizations";
-    }
+    // if (this.level == 1) {
+    this.getAllUrl = "/api/services/app/User/GetAll";
+    this.addUrl = "/api/services/app/User/Create";
+    this.editUrl = "/api/services/app/User/Update";
+    this.deleteUrl = "/api/services/app/User/Delete";
+    this.CountsByOrganizations =
+      "/api/services/app/User/GetCountsByOrganizations";
+    // } else {
+    //   this.getAllUrl = "/api/services/app/EdittingUser/GetAll";
+    //   this.addUrl = "/api/services/app/EdittingUser/Create";
+    //   this.editUrl = "/api/services/app/EdittingUser/Update";
+    //   this.deleteUrl = "/api/services/app/EdittingUser/Delete";
+    //   this.CountsByOrganizations =
+    //     "/api/services/app/EdittingUser/GetCountsByOrganizations";
+    // }
     this.getAllOrganization();
     this.getAllRoles();
     this.getAllRoles2();
@@ -102,7 +102,6 @@ export class UserComponent implements OnInit {
       .subscribe((data: any) => {
         this.usersLIst = data.result.items;
         this.usersNum = data.result.totalCount;
-        console.log("所有用户", this.usersLIst);
         this.loading = false;
       });
   }
@@ -216,7 +215,6 @@ export class UserComponent implements OnInit {
           this.defaultExpandedKeys = [this.nodes[0].id];
           this.nzSelectedKeys = [this.nodes[0].id];
           this.OrganizationUnitId = [this.nodes[0].id];
-          console.log(this.nodes, 9000);
         });
     });
   }
@@ -230,7 +228,6 @@ export class UserComponent implements OnInit {
     this.getAllUsers();
   }
   nzClick(event: NzFormatEmitEvent) {
-    console.log(event);
     this.nzSelectedKeys[0] = event.node.origin.id;
     this.nzSelectedKeys = [...this.nzSelectedKeys];
     this.OrganizationUnitId = event.node.origin.id;
@@ -295,15 +292,10 @@ export class UserComponent implements OnInit {
       },
     });
     const instance = modal.getContentComponent();
-    modal.afterOpen.subscribe(() => console.log("[afterOpen] emitted!"));
-    modal.afterClose.subscribe((result) =>
-      console.log("[afterClose] The result is:", result)
-    );
   }
 
   //编辑用户
   editUser(data): void {
-    console.log(data);
     const modal = this.modal.create({
       nzTitle: "编辑用户",
       nzContent: EdituserComponent,
@@ -312,7 +304,7 @@ export class UserComponent implements OnInit {
       nzFooter: null,
       nzMaskClosable: false,
       nzComponentParams: {
-        data: data,
+        data: JSON.parse(JSON.stringify(data)),
         listOfData: this.listOfData,
         listOfData2: this.listOfData2,
         nodes: this.nodes,
@@ -327,27 +319,30 @@ export class UserComponent implements OnInit {
   isShowNewPassword: boolean;
   newPasswordObj: any;
   resetPassword(item) {
-    // console.log(item)
     this.modal.confirm({
       nzTitle: `确定要重置${item.userName}这个账户的密码吗?`,
       nzOkText: "确定",
       nzOkType: "primary",
       nzOnOk: () => {
         let body;
-        if (this.level == 1) {
-          body = {
-            userId: item.id,
-          };
-        } else {
-          if (item.userId) {
-            body = {
-              userId: item.userId,
-            };
-          } else {
-            this.message.create("warning", "审核未完成的不能重置密码");
-            return;
-          }
-        }
+        // if (this.level == 1) {
+        //   body = {
+        //     userId: item.id,
+        //   };
+        // } else {
+        //   if (item.userId) {
+        //     body = {
+        //       userId: item.userId,
+        //     };
+        //   } else {
+        //     this.message.create("warning", "审核未完成的不能重置密码");
+        //     return;
+        //   }
+        // }
+
+        body = {
+          userId: item.id,
+        };
 
         this.http
           .post("/api/services/app/User/ResetPassword", body)
@@ -450,15 +445,19 @@ export class UserComponent implements OnInit {
   //停用启用
   cancel(data, type) {
     let url;
-    if (this.level == 1) {
-      type
-        ? (url = "/api/services/app/User/Activate")
-        : (url = "/api/services/app/User/DeActivate");
-    } else {
-      type
-        ? (url = "/api/services/app/EdittingUser/Activate")
-        : (url = "/api/services/app/EdittingUser/DeActivate");
-    }
+
+    type
+      ? (url = "/api/services/app/User/Activate")
+      : (url = "/api/services/app/User/DeActivate");
+    // if (this.level == 1) {
+    //   type
+    //     ? (url = "/api/services/app/User/Activate")
+    //     : (url = "/api/services/app/User/DeActivate");
+    // } else {
+    //   type
+    //     ? (url = "/api/services/app/EdittingUser/Activate")
+    //     : (url = "/api/services/app/EdittingUser/DeActivate");
+    // }
     let body = {
       id: data.id,
     };