xll 7 months ago
parent
commit
30ceb97272

+ 2 - 2
projects/textbook/src/modules/nav-author/apply/apply.component.html

@@ -9,8 +9,8 @@
   <div class="steps">
     <nz-steps [nzCurrent]="state">
       <nz-step nzTitle="填写基本信息" nzDescription=""></nz-step>
-      <nz-step nzTitle="填写材适用情况" nzDescription=""></nz-step>
-      <nz-step nzTitle="填写材内容" nzDescription=""></nz-step>
+      <nz-step nzTitle="填写材适用情况" nzDescription=""></nz-step>
+      <nz-step nzTitle="填写材内容" nzDescription=""></nz-step>
       <nz-step nzTitle="上传附件及承诺" nzDescription=""></nz-step>
     </nz-steps>
   </div>

+ 47 - 485
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.html

@@ -1,225 +1,11 @@
 <div class="entry">
-  <form
-    nz-form
-    [formGroup]="validateForm"
-    class="login-form"
-    (ngSubmit)="submitForm()"
-  >
-    <!-- <div class="author-content">
-      <div class="title">教材电子版</div>
-      <div class="text">
-        教材出版单位配合按要求上传各地推荐的本单位出版的纸质教材最新印次的完整PDF电子版;数字教材上传全部教材内容电子版或填写能够查看全部教材内容的链接地址、账号;纸质教材附带数字资源的,上传纸质教材最新印次的完整PDF电子版,以及全部数字资源电子版或能够查看全部数字资源内容的链接地址、账号
-      </div>
-
-      <nz-checkbox-group  //nz-checkbox-group注释
-        style="margin: 10px 0"
-        formControlName="textbookTypes"
-        [(ngModel)]="checkOptionsOne"
-      ></nz-checkbox-group>
-
-      <label nz-checkbox [ngModelOptions]="{ standalone: true }" [ngModel]="true">纸质教材</label>
-      <label nz-checkbox [ngModelOptions]="{ standalone: true }" [ngModel]="true">电子教材 / 资源</label>
-      <div nz-row>
-        <div nz-col nzSpan="12">
-          <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%"
-            >
-              <nz-upload
-                formControlName="textbookFiles"
-                nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                [nzHeaders]="{ authorization: 'authorization-text' }"
-                (nzChange)="handleChange($event)"
-              >
-                <div style="color: #3e49b3">
-                  <span nz-icon nzType="upload"></span>上传教材
-                </div>
-              </nz-upload>
-              <div class="text upText" style="margin: 10px 0">
-                支持批量上传 PDF、EPUB、AZW3、Mp4,单个文件小于 2M
-              </div>
-            </nz-form-control>
-          </nz-form-item>
-        </div>
-        <div nz-col nzSpan="12">
-          <nz-form-item class="row" style="margin-bottom: 16px">
-            <nz-form-label
-              class="label"
-              [nzNoColon]="true"
-              [nzSm]="18"
-              [nzXs]="18"
-              nzRequired
-              >填写教材数字内容链接地址、账号</nz-form-label
-            >
-            <nz-form-control
-              class="val"
-              nzErrorTip="请填写数字内容链接地址、账号,每项内容使用回车键分隔"
-              style="width: 100%"
-            >
-              <nz-textarea-count [nzMaxCharacterCount]="1000">
-                <textarea
-                  style="min-height: 160px"
-                  rows="4"
-                  formControlName="links"
-                  placeholder="请填写数字内容链接地址、账号,每项内容使用回车键分隔"
-                  nz-input
-                ></textarea>
-              </nz-textarea-count>
-            </nz-form-control>
-          </nz-form-item>
-        </div>
-      </div>
-    </div> -->
-
-
-
-
-
-
-
-
-
-
-    <!-- <div class="author-content">
-      <div class="title">所有作者政治审查意见</div>
-      <div class="text">
-        从本申报平台<a>下载格式要求</a>后,对应作者姓名上传“作者政治审查表”,支持
-        PDF、JPG、JPEG、PNG 格式,大小不超过
-        2M。作者单位党委对作者进行审查,对政治思想表现情况进行评价,确保作者的正确政治方向、价值取向,无违法违纪等记录。教材编写成员涉及多个不同单位时需要各单位分别出具意见,并由所在单位党委盖章。
-      </div>
-
-      <nz-table
-        #basicTable
-        [nzData]="opinions"
-        [nzScroll]="{ x: (maxWidth || '1200') + 'px' }"
-      >
-        <thead>
-          <tr>
-            <th nzWidth="80px" nzLeft nzAlign="right">序号</th>
-            <th nzWidth="120px">姓名</th>
-            <th nzWidth="120px">单位</th>
-            <th nzWidth="120px">出生年月</th>
-            <th nzWidth="120px">国籍</th>
-            <th nzWidth="120px" nzRight>
-              <nz-form-label [nzNoColon]="true" nzRequired
-                >作者政治审查表</nz-form-label
-              >
-            </th>
-            <th nzWidth="80px" nzRight>操作</th>
-          </tr>
-        </thead>
-        <tbody>
-          @for (data of opinions; track $index) {
-          <tr>
-            <td nzLeft nzAlign="right">{{ $index + 1 }}</td>
-            <td>
-              <input
-                nz-input
-                type="text"
-                placeholder="请填写作者姓名"
-                [ngModelOptions]="{ standalone: true }"
-                [(ngModel)]="data.name"
-                nzStatus=""
-              />
-            </td>
-            <td>
-              <input
-                nz-input
-                type="text"
-                placeholder="请填写作者单位"
-                [ngModelOptions]="{ standalone: true }"
-                [(ngModel)]="data.unit"
-                nzStatus=""
-              />
-            </td>
-            <td>
-              <nz-date-picker
-                nzMode="month"
-                [ngModelOptions]="{ standalone: true }"
-                [(ngModel)]="data.birth"
-              ></nz-date-picker>
-            </td>
-            <td>
-              <input
-                nz-input
-                type="text"
-                placeholder="请填写作者国籍"
-                [ngModelOptions]="{ standalone: true }"
-                [(ngModel)]="data.nationality"
-                nzStatus=""
-              />
-            </td>
-            <td nzRight>
-              <nz-upload
-                nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                [nzHeaders]="{ authorization: 'authorization-text' }"
-                (nzChange)="handleChange($event)"
-              >
-                <div style="color: #3e49b3">
-                  <span nz-icon nzType="upload"></span>上传文件
-                </div>
-              </nz-upload>
-            </td>
-            <td nzRight>
-              <a class="edit-icon" (click)="onPush('opinions', $index)"
-                ><span
-                  nz-icon
-                  style="font-size: 20px; margin-right: 10px"
-                  nzType="plus-circle"
-                  nzTheme="outline"
-                ></span
-              ></a>
-              <a class="edit-icon" (click)="onDel('opinions', $index)"
-                ><span
-                  nz-icon
-                  style="font-size: 20px"
-                  nzType="delete"
-                  nzTheme="outline"
-                ></span
-              ></a>
-            </td>
-          </tr>
-          }
-        </tbody>
-      </nz-table>
-    </div> -->
-
-
-
-
-
-
-
-
-
+  <!-- <form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()"> -->
     <div class="author-content">
       <div class="title">教材版权信息</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%"
