Browse Source

Merge branch 'master' of http://git.fmode.cn:3000/bin/edu-textbook

ryanemax 8 months ago
parent
commit
b0361b5152

+ 229 - 63
projects/textbook/src/app/textbook/textbook.component.html

@@ -119,50 +119,139 @@
           [nzChecked]="setOfCheckedId.has(data.id)"
           (nzCheckedChange)="onItemChecked(data.id, $event)"
         ></td>
-        <td nzEllipsis (click)="toUrl(path + '/' + data.id)">
+        <td
+          nzEllipsis
+          (click)="toUrl(path + '/' + data.id)"
+          nz-popover
+          [nzPopoverContent]="contentTemplate"
+        >
           {{ data?.get("code") }}
+          <ng-template #contentTemplate>
+            <div style="max-width: 400px">
+              {{ data?.get("code") }}
+            </div>
+          </ng-template>
         </td>
         }@else {
-        <td nzEllipsis nzLeft>
+        <td nzEllipsis nzLeft nz-popover [nzPopoverContent]="contentTemplate">
           {{ data?.get("code") }}
+          <ng-template #contentTemplate>
+            <div style="max-width: 400px">
+              {{ data?.get("code") }}
+            </div>
+          </ng-template>
         </td>
         }
-        <td nzEllipsis class="activeTd" (click)="toUrl(path + '/' + data.id)">
+        <td
+          nzEllipsis
+          class="activeTd"
+          (click)="toUrl(path + '/' + data.id)"
+          nz-popover
+          [nzPopoverContent]="contentTemplate"
+        >
           {{ data?.get("title") || "-" }}
+          <ng-template #contentTemplate>
+            <div style="max-width: 400px">
+              {{ data?.get("title") || "-" }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("ISBN") + ' ' || "-" }}
-          }
+        <td
+          nzEllipsis
+          nz-popover
+          [nzPopoverContent]="contentTemplateISBN"
+          #ISBN
+        >
+          {{ fromatFiled(data?.get("childrens"), "ISBN") }}
+          <ng-template #contentTemplateISBN>
+            <div style="max-width: 400px">
+              {{ ISBN.innerText }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("author") + ' ' || "-" }}
-          }
+        <td
+          nzEllipsis
+          nz-popover
+          [nzPopoverContent]="contentTemplateauthor"
+          #author
+        >
+          {{ fromatFiled(data?.get("childrens"), "author") }}
+          <ng-template #contentTemplateauthor>
+            <div style="max-width: 400px">
+              {{ author.innerText }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("lang") + ' ' || "-" }}
-          }
+        <td
+          nzEllipsis
+          nz-popover
+          [nzPopoverContent]="contentTemplatelang"
+          #lang
+        >
+          {{ fromatFiled(data?.get("childrens"), "lang") }}
+          <ng-template #contentTemplatelang>
+            <div style="max-width: 400px">
+              {{ lang.innerText }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          {{ data?.get("majorPoniter")?.code + '/'+data?.get("majorPoniter")?.name || "-" }}
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplatemajor">
+          {{
+            (data?.get("majorPoniter")?.code || "") +
+              "/" +
+              (data?.get("majorPoniter")?.name || "")
+          }}
+          <ng-template #contentTemplatemajor>
+            <div style="max-width: 400px">
+              {{
+                (data?.get("majorPoniter")?.code || "") +
+                  "/" +
+                  (data?.get("majorPoniter")?.name || "")
+              }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("editionUnit") + ' ' || "-" }}
-          }
+        <td
+          nzEllipsis
+          nz-popover
+          [nzPopoverContent]="contentTemplateeditionUnit"
+          #editionUnit
+        >
+          {{ fromatFiled(data?.get("childrens"), "editionUnit") }}
+          <ng-template #contentTemplateeditionUnit>
+            <div style="max-width: 400px">
+              {{ editionUnit.innerText }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplateapproval">
           {{ data?.get("approval") || "-" }}
+          <ng-template #contentTemplateapproval>
+            <div style="max-width: 400px">
+              {{ data?.get("approval") || "-" }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("carrierShape") + ' ' || "-" }}
-          }
+        <td
+          nzEllipsis
+          nz-popover
+          [nzPopoverContent]="contentTemplatecarrierShape"
+          #carrierShape
+        >
+          {{ fromatFiled(data?.get("childrens"), "carrierShape") }}
+          <ng-template #contentTemplatecarrierShape>
+            <div style="max-width: 400px">
+              {{ carrierShape.innerText }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplatename">
           {{ data?.get("department")?.get("name") || "-" }}
+          <ng-template #contentTemplatename>
+            <div style="max-width: 400px">
+              {{ data?.get("department")?.get("name") || "-" }}
+            </div>
+          </ng-template>
         </td>
         <td nzEllipsis nzRight>
           @if(manage){
@@ -191,9 +280,7 @@
               <li nz-menu-item>
                 <button
                   nz-button
-                  (click)="
-                    toUrl('/common/textbook/details/' + data.id)
-                  "
+                  (click)="toUrl('/common/textbook/details/' + data.id)"
                   nzType="link"
                   style="color: #231c1f"
                 >
@@ -308,13 +395,13 @@
           (nzCheckedChange)="onAllChecked($event)"
         ></th>
         @if (!filterObj?.btns?.submit) {
-        <th nzEllipsis nzWidth="80px">申报编号</th>
+        <th nzEllipsis nzWidth="100px">申报编号</th>
         }
         <th nzEllipsis nzWidth="120px">教材名称</th>
         }@else if(filterObj?.btns?.submit){
         <th nzEllipsis nzLeft nzWidth="120px">教材名称</th>
         }@else {
-        <th nzEllipsis nzWidth="80px" nzLeft>申报编号</th>
+        <th nzEllipsis nzWidth="100px" nzLeft>申报编号</th>
         <th nzEllipsis nzWidth="120px">教材名称</th>
         }
         <th nzEllipsis nzWidth="50px">册数</th>
@@ -339,12 +426,34 @@
           (nzCheckedChange)="onItemChecked(data.id, $event)"
         ></td>
         @if (!filterObj?.btns?.submit) {
-        <td nzEllipsis class="activeTd" (click)="toUrl(path + '/' + data.id)">
+        <td
+          nzEllipsis
+          class="activeTd"
+          (click)="toUrl(path + '/' + data.id)"
+          nz-popover
+          [nzPopoverContent]="contentTemplate"
+        >
           {{ data?.get("code") }}
+          <ng-template #contentTemplate>
+            <div style="max-width: 400px">
+              {{ data?.get("code") }}
+            </div>
+          </ng-template>
         </td>
         }
-        <td nzEllipsis class="activeTd" (click)="toUrl(path + '/' + data.id)">
+        <td
+          nzEllipsis
+          class="activeTd"
+          (click)="toUrl(path + '/' + data.id)"
+          nz-popover
+          [nzPopoverContent]="contentTemplatetitle"
+        >
           {{ data?.get("title") || "-" }}
+          <ng-template #contentTemplatetitle>
+            <div style="max-width: 400px">
+              {{ data?.get("title") || "-" }}
+            </div>
+          </ng-template>
         </td>
         }@else if(filterObj?.btns?.submit){
         <td
@@ -352,53 +461,112 @@
           nzLeft
           class="activeTd"
           (click)="toUrl(path + '/' + data.id)"
+          nz-popover
+          [nzPopoverContent]="contentTemplatetitle"
         >
           {{ data?.get("title") || "-" }}
+          <ng-template #contentTemplatetitle>
+            <div style="max-width: 400px">
+              {{ data?.get("title") || "-" }}
+            </div>
+          </ng-template>
         </td>
         } @else {
-        <td nzEllipsis nzLeft>
+        <td nzLeft nz-popover [nzPopoverContent]="contentTemplate">
           {{ data?.get("code") }}
+          <ng-template #contentTemplate>
+            <div style="max-width: 400px">
+              {{ data?.get("code") || "-" }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis class="activeTd" (click)="toUrl(path + '/' + data.id)">
+        <td
+          nzEllipsis
+          class="activeTd"
+          (click)="toUrl(path + '/' + data.id)"
+          nz-popover
+          [nzPopoverContent]="contentTemplatetitle"
+        >
           {{ data?.get("title") || "-" }}
+          <ng-template #contentTemplatetitle>
+            <div style="max-width: 400px">
+              {{ data?.get("title") || "-" }}
+            </div>
+          </ng-template>
         </td>
         }
 
-        <td nzEllipsis>
+        <td
+          nzEllipsis
+          nz-popover
+          [nzPopoverContent]="contentTemplatetypeNumber"
+        >
           {{
             data?.get("type") == "单本"
               ? "单本"
-              : data?.get("typeNumber") || "-"
+              : "全册 - " + data?.get("typeNumber") || "-"
           }}
+          <ng-template #contentTemplatetypeNumber>
+            <div style="max-width: 400px">
+              {{
+                data?.get("type") == "单本"
+                  ? "单本"
+                  : "全册 - " + data?.get("typeNumber") || "-"
+              }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("author") + ' ' || "-" }}
-          }
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplateauthor" #author>
+          {{ fromatFiled(data?.get("childrens"), "author") }}
+          <ng-template #contentTemplateauthor>
+            <div style="max-width: 400px">
+              {{ author.innerText }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("unit") + ' ' || "-" }}
-          }
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplateunit" #unit>
+          {{ fromatFiled(data?.get("childrens"), "unit") }}
+          <ng-template #contentTemplateunit>
+            <div style="max-width: 400px">
+              {{ unit.innerText }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplatemajor">
           {{ data?.get("major")?.name || "-" }}
+          <ng-template #contentTemplatemajor>
+            <div style="max-width: 400px">
+              {{ data?.get("major")?.name || "-" }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("lang") + ' ' || "-" }}
-          }
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplatelang" #lang>
+          {{ fromatFiled(data?.get("childrens"), "lang") }}
+          <ng-template #contentTemplatelang>
+            <div style="max-width: 400px">
+              {{ lang.innerText }}
+            </div>
+          </ng-template>
         </td>
