Browse Source

update 全部教材列表

warrior 7 months ago
parent
commit
268aa3f7dc
22 changed files with 663 additions and 117 deletions
  1. 1 1
      projects/textbook/src/app/comp-manage/comp-manage.component.scss
  2. 12 12
      projects/textbook/src/app/comp-manage/comp-manage.component.ts
  3. 276 12
      projects/textbook/src/app/textbook/textbook.component.html
  4. 221 42
      projects/textbook/src/app/textbook/textbook.component.ts
  5. 1 1
      projects/textbook/src/modules/nav-admin/modules.routes.ts
  6. 5 3
      projects/textbook/src/modules/nav-admin/page-process/page-process.component.ts
  7. 9 13
      projects/textbook/src/modules/nav-admin/page-textbook/page-textbook.component.html
  8. 10 0
      projects/textbook/src/modules/nav-admin/page-textbook/page-textbook.component.scss
  9. 6 1
      projects/textbook/src/modules/nav-admin/page-textbook/page-textbook.component.ts
  10. 1 1
      projects/textbook/src/modules/nav-author/components/attachment/attachment.component.scss
  11. 1 1
      projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.scss
  12. 3 15
      projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.ts
  13. 1 1
      projects/textbook/src/modules/nav-author/components/textbook-content/textbook-content.component.scss
  14. 1 1
      projects/textbook/src/modules/nav-author/components/textbook-content/textbook-content.component.ts
  15. 1 1
      projects/textbook/src/modules/nav-author/components/textbook-pertain/textbook-pertain.component.html
  16. 1 1
      projects/textbook/src/modules/nav-author/components/textbook-pertain/textbook-pertain.component.ts
  17. 2 2
      projects/textbook/src/modules/nav-author/space/space.component.ts
  18. 1 1
      projects/textbook/src/modules/nav-province-contact/modules.routes.ts
  19. 4 0
      projects/textbook/src/modules/nav-province-contact/page-process/page-process.component.ts
  20. 42 5
      projects/textbook/src/modules/nav-province-contact/page-textbook/page-textbook.component.html
  21. 26 1
      projects/textbook/src/modules/nav-province-contact/page-textbook/page-textbook.component.scss
  22. 38 2
      projects/textbook/src/modules/nav-province-contact/page-textbook/page-textbook.component.ts

+ 1 - 1
projects/textbook/src/app/comp-manage/comp-manage.component.scss

