cehn 8 meses atrás
pai
commit
4e8094103c

+ 171 - 102
projects/textbook/src/modules/common/textbook-details/textbook-details.component.html

@@ -1,5 +1,9 @@
 <div class="site-page-header">
-  <nz-page-header nzTitle="教材详情 - {{ textBook?.title }}" nzSubtitle="" style="padding: 0">
+  <nz-page-header
+    nzTitle="教材详情 - {{ textBook?.title }}"
+    nzSubtitle=""
+    style="padding: 0"
+  >
     <nz-breadcrumb nz-page-header-breadcrumb>
       <div class="back" (click)="back()">
         <span nz-icon nzType="left" nzTheme="outline"></span>返回
@@ -8,43 +12,55 @@
   </nz-page-header>
 </div>
 
-
-<nz-tabset style="margin:0 20px;">
+@if (this.tbookSer.profile.identity == '工作联系人' ||
+this.tbookSer.profile.user?.department == textBook?.department) {
+<nz-tabset style="margin: 0 20px">
   <nz-tab nzTitle="教材申报书及附件">
     <ng-container *ngTemplateOutlet="one"></ng-container>
   </nz-tab>
   <nz-tab nzTitle="教材评审明细">
-    <nz-table [nzLoading]="groupLogin||reviewLogin" class="reviewTable" #basicTable [nzData]="groupList" [nzScroll]="{ x: '100%' }">
+    <nz-table
+      [nzLoading]="groupLogin || reviewLogin"
+      class="reviewTable"
+      #basicTable
+      [nzData]="groupList"
+      [nzScroll]="{ x: '100%' }"
+    >
       <thead>
         <tr>
-          <th style="width: 130px;" nzLeft>所属评审组</th>
+          <th style="width: 130px" nzLeft>所属评审组</th>
           @for (item of reviewList; track $index) {
-          <th style="width: 100px;">{{item?.get('profile')?.get('user')?.get('name')||'未命名评审专家'}}</th>
+          <th style="width: 100px">
+            {{
+              item?.get("profile")?.get("user")?.get("name") || "未命名评审专家"
+            }}
+          </th>
           }
-          <th style="width: 130px;" nzRight>合计分值</th>
+          <th style="width: 80px" nzRight>合计分值</th>
         </tr>
       </thead>
       <tbody>
         <tr *ngFor="let data of basicTable.data">
-          <td nzLeft>{{data?.get('name')}}</td>
+          <td nzLeft>{{ data?.get("name") }}</td>
           @for (item of reviewList; track $index) {
-            <td>{{item?.get('score')||'-'}}</td>
-            }
-          <td nzRight>{{textBook?.score||'-'}}</td>
+          <td>{{ item?.get("score") || "-" }}</td>
+          }
+          <td nzRight>{{ textBook?.score || "-" }}</td>
         </tr>
       </tbody>
     </nz-table>
   </nz-tab>
 </nz-tabset>
-
-
+} @else {
+<ng-container *ngTemplateOutlet="one"></ng-container>
+}
 
 <ng-template #one>
   <div class="content">
     <div nz-row>
       <div nz-col nzSpan="18">
-        <div id="anchor1" class="occupy" style="height: 100px;"></div>
-        <div class="templ1" #templ1 style="width: 500px; ">
+        <div id="anchor1" class="occupy" style="height: 100px"></div>
+        <div class="templ1" #templ1 style="width: 500px">
           <div class="title">教材基本信息</div>
           <div class="base-content">
             <div class="row">
@@ -53,11 +69,16 @@
             </div>
             <div class="row">
               <div class="label">教材应用对象及所属学科专业类</div>
-              <div class="value">{{ textBook?.majorPoniter?.code }}-{{ textBook?.majorPoniter?.name }}</div>
+              <div class="value">
+                {{ textBook?.majorPoniter?.code }}-{{
+                  textBook?.majorPoniter?.name
+                }}
+              </div>
             </div>
             <div class="row">
               <div class="label">是否为重点立项教材</div>