-
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("ISBN") + ' ' || "-" }}
-          }
+        <td nzEllipsis nz-popover [nzPopoverContent]="contentTemplateISBN" #ISBN>
+          {{ fromatFiled(data?.get("childrens"), "ISBN") }}
+          <ng-template #contentTemplateISBN>
+            <div style="max-width: 400px">
+              {{ ISBN.innerText }}
+            </div>
+          </ng-template>
         </td>
-        <td nzEllipsis>
-          @for (vul of data?.get('childrens'); track vul) {
-            {{ vul?.get("editionUnit") + ' ' || "-" }}
-          }
+        <td nzEllipsis
+          nz-popover
+          [nzPopoverContent]="contentTemplateeditionUnit"
+          #editionUnit
+        >
+          {{ fromatFiled(data?.get("childrens"), "editionUnit") }}
+          <ng-template #contentTemplateeditionUnit>
+            <div style="max-width: 400px">
+              {{ editionUnit.innerText }}
+            </div>
+          </ng-template>
         </td>
         <td nzEllipsis nzRight>
           @if(manage){
@@ -427,9 +595,7 @@
               <li nz-menu-item>
                 <button
                   nz-button
-                  (click)="
-                    toUrl('/common/textbook/details/' + data.id)
-                  "
+                  (click)="toUrl('/common/textbook/details/' + data.id)"
                   nzType="link"
                   style="color: #231c1f"
                 >

+ 137 - 110
projects/textbook/src/app/textbook/textbook.component.ts

@@ -11,6 +11,7 @@ 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';
+import { NzPopoverModule } from 'ng-zorro-antd/popover';
 interface filter {
   lang: any;
   majorPoniter: any;
@@ -30,7 +31,7 @@ interface filter {
     MatButtonModule,
     NzRadioModule,
     DatePipe,
-    NzEmptyModule,
+    NzEmptyModule,NzPopoverModule
   ],
   standalone: true,
   providers: [DatePipe],
@@ -161,6 +162,25 @@ export class TextbookComponent implements OnInit {
   calc: number = 120;
 
   showLoading: boolean = false; //全局
+  /* 格式化拓展表字段 */
+  fromatFiled(list:Array<Parse.Object>, filed:string):string{
+    let arr:Array<string|null> = []
+    let isDate = false
+    list.forEach((item:Parse.Object)=>{
+      // arr.add(item.get(filed))
+     if(Object.prototype.toString.call(item.get(filed)).indexOf('Date') != -1 || isDate){
+        arr.push(this.datePipe.transform(item.get(filed), 'yyyy-MM'))
+        isDate = true
+      }else{
+        arr.push(item.get(filed))
+      }
+    })
+    let j = Array.from(arr).join(',')
+    if(!isDate){
+      j = Array.from(new Set(arr)).join(' ')
+    }
+    return j || '-'
+  }
 
   constructor(
     public tbookSer: textbookServer,
@@ -525,7 +545,9 @@ export class TextbookComponent implements OnInit {
     }
     this.modal.confirm({
       nzTitle: '确认提交教材?',
-      nzContent: `申报书及附件已经提交,请务必确保函报材料与系统填报材料保持一致,否则不予受理`,
+      nzContent: `申报书提交后不可修改。
+      - 请在获得推荐资质后根据相关要求做好联系出版社上传教材等准备工作;并提醒、确认相应出版社到申报系统申请工作联系人账号。
+      - 请务必确保函报材料与系统填报材料保持一致,否则不予受理。`,
       nzOkText: '确认',
       nzOkType: 'primary',
       nzOkDanger: false,
@@ -808,127 +830,132 @@ export class TextbookComponent implements OnInit {
   }
   //导出表格
   async export() {
-    console.log(this.eduProcess);
-    let query = new Parse.Query('EduProcess');
-    query.equalTo('objectId', this.eduProcess?.id);
-    query.include('profileSubmitted', 'profileSubmitted.user');
-    query.select('name', 'profileSubmitted');
-    let r = await query.first();
-    let data: any = await this.getTextbook('', true);
-    let table = `<table border="1px" cellspacing="0" cellpadding="0">
-        <thead>
-        <tr>
-                <th colspan="10" style="font-size: 20px;font-family: '黑体';">“十四五”普通高等教育本科国家级规划教材推荐汇总表</th>
-            </tr>
-            <tr>
-                <th></th><th></th><th></th><th></th><th></th>
-                <th></th><th></th><th></th><th></th><th></th>
-            </tr>
-            <tr>
-                <th></th><th></th><th></th><th></th><th></th>
-                <th></th><th></th><th></th><th></th><th></th>
-            </tr>
-            <tr>
-                <th></th><th></th>
-                <th style="font-size: 12px;font-family: '黑体';text-align: left;">单位名称(公章):${r?.get(
-                  'name'
-                )}</th>
-                <th colspan="3"></th>
-                <th></th><th></th><th></th>
-            </tr>
-            <tr>
-                <th></th><th></th><th></th><th></th><th></th>
-                <th></th><th></th><th></th><th></th><th></th>
-            </tr>
-            <tr>
-                <th></th><th></th>
-                <th style="font-size: 12px;font-family: '黑体';text-align: left;">申报工作联系人:</th>
-                <th colspan="2" style="font-size: 12px;font-family: '黑体';text-align: left;">姓名 ${r
-                  ?.get('profileSubmitted')
-                  ?.get('user')
-                  ?.get('name')}</th>
-                <th colspan="2" style="font-size: 12px;font-family: '黑体';text-align: left;">电话 ${r
-                  ?.get('profileSubmitted')
-                  ?.get('user')
-                  ?.get('phone')}</th>
-                <th></th><th></th><th></th>
-            </tr>
+    if (this.showLoading) return;
+    this.showLoading = true;
+    try{
+      console.log(this.eduProcess);
+      let query = new Parse.Query('EduProcess');
+      query.equalTo('objectId', this.eduProcess?.id);
+      query.include('profileSubmitted', 'profileSubmitted.user');
+      query.select('name', 'profileSubmitted');
+      let r = await query.first();
+      let data: any = await this.getTextbook('', true);
+      let table = `<table border="1px" cellspacing="0" cellpadding="0">
+          <thead>
+          <tr>
+                  <th colspan="10" style="font-size: 20px;font-family: '黑体';">“十四五”普通高等教育本科国家级规划教材推荐汇总表</th>
+              </tr>
+              <tr>
+                  <th></th><th></th><th></th><th></th><th></th>
+                  <th></th><th></th><th></th><th></th><th></th>
+              </tr>
+              <tr>
+                  <th></th><th></th><th></th><th></th><th></th>
+                  <th></th><th></th><th></th><th></th><th></th>
+              </tr>
+              <tr>
+                  <th></th><th></th>
+                  <th style="font-size: 12px;font-family: '黑体';text-align: left;">单位名称(公章):</th>
+                  <th colspan="3" style="font-size: 12px;font-family: '黑体';text-align: left;">${r?.get('name')}</th>
+                  <th></th><th></th><th></th>
+              </tr>
+              <tr>
+                  <th></th><th></th><th></th><th></th><th></th>
+                  <th></th><th></th><th></th><th></th><th></th>
+              </tr>
+              <tr>
+                  <th></th><th></th>
+                  <th style="font-size: 12px;font-family: '黑体';text-align: left;">申报工作联系人:</th>
+                  <th colspan="2" style="font-size: 12px;font-family: '黑体';text-align: left;">姓名 ${r
+                    ?.get('profileSubmitted')
+                    ?.get('user')
+                    ?.get('name')}</th>
+                  <th colspan="2" style="font-size: 12px;font-family: '黑体';text-align: left;">电话 ${r
+                    ?.get('profileSubmitted')
+                    ?.get('user')
+                    ?.get('phone')}</th>
+                  <th></th><th></th><th></th>
+              </tr>
+              <tr>
+                  <th></th><th></th><th></th><th></th><th></th>
+                  <th></th><th></th><th></th><th></th><th></th>
+              </tr>
             <tr>
-                <th></th><th></th><th></th><th></th><th></th>
-                <th></th><th></th><th></th><th></th><th></th>
+              <th>序号</th>
+              <th>申报编号</th>
+              <th>申报教材名称</th>
+              <th>第一主编/作者</th>
+              <th>第一主编(作者)单位</th>
+              <th>申报类型</th>
+              <th>是否为重点建设教材</th>
+              <th>出版单位</th>
+              <th>初版时间</th>
+              <th>载体形式</th>
             </tr>
-          <tr>
-            <th>序号</th>
-            <th>申报编号</th>
-            <th>申报教材名称</th>
-            <th>第一主编/作者</th>
-            <th>第一主编(作者)单位</th>
-            <th>申报类型</th>
-            <th>是否为重点建设教材</th>
-            <th>出版单位</th>
-            <th>初版时间</th>
-            <th>载体形式</th>
-          </tr>
-        </thead>
-        <tbody>
-        `;
-    let _body = '';
-    for (var row = 0; row < data.length; row++) {
-      _body += '<tr>';
-      _body += '<td>';
-      _body += `${row + 1}`;
-      _body += '</td>';
+          </thead>
+          <tbody>
+          `;
+      let _body = '';
+      for (var row = 0; row < data.length; row++) {
+        _body += '<tr>';
+        _body += '<td>';
+        _body += `${row + 1}`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += `${data[row].get('code') || ''}`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += `${data[row].get('code') || ''}`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += ` &nbsp;${data[row].get('title') || '-'}`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += ` &nbsp;${data[row].get('title') || '-'}`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += `${data[row]?.get('author') || '-'}`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += `${this.fromatFiled(data[row]?.get('childrens'), 'author')}`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += `${data[row]?.get('unit') || '-'}`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += `${this.fromatFiled(data[row]?.get('childrens'), 'unit')}`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += `${
-        data[row]?.get('type') == '单本'
-          ? '单本'
-          : data[row]?.get('typeNumber') || '-'
-      }`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += `${
+          data[row]?.get('type') == '单本'
+            ? '单本'
+            :'全册 - ' + data[row]?.get('typeNumber') || '-'
+        }`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += `${data[row]?.get('approval') || '-'}`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += `${data[row]?.get('approval') || '-'}`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += `${data[row]?.get('editionUnit') || '-'}`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += `${this.fromatFiled(data[row]?.get('childrens'), 'editionUnit')}`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += `${
-        this.datePipe.transform(data[row]?.get('editionFirst'), 'yyyy-MM') ||
-        '-'
-      }`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += `${
+          this.fromatFiled(data[row]?.get('childrens'), 'editionFirst')
+        }`;
+        _body += '</td>';
 
-      _body += '<td>';
-      _body += `${data[row]?.get('carrierShape') || '-'}`;
-      _body += '</td>';
+        _body += '<td>';
+        _body += `${this.fromatFiled(data[row]?.get('childrens'), 'carrierShape')}`;
+        _body += '</td>';
 
-      _body += '</tr>';
+        _body += '</tr>';
+      }
+      table += _body;
+      table += '</tbody>';
+      table += '</table>';
+      let title = '推荐汇总表';
+      this.excel(table, `${title}.xls`);
+      this.showLoading = false;
+    }catch(err){
+      this.showLoading = false
+      this.message.error('导出超时')
     }
-    table += _body;
-    table += '</tbody>';
-    table += '</table>';
-    let title = '申报流程列表';
-    this.excel(table, `${title}.xls`);
   }
   excel(data: any, filename: string) {
     let html =

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

@@ -263,7 +263,7 @@ export class PageRoleComponent implements OnInit {
                 where: {
                   $or: [
                     {
-                      department: { $in: [childrens] },
+                      department: { $in: childrens },
                     },
                   ],
                 },

+ 11 - 5
projects/textbook/src/modules/nav-admin/page-user/page-user.component.html

@@ -85,17 +85,24 @@
           nzWidth="120px"
           [nzShowFilter]="true"
           [nzFilters]="listOfColumns.identity.listOfFilter"
-          (nzFilterChange)="onChangeFilter($event,'identity')"
+          (nzFilterChange)="onChangeFilter($event, 'identity')"
         >
           人员类型
         </th>
-        <th nzWidth="80px">认证状态</th>
+        <th
+          nzWidth="80px"
+          [nzShowFilter]="true"
+          [nzFilters]="listOfColumns.accountState.listOfFilter"
+          (nzFilterChange)="onChangeFilter($event, 'accountState')"
+        >
+          认证状态
+        </th>
         <th
           nzWidth="150px"
           nzEllipsis
           [nzShowFilter]="true"
           [nzFilters]="listOfColumns.companyType.listOfFilter"
-          (nzFilterChange)="onChangeFilter($event,'companyType')"
+          (nzFilterChange)="onChangeFilter($event, 'companyType')"
         >
           单位类型
         </th>
@@ -238,7 +245,7 @@
   <ng-container *nzModalContent>
     <div nz-row class="depart-modal">
       <div nz-col nzSpan="12">
-        <div class="row" style="margin-bottom: 6px;">
+        <div class="row" style="margin-bottom: 6px">
           <div class="label">
             选择所属部门 <span style="color: #e8353e">*</span>
           </div>
@@ -377,7 +384,6 @@
             </ng-template> -->
           </div>
         </div>
-
       </div>
     </div>
   </ng-container>

+ 21 - 5
projects/textbook/src/modules/nav-admin/page-user/page-user.component.ts

@@ -45,6 +45,13 @@ export class PageUserComponent implements OnInit {
         { value: '教师', text: '教师' },
       ],
     },
+    accountState: {
+      listOfFilter: [
+        { value: '已认证', text: '已认证' },
+        { value: '待认证', text: '待认证' },
+        { value: '已禁用', text: '已禁用' },
+      ],
+    },
     companyType: {
       listOfFilter: [
         { value: '教育部直属高校', text: '教育部直属高校' },
@@ -92,8 +99,9 @@ export class PageUserComponent implements OnInit {
   parents: Array<any> = []; //所有一级列表
   //筛选条件
   filters: any = {
-    identity: { type: 'string', value: [] },
-    companyType: { type: 'string', value: [] },
+    identity: { type: 'profile', value: [] },
+    companyType: { type: 'profile', value: [] },
+    accountState: { type: 'user', value: [] },
   };
   constructor(
     public tbookSer: textbookServer,
@@ -156,17 +164,25 @@ export class PageUserComponent implements OnInit {
       let childrens = await this.tbookSer.getChild(
         this.tbookSer.profile.user.department?.objectId
       );
-      this.tbookSer.profile.user.department;
+      // this.tbookSer.profile.user.department;
       queryParams['where']['$or'][0]['user']['$inQuery']['where'][
         'department'
       ] = {
-        $in: [childrens],
+        $in: childrens,
       };
     }
+    for (const key in this.filters) {
+      const element = this.filters[key];
+      if (element.type == 'user' && element.value?.length > 0) {
+        queryParams['where']['$or'][0]['user']['$inQuery']['where'][key] = {
+          $in: element.value,
+        };
+      }
+    }
     let query = Parse.Query.fromJSON('Profile', queryParams);
     for (const key in this.filters) {
       const element = this.filters[key];
-      if (element.value?.length > 0) {
+      if (element.type == 'profile' && element.value?.length > 0) {
         query.containedIn(key, element.value);
       }
     }

+ 43 - 9
projects/textbook/src/modules/nav-admin/user-edit/user-edit.component.html

@@ -391,10 +391,13 @@
           [nzColor]="'#efefef'"
           >{{ userDataJson.companyType }}</nz-tag
         >
-        /
-        <nz-tag [nzBordered]="false" [nzColor]="'geekblue'">{{
-          userDataJson.department?.get("name")
-        }}</nz-tag>
+        @for (item of userDataJson.node; track $index) {
+          @if($index > 0){
+            /<nz-tag [nzBordered]="false" [nzColor]="'geekblue'">{{
+              item.title
+            }}</nz-tag>
+          }
+        }
         }@else { 待选择 }
       </div>
       <!-- <div class="title">所属组织部门</div>
@@ -462,8 +465,8 @@
           <div class="value">
             <input
               nz-input
-              [ngModel]="userDataJson.department?.get('name')"
-              (ngModelChange)="provinceChange(parent, $event)"
+              [ngModel]="depTitle"
+              (ngModelChange)="getDepart(userDataJson.department?.id, $event)"
               placeholder="搜索或选择一个下方部门"
               type="text"
             />
@@ -471,6 +474,20 @@
         </div>
         <div class="select">
           <div class="bar">
+            @if (this.tbookSer.profile.identity == '国家级管理员') {
+            <a style="color: #86909c" (click)="onPre()">所有部门</a>
+            }@else {
+            <a style="color: #86909c">所有部门</a>
+            } @for (data of parentMap; track data.title) {
+            <span style="margin: 0 10px">/</span>
+            @if (this.tbookSer.profile.identity == '国家级管理员' ||
+            data?.verify) {
+            <a (click)="onPre(data, $index)">{{ data.title }}</a>
+            }@else {
+            <a style="color: #86909c">{{ data.title }}</a>
+            } }
+          </div>
+          <!-- <div class="bar">
             <a style="color: #86909c">所有部门</a>
             @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
@@ -482,9 +499,26 @@
             } }@else {
             <a style="color: #86909c">{{ data.title }}</a>
             } }
-          </div>
+          </div> -->
           <div class="tree">
-            @for (data of parentList; track $index) {
+            @if(parentList.length > 0){ @for (data of parentList; track $index)
+              {
+              <div class="li" (click)="onCheckedDepart(data)">
+                <label
+                  nz-radio
+                  [ngModel]="data.key == radio"
+                  [nzValue]="data.key"
+                  (click)="onCheckedDepart(data, true)"
+                  >{{ data.title }}</label
+                >
+                @if (!data.isLeaf) {
+                <span nz-icon nzType="right" nzTheme="outline"></span>
+                }
+              </div>
+              } }@else {
+              <nz-empty nzNotFoundContent="暂无下级部门"></nz-empty>
+              }
+            <!-- @for (data of parentList; track $index) {
             <div class="li" (click)="onCheckedDepart(data)">
               <label
                 nz-radio
@@ -497,7 +531,7 @@
               <span nz-icon nzType="right" nzTheme="outline"></span>
               }
             </div>
-            }
+            } -->
           </div>
         </div>
       </div>

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

@@ -83,6 +83,8 @@ export class UserEditComponent implements OnInit {
   };
   userType: Array<string> = ['教师', '评审专家', '高校联系人', '工作联系人'];
   provinces: Array<string> = provinces.options; //省份
+  depTitle:string = '' //关联部门标题
+  radio:string = ''
 
   constructor(
     public tbookSer: textbookServer,
@@ -116,10 +118,15 @@ export class UserEditComponent implements OnInit {
         queryProfile.equalTo('user', id);
         this.profile = await queryProfile.first();
         this.profileJson = this.profile.toJSON();
-        this.userJson.email = this.profileJson.email
+        this.userJson.email = this.profileJson.email;
         this.userDataJson = {
           companyType: this.profile?.get('companyType'),
-          department: this.user.get('department'),
+          department: {
+            id: this.user.get('department')?.id,
+            name: this.user.get('department')?.get('name'),
+            branch: this.user.get('department')?.get('branch'),
+          },
+          node: await this.tbookSer.formatNode(this.user.get('department')?.id),
         };
       }
       await this.getUnitTypes();
@@ -130,9 +137,12 @@ export class UserEditComponent implements OnInit {
         this.tbookSer.profile.identity == '工作联系人' &&
         arr.includes(this.profile.get('identity'))
       ) {
-        if(this.tbookSer.profile.companyType == '省级教育行政部门' || this.tbookSer.profile.companyType == '有关部门(单位)教育司(局)'){
+        if (
+          this.tbookSer.profile.companyType == '省级教育行政部门' ||
+          this.tbookSer.profile.companyType == '有关部门(单位)教育司(局)'
+        ) {
           this.userType = ['教师', '评审专家', '高校联系人'];
-        }else{
+        } else {
           this.userType = ['教师', '评审专家'];
         }
         this.edit = true;
@@ -189,7 +199,7 @@ export class UserEditComponent implements OnInit {
           case '删除':
             await this.profile.destroy();
             await this.user.destroy();
-            this.goUserList()
+            this.goUserList();
             break;
         }
         this.ngOnInit();
@@ -220,6 +230,8 @@ export class UserEditComponent implements OnInit {
   //切换单位类型
   onChangeType() {
     this.userDataJson.department = null;
+    this.depTitle = ''
+    this.radio = ''
   }
   //选择部门
   async showModalDepart() {
@@ -227,16 +239,23 @@ export class UserEditComponent implements OnInit {
       this.message.warning('同级身份暂无权限操作');
       return;
     }
+    this.depTitle = this.userDataJson.department.name
+    this.radio = this.userDataJson.department.id
     if (this.unitTypes.length == 0) {
       await this.getUnitTypes();
     }
-    let parent = this.unitTypes.find(
-      (item) => item.name == this.userDataJson.companyType
+    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
     );
-    if (parent?.id) {
-      this.parentMap = await this.formatNode(parent.id);
+    if (index != -1) {
+      this.parentMap.forEach((item, i) => {
+        if (i >= index) {
+          this.parentMap[i].verify = true;
+        }
+      });
     }
-    this.provinceChange(this.parentMap[this.parentMap.length - 1]?.id);
+    this.getDepart(this.parentMap[this.parentMap.length - 1]?.id);
     this.isShowModal = true;
   }
   async getUnitTypes() {
@@ -251,81 +270,144 @@ export class UserEditComponent implements OnInit {
     });
   }
   //根据所选单位类型获取对应单位
-  async provinceChange(id?: string, val?: string) {
+  async getDepart(parent?: string, val?: string) {
     let query = new Parse.Query('Department');
-    query.select('name', 'branch', 'parent');
-    if (this.tbookSer.profile.identity != '国家级管理员') {
-      query.equalTo(
-        'objectId',
-        this.tbookSer.profile?.user.department?.objectId
-      );
-    }
-    if (this.tbookSer.profile.identity == '国家级管理员' || id) {
-      query.equalTo('parent', id ? id : null);
-    }
+    query.equalTo(
+      'parent',
+      val
+        ? this.parentMap[this.parentMap.length - 1]?.key
+        : parent
+        ? parent
+        : this.tbookSer.profile.identity != '国家级管理员'
+        ? this.tbookSer.profile.user.department?.objectId
+        : null
+    );
+    query.select('code', 'name', 'branch', 'parent', 'type', 'hasChildren');
     query.limit(100);
+    query.descending('createdAt');
+    query.notEqualTo('isDeleted', true);
     val && query.contains('name', val);
-    let r = await query.find();
-    this.parentList = r;
-  }
-
-  async formatNode(id: string): Promise<Array<any>> {
-    let arr = [];
-    if (id) {
-      let query = new Parse.Query('Department');
-      query.equalTo('objectId', id);
-      query.select('parent', 'name');
-      let r = await query.first();
-      arr.push({
-        title: r?.get('name'),
-        id: r?.id,
+    let res = await query.find();
+    let nodes: any = [];
+    res.forEach((item) => {
+      nodes.push({
+        title: item.get('name'),
+        key: item.id,
+        id: item.id,
+        branch: item.get('branch'),
+        parent: item.get('parent')?.id, //上级
+        isLeaf: !item.get('hasChildren'), //是否是最下级
+        type: item.get('type'),
       });
-      if (r?.get('parent')) {
-        arr.unshift(...(await this.formatNode(r?.get('parent')?.id)));
-      }
-    }
-    return arr;
+    });
+    this.parentList = nodes;
   }
-  onCheck(e: any) {
-    console.log(e);
+  async onPre(data?: any, index?: number) {
+    if (!data) {
+      this.userDataJson.department = undefined;
+      this.depTitle = ''
+      this.radio = ''
+      await this.getDepart();
+      this.parentMap = [];
+      return;
+    }
+    if (index == this.parentMap.length - 1) {
+      if (this.parentList.length == 0) await this.getDepart(data?.key);
+      return;
+    }
+    this.parentMap.splice((index || 0) + 1);
     this.userDataJson.department = undefined;
-    this.provinceChange();
+    this.depTitle = ''
+    this.radio = ''
+    await this.getDepart(data?.key);
   }
-  parent: string = ''; //搜索时传入的id
   //选择部门
-  async onCheckedDepart(e: any) {
-    console.log(e);
-    if (e?.get('parent')?.id) {
-      this.userDataJson.department = e;
-      this.parent = e?.get('parent')?.id;
-    } else {
-      this.provinceChange(e.id);
-      this.parent = e?.id;
+  async onCheckedDepart(e: any, checked?: boolean) {
+    console.log(e, checked);
+    this.userDataJson.department = null;
+    this.depTitle = ''
+    this.parentMap = await this.tbookSer.formatNode(e.id);
+    if (this.tbookSer.profile.identity != '国家级管理员') {
+      let index = this.parentMap.findIndex(
+        (item) => this.tbookSer.profile.user.department?.objectId == item.key
+      );
+      if (index != -1) {
+        this.parentMap.forEach((item, i) => {
+          if (i >= index) {
+            this.parentMap[i].verify = true;
+          }
+        });
+      }
+    }
+    if (checked && e.branch) {
+      this.pushValue(e);
+      return
+    }
+    if (e.isLeaf) {
+      return;
+    }
+    this.radio = ''
+    await this.getDepart(e?.key);
+  }
+  pushValue(e: any) {
+    this.userDataJson.department = {
+      name: e.title,
+      branch: e.branch,
+      title: e.title,
+      id: e.key,
+    };
+    this.depTitle = e.title
+    console.log(this.depTitle);
+    this.radio = e.key
+    if (this.tbookSer.profile.identity == '国家级管理员') {
+      this.userType = this.unitTypes.some((item) => e.parent == item.id)
+        ? !e.type
+          ? ['工作联系人']
+          : ['评审专家', '工作联系人', '教师']
+        : e.type == '单位'
+        ? ['评审专家', '高校联系人', '教师']
+        : ['评审专家', '教师'];
+    } else if (this.tbookSer.profile.identity == '工作联系人') {
+      this.userType = this.unitTypes.some((item) => e.parent == item.id)
+        ? !e.type
+          ? ['评审专家', '教师', '高校联系人']
+          : ['评审专家', '教师']
+        : e.type == '单位'
+        ? ['评审专家', '高校联系人', '教师']
+        : ['评审专家', '教师'];
     }
-    this.parentMap = await this.formatNode(e.id);
   }
-  handleCancel(): void {
-    console.log('Button cancel clicked!');
+
+  async handleCancel() {
     this.userDataJson = {
       companyType: this.profile?.get('companyType'),
-      department: this.user.get('department'),
+      department: {
+        id: this.user.get('department')?.id,
+        name: this.user.get('department')?.get('name'),
+        branch: this.user.get('department')?.get('branch'),
+      },
+      node: await this.tbookSer.formatNode(this.user.get('department')?.id),
     };
+    this.depTitle = ''
+    this.radio = ''
     this.isShowModal = false;
-    this.parent = '';
   }
   async completeChange(): Promise<void> {
     if (!this.userDataJson.department?.id) {
       this.message.warning('请选择部门');
       return;
     }
-    this.userDataJson.companyType = this.userDataJson.department.get('branch');
+    this.userDataJson.companyType = this.userDataJson.department?.branch;
     this.profile?.set('companyType', this.userDataJson.companyType);
     await this.profile?.save();
-    this.user?.set('department', this.userDataJson.department?.toPointer());
+    this.user?.set('department', {
+      __type: 'Pointer',
+      className: 'Department',
+      objectId: this.userDataJson.department?.id,
+    });
     await this.user?.save();
     this.ngOnInit();
     this.isShowModal = false;
-    this.parent = '';
   }
   openUrl(url: string) {
     if (!/\.(jpg|jpeg|png|GIF|JPG|PNG)$/.test(url)) {
@@ -344,7 +426,7 @@ export class UserEditComponent implements OnInit {
   }
   /* 修改账号 */
   loading: boolean = false;
-  submitForm(type: string) {
+  async submitForm(type: string) {
     if (this.loading) return;
     this.loading = true;
     if (type == 'save') {
@@ -354,8 +436,15 @@ export class UserEditComponent implements OnInit {
       this.profileJson = this.profile.toJSON();
       this.userDataJson = {
         companyType: this.profile?.get('companyType'),
-        department: this.user.get('department'),
+        department: {
+          id: this.user.get('department')?.id,
+          name: this.user.get('department')?.get('name'),
+          branch: this.user.get('department')?.get('branch'),
+        },
+        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.loading = false;
     }
   }

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

@@ -203,6 +203,7 @@
   </div>
   <div class="author-content">
     <div class="title">5.版权信息及CIP数据(必须提供)</div>
+    <div class="text">全册中有不同版权信息及CIP数据的各分册,其附件请合并到一个PDF文件上传</div>
     <nz-form-item class="row" style="margin-bottom: 16px">
       <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>版权页截图</nz-form-label>
       <nz-form-control class="val" nzErrorTip="请上传版权页截图" style="width: 100%">

+ 8 - 5
projects/textbook/src/modules/nav-author/components/create/basic/basic.component.html

@@ -123,8 +123,9 @@
       <nz-input-group>
         <div class="basic-row">
           <nz-date-picker nzMode="month" style="flex: 1" formControlName="editionDate"></nz-date-picker>
-          <nz-input-group style="width: 100px; margin-left: 20px" [nzSuffix]="suffixTemplateInfo">
-            <input type="number" formControlName="editionNumber" nz-input placeholder="输入版次" />
+          <nz-input-group style="width: 150px; margin-left: 20px" [nzSuffix]="suffixTemplateInfo">
+            <!-- <input type="number" formControlName="editionNumber" nz-input placeholder="输入版次" /> -->
+            <nz-input-number nzBorderless formControlName="editionNumber" [nzMin]="1" [nzStep]="1"></nz-input-number>
           </nz-input-group>
           <ng-template #suffixTemplateInfo> 版 </ng-template>
         </div>
@@ -138,8 +139,9 @@
         <div class="basic-row">
           <nz-date-picker nzMode="month" style="flex: 1" formControlName="printDate"
             [nzDisabledDate]="disabledEditionDate"></nz-date-picker>
-          <nz-input-group style="width: 100px; margin-left: 20px" [nzSuffix]="suffixTemplateInfo02">
-            <input type="number" formControlName="printNumber" nz-input placeholder="输入印次" />
+          <nz-input-group style="width: 150px; margin-left: 20px" [nzSuffix]="suffixTemplateInfo02">
+            <!-- <input type="number" formControlName="printNumber" nz-input placeholder="输入印次" /> -->
+            <nz-input-number nzBorderless formControlName="printNumber" [nzMin]="1" [nzStep]="1"></nz-input-number>
           </nz-input-group>
           <ng-template #suffixTemplateInfo02> 次 </ng-template>
         </div>
@@ -152,7 +154,8 @@
     <nz-form-control nzErrorTip="请输入初版以来合计印数" [nzSm]="12" [nzXs]="12">
       <nz-input-group>
         <nz-input-group [nzSuffix]="suffixTemplateInfo03">
-          <input type="number" formControlName="printSum" nz-input placeholder="输入合计印数" />
+          <!-- <input type="number" formControlName="printSum" nz-input placeholder="输入合计印数" /> -->
+          <nz-input-number style="width: 100%" nzBorderless formControlName="printNumber" [nzMin]="1" [nzStep]="1"></nz-input-number>
         </nz-input-group>
         <ng-template #suffixTemplateInfo03> 万册 </ng-template>
       </nz-input-group>

+ 22 - 21
projects/textbook/src/modules/nav-author/components/create/basic/basic.component.ts

@@ -20,7 +20,7 @@ import { CompUploadComponent } from '../../../../../app/comp-upload/comp-upload.
 import { NzInputModule } from 'ng-zorro-antd/input';
 import * as major from '../../../../../services/majors4.map'
 import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
-
+import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
 
 @Component({
   selector: 'app-one',
@@ -36,7 +36,7 @@ import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
     NzInputModule,
     NzTagModule,
     CompUploadComponent,
-    NzCheckboxModule,
+    NzCheckboxModule,NzInputNumberModule
   ],
 })
 export class BasicComponent implements OnInit {
@@ -134,22 +134,24 @@ export class BasicComponent implements OnInit {
     //   importantProjectOther: [this.eduTextbookVolume?.get('importantProjectOther') || ''],
     //   unitType: [this.eduTextbookVolume?.get('unitType') || '', [Validators.required]],
     // });
-    this.validateForm.get("ISBN")?.setValue(Number(this.eduTextbookVolume?.get('ISBN')))
-    this.validateForm.get("author")?.setValue(this.eduTextbookVolume?.get('author'))
-    this.validateForm.get("unit")?.setValue(this.eduTextbookVolume?.get('unit'))
-    this.validateForm.get("lang")?.setValue(this.eduTextbookVolume?.get('lang'))
-    this.validateForm.get("authors")?.setValue(this.eduTextbookVolume?.get('authors'))
-    this.validateForm.get("editor")?.setValue(this.eduTextbookVolume?.get('editor'))
-    this.validateForm.get("editionUnit")?.setValue(this.eduTextbookVolume?.get('editionUnit'))
-    this.validateForm.get("editionFirst")?.setValue(this.eduTextbookVolume?.get('editionFirst'))
-    this.validateForm.get("carrierShape")?.setValue(this.eduTextbookVolume?.get('carrierShape'))
-    this.validateForm.get("editionDate")?.setValue(this.eduTextbookVolume?.get('editionDate'))
-    this.validateForm.get("editionNumber")?.setValue(this.eduTextbookVolume?.get('editionNumber'))
-    this.validateForm.get("printDate")?.setValue(this.eduTextbookVolume?.get('printDate'))
-    this.validateForm.get("printNumber")?.setValue(this.eduTextbookVolume?.get('printNumber'))
-    this.validateForm.get("printSum")?.setValue(this.eduTextbookVolume?.get('printSum'))
-    this.validateForm.get("importantProjectOther")?.setValue(this.eduTextbookVolume?.get('importantProjectOther'))
-    this.validateForm.get("unitType")?.setValue(this.eduTextbookVolume?.get('unitType'))
+    if(this.eduTextbookVolume?.id){
+      this.validateForm.get("ISBN")?.setValue(Number(this.eduTextbookVolume?.get('ISBN')))
+      this.validateForm.get("author")?.setValue(this.eduTextbookVolume?.get('author'))
+      this.validateForm.get("unit")?.setValue(this.eduTextbookVolume?.get('unit'))
+      this.validateForm.get("lang")?.setValue(this.eduTextbookVolume?.get('lang'))
+      this.validateForm.get("authors")?.setValue(this.eduTextbookVolume?.get('authors'))
+      this.validateForm.get("editor")?.setValue(this.eduTextbookVolume?.get('editor'))
+      this.validateForm.get("editionUnit")?.setValue(this.eduTextbookVolume?.get('editionUnit'))
+      this.validateForm.get("editionFirst")?.setValue(this.eduTextbookVolume?.get('editionFirst'))
+      this.validateForm.get("carrierShape")?.setValue(this.eduTextbookVolume?.get('carrierShape'))
+      this.validateForm.get("editionDate")?.setValue(this.eduTextbookVolume?.get('editionDate'))
+      this.validateForm.get("editionNumber")?.setValue(this.eduTextbookVolume?.get('editionNumber'))
+      this.validateForm.get("printDate")?.setValue(this.eduTextbookVolume?.get('printDate'))
+      this.validateForm.get("printNumber")?.setValue(this.eduTextbookVolume?.get('printNumber'))
+      this.validateForm.get("printSum")?.setValue(this.eduTextbookVolume?.get('printSum'))
+      this.validateForm.get("importantProjectOther")?.setValue(this.eduTextbookVolume?.get('importantProjectOther'))
+      this.validateForm.get("unitType")?.setValue(this.eduTextbookVolume?.get('unitType'))
+    }
   }
   public isComlpete:boolean = false //填写是否完整
   async submitForm(eduTextbookId?:any):Promise<string|undefined> {
@@ -209,12 +211,12 @@ export class BasicComponent implements OnInit {
   async autoCompleteByISBN() {
     let isbn = this.validateForm.value?.ISBN;
     let result = await Parse.Cloud.run("tbookISBN", {
-      isbn: isbn
+      isbn: String(isbn)
     })
     if (!result?.isbn) {
       this.msg.warning('未找到该书号的图书信息,请手动填写')
     }
-
+    console.log(result)
     // 其他字段,需补充接口与数据库对应关系
     this.validateForm.get("author")?.setValue(result?.author_name)
     this.validateForm.get("authors")?.setValue(result?.author)
@@ -222,7 +224,6 @@ export class BasicComponent implements OnInit {
     this.validateForm.get("editionUnit")?.setValue(result?.publisher)
     this.validateForm.get("editionDate")?.setValue(new Date(result?.publish_time))
     this.validateForm.get("carrierShape")?.setValue(result?.publication_class)
-    console.log(result)
   }
   /**出版时间及版次不可选择时间 */
   disabledEditionDate = (current: Date): boolean => {

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

@@ -309,7 +309,7 @@ export class PageRoleComponent implements OnInit {
                 where: {
                   $or: [
                     {
-                      department: { $in: [childrens] },
+                      department: { $in: childrens },
                     },
                   ],
                 },

+ 3 - 3
projects/textbook/src/modules/nav-province-contact/submitted/export-file/export-file.component.html

@@ -16,15 +16,15 @@
 <div class="manage">
   <div class="left">
     <div class="row">
-      <div class="lable">推荐教材限额</div>
+      <div class="lable">推荐限额内申报数</div>
       <div class="val">{{otherCount}}</div>
     </div>
     <div class="row">
-      <div class="lable">推荐限额额外推荐教材</div>
+      <div class="lable">推荐限额外申报数</div>
       <div class="val">{{allCount - otherCount}}</div>
     </div>
     <div class="row">
-      <div class="lable">推荐表总份数</div>
+      <div class="lable">申报书总份数</div>
       <div class="val">{{allCount}}</div>
     </div>
   </div>

+ 94 - 67
projects/textbook/src/services/textbook.ts

@@ -58,6 +58,7 @@ export class textbookServer {
   }
   //格式化链
   async formatNode(id: string): Promise<Array<any>> {
+    if(!id) return []
     let query = new Parse.Query('Department');
     query.select('name', 'parent', 'hasChildren', 'type', 'branch');
     let r = await query.get(id);
@@ -220,7 +221,47 @@ export class textbookServer {
 
   /* 批量预设(临时) */
   async saveProcess() {
-    // let count = 0
+    let count = 0
+    /* 批量关联流程管理员 */
+    // let queryEdupro = new Parse.Query('EduProcess')
+    // queryEdupro.select('department','name')
+    // queryEdupro.equalTo('profileSubmitted',null)
+    // queryEdupro.limit(1000)
+    // let res = await queryEdupro.find()
+    // console.log(res);
+    // for (let index = 0; index < res.length; index++) {
+    //   const item = res[index];
+    //   let queryParams: any = {
+    //     where: {
+    //       $or: [
+    //         {
+    //           user: {
+    //             $inQuery: {
+    //               where: {
+    //                "department":item?.get('department')?.id,
+    //                "accountState":'已认证',
+    //               },
+    //               className: '_User',
+    //             },
+    //           },
+    //         },
+    //       ],
+    //     },
+    //   };
+    //   let query = Parse.Query.fromJSON('Profile', queryParams);
+    //   query.equalTo('identity','工作联系人')
+    //   query.select('objectId')
+    //   let p = await query.first()
+    //   if(p?.id){
+    //     item.set('profileSubmitted',p.toPointer())
+    //     await item.save()
+    //     console.log('绑定成功'+p.id+':'+item?.get('name'));
+    //     count++
+    //   }
+    // }
+    // console.log(count);
+
+    /* 开始时间 */
     // let query = new Parse.Query('EduTextbook')
     // // query.equalTo('num',null)
     // query.notEqualTo('isDeleted',true)
@@ -238,6 +279,8 @@ export class textbookServer {
     //     await item.save()
     //     console.log(count);
     // }
+
+    /* 修改更新部门名称 */
     // let list = updateDept.list2
     // for (let index = 0; index < list.length; index++) {
     //   const item = list[index]
@@ -264,72 +307,56 @@ export class textbookServer {
     //   }
     // }
 
-    // let query = new Parse.Query('Department')
-    // query.equalTo('branch', '中央有关部门教育司')
-    // query.limit(2000);
-    // let r = await query.find()
-    // console.log(r);
-    // for (let index = 0; index < r.length; index++) {
-    //   const element = r[index];
-    //   element.set('branch', '有关部门(单位)教育司(局)')
-    //   await element.save()
-    //   count++
-    //   console.log(count);
-    // }
-      // let query = new Parse.Query('Department')
-      // query.equalTo('parent',null)
-      // query.equalTo('name','省级教育行政部门')
-      // let r = await query.find()
-      // let addCount = 0
-      // let list = updateDept.list3
-      // for (let index = 0; index < list.length; index++) {
-      //   const item = list[index];
-      //   let queryPareet = new Parse.Query('Department')
-      //   queryPareet.equalTo('name', item.name)
-      //   let dep = await queryPareet.first()
-      //   console.log(dep?.get('name'));
+    /* 批量导入部门 */
+    // let list = updateDept.list3
+    // for (let index = 0; index < list.length; index++) {
+    //   const item = list[index];
+    //   let queryPareet = new Parse.Query('Department')
+    //   queryPareet.equalTo('name', item.name)
+    //   let dep = await queryPareet.first()
+    //   console.log(dep?.get('name'));
+      
+    //   // for (let index = 0; index < prents.length; index++) {
+    //   //   let item = prents[index];
+    //     let query = new Parse.Query('EduProcess')
+    //     query.equalTo('department',dep?.id)
+    //     query.notEqualTo('isDeleted',true)
+    //     let eduProcess = await query.first()
+    //     if(!eduProcess?.id){
+    //       console.log('不存在,新建'+dep?.get('name'),addCount);
+    //       let obj = Parse.Object.extend('EduProcess');
+    //       eduProcess = new obj()
+    //     }
+    //     eduProcess?.set('company', {
+    //       __type: 'Pointer',
+    //       className: 'Company',
+    //       objectId: 'RbIKpmuaMC',
+    //     });
+    //     eduProcess?.set('branch', {
+    //       __type: 'Pointer',
+    //       className: 'Department',
+    //       objectId:dep?.get('parent')?.id,
+    //     });
+    //     eduProcess?.set('department', {
+    //       __type: 'Pointer',
+    //       className: 'Department',
+    //       objectId: dep?.id,
+    //     });
+    //     eduProcess?.set('name', dep?.get('name'));
+    //     eduProcess?.set('desc',item.desc ? item.desc : dep?.get('name') + '流程');
+    //     eduProcess?.set('code', dep?.get('code') || dep?.id);
+    //     if(dep?.get('branch') == '出版单位') {
+    //       eduProcess?.set('startDate', new Date('2024-07-20 18:00'));
+    //       eduProcess?.set('deadline', new Date('2024-09-20 18:00'));
+    //     }
+    //     eduProcess?.set('num',item.num)
+    //     eduProcess?.set('status', '200');
+    //     await eduProcess?.save();
+    //     count ++
+    //     console.log('已完成'+dep?.get('name')+'流程');
+    //     console.log(count);
         
-      //   // for (let index = 0; index < prents.length; index++) {
-      //   //   let item = prents[index];
-      //     let query = new Parse.Query('EduProcess')
-      //     query.equalTo('department',dep?.id)
-      //     query.notEqualTo('isDeleted',true)
-      //     let eduProcess = await query.first()
-      //     if(!eduProcess?.id){
-      //       console.log('不存在,新建'+dep?.get('name'),addCount);
-      //       let obj = Parse.Object.extend('EduProcess');
-      //       eduProcess = new obj()
-      //     }
-      //     eduProcess?.set('company', {
-      //       __type: 'Pointer',
-      //       className: 'Company',
-      //       objectId: 'RbIKpmuaMC',
-      //     });
-      //     eduProcess?.set('branch', {
-      //       __type: 'Pointer',
-      //       className: 'Department',
-      //       objectId:dep?.get('parent')?.id,
-      //     });
-      //     eduProcess?.set('department', {
-      //       __type: 'Pointer',
-      //       className: 'Department',
-      //       objectId: dep?.id,
-      //     });
-      //     eduProcess?.set('name', dep?.get('name'));
-      //     eduProcess?.set('desc',item.desc ? item.desc : dep?.get('name') + '流程');
-      //     eduProcess?.set('code', dep?.get('code') || dep?.id);
-      //     if(dep?.get('branch') == '出版单位') {
-      //       eduProcess?.set('startDate', new Date('2024-07-20 18:00'));
-      //       eduProcess?.set('deadline', new Date('2024-09-20 18:00'));
-      //     }
-      //     eduProcess?.set('num',item.num)
-      //     eduProcess?.set('status', '200');
-      //     await eduProcess?.save();
-      //     count ++
-      //     console.log('已完成'+dep?.get('name')+'流程');
-      //     console.log(count);
-          
-      //   // }
-      // }
+    //   // }
+    // }
   }
 }