-        >
-        <app-comp-upload [width]="320" (change)="upload($event, 'copyrightImgUrl')" title="上传截图"></app-comp-upload>
+        <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>版权页截图</nz-form-label>
+        <nz-form-control class="val" nzErrorTip="请上传版权页截图" style="width: 100%">
+          <app-comp-upload [width]="320" (change)="upload($event, 'copyrightImgUrl')" title="上传截图"></app-comp-upload>
 
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
@@ -227,29 +13,10 @@
         </nz-form-control>
       </nz-form-item>
       <nz-form-item class="row" style="margin-bottom: 16px">
-        <nz-form-label
-          class="label"
-          [nzNoColon]="true"
-          [nzSm]="10"
-          [nzXs]="10"
-          nzRequired
-          >中国版本图书馆 CIP 查询截图</nz-form-label
-        >
-        <nz-form-control
-          class="val"
-          nzErrorTip="请上传中国版本图书馆 CIP 查询截图"
-          style="width: 100%"
-        >
-          <!-- <nz-upload
-            formControlName="selfResults"
-            nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-            [nzHeaders]="{ authorization: 'authorization-text' }"
-            (nzChange)="handleChange($event)"
-          >
-            <div style="color: #3e49b3">
-              <span nz-icon nzType="upload"></span>上传文件
-            </div>
-          </nz-upload> -->
+        <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>中国版本图书馆 CIP
+          查询截图</nz-form-label>
+        <nz-form-control class="val" nzErrorTip="请上传中国版本图书馆 CIP 查询截图" style="width: 100%">
+
           <app-comp-upload [width]="320" (change)="upload($event, 'CIPImgUrl')" title="上传截图"></app-comp-upload>
 
           <div class="text upText" style="margin: 10px 0">
@@ -261,34 +28,20 @@
     <div class="author-content">
       <div class="title">图书编校质量自查结果记录表</div>
       <div class="text">
-        教材出版单位对申报教材的编校质量自查后,按要求提供图书编校质量自查结果记录表,并加盖出版社公章。全册教材的不同分册以不同文件分别上传。<a
-          >下载模板</a
-        >
+        教材出版单位对申报教材的编校质量自查后,按要求提供图书编校质量自查结果记录表,并加盖出版社公章。全册教材的不同分册以不同文件分别上传。<a>下载模板</a>
       </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%"
-        >
-          <nz-upload
-            formControlName="selfResults"
-            nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-            [nzHeaders]="{ authorization: 'authorization-text' }"
-            (nzChange)="handleChange($event)"
-          >
+        <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10"
+          nzRequired>上传图书编校质量自查结果记录表</nz-form-label>
+        <nz-form-control class="val" nzErrorTip="请上图书编校质量自查结果记录表" style="width: 100%">
+          <!-- <nz-upload formControlName="selfResults" nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+            [nzHeaders]="{ authorization: 'authorization-text' }" (nzChange)="handleChange($event)">
             <div style="color: #3e49b3">
               <span nz-icon nzType="upload"></span>上传文件
             </div>
-          </nz-upload>
+          </nz-upload> -->
+          <app-comp-upload [width]="320" (change)="upload($event, 'selfResults')" title="上传截图"></app-comp-upload>
+
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
           </div>
@@ -300,34 +53,19 @@
       <div class="text">
         由第一主编所在单位和出版机构邀请校内外相关学科专业领域专家,对教材进行思想性、学术性审核。专家不少于
         3
-        名,其中半数以上为校外专家,专家分别实名评价并签字,并注明所在单位及专业身份。评价人不得是本教材的作者。<a
-          >下载模板</a
-        >
+        名,其中半数以上为校外专家,专家分别实名评价并签字,并注明所在单位及专业身份。评价人不得是本教材的作者。<a>下载模板</a>
       </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%"
