Ver código fonte

教材资源收集

warrior 2 meses atrás
pai
commit
3b75d332a8

+ 1 - 0
projects/textbook/src/modules/nav-admin/components/collect-textbook/collect-textbook.component.html

@@ -179,6 +179,7 @@
               nzShowSizeChanger
               (nzPageIndexChange)="pageIndexChange($event)"
               (nzPageSizeChange)="onPageSizeChange($event)"
+              nzBordered
             >
               <thead>
                 <tr>

+ 57 - 29
projects/textbook/src/modules/nav-province-contact/collect-file/collect-file.component.html

@@ -46,9 +46,9 @@
         <th nzEllipsis nzWidth="120px" nzLeft>教材名称</th>
         <th nzEllipsis nzWidth="120px">申报编号</th>
         <th nzEllipsis nzWidth="120px">ISBN</th>
-        <th nzEllipsis nzWidth="120px">出版单位</th>
-        <th nzEllipsis nzWidth="120px">出版单位联系人</th>
-        <th nzEllipsis nzWidth="80px" nzAlign="center">文件状态</th>
+        <th nzEllipsis nzWidth="120px">推荐单位</th>
+        <th nzEllipsis nzWidth="120px">推荐单位联系人</th>
+        <th nzEllipsis nzWidth="80px" nzAlign="center">任务状态</th>
         <th nzEllipsis nzWidth="80px" nzAlign="center" nzRight>操作</th>
       </tr>
     </thead>
@@ -88,35 +88,21 @@
             </div>
           </ng-template>
         </td>
-        <td
-          nzEllipsis
-          nz-popover
-          [nzPopoverContent]="contentTemplateeditionUnit"
-          #editionUnit
-        >
-          {{ data?.get("department")?.get('title')}}
-          <ng-template #contentTemplateeditionUnit>
-            <div style="max-width: 400px">
-              {{ editionUnit.innerText }}
-            </div>
-          </ng-template>
+        <td nzEllipsis>
+          {{ data?.get("department")?.get("name") }}
         </td>
-
-        <td
-          nzEllipsis
-          nz-popover
-          [nzPopoverContent]="contentTemplateChild"
-          #childrens
-        >
-          <ng-template #contentTemplateChild>
-            <div style="max-width: 400px">
-              {{ childrens.innerText }}
-            </div>
-          </ng-template>
+        <td nzEllipsis>
+          {{
+            data
+              ?.get("eduProcess")
+              ?.get("profileSubmitted")
+              ?.get("user")
+              ?.get("name")
+          }}
         </td>
         <td nzEllipsis nzAlign="center">未上传</td>
         <td nzEllipsis nzRight nzAlign="center">
-          <a nz-button nzType="link">查看</a>
+          <a nz-button nzType="link" (click)="onEditModal(data)">上传</a>
         </td>
       </tr>
       }
@@ -130,4 +116,46 @@
   <div class="loading" [hidden]="!showLoading">
     <nz-spin nzSimple [nzSize]="'large'"></nz-spin>
   </div>
-</div>
+</div>
+
+
+<nz-modal
+  [(nzVisible)]="isVisible"
+  nzTitle="上传教材源文件"
+  (nzOnCancel)="handleCancel()"
+  nzWidth="600px"
+>
+  <ng-container *nzModalContent>
+    <div nz-row class="depart-modal">
+      <div nz-col nzSpan="24">
+        <div class="row">
+         <div class="title-name">纸质教材PDF文件</div>
+         <div class="desc">单个文件不超过500MB</div>
+        </div>
+        <div class="row">
+          <div class="title-name">数字教材</div>
+          <div class="desc">可单选上次文件、链接、链接和账号密码三种格式,上传文件总大小不可超过500MB</div>
+          <div class="value">
+          </div>
+        </div>
+        <div class="row" style="align-items: start;">
+          <div class="label">收集教材</div>
+          <div class="value">
+          </div>
+        </div>
+      </div>
+    </div>
+  </ng-container>
+  <div *nzModalFooter>
+    <button nz-button nzType="default" (click)="handleCancel()">取消</button>
+    <button nz-button nzType="default" (click)="saveCollect('sbmit')">提交</button>
+    <button
+      nz-button
+      nzType="primary"
+      [disabled]="false"
+      (click)="saveCollect('save')"
+    >
+      保存
+    </button>
+  </div>
+</nz-modal>