-              <div class="value">{{ textBook?.approval }}
+              <div class="value">
+                {{ textBook?.approval }}
                 @if (textBook?.approval&&textBook?.approval!='否') {
                 <a (click)="openFile(textBook?.approvedImgUrl)">
                   <span nz-icon nzType="file" nzTheme="outline"></span>
@@ -70,13 +91,18 @@
               <div class="label">申报类型</div>
               <div class="value">
                 {{ textBook?.type }}
-                {{ textBook?.type == "全册" ? textBook?.typeNumber + "册" : "" }}
+                {{
+                  textBook?.type == "全册" ? textBook?.typeNumber + "册" : ""
+                }}
               </div>
             </div>
 
             <nz-collapse>
               @for (volume of eduTextbookVolumeList; track $index) {
-              <nz-collapse-panel [nzHeader]="$index+1+'册'" [nzActive]="'true'">
+              <nz-collapse-panel
+                [nzHeader]="$index + 1 + '册'"
+                [nzActive]="'true'"
+              >
                 <div class="row">
                   <div class="label">第一主编(作者)</div>
                   <div class="value">{{ volume?.author }}</div>
@@ -86,7 +112,6 @@
                   <div class="value">{{ volume?.unit }}</div>
                 </div>
 
-
                 <div class="row">
                   <div class="label">教材主要语种类型</div>
                   <div class="value">{{ volume?.lang }}</div>
@@ -97,11 +122,11 @@
                 </div>
                 <div class="row">
                   <div class="label">其他主编姓名</div>
-                  <div class="value">{{ volume?.authors || '-'}}</div>
+                  <div class="value">{{ volume?.authors || "-" }}</div>
                 </div>
                 <div class="row">
                   <div class="label">其他编者姓名</div>
-                  <div class="value">{{ volume?.editor || '-'}}</div>
+                  <div class="value">{{ volume?.editor || "-" }}</div>
                 </div>
 
                 <div class="row">
@@ -122,7 +147,7 @@
                   <div class="label">本版出版时间及版次</div>
                   <div class="value">
                     {{ volume?.editionDate?.iso | date : "yyyy-MM" }}/{{
-                    volume?.editionNumber
+                      volume?.editionNumber
                     }}
                   </div>
                 </div>
@@ -130,7 +155,7 @@
                   <div class="label">最新印次时间及印次</div>
                   <div class="value">
                     {{ volume?.printDate?.iso | date : "yyyy-MM-dd" }}/{{
-                    volume?.printNumber
+                      volume?.printNumber
                     }}
                   </div>
                 </div>
@@ -142,7 +167,14 @@
                   <div class="label">初版以来是否曾列为重点项目</div>
                   <div class="value">
                     @for (item of volume?.importantProject; track $index) {
-                    <p>{{item}} {{item=='其他省部级及以上项目'?'-'+volume?.importantProjectOther:''}}</p>
+                    <p>
+                      {{ item }}
+                      {{
+                        item == "其他省部级及以上项目"
+                          ? "-" + volume?.importantProjectOther
+                          : ""
+                      }}
+                    </p>
                     }
                   </div>
                 </div>
@@ -150,7 +182,6 @@
               }
             </nz-collapse>
 
-
             <!-- <div class="row">
               <div class="label">版权页截图</div>
               <div class="value">
@@ -165,7 +196,7 @@
             </div> -->
           </div>
         </div>
-        <div id="anchor2" class="occupy" style="height: 60px;"></div>
+        <div id="anchor2" class="occupy" style="height: 60px"></div>
         <div class="templ">
           <div class="title">教材适用情况</div>
           <div class="base-content">
@@ -194,23 +225,30 @@
             </div>
           </div>
         </div>
-        <div id="anchor3" class="occupy" style="height: 60px;"></div>
+        <div id="anchor3" class="occupy" style="height: 60px"></div>
         <div class="templ">
-          <div id="anchor3_1" class="occupy" style="height: 60px;"></div>
+          <div id="anchor3_1" class="occupy" style="height: 60px"></div>
           <div class="title">作者信息</div>
 
-
           <nz-collapse>
             @for (volume of eduTextbookVolumeList; track $index) {
-            <nz-collapse-panel [nzHeader]="$index+1+'册'" [nzActive]="'true'">
+            <nz-collapse-panel
+              [nzHeader]="$index + 1 + '册'"
+              [nzActive]="'true'"
+            >
               <div class="text mar10">
                 作者(含主编,不超过 6 人,教材中明确出现姓名)
               </div>
               <div class="base-content">
-                <nz-table #basicTable [nzShowPagination]="false" [nzData]="volume?.authorList" [nzScroll]="{
+                <nz-table
+                  #basicTable
+                  [nzShowPagination]="false"
+                  [nzData]="volume?.authorList"
+                  [nzScroll]="{
                     x: (templ1.style.width || '1000') + 'px',
                     y: '240px'
-                  }">
+                  }"
+                >
                   <thead>
                     <tr>
                       <th nzEllipsis nzWidth="120px" nzLeft>姓名</th>
