Procházet zdrojové kódy

修复部分问题

warrior před 1 měsícem
rodič
revize
9ec50096ca
20 změnil soubory, kde provedl 288 přidání a 183 odebrání
  1. 2 1
      projects/textbook/src/app/textbook/textbook.component.ts
  2. 33 7
      projects/textbook/src/modules/nav-admin/components/collect-textbook/collect-textbook.component.html
  3. 8 1
      projects/textbook/src/modules/nav-admin/components/collect-textbook/collect-textbook.component.ts
  4. 13 2
      projects/textbook/src/modules/nav-admin/page-process/page-process.component.html
  5. 24 8
      projects/textbook/src/modules/nav-admin/page-process/page-process.component.scss
  6. 19 9
      projects/textbook/src/modules/nav-admin/page-process/page-process.component.ts
  7. 60 37
      projects/textbook/src/modules/nav-admin/page-process/process-create/process-create.component.ts
  8. 2 2
      projects/textbook/src/modules/nav-admin/user-edit/user-edit.component.ts
  9. 1 1
      projects/textbook/src/modules/nav-author/apply/apply.component.html
  10. 12 2
      projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.html
  11. 11 45
      projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.ts
  12. 2 1
      projects/textbook/src/modules/nav-author/components/create/author-file/author-file.component.ts
  13. 2 2
      projects/textbook/src/modules/nav-author/components/textbook-content/textbook-content.component.html
  14. 1 1
      projects/textbook/src/modules/nav-province-contact/activity/activity.component.ts
  15. 3 3
      projects/textbook/src/modules/nav-province-contact/activity/review-edit/review-edit.component.html
  16. 79 51
      projects/textbook/src/modules/nav-province-contact/activity/review-edit/review-edit.component.ts
  17. 2 2
      projects/textbook/src/modules/nav-province-contact/page-process/process-create/process-create.component.html
  18. 3 3
      projects/textbook/src/modules/nav-province-contact/page-role/page-role.component.html
  19. 9 4
      projects/textbook/src/modules/nav-province-contact/page-role/page-role.component.ts
  20. 2 1
      projects/textbook/src/services/compute.ts

+ 2 - 1
projects/textbook/src/app/textbook/textbook.component.ts