-        >
-          <nz-upload
-            formControlName="expertOpinion"
-            nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-            [nzHeaders]="{ authorization: 'authorization-text' }"
-            (nzChange)="handleChange($event)"
-          >
+        <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>上传专家审核意见表</nz-form-label>
+        <nz-form-control class="val" nzErrorTip="请上传专家审核意见表" style="width: 100%">
+          <!-- <nz-upload formControlName="expertOpinion" nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+            [nzHeaders]="{ authorization: 'authorization-text' }" (nzChange)="handleChange($event)">
             <div style="color: #3e49b3">
               <span nz-icon nzType="upload"></span>上传文件
             </div>
-          </nz-upload>
+          </nz-upload> -->
+          <app-comp-upload [width]="320" (change)="upload($event, 'expertOpinion')" title="上传截图"></app-comp-upload>
+
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个大小不超过 2M
           </div>
@@ -337,34 +75,19 @@
     <div class="author-content">
       <div class="title">教材使用情况证明材料</div>
       <div class="text">
-        教材出版单位提供教材主要使用高校名单及使用情况证明材料,并加盖公章。<a
-          >下载模板</a
-        >
+        教材出版单位提供教材主要使用高校名单及使用情况证明材料,并加盖公章。<a>下载模板</a>
       </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%"
-        >
-          <nz-upload
-            formControlName="evidence"
-            nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-            [nzHeaders]="{ authorization: 'authorization-text' }"
-            (nzChange)="handleChange($event)"
-          >
+        <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>教材使用情况证明材料</nz-form-label>
+        <nz-form-control class="val" nzErrorTip="请上教材使用情况证明材料" style="width: 100%">
+          <!-- <nz-upload formControlName="evidence" nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+            [nzHeaders]="{ authorization: 'authorization-text' }" (nzChange)="handleChange($event)">
             <div style="color: #3e49b3">
               <span nz-icon nzType="upload"></span>上传文件
             </div>
-          </nz-upload>
+          </nz-upload> -->
+          <app-comp-upload [width]="320" (change)="upload($event, 'evidence')" title="上传截图"></app-comp-upload>
+
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
           </div>
@@ -375,153 +98,14 @@
       <div class="title">其他材料</div>
       <div class="text">其他佐证材料。</div>
 
-      <!-- <nz-upload
-        formControlName="moreMaterial"
-        nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-        [nzHeaders]="{ authorization: 'authorization-text' }"
-        (nzChange)="handleChange($event)"
-      >
-        <div style="color: #3e49b3">
-          <span nz-icon nzType="upload"></span>上传文件
-        </div>
-      </nz-upload> -->
+
       <app-comp-upload [width]="320" (change)="upload($event, 'moreMaterial')" title="上传截图"></app-comp-upload>
 
       <div class="text upText" style="margin: 10px 0">
         支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
       </div>
     </div>
-    <!-- <div class="author-content">
-      <div class="nav">教材作者诚信承诺</div>
-      <div class="text">请填写作者诚信承诺文字内容,并上传所有作者签名</div>
-      <nz-form-item class="row" style="margin-bottom: 16px">
-        <nz-form-label
-          class="label"
-          [nzNoColon]="true"
-          [nzSm]="16"
-          [nzXs]="16"
-          nzRequired
-          >填写诚信承诺:本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实</nz-form-label
-        >
-        <nz-form-control
-          class="val"
-          nzErrorTip="请填写承诺内容"
-          style="width: 450px"
-        >
-          <input
-            formControlName="accept"
-            placeholder="请填写承诺内容"
-            nz-input
-          />
-        </nz-form-control>
-      </nz-form-item>
-    </div> -->
 
-    
-    <!-- <div class="author-content">
-      <nz-form-label
-        class="label"
-        [nzNoColon]="true"
-        [nzSm]="16"
-        [nzXs]="16"
-        nzRequired
-        >上传所有作者签名,支持 PDF、PNG 格式,文件大小不超过 1M</nz-form-label
-      >
-      <nz-table
-        #basicTable
-        [nzData]="authorSign"
-        [nzScroll]="{ x: (maxWidth || '1200') + 'px' }"
-      >
-        <thead>
-          <tr>
-            <th nzWidth="80px" nzLeft nzAlign="right">序号</th>
-            <th nzWidth="120px">姓名</th>
-            <th nzWidth="120px">单位</th>
-            <th nzWidth="120px">出生年月</th>
-            <th nzWidth="120px">国籍</th>
-            <th nzWidth="120px" nzRight>
-              <nz-form-label [nzNoColon]="true" nzRequired
-                >作者政治审查表</nz-form-label
-              >
-            </th>
-            <th nzWidth="80px" nzRight>操作</th>
-          </tr>
-        </thead>
-        <tbody>
-          @for (data of authorSign; track $index) {
-          <tr>
-            <td nzLeft nzAlign="right">{{ $index + 1 }}</td>
-            <td>
-              <input
-                nz-input
-                type="text"
-                placeholder="请填写作者姓名"
-                [ngModelOptions]="{ standalone: true }"
-                [(ngModel)]="data.name"
-                nzStatus=""
-              />
-            </td>
-            <td>
-              <input
-                nz-input
-                type="text"
-                placeholder="请填写作者单位"
-                [ngModelOptions]="{ standalone: true }"
-                [(ngModel)]="data.unit"
-                nzStatus=""
-              />
-            </td>
-            <td>
-              <nz-date-picker
-                nzMode="month"
-                [ngModelOptions]="{ standalone: true }"
-                [(ngModel)]="data.birth"
-              ></nz-date-picker>
-            </td>
-            <td>
-              <input
-                nz-input
-                type="text"
-                placeholder="请填写作者国籍"
-                [ngModelOptions]="{ standalone: true }"
-                [(ngModel)]="data.nationality"
-                nzStatus=""
-              />
-            </td>
-            <td nzRight>
-              <nz-upload
-                nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                [nzHeaders]="{ authorization: 'authorization-text' }"
-                (nzChange)="handleChange($event)"
-              >
-                <div style="color: #3e49b3">
-                  <span nz-icon nzType="upload"></span>上传文件
-                </div>
-              </nz-upload>
-            </td>
-            <td nzRight>
-              <a class="edit-icon" (click)="onPush('authorSign', $index)"
-                ><span
-                  nz-icon
-                  style="font-size: 20px; margin-right: 10px"
-                  nzType="plus-circle"
-                  nzTheme="outline"
-                ></span
-              ></a>
-              <a class="edit-icon" (click)="onDel('authorSign', $index)"
-                ><span
-                  nz-icon
-                  style="font-size: 20px"
-                  nzType="delete"
-                  nzTheme="outline"
-                ></span
-              ></a>
-            </td>
-          </tr>
-          }
-        </tbody>
-      </nz-table>
-    </div> -->
     <div class="author-content">
       <div class="nav"><b>申报单位承诺意见</b></div>
       <div class="text">