@@ -227,8 +265,8 @@
                     </tr>
                   </thead>
                   <tbody>
-                    @for (data of volume?.authorList; track data.mobile;let index =
-                    $index) {
+                    @for (data of volume?.authorList; track data.mobile;let
+                    index = $index) {
                     <tr>
                       <td nzEllipsis nzLeft>
                         {{ data.name }}
@@ -263,18 +301,26 @@
                 </nz-table>
               </div>
 
-              <div id="anchor3_2" class="occupy" style="height: 60px;"></div>
+              <div id="anchor3_2" class="occupy" style="height: 60px"></div>
               <div class="text mar10">第一主编(作者)情况</div>
               <div class="base-content">
                 <div class="text-tips">1.相关教学经历</div>
                 <div class="note">
                   {{ volume?.authorDetails }}
                 </div>
-                <div class="text-tips">2.相关科学研究项目、成果或论文专著(限5项)</div>
-                <nz-table #basicTable [nzShowPagination]="false" [nzData]="volume?.achievementOptions" [nzScroll]="{
+                <div class="text-tips">
+                  2.相关科学研究项目、成果或论文专著(限5项)
+                </div>
+                <nz-table
+                  #basicTable
+                  [nzShowPagination]="false"
+                  [nzData]="volume?.achievementOptions"
+                  [nzScroll]="{
                     x: (templ1.style.width || '1000') + 'px',
                     y: '240px'
-                  }" nzTableLayout="fixed">
+                  }"
+                  nzTableLayout="fixed"
+                >
                   <thead>
                     <tr>
                       <th nzWidth="80px" nzLeft nzAlign="right">序号</th>
@@ -284,8 +330,8 @@
                     </tr>
                   </thead>
                   <tbody>
-                    @for (data of volume?.achievementOptions; track data.name;let
-                    index = $index) {
+                    @for (data of volume?.achievementOptions; track
+                    data.name;let index = $index) {
                     <tr>
                       <td nzEllipsis nzLeft nzAlign="right">{{ index + 1 }}</td>
                       <td nzEllipsis>
@@ -302,27 +348,30 @@
                   </tbody>
                 </nz-table>
               </div>
-
             </nz-collapse-panel>
             }
           </nz-collapse>
-
-
         </div>
-        <div id="anchor4" class="occupy" style="height: 60px;"></div>
+        <div id="anchor4" class="occupy" style="height: 60px"></div>
         <div class="templ">
           <div class="title">申报教材建设历程</div>
 
           <div class="base-content">
-
             <nz-collapse>
               @for (volume of eduTextbookVolumeList; track $index) {
-              <nz-collapse-panel [nzHeader]="$index+1+'册'" [nzActive]="'true'">
-
-                <nz-table #basicTable [nzShowPagination]="false" [nzData]="volume?.courses" [nzScroll]="{
-                  x: (templ1.style.width || '1000') + 'px',
-                  y: '240px'
-                }">
+              <nz-collapse-panel
+                [nzHeader]="$index + 1 + '册'"
+                [nzActive]="'true'"
+              >
+                <nz-table
+                  #basicTable
+                  [nzShowPagination]="false"
+                  [nzData]="volume?.courses"
+                  [nzScroll]="{
+                    x: (templ1.style.width || '1000') + 'px',
+                    y: '240px'
+                  }"
+                >
                   <thead>
                     <tr>
                       <th nzWidth="80px" nzLeft nzAlign="right">版次</th>
@@ -334,7 +383,8 @@
                     </tr>
                   </thead>
                   <tbody>