@@ -472,7 +472,8 @@ export class TextbookComponent implements OnInit {
     query.select('name');
     query.notEqualTo('isDeleted', true);
     if (all) {
-      query.containedIn('parent', filters);
+      // query.containedIn('parent', filters);
+      query.equalTo('objectId', this.tbookSer.profile.user?.department?.objectId);
     } else {
       query.equalTo('parent', '66865d66ad23a23355b12aa7');
     }

+ 33 - 7
projects/textbook/src/modules/nav-admin/components/collect-textbook/collect-textbook.component.html

@@ -65,17 +65,22 @@
             </div>
           </ng-template>
         </td>
-        <td nzEllipsis>
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplateCode">
           {{ data?.get("code") ?? "-" }}
+          <ng-template #contentTemplateCode>
+            <div style="max-width: 400px">
+              {{ data?.get("code") ?? "-" }}
+            </div>
+          </ng-template>
         </td>
         <td
           nzEllipsis
           nz-popover
-          [nzPopoverContent]="contentTemplateISBN"
+          [nzPopoverContent]="contentTemplateISBNContent1"
           #ISBN
         >
           {{ fromatFiled(data?.get("childrens"), "ISBN") }}
-          <ng-template #contentTemplateISBN>
+          <ng-template #contentTemplateISBNContent1>
             <div style="max-width: 400px">
               {{ ISBN.innerText }}
             </div>
@@ -111,7 +116,19 @@
           </ng-template>
         </td>
         @if (!eduProcess?.id) {
-        <td nzEllipsis>{{ data?.get("department")?.get("name") }}</td>
+        <td
+          [nzPopoverContent]="departmentContent"
+          #department
+          nz-popover
+          nzEllipsis
+        >
+          {{ data?.get("department")?.get("name") }}
+          <ng-template #departmentContent>
+            <div style="max-width: 400px">
+              {{ department.innerText }}
+            </div>
+          </ng-template>
+        </td>
         }
         <td nzEllipsis nzAlign="center">
           <span [style.color]="statusMap[data.id].color">{{
@@ -148,12 +165,12 @@
                 </button>
               </li>
               }@else {
-              <li nz-menu-item (click)="onEmitMsg(data)">
+              <!-- <li nz-menu-item (click)="onEmitMsg(data)">
                 <button nz-button nzType="link" style="color: #231c1f">
                   <span nz-icon nzType="read" nzTheme="outline"></span
                   >短信提醒上传
                 </button>
-              </li>
+              </li> -->
               }
             </ul>
           </nz-dropdown-menu>
@@ -264,8 +281,17 @@
                       </div>
                     </ng-template>
                   </td>
-                  <td nzEllipsis>
+                  <td
+                    nzEllipsis
+                    nz-popover
+                    [nzPopoverContent]="contentTemplateCode"
+                  >
                     {{ data?.get("code") ?? "-" }}
+                    <ng-template #contentTemplateCode>
+                      <div style="max-width: 400px">
+                        {{ data?.get("code") ?? "-" }}
+                      </div>
+                    </ng-template>
                   </td>
                   <td
                     nzEllipsis

+ 8 - 1
projects/textbook/src/modules/nav-admin/components/collect-textbook/collect-textbook.component.ts

@@ -275,7 +275,14 @@ export class CollectTextbookComponent implements OnInit {
       nzOkText: '确定',
       nzOkType: 'primary',
       nzOkDanger: false,
-      nzOnOk: () => console.log('OK'),
+      nzOnOk: () => {
+        Parse.Cloud.run('aliSmsSend', {
+          mobileList: [users],
+          templateCode: 'SMS_474205136',
+          params: {},
+          signName: '普通高等教育教材网',
+        });
+      },
       nzCancelText: '取消',
       nzOnCancel: () => console.log('Cancel')
     });

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

@@ -42,8 +42,12 @@
 <div class="edit-content">
   <nz-tabset [(nzSelectedIndex)]="active">
     <nz-tab nzTitle="报送流程">
-      @if (active == 0) {
-      <app-process-create [isEdit]="true"></app-process-create>
+      @if (eduProcess?.id) {
+      <app-process-create
+        [isEdit]="true"
+        [eduProcess]="eduProcess"
+        (save)="save($event)"
+      ></app-process-create>
       }
     </nz-tab>
     <nz-tab nzTitle="教材列表">
@@ -66,3 +70,10 @@
     </nz-tab>
   </nz-tabset>
 </div>
+@if (loading) {
+  <div class="loading">
+    <nz-spin nzSimple></nz-spin>
+    <div class="tips">加载中</div>
+  </div>
+}
+

+ 24 - 8
projects/textbook/src/modules/nav-admin/page-process/page-process.component.scss

@@ -1,4 +1,4 @@
-.subtitle{
+.subtitle {
   margin-right: 12px;
   color: #00000073;
   font-size: 14px;
@@ -8,23 +8,39 @@
   // white-space: nowrap;
   // text-overflow: ellipsis;
 }
-.edit-content{
+.edit-content {
   margin: 0 0 20px;
   padding: 0 24px;
   height: calc(100vh - 250px);
 }
-::ng-deep .ant-page-header-heading-title{
+::ng-deep .ant-page-header-heading-title {
   white-space: normal;
 }
-::ng-deep .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{
+::ng-deep .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
   color: #c6233f;
 }
-::ng-deep .ant-tabs-ink-bar{
+::ng-deep .ant-tabs-ink-bar {
   background: #c6233f;
 }
-::ng-deep .ant-tabs-tab:hover{
+::ng-deep .ant-tabs-tab:hover {
   color: #e97488;
 }
-::ng-deep .ant-tabs-tab-btn:active{
+::ng-deep .ant-tabs-tab-btn:active {
   color: #e97488;
-}
+}
+.loading {
+  position: absolute;
+  top: 0;
+  left: 0;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  width: 100%;
+  height: 100%;
+  background: #a1a1a12e;
+  .tips {
+    color: #6f6f6f;
+    font-size: 14px;
+  }
+}

+ 19 - 9
projects/textbook/src/modules/nav-admin/page-process/page-process.component.ts

@@ -21,11 +21,11 @@ import { CollectTextbookComponent } from '../components/collect-textbook/collect
     ProcessCreateComponent,
     CompTableListComponent,
     TextbookComponent,
-    CollectTextbookComponent
+    CollectTextbookComponent,
   ],
   standalone: true,
 })
-export class PageProcessComponent  implements OnInit {
+export class PageProcessComponent implements OnInit {
   @ViewChild('collect') collect: CollectTextbookComponent | any;
   @ViewChild('textbook') textbook: ElementRef | any;
 
@@ -37,12 +37,10 @@ export class PageProcessComponent  implements OnInit {
     showMore: true, //显示更多字段
     isCheck: false,
     status: ['400'],
-    btns: {review:true},
+    btns: { review: true },
   };
-  constructor(
-    private activeRoute:ActivatedRoute,
-    private router: Router,
-  ) {
+  loading: boolean = true;
+  constructor(private activeRoute: ActivatedRoute, private router: Router) {
     this.user = Parse.User.current();
   }
 
@@ -51,10 +49,22 @@ export class PageProcessComponent  implements OnInit {
       let id = params.get('id');
       if (id) {
         let query = new Parse.Query('EduProcess');
-        query.include('branch', 'department');
+        query.include('branch', 'department', 'profileSubmitted');
         query.equalTo('objectId', id);
         this.eduProcess = await query.first();
+        this.loading = false;
       }
-    })
+    });
+  }
+  async save(obj: any) {
+    console.log(obj);
+    this.loading = obj.isLoadling;
+    if (obj.save) {
+      let query = new Parse.Query('EduProcess');
+      query.include('branch', 'department', 'profileSubmitted');
+      query.equalTo('objectId', this.eduProcess?.id);
+      this.eduProcess = await query.first();
+      this.loading = false;
+    }
   }
 }

+ 60 - 37
projects/textbook/src/modules/nav-admin/page-process/process-create/process-create.component.ts

@@ -1,4 +1,4 @@
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { CommonCompModule } from '../../../../services/common.modules';
 import { Router, ActivatedRoute } from '@angular/router';
@@ -36,8 +36,9 @@ import { NzRadioModule } from 'ng-zorro-antd/radio';
 })
 export class ProcessCreateComponent implements OnInit {
   timeDefaultValue = setHours(new Date(), 0);
+  @Output() save: EventEmitter<any> = new EventEmitter<any>();
 
-  eduProcess: Parse.Object | undefined;
+  @Input('eduProcess') eduProcess: Parse.Object | undefined;
   showProfileFrom: boolean = false;
   @Input('isEdit') isEdit: boolean = false; //当前是否作为编辑子组件
   profileId: string = '';
@@ -52,12 +53,11 @@ export class ProcessCreateComponent implements OnInit {
     branch: FormControl<Array<string> | any>; //所属分类
     startDate: FormControl<Date>; //开始时间
     deadline: FormControl<Date>; //结束时间
-
   }> = this.fb.group({
     name: ['', [Validators.required]],
-    desc: ['',[Validators.maxLength(500)]],
+    desc: ['', [Validators.maxLength(500)]],
     code: ['', [Validators.required]],
-    num: [0,],
+    num: [0],
     branch: ['', [Validators.required]],
     startDate: [new Date('2024/07/20'), [Validators.required]],
     deadline: [new Date('2024/09/20'), [Validators.required]],
@@ -82,25 +82,44 @@ export class ProcessCreateComponent implements OnInit {
 
   ngOnInit() {
     this.activeRoute.paramMap.subscribe(async (params) => {
-      let id = params.get('id');
+      this.save.emit({ isLoadling: true, save: false });
+      // let id = params.get('id');
       await this.getUnitTypes();
-      if (id) {
+      if (this.eduProcess?.id) {
         this.isEdit = true;
-        let query = new Parse.Query('EduProcess');
-        query.include('branch', 'department','profileSubmitted');
-        query.equalTo('objectId', id);
-        this.eduProcess = await query.first();
-        this.validateForm.get('name')?.setValue(this.eduProcess?.get('name') || '')
-        this.validateForm.get('desc')?.setValue(this.eduProcess?.get('desc') || '')
-        this.validateForm.get('code')?.setValue(this.eduProcess?.get('code') || '')
-        this.validateForm.get('num')?.setValue(this.eduProcess?.get('num') ?? 0)
-        this.validateForm.get('branch')?.setValue(this.eduProcess?.get('branch')?.id || '')
-        this.validateForm.get('startDate')?.setValue(this.eduProcess?.get('startDate')
+        // let query = new Parse.Query('EduProcess');
+        // query.include('branch', 'department','profileSubmitted');
+        // query.equalTo('objectId', id);
+        // this.eduProcess = await query.first();
+        this.validateForm
+          .get('name')
+          ?.setValue(this.eduProcess?.get('name') || '');
+        this.validateForm
+          .get('desc')
+          ?.setValue(this.eduProcess?.get('desc') || '');
+        this.validateForm
+          .get('code')
+          ?.setValue(this.eduProcess?.get('code') || '');
+        this.validateForm
+          .get('num')
+          ?.setValue(this.eduProcess?.get('num') ?? 0);
+        this.validateForm
+          .get('branch')
+          ?.setValue(this.eduProcess?.get('branch')?.id || '');
+        this.validateForm
+          .get('startDate')
+          ?.setValue(
+            this.eduProcess?.get('startDate')
               ? this.eduProcess?.get('startDate')
-              : '')
-        this.validateForm.get('deadline')?.setValue( this.eduProcess?.get('deadline')
+              : ''
+          );
+        this.validateForm
+          .get('deadline')
+          ?.setValue(
+            this.eduProcess?.get('deadline')
               ? this.eduProcess?.get('deadline')
-              : '')
+              : ''
+          );
         // this.validateForm = this.fb.group({
         //   name: [this.eduProcess?.get('name') || '', [Validators.required]],
         //   desc: [this.eduProcess?.get('desc') || '',[Validators.maxLength(100)]],
@@ -126,6 +145,7 @@ export class ProcessCreateComponent implements OnInit {
       }
       this.profileId = this.eduProcess?.get('profileSubmitted')?.id || '';
       this.department = this.eduProcess?.get('department')?.id || '';
+      this.save.emit({ isLoadling: false, save: false });
     });
   }
   async getUnitTypes() {
@@ -134,7 +154,7 @@ export class ProcessCreateComponent implements OnInit {
     query.equalTo('parent', undefined);
     query.notEqualTo('isDeleted', true);
     query.select('name');
-    query.descending('createdAt')
+    query.descending('createdAt');
     let r = await query.find();
     r.forEach((item) => {
       this.unitTypes.push({ id: item.id, name: item.get('name') });
@@ -167,6 +187,7 @@ export class ProcessCreateComponent implements OnInit {
     }
     console.log('submit', this.validateForm.value);
     if (this.validateForm.valid) {
+      this.save.emit({ isLoadling: true, save: false });
       let params = this.validateForm.value;
       this.saveEduCollection(params);
     } else {
@@ -204,7 +225,7 @@ export class ProcessCreateComponent implements OnInit {
     this.eduProcess?.set('name', params.name);
     this.eduProcess?.set('desc', params.desc);
     this.eduProcess?.set('code', params.code);
-    typeof(params.num) == 'number' && this.eduProcess?.set('num', params.num);
+    typeof params.num == 'number' && this.eduProcess?.set('num', params.num);
     this.eduProcess?.set('startDate', params.startDate);
     this.eduProcess?.set('deadline', params.deadline);
     if (!this.eduProcess?.get('profileSubmitted')) {
@@ -219,10 +240,12 @@ export class ProcessCreateComponent implements OnInit {
     this.eduProcess = await this.eduProcess?.save();
     this.msg.success(this.isEdit ? '已保存' : '已创建');
     this.showProfileFrom = false;
-    this.router.navigate([
-      '/nav-admin/manage/process/page',
-      { id: this.eduProcess?.id },
-    ]);
+    !this.isEdit &&
+      this.router.navigate(
+        ['/nav-admin/manage/process/page', { id: this.eduProcess?.id }],
+        { replaceUrl: true }
+      );
+    this.save.emit({ isLoadling: true, save: true });
   }
   //选择部门
   async showModalDepart() {
@@ -251,7 +274,7 @@ export class ProcessCreateComponent implements OnInit {
       query.equalTo('objectId', id);
       query.select('parent', 'name');
       let r = await query.first();
-      if(!r?.get('parent')){
+      if (!r?.get('parent')) {
         arr.push({
           title: r?.get('name'),
           id: r?.id,
@@ -263,11 +286,11 @@ export class ProcessCreateComponent implements OnInit {
   }
   //选择联系人
   onShowCheck() {
-    if(!this.eduProcess?.get('department')?.id){
-      this.msg.error('请先选择申报单位')
-      return
+    if (!this.eduProcess?.get('department')?.id) {
+      this.msg.error('请先选择申报单位');
+      return;
     }
-    if(this.profileId)return
+    if (this.profileId) return;
     this.showProfileFrom = true;
   }
   //获取联系人
@@ -316,13 +339,13 @@ export class ProcessCreateComponent implements OnInit {
         : null
     );
     await this.eduProcess?.save();
-    if(this.profileId){
-      this.msg.success('成功设置联系人')
-    }else{
-      this.msg.success('已删除联系人,请重新选择')
+    if (this.profileId) {
+      this.msg.success('成功设置联系人');
+    } else {
+      this.msg.success('已删除联系人,请重新选择');
     }
     this.ngOnInit();
-    this.showProfileFrom = false
+    this.showProfileFrom = false;
   }
   onCheck(e: any) {
     console.log(e);
@@ -350,7 +373,7 @@ export class ProcessCreateComponent implements OnInit {
       });
     await this.eduProcess?.save();
     this.ngOnInit();
-    this.msg.success('申报单位设置成功')
+    this.msg.success('申报单位设置成功');
     this.isVisible = false;
   }
 }

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

@@ -233,8 +233,8 @@ export class UserEditComponent implements OnInit {
       return;
     }
     this.password = this.password?.trim();
-    if (!this.password) {
-      this.message.warning('密码格式错误');
+    if(!(this.password.length >= 6 && this.password.length <= 18)){
+      this.message.error('密码格式错误,请填写6-18位非空字符串(数字、大小写字母或英文符号)');
       return;
     }
     try {

+ 1 - 1
projects/textbook/src/modules/nav-author/apply/apply.component.html

@@ -19,7 +19,7 @@
 </div>
 
 <div class="content">
-  <div class="state-title">{{ stateMap }}</div>
+  <div class="state-title">{{ stateMap }} @if (state == 2) {<span style="color: red">*</span>}</div>
   @if (showFrom) {
   <div class="submit-block" #submitComp>
     @switch (state) { @case (0) {

+ 12 - 2
projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.html

@@ -140,7 +140,7 @@
         >教材获批截图</nz-form-label
       >
       <nz-form-control nzErrorTip="请上传教材获批截图" [nzSm]="12" [nzXs]="12">
-        @if (validateForm.value.approvedImgUrl) {
+        <!-- @if (validateForm.value.approvedImgUrl) {
         <a
           style="color: #3e49b3; font-size: 14px"
           (click)="openFile(validateForm.value.approvedImgUrl)"
@@ -148,9 +148,19 @@
           <span nz-icon nzType="file" nzTheme="outline"></span>
           教材获批截图
         </a>
-        }
+        } -->
         <nz-input-group>
           <app-comp-upload
+            [files]="
+              validateForm.value.approvedImgUrl
+                ? [
+                    {
+                      url: validateForm.value.approvedImgUrl,
+                      name: '教材获批截图'
+                    }
+                  ]
+                : []
+            "
             [type]="'pdf'"
             (change)="upload($event, 'approvedImgUrl')"
             title="上传教材获批截图"

+ 11 - 45
projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.ts

@@ -214,8 +214,8 @@ export class BasicInComponent implements OnInit {
       console.log(eduTextbookVolumes.list);
       this.eduTextbook?.set('childrens', eduTextbookVolumes.list);
       this.eduTextbook?.set('typeNumber', eduTextbookVolumes.list.length);
-      
-      isComplete = isComplete && eduTextbookVolumes?.isVrifly;
+      let pass = params.approvedImgUrl || params.approval == '否'
+      isComplete = isComplete && eduTextbookVolumes?.isVrifly && pass
       //如果填写未完整,仅保存,状态修改待完善101
       if (this.eduTextbook.get('status') == '102' && !isComplete) {
         this.eduTextbook?.set('status', '101');
@@ -292,13 +292,13 @@ export class BasicInComponent implements OnInit {
   getCode(e: any) {}
 
   /***教材获批截图 */
-  approvedImgList: Array<any> = [
-    {
-      name: '获批截图',
-      status: 'done',
-      url: '',
-    },
-  ];
+  // approvedImgList: Array<any> = [
+  //   {
+  //     name: '获批截图',
+  //     status: 'done',
+  //     url: '',
+  //   },
+  // ];
   /**
    * 书号自动补全函数
    * @param isbn 书号
@@ -343,8 +343,8 @@ export class BasicInComponent implements OnInit {
   //   //   // }
   //   //   this.eduTextbookVolumeList=new Array(this.typeNumber-1).fill(false)
   //   //   console.log(this.eduTextbookVolumeList)
-
   // }
+  
   validateForm: FormGroup<{
     title: FormControl<string>; //申报教材名称
     majorPoniter: FormControl<string>; //教材应用对象及所诉学科专业类
@@ -352,23 +352,6 @@ export class BasicInComponent implements OnInit {
     approval: FormControl<string>; //是否为重点立项教材
     type: FormControl<string>; //申报类型
     approvedImgUrl: FormControl<string>; //重点立项教材获批截图
-
-    // ISBN: FormControl<any>; //国际标准书号
-    // author: FormControl<string>; //第一主编(作者)
-    // unit: FormControl<string>; //第一主编(作者)单位
-    // unitType: FormControl<string>//第一主编(作者)单位类型
-    // lang: FormControl<string>; //教材主要语种类型
-    // authors: FormControl<string>; //其他主编姓名
-    // editor: FormControl<string>; //其他编者姓名
-    // editionUnit: FormControl<string>; //出版单位
-    // editionFirst: FormControl<Date>; //初版时间
-    // carrierShape: FormControl<string>; //载体形式
-    // editionDate: FormControl<Date>; //出版时间
-    // editionNumber: FormControl<number>; //出版版次
-    // printDate: FormControl<Date>; //最新印次时间
-    // printNumber: FormControl<number>; //最新印次
-    // printSum: FormControl<number>; //初版以来合计印数
-    // importantProjectOther: FormControl<string>; //其他省部级及以上项目
   }> = this.fb.group({
     title: ['', [Validators.required]],
     majorPoniter: ['', [Validators.required]],
@@ -376,23 +359,6 @@ export class BasicInComponent implements OnInit {
     approval: ['', [Validators.required]],
     type: ['', [Validators.required]],
     approvedImgUrl: [''],
-
-    // ISBN: [null, [Validators.required]],
-    // author: ['', [Validators.required]],
-    // unit: ['', [Validators.required]],
-    // lang: ['', [Validators.required]],
-    // authors: [''],
-    // editor: [''],
-    // editionUnit: ['', [Validators.required]],
-    // editionFirst: [new Date(), [Validators.required]],
-    // carrierShape: ['', [Validators.required]],
-    // editionDate: [new Date(), [Validators.required]],
-    // editionNumber: [0, [Validators.required]],
-    // printDate: [new Date(), [Validators.required]],
-    // printNumber: [0, [Validators.required]],
-    // printSum: [0, [Validators.required]],
-    // importantProjectOther: [''],
-    // unitType: ['', [Validators.required]],
   });
   /** 所属学科专业类显示数量*/
   nzOptionOverflowSize = 5;
@@ -523,7 +489,7 @@ export class BasicInComponent implements OnInit {
     //   }
     // }
 
-    this.approvedImgList[0].url = this.eduTextbook?.get('approvedImgUrl');
+    // this.approvedImgList[0].url = this.eduTextbook?.get('approvedImgUrl');
     this.typeNumber = this.eduTextbook?.get('childrens').length || 2;
     if (this.typeNumber > 12) this.typeNumber = 12;
     // console.log(this.approvedImgList)

+ 2 - 1
projects/textbook/src/modules/nav-author/components/create/author-file/author-file.component.ts

@@ -106,9 +106,10 @@ export class AuthorFileComponent implements OnInit {
     // console.log(this.otherEditor);
   }
   async submitForm(): Promise<boolean> {
-    // console.log(this.otherEditor);
+    console.log(this.authorList);
     let coursesVrifly = !this.authorList.some((item:any) =>
       Object.keys(item).some((key) => key != 'otherEditor' && key != 'signature' && (item[key] == '' || item[key] == undefined))
+      || Object.keys(item).findIndex((key) => key == 'examine') == -1
     );
     this.eduTextbookVolume?.set('authorList', this.authorList);
     this.eduTextbookVolume?.set('otherEditor', this.otherEditor||null);

+ 2 - 2
projects/textbook/src/modules/nav-author/components/textbook-content/textbook-content.component.html

@@ -41,7 +41,7 @@
     }
 
     <div class="author-content">
-      <div class="nav">申报教材特色及创新</div>
+      <div class="nav">申报教材特色及创新<span style="color: red">*</span></div>
       <nz-form-item class="row" style="margin-bottom: 16px">
         <nz-form-control
           class="val"
@@ -62,7 +62,7 @@
       </nz-form-item>
     </div>
     <div class="author-content">
-      <div class="nav">申报教材应用情况及社会影响力</div>
+      <div class="nav">申报教材应用情况及社会影响力<span style="color: red">*</span></div>
       <nz-form-item class="row" style="margin-bottom: 16px">
         <nz-form-control
           class="val"

+ 1 - 1
projects/textbook/src/modules/nav-province-contact/activity/activity.component.ts

@@ -147,7 +147,7 @@ export class ActivityComponent implements OnInit {
 
   }
   /**计算方式 mean:平均数 truncatedMean:截尾平均数 */
-  calculation: 'truncatedMean' | 'mean' = 'mean'
+  calculation: 'truncatedMean' | 'mean' = 'truncatedMean'
   async changeCalculation() {
     console.log(this.calculation)
     this.msg.warning('计算方式已调整,请返回评审活动重新计算平均分')

+ 3 - 3
projects/textbook/src/modules/nav-province-contact/activity/review-edit/review-edit.component.html

@@ -78,7 +78,7 @@
         "
         nz-button
         nzType="primary"
-        (click)="reset()"
+        (click)="reset('text')"
       >
         重置
       </button>
@@ -144,7 +144,7 @@
         <div class="select">
           <div class="tool">
             <div class="">已选:{{ checkProfileListLeng }}</div>
-            <div class="clrea">清除</div>
+            <div class="clrea" (click)="clrea()">清除</div>
           </div>
           @if (checkProfileListLeng > 0) { @for (item of profilList; track
           $index) { @if ( setOfCheckedProfileAll.has(item.id) ) {
@@ -192,7 +192,7 @@
         "
         nz-button
         nzType="primary"
-        (click)="reset()"
+        (click)="reset('review')"
       >
         重置
       </button>

+ 79 - 51
projects/textbook/src/modules/nav-province-contact/activity/review-edit/review-edit.component.ts

@@ -11,7 +11,7 @@ import { NzRadioModule } from 'ng-zorro-antd/radio';
 import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
 import { NzModalService } from 'ng-zorro-antd/modal';
 import { NzMessageService } from 'ng-zorro-antd/message';
-import { ReviewDetailsComponent } from '../../components/review-details/review-details.component'
+import { ReviewDetailsComponent } from '../../components/review-details/review-details.component';
 
 @Component({
   selector: 'app-review-edit',
@@ -25,7 +25,7 @@ import { ReviewDetailsComponent } from '../../components/review-details/review-d
     TextbookComponent,
     NzRadioModule,
     NzCheckboxModule,
-    ReviewDetailsComponent
+    ReviewDetailsComponent,
   ],
   standalone: true,
 })
@@ -41,7 +41,7 @@ export class ReviewEditComponent implements OnInit {
   }
   radio: string = 'all';
   radioReview: string = 'all';
-  active:number = 0
+  active: number = 0;
   filterObj: any = {
     showMore: true, //显示更多字段
     isCheck: true,
@@ -49,20 +49,19 @@ export class ReviewEditComponent implements OnInit {
     status: ['200'],
     notContained: [], //排除id
     showText: true,
-    btns: {
-    },
+    btns: {},
   };
   modalValue: string = '';
   profilList: Array<Parse.Object> = [];
   loading = false;
-  showTextbook:boolean = false
+  showTextbook: boolean = false;
 
-  allTextbook:Array<any> = [] //已选择教材列表
-  showAll:boolean = false
+  allTextbook: Array<any> = []; //已选择教材列表
+  showAll: boolean = false;
 
-  reviewFilterObj:any = {
+  reviewFilterObj: any = {
     contained: [],
-  }
+  };
 
   constructor(
     private activeRoute: ActivatedRoute,
@@ -78,7 +77,7 @@ export class ReviewEditComponent implements OnInit {
       this.refresh();
     });
   }
-  async refresh() {
+  async refresh(type?: string) {
     let query = new Parse.Query('ExpertGroup');
     query.include('eduProcess');
     query.equalTo('objectId', this.id);
@@ -88,34 +87,50 @@ export class ReviewEditComponent implements OnInit {
       this.expertGroup = res;
       this.eduProcess = res?.get('eduProcess');
 
-      this.expertGroup.get('textbookList')?.forEach((item: any) => {
-        this.setOfCheckedTextbookAll.add(item.id || item.objectId);
-      });
-      this.expertGroup.get('reviewList')?.forEach((item: any) => {
-        this.setOfCheckedProfileAll.add(item.id || item.objectId);
-      });
-      //赋值给评审详情组建
-      this.reviewFilterObj.contained = Array.from(this.setOfCheckedTextbookAll)
-      await this.getExpertGroup()
-      this.radio = res?.get('checkTextbook') ?? 'all';
-      this.getProfile()
-      this.getTextName()
-      this.radioReview = res?.get('checkReview') ?? 'all';
-      this.showTextbook = true
+      if (type == 'review' || !type) {
+        this.expertGroup.get('reviewList')?.forEach((item: any) => {
+          this.setOfCheckedProfileAll.add(item.id || item.objectId);
+        });
+        this.radioReview = res?.get('checkReview') ?? 'all';
+        this.getProfile();
+      }
+      if (type == 'text' || !type) {
+        this.expertGroup.get('textbookList')?.forEach((item: any) => {
+          this.setOfCheckedTextbookAll.add(item.id || item.objectId);
+        });
+        //赋值给评审详情组建
+        this.reviewFilterObj.contained = Array.from(
+          this.setOfCheckedTextbookAll
+        );
+        await this.getExpertGroup();
+        this.radio = res?.get('checkTextbook') ?? 'all';
+        this.getTextName();
+        this.showTextbook = true;
+      }
     }
   }
   //获取所有已选择教材名称展示
-  async getTextName(){
+  async getTextName() {
     let query = new Parse.Query('EduTextbook');
     query.notEqualTo('isDeleted', true);
     query.containedIn('objectId', Array.from(this.setOfCheckedTextbookAll));
-    query.select('title')
-    let r = await query.find()
-    this.allTextbook = r
+    query.select('title');
+    let r = await query.find();
+    this.allTextbook = r;
   }
   //重置
-  reset() {
-    this.refresh();
+  reset(type: string) {
+    if (type == 'text') {
+      // this.radio = 'all';
+      this.setOfCheckedTextbookAll = new Set();
+    } else if (type == 'review') {
+      // this.radioReview = 'all';
+      this.setOfCheckedProfileAll = new Set();
+    }
+    this.refresh(type);
+  }
+  clrea(){
+    this.setOfCheckedProfileAll = new Set();
   }
   back() {
     history.back();
@@ -129,7 +144,7 @@ export class ReviewEditComponent implements OnInit {
   }
 
   //获取所有已被其他评审组选择过教材
-  async getExpertGroup(){
+  async getExpertGroup() {
     let query = new Parse.Query('ExpertGroup');
     query.include('eduProcess');
     query.notEqualTo('isDeleted', true);
@@ -206,25 +221,28 @@ export class ReviewEditComponent implements OnInit {
       ? this.setOfCheckedProfileAll.delete($event.id)
       : this.setOfCheckedProfileAll.add($event.id);
   }
-  updateCheck(){
+  updateCheck() {
     console.log(this.textbook.setOfCheckedId);
-    this.setOfCheckedTextbookAll = this.textbook.setOfCheckedId
-    this.getTextName()
+    this.setOfCheckedTextbookAll = this.textbook.setOfCheckedId;
+    this.getTextName();
   }
   /* 保存 */
   async onSave(type: string) {
     if (type == 'eduTextbook') {
       let fileds: any = [];
-      if(this.radio == 'all'){
-       let list = await this.textbook.getTextbook('',{excel:true,id:true})
-       list.forEach((item:any) => {
-        fileds.push({
-          __type: 'Pointer',
-          className: 'EduTextbook',
-          objectId: item.id,
+      if (this.radio == 'all') {
+        let list = await this.textbook.getTextbook('', {
+          excel: true,
+          id: true,
+        });
+        list.forEach((item: any) => {
+          fileds.push({
+            __type: 'Pointer',
+            className: 'EduTextbook',
+            objectId: item.id,
+          });
         });
-       });
-      }else{
+      } else {
         Array.from(this.textbook.setOfCheckedId).forEach((item) => {
           fileds.push({
             __type: 'Pointer',
@@ -237,18 +255,28 @@ export class ReviewEditComponent implements OnInit {
       this.expertGroup?.set('checkTextbook', this.radio);
     } else {
       let fileds: any = [];
-      Array.from(this.setOfCheckedProfileAll).forEach((item) => {
-        fileds.push({
-          __type: 'Pointer',
-          className: 'Profile',
-          objectId: item,
+      if (this.radioReview == 'all') {
+        this.profilList.forEach((item: any) => {
+          fileds.push({
+            __type: 'Pointer',
+            className: 'Profile',
+            objectId: item.id,
+          });
         });
-      });
+      } else {
+        Array.from(this.setOfCheckedProfileAll).forEach((item) => {
+          fileds.push({
+            __type: 'Pointer',
+            className: 'Profile',
+            objectId: item,
+          });
+        });
+      }
       this.expertGroup?.set('reviewList', fileds);
       this.expertGroup?.set('checkReview', this.radioReview);
     }
     await this.expertGroup?.save();
-    this.reviewFilterObj.contained = Array.from(this.setOfCheckedTextbookAll)
+    this.reviewFilterObj.contained = Array.from(this.setOfCheckedTextbookAll);
     this.message.success('设置成功');
     // this.refresh()
   }

+ 2 - 2
projects/textbook/src/modules/nav-province-contact/page-process/process-create/process-create.component.html

@@ -60,7 +60,7 @@
         <nz-form-item class="row" style="margin-bottom: 6px">
           <nz-form-label class="label" [nzNoColon]="true" [nzSm]="18" [nzXs]="18" nzRequired>开始时间</nz-form-label>
           <div class="date">
-            {{ eduProcess?.get("startDate") | date : "yyyy-MM-dd HH:MM" }}
+            {{ eduProcess?.get("startDate") | date : "yyyy-MM-dd HH:mm" }}
           </div>
         </nz-form-item>
       </div>
@@ -68,7 +68,7 @@
         <nz-form-item class="row" style="margin-bottom: 6px">
           <nz-form-label class="label" [nzNoColon]="true" [nzSm]="18" [nzXs]="18" nzRequired>结束时间</nz-form-label>
           <div class="date">
-            {{ eduProcess?.get("deadline") | date : "yyyy-MM-dd HH:MM" }}
+            {{ eduProcess?.get("deadline") | date : "yyyy-MM-dd HH:mm" }}
           </div>
         </nz-form-item>
       </div>

+ 3 - 3
projects/textbook/src/modules/nav-province-contact/page-role/page-role.component.html

@@ -342,7 +342,7 @@
               }
             </div>
             } }@else {
-            <nz-empty nzNotFoundContent="暂无下级部门"></nz-empty>
+            <nz-empty nzNotFoundContent="暂无可操作部门"></nz-empty>
             }
           </div>
         </div>
@@ -430,7 +430,7 @@
               }
             </div>
             } }@else {
-            <nz-empty nzNotFoundContent="暂无下级部门"></nz-empty>
+            <nz-empty nzNotFoundContent="暂无可操作部门"></nz-empty>
             }
           </div>
         </div>
@@ -613,7 +613,7 @@
               }
             </div>
             }}@else {
-            <nz-empty nzNotFoundContent="暂无下级部门"></nz-empty>
+            <nz-empty nzNotFoundContent="暂无可操作部门"></nz-empty>
             }
           </div>
         </div>

+ 9 - 4
projects/textbook/src/modules/nav-province-contact/page-role/page-role.component.ts

@@ -208,8 +208,12 @@ export class PageRoleComponent implements OnInit {
     // if (searchValue && searchValue != undefined) {
     //   query.equalTo('parent', this.tbookSer.profile.user.department?.objectId);
     // }
-    query.limit(100);
+    console.log(parent,this.tbookSer.profile.user.department?.parent?.id);
+    if(parent == this.tbookSer.profile.user.department?.parent?.id){
+      query.equalTo('objectId', this.tbookSer.profile.user.department?.id);
+    }
     if (this.activeDepart) query.notEqualTo('objectId', this.activeDepart?.id);
+    query.limit(100);
     let res = await query.find();
     res.forEach((item) => {
       nodes.push({
@@ -445,9 +449,10 @@ export class PageRoleComponent implements OnInit {
       this.parentMap = await this.tbookSer.formatNode(
         this.activeDepart.get('parent')?.id
       );
-      if (this.activatedNode?.parentNode?.origin?.parentNode?.origin.key) {
+      console.log(this.activatedNode);
+      if (this.activatedNode?.parentNode?.origin?.parent) {
         this.parentList = await this.getDepart(
-          this.activatedNode?.parentNode?.origin?.parentNode?.origin.key
+          this.activatedNode?.parentNode?.origin?.parent
         );
       }
       this.radio = this.activeDepart.get('parent')?.id;
@@ -552,7 +557,7 @@ export class PageRoleComponent implements OnInit {
     }
   }
   async handleOk(): Promise<void> {
-    if (!this.editObject?.name || !this.editObject.parent?.id) {
+    if (!this.editObject?.name?.trim() || !this.editObject.parent?.id) {
       this.message.error('请填写完整信息');
       return;
     }

+ 2 - 1
projects/textbook/src/services/compute.ts

@@ -98,5 +98,6 @@ export const accDiv = function accDiv(arg1: number, arg2: number): number {
   } catch (e) {}
   r1 = Number(arg1.toString().replace('.', ''));
   r2 = Number(arg2.toString().replace('.', ''));
-  return (r1 / r2) * Math.pow(10, t2 - t1);
+  let n = (r1 / r2) * Math.pow(10, t2 - t1);
+  return Math.round(n)
 }