@@ -530,53 +114,31 @@
         / 出版单位公章后上传此项。<a>下载模板</a>
       </div>
       <nz-form-item class="row" style="margin-bottom: 16px">
-        <nz-form-label
-          class="label"
-          [nzNoColon]="true"
-          [nzSm]="16"
-          [nzXs]="16"
-          nzRequired
-          >申报单位承诺意见材料</nz-form-label
-        >
-        <nz-form-control
-          class="val"
-          nzErrorTip="请上传申报单位承诺意见材料"
-          style="width: 450px"
-        >
-          <nz-upload
-            formControlName="unitMaterial"
-            nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-            [nzHeaders]="{ authorization: 'authorization-text' }"
-            (nzChange)="handleChange($event)"
-          >
+        <nz-form-label class="label" [nzNoColon]="true" [nzSm]="16" [nzXs]="16" nzRequired>申报单位承诺意见材料</nz-form-label>
+        <nz-form-control class="val" nzErrorTip="请上传申报单位承诺意见材料" style="width: 450px">
+          <!-- <nz-upload formControlName="unitMaterial" nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+            [nzHeaders]="{ authorization: 'authorization-text' }" (nzChange)="handleChange($event)">
             <div style="color: #3e49b3">
               <span nz-icon nzType="upload"></span>上传文件
             </div>
-          </nz-upload>
+          </nz-upload> -->
+          <app-comp-upload [width]="320" (change)="upload($event, 'unitMaterial')" title="上传截图"></app-comp-upload>
+
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
           </div>
         </nz-form-control>
       </nz-form-item>
     </div>
-  </form>
+  <!-- </form> -->
 </div>
 <div class="footer">
-  <button
-    nz-button
-    nzType="default"
-    style="margin-right: 20px"
-    (click)="submitForm('save')"
-  >
+  <button nz-button nzType="default" style="margin-right: 20px" (click)="submitForm('save')">
     保存本页
   </button>
-  <button
-    nz-button
-    nzType="default"
-    style="margin-right: 20px"
-    (click)="submitForm('pre')"
-  >
+  <button nz-button nzType="default" style="margin-right: 20px" (click)="submitForm('pre')">
     上一步
   </button>
-  <button nz-button nzType="primary" style="background: #3e49b3; border: 1px #3e49b3" (click)="submitForm('complete')">完成</button>
-</div>
+  <button nz-button nzType="primary" style="background: #3e49b3; border: 1px #3e49b3"
+    (click)="submitForm('complete')">完成</button>
+</div>

+ 157 - 368
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -21,14 +21,8 @@ import {
   ValidatorFn,
   AbstractControl,
 } from '@angular/forms';
-interface opinionType {
-  name: string;
-  unit: string;
-  birth: Date | any;
-  nationality: string;
-  reviewFile: string | object;
-}
 import { textbookServer } from '../../../../services/textbook';