-                    @for (data of volume?.courses; track data;let index = $index) {
+                    @for (data of volume?.courses; track data;let index =
+                    $index) {
                     <tr>
                       <td nzEllipsis nzLeft nzAlign="right">{{ index + 1 }}</td>
                       <td nzEllipsis>
@@ -359,13 +409,14 @@
               </nz-collapse-panel>
               }
             </nz-collapse>
-
-
-
-
           </div>
         </div>
-        <div id="anchor4" id="anchor5" class="occupy" style="height: 60px;"></div>
+        <div
+          id="anchor4"
+          id="anchor5"
+          class="occupy"
+          style="height: 60px"
+        ></div>
         <div class="templ">
           <div class="title">申报教材特色及创新</div>
           <div class="base-content">
@@ -374,7 +425,12 @@
             </div>
           </div>
         </div>
-        <div id="anchor4" id="anchor6" class="occupy" style="height: 60px;"></div>
+        <div
+          id="anchor4"
+          id="anchor6"
+          class="occupy"
+          style="height: 60px"
+        ></div>
         <div class="templ">
           <div class="title">申报教材应用情况及社会影响力</div>
           <div class="base-content">
@@ -383,13 +439,18 @@
             </div>
           </div>
         </div>
-        <div id="anchor4" id="anchor9" class="occupy" style="height: 60px;"></div>
+        <div
+          id="anchor4"
+          id="anchor9"
+          class="occupy"
+          style="height: 60px"
+        ></div>
         <div class="templ">
           <div class="title">申报单位承诺意见</div>
           <div class="base-content">
             <div class="text-tips">1.教材作者诚信承诺</div>
             <div class="note">
-              {{textBook?.accept}}
+              {{ textBook?.accept }}
             </div>
             <!-- <div class="text-tips">2.申报单位承诺意见</div>
             <div class="note">
@@ -397,21 +458,31 @@
             </div> -->
           </div>
         </div>
-        <div id="anchor4" id="anchor7" class="occupy" style="height: 60px;"></div>
+        <div
+          id="anchor4"
+          id="anchor7"
+          class="occupy"
+          style="height: 60px"
+        ></div>
         <div class="templ">
           <div class="title">附件材料</div>
           <div class="base-content">
-
-
             <nz-collapse>
               @for (volume of eduTextbookVolumeList; track $index) {
-              <nz-collapse-panel [nzHeader]="$index+1+'册'" [nzActive]="'true'">
-
-                <nz-table style="margin-bottom: 20px;" #basicTable [nzShowPagination]="false"
-                  [nzData]="volume?.authorList" [nzScroll]="{
-                x: (templ1.style.width || '1000') + 'px',
-                y: '240px'
-              }">
+              <nz-collapse-panel
+                [nzHeader]="$index + 1 + '册'"
+                [nzActive]="'true'"
+              >
+                <nz-table
+                  style="margin-bottom: 20px"
+                  #basicTable
+                  [nzShowPagination]="false"
+                  [nzData]="volume?.authorList"
+                  [nzScroll]="{
+                    x: (templ1.style.width || '1000') + 'px',
+                    y: '240px'
+                  }"
+                >
                   <thead>
                     <tr>
                       <th nzEllipsis nzWidth="120px" nzLeft>姓名</th>
@@ -428,8 +499,8 @@
                     </tr>
                   </thead>
                   <tbody>
-                    @for (data of volume?.authorList; track data.mobile;let index =
-                    $index) {
+                    @for (data of volume?.authorList; track data.mobile;let
+                    index = $index) {
                     <tr>
                       <td nzEllipsis nzLeft>
                         {{ data.name }}
@@ -464,7 +535,6 @@
                       <!-- <td nzEllipsis>
                     <a (click)="openFile(data?.signature)">签名文件</a>
                   </td> -->
-
                     </tr>
                     }
                   </tbody>
@@ -473,15 +543,12 @@
               }
             </nz-collapse>
 
-
-
-
             <div class="row" style="margin-top: 10px">
               <div class="label">图书编校质量自查结果记录表</div>
               <div class="value">
                 <a (click)="openFile(textBook?.selfResults?.url)">{{
                   textBook?.selfResults?.name
-                  }}</a>
+                }}</a>
               </div>
             </div>
             <div class="row">