@@ -28,7 +28,7 @@
   .preview{
     height: 100%;
     overflow-y: scroll;
-    padding: 0 0 40px 0;
+    padding: 0 0 10px 0;
     flex: 1;
     background-color: white;
     border-radius: 10px;

+ 12 - 12
projects/textbook/src/app/comp-manage/comp-manage.component.ts

@@ -29,16 +29,16 @@ export class CompManageComponent implements OnInit {
         name:'教材管理',
         id:'1',
         child:[
+          {
+            name:'全部教材列表',
+            path:'/nav-admin/manage/textbook',
+            id:'1-1',
+          },
           {
             name:'申报流程',
             path:"/nav-admin/manage/process",
-            id:'1-1',
+            id:'1-2',
           },
-          // {
-          //   name:'全部教材',
-          //   path:'/nav-admin/manage/textbook',
-          //   id:'1-2',
-          // },
         ]
       },
       {
@@ -81,16 +81,16 @@ export class CompManageComponent implements OnInit {
         name:'教材申报',
         id:'1',
         child:[
+          {
+            name:'全部教材列表',
+            path:'/nav-province-contact/manage/textbook',
+            id:'1-1',
+          },
           {
             name:'申报流程',
             path:"/nav-province-contact/manage/process",
-            id:'1-1',
+            id:'1-2',
           },
-          // {
-          //   name:'全部教材',
-          //   path:'/nav-province-contact/manage/textbook',
-          //   id:'1-2',
-          // },
         ]
       },
       {

+ 276 - 12
projects/textbook/src/app/textbook/textbook.component.html

@@ -37,6 +37,248 @@
     nzTableLayout="fixed"
     (nzPageIndexChange)="pageIndexChange($event)"
   >
+    @if(filterObj?.showMore){
+    <thead>
+      <tr>
+        @if (filterObj.isCheck) {
+        <th
+          nzWidth="50px"
+          nzLeft
+          [nzChecked]="checkedAll"
+          [nzIndeterminate]="false"
+          nzLabel="Select all"
+          (nzCheckedChange)="onAllChecked($event)"
+        ></th>
+        <th nzEllipsis nzWidth="80px">申报编号</th>
+        }@else{
+        <th nzEllipsis nzWidth="120px" nzLeft>申报编号</th>
+        }
+        <th nzEllipsis nzWidth="120px">教材名称</th>
+        <th nzEllipsis nzWidth="120px">ISBN</th>
+        <th nzEllipsis nzWidth="180px">第一主编/作者</th>
+        <th
+          nzEllipsis
+          nzWidth="120px"
+          [nzShowFilter]="true"
+          [nzFilters]="listOfColumns.lang.listOfFilter"
+          (nzFilterChange)="listOfColumns.lang.onChange($event)"
+        >
+          主要语种类型
+        </th>
+        <th
+          nzEllipsis
+          nzWidth="180px"
+          [nzShowFilter]="true"
+          [nzFilters]="listOfColumns.majorPoniter.listOfFilter"
+          (nzFilterChange)="listOfColumns.majorPoniter.onChange($event)"
+        >
+          所属学科专业类
+        </th>
+        <th
+          nzEllipsis
+          nzWidth="180px"
+          [nzShowFilter]="true"
+          [nzFilters]="listOfColumns.editionUnit.listOfFilter"
+          (nzFilterChange)="listOfColumns.editionUnit.onChange($event)"
+        >
+          出版单位
+        </th>
+        <th
+          nzEllipsis
+          nzWidth="180px"
+          [nzShowFilter]="true"
+          [nzFilters]="listOfColumns.approval.listOfFilter"
+          (nzFilterChange)="listOfColumns.approval.onChange($event)"
+        >
+          重点立项教材
+        </th>
+        <th
+          nzEllipsis
+          nzWidth="180px"
+          [nzShowFilter]="true"
+          [nzFilters]="listOfColumns.carrierShape.listOfFilter"
+          (nzFilterChange)="listOfColumns.carrierShape.onChange($event)"
+        >
+          载体形式
+        </th>
+        <th
+          nzEllipsis
+          nzWidth="180px"
+          [nzShowFilter]="true"
+          [nzFilters]="listOfColumns.department.listOfFilter"
+          (nzFilterChange)="listOfColumns.department.onChange($event)"
+        >
+          申报部门
+        </th>
+        <th nzEllipsis nzWidth="50px" nzRight>操作</th>
+      </tr>
+    </thead>
+    @if (textbookList.length > 0) {
+    <tbody>
+      @for (data of textbookList; track data.id) {
+      <tr>
+        @if (filterObj.isCheck) {
+        <td
+          nzEllipsis
+          nzLeft
+          [nzChecked]="setOfCheckedId.has(data.id)"
+          (nzCheckedChange)="onItemChecked(data.id, $event)"
+        ></td>
+        <td nzEllipsis (click)="toUrl(path + '/' + data.id)">
+          {{ data?.get("code") }}
+        </td>
+        }@else {
+        <td nzEllipsis nzLeft>
+          {{ data?.get("code") }}
+        </td>
+        }
+        <td nzEllipsis class="activeTd" (click)="toUrl(path + '/' + data.id)">
+          {{ data?.get("title") || "-" }}
+        </td>
+        <td nzEllipsis>
+          {{ data?.get("ISBN") || "-" }}
+        </td>
+        <td nzEllipsis>
+          {{ data?.get("author") || "-" }}
+        </td>
+        <td nzEllipsis>
+          {{ data?.get("lang") || "-" }}
+        </td>
+        <td nzEllipsis>
+          {{ data?.get("majorPoniter") || "-" }}
+        </td>
+        <td nzEllipsis>
+          {{ data?.get("editionUnit") || "-" }}
+        </td>
+        <td nzEllipsis>
+          {{ data?.get("approval") || "-" }}
+        </td>
+        <td nzEllipsis>
+          {{ data?.get("carrierShape") || "-" }}
+        </td>
+        <td nzEllipsis>
+          {{ data?.get("department")?.get("name") || "-" }}
+        </td>
+        <td nzEllipsis nzRight>
+          @if(manage){
+          <button
+            nz-button
+            nz-dropdown
+            [nzDropdownMenu]="menu"
+            [nzPlacement]="'bottomLeft'"
+          >
+            <span nz-icon nzType="ellipsis" nzTheme="outline"></span>
+          </button>
+          <nz-dropdown-menu #menu="nzDropdownMenu">
+            <ul nz-menu>
+              @if(filterObj.btns.edit){
+              <li nz-menu-item>
+                <button
+                  (click)="toUrl('/nav-author/manage/apply', { id: data.id })"
+                  nz-button
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="edit" nzTheme="outline"></span>编辑教材
+                </button>
+              </li>
+              }@if(filterObj.btns.review){
+              <li nz-menu-item>
+                <button
+                  nz-button
+                  (click)="
+                    toUrl('/nav-admin/manage/textbook/details/' + data.id)
+                  "
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="read" nzTheme="outline"></span>预览教材
+                </button>
+              </li>
+              } @if(filterObj.btns.star){
+              <li nz-menu-item>
+                <button
+                  (click)="updateStatus(data, true)"
+                  nz-button
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="star" nzTheme="outline"></span>加入推荐
+                </button>
+              </li>
+              } @if(filterObj.btns.export){
+              <li nz-menu-item>
+                <button
+                  (click)="exportProcess(data)"
+                  nz-button
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="export" nzTheme="outline"></span
+                  >导出函报文件
+                </button>
+              </li>
+              } @if(filterObj.btns.reject){
+              <li nz-menu-item>
+                <button
+                  (click)="reject(data)"
+                  nz-button
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="rollback" nzTheme="outline"></span
+                  >退回教材
+                </button>
+              </li>
+              } @if(filterObj.btns.remove){
+              <li nz-menu-item>
+                <button
+                  (click)="updateStatus(data, false)"
+                  nz-button
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span
+                    nz-icon
+                    nzType="vertical-align-bottom"
+                    nzTheme="outline"
+                  ></span
+                  >移除推荐
+                </button>
+              </li>
+              } @if(filterObj.btns.submit){
+              <li nz-menu-item>
+                <button
+                  nz-button
+                  (click)="submit(data)"
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="upload" nzTheme="outline"></span
+                  >提交教材
+                </button>
+              </li>
+              } @if(filterObj.btns.isDelete){
+              <li nz-menu-item>
+                <button
+                  (click)="del(data)"
+                  nz-button
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="delete" nzTheme="outline"></span
+                  >删除教材
+                </button>
+              </li>
+              }
+            </ul>
+          </nz-dropdown-menu>
+          } @else { - }
+        </td>
+      </tr>
+      }
+    </tbody>
+    } }@else {
     <thead>
       <tr>
         @if (filterObj.isCheck) {
@@ -81,7 +323,7 @@
         ></td>
         @if (!filterObj?.btns?.submit) {
         <td nzEllipsis class="activeTd" (click)="toUrl(path + '/' + data.id)">
-          {{ data?.get('code') }}
+          {{ data?.get("code") }}
         </td>
         }
         <td nzEllipsis class="activeTd" (click)="toUrl(path + '/' + data.id)">
@@ -98,7 +340,7 @@
         </td>
         } @else {
         <td nzEllipsis nzLeft>
-          {{ data?.get('code') }}
+          {{ data?.get("code") }}
         </td>
         <td nzEllipsis class="activeTd" (click)="toUrl(path + '/' + data.id)">
           {{ data?.get("title") || "-" }}
@@ -167,27 +409,39 @@
                   <span nz-icon nzType="read" nzTheme="outline"></span>预览教材
                 </button>
               </li>
-              } @if(filterObj.btns.reject){
+              } @if(filterObj.btns.star){
               <li nz-menu-item>
                 <button
-                  (click)="reject(data)"
+                  (click)="updateStatus(data, true)"
                   nz-button
                   nzType="link"
                   style="color: #231c1f"
                 >
-                  <span nz-icon nzType="rollback" nzTheme="outline"></span
-                  >退回教材
+                  <span nz-icon nzType="star" nzTheme="outline"></span>加入推荐
                 </button>
               </li>
-              } @if(filterObj.btns.star){
+              } @if(filterObj.btns.export){
               <li nz-menu-item>
                 <button
-                  (click)="updateStatus(data, true)"
+                  (click)="exportProcess(data)"
                   nz-button
                   nzType="link"
                   style="color: #231c1f"
                 >
-                  <span nz-icon nzType="star" nzTheme="outline"></span>加入推荐
+                  <span nz-icon nzType="export" nzTheme="outline"></span
+                  >导出函报文件
+                </button>
+              </li>
+              } @if(filterObj.btns.reject){
+              <li nz-menu-item>
+                <button
+                  (click)="reject(data)"
+                  nz-button
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="rollback" nzTheme="outline"></span
+                  >退回教材
                 </button>
               </li>
               } @if(filterObj.btns.remove){
@@ -238,7 +492,7 @@
       </tr>
       }
     </tbody>
-    }
+    } }
   </nz-table>
   @if (textbookList.length == 0) {
   <nz-empty nzNotFoundImage="/img/group-empty.png"></nz-empty>
@@ -270,7 +524,8 @@
         批量推荐
       </button>
     </div>
-    } @if(filterObj.btns.remove){
+    } 
+    @if(filterObj.btns.remove){
     <div class="batch-toolbar-actions">
       <div class="ant-space ant-space-horizontal ant-space-align-center">
         <div class="ant-space-item" style="margin-right: 16px">
@@ -289,7 +544,16 @@
         </div>
       </div>
     </div>
-    } @if(filterObj.btns.isDelete){
+    }
+    @if(filterObj.btns.export){
+      <div class="styles_cancel__AARoT">
+        <button nz-button nzType="text" (click)="exportProcess()">
+          <span nz-icon nzType="export" nzTheme="outline"></span>
+          批量导出
+        </button>
+      </div>
+      } 
+    @if(filterObj.btns.isDelete){
     <div class="batch-toolbar-actions">
       <div class="ant-space ant-space-horizontal ant-space-align-center">
         <div class="ant-space-item" style="margin-right: 16px">

+ 221 - 42
projects/textbook/src/app/textbook/textbook.component.ts

@@ -10,6 +10,15 @@ import { MatButtonModule } from '@angular/material/button';
 import { NzRadioModule } from 'ng-zorro-antd/radio';
 import { DatePipe } from '@angular/common';
 import { NzEmptyModule } from 'ng-zorro-antd/empty';
+import * as major from '../../services/majors.map';
+interface filter {
+  lang: any;
+  majorPoniter: any;
+  editionUnit: any;
+  approval: any;
+  carrierShape: any;
+  department: any;
+}
 @Component({
   selector: 'app-textbook',
   templateUrl: './textbook.component.html',
@@ -28,7 +37,7 @@ import { NzEmptyModule } from 'ng-zorro-antd/empty';
 export class TextbookComponent implements OnInit {
   textbookList: Array<Parse.Object> = [];
   count: number = 0;
-  limit: number = 10;
+  @Input('limit') limit: number = 10;
   pageSize: number = 1;
 
   @Input('maxWidth') maxWidth: any; //最大宽度
@@ -37,8 +46,11 @@ export class TextbookComponent implements OnInit {
   @Input('uid') uid: string = ''; //个人空间
   @Input('path') path: string = '/nav-admin/manage/textbook/details';
   @Input('discard') discard: Boolean = false; //是否删除
+  @Input('eduProcessId') eduProcessId: any = ''; //流程id,verify存在时需要
+
   //相关权限配置
   @Input('filterObj') filterObj: any = {
+    showMore: false, //显示更多字段
     isCheck: true,
     noStared: false, //非推荐
     status: [],
@@ -50,16 +62,92 @@ export class TextbookComponent implements OnInit {
       star: false, //加入推荐
       remove: false, //移除推荐
       submit: false, //提交
+      export:false,
       verify: false, //提交推荐权限
     },
   };
-
+  listOfColumns: any = {
+    lang: {
+      listOfFilter: [
+        { value: '中文', text: '中文' },
+        { value: '英语', text: '英语' },
+        { value: '其他外国语', text: '其他外国语' },
+        { value: '中国少数名族语言', text: '中国少数名族语言' },
+      ],
+      onChange: (data: any) => {
+        console.log(data);
+        this.filters.lang.value = data;
+        this.onFilter()
+      },
+    },
+    majorPoniter: {
+      listOfFilter: [],
+      onChange: (data: any) => {
+        console.log(data);
+        this.filters.majorPoniter.value = data;
+        this.onFilter()
+      },
+    },
+    editionUnit: {
+      listOfFilter: [],
+      onChange: (data: any) => {
+        console.log(data);
+        this.filters.editionUnit.value = data;
+        this.onFilter()
+      },
+    },
+    approval: {
+      listOfFilter: [
+        {
+          value: '基础学科“101计划”核心教材',
+          text: '基础学科“101计划”核心教材',
+        },
+        { value: '战略性新兴领域教材', text: '战略性新兴领域教材' },
+        { value: '“四新”重点建设教材', text: '“四新”重点建设教材' },
+        { value: '否', text: '否' },
+      ],
+      onChange: (data: any) => {
+        console.log(data);
+        this.filters.approval.value = data;
+        this.onFilter()
+      },
+    },
+    carrierShape: {
+      listOfFilter: [
+        { value: '纸质教材', text: '纸质教材' },
+        { value: '电子教材', text: '电子教材' },
+        { value: '纸质教材附带电子资源', text: '纸质教材附带电子资源' },
+      ],
+      onChange: (data: any) => {
+        console.log(data);
+        this.filters.carrierShape.value = data;
+        this.onFilter()
+      },
+    },
+    department: {
+      listOfFilter: [],
+      onChange: (data: any) => {
+        console.log(data);
+        this.filters.department.value = data;
+        this.onFilter()
+      },
+    },
+  };
+  //筛选条件
+  filters: filter | any = {
+    lang: { type: 'string', value: [] },
+    majorPoniter: { type: 'string', value: [] },
+    editionUnit: { type: 'string', value: [] },
+    approval: { type: 'string', value: [] },
+    carrierShape: { type: 'string', value: [] },
+    department: { type: 'pointer', value: [] },
+  };
   loading: boolean = false;
   checkedAll: boolean = false; //全选
   setOfCheckedId = new Set<string>();
   searchValue: string = '';
   manage: boolean = false;
-  eduProcessId: any = ''; //流程id,verify存在时需要
+
   constructor(
     public tbookSer: textbookServer,
     private route: Router,
@@ -70,11 +158,23 @@ export class TextbookComponent implements OnInit {
 
   ngOnInit() {
     this.activeRoute.paramMap.subscribe(async (params) => {
-      this.eduProcessId = params.get('id');
+      // this.eduProcessId = params.get('id');
       this.getTextbook();
       if (Object.values(this.filterObj.btns).some((item) => item)) {
         this.manage = true;
       }
+      if (this.filterObj.showMore) {
+        this.listOfColumns.majorPoniter.listOfFilter = major.majors.options.map(
+          (item) => {
+            return { text: item.name, value: item.name };
+          }
+        );
+        this.listOfColumns.editionUnit.listOfFilter =
+          await this.getDepartment();
+        this.listOfColumns.department.listOfFilter = await this.getDepartment(
+          true
+        );
+      }
     });
   }
   async getTextbook(val?: string, exported?: boolean): Promise<any[] | void> {
@@ -102,11 +202,18 @@ export class TextbookComponent implements OnInit {
       query = Parse.Query.or(query1, query2);
     }
     // this.uid && query.equalTo('user',this.tbookSer.profile.user?.objectId);
+    for (const key in this.filters) {
+      const element = this.filters[key];
+      if (element.value?.length > 0) {
+        query.containedIn(key, element.value);
+      }
+    }
+    this.eduProcessId && query.equalTo('eduProcess', this.eduProcessId);
     this.depart && query.equalTo('department', this.depart);
     this.recommend && query.equalTo('recommend', true);
     this.filterObj?.noStared && query.notEqualTo('recommend', true);
     this.uid && query.equalTo('user', this.uid);
-    query.descending('createdAt')
+    query.descending('createdAt');
     query.notEqualTo('isDeleted', true);
     if (!this.uid) {
       query.equalTo('render', true);
@@ -125,7 +232,7 @@ export class TextbookComponent implements OnInit {
       this.loading = false;
       return r;
     }
-    // query.include('department');
+    query.include('department');
     this.count = await query.count();
     query.limit(this.limit);
     query.skip(this.limit * (this.pageSize - 1));
@@ -134,6 +241,41 @@ export class TextbookComponent implements OnInit {
     console.log(this.textbookList);
     this.loading = false;
   }
+  async getDepartment(all?: boolean): Promise<any> {
+    let arr: { value: any; text: any }[] = [];
+    let filters = [
+      '66865e1c5d561921fb4d6764',
+      '66865deea3ac903090a7b30b',
+      '66865dac288c15c56afd80fa',
+      '66865d66ad23a23355b12aa7',
+    ];
+    if (this.tbookSer.profile.identity != '国家级管理员') {
+      filters = [this.tbookSer.profile.user?.department?.objectId];
+    }
+    let query = new Parse.Query('Department');
+    query.select('name');
+    query.notEqualTo('isDeleted', true);
+    if (all) {
+      query.containedIn('parent', filters);
+    } else {
+      query.equalTo('parent', '66865d66ad23a23355b12aa7');
+    }
+    query.limit(2000);
+    let r = await query.find();
+    r.forEach((item) => {
+      arr.push({
+        value: all ? item.id : item?.get('name'),
+        text: item?.get('name'),
+      });
+    });
+    return arr;
+  }
+  //筛选
+  onFilter(){
+    this.textbookList = []
+    this.pageSize = 1
+    this.getTextbook(this.searchValue)
+  }
   onSearch(e: string) {
     console.log(e);
     this.getTextbook(e);
@@ -180,6 +322,7 @@ export class TextbookComponent implements OnInit {
       nzOnOk: async () => {
         if (data?.id) {
           data.set('status', '300');
+          data.set('code', null);
           await data.save();
         } else {
           let selectedList = this.textbookList.filter((item: any) =>
@@ -188,6 +331,7 @@ export class TextbookComponent implements OnInit {
           let deletePromiseList = selectedList.map((item: any) => {
             return new Promise((resolve) => {
               item.set('status', '300');
+              item.set('code', null);
               item.save().then(() => resolve(true));
             });
           });
@@ -196,6 +340,7 @@ export class TextbookComponent implements OnInit {
           } catch (err) {}
         }
         this.getTextbook();
+        this.onAllChecked(false);
       },
       nzCancelText: '取消',
       nzOnCancel: () => console.log('Cancel'),
@@ -229,6 +374,7 @@ export class TextbookComponent implements OnInit {
           } catch (err) {}
         }
         this.getTextbook();
+        this.onAllChecked(false);
       },
       nzCancelText: '取消',
       nzOnCancel: () => console.log('Cancel'),
@@ -270,12 +416,14 @@ export class TextbookComponent implements OnInit {
   }
   //提交教材
   async submit(data?: Parse.Object) {
-    let parentMap = await this.tbookSer.formatNode(this.tbookSer?.profile?.user?.department?.objectId);
+    let parentMap = await this.tbookSer.formatNode(
+      this.tbookSer?.profile?.user?.department?.objectId
+    );
     console.log(parentMap);
-    let processId = await this.getEduProcess(parentMap[1]?.key)
-    if(!processId){
-      this.message.warning('你的申报单位暂无进行的流程')
-      return
+    let processId = await this.getEduProcess(parentMap[1]?.key);
+    if (!processId) {
+      this.message.warning('你的申报单位暂无进行的流程');
+      return;
     }
     this.modal.confirm({
       nzTitle: '提交教材',
@@ -285,54 +433,69 @@ export class TextbookComponent implements OnInit {
       nzOkDanger: false,
       nzOnOk: async () => {
         if (data?.id) {
+          if (data?.get('status') != '102' || data?.get('status') != '300') {
+            this.message.warning('教材信息填写不完整');
+            return;
+          }
           let t =
             this.tbookSer.formatTime('YYYYmmdd', new Date()) +
             Math.random().toString().slice(-4);
           data.set('render', true);
           data.set('status', '200');
           data.set('code', t);
-          data.set('eduProcess',{
+          data.set('eduProcess', {
             __type: 'Pointer',
             className: 'EduProcess',
-            objectId:processId
+            objectId: processId,
           });
-          if(parentMap[1]?.key){
+          if (parentMap[1]?.key) {
             data.set('department', {
               __type: 'Pointer',
               className: 'Department',
-              objectId:parentMap[1]?.key
+              objectId: parentMap[1]?.key,
             });
           }
           await data.save();
         } else {
+          let count = 0;
           let selectedList = this.textbookList.filter((item: any) =>
             this.setOfCheckedId.has(item?.id)
           );
           let deletePromiseList = selectedList.map((item: any) => {
             return new Promise((resolve) => {
-              let t =
-                this.tbookSer.formatTime('YYYYmmdd', new Date()) +
-                Math.random().toString().slice(-4);
-              item.set('render', true);
-              item.set('status', '200');
-              item.set('code', t);
-              item.set('eduProcess',{
-                __type: 'Pointer',
-                className: 'EduProcess',
-                objectId:processId
-              });
-              if(parentMap[1]?.key){
-                item.set('department', {
+              if (
+                data?.get('status') == '102' ||
+                data?.get('status') == '300'
+              ) {
+                count++;
+                let t =
+                  this.tbookSer.formatTime('YYYYmmdd', new Date()) +
+                  Math.random().toString().slice(-4);
+                item.set('render', true);
+                item.set('status', '200');
+                item.set('code', t);
+                item.set('eduProcess', {
                   __type: 'Pointer',
-                  className: 'Department',
-                  objectId:parentMap[1]?.key
+                  className: 'EduProcess',
+                  objectId: processId,
                 });
+                if (parentMap[1]?.key) {
+                  item.set('department', {
+                    __type: 'Pointer',
+                    className: 'Department',
+                    objectId: parentMap[1]?.key,
+                  });
+                }
+                item.save().then(() => resolve(true));
+              } else {
+                resolve(true);
               }
-              item.save().then(() => resolve(true));
             });
           });
           try {
             await Promise.all(deletePromiseList);
+            this.message.success('成功提交' + count + '条教材');
+            this.onAllChecked(false);
           } catch (err) {}
         }
         this.getTextbook();
@@ -341,17 +504,33 @@ export class TextbookComponent implements OnInit {
       nzOnCancel: () => console.log('Cancel'),
     });
   }
-  async getEduProcess(id:string):Promise<string|undefined>{
-    if(!id) return
-    let query = new Parse.Query('EduProcess')
-    query.equalTo('department',id)
-    query.lessThanOrEqualTo('startDate',new Date())
-    query.greaterThan('deadline',new Date())
-    query.notEqualTo('isDeleted',true)
-    query.notEqualTo('status','100')
-    query.select('objectId')
-    let res = await query.first()
-    return res?.id
+  async getEduProcess(id: string): Promise<string | undefined> {
+    if (!id) return;
+    let query = new Parse.Query('EduProcess');
+    query.equalTo('department', id);
+    query.lessThanOrEqualTo('startDate', new Date());
+    query.greaterThan('deadline', new Date());
+    query.notEqualTo('isDeleted', true);
+    query.notEqualTo('status', '100');
+    query.select('objectId');
+    let res = await query.first();
+    return res?.id;
+  }
+  //导出
+  async exportProcess(data?:Parse.Object){
+    let processId = await this.getEduProcess(this.tbookSer.profile.user?.department?.objectId);
+    Parse.Cloud.run('tbookExportReport', { processId: processId }).then(
+      (data) => {
+        console.log(data);
+        let url = data.zipUrl;
+        const a = document.createElement('a'); // 创建一个&lt;a&gt;元素
+        a.href = url; // 设置链接的href属性为要下载的文件的URL
+        a.download = '报送流程'; // 设置下载文件的名称
+        document.body.appendChild(a); // 将&lt;a&gt;元素添加到文档中
+        a.click(); // 模拟点击&lt;a&gt;元素
+        document.body.removeChild(a); // 下载后移除&lt;a&gt;元素
+      }
+    );
   }
   toUrl(url: string, param?: Object) {
     console.log(url);

+ 1 - 1
projects/textbook/src/modules/nav-admin/modules.routes.ts

@@ -15,7 +15,7 @@ import { UserCreateComponent } from './page-user/user-create/user-create.compone
 const routes: Routes = [
   {
     path: '',
-    redirectTo:'manage/process',
+    redirectTo:'manage/textbook',
     pathMatch: "full",
   },
   {

+ 5 - 3
projects/textbook/src/modules/nav-admin/page-process/page-process.component.ts

@@ -34,10 +34,12 @@ export class PageProcessComponent  implements OnInit {
   className: string | undefined;
   queryParams: any | undefined;
   fieldsArray: Array<any> | undefined;
-  filterObj:any = {
+  filterObj: any = {
+    showMore: true, //显示更多字段
+    isCheck: false,
     status: ['400'],
-    btns:{}
-  }
+    btns: {review:true},
+  };
   constructor(
     private activeRoute:ActivatedRoute,
     private router: Router,

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

@@ -1,17 +1,13 @@
 <nz-page-header>
-  <nz-breadcrumb nz-page-header-breadcrumb>
-    <nz-breadcrumb-item>国家级管理</nz-breadcrumb-item>
-    <nz-breadcrumb-item><a>报送合集</a></nz-breadcrumb-item>
-  </nz-breadcrumb>
+  <!--title-->
+  <nz-page-header-title
+    >全部教材
+    <br />
+    <div class="subtitle">
+      查看全部申报流程所提交的教材推荐表
+    </div>
+  </nz-page-header-title>
 </nz-page-header>
-<!-- <comp-table-list
-  #list
-  [schema]="EduTextbook"
-  *ngIf="className && fieldsArray"
-  [className]="className"
-  [fieldsArray]="fieldsArray"
-  [queryParams]="queryParams"
-></comp-table-list> -->
 <div class="conetent">
-  <app-textbook></app-textbook>
+  <app-textbook [filterObj]="filterObj"></app-textbook>
 </div>

+ 10 - 0
projects/textbook/src/modules/nav-admin/page-textbook/page-textbook.component.scss

@@ -1,3 +1,13 @@
+.subtitle{
+  margin-right: 12px;
+  color: #00000073;
+  font-size: 14px;
+  font-weight: normal;
+  line-height: 1.5715;
+  // overflow: hidden;
+  // white-space: nowrap;
+  // text-overflow: ellipsis;
+}
 .conetent{
   margin: 0 0 20px;
   padding: 0 24px;

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

@@ -31,7 +31,12 @@ export class PageTextbookComponent implements OnInit {
   className: string | undefined;
   queryParams: any | undefined;
   fieldsArray: Array<any> | undefined;
-
+  filterObj: any = {
+    showMore: true, //显示更多字段
+    isCheck: false,
+    status: ['400'],
+    btns: {review:true},
+  };
   constructor(
     private router: Router,
     private activeRoute: ActivatedRoute // private translate:TranslateService,

+ 1 - 1
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.scss

@@ -56,7 +56,7 @@
   justify-content: space-evenly;
   // width: 200px;
   justify-content: end;
-  padding-right: 100px;
+  // padding-right: 100px;
 }
 .upText{
   color: gray;

+ 1 - 1
projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.scss

@@ -22,5 +22,5 @@
   justify-content: space-evenly;
   // width: 200px;
   justify-content: end;
-  padding-right: 100px;
+  // padding-right: 100px;
 }

+ 3 - 15
projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.ts

@@ -7,7 +7,6 @@ import { NzRadioModule } from 'ng-zorro-antd/radio';
 import { NzUploadModule } from 'ng-zorro-antd/upload';
 import { NzTagModule } from 'ng-zorro-antd/tag';
 import { NzMessageService } from 'ng-zorro-antd/message';
-import { NzUploadChangeParam } from 'ng-zorro-antd/upload';
 import { NzModalService } from 'ng-zorro-antd/modal';
 import { textbookServer } from '../../../../services/textbook'
 import Parse from 'parse';
@@ -240,17 +239,6 @@ export class BasicInComponent implements OnInit {
     }
     this.validateForm.controls.typeNumber.updateValueAndValidity();
   }
-
-  handleChange(info: NzUploadChangeParam): void {
-    if (info.file.status !== 'uploading') {
-      console.log(info.file, info.fileList);
-    }
-    if (info.file.status === 'done') {
-      this.msg.success(`${info.file.name} file uploaded successfully`);
-    } else if (info.file.status === 'error') {
-      this.msg.error(`${info.file.name} file upload failed.`);
-    }
-  }
   upload(e: any, type:string) {
     console.log(e);
     let file = e[0];
@@ -370,9 +358,9 @@ export class BasicInComponent implements OnInit {
   async search(value: string) {
     clearTimeout(this.eduTimeout)
     this.eduTimeout = setTimeout(async() => {
-      let query = new Parse.Query('EduProcess')
-      query.equalTo('company', this.tbookSer.company)
-      query.equalTo('branch','66865d66ad23a23355b12aa7')
+      let query = new Parse.Query('Department')
+      query.notEqualTo('isDeleted',true)
+      query.equalTo('parent','66865d66ad23a23355b12aa7')
       query.contains('name',value)
       query.limit(10)
       this.eduList = await query.find()

+ 1 - 1
projects/textbook/src/modules/nav-author/components/textbook-content/textbook-content.component.scss

@@ -46,5 +46,5 @@
   justify-content: space-evenly;
   // width: 200px;
   justify-content: end;
-  padding-right: 100px;
+  // padding-right: 100px;
 }

+ 1 - 1
projects/textbook/src/modules/nav-author/components/textbook-content/textbook-content.component.ts

@@ -108,7 +108,7 @@ export class TextbookContentComponent  implements OnInit {
       }
       if (event == 'next') {
       let params: any = this.validateForm.value;
-      await this.saveEduTextbook(params, true);
+      await this.saveEduTextbook(params, false);
         this.state.emit({ type: 'next', textBook: this.eduTextbook });
       }
       // Object.values(this.validateForm.controls).forEach((control) => {

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

@@ -256,7 +256,7 @@
   </form>
   
 </div>
-<div style="width: 100%;display: flex;justify-content: space-between;padding: 30px;">
+<div style="width: 100%;display: flex;justify-content: space-between;padding: 30px 0 0;">
   <a (click)="downloadFile()">
     <span nz-icon nzType="download" nzTheme="outline"></span>
     下载本页所有附件模板

+ 1 - 1
projects/textbook/src/modules/nav-author/components/textbook-pertain/textbook-pertain.component.ts

@@ -252,7 +252,7 @@ export class TextbookPertainComponent implements OnInit {
         //   return
         // }
         let params: any = this.validateForm.value;
-        await this.saveEduTextbook(params, true);
+        await this.saveEduTextbook(params, false);
         this.state.emit({ type: 'next', textBook: this.eduTextbook });
       }
       // Object.values(this.validateForm.controls).forEach((control) => {

+ 2 - 2
projects/textbook/src/modules/nav-author/space/space.component.ts

@@ -23,7 +23,7 @@ export class SpaceComponent implements OnInit {
   active: number = 0;
   myTextBook:any = {
     isCheck:true,
-    status:['101','102'],
+    status:['101','102','300'],
     btns:{
       edit:true,//编辑
       isDelete:true, //删除权限
@@ -31,7 +31,7 @@ export class SpaceComponent implements OnInit {
     }
   }
   submitTextBook = {
-    status:['200','300','400'],
+    status:['200','400'],
     btns:{
       review:true,//编辑
     }

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

@@ -11,7 +11,7 @@ import { SubmittedComponent } from "./submitted/submitted.component";
 const routes: Routes = [
   {
     path: '',
-    redirectTo:'manage/process',
+    redirectTo:'manage/textbook',
     pathMatch: "full",
   },
   {

+ 4 - 0
projects/textbook/src/modules/nav-province-contact/page-process/page-process.component.ts

@@ -30,21 +30,25 @@ export class PageProcessComponent  implements OnInit {
   user: Parse.User | undefined;
   //待审核
   beforeFilterObj: any = {
+    showMore: true, //显示更多字段
     isCheck: true,
     noStared:true,
     status: ['200'],
     btns: {
       reject: true, //退回教材
       star: true, //移除推荐
+      export:true
     },
   };
   //已加入推荐
   afterFilterObj: any = {
+    showMore: true, //显示更多字段
     isCheck: true,
     status: ['200'],
     btns: {
       verify:true,
       remove: true, //移除推荐
+      export:true
     },
   };
 

+ 42 - 5
projects/textbook/src/modules/nav-province-contact/page-textbook/page-textbook.component.html

@@ -1,8 +1,24 @@
 <nz-page-header>
-  <nz-breadcrumb nz-page-header-breadcrumb>
-    <nz-breadcrumb-item>教材申报</nz-breadcrumb-item>
-    <nz-breadcrumb-item><a>全部教材</a></nz-breadcrumb-item>
-  </nz-breadcrumb>
+  <nz-page-header-title
+    >全部教材
+    <br />
+    <div class="subtitle">
+      查看全部申报流程所提交的教材推荐表
+    </div>
+  </nz-page-header-title>
+  <nz-page-header-extra>
+    <nz-space>
+      <button
+        style="background: #3e49b3; border: 1px #3e49b3"
+        *nzSpaceItem
+        nz-button
+        nzType="primary"
+        (click)="toUrl('/nav-province-contact/manage/submitted/' + tbookSer.profile.user.department?.objectId)"
+      >
+      提交推荐教材列表
+      </button>
+    </nz-space>
+  </nz-page-header-extra>
 </nz-page-header>
 <!-- <comp-table-list
   #list
@@ -12,6 +28,27 @@
   [fieldsArray]="fieldsArray"
   [queryParams]="queryParams"
 ></comp-table-list> -->
+<!-- <div class="conetent">
+  <app-textbook [depart]="this.tbookSer.profile.user.department?.objectId" [limit]="15" [filterObj]="filterObj"></app-textbook>
+</div> -->
 <div class="conetent">
-  <app-textbook [filterObj]="filterObj"></app-textbook>
+  <nz-tabset [(nzSelectedIndex)]="active">
+    <nz-tab nzTitle="待评审教材">
+      @if (!active) {
+        <app-textbook
+        [depart]="this.tbookSer.profile.user.department?.objectId"
+        [filterObj]="beforeFilterObj"
+      ></app-textbook>
+      }
+    </nz-tab>
+    <nz-tab nzTitle="推荐教材">
+      @if (active) {
+        <app-textbook
+        [filterObj]="afterFilterObj"
+        [recommend]="true"
+        [depart]="this.tbookSer.profile.user.department?.objectId"
+      ></app-textbook>
+      }
+    </nz-tab>
+  </nz-tabset>
 </div>

+ 26 - 1
projects/textbook/src/modules/nav-province-contact/page-textbook/page-textbook.component.scss

@@ -1,4 +1,29 @@
+.subtitle{
+  margin-right: 12px;
+  color: #00000073;
+  font-size: 14px;
+  font-weight: normal;
+  line-height: 1.5715;
+  // overflow: hidden;
+  // white-space: nowrap;
+  // text-overflow: ellipsis;
+}
 .conetent{
   margin: 0 0 20px;
   padding: 0 24px;
-}
+}
+::ng-deep .ant-page-header-heading-title {
+  white-space: normal;
+}
+::ng-deep .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
+  color: #c6233f;
+}
+::ng-deep .ant-tabs-ink-bar {
+  background: #c6233f;
+}
+::ng-deep .ant-tabs-tab:hover {
+  color: #e97488;
+}
+::ng-deep .ant-tabs-tab-btn:active {
+  color: #e97488;
+}

+ 38 - 2
projects/textbook/src/modules/nav-province-contact/page-textbook/page-textbook.component.ts

@@ -8,6 +8,10 @@ import * as Parse from 'parse';
 import { CommonModule } from '@angular/common';
 import { textbookServer } from '../../../services/textbook';
 import { TextbookComponent } from '../../../app/textbook/textbook.component';
+import { NzSpaceModule } from 'ng-zorro-antd/space';
+import { CommonCompModule } from '../../../services/common.modules';
+import { NzTabsModule } from 'ng-zorro-antd/tabs';
+
 @Component({
   selector: 'app-page-textbook',
   templateUrl: './page-textbook.component.html',
@@ -18,7 +22,10 @@ import { TextbookComponent } from '../../../app/textbook/textbook.component';
     TextbookComponent,
     CompTableListComponent,
     NzPageHeaderModule,
+    CommonCompModule,
     NzBreadCrumbModule,
+    NzSpaceModule,
+    NzTabsModule,
   ],
   standalone: true,
 })
@@ -26,15 +33,37 @@ export class PageTextbookComponent implements OnInit {
   @ViewChild(CompTableListComponent) list: CompTableListComponent | undefined;
   @Input('discard') discard: boolean = false;
   @Input('render') render: boolean = false;
+  active: number = 0;
 
   EduTextbook = EduTextbook;
   user: Parse.User | undefined;
   className: string | undefined;
   queryParams: any | undefined;
   fieldsArray: Array<any> | undefined;
-  filterObj: any = {
-    isCheck: false,
+
+  //待审核
+  beforeFilterObj: any = {
+    showMore: true, //显示更多字段
+    isCheck: true,
+    noStared: true,
+    status: ['200'],
+    btns: {
+      reject: true, //退回教材
+      star: true, //移除推荐
+      export:true
+    },
+  };
+  //已加入推荐
+  afterFilterObj: any = {
+    showMore: true, //显示更多字段
+    isCheck: true,
+    status: ['200'],
+    btns: {
+      remove: true, //移除推荐
+      export:true
+    },
   };
+
   constructor(
     public tbookSer: textbookServer,
     private router: Router,
@@ -54,4 +83,11 @@ export class PageTextbookComponent implements OnInit {
   }
 
   ngOnInit(): void {}
+  toUrl(url: string, params?: object) {
+    if (params) {
+      this.router.navigate([url, params]);
+    } else {
+      this.router.navigate([url]);
+    }
+  }
 }