+ 6 - 2
projects/textbook/src/modules/nav-province-contact/collect-file/collect-file.component.scss

@@ -55,9 +55,13 @@
 .row {
   width: 100%;
   margin-bottom: 20px;
-  display: flex;
-  align-items: center;
+  // display: flex;
+  // align-items: center;
   .label {
     width: 100px;
   }
+  .desc{
+    color: rgba(0, 0, 0, 0.4509803922);
+    font-size: 14px;
+  }
 }

+ 33 - 17
projects/textbook/src/modules/nav-province-contact/collect-file/collect-file.component.ts

@@ -12,8 +12,6 @@ import { MatDialog } from '@angular/material/dialog';
 import { NzEmptyModule } from 'ng-zorro-antd/empty';
 import { DatePipe } from '@angular/common';
 import { NzPopoverModule } from 'ng-zorro-antd/popover';
-import { setHours } from 'date-fns';
-import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
 @Component({
   selector: 'app-collect-file',
   templateUrl: './collect-file.component.html',
@@ -25,22 +23,19 @@ import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
     NzMessageModule,
     NzEmptyModule,
     NzPopoverModule,
-    NzDatePickerModule,
   ],
   providers: [DatePipe],
   standalone: true,
 })
 export class CollectFileComponent implements OnInit {
   textbookList: Array<Parse.Object> = [];
-  eduProcess?:Parse.Object //流程
+  eduProcess?: Parse.Object; //流程
   count: number = 0;
-  timeDefaultValue = setHours(new Date(), 0);
 
   @Input('limit') limit: number = 10;
   pageIndex: number = 1;
   loading: boolean = false;
   @Input('maxWidth') maxWidth: any; //最大宽度
-  showModal: boolean = false;
 
   searchValue: string = '';
   time: any;
@@ -66,6 +61,10 @@ export class CollectFileComponent implements OnInit {
     }
     return j || '-';
   }
+
+  isVisible: boolean = false;
+  currentTextbook?: Parse.Object; //当前编辑教材
+
   constructor(
     private msg: NzMessageService,
     public tbookSer: textbookServer,
@@ -76,17 +75,17 @@ export class CollectFileComponent implements OnInit {
   ) {}
 
   async ngOnInit() {
-    await this.getEduProcess()
-    this.getTextbook()
+    await this.getEduProcess();
+    this.getTextbook();
   }
-  async getEduProcess(){
-    let query = new Parse.Query('EduProcess')
-    query.notEqualTo('isDeleted',true)
-    query.equalTo('profileSubmitted',this.tbookSer.profile.objectId)
-    query.containedIn('status',['400'])
-    let r = await query.first()
+  async getEduProcess() {
+    let query = new Parse.Query('EduProcess');
+    query.notEqualTo('isDeleted', true);
+    query.equalTo('profileSubmitted', this.tbookSer.profile.objectId);
+    query.containedIn('status', ['400']);
+    let r = await query.first();
     console.log(r);
-    this.eduProcess = r
+    this.eduProcess = r;
   }
 
   async getTextbook(val?: string, review?: boolean): Promise<any[] | void> {
@@ -121,7 +120,8 @@ export class CollectFileComponent implements OnInit {
           childrens: {
             $inQuery: {
               where: {
-                editionUnit:'民政部' || this.eduProcess?.get('name'),
+                editionUnit: this.eduProcess?.get('name'),
+                // editionUnit: '山东大学出版社',
               },
               className: 'EduTextbookVolume',
             },
@@ -137,7 +137,11 @@ export class CollectFileComponent implements OnInit {
       query.notEqualTo('discard', true);
       // query.exists('score');
       // query.equalTo('verify', true);
-      query.include('childrens','department');
+      query.include(
+        'childrens',
+        'eduProcess.profileSubmitted.user',
+        'department'
+      );
       this.count = await query.count();
       query.limit(this.limit);
       query.skip(this.limit * (this.pageIndex - 1));
@@ -203,4 +207,16 @@ export class CollectFileComponent implements OnInit {
     }
     this.route.navigate([url]);
   }
+  //打开上传弹窗
+  onEditModal(data:Parse.Object){
+    this.currentTextbook = data
+    this.isVisible = true
+  }
+  handleCancel(): void {
+    this.isVisible = false;
+    this.currentTextbook = undefined;
+  }
+  saveCollect(type:string) {
+    console.log(type);
+  }
 }