Explorar o código

update 国家级管理员

warrior hai 9 meses
pai
achega
239fc468a5

+ 15 - 25
projects/textbook/src/modules/nav-admin/components/profile/profile.component.html

@@ -12,8 +12,10 @@
   [nzScroll]="{ x: (maxWidth || '800') + 'px', y: '480px' }"
   [nzTotal]="profiles.length"
   [nzPageSize]="10"
-    nzTableLayout="fixed"
-    style="margin: 10px 0"
+  [nzLoading]="loading"
+  nzTableLayout="fixed"
+  nzTemplateMode
+  style="margin: 10px 0"
 >
   <thead>
     <tr>
@@ -21,9 +23,7 @@
       <th nzWidth="120px">电话号码</th>
       <th nzWidth="120px">邮箱</th>
       <th nzWidth="120px">所属部门</th>
-      @if (!disabled) {
       <th nzWidth="50px" nzRight>操作</th>
-      }
     </tr>
   </thead>
   <tbody>
@@ -31,16 +31,16 @@
     <tr>
       <td nzEllipsis nzLeft>
         <nz-avatar nzIcon="user"></nz-avatar>
-        {{ data?.get("user").get("name") }}
+        {{ data?.get("user").get("name") || "-" }}
       </td>
       <td nzEllipsis>
-        {{ data?.get("user").get("phone") }}
+        {{ data?.get("user").get("phone") || "-" }}
       </td>
       <td nzEllipsis>
-        {{ data?.get("user").get("phone") || data?.get("email") }}
+        {{ data?.get("user").get("phone") || data?.get("email") || "-" }}
       </td>
       <td nzEllipsis>
-        {{ data?.get("user").get("departmentName") }}
+        {{ data?.get("user").get("departmentName") || "-" }}
       </td>
       <td nzEllipsis nzRight>
         <button
@@ -53,40 +53,27 @@
         </button>
         <nz-dropdown-menu #menu="nzDropdownMenu">
           <ul nz-menu>
-            @if (!disabled) {
             <li nz-menu-item>
               @if(checked(data.id)){
               <button
                 nz-button
-                (click)="onChange(data.id)"
+                (click)="onChange(data.id, 'delete')"
                 nzType="link"
                 style="color: #231c1f"
               >
-                <span nz-icon nzType="delete" nzTheme="outline"></span>取消权限
+                <span nz-icon nzType="delete" nzTheme="outline"></span>删除
               </button>
               }@else {
               <button
                 nz-button
-                (click)="onChange(data.id)"
+                (click)="onChange(data.id, 'push')"
                 nzType="link"
                 style="color: #231c1f"
               >
-                <span nz-icon nzType="edit" nzTheme="outline"></span>设置权限
+                <span nz-icon nzType="edit" nzTheme="outline"></span>设为管理员
               </button>
               }
             </li>
-            } @else {
-            <li nz-menu-item>
-              <button
-                nz-button
-                [disabled]="user?.get('isDeleted')"
-                nzType="link"
-                style="color: #231c1f"
-              >
-                <span nz-icon nzType="delete" nzTheme="outline"></span>删除
-              </button>
-            </li>
-            }
           </ul>
         </nz-dropdown-menu>
       </td>
@@ -94,3 +81,6 @@
     }
   </tbody>
 </nz-table>
+@if (profiles.length == 0) {
+<nz-empty></nz-empty>
+}

+ 19 - 12
projects/textbook/src/modules/nav-admin/components/profile/profile.component.ts

@@ -6,12 +6,13 @@ import { Profile } from '../../../../schemas/Profile';
 import * as Parse from 'parse';
 import { CommonModule } from '@angular/common';
 import { NzAvatarModule } from 'ng-zorro-antd/avatar';