+
 @Component({
   selector: 'app-attachment',
   imports: [
@@ -65,371 +59,166 @@ export class AttachmentComponent implements OnInit {
     return {};
   };
 
-  validateForm: FormGroup<{
-    // textbookTypes: FormControl<Array<string> | any>; //教材电子版
-    // textbookFiles: FormControl<Array<string> | any>; //上传教材文件
-    // links: FormControl<string>; //教材数字内容链接地址、账号
-    selfResults: FormControl<object | any>; //图书编校质量自查结果记录表
-    expertOpinion: FormControl<object | any>; //专家审核意见表
-    evidence: FormControl<object | any>; //教材使用情况证明材料
-    moreMaterial: FormControl<Array<any> | any>; //其他材料
-    unitMaterial: FormControl<object | any>; //申报单位承诺意见材料
-    // accept: FormControl<string>; //填写诚信承诺
-    copyrightImgUrl: FormControl<string>; //版权页截图
-    CIPImgUrl: FormControl<string>; //中国版本图书馆CIP查询截图
-  }> = this.fb.group({
-    // textbookTypes: [''],
-    // textbookFiles: [
-    //   [
-    //     {
-    //       url: '',
-    //     },
-    //   ],
-    //   [Validators.required]
-    // ],
-    // links: ['', [Validators.required]],
-    selfResults: [
-      {
-        name: '自查表.pdf',
-        url: '',
-      },
-      [Validators.required]
-    ],
-    expertOpinion: [
-      {
-        name: '自查表.pdf',
-        url: '',
-      },
-      [Validators.required]
-    ],
-    evidence: ['',
-      [Validators.required]
-    ],
-    moreMaterial: [
-      [
-        {
-          name: '材料1.pdf',
-          url: '',
-        },
-        {
-          name: '材料2.pdf',
-          url: '',
-        },
-      ],
-    ],
-    unitMaterial: [
-      {
-        name: '承诺意见表.pdf',
-        url: '',
-      },
-      [Validators.required]
-    ],
-    // accept: ['', [Validators.required, this.confirmationValidator]],
-    copyrightImgUrl: [''],
-    CIPImgUrl: [''],
-  });
-  checkOptionsOne = [
-    { label: '纸质教材', value: '纸质教材', checked: true },
-    { label: '电子教材 / 资源', value: '电子教材 / 资源', checked: true },
-  ];
-  // //所有作者政治审查意见
-  // opinions: Array<opinionType> = [
-  //   {
-  //     name: '', //作者
-  //     unit: '', //单位
-  //     birth: '', //出生年月
-  //     nationality: '', //国籍
-  //     reviewFile: {
-  //       name: '自查表.pdf',
-  //       url: '',
-  //     }, //作者政治审查表/作者签名
-  //   },
-  // ];
-  // //所有作者签名
-  // authorSign: Array<opinionType> = [
-  //   {
-  //     name: '', //作者
-  //     unit: '', //单位
-  //     birth: '', //出生年月
-  //     nationality: '', //国籍
-  //     reviewFile: {
-  //       name: '审查表.pdf',
-  //       url: '',
-  //     }, //作者政治审查表/作者签名
-  //   },
-  // ];
+
+  /** 版权页截图*/
+  copyrightImgUrl: string = ''
+  /** 中国版本图书馆CIP查询截图*/
+  CIPImgUrl: string = ''
+  /**图书编校质量自查结果记录表 */
+  selfResults: any = {
+    name: '',
+    url: '',
+  }
+  /** 专家审核意见表*/
+  expertOpinion: any = {
+    name: '',
+    url: '',
+  }
+  /** 教材使用情况证明材料*/
+  evidence: any = {
+    name: '',
+    url: '',
+  }
+  /**其他材料 {name: '',url: '',} */
+  moreMaterial: Array<any> = []
+
+  /**申报单位承诺意见 */
+  unitMaterial: any = {
+    name: '',
+    url: '',
+  }
+
   constructor(
     public tbookSer: textbookServer,
-    private fb: NonNullableFormBuilder,
     private msg: NzMessageService,
     private modal: NzModalService
   ) { }
-  ngOnInit() { 
+  ngOnInit() {
     if (this.eduTextbook.id) {
-      this.validateForm = this.fb.group({
-        // textbookTypes: [
-        //   this.eduTextbook.get('textbookTypes'),
-        // ],
-        // textbookFiles: [
-        //   this.eduTextbook.get('textbookFiles') ||
-        //   this.validateForm.value.textbookFiles,
-        //   [Validators.required]
-        // ],
-        // links: [
-        //   this.eduTextbook.get('links')?.join('\n') || '',
-        //   [Validators.required]
-        // ],
-        selfResults: [
-          this.eduTextbook.get('selfResults') ||
-          this.validateForm.value.selfResults,
-          [Validators.required]
-        ],
-        expertOpinion: [
-          this.eduTextbook.get('expertOpinion') ||
-          this.validateForm.value.expertOpinion,
-          [Validators.required]
-        ],
-        evidence: [
-          this.eduTextbook.get('evidence') || this.validateForm.value.evidence,
-          [Validators.required]
-        ],
-        moreMaterial: [''],
-        unitMaterial: [
-          this.eduTextbook.get('unitMaterial') ||
-          this.validateForm.value.unitMaterial,
-          [Validators.required]
-        ],
-        // accept: [
-        //   this.eduTextbook.get('accept') || '',
-        //   [Validators.required, this.confirmationValidator]
-        // ],
-        copyrightImgUrl: [
-          this.eduTextbook.get('copyrightImgUrl') || '',
-          [Validators.required]
-        ],
-        CIPImgUrl: [
-          this.eduTextbook.get('CIPImgUrl') || '',
-          [Validators.required]
-        ],
-      });
-      // this.opinions = this.eduTextbook.get('opinions') || this.opinions
-      // this.authorSign = this.eduTextbook.get('authorSign') || this.authorSign
+      this.copyrightImgUrl = this.eduTextbook?.get('copyrightImgUrl') || this.copyrightImgUrl
+      this.CIPImgUrl = this.eduTextbook?.get('CIPImgUrl') || this.CIPImgUrl
+      this.selfResults = this.eduTextbook?.get('selfResults') || this.selfResults
+      this.expertOpinion = this.eduTextbook?.get('expertOpinion') || this.expertOpinion
+      this.evidence = this.eduTextbook?.get('evidence') || this.evidence
+      this.moreMaterial = this.eduTextbook?.get('moreMaterial') || this.moreMaterial
+      this.unitMaterial = this.eduTextbook?.get('unitMaterial') || this.unitMaterial
     }
+    console.log(    
+      'copyrightImgUrl',this.copyrightImgUrl,
+      'CIPImgUrl',this.CIPImgUrl,
+      'selfResults',this.selfResults,
+      'expertOpinion',this.expertOpinion,
+      'evidence',this.evidence,
+      'moreMaterial',this.moreMaterial,
+      'unitMaterial',this.unitMaterial)
   }
-  async submitForm(event?: string): Promise<void> {
-    if (event == 'pre') {
-      this.state.emit({ type: 'pre' });
-      return;
+
+  /**本页必填是否存在空项 */
+  examineNull() {
+    let isNull = false
+    let msgList = []
+    if (this.copyrightImgUrl == '' || !this.copyrightImgUrl) {
+      msgList.push('版权页截图')
+      isNull = true
     }
-    console.log(this.validateForm.value);
-    // let opinionsVrifly = !this.opinions.some((item) =>
-    //   Object.values(item).some((val) => val == '' || val == undefined)
-    // );
-    // let authorSignVrifly = !this.authorSign.some((item) =>
-    //   Object.values(item).some((val) => val == '' || val == undefined)
-    // );
-    let params: any = this.validateForm.value;
-    console.log(this.validateForm)
-    if (this.validateForm.valid) {
-      console.log(this.validateForm.value);
-      if (event == 'complete') {
-        // if (!opinionsVrifly) {
-        //   this.msg.warning('所有作者政治审查意见填写不完整');
-        //   return;
-        // }
-        // if (!authorSignVrifly) {
-        //   this.msg.warning('上传所有作者签名填写不完整');
-        //   return;
-        // }
-        await this.saveEduTextbook(params, true);
-        let textBookJson = this.eduTextbook.toJSON()
-        let ignoreFiled = [
-          'typeNumber',
-          'editionNumber', 
-          'importantProjectOther', 
-          'textbookFiles',
-          'createdAt', 
-          'updatedAt',
-          'copyright',
-          'authorSign',
-          'CIP',
-          'isDeleted',
-          'opinions',
-          'printNumber',
-          'printSum',
-          'render',
-          'importantProject',
-          'importantProjectOther',
-          'complete',
-          'links',
-          'recommend',
-          'printSun',
-          'discard',
-          'edition',
-          'eduProcess',
-          'authors',
-          'editor',
-        ] //非必填字段
-        console.log(textBookJson);
-        let isVrifly = Object.keys(textBookJson).some((item: string) => {
-          if (!ignoreFiled.includes(item) && (textBookJson[item] === '' || textBookJson[item] === undefined || textBookJson[item] === null)) {
-            console.warn('字段未填写:' + item);
-            return true
-          }
-          return
-        })
-        if (isVrifly) {
-          this.msg.warning('存在未填项')
-          return
-        }
-        this.state.emit({ type: 'complete', textBook: this.eduTextbook });
-        this.eduTextbook.set('complete', true)
-        this.eduTextbook.set('status', '102')
-        await this.eduTextbook.save()
-        this.msg.success('已填写完成')
-      }
-    } else {
-      if (event == 'save') {
-        // await this.saveEduTextbook(params, this.validateForm.valid && opinionsVrifly && authorSignVrifly);
-        await this.saveEduTextbook(params, this.validateForm.valid);
-        this.modal.success({
-          nzTitle: '保存成功',
-          nzContent: '<p>已保存并且至空间</p>',
-          nzOnOk: () => console.log('Info OK'),
-        });
-        return;
+    if (this.CIPImgUrl == '' || !this.CIPImgUrl) {
+      msgList.push('CIP查询截图')
+      isNull = true
+    }
+    if (this.selfResults.url == '' || !this.selfResults.url) {
+      msgList.push('自查结果记录表')
+      isNull = true
+    }
+    if (this.expertOpinion.url == '' || !this.expertOpinion.url) {
+      msgList.push('专家审核意见表')
+      isNull = true
+    }
+    if (this.evidence.url == '' || !this.evidence.url) {
+      msgList.push('证明材料')
+      isNull = true
+    }
+    if (this.moreMaterial?.length > 0) {
+      let isExist = this.moreMaterial.every(item => item?.url == '' || !item?.url)
+      if (isExist) {
+        msgList.push('其他材料')
+        isNull = true
       }
+    }
+    if (this.unitMaterial.url == '' || !this.unitMaterial.url) {
+      msgList.push('申报单位承诺意见')
+      isNull = true
+    }
+    if (isNull) {
+      this.msg.create('error', `请上传完整 ${msgList.join()}`)
+    }
+    return isNull
+  }
 
-
-
-
-
-
-
-      console.log(this.validateForm.value);
-      if (event == 'complete') {
-        await this.saveEduTextbook(params, true);
-        let textBookJson = this.eduTextbook.toJSON()
-        let ignoreFiled = ['typeNumber', 'importantProjectOther', 'createdAt', 'updatedAt'] //非必填字段
-        console.log(textBookJson);
-        let isVrifly = Object.keys(textBookJson).some((item: string) => {
-          if (!ignoreFiled.includes(item) && (textBookJson[item] === '' || textBookJson[item] === undefined || textBookJson[item] === null)) {
-            console.warn('字段未填写:' + item);
-            return true
-          }
-          return
-        })
-        if (isVrifly) {
-          this.msg.warning('存在未填项')
-          return
-        }
-        this.state.emit({ type: 'complete', textBook: this.eduTextbook });
-        this.eduTextbook.set('complete', true)
-        this.eduTextbook.set('status', '102')
-        await this.eduTextbook.save()
-        this.msg.success('已填写完成')
+  /**判断是否存在未填字段 */
+  isIgnoreFiledNull() {
+    let ignoreFiled = [
+      'typeNumber', 'editionNumber', 'importantProjectOther',
+      'textbookFiles', 'createdAt', 'updatedAt', 'copyright', 'authorSign',
+      'CIP', 'isDeleted', 'opinions', 'printNumber', 'printSum', 'render',
+      'importantProject', 'importantProjectOther', 'complete', 'links', 'recommend',
+      'printSun', 'discard', 'edition', 'eduProcess', 'authors', 'editor',
+      'copyrightImgUrl', 'CIPImgUrl', 'selfResults', 'expertOpinion', 'evidence',
+      'moreMaterial', 'unitMaterial','approvedImgUrl'
+    ] //非必填字段
+    let textBookJson = this.eduTextbook.toJSON()
+    let isVrifly = Object.keys(textBookJson).some((item: string) => {
+      if (!ignoreFiled.includes(item) && (textBookJson[item] === '' || textBookJson[item] === undefined || textBookJson[item] === null)) {
+        console.warn('字段未填写:' + item);
+        return true
       }
+      return
+    })
+    if (isVrifly) {
+      this.msg.warning('存在未填项')
+      return true
+    } else {
+      return false
+    }
+  }
 
+  async submitForm(event?: string): Promise<void> {
+    let params = {
+      copyrightImgUrl: this.copyrightImgUrl,
+      CIPImgUrl: this.CIPImgUrl,
+      selfResults: this.selfResults,
+      expertOpinion: this.expertOpinion,
+      evidence: this.evidence,
+      moreMaterial: this.moreMaterial,
+      unitMaterial: this.unitMaterial,
+    }
+      await this.saveEduTextbook(params, true);
+      if (event == 'pre') {//上一步
+      this.state.emit({ type: 'pre' });
+      return;
+    }
+   
+    if (event == 'complete') {
+      let isPageNull = this.examineNull()//检查本页空项
+      if (isPageNull) return
+      let isIgnoreFiled = this.isIgnoreFiledNull()//检查数据空项
+      if (isIgnoreFiled) return
 
 
 
 
-      
-
-
-
-
-      // Object.values(this.validateForm.controls).forEach((control) => {
-      //   if (control.invalid) {
-      //     control.markAsDirty();
-      //     control.updateValueAndValidity({ onlySelf: true });
-      //   }
-      // });
-      // this.msg.warning('请填写完整信息');
-
-
-
 
-      
-    }
-    if (event == 'save') {
-      // await this.saveEduTextbook(params, this.validateForm.valid && opinionsVrifly && authorSignVrifly);
-      await this.saveEduTextbook(params, this.validateForm.valid);
+      this.state.emit({ type: 'complete', textBook: this.eduTextbook });
+      this.eduTextbook.set('complete', true)
+      this.eduTextbook.set('status', '102')
+      await this.eduTextbook.save()
+      this.msg.success('已填写完成')
+    } else if (event == 'save') {
       this.modal.success({
-        nzTitle: '您已填写完成',
+        nzTitle: '保存成功',
         nzContent: '<p>已保存并且至空间</p>',
         nzOnOk: () => console.log('Info OK'),
       });
-    }
-  }
-  changeCode() { }
-  getCode(e: any) { }
-  // //添加作者信息
-  // onPush(type: string, idx: number) {
-  //   switch (type) {
-  //     case 'opinions':
-  //       this.opinions.splice(idx + 1, 0, {
-  //         name: '', //作者
-  //         unit: '', //单位
-  //         birth: '', //出生年月
-  //         nationality: '', //国籍
-  //         reviewFile: '', //作者政治审查表/作者签名
-  //       });
-  //       break;
-  //     case 'authorSign':
-  //       this.authorSign.splice(idx + 1, 0, {
-  //         name: '', //作者
-  //         unit: '', //单位
-  //         birth: '', //出生年月
-  //         nationality: '', //国籍
-  //         reviewFile: '', //作者政治审查表/作者签名
-  //       });
-  //       break;
-  //   }
-  // }
-  // //删除作者信息
-  // onDel(type: string, idx: number) {
-  //   switch (type) {
-  //     case 'opinions':
-  //       if (this.opinions.length <= 1) {
-  //         this.opinions = [
-  //           {
-  //             name: '', //作者
-  //             unit: '', //单位
-  //             birth: '', //出生年月
-  //             nationality: '', //国籍
-  //             reviewFile: '', //作者政治审查表/作者签名
-  //           },
-  //         ];
-  //         return;
-  //       }
-  //       this.opinions.splice(idx, 1);
-  //       break;
-  //     case 'authorSign':
-  //       if (this.authorSign.length <= 1) {
-  //         this.authorSign = [
-  //           {
-  //             name: '', //作者
-  //             unit: '', //单位
-  //             birth: '', //出生年月
-  //             nationality: '', //国籍
-  //             reviewFile: '', //作者政治审查表/作者签名
-  //           },
-  //         ];
-  //         return;
-  //       }
-  //       this.authorSign.splice(idx, 1);
-  //       break;
-  //   }
-  // }
-  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.`);
+      return;
     }
   }
 
@@ -451,12 +240,6 @@ export class AttachmentComponent implements OnInit {
       className: 'Company',
       objectId: this.tbookSer.company,
     });
-    // params.textbookTypes &&
-    //   this.eduTextbook?.set('textbookTypes', params.textbookTypes);
-    // params.textbookFiles &&
-    //   this.eduTextbook?.set('textbookFiles', params.textbookFiles);
-    // let links = params.links.split(/[(\r\n)\r\n]+/);
-    // links && this.eduTextbook?.set('links', links);
     params.selfResults &&
       this.eduTextbook?.set('selfResults', params.selfResults);
     params.unitMaterial &&
@@ -466,11 +249,8 @@ export class AttachmentComponent implements OnInit {
     params.evidence && this.eduTextbook?.set('evidence', params.evidence);
     params.moreMaterial &&
       this.eduTextbook?.set('moreMaterial', params.moreMaterial);
-    // params.accept && this.eduTextbook?.set('accept', params.accept);
     this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl);
     this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl);
-    // this.opinions && this.eduTextbook?.set('opinions', this.opinions);
-    // this.authorSign && this.eduTextbook?.set('authorSign', this.authorSign);
     await this.eduTextbook?.save();
     return;
   }
@@ -478,15 +258,24 @@ export class AttachmentComponent implements OnInit {
     console.log(e);
     let file = e[0];
     if (type == 'copyrightImgUrl' || type == 'CIPImgUrl') {
-      this.validateForm.value[type] = file
-    }else if(type == 'moreMaterial'){
-        this.validateForm.value[type]=e
-
-      // if(this.validateForm.value[type]){
-      //   this.validateForm.value[type].push(file)
-      // }else{
-      //   this.validateForm.value[type]=[file]
-      // }
+      this[type] = file
+    } else if (type == 'selfResults' || type == 'expertOpinion' ||
+      type == 'evidence' || type == 'unitMaterial') {
+      this[type].url = file
+      this[type].name = this.getFileName(file)
+    } else if (type == 'moreMaterial') {
+      let newList = e.map((item: any) => {
+        return { name: this.getFileName(item), url: item }
+      })
+      this[type]=newList
     }
   }
+  /**获取文件名 */
+  getFileName(url: string) {
+    if (!url) return ''
+    let str = url?.split('/')[5]
+    let index = str?.indexOf('-')
+    let result = decodeURIComponent(str?.substring(index + 1))
+    return result || '未知文件名'
+  }
 }

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

@@ -190,7 +190,7 @@
         </tbody>
       </nz-table>
       <p>输入诚信承诺:本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实。</p>
-      <input  formControlName="accept" nz-input placeholder="请输入承诺内容" />
+      <input formControlName="accept" nz-input placeholder="请输入承诺内容" />
     </div>
     <div class="author-content">
       <div class="nav">第一主编(作者)情况</div>
@@ -198,9 +198,12 @@
         <nz-form-label class="title" [nzNoColon]="true" [nzSm]="24" [nzXs]="24" nzRequired>
           <span style="font-size: 16px"> 相关教学经历 </span>
         </nz-form-label>
-        <nz-form-control class="val" nzErrorTip="请输入第一主编(作者)承担学校教学任务、开展教学研究情况、教材编写情况以及取得的教学成果" style="width: 100%">
-          <textarea rows="4" formControlName="authorDetails" placeholder="请输入第一主编(作者)承担学校教学任务、开展教学研究情况、教材编写情况以及取得的教学成果"
+        <nz-form-control  class="val" nzErrorTip="请输入第一主编(作者)承担学校教学任务、开展教学研究情况、教材编写情况以及取得的教学成果" style="width: 100%">
+          <nz-textarea-count [nzMaxCharacterCount]="500">
+            <textarea rows="4" maxlength="500" formControlName="authorDetails" placeholder="请输入第一主编(作者)承担学校教学任务、开展教学研究情况、教材编写情况以及取得的教学成果"
             nz-input></textarea>
+          </nz-textarea-count>
+          
         </nz-form-control>
       </nz-form-item>
     </div>

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

@@ -23,6 +23,7 @@
       font-weight: 500;
       line-height: 28px;
       text-align: left;
+      margin: 10px 0;
     }
     .title{
       font-family: PingFang SC;

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

@@ -96,6 +96,7 @@ export class TextbookPertainComponent implements OnInit {
 
 
 
+
   //适用专业代码及名称
   selectList = major.majors.options
 
@@ -197,7 +198,7 @@ export class TextbookPertainComponent implements OnInit {
         ],
         authorDetails: [
           this.eduTextbook.get('authorDetails') || '',
-          [Validators.required],
+          [Validators.required,Validators.maxLength(500)],
         ],
         accept: [
           this.eduTextbook.get('accept') || '',

+ 4 - 4
server/db/schemas/EduTextbook.js

@@ -56,7 +56,7 @@ export const EduTextbook = {
             "type": "String",
             "required": false
         },
-        "typeNumber": {
+        "typeNumber": {//全册次数
             "type": "Number",
             "required": false
         },
@@ -100,7 +100,7 @@ export const EduTextbook = {
             "type": "Date",
             "required": false
         },
-        "editionNumber": {
+        "editionNumber": {//出版版次
             "type": "Number",
             "required": false
         },
@@ -116,11 +116,11 @@ export const EduTextbook = {
             "type": "Number",
             "required": false
         },
-        "importantProject": {
+        "importantProject": {//重点项目
             "type": "String",
             "required": false
         },
-        "importantProjectOther": {
+        "importantProjectOther": {//重点项目-其他
             "type": "String",
             "required": false
         },