Quellcode durchsuchen

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

ryanemax vor 8 Monaten
Ursprung
Commit
f75a897280

BIN
projects/textbook/public/file/“十四五”普通高等教育本科国家级规划教材申报书.docx


+ 6 - 1
projects/textbook/src/app/app.routes.ts

@@ -3,10 +3,15 @@ import { AuthGuard } from '../services/auth.guard';
 import { CompUserComponent } from './comp-user/comp-user.component';
 import { ProfileComponent } from '../modules/user/profile/profile.component'
 import { CompManageComponent } from './comp-manage/comp-manage.component'
-import { TextbookDetailsComponent } from '../modules/common/textbook-details/textbook-details.component';
+import {PageHomeComponent} from '../modules/textbook/page-home/page-home.component'
 export const routes: Routes = [
   { path: '', redirectTo:'user/login', pathMatch: "full",}, // 默认跳转到 ''
   // { path: '',loadComponent:()=>import('../modules/textbook/page-home/page-home.component').then(m=>m.PageHomeComponent) }, // 默认跳转到 ''
+  {
+    path: 'home', // 首页
+    canActivate: mapToCanActivate([AuthGuard]),
+    component: PageHomeComponent,
+  },
   {
     path: 'user', // 用户登录/注册
     component: CompUserComponent,

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

@@ -13,7 +13,7 @@
       [nzInlineCollapsed]="isCollapsed"
       nz-menu
       nzMode="inline"
-      style="width: 100%; background: #f9eaea"
+      style="width: 100%; background: #f9eaea;height: 100%;position: relative;"
     >
       @for (item of optionsMap[textbook.profile?.identity]; track item.id;let index = $index) { @if(item.child)
       {
@@ -36,6 +36,12 @@
         <span>{{ item.name }}</span>
       </li>
       } }
+
+      <li (click)="downloadFile('“十四五”普通高等教育本科国家级规划教材申报书.docx')" style="position: absolute;bottom: 150px; height: 100px; text-wrap: wrap;" nz-menu-item>
+        <span nz-icon nzType="file" nzTheme="outline"></span>
+        “十四五”普通高等教育本科
+        国家级规划教材申报书
+      </li>
     </ul>
     <app-comp-nav
       [viewCollapsed]="isCollapsed"

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

@@ -5,6 +5,11 @@ import { RouterOutlet, Router } from '@angular/router';
 import { CommonCompModule } from '../../services/common.modules';
 import { MatIconRegistry, MatIconModule } from '@angular/material/icon';
 import { textbookServer } from '../../services/textbook';
+import { HttpClient } from '@angular/common/http';
+
+
+
+
 @Component({
   selector: 'app-comp-manage',
   standalone: true,
@@ -185,12 +190,15 @@ export class CompManageComponent implements OnInit {
     public tbookSer: textbookServer,
     public textbook:textbookServer,
     iconRegistry: MatIconRegistry, 
-    sanitizer: DomSanitizer
+    sanitizer: DomSanitizer,
+    private http: HttpClient,
+
   ) {
     iconRegistry.addSvgIconLiteral('menu', sanitizer.bypassSecurityTrustHtml(this.MENU_ICON));
    }
 
   ngOnInit() {
+    console.log(this.tbookSer.profile.identity) 
     if(localStorage.getItem('active')) return
     if(this.optionsMap[this.tbookSer.profile.identity][0]?.child){
       this.active = '1-1'
@@ -212,4 +220,18 @@ export class CompManageComponent implements OnInit {
       this.router.navigate([child.path]);
     }
   }
+
+  downloadFile(fileName: string) {
+    const fileUrl = `/file/${fileName}`;
+    this.http.get(fileUrl, { responseType: 'blob' }).subscribe((blob) => {
+      const url = window.URL.createObjectURL(blob);
+      const a = document.createElement('a');
+      a.href = url;
+      a.download = fileName;
+      document.body.appendChild(a);
+      a.click();
+      document.body.removeChild(a);
+      window.URL.revokeObjectURL(url);
+    })
+  }
 }

+ 39 - 15
projects/textbook/src/app/textbook/textbook.component.html

@@ -131,25 +131,39 @@
           {{ data?.get("title") || "-" }}
         </td>
         <td nzEllipsis>
-          {{ data?.get("ISBN") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("ISBN") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis>
-          {{ data?.get("author") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("author") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis>
-          {{ data?.get("lang") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("lang") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis>
-          {{ data?.get("majorPoniter") || "-" }}
+<<<<<<< HEAD
+          {{ data?.get("majorPoniter")?.code + '/'+data?.get("majorPoniter")?.name || "-" }}
+=======
+          {{ data?.get("majorPoniter")?.name || "-" }}
+>>>>>>> 97e6109cf35ed44c937fef2cd84cfbaeeb5c8810
         </td>
         <td nzEllipsis>
-          {{ data?.get("editionUnit") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("editionUnit") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis>
           {{ data?.get("approval") || "-" }}
         </td>
         <td nzEllipsis>
-          {{ data?.get("carrierShape") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("carrierShape") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis>
           {{ data?.get("department")?.get("name") || "-" }}
@@ -182,7 +196,7 @@
                 <button
                   nz-button
                   (click)="
-                    toUrl('/nav-admin/manage/textbook/details/' + data.id)
+                    toUrl('/common/textbook/details/' + data.id)
                   "
                   nzType="link"
                   style="color: #231c1f"
@@ -356,29 +370,39 @@
 
         <td nzEllipsis>
           {{
-            data?.get("type") == "单"
-              ? "单"
+            data?.get("type") == "单"
+              ? "单"
               : data?.get("typeNumber") || "-"
           }}
         </td>
         <td nzEllipsis>
-          {{ data?.get("author") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("author") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis>
-          {{ data?.get("unit") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("unit") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis>
           {{ data?.get("major")?.name || "-" }}
         </td>
         <td nzEllipsis>
-          {{ data?.get("lang") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("lang") + ' ' || "-" }}
+          }
         </td>
 
         <td nzEllipsis>
-          {{ data?.get("ISBN") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("ISBN") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis>
-          {{ data?.get("editionUnit") || "-" }}
+          @for (vul of data?.get('childrens'); track vul) {
+            {{ vul?.get("editionUnit") + ' ' || "-" }}
+          }
         </td>
         <td nzEllipsis nzRight>
           @if(manage){
@@ -408,7 +432,7 @@
                 <button
                   nz-button
                   (click)="
-                    toUrl('/nav-admin/manage/textbook/details/' + data.id)
+                    toUrl('/common/textbook/details/' + data.id)
                   "
                   nzType="link"
                   style="color: #231c1f"

+ 3 - 3
projects/textbook/src/app/textbook/textbook.component.ts

@@ -276,7 +276,7 @@ export class TextbookComponent implements OnInit {
       this.loading = false;
       return r;
     }
-    query.include('department');
+    query.include('department','childrens');
     this.count = await query.count();
     query.limit(this.limit);
     query.skip(this.limit * (this.pageIndex - 1));
@@ -869,8 +869,8 @@ export class TextbookComponent implements OnInit {
 
       _body += '<td>';
       _body += `${
-        data[row]?.get('type') == '单'
-          ? '单'
+        data[row]?.get('type') == '单'
+          ? '单'
           : data[row]?.get('typeNumber') || '-'
       }`;
       _body += '</td>';

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

@@ -4,7 +4,7 @@
 
 
   <div class="author-content">
-    <div class="title">1.所有作者政治审查意见(必须上传 )</div>
+    <div class="title">1.所有作者政治审查意见(必须提供 )</div>
     <div class="text">
       <span style="color: red;">*</span>
       从本申报平台 <a (click)="downloadFile('教材编写人员政治审查表.docx')">下载格式要求</a> 后,对应作者姓名上传“作者政治审查表” PDF 格式,大小不超过 2M。作者单位党委对作者进行审查,对政治思想表现情况进行评价,确保作者的正确政治方向、价值取向,无违法违纪等记录。
@@ -125,10 +125,10 @@
   </div>
  
   <div class="author-content">
-    <div class="title">2.图书编校质量自查结果记录表(必须上传)</div>
+    <div class="title">2.图书编校质量自查结果记录表(必须提供)</div>
     <div class="text">
       教材出版单位对申报教材的编校质量自查后,按要求提供图书编校质量自查结果记录表,并加盖出版社公章。全册教材的不同分册以不同文件分别上传。<a
-        (click)="downloadFile('图书编校质量自查结果记录表.docx')">下载模板</a>
+        (click)="downloadFile('图书编校质量自查结果记录表.docx')">下载格式要求</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>
@@ -148,7 +148,7 @@
     </nz-form-item>
   </div>
   <div class="author-content">
-    <div class="title">3.专家审查意见表(必须上传)</div>
+    <div class="title">3.专家审查意见表(必须提供)</div>
     <div class="text">
       从本申报平台 <a (click)="downloadFile('专家审查意见表.docx')">下载格式要求</a> 后,由第一主编所在单位和出版机构邀请校内外相关学科专业领域专家,
       对教材进行思想性、学术性审查。专家不少于 3 名,其中半数以上为校外专家,
@@ -179,7 +179,7 @@
     </nz-form-item>
   </div>
   <div class="author-content">
-    <div class="title">4.教材使用情况证明材料(必须上传)</div>
+    <div class="title">4.教材使用情况证明材料(必须提供)</div>
     <div class="text">
       教材出版单位提供教材主要使用高校名单及使用情况证明材料,并加盖公章。
       <!-- <a (click)="downloadFile('专家审查意见表.docx')">下载模板</a> -->
@@ -202,7 +202,7 @@
     </nz-form-item>
   </div>
   <div class="author-content">
-    <div class="title">5.版权信息及CIP数据(必须上传)</div>
+    <div class="title">5.版权信息及CIP数据(必须提供)</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%">
@@ -265,7 +265,7 @@
     </div>
   </div>
   <div class="author-content">
-    <div class="title">6.其他材料(可选上传)</div>
+    <div class="title">6.其他材料(可选提供)</div>
     <div class="text">其他佐证材料。</div>
     @if (moreMaterial.length>0) {
     @for (url of moreMaterial; track $index) {

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

@@ -136,7 +136,7 @@
             style="display: flex; flex-direction: column"
             formControlName="type"
           >
-            <label (click)="checkSingle()" nz-radio nzValue="单册">单册</label>
+            <label (click)="checkSingle()" nz-radio nzValue="单本">单本</label>
             <div class="basic-row">
               <label (click)="checkAll()" nz-radio nzValue="全册">全册</label>
               <!-- @if (validateForm.value.type =='全册') {

+ 7 - 2
projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.ts

@@ -240,6 +240,11 @@ export class BasicInComponent implements OnInit {
       objectId: '',
     });
     if (this.validateForm?.value?.type == '全册') {
+      if(this.eduTextbookVolumeList.length < 2){
+        for (let index = 0; index <  2 - this.eduTextbookVolumeList.length; index++) {
+          this.eduTextbookVolumeList.push({objectId:''})
+        }
+      }
       list.forEach((item: any, index: number) => {
         this.eduTextbookVolumeList[index] = item;
       });
@@ -251,7 +256,7 @@ export class BasicInComponent implements OnInit {
   loading = false;
   async checkSingle() {
     this.loading = true;
-    this.validateForm.get('type')?.setValue('单');
+    this.validateForm.get('type')?.setValue('单');
     await this.getEduTextbookVolumeList();
     this.loading = false;
   }
@@ -505,7 +510,7 @@ export class BasicInComponent implements OnInit {
         this.eduTextbook?.get('approval') || '',
         [Validators.required],
       ],
-      type: [this.eduTextbook?.get('type') || '单', [Validators.required]],
+      type: [this.eduTextbook?.get('type') || '单', [Validators.required]],
       approvedImgUrl: [this.eduTextbook?.get('approvedImgUrl') || ''],
 
       // ISBN: [parseInt(this.eduTextbook?.get('ISBN') || '') || null, [Validators.required]],

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

@@ -105,7 +105,7 @@
   <nz-form-item style="margin-bottom: 16px">
     <nz-form-label [nzSm]="8" [nzNoColon]="true" [nzXs]="8" nzRequired>
       载体形式
-      <span style="padding: 0 5px;" nz-icon nzType="info-circle" nzTheme="outline"></span>
+      <!-- <span style="padding: 0 5px;" nz-icon nzType="info-circle" nzTheme="outline"></span> -->
     </nz-form-label>
     <nz-form-control nzErrorTip="请输入载体形式" [nzSm]="12" [nzXs]="12">
       <nz-input-group>

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

@@ -115,7 +115,7 @@ export class TextbookContentComponent implements OnInit {
   typeNumber: any;
   /** 申报类型*/
   type: any;
-  /** 单时该册id*/
+  /** 单时该册id*/
   eduTextbookVolumeId: any;
 
   ngAfterViewInit(): void {

+ 1 - 1
projects/textbook/src/modules/textbook/page-home/header/header.component.html

@@ -46,7 +46,7 @@
     }@else{
     <div class="login-manage-box"> 
         <div class="manage-box">
-            <button class="manage-button" (click)="authServr.profileVerify()">进入后台</button>
+            <button class="manage-button" (click)="authServr.profileVerify(modal,true)">进入后台</button>
         </div>
     </div>
     }

+ 3 - 0
projects/textbook/src/modules/textbook/page-home/header/header.component.ts

@@ -12,6 +12,8 @@ import { Router, RouterModule } from '@angular/router';
 import { NzButtonModule } from 'ng-zorro-antd/button';
 import { CommonModule } from '@angular/common';
 import { AuthServr } from '../../../../services/auth.service';
+import { NzModalService } from 'ng-zorro-antd/modal';
+
 @Component({
   selector: 'app-header',
   templateUrl: './header.component.html',
@@ -77,6 +79,7 @@ export class HeaderComponent {
     private message: NzMessageService,
     public router:Router,
     public authServr: AuthServr,
+    public modal:NzModalService
     ){
     // this.accServ.getBilling();
     this.isCapacitor = this.platform.is("capacitor")

+ 4 - 2
projects/textbook/src/services/auth.service.ts

@@ -134,7 +134,7 @@ export class AuthServr {
     });
   }
   //验证用户类型
-  async profileVerify(modal?: NzModalService) {
+  async profileVerify(modal?: NzModalService, manage?:boolean) {
     if(!Parse.User.current()?.id) return
     let query = new Parse.Query('Profile');
     query.equalTo('user', Parse.User.current()?.id);
@@ -157,7 +157,9 @@ export class AuthServr {
             let profile = r.toJSON();
             localStorage.setItem('profile', JSON.stringify(profile));
             this.textbook.profile = profile;
-            this.router.navigate([this.roterPath[r.get('identity')]]);
+            let url = this.roterPath[r.get('identity')]
+            // if(!manage) url = '/home'
+            this.router.navigate([url]);
             // this.message.success('登录成功');
             return;
           }

+ 6 - 5
projects/textbook/src/services/textbook.ts

@@ -221,17 +221,18 @@ export class textbookServer {
   /* 批量预设(临时) */
   async saveProcess() {
     // let count = 0
-
     // let query = new Parse.Query('EduProcess')
-    // query.equalTo('num',null)
+    // // query.equalTo('num',null)
     // query.notEqualTo('isDeleted',true)
-    // query.select('name','num')
-    // query.limit(1000)
+    // // query.select('name','num')
+    // query.limit(2000)
+    // query.select('objectId')
     // let res = await query.find()
     // console.log(res);
     // for (let index = 0; index < res.length; index++) {
     //     const item = res[index]
-    //     item.set('num',0)
+    //     item?.set('startDate', new Date('2024-08-05 8:00'));
+    //     item?.set('deadline', new Date('2024-09-30 23:59'));
     //     await item.save()
     //     console.log(count);
     // }