+import { NzEmptyModule } from 'ng-zorro-antd/empty';
 import { NzMessageService } from 'ng-zorro-antd/message';
 @Component({
   selector: 'app-profile',
   templateUrl: './profile.component.html',
   styleUrls: ['./profile.component.scss'],
-  imports: [CommonModule, RouterOutlet, CompTableListComponent, CommonCompModule,NzAvatarModule],
+  imports: [CommonModule, RouterOutlet, CompTableListComponent,NzEmptyModule, CommonCompModule,NzAvatarModule],
   standalone: true,
 })
 export class ProfileComponent  implements OnInit {
@@ -53,7 +54,9 @@ export class ProfileComponent  implements OnInit {
   ngOnInit() {
     this.getProfile()
   }
+  loading:boolean = false
   async getProfile(){
+    this.loading = true
     let query = new Parse.Query('Profile')
     if(this.depart){
       let queryParams = {
@@ -77,23 +80,27 @@ export class ProfileComponent  implements OnInit {
     }
     this.identity && query.equalTo('identity',this.identity)
     this.disabled && query.containedIn('objectId',this.idList)
+    query.notEqualTo('isDeleted',true)
     query.include('user','user.department')
     this.profiles = await query.find()
+    this.loading = false
   }
-  onChange(id:string){
-    console.log(this.idList);
+  onChange(id:string, type:string){
     let index = this.idList.findIndex(item=> item == id)
-    if(index == -1){
-      if(this.idList.length >= this.maxChecked){
-        this.msg.warning('超出数量限制')
-        this.idList.shift()
+    if(type == 'delete'){
+      this.idList.splice(index,1)
+    }else{
+      if(index == -1){
+        if(this.idList.length >= this.maxChecked){
+          // this.msg.warning('超出数量限制')
+          this.idList.shift()
+          this.idList.push(id)
+          return
+        }
         this.idList.push(id)
-        console.log(this.idList);
-        return
+      }else{
+        this.idList.splice(index,1)
       }
-      this.idList.push(id)
-    }else{
-      this.idList.splice(index,1)
     }
     this.change.emit(this.idList)
   }

+ 1 - 0
projects/textbook/src/modules/nav-admin/page-process/page-process.component.ts

@@ -52,6 +52,7 @@ export class PageProcessComponent  implements OnInit {
   ngOnInit() {
     this.activeRoute.paramMap.subscribe(async (params) => {
       let id = params.get('id');
+      this.queryParams.where['department'] = id
       if (id) {
         let query = new Parse.Query('EduProcess');
         query.include('branch', 'department');

+ 13 - 4
projects/textbook/src/modules/nav-admin/page-process/process-create/process-create.component.html

@@ -304,22 +304,31 @@
       <div class="title-row">
         <div class="bar">
           工作联系人
-          <a class="btn" (click)="onShowCheck()">选择联系人</a>
+          <a class="btn" [style.color]="profileId ? '#86b9f5' : ''" (click)="onShowCheck()">选择联系人</a>
         </div>
       </div>
       <div class="table" #maxWidth>
-        @if (eduProcess?.get('profileSubmitted') && !showProfileFrom) {
+        @if (profileId) {
         <app-profile
-          [idList]="profileId ? [profileId] : []"
+          [idList]="profileId ? [profileId] : ['']"
           (change)="changeSubmitted($event)"
           [maxWidth]="maxWidth"
           [disabled]="true"
+          [depart]="eduProcess?.get('department')?.id"
         ></app-profile>
         } @else if(showProfileFrom){
         <app-profile
-          [idList]="profileId ? [profileId] : []"
           [maxWidth]="maxWidth"
           (change)="changeSubmitted($event)"
+          [depart]="eduProcess?.get('department')?.id"
+          ></app-profile>
+        }@else {
+          <app-profile
+          [idList]="['']"
+          (change)="changeSubmitted($event)"
+          [maxWidth]="maxWidth"
+          [disabled]="true"
+          [depart]="eduProcess?.get('department')?.id"
         ></app-profile>
         }
       </div>

+ 45 - 24
projects/textbook/src/modules/nav-admin/page-process/process-create/process-create.component.ts

@@ -29,7 +29,8 @@ import { NzRadioModule } from 'ng-zorro-antd/radio';
     NzSelectModule,
     SubmittedComponent,
     MatButtonModule,
-    ProfileComponent,NzRadioModule
+    ProfileComponent,
+    NzRadioModule,
   ],
   standalone: true,
 })
@@ -41,8 +42,8 @@ export class ProcessCreateComponent implements OnInit {
   @Input('isEdit') isEdit: boolean = false; //当前是否作为编辑子组件
   profileId: string = '';
   isVisible: boolean = false;
-  searchValue:string = '' //搜索部门内容
-  
+  searchValue: string = ''; //搜索部门内容
+
   validateForm: FormGroup<{
     name: FormControl<Array<string> | any>; //流程名称
     desc: FormControl<Array<string> | any>; //流程描述
@@ -57,8 +58,8 @@ export class ProcessCreateComponent implements OnInit {
     code: ['', [Validators.required]],
     num: ['', [Validators.required]],
     branch: ['', [Validators.required]],
-    startDate: [new Date(), [Validators.required]],
-    deadline: [new Date(), [Validators.required]],
+    startDate: [new Date('2024/07/20'), [Validators.required]],
+    deadline: [new Date('2024-09-20'), [Validators.required]],
   });
   department: string = ''; //所属单位
   unitTypes: Array<any> = []; //单位类型
@@ -93,22 +94,25 @@ export class ProcessCreateComponent implements OnInit {
           desc: [this.eduProcess?.get('desc') || '', [Validators.required]],
           code: [this.eduProcess?.get('code') || '', [Validators.required]],
           num: [this.eduProcess?.get('num') || '', [Validators.required]],
-          branch: [this.eduProcess?.get('branch')?.id || '', [Validators.required]],
+          branch: [
+            this.eduProcess?.get('branch')?.id || '',
+            [Validators.required],
+          ],
           startDate: [
             this.eduProcess?.get('startDate')
               ? this.eduProcess?.get('startDate')
-              : new Date(),
+              : new Date('2024/07/20'),
             [Validators.required],
           ],
           deadline: [
             this.eduProcess?.get('deadline')
               ? this.eduProcess?.get('deadline')
-              : new Date(),
+              : new Date('2024-09-20'),
             [Validators.required],
           ],
         });
       }
-      this.profileId = this.eduProcess?.get('profileSubmitteds')?.id || '';
+      this.profileId = this.eduProcess?.get('profileSubmitted')?.id || '';
       this.department = this.eduProcess?.get('department')?.id || '';
     });
   }
@@ -131,7 +135,7 @@ export class ProcessCreateComponent implements OnInit {
     query.limit(100);
     val && query.contains('name', val);
     let r = await query.find();
-    this.parentList = r
+    this.parentList = r;
   }
   async submitForm(type: string): Promise<void> {
     if (type == 'close') {
@@ -189,12 +193,14 @@ export class ProcessCreateComponent implements OnInit {
     this.eduProcess?.set('num', params.num);
     this.eduProcess?.set('startDate', params.startDate);
     this.eduProcess?.set('deadline', params.deadline);
-    let pid = await this.getProfile();
-    this.eduProcess?.set('profileSubmitteds', {
-      __type: 'Pointer',
-      className: 'Profile',
-      objectId: pid,
-    });
+    if (!this.eduProcess?.get('profileSubmitted')) {
+      let pid = await this.getProfile();
+      this.eduProcess?.set('profileSubmitted', {
+        __type: 'Pointer',
+        className: 'Profile',
+        objectId: pid,
+      });
+    }
     this.eduProcess = await this.eduProcess?.save();
     this.msg.success(this.isEdit ? '已保存' : '已创建');
     this.showProfileFrom = false;
@@ -210,7 +216,9 @@ export class ProcessCreateComponent implements OnInit {
         this.eduProcess?.get('department').id
       );
     } else {
-      let dp = this.unitTypes.find(item=> item.id == this.validateForm.value.branch)
+      let dp = this.unitTypes.find(
+        (item) => item.id == this.validateForm.value.branch
+      );
       this.parentMap = [
         {
           title: dp?.name,
@@ -238,6 +246,7 @@ export class ProcessCreateComponent implements OnInit {
   }
   //选择联系人
   onShowCheck() {
+    if(this.profileId)return
     this.showProfileFrom = true;
   }
   //获取联系人
@@ -251,7 +260,7 @@ export class ProcessCreateComponent implements OnInit {
                 where: {
                   $or: [
                     {
-                      department: { $eq: this.validateForm.value.branch },
+                      department: { $eq: this.department },
                     },
                   ],
                 },
@@ -274,7 +283,19 @@ export class ProcessCreateComponent implements OnInit {
   }
   async changeSubmitted(e: Array<string>) {
     console.log(e);
-    if (e[0]) this.profileId = e[0];
+    this.profileId = e[0];
+    this.eduProcess?.set(
+      'profileSubmitted',
+      this.profileId
+        ? {
+            __type: 'Pointer',
+            className: 'Profile',
+            objectId: this.profileId,
+          }
+        : null
+    );
+    await this.eduProcess?.save();
+    this.showProfileFrom = false
   }
   onCheck(e: any) {
     console.log(e);
@@ -282,17 +303,17 @@ export class ProcessCreateComponent implements OnInit {
   //选择部门
   async onCheckedDepart(e: any, checked?: boolean) {
     console.log(e);
-    this.department = e.id
+    this.department = e.id;
   }
   handleCancel(): void {
     console.log('Button cancel clicked!');
     this.isVisible = false;
   }
-  async handleOk():Promise<void> {
+  async handleOk(): Promise<void> {
     this.eduProcess?.set('branch', {
       __type: 'Pointer',
       className: 'Department',
-      objectId: this.validateForm.value.branch
+      objectId: this.validateForm.value.branch,
     });
     this.department &&
       this.eduProcess?.set('department', {
@@ -300,8 +321,8 @@ export class ProcessCreateComponent implements OnInit {
         className: 'Department',
         objectId: this.department,
       });
-     await this.eduProcess?.save()
-     this.ngOnInit()
+    await this.eduProcess?.save();
+    this.ngOnInit();
     this.isVisible = false;
   }
 }

+ 59 - 20
projects/textbook/src/modules/nav-admin/page-process/process-list/process-list.component.html

@@ -33,6 +33,7 @@
             nz-input
             placeholder="搜索"
             [(ngModel)]="searchValue"
+            (ngModelChange)="onSearch($event)"
           />
         </nz-input-group>
         <ng-template #prefixTemplateUser
@@ -50,7 +51,7 @@
         </button>
         <nz-dropdown-menu #menutep="nzDropdownMenu">
           <ul nz-menu>
-            <li nz-menu-item>
+            <!-- <li nz-menu-item>
               <button
                 nz-button
                 nzType="link"
@@ -59,7 +60,7 @@
               >
                 <span nz-icon nzType="plus" nzTheme="outline"></span>添加部门
               </button>
-            </li>
+            </li> -->
             <li nz-menu-item>
               <button
                 nz-button
@@ -80,7 +81,8 @@
             type="text"
             nz-input
             placeholder="搜索流程名称 / 流程 code"
-            [(ngModel)]="searchValue"
+            [(ngModel)]="searchValuePro"
+            (ngModelChange)="onSearchPro($event)"
           />
         </nz-input-group>
         <ng-template #prefixTemplateUser
@@ -137,22 +139,22 @@
               (nzCheckedChange)="onItemChecked(data.objectId, $event)"
             ></td>
             <td nzLeft>
-              {{ data?.name }}
+              {{ data?.name || '-' }}
             </td>
             <td>
-              {{ data?.code }}
+              {{ data?.code || '-' }}
             </td>
             <td>
-              {{ data?.desc }}
+              {{ data?.desc || '-' }}
             </td>
             <td>
-              {{ data?.num }}
+              {{ data?.num || '-' }}
             </td>
             <td>
-              {{ data?.profileSubmitted?.user.name }}
+              {{ data?.profileSubmitted?.user.name || '-'}}
             </td>
             <td>
-              {{ data?.status }}
+              <nz-tag [nzColor]="data?.state.color"> {{ data?.state.title}}</nz-tag>
             </td>
             <td nzRight>
               <button
@@ -165,17 +167,54 @@
               </button>
               <nz-dropdown-menu #menu="nzDropdownMenu">
                 <ul nz-menu>
-                  <li nz-menu-item>
-                    <button
-                      nz-button
-                      [disabled]="user?.get('isDeleted')"
-                      nzType="link"
-                      style="color: #231c1f"
-                    >
-                      <span nz-icon nzType="delete" nzTheme="outline"></span
-                      >删除流程
-                    </button>
-                  </li>
+                  @if (data.state?.strat){
+                    <li nz-menu-item>
+                      <button
+                        nz-button
+                        [disabled]="user?.get('isDeleted')"
+                        nzType="link"
+                        style="color: #231c1f"
+                      >
+                      <span nz-icon nzType="caret-right" nzTheme="outline"></span>开始流程
+                      </button>
+                    </li>
+                  }
+                  @if (data.state?.stop){
+                    <li nz-menu-item>
+                      <button
+                        nz-button
+                        [disabled]="user?.get('isDeleted')"
+                        nzType="link"
+                        style="color: #231c1f"
+                      >
+                      <span nz-icon nzType="pause-circle" nzTheme="outline"></span>暂停流程
+                      </button>
+                    </li>
+                  }
+                  @if (data.state?.end){
+                    <li nz-menu-item>
+                      <button
+                        nz-button
+                        [disabled]="user?.get('isDeleted')"
+                        nzType="link"
+                        style="color: #231c1f"
+                      >
+                      <span nz-icon nzType="stop" nzTheme="outline"></span>结束流程
+                      </button>
+                    </li>
+                  }
+                  @if (data.state?.del){
+                    <li nz-menu-item>
+                      <button
+                        nz-button
+                        nzType="link"
+                        style="color: #231c1f"
+                      >
+                        <span nz-icon nzType="delete" nzTheme="outline"></span
+                        >删除流程
+                      </button>
+                    </li>
+                  }
                   <li nz-menu-item>
                     <button
                       (click)="

+ 121 - 41
projects/textbook/src/modules/nav-admin/page-process/process-list/process-list.component.ts

@@ -70,6 +70,7 @@ export class ProcessListComponent implements OnInit {
   queryParams: any | undefined;
   fieldsArray: Array<any> | undefined;
   searchValue: string = ''; //搜索内容
+  searchValuePro: string = ''; //搜索流程内容
   nodes: Array<nodes | any> = [];
   currentDepart: nodes | any = null;
 
@@ -94,13 +95,75 @@ export class ProcessListComponent implements OnInit {
   parentMap: Array<any> = [];
   parentList: Array<any> = [];
   setOfCheckedId = new Set<string>();
-
+  formatStatus = (e:any)=>{
+    if(e.status == '100'){
+      return {
+        title:'已暂停',
+        color:'lime',
+        strat:true,
+        stop:true,
+        end:false,
+        del:false,
+      }
+    }
+    if(e?.deadline.iso && new Date() > new Date(e.deadline.iso) && e.status == '200'){
+      return {
+        title:'已结束',
+        color:'gold',
+        strat:false,
+        stop:false,
+        end:false,
+        del:true,
+      }
+    }
+    if(e.status == '200'){
+      return {
+        title:'已完成',
+        color:'green',
+        strat:false,
+        stop:false,
+        end:true,
+        del:false,
+      }
+    }
+    if(!e?.startDate.iso || (new Date() < new Date(e.startDate.iso))){
+      return {
+        title:'未开始',
+        color:'grey',
+        strat:true,
+        stop:false,
+        end:false,
+        del:true,
+      }
+    }
+    if(!e.statuse && e.startDate.iso && new Date() >= new Date(e.startDate.iso) ){
+      return {
+        title:'遴选中',
+        color:'blue',
+        strat:false,
+        stop:true,
+        end:true,
+        del:false,
+      }
+    }
+    if(e?.deadline.iso && (new Date() > new Date(e.deadline.iso))){
+      return {
+        title:'已逾期',
+        color:'red',
+        strat:true,
+        stop:false,
+        end:false,
+        del:true,
+      }
+    }
+    return
+  }
   constructor(
     private route: Router,
     private activeRoute: ActivatedRoute,
     private nzContextMenuService: NzContextMenuService,
     private message: NzMessageService,
-    private modal: NzModalService,
+    private modal: NzModalService
   ) {
     this.user = Parse.User.current();
     this.className = this.Department.className;
@@ -141,9 +204,11 @@ export class ProcessListComponent implements OnInit {
     });
     return nodes;
   }
-  //添加成员
-  addMember() {
-    this.message.warning('权限灰度中');
+  async onSearch(e: string) {
+    this.nodes = await this.getDepart('', e);
+  }
+  onSearchPro(e: string){
+    this.getProfile()
   }
   changeDepart(e: any) {
     this.currentDepart = e;
@@ -176,31 +241,47 @@ export class ProcessListComponent implements OnInit {
         ],
       },
     };
-    let query = Parse.Query.fromJSON('EduProcess', queryParams);
-    query.include('profileSubmitted','profileSubmitted.user');
-    
+    let query1 = Parse.Query.fromJSON('EduProcess', queryParams);
+    let query2= Parse.Query.fromJSON('EduProcess', {
+      where: {
+        $or: [
+          {
+            name: { "$regex": `.*${this.searchValuePro}.*`},
+          },
+        ]
+      }
+    });
+    let query3= Parse.Query.fromJSON('EduProcess', {
+      where: {
+        $or: [
+          {
+            code: { "$regex": `.*${this.searchValuePro}.*`},
+          },
+        ]
+      }
+    });
+    let query = Parse.Query.and(query1,Parse.Query.or(query2, query3));
+    query.include('profileSubmitted', 'profileSubmitted.user');
     let r = await query.find();
     let list: any[] = [];
     r.forEach((item) => {
       let _item = item.toJSON();
       _item['checked'] = false;
+      _item['state'] = this.formatStatus(_item);
       list.push(_item);
     });
     this.eduProcessList = list;
     this.loading = false;
   }
-  //搜索触发
-  onSearch(event: NzFormatEmitEvent) {
-    console.log(event);
-  }
+
   onAllChecked(checked: boolean): void {
     console.log(checked);
     this.eduProcessList = this.eduProcessList.map((item) => {
       item.checked = checked;
-      if(checked){
-        this.setOfCheckedId.add(item.user.objectId)
-      }else{
-        this.setOfCheckedId.delete(item.user.objectId)
+      if (checked) {
+        this.setOfCheckedId.add(item.user.objectId);
+      } else {
+        this.setOfCheckedId.delete(item.user.objectId);
       }
       return item;
     });
@@ -213,10 +294,10 @@ export class ProcessListComponent implements OnInit {
       if (!item.checked) checkedAll = false;
       return item;
     });
-    if(e){
-      this.setOfCheckedId.add(id)
-    }else{
-      this.setOfCheckedId.delete(id)
+    if (e) {
+      this.setOfCheckedId.add(id);
+    } else {
+      this.setOfCheckedId.delete(id);
     }
     this.checkedAll = checkedAll;
   }
@@ -294,37 +375,36 @@ export class ProcessListComponent implements OnInit {
   showModalOrganize() {
     this.message.warning('权限灰度中');
   }
-  deleteSelected(){
+  deleteSelected() {
     this.modal.confirm({
       nzTitle: '批量删除',
       nzContent: `删除后数据不可恢复,请谨慎操作`,
       nzOkText: '确认',
       nzOkType: 'primary',
       nzOkDanger: true,
-      nzOnOk:async () => {
-        let selectedList = this.eduProcessList.filter((item:any)=>this.setOfCheckedId.has(item?.id))
-        let deletePromiseList = selectedList.map((item:any)=>{
-          return new Promise((resolve=>{
-            item.set("isDeleted",true);
+      nzOnOk: async () => {
+        let selectedList = this.eduProcessList.filter((item: any) =>
+          this.setOfCheckedId.has(item?.id)
+        );
+        let deletePromiseList = selectedList.map((item: any) => {
+          return new Promise((resolve) => {
+            item.set('isDeleted', true);
             item.save();
-          }))
-        })
-        try{
-          await Promise.all(deletePromiseList)
-        }
-        catch(err){
-
-        }
+          });
+        });
+        try {
+          await Promise.all(deletePromiseList);
+        } catch (err) {}
       },
       nzCancelText: '取消',
-      nzOnCancel: () => console.log('Cancel')
+      nzOnCancel: () => console.log('Cancel'),
     });
-   }
-  toUrl(url:string, params?:object){
-    if(params){
-      this.route.navigate([url,params])
-    }else{
-      this.route.navigate([url])
+  }
+  toUrl(url: string, params?: object) {
+    if (params) {
+      this.route.navigate([url, params]);
+    } else {
+      this.route.navigate([url]);
     }
   }
 }

+ 1 - 1
projects/textbook/src/modules/nav-admin/page-user/page-user.component.html

@@ -105,7 +105,7 @@
       <tr>
         <td
           nzLeft
-          [nzChecked]="data.checked"
+          [nzChecked]="setOfCheckedId.has(data.objectId)"
           (nzCheckedChange)="
             onItemChecked(data.objectId, data.user.objectId, $event)
           "

+ 2 - 11
projects/textbook/src/modules/nav-admin/page-user/page-user.component.ts

@@ -107,29 +107,20 @@ export class PageUserComponent implements OnInit {
   }
   createUser() {}
   onItemChecked(id: string,user:string, e: boolean) {
-    let checkedAll = true;
-    this.profiles = this.profiles.map((item) => {
-      if (id == item.objectId) item.checked = e;
-      if (!item.checked) checkedAll = false;
-      return item;
-    });
     if(e){
       this.setOfCheckedId.add(user)
     }else{
       this.setOfCheckedId.delete(user)
     }
-    this.checkedAll = checkedAll;
+    this.checkedAll = this.profiles.every((item) => this.setOfCheckedId.has(item.user.objectId))
   }
   onAllChecked(checked: boolean): void {
-    console.log(checked);
-    this.profiles = this.profiles.map((item) => {
-      item.checked = checked;
+    this.profiles.forEach((item) => {
       if(checked){
         this.setOfCheckedId.add(item.user.objectId)
       }else{
         this.setOfCheckedId.delete(item.user.objectId)
       }
-      return item;
     });
     this.checkedAll = checked;
   }

+ 2 - 2
server/db/schemas/EduProcess.js

@@ -45,8 +45,8 @@ export const EduProcess = {
       "type": "Date",
       "required": false
     },
-    "status": {//状态
-      "type": "Date",
+    "status": {//状态 100:暂停 200:已提交
+      "type": "String",
       "required": false
     },
   },

+ 5 - 0
server/db/schemas/EduTextbook.js

@@ -11,6 +11,11 @@ export const EduTextbook = {
             "targetClass":"_User",
             "required": false
         },
+        "department": { //所属流程
+            "type": "Pointer",
+            "targetClass":"Department",
+            "required": false
+        },
         "render": { //是否提交
             "type": "Boolean",
             "required": false