Explorar o código

优化评审活动设置

cehn hai 8 meses
pai
achega
451921e358

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

@@ -83,8 +83,8 @@ export class UserEditComponent implements OnInit {
   };
   userType: Array<string> = ['教师', '评审专家', '高校联系人', '工作联系人'];
   provinces: Array<string> = provinces.options; //省份
-  depTitle:string = '' //关联部门标题
-  radio:string = ''
+  depTitle: string = ''; //关联部门标题
+  radio: string = '';
 
   constructor(
     public tbookSer: textbookServer,
@@ -97,9 +97,16 @@ export class UserEditComponent implements OnInit {
   ) {}
 
   goUserList() {
-    this.router.navigate(['/nav-admin/manage/user'], {
-      queryParams: { page: this.route.snapshot.queryParamMap.get('page') },
-    });
+    switch (this.tbookSer.profile.identity) {
+      case '国家级管理员':
+        this.router.navigate(['/nav-admin/manage/user'], {
+          queryParams: { page: this.route.snapshot.queryParamMap.get('page') },
+        });
+        break;
+      default:
+        history.back();
+        break;
+    }
   }
   ngOnInit() {
     // window.onbeforeunload = (event) => {
@@ -230,8 +237,8 @@ export class UserEditComponent implements OnInit {
   //切换单位类型
   onChangeType() {
     this.userDataJson.department = null;
-    this.depTitle = ''
-    this.radio = ''
+    this.depTitle = '';
+    this.radio = '';
   }
   //选择部门
   async showModalDepart() {
@@ -239,12 +246,14 @@ export class UserEditComponent implements OnInit {
       this.message.warning('同级身份暂无权限操作');
       return;
     }
-    this.depTitle = this.userDataJson.department.name
-    this.radio = this.userDataJson.department.id
+    this.depTitle = this.userDataJson.department.name;
+    this.radio = this.userDataJson.department.id;
     if (this.unitTypes.length == 0) {
       await this.getUnitTypes();
     }
-    this.parentMap = await this.tbookSer.formatNode(this.user?.get('department')?.id);
+    this.parentMap = await this.tbookSer.formatNode(
+      this.user?.get('department')?.id
+    );
     let index = this.parentMap.findIndex(
       (item) => this.tbookSer.profile.user.department?.objectId == item.key
     );
@@ -305,8 +314,8 @@ export class UserEditComponent implements OnInit {
   async onPre(data?: any, index?: number) {
     if (!data) {
       this.userDataJson.department = undefined;
-      this.depTitle = ''
-      this.radio = ''
+      this.depTitle = '';
+      this.radio = '';
       await this.getDepart();
       this.parentMap = [];
       return;
@@ -317,15 +326,15 @@ export class UserEditComponent implements OnInit {
     }
     this.parentMap.splice((index || 0) + 1);
     this.userDataJson.department = undefined;
-    this.depTitle = ''
-    this.radio = ''
+    this.depTitle = '';
+    this.radio = '';
     await this.getDepart(data?.key);
   }
   //选择部门
   async onCheckedDepart(e: any, checked?: boolean) {
     console.log(e, checked);
     this.userDataJson.department = null;
-    this.depTitle = ''
+    this.depTitle = '';
     this.parentMap = await this.tbookSer.formatNode(e.id);
     if (this.tbookSer.profile.identity != '国家级管理员') {
       let index = this.parentMap.findIndex(
@@ -341,12 +350,12 @@ export class UserEditComponent implements OnInit {
     }
     if (checked && e.branch) {
       this.pushValue(e);
-      return
+      return;
     }
     if (e.isLeaf) {
       return;
     }
-    this.radio = ''
+    this.radio = '';
     await this.getDepart(e?.key);
   }
   pushValue(e: any) {
@@ -356,9 +365,9 @@ export class UserEditComponent implements OnInit {
       title: e.title,
       id: e.key,
     };
-    this.depTitle = e.title
+    this.depTitle = e.title;
     console.log(this.depTitle);
-    this.radio = e.key
+    this.radio = e.key;
     if (this.tbookSer.profile.identity == '国家级管理员') {
       this.userType = this.unitTypes.some((item) => e.parent == item.id)
         ? !e.type
@@ -388,8 +397,8 @@ export class UserEditComponent implements OnInit {
       },
       node: await this.tbookSer.formatNode(this.user.get('department')?.id),
     };
-    this.depTitle = ''
-    this.radio = ''
+    this.depTitle = '';
+    this.radio = '';
     this.isShowModal = false;
   }
   async completeChange(): Promise<void> {
@@ -443,8 +452,8 @@ export class UserEditComponent implements OnInit {
         },
         node: await this.tbookSer.formatNode(this.user.get('department')?.id),
       };
-      this.depTitle = this.user.get('department')?.get('name')
-      this.radio = this.user.get('department')?.id
+      this.depTitle = this.user.get('department')?.get('name');
+      this.radio = this.user.get('department')?.id;
       this.loading = false;
     }
   }

+ 155 - 133
projects/textbook/src/modules/nav-province-contact/activity/activity.component.html

@@ -1,148 +1,170 @@
-<nz-page-header>
-  <nz-breadcrumb nz-page-header-breadcrumb>
-    <div class="back" (click)="back()">
-      <span nz-icon nzType="left" nzTheme="outline"></span>返回
-    </div>
-  </nz-breadcrumb>
-  <nz-page-header-title
-    >{{ activity?.get("name") ? activity?.get("name") : "创建评委活动" }}
-  </nz-page-header-title>
-</nz-page-header>
-<div class="edit-content">
+<div class="site-page-header">
+  <nz-page-header>
+    <nz-breadcrumb nz-page-header-breadcrumb>
+      <div class="back" (click)="back()">
+        <span nz-icon nzType="left" nzTheme="outline"></span>返回
+      </div>
+    </nz-breadcrumb>
+    <nz-page-header-title
+      >{{ activity?.get("name") ? activity?.get("name") : "创建评委活动" }}
+    </nz-page-header-title>
+  </nz-page-header>
   <nz-tabset [(nzSelectedIndex)]="active">
-    <nz-tab nzTitle="活动规则设置">
-      @if (active == 0) {
-      <div class="basic">
-        <div class="title" style="margin-top: 10px;" >基本信息</div>
-        <ul nz-row nzJustify="space-between">
-          <li nz-col nzSpan="11">
-            <p>评审活动名称<span>*</span></p>
-            <input
-              nz-input
-              placeholder="请输入评审活动名称"
-              [(ngModel)]="name"
-              type="text"
-            />
-          </li>
-          <li nz-col nzSpan="11">
-            <p>开始时间<span></span></p>
-            <nz-date-picker
-              nzShowTime
-              nzFormat="yyyy-MM-dd HH:mm:ss"
-              [(ngModel)]="startDate"
-            ></nz-date-picker>
-          </li>
-          <li nz-col nzSpan="11">
-            <p>结束时间<span></span></p>
-            <nz-date-picker
-              nzShowTime
-              nzFormat="yyyy-MM-dd HH:mm:ss"
-              [(ngModel)]="deadline"
-            ></nz-date-picker>
-          </li>
-        </ul>
+    <nz-tab nzTitle="活动规则设置"> </nz-tab>
+    <nz-tab nzTitle="评审明细"> </nz-tab>
+  </nz-tabset>
+</div>
+<div class="edit-content">
+  @if (active == 0) {
+  <div class="basic">
+    <div class="title" style="margin-top: 10px">基本信息</div>
+    <ul nz-row nzJustify="space-between">
+      <li nz-col nzSpan="11">
+        <p>评审活动名称<span>*</span></p>
+        <input
+          nz-input
+          placeholder="请输入评审活动名称"
+          [(ngModel)]="name"
+          type="text"
+        />
+      </li>
+      <li nz-col nzSpan="11">
+        <p>开始时间<span></span></p>
+        <nz-date-picker
+          nzShowTime
+          nzFormat="yyyy-MM-dd HH:mm:ss"
+          [(ngModel)]="startDate"
+        ></nz-date-picker>
+      </li>
+      <li nz-col nzSpan="11">
+        <p>结束时间<span></span></p>
+        <nz-date-picker
+          nzShowTime
+          nzFormat="yyyy-MM-dd HH:mm:ss"
+          [(ngModel)]="deadline"
+        ></nz-date-picker>
+      </li>
+    </ul>
 
-        <button (click)="save()" class="btn save" nz-button nzType="primary">
-          保存
-        </button>
-        <button (click)="reset()" class="btn replay" nz-button nzType="primary">
-          重置
-        </button>
-        <div class="title">评审规则</div>
-        <ul nz-row nzJustify="space-between">
-          <li nz-col nzSpan="11">
-            <p>总分值计算方式<span>*</span></p>
-            <nz-radio-group
-              [(ngModel)]="calculation"
-              (ngModelChange)="changeCalculation()"
-            >
-              <label nz-radio nzValue="mean">平均数</label>
-              <label nz-radio nzValue="truncatedMean">截尾平均数</label>
-            </nz-radio-group>
-          </li>
-          <li nz-col nzSpan="11">
-            <p>评审细则</p>
-            @if(reviewDetails?.url){
-            <a target="_blank" [href]="reviewDetails?.url">
-              <span nz-icon nzType="file" nzTheme="outline"></span>
-              {{ reviewDetails?.name }}
-            </a>
-            }
+    <button (click)="save()" class="btn save" nz-button nzType="primary">
+      保存
+    </button>
+    <button (click)="reset()" class="btn replay" nz-button nzType="primary">
+      重置
+    </button>
+    <div class="title">评审规则</div>
+    <ul nz-row nzJustify="space-between">
+      <li nz-col nzSpan="11">
+        <p>总分值计算方式<span>*</span></p>
+        <nz-radio-group
+          [(ngModel)]="calculation"
+          (ngModelChange)="changeCalculation()"
+        >
+          <label nz-radio nzValue="mean">平均数</label>
+          <label nz-radio nzValue="truncatedMean">截尾平均数</label>
+        </nz-radio-group>
+      </li>
+      <li nz-col nzSpan="11">
+        <p>评审细则</p>
+        @if(reviewDetails?.url){
+        <a target="_blank" [href]="reviewDetails?.url">
+          <span nz-icon nzType="file" nzTheme="outline"></span>
+          {{ reviewDetails?.name }}
+        </a>
+        }
 
-            <div class="uploadBtn">
-              <app-comp-upload
-                [type]="'pdf'"
-                (change)="upload($event)"
-                title="上传评审细则文件"
-              ></app-comp-upload>
+        <div class="uploadBtn">
+          <app-comp-upload
+            [type]="'pdf'"
+            (change)="upload($event)"
+            title="上传评审细则文件"
+          ></app-comp-upload>
+        </div>
+      </li>
+    </ul>
+    <div class="title">
+      评审组
+      <button
+        (click)="creatReviewGroup()"
+        class="btn replay"
+        nz-button
+        nzType="primary"
+      >
+        创建评审组
+      </button>
+    </div>
+    @if (expertGroupList.length>0) {
+    <div class="reviewGroup">
+      @for (item of expertGroupList; track $index) {
+      <div class="group-compl">
+        <div>
+          <div class="name">{{ item?.get("name") || "未命名" }}</div>
+          <div class="row">
+            <div class="lable">更新时间:</div>
+            <div class="val">
+              {{ item?.get("updatedAt") | date : "yyyy-MM-dd HH:mm:ss" }}
+            </div>
+          </div>
+          <div class="row">
+            <div class="lable">评审教材:</div>
+            <div class="val">
+              @for (booktext of item?.get('textbookList'); track booktext.id;let
+              j = $index) { @if(j<5){
+              {{ booktext?.get("title") + " " }}
+              } } @if (item?.get('textbookList')?.length > 5){ 等{{
+                item?.get("textbookList")?.length
+              }}个 }
+            </div>
+          </div>
+          <div class="row">
+            <div class="lable">评审专家:</div>
+            <div class="val">
+              @for (p of item?.get('reviewList'); track p.id;let j = $index) {
+              @if(j<5){
+              {{ p?.get("user")?.get("name") + " " }}
+              } } @if (item?.get('reviewList')?.length > 5){ 等{{
+                item?.get("textbookList")?.length
+              }}个 }
             </div>
-          </li>
-        </ul>
-        <div class="title">
-          评审组
+          </div>
+        </div>
+        <div>
           <button
-            (click)="creatReviewGroup()"
             class="btn replay"
             nz-button
-            nzType="primary"
+            nzType="text"
+            (click)="
+              goUrl('/nav-province-contact/manage/review-edit/' + item.id)
+            "
           >
-            创建评审组
+            编辑</button
+          ><br />
+          <button
+            (click)="deleteGroup($index)"
+            nz-button
+            nzType="text"
+            nzDanger
+          >
+            删除
           </button>
         </div>
-        @if (expertGroupList.length>0) {
-        <ul class="reviewGroup">
-          @for (item of expertGroupList; track $index) {
-          <li>
-            <div>
-              <div>{{ item?.get("name") || "未命名" }}</div>
-              <p>
-                更新时间:{{
-                  item?.get("updatedAt") | date : "yyyy-MM-dd HH:mm:ss"
-                }}
-              </p>
-            </div>
-            <div>
-              <button
-                class="btn replay"
-                nz-button
-                nzType="primary"
-                (click)="
-                  goUrl('/nav-province-contact/manage/review-edit/' + item.id)
-                "
-              >
-                编辑</button
-              ><br />
-              <button
-                (click)="deleteGroup($index)"
-                nz-button
-                nzType="text"
-                nzDanger
-              >
-                删除
-              </button>
-            </div>
-          </li>
-          }
-        </ul>
-        }@else {
-        <nz-empty
-          class="empty"
-          nzNotFoundImage="simple"
-          nzNotFoundContent="还没有评审组"
-        ></nz-empty>
-        }
       </div>
       }
-    </nz-tab>
-    <nz-tab nzTitle="评审明细">
-      @if (active == 1) {
-      <app-review-details
-        [listOfFilter]="listOfFilter"
-        [filterObj]="filterObj"
-      ></app-review-details>
-      }
-    </nz-tab>
-  </nz-tabset>
+    </div>
+    }@else {
+    <nz-empty
+      class="empty"
+      nzNotFoundImage="simple"
+      nzNotFoundContent="还没有评审组"
+    ></nz-empty>
+    }
+  </div>
+  } @else if (active == 1) {
+  <app-review-details
+    [listOfFilter]="listOfFilter"
+    [filterObj]="filterObj"
+  ></app-review-details>
+  }
 </div>
 
 <div class="loading" [hidden]="!saveLoading">

+ 104 - 64
projects/textbook/src/modules/nav-province-contact/activity/activity.component.scss

@@ -1,109 +1,145 @@
-.back {
-  font-family: PingFang SC;
-  font-size: 14px;
-  font-weight: 400;
-  line-height: 22px;
-  text-align: left;
-  cursor: pointer;
+.site-page-header {
+  position        : sticky;
+  top             : 0;
+  z-index         : 9;
+  padding         : 24px 24px 10px;
+  background-color: white;
+  font-family     : PingFang SC;
+
+  .back {
+    font-family: PingFang SC;
+    font-size  : 14px;
+    font-weight: 400;
+    line-height: 22px;
+    text-align : left;
+    cursor     : pointer;
+  }
 }
 
+
 .edit-content {
-  margin: 0 0 20px;
+  margin : 0 0 20px;
   padding: 0 24px;
-  height: calc(100vh - 250px);
+  height : calc(100vh - 250px);
 
   .basic {
     .title {
-      width: 100%;
-      font-family: PingFang SC;
-      font-size: 20px;
-      font-weight: bold;
-      line-height: 32px;
-      text-align: left;
-      margin-top: 30px;
-      margin-bottom: 20px;
-      display: flex;
+      width          : 100%;
+      font-family    : PingFang SC;
+      font-size      : 20px;
+      font-weight    : bold;
+      line-height    : 32px;
+      text-align     : left;
+      margin-top     : 30px;
+      margin-bottom  : 20px;
+      display        : flex;
       justify-content: space-between;
     }
 
     ul {
-      margin: 0;
+      margin : 0;
       padding: 0;
+
       li {
         list-style: none;
-        margin: 10px 0;
+        margin    : 10px 0;
+
         p {
           color: rgb(109, 108, 108);
 
           span {
-            color: red;
+            color      : red;
             margin-left: 5px;
           }
         }
-        .uploadBtn{
-          width: 150px;
-          text-wrap: nowrap;
-          padding: 5px 10px;
+
+        .uploadBtn {
+          width        : 150px;
+          text-wrap    : nowrap;
+          padding      : 5px 10px;
           border-radius: 5px;
-          background: #EAE6E6;
-          color: gray;
+          background   : #EAE6E6;
+          color        : gray;
         }
       }
     }
-    .btn{
+
+    .btn {
       margin-right: 15px;
-      margin-top: 20px;
-      background: #3E49B3;
-      border: none;
+      margin-top  : 20px;
+      background  : #3E49B3;
+      border      : none;
     }
-    .replay{
-      background:#EAE6E6;
-      color: black;
+
+    .replay {
+      background: #fff;
+      color     : #215AE5;
     }
-    .empty{
-      color: #86909C; 
-      background: whitesmoke;
-      display: flex;
-      flex-direction: column;
+
+    .empty {
+      color          : #86909C;
+      background     : whitesmoke;
+      display        : flex;
+      flex-direction : column;
       justify-content: center;
-      align-items: center;
+      align-items    : center;
     }
-    .reviewGroup{
-      background: whitesmoke;
-      padding: 20px;
+
+    .reviewGroup {
+      background   : whitesmoke;
+      padding      : 20px;
       margin-bottom: 20px;
       border-radius: 2px;
-      >li{
-      border-radius: 2px;
-        background: white;
-        padding: 20px;
-        display: flex;
+
+      .group-compl {
+        border-radius  : 6px;
+        background     : white;
+        padding        : 20px;
+        display        : flex;
         justify-content: space-between;
-        align-items: center;
-        >div>div{
-          font-size: 18px;
+        align-items    : center;
+        margin         : 10px 0;
+
+        .name {
+          font-size  : 18px;
           font-weight: bold;
         }
-        p{
-          margin: 10px 0;
+
+        .row {
+          margin : 10px 0;
+          display: flex;
+          align-content: center;
+          font-size  : 14px;
+          font-weight: 400;
+          line-height: 20px;
+          .lable {
+            width: 120px;
+            font-family: PingFang SC;
+            text-align : left;
+            color      : #231C1F99;
+          }
+          .val{
+            color: #231C1FCC;
+          }
         }
       }
     }
   }
 
 }
-.loading{
-  position: fixed;
-  top: 0;
-  left: 0;
-  width: 100vw;
-  text-align: center;
-  height: 100%;
-  display: flex;
-  align-items: center;
+
+.loading {
+  position       : fixed;
+  top            : 0;
+  left           : 0;
+  width          : 100vw;
+  text-align     : center;
+  height         : 100%;
+  display        : flex;
+  align-items    : center;
   justify-content: center;
-  background: rgb(0 0 0 / 30%);
-  z-index: 99;
+  background     : rgb(0 0 0 / 30%);
+  z-index        : 99;
 }
 
 
@@ -129,4 +165,8 @@
 
 ::ng-deep .ant-tabs-tab-btn:active {
   color: #e97488;
+}
+
+::ng-deep .ant-page-header {
+  padding: 0 !important;
 }

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

@@ -172,7 +172,7 @@ export class ActivityComponent implements OnInit {
     query.equalTo('eduProcess', this.eduProcess?.id)
     query.notEqualTo('isDeleted', true)
     query.descending('updatedAt')//大到小
-    query.include('textbookList')
+    query.include('textbookList','reviewList.user')
     this.expertGroupList = await query.find()
     console.log(this.expertGroupList)
     this.expertGroupList.forEach(item=>{