@@ -489,7 +556,7 @@
               <div class="value">
                 <a (click)="openFile(textBook?.expertOpinion?.url)">{{
                   textBook?.expertOpinion?.name
-                  }}</a>
+                }}</a>
               </div>
             </div>
             <div class="row">
@@ -497,7 +564,7 @@
               <div class="value">
                 <a (click)="openFile(textBook?.evidence?.url)">{{
                   textBook?.evidence?.name
-                  }}</a>
+                }}</a>
               </div>
             </div>
             <div class="row">
@@ -513,26 +580,25 @@
               </div>
             </div>
             <div class="row">
-              <div class="label"> CIP 相关证明截图</div>
+              <div class="label">CIP 相关证明截图</div>
               <div class="value">
                 @for (item of textBook?.cipProveFile; track item.name) {
                 <a (click)="openFile(item.url)" style="margin-right: 10px">{{
                   item.name
-                  }}</a>
-                <br>
+                }}</a>
+                <br />
                 }
               </div>
             </div>
 
-
             <div class="row">
               <div class="label">其他材料</div>
               <div class="value">
                 @for (item of textBook?.moreMaterial; track item.name) {
                 <a (click)="openFile(item.url)" style="margin-right: 10px">{{
                   item.name
-                  }}</a>
-                <br>
+                }}</a>
+                <br />
                 }
               </div>
             </div>
@@ -609,38 +675,41 @@
       </div>
 
       <div nz-col nzSpan="6">
-
         <div style="position: fixed">
           <ul class="herf">
             <li class="lv1" (click)="herfLink('anchor1')">教材基本信息</li>
             <li class="lv1" (click)="herfLink('anchor2')">教材适用情况</li>
-            <li class="lv1" (click)="herfLink('anchor3')">
-              作者信息
-            </li>
+            <li class="lv1" (click)="herfLink('anchor3')">作者信息</li>
             <li class="lv2" (click)="herfLink('anchor3_1')">作者</li>
-            <li class="lv2" (click)="herfLink('anchor3_2')">第一主编(作者)情况</li>
+            <li class="lv2" (click)="herfLink('anchor3_2')">
+              第一主编(作者)情况
+            </li>
             <li class="lv1" (click)="herfLink('anchor4')">申报教材建设历程</li>
-            <li class="lv1" (click)="herfLink('anchor5')">申报教材特色及创新</li>
-            <li class="lv1" (click)="herfLink('anchor6')">申报教材应用情况及社会影响力</li>
+            <li class="lv1" (click)="herfLink('anchor5')">
+              申报教材特色及创新
+            </li>
+            <li class="lv1" (click)="herfLink('anchor6')">
+              申报教材应用情况及社会影响力
+            </li>
             <li class="lv1" (click)="herfLink('anchor9')">申报单位承诺意见</li>
             <li class="lv1" (click)="herfLink('anchor7')">附件材料清单</li>
           </ul>
         </div>
-
       </div>
     </div>
   </div>
-
 </ng-template>
 
-
-
-
-@if (user?.id == textBook?.user?.objectId && !textBook?.discard && !textBook?.render)
-{
+@if (user?.id == textBook?.user?.objectId && !textBook?.discard &&
+!textBook?.render) {
 <div class="footer">
-  <button nz-button nzType="primary" style="background: #3e49b3; border: 1px #3e49b3" (click)="edit()">
+  <button
+    nz-button
+    nzType="primary"
+    style="background: #3e49b3; border: 1px #3e49b3"
+    (click)="edit()"
+  >
     编辑教材
   </button>
 </div>
-}
+}

+ 64 - 65
projects/textbook/src/modules/common/textbook-details/textbook-details.component.ts

@@ -1,8 +1,4 @@
-import {
-  Component,
-  OnInit,
-  ViewChild,
-} from '@angular/core';
+import { Component, OnInit, ViewChild } from '@angular/core';
 import { CommonCompModule } from '../../../services/common.modules';
 import { Router, ActivatedRoute } from '@angular/router';
 import { ReactiveFormsModule } from '@angular/forms';
@@ -14,6 +10,7 @@ import { BrowserModule } from '@angular/platform-browser';
 import { CommonModule } from '@angular/common';
 import { NzTabsModule } from 'ng-zorro-antd/tabs';
 import { NzTableModule } from 'ng-zorro-antd/table';
+import { textbookServer } from '../../../services/textbook';
 
 @Component({
   selector: 'app-textbook-details',
@@ -22,8 +19,10 @@ import { NzTableModule } from 'ng-zorro-antd/table';
     ReactiveFormsModule,
     NzAnchorModule,
     DatePipe,
-    NzCollapseModule,CommonModule,
-    NzTabsModule,NzTableModule
+    NzCollapseModule,
+    CommonModule,
+    NzTabsModule,
+    NzTableModule,
   ],
   standalone: true,
   templateUrl: './textbook-details.component.html',
@@ -32,38 +31,38 @@ import { NzTableModule } from 'ng-zorro-antd/table';
 })
 export class TextbookDetailsComponent implements OnInit {
   @ViewChild('templ1') templ1: any;
-  user?:Parse.Object
-  textBook: object | any = {}
+  user?: Parse.Object;
+  textBook: object | any = {};
 
+  /**扩展表记录 */
+  eduTextbookVolumeList: Array<any> = [];
 
+  /** 册数*/
+  typeNumber: any;
+  /** 申报类型*/
+  type: any;
 
-/**扩展表记录 */
-eduTextbookVolumeList: Array<any> = []
-
-/** 册数*/
-typeNumber:any
-/** 申报类型*/
-type:any
-
-
-
-  constructor(private router: Router, private activeRoute: ActivatedRoute) {}
+  constructor(
+    public tbookSer: textbookServer,
+    private router: Router,
+    private activeRoute: ActivatedRoute
+  ) {}
 
   ngOnInit() {
     this.activeRoute.paramMap.subscribe(async (params) => {
-      this.user = Parse.User.current()
+      this.user = Parse.User.current();
       let id = params.get('id');
-      console.log(id)
+      console.log(id);
       if (id) {
         let query = new Parse.Query('EduTextbook');
         query.equalTo('objectId', id);
-        query.include('childrens')
+        query.include('childrens');
         let r = await query.first();
-        this.textBook = r?.toJSON()
+        this.textBook = r?.toJSON();
         console.log(this.textBook);
-        this.eduTextbookVolumeList = this.textBook?.childrens
-        this.getExpertGroup()
-        this.getEduReview()
+        this.eduTextbookVolumeList = this.textBook?.childrens;
+        this.getExpertGroup();
+        this.getEduReview();
       }
     });
   }
@@ -74,50 +73,50 @@ type:any
   back() {
     history.back();
   }
-  edit(){
-    this.router?.navigate(['/nav-author/manage/apply',{id:this.textBook.objectId}],{ replaceUrl: true })
+  edit() {
+    this.router?.navigate(
+      ['/nav-author/manage/apply', { id: this.textBook.objectId }],
+      { replaceUrl: true }
+    );
   }
-  openFile(url:string){
+  openFile(url: string) {
     console.log(url);
-    window.open(url)
+    window.open(url);
   }
   /**锚点 */
-  herfLink(domId:string){
-    console.log(domId)
-    let topEle = document.getElementById(domId)
-    if(topEle){
+  herfLink(domId: string) {
+    console.log(domId);
+    let topEle = document.getElementById(domId);
+    if (topEle) {
       topEle.scrollIntoView({ behavior: 'smooth' });
     }
   }
 
-
-
-
-groupLogin:boolean=true
-reviewLogin:boolean=true
-  groupList:Array<Parse.Object> = []
-/**获取本教材评审组 */
-async getExpertGroup(){
-  let groupQuery = new Parse.Query('ExpertGroup')
-  groupQuery.notEqualTo('isDeleted',true)
-
-  let bookQuery = new Parse.Query('EduTextbook')
-  bookQuery.equalTo('objectId',this.textBook?.objectId)
-
-  groupQuery.matchesQuery('textbookList',bookQuery)
-  this.groupList = await groupQuery.find()
-  console.log(this.groupList)
-  this.groupLogin=false
-}
-reviewList:Array<Parse.Object>=[]
-/**获取本教程评分 */
-async getEduReview(){
-  let query = new Parse.Query('EduReview')
-  query.notEqualTo('isDeleted',true)
-  query.equalTo('eduTextbook',this.textBook?.objectId)
-  query.include('profile','profile.user')
-  this.reviewList = await query.find()
-  console.log(this.reviewList)
-  this.reviewLogin=false
-}
+  groupLogin: boolean = true;
+  reviewLogin: boolean = true;
+  groupList: Array<Parse.Object> = [];
+  /**获取本教材评审组 */
+  async getExpertGroup() {
+    let groupQuery = new Parse.Query('ExpertGroup');
+    groupQuery.notEqualTo('isDeleted', true);
+
+    let bookQuery = new Parse.Query('EduTextbook');
+    bookQuery.equalTo('objectId', this.textBook?.objectId);
+
+    groupQuery.matchesQuery('textbookList', bookQuery);
+    this.groupList = await groupQuery.find();
+    console.log(this.groupList);
+    this.groupLogin = false;
+  }
+  reviewList: Array<Parse.Object> = [];
+  /**获取本教程评分 */
+  async getEduReview() {
+    let query = new Parse.Query('EduReview');
+    query.notEqualTo('isDeleted', true);
+    query.equalTo('eduTextbook', this.textBook?.objectId);
+    query.include('profile', 'profile.user');
+    this.reviewList = await query.find();
+    console.log(this.reviewList);
+    this.reviewLogin = false;
+  }
 }

+ 0 - 1
projects/textbook/src/modules/nav-province-school-contact/page-textbook/page-textbook.component.html

@@ -39,7 +39,6 @@
       @if (active == 2 && eduProcess) {
         <app-textbook
         [filterObj]="afterFilterObj"
-        [recommend]="true"
         [eduProcess]="eduProcess"
         ></app-textbook>
       }

+ 1 - 0
projects/textbook/src/modules/nav-province-school-contact/page-textbook/page-textbook.component.ts

@@ -65,6 +65,7 @@ export class PageTextbookComponent implements OnInit {
     isCheck: true,
     status: ['200'],
     team:true,
+    noStared: true,
     btns: {
       export:true,
       review:true,//查阅

+ 9 - 6
projects/textbook/src/modules/nav-review/approve/approve.component.html

@@ -1,12 +1,15 @@
 <nz-page-header>
   <!--title-->
   <nz-page-header-title
-    >{{activity?.get('name') || '暂无评审活动'}} @if(eduProcess?.get('status') == '200'){
+    >{{ activity?.get("name") || "暂无评审活动" }}
+    @if (activity?.id || !isStart) { @if (authCompute && eduProcess?.get('status') ==
+    '201'){
     <nz-tag style="margin-left: 10px" [nzColor]="'blue'"> 评审中</nz-tag>
-    } @else if (eduProcess?.get('status') != '200') {
+    }@else if (isEnd) {
     <nz-tag style="margin-left: 10px" nzColor="default"> 已结束</nz-tag>
+    } }@else {
+    <nz-tag style="margin-left: 10px" nzColor="default"> 未开启</nz-tag>
     }
-
     <br />
     <div class="subtitle">查看全部申报流程所提交的教材推荐表</div>
   </nz-page-header-title>
@@ -49,9 +52,9 @@
   <ng-container *nzModalContent>
     <div nz-row class="modal">
       @if (srcUrl) {
-        <div class="proview-pdf">
-          <iframe [src]="srcUrl" frameborder="0"></iframe>
-        </div>
+      <div class="proview-pdf">
+        <iframe [src]="srcUrl" frameborder="0"></iframe>
+      </div>
       }
       <div class="modal-title">分值</div>
       <nz-input-group style="width: 100%" nzSuffix="/100">

+ 45 - 16
projects/textbook/src/modules/nav-review/approve/approve.component.ts

@@ -14,7 +14,7 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs';
 import { NzMessageService } from 'ng-zorro-antd/message';
 import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
 import { NzModalService } from 'ng-zorro-antd/modal';
-import { DomSanitizer} from '@angular/platform-browser';
+import { DomSanitizer } from '@angular/platform-browser';
 @Component({
   selector: 'app-approve',
   imports: [
@@ -36,7 +36,7 @@ import { DomSanitizer} from '@angular/platform-browser';
 export class ApproveComponent implements OnInit {
   // @ViewChild(CompTableListComponent) list: CompTableListComponent | undefined;
   @ViewChild('textbook') textbook: TextbookComponent | any;
-  eduProcess?:Parse.Object
+  eduProcess?: Parse.Object;
 
   active: number = 0;
   user: Parse.User | undefined;
@@ -70,7 +70,26 @@ export class ApproveComponent implements OnInit {
   eduReview?: Parse.Object; //评审记录
   score?: number; //填写评分
   scoreMap: any = {};
-  activity?: Parse.Object
+  activity?: Parse.Object;
+  get authCompute(): boolean {
+    return (
+      this.activity?.get('startDate') < new Date() &&
+      (!this.activity?.get('deadline') ||
+        this.activity?.get('deadline') > new Date())
+    );
+  }
+  get isStart(): boolean {
+    return (
+      !this.activity?.get('startDate') ||
+      this.activity?.get('startDate') > new Date()
+    );
+  }
+  get isEnd(): boolean {
+    return (
+      this.eduProcess?.get('status') != '201' ||
+      this.activity?.get('deadline') < new Date()
+    );
+  }
 
   constructor(
     private message: NzMessageService,
@@ -84,7 +103,7 @@ export class ApproveComponent implements OnInit {
   async ngOnInit() {
     await this.getEduReview();
     await this.getExpertGroup();
-    this.getActivity()
+    this.getActivity();
   }
   //获取评审记录
   async getEduReview() {
@@ -116,8 +135,8 @@ export class ApproveComponent implements OnInit {
         objectId: this.tbookSer.profile?.objectId,
       },
     ]);
-    query.include('eduProcess')
-    query.select('textbookList', 'reviewDetails','eduProcess');
+    query.include('eduProcess');
+    query.select('textbookList', 'reviewDetails', 'eduProcess');
     let r = await query.find();
     console.log(r);
     r.forEach((item) => {
@@ -127,15 +146,17 @@ export class ApproveComponent implements OnInit {
     });
     this.beforeFilterObj.contained;
     this.showText = true;
-    this.eduProcess = r[0]?.get('eduProcess')
+    this.eduProcess = r[0]?.get('eduProcess');
   }
-  srcUrl:any
-  async getActivity(){
-    let query = new Parse.Query('Activity')
-    query.notEqualTo('isDeleted', true)
-    query.equalTo('eduProcess', this.eduProcess?.id)
-    this.activity = await query.first()
-    this.srcUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.activity?.get('reviewDetails')?.url+'#toolbar=0')
+  srcUrl: any;
+  async getActivity() {
+    let query = new Parse.Query('Activity');
+    query.notEqualTo('isDeleted', true);
+    query.equalTo('eduProcess', this.eduProcess?.id);
+    this.activity = await query.first();
+    this.srcUrl = this.sanitizer.bypassSecurityTrustResourceUrl(
+      this.activity?.get('reviewDetails')?.url + '#toolbar=0'
+    );
   }
   //切换tab
   async onSelectChange(e: number) {
@@ -168,6 +189,14 @@ export class ApproveComponent implements OnInit {
   }
   async onMarkScore(e: any) {
     console.log(e);
+    if (
+      this.eduProcess?.get('status') != '201' ||
+      this.activity?.get('startDate') > new Date() ||
+      this.activity?.get('deadline') < new Date()
+    ) {
+      this.message.warning('当前状态不可操作');
+      return;
+    }
     let query = new Parse.Query('EduReview');
     query.notEqualTo('isDeleted', true);
     query.equalTo('eduTextbook', e);
@@ -219,7 +248,7 @@ export class ApproveComponent implements OnInit {
             score: this.eduReview?.get('score'),
           };
           this.scoreMap = this.textbook.scoreMap;
-          this.textbook.updateStatusChange()
+          this.textbook.updateStatusChange();
           this.handleCancel();
         },
         nzCancelText: '取消',
@@ -244,7 +273,7 @@ export class ApproveComponent implements OnInit {
         score: this.eduReview?.get('num'),
       };
       this.scoreMap = this.textbook.scoreMap;
-      this.textbook.updateStatusChange()
+      this.textbook.updateStatusChange();
       this.handleCancel();
     }
   }