Browse Source

Merge remote-tracking branch 'origin/master'

lizeyu 9 months ago
parent
commit
33e2ede894
37 changed files with 1199 additions and 1998 deletions
  1. 379 1031
      parth5/parth5/package-lock.json
  2. 2 1
      parth5/parth5/package.json
  3. 44 0
      parth5/parth5/src/app/api/partycourse/index.ts
  4. 2 0
      parth5/parth5/src/app/views/pages/study/partycourse/fileshower/fileshower.component.html
  5. 0 0
      parth5/parth5/src/app/comm/modal/showpdf/showpdf.component.scss
  6. 67 0
      parth5/parth5/src/app/comm/modal/showpdf/showpdf.component.ts
  7. 0 6
      parth5/parth5/src/app/views/pages/study/againt/againt.component.html
  8. 0 13
      parth5/parth5/src/app/views/pages/study/againt/againt.component.scss
  9. 0 27
      parth5/parth5/src/app/views/pages/study/againt/againt.component.spec.ts
  10. 0 14
      parth5/parth5/src/app/views/pages/study/againt/againt.component.ts
  11. 0 7
      parth5/parth5/src/app/views/pages/study/education/education.component.html
  12. 0 13
      parth5/parth5/src/app/views/pages/study/education/education.component.scss
  13. 0 27
      parth5/parth5/src/app/views/pages/study/education/education.component.spec.ts
  14. 0 14
      parth5/parth5/src/app/views/pages/study/education/education.component.ts
  15. 0 24
      parth5/parth5/src/app/views/pages/study/partycourse/fileshower/fileshower.component.spec.ts
  16. 0 38
      parth5/parth5/src/app/views/pages/study/partycourse/fileshower/fileshower.component.ts
  17. 0 62
      parth5/parth5/src/app/views/pages/study/partycourse/partycourse.component.html
  18. 0 160
      parth5/parth5/src/app/views/pages/study/partycourse/partycourse.component.scss
  19. 0 27
      parth5/parth5/src/app/views/pages/study/partycourse/partycourse.component.spec.ts
  20. 0 301
      parth5/parth5/src/app/views/pages/study/partycourse/partycourse.component.ts
  21. 0 6
      parth5/parth5/src/app/views/pages/study/rule/rule.component.html
  22. 0 13
      parth5/parth5/src/app/views/pages/study/rule/rule.component.scss
  23. 0 27
      parth5/parth5/src/app/views/pages/study/rule/rule.component.spec.ts
  24. 0 14
      parth5/parth5/src/app/views/pages/study/rule/rule.component.ts
  25. 16 11
      parth5/parth5/src/app/views/tapp/tab-study/tab-study.module.ts
  26. 58 21
      parth5/parth5/src/app/views/tapp/tab-study/tab-study.page.html
  27. 156 10
      parth5/parth5/src/app/views/tapp/tab-study/tab-study.page.scss
  28. 288 2
      parth5/parth5/src/app/views/tapp/tab-study/tab-study.page.ts
  29. 2 1
      parth5/parth5/tsconfig.json
  30. 0 116
      src/main/java/com/ghsc/partybuild/controller/AppFileMgrController.java
  31. 2 2
      src/main/java/com/ghsc/partybuild/controller/FileMgrController.java
  32. 160 0
      src/main/java/com/ghsc/partybuild/controller/app/AppFileMgrController.java
  33. 1 1
      src/main/java/com/ghsc/partybuild/mapper/CfFileCQuery.java
  34. 1 1
      src/main/java/com/ghsc/partybuild/service/FileMgrService.java
  35. 5 5
      src/main/java/com/ghsc/partybuild/service/impl/FileMgrServiceImpl.java
  36. 1 0
      src/main/java/com/ghsc/partybuild/shiro/ShiroConfiguration.java
  37. 15 3
      src/main/resources/mapping/CfFileCQuery.xml

File diff suppressed because it is too large
+ 379 - 1031
parth5/parth5/package-lock.json


+ 2 - 1
parth5/parth5/package.json

@@ -32,10 +32,11 @@
     "echarts": "^5.1.2",
     "eventemitter3": "^4.0.7",
     "moment": "^2.29.1",
-    "ng2-pdf-viewer": "^6.4.1",
+    "ng2-pdf-viewer": "^5.1.3",
     "ngx-order-pipe": "^2.1.1",
     "ngx-pinch-zoom": "^2.5.5",
     "ngx-quill": "^14.0.0",
+    "pdfjs-dist": "^2.5.207",
     "photoswipe": "^4.1.3",
     "quill": "^1.3.7",
     "rxjs": "~6.6.0",

+ 44 - 0
parth5/parth5/src/app/api/partycourse/index.ts

@@ -0,0 +1,44 @@
+import {Injectable} from '@angular/core';
+import {ConfigService, RequsetData} from "../../service/config.service";
+import {Observable} from "rxjs";
+import {
+  debounceTime, distinctUntilChanged, switchMap, map
+} from 'rxjs/operators';
+
+
+export interface IFileParams {
+  pageIndex: number;
+  pageSize: number;
+  fileTypeId: string;
+  fileName: string,
+}
+
+@Injectable({
+  providedIn: 'root'
+})
+export class PartyCourseApi {
+
+  fileTypeRootUrl: string = '/appApi/fileMgr/GetFileTypeRoot';
+  fileTypesByParentUrl: string = '/appApi/fileMgr/GetFileTypesByParent';
+  fileListUrl: string = '/appApi/fileMgr/getFileList';
+  fileKeyUrl: string = '/appApi/fileMgr/GetFilesByKey';
+
+  constructor(private configService: ConfigService) {
+  }
+
+  GetFileListByType(datas: any): Observable<RequsetData> {
+    return this.configService.HttpGetRomote(this.fileListUrl, datas);
+  }
+
+  GetfileListByKey(datas: any): Observable<RequsetData> {
+    return this.configService.HttpGetRomote(this.fileKeyUrl, datas);
+  }
+
+  GetfileTypeRoot(datas: any): Observable<RequsetData> {
+    return this.configService.HttpGetRomote(this.fileTypeRootUrl, datas);
+  }
+
+  GetileTypesByParent(id: string): Observable<RequsetData> {
+    return this.configService.HttpGetRomote(this.fileTypesByParentUrl, {parentid: id});
+  }
+}

+ 2 - 0
parth5/parth5/src/app/views/pages/study/partycourse/fileshower/fileshower.component.html

@@ -14,3 +14,5 @@
                 [original-size]="false" [autoresize]="true" class="pdf-viewer"></pdf-viewer>
   </pinch-zoom>
 </ion-content>
+
+

parth5/parth5/src/app/views/pages/study/partycourse/fileshower/fileshower.component.scss → parth5/parth5/src/app/comm/modal/showpdf/showpdf.component.scss


+ 67 - 0
parth5/parth5/src/app/comm/modal/showpdf/showpdf.component.ts

@@ -0,0 +1,67 @@
+import {Component, Input, NgModule, OnInit} from '@angular/core';
+import {ConfigService, RequsetData} from "../../../service/config.service";
+import {ModalController} from "@ionic/angular";
+import {DomSanitizer} from "@angular/platform-browser";
+import {UserService} from "../../../service/user.service";
+
+@Component({
+  selector: 'app-showpdf',
+  templateUrl: './showpdf.component.html',
+  styleUrls: ['./showpdf.component.scss'],
+})
+export class ShowpdfComponent implements OnInit {
+
+  /*pdfSrc = "https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf";*/
+  @Input()
+  pdfUrl: string = '';
+
+  @Input()
+  fileid: string = '';
+
+  @Input()
+  pdfTitle: string = '';
+
+  @Input()
+  pointType: number;
+
+  @Input()
+  duration: number;
+
+  timer: any = {};
+  safeUrl: string = "";
+
+  constructor(private configService: ConfigService, private userService: UserService, public modalController: ModalController, private sanitizer: DomSanitizer) {
+  }
+
+  ngOnInit() {
+    this.configService.GetConfig().subscribe(config => {
+      //this.sanitizer.bypassSecurityTrustResourceUrl(
+      this.safeUrl = config.webServerHost + this.pdfUrl;
+    });
+    let parent = this;
+    this.timer = setTimeout(function () {
+      parent.insertCoursePoint(parent);
+    }, this.duration == null ? 180000 : this.duration * 1000);
+  }
+
+  close() {
+    clearTimeout(this.timer);
+    this.modalController.dismiss({});
+  }
+
+  insertCoursePoint(parent) {
+    /*parent.configService.HttpGetRomote('/appApi/onlineCourse/insertCoursePoint', {
+      courseId: parent.fileid,
+      studentUserId: parent.userService.GetUser().userid, pointType: parent.pointType, title: parent.pdfTitle,
+      userName: parent.userService.GetUser().username
+    }).subscribe((data: RequsetData) => {
+      if (data.success) {
+      }
+    });*/
+  }
+
+  onError(error: any) {
+    console.log('PDF error', error);
+  }
+
+}

+ 0 - 6
parth5/parth5/src/app/views/pages/study/againt/againt.component.html

@@ -1,6 +0,0 @@
-<ion-content>
-  <div class="building">
-    <img class="building-img" src="assets/icon/education.svg">
-    <ion-text class="building-text">建设中...</ion-text>
-  </div>
-</ion-content>

+ 0 - 13
parth5/parth5/src/app/views/pages/study/againt/againt.component.scss

@@ -1,13 +0,0 @@
-.building {
-  display: flex;
-  flex-direction: column;
-  margin: 15px 0;
-  .building-img{
-    width: 20%;
-    display: flex;
-    align-self: center;
-  }
-  .building-text{
-    text-align: center;
-  }
-}

+ 0 - 27
parth5/parth5/src/app/views/pages/study/againt/againt.component.spec.ts

@@ -1,27 +0,0 @@
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { AgaintComponent } from './againt.component';
-
-describe('AgaintComponent', () => {
-  let component: AgaintComponent;
-  let fixture: ComponentFixture<AgaintComponent>;
-
-  beforeEach(async(() => {
-    TestBed.configureTestingModule({
-      declarations: [ AgaintComponent ],
-      schemas: [CUSTOM_ELEMENTS_SCHEMA],
-    })
-    .compileComponents();
-  }));
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(AgaintComponent);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 14
parth5/parth5/src/app/views/pages/study/againt/againt.component.ts

@@ -1,14 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
-  selector: 'app-againt',
-  templateUrl: './againt.component.html',
-  styleUrls: ['./againt.component.scss'],
-})
-export class AgaintComponent implements OnInit {
-
-  constructor() { }
-
-  ngOnInit() {}
-
-}

+ 0 - 7
parth5/parth5/src/app/views/pages/study/education/education.component.html

@@ -1,7 +0,0 @@
-
-<ion-content>
-  <div class="building">
-    <img class="building-img" src="assets/icon/education.svg">
-    <ion-text class="building-text">建设中...</ion-text>
-  </div>
-</ion-content>

+ 0 - 13
parth5/parth5/src/app/views/pages/study/education/education.component.scss

@@ -1,13 +0,0 @@
-.building {
-  display: flex;
-  flex-direction: column;
-  margin: 15px 0;
-  .building-img{
-    width: 20%;
-    display: flex;
-    align-self: center;
-  }
-  .building-text{
-    text-align: center;
-  }
-}

+ 0 - 27
parth5/parth5/src/app/views/pages/study/education/education.component.spec.ts

@@ -1,27 +0,0 @@
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { EducationComponent } from './education.component';
-
-describe('EducationComponent', () => {
-  let component: EducationComponent;
-  let fixture: ComponentFixture<EducationComponent>;
-
-  beforeEach(async(() => {
-    TestBed.configureTestingModule({
-      declarations: [ EducationComponent ],
-      schemas: [CUSTOM_ELEMENTS_SCHEMA],
-    })
-    .compileComponents();
-  }));
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(EducationComponent);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 14
parth5/parth5/src/app/views/pages/study/education/education.component.ts

@@ -1,14 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
-  selector: 'app-education',
-  templateUrl: './education.component.html',
-  styleUrls: ['./education.component.scss'],
-})
-export class EducationComponent implements OnInit {
-
-  constructor() { }
-
-  ngOnInit() {}
-
-}

+ 0 - 24
parth5/parth5/src/app/views/pages/study/partycourse/fileshower/fileshower.component.spec.ts

@@ -1,24 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { IonicModule } from '@ionic/angular';
-
-import { FileshowerComponent } from './fileshower.component';
-
-describe('FileshowerComponent', () => {
-  let component: FileshowerComponent;
-  let fixture: ComponentFixture<FileshowerComponent>;
-
-  beforeEach(waitForAsync(() => {
-    TestBed.configureTestingModule({
-      declarations: [ FileshowerComponent ],
-      imports: [IonicModule.forRoot()]
-    }).compileComponents();
-
-    fixture = TestBed.createComponent(FileshowerComponent);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  }));
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 38
parth5/parth5/src/app/views/pages/study/partycourse/fileshower/fileshower.component.ts

@@ -1,38 +0,0 @@
-import {Component, Input, OnInit} from '@angular/core';
-import {ConfigService} from "../../../service/config.service";
-import {ModalController} from "@ionic/angular";
-import { DomSanitizer } from '@angular/platform-browser';
-
-@Component({
-  selector: 'app-fileshower',
-  templateUrl: './fileshower.component.html',
-  styleUrls: ['./fileshower.component.scss'],
-})
-export class FileshowerComponent implements OnInit {
-
-  pdfUrl:string='/appApi/FileMgr/showDoc/';
-
-  safeUrl:any;
-
-  @Input()
-  pdfTitle:string='';
-
-  @Input()
-  fileId: string;
-
-  constructor(private configService:ConfigService,public modalController: ModalController,private sanitizer: DomSanitizer) { }
-
-  ngOnInit() {
-
-    this.configService.GetConfig().subscribe(config=>{
-      //this.sanitizer.bypassSecurityTrustResourceUrl(
-      this.safeUrl=config.webServerHost+this.pdfUrl+this.fileId;
-    });
-
-  }
-
-  close(){
-    this.modalController.dismiss({});
-  }
-
-}

+ 0 - 62
parth5/parth5/src/app/views/pages/study/partycourse/partycourse.component.html

@@ -1,62 +0,0 @@
-<ion-header id="main-content">
-  <ion-toolbar>
-    <ion-label style="font-size: 20px;">制度学习</ion-label>
-    <ion-searchbar slot="end" mode="ios" enterkeyhint="search" placeholder="搜索文件名称" showCancelButton="never" (ionChange)="searchChange($event)"></ion-searchbar>
-  </ion-toolbar>
-  <div class="panel-background search-panel">
-    <div class="search-label">
-      当前选中制度:
-    </div>
-    <div class="search-text">
-      <span>{{fileTypeData.fileTypeName}}</span>
-      <div class="select-right" (click)="selectFileType()">
-        <span>选目录</span>
-        <img src="assets/icon/icon-treeparty.png" height="16" width="16"/>
-      </div>
-    </div>
-  </div>
-  <ion-item class="item-filter item-title">
-  </ion-item>
-</ion-header>
-<ion-content>
-  <ion-list>
-    <ion-item class="item1" (click)="ShowPdf(it)" *ngFor="let it of dataList$|async">
-      <ion-label>
-        <h4>{{it.FILENAME}}</h4>
-        <p class="item-fileno">类型:{{it.FILETYPENAME}}</p>
-      </ion-label>
-      <ion-img src="assets/icon/read-book.svg" class="img-read" slot="end"></ion-img>
-    </ion-item>
-  </ion-list>
-  <ion-infinite-scroll threshold="100px" (ionInfinite)="scroll($event)">
-    <ion-infinite-scroll-content
-      loadingSpinner="bubbles"
-      loadingText="{{total>searchParams.pageIndex*searchParams.pageSize?'正在加载...':'暂无更多'}}">
-    </ion-infinite-scroll-content>
-  </ion-infinite-scroll>
-</ion-content>
-<ion-menu menuId="typeRoot" side="end" type="overlay" class="menu-body" contentId="main-content">
-  <ion-header class="menu-header">
-    <ion-icon name="close-circle-outline" class="btn-close" (click)="CloseMenu()"></ion-icon>
-    <ion-toolbar>
-      <ion-buttons slot="start">
-        <ion-button [hidden]="fileTypeData.selectedParent==null" (click)="BackMenu()">
-          <ion-icon class="back-img" name="arrow-back-outline"></ion-icon>
-        </ion-button>
-      </ion-buttons>
-      <ion-label [class]="{'filetype-selected':selectedTitle()}" (click)="SelectTitleFileType()" class="header-title">{{fileTypeData.pSelectedName}}</ion-label>
-    </ion-toolbar>
-  </ion-header>
-  <ion-content class="menu-content">
-    <ion-list>
-      <ion-item *ngFor="let it of typeList" (click)="ShowKidsFileType(it)">
-        <ion-label [class]="{'filetype-selected':selectedItem(it)}" >{{it.filetypename}}</ion-label>
-        <ion-icon [hidden]="it.childcount==0"   name="chevron-forward-outline" slot="end"></ion-icon>
-      </ion-item>
-    </ion-list>
-  </ion-content>
-  <ion-toolbar id="menu-bar" class="toolbar-center">
-    <ion-button color="light" (click)="CloseMenu()" mode="ios">关闭</ion-button>
-    <ion-button color="danger" (click)="chooseFileType()" mode="ios">选择</ion-button>
-  </ion-toolbar>
-</ion-menu>

+ 0 - 160
parth5/parth5/src/app/views/pages/study/partycourse/partycourse.component.scss

@@ -1,160 +0,0 @@
-:host{
-  --background:#000000;
-}
-
-.building {
-  display: flex;
-  flex-direction: column;
-  margin: 15px 0;
-  .building-img{
-    width: 20%;
-    display: flex;
-    align-self: center;
-  }
-  .building-text{
-    text-align: center;
-  }
-}
-.toolbar-label{
-  padding-left: 10px;
-}
-.search-panel {
-  padding: 5px 15px 15px 15px;
-  .search-label {
-    opacity: 0.75;
-    font-size: 14px;
-  }
-
-  .search-text {
-    display: flex;
-    justify-content: space-between;
-    padding-top: 15px;
-
-    div {
-      display: flex;
-      cursor: pointer;
-
-      img {
-        padding-left: 2px;
-      }
-    }
-  }
-}
-
-.filetype-selected {
-  color: #DE4F3F !important;
-}
-
-.back-btn {
-  padding: 10px;
-}
-
-#menu-bar{
-  margin-bottom: 40px;
-  :nth-child(1){
-    margin-right: 15px;
-    width: 100px;
-  }
-  :nth-child(2){
-    margin-left: 15px;
-    width: 100px;
-  }
-}
-
-.item-title{
-  height: 6px;
-}
-
-.item1{
-  --background:#F8F9FC;
-  --border-radius:10pt;
-  margin: 5px;
-
-  .img-read {
-    height: 22px;
-    width: 22px;
-  }
-}
-
-.search-panel {
-  padding: 5px 15px 15px 15px;
-
-  .search-label {
-    opacity: 0.75;
-    font-size: 14px;
-  }
-
-  .search-text {
-    display: flex;
-    justify-content: space-between;
-    padding-top: 15px;
-
-    ion-icon {
-      padding-top: 3px;
-    }
-
-    .select-right{
-      display: flex;
-      cursor: pointer;
-      margin-right: 15px;
-      img{
-        margin-left: 2px;
-        margin-top: 3px;
-      }
-    }
-  }
-}
-
-.selected {
-  color: #DE4F3F;
-
-  .img-check {
-    margin-right: 8px;
-  }
-}
-
-.menu-content {
-  .up-title {
-    color: #DE4F3F;
-  }
-
-}
-
-.menu-body {
-  --background: transparent;
-
-  .menu-header {
-    border-top-left-radius: 8px;
-    background: white;
-    --background: #fff;
-
-    ion-toolbar {
-      --background: #fff;
-      border-top-left-radius: 8px;
-    }
-    .back-img {
-      color: #380F0A;
-    }
-    .header-title {
-      padding: 20px 15px 10px 15px;
-      font-size: 15px;
-      color: #380F0A;
-      font-weight: bold;
-    }
-
-    .btn-close {
-      font-size: 22px;
-      padding: 10px 0 0 10px;
-      color: #5E4545;
-      cursor: pointer;
-    }
-  }
-
-  .toolbar-center {
-    border-bottom-left-radius: 8px;
-  }
-}
-
-
-
-

+ 0 - 27
parth5/parth5/src/app/views/pages/study/partycourse/partycourse.component.spec.ts

@@ -1,27 +0,0 @@
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { PartycourseComponent } from './partycourse.component';
-
-describe('PartycourseComponent', () => {
-  let component: PartycourseComponent;
-  let fixture: ComponentFixture<PartycourseComponent>;
-
-  beforeEach(async(() => {
-    TestBed.configureTestingModule({
-      declarations: [ PartycourseComponent ],
-      schemas: [CUSTOM_ELEMENTS_SCHEMA],
-    })
-    .compileComponents();
-  }));
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(PartycourseComponent);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 301
parth5/parth5/src/app/views/pages/study/partycourse/partycourse.component.ts

@@ -1,301 +0,0 @@
-import {Component, Inject, OnInit} from '@angular/core';
-import {ActivatedRoute, Router} from "@angular/router";
-import {ConfigService, RequsetData} from "../../service/config.service";
-import {UserService} from "../../service/user.service";
-import {AlertController, MenuController, ModalController} from "@ionic/angular";
-import {PartycourseService, IFileParams} from '../../api/partycourse.service';
-import {Observable, Subject} from 'rxjs';
-import {FileshowerComponent} from './fileshower/fileshower.component';
-import {
-  debounceTime, distinctUntilChanged, switchMap, map, tap
-} from 'rxjs/operators';
-import {DOCUMENT} from "@angular/common";
-import {ShowpdfComponent} from "../../comm/modal/showpdf/showpdf.component";
-
-@Component({
-  selector: 'app-partycourse',
-  templateUrl: './partycourse.component.html',
-  styleUrls: ['./partycourse.component.scss'],
-})
-export class PartycourseComponent implements OnInit {
-
-  private searchFiles = new Subject<any>();
-  dataList$: Observable<any[]>;
-  dataParams: any = {
-    target: null,
-    total: 10,
-    searchParams: null
-  };
-  searchParams: IFileParams = {
-    pageIndex: 1,
-    pageSize: 10,
-    fileTypeId: '',
-    fileName: ''
-  };
-
-  dataList: any[] = [];
-  typeList: any[] = [];
-
-  total: number = 30;
-  fileTypeData: any = {
-    title: '全部目录',
-    allTypeName: '制度查询',
-    pSelectedName: '全部目录',
-    rootKids: [],
-    selectedNode: null,
-    selectedParent: null,
-    fileTypeName: ''
-  };
-  sourceType: null;
-
-  constructor(private router: Router, private routeInfo: ActivatedRoute, private partycourseService: PartycourseService, private configService: ConfigService, private userService: UserService,
-              public alertController: AlertController, private menu: MenuController, private modal: ModalController, @Inject(DOCUMENT) private document: any) {
-
-
-  }
-
-  ionViewWillEnter(): void {
-    this.searchParams.pageIndex = 1;
-  }
-
-  ngOnInit() {
-
-    this.dataList$ = this.searchFiles.pipe(
-      debounceTime(300),
-      distinctUntilChanged(null, x => x.searchParams.fileName + x.searchParams.fileTypeId + x.searchParams.pageIndex + x.searchParams.pageSize),
-      switchMap((params: any) => {
-
-        let sMap = this.partycourseService.GetFileListByType(params.searchParams).pipe(map(x => {
-
-          //this.total=x.item.total;
-          this.dataParams.total = x.item.total;
-
-          if (params.target) {
-            this.dataList = this.dataList.concat(x.item.list);
-            params.target.complete();
-          } else {
-            this.dataList = x.item.list;
-          }
-
-          return this.dataList;
-        }));
-
-        return sMap;
-      })
-    );
-    this.routeInfo.queryParams.subscribe(params => {
-      this.sourceType = params['sourceType'] == undefined ? null : params['sourceType'];
-      this.partycourseService.GetfileTypeRoot({sourceType: this.sourceType}).subscribe(next => {
-
-        this.fileTypeData.rootKids = next.item;
-        if (this.fileTypeData.rootKids.length > 0) {
-          if (this.sourceType != null) {
-            this.fileTypeData.selectedNode = this.fileTypeData.rootKids[0];
-            this.searchParams.fileTypeId = this.fileTypeData.selectedNode.filetypeid.toString();
-            this.fileTypeData.fileTypeName = this.fileTypeData.selectedNode.filetypename;
-          }
-          this.dataParams.searchParams = this.searchParams;
-          this.dataParams.target = null;
-          this.searchFiles.next(this.dataParams);
-          //this.loadFilesbyType();
-        }
-        this.typeList = this.fileTypeData.rootKids;
-      });
-    });
-  }
-
-
-  scroll(event) {
-
-    if (this.dataParams.total > this.searchParams.pageIndex * this.searchParams.pageSize) {
-      this.searchParams.pageIndex += 1;
-      //this.getList();
-      this.dataParams.target = event.target;
-      //this.dataParams.searchParams=this.searchParams;
-      this.searchFiles.next(this.dataParams);
-    } else {
-      setTimeout(() => {
-        event.target.complete();
-      }, 500);
-    }
-    /*
-      setTimeout(() => {
-        //event.target.complete();
-
-        }
-      }, 500);*/
-  }
-
-  back() {
-    this.router.navigateByUrl('/main/tabs/tab3');
-    //this.navCtrl.back();
-  }
-
-  searchChange(event) {
-    /*
-    this.fieldList[0].value = event.detail.value;
-    this.searchParams.dzzmc = event.detail.value;
-    this.reload();*/
-
-    //this.searchFiles.next(event.detail.value);
-
-    this.searchParams.fileName = event.detail.value;
-    this.searchParams.pageIndex = 1;
-    this.dataParams.target = null;
-    this.searchFiles.next(this.dataParams);
-    /*
-    this.searchParams.pageIndex=1;
-    this.dataList.length=0;
-    this.searchParams.fileTypeId=null;
-    this.fileTypeData.fileTypeName="";
-    this.loadFilesBySearch();*/
-  }
-
-  loadFilesBySearch() {
-
-    this.partycourseService.GetfileListByKey(this.searchParams).subscribe(next => {
-      //next.item
-      this.dataList = this.dataList.concat(next.item.list);
-    });
-
-  }
-
-  loadFilesbyType() {
-    //this.partycourseService.GetFileListByType(this.searchParams)
-
-    this.partycourseService.GetFileListByType(this.searchParams).subscribe(next => {
-      //next.item
-      //this.dataList=this.dataList.concat(next.item.list);
-
-    });
-  }
-
-  selectFileType() {
-    this.menu.enable(true, 'typeRoot').then(a => {
-    });
-    this.menu.open('typeRoot').then(a => {
-    });
-  }
-
-  ClickPFileType(it: any) {
-    /*
-    this.fileTypeData.pSelectedId=it.filetypeid;
-    this.fileTypeData.pSelectedName=it.filetypename;*/
-    //this.fileTypeData.selectedId=it.
-    this.fileTypeData.selectedNode = it;
-
-  }
-
-  selectedItem(it: any) {
-    let result = false;
-    if (this.fileTypeData.selectedNode != null) {
-      result = this.fileTypeData.selectedNode.filetypeid == it.filetypeid;
-    }
-    return result;
-  }
-
-  selectedTitle() {
-    let result = false;
-
-    if (this.fileTypeData.selectedNode == null) {
-      result = true;
-    } else {
-      if (this.fileTypeData.selectedParent != null) {
-        result = this.fileTypeData.selectedNode.filetypeid == this.fileTypeData.selectedParent.filetypeid;
-      }
-    }
-
-    return result;
-  }
-
-  SelectTitleFileType() {
-    this.fileTypeData.selectedNode = this.fileTypeData.selectedParent;
-  }
-
-  ShowKidsFileType(it: any) {
-    //this.ClickPFileType(it);
-    this.fileTypeData.selectedNode = it;
-
-    if (it.childcount == 0) {
-      return true;
-    }
-
-    this.fileTypeData.pSelectedName = it.filetypename;
-    this.fileTypeData.selectedParent = it;
-
-    if (it.kids != null) {
-      this.typeList = it.kids;
-
-    } else {
-      this.partycourseService.GetileTypesByParent(it.filetypeid).subscribe(req => {
-        it.kids = req.item;
-        it.kids.forEach(kit => {
-          kit.parent = it;
-        });
-        this.typeList = it.kids;
-
-      });
-    }
-
-  }
-
-  BackMenu() {
-    if (this.fileTypeData.selectedParent != null) {
-      this.fileTypeData.selectedNode = this.fileTypeData.selectedParent;
-      this.fileTypeData.selectedParent = this.fileTypeData.selectedParent.parent;
-    }
-
-    if (this.fileTypeData.selectedParent != null) {
-      this.typeList = this.fileTypeData.selectedParent.kids;
-    } else {
-      this.typeList = this.fileTypeData.rootKids;
-      this.fileTypeData.pSelectedName = this.fileTypeData.title;
-      this.fileTypeData.selectedNode = null;
-    }
-  }
-
-  CloseMenu() {
-    this.menu.close('typeRoot').then(a => {
-    });
-  }
-
-  chooseFileType() {
-    if (this.fileTypeData.selectedNode == null) {
-      this.searchParams.fileTypeId = '';
-      this.fileTypeData.fileTypeName = this.fileTypeData.title;
-    } else {
-      this.searchParams.fileTypeId = this.fileTypeData.selectedNode.filetypeid.toString();
-      this.fileTypeData.fileTypeName = this.fileTypeData.selectedNode.filetypename;
-    }
-    this.searchParams.pageIndex = 1;
-    this.dataParams.target = null;
-    //this.searchParams.fileName="";
-    //this.dataList.length=0;
-    this.searchFiles.next(this.dataParams);
-    //this.loadFilesbyType();
-    this.CloseMenu();
-  }
-
-  ShowPdf(it: any) {
-    let pdfModal = this.modal.create({
-      component: ShowpdfComponent,
-      componentProps: {
-        pdfTitle: it.FILENAME,
-        // pdfUrl:"/assets/study/pdf/"+it.URL
-        pdfUrl: '/appApi/FileMgr/showDoc/' + it.FILEID,
-        pointType: 2,
-        fileid: it.FILEID,
-        duration: it.DURATION
-      }
-    });
-    this.configService.HttpGetRomote('/appApi/onlineCourse/insertCourseRecord', {
-      courseId: it.FILEID,
-      studentUserId: this.userService.GetUser().userid, pointType: 2, title: it.FILENAME,
-      userName: this.userService.GetUser().username
-    }).subscribe((data: RequsetData) => {
-      if (data.success) {
-      }
-    });
-    pdfModal.then(a => a.present());
-  }
-}

+ 0 - 6
parth5/parth5/src/app/views/pages/study/rule/rule.component.html

@@ -1,6 +0,0 @@
-<ion-content>
-  <div class="building">
-    <img class="building-img" src="assets/icon/education.svg">
-    <ion-text class="building-text">建设中...</ion-text>
-  </div>
-</ion-content>

+ 0 - 13
parth5/parth5/src/app/views/pages/study/rule/rule.component.scss

@@ -1,13 +0,0 @@
-.building {
-  display: flex;
-  flex-direction: column;
-  margin: 15px 0;
-  .building-img{
-    width: 20%;
-    display: flex;
-    align-self: center;
-  }
-  .building-text{
-    text-align: center;
-  }
-}

+ 0 - 27
parth5/parth5/src/app/views/pages/study/rule/rule.component.spec.ts

@@ -1,27 +0,0 @@
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { RuleComponent } from './rule.component';
-
-describe('RuleComponent', () => {
-  let component: RuleComponent;
-  let fixture: ComponentFixture<RuleComponent>;
-
-  beforeEach(async(() => {
-    TestBed.configureTestingModule({
-      declarations: [ RuleComponent ],
-      schemas: [CUSTOM_ELEMENTS_SCHEMA],
-    })
-    .compileComponents();
-  }));
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(RuleComponent);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 14
parth5/parth5/src/app/views/pages/study/rule/rule.component.ts

@@ -1,14 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
-  selector: 'app-rule',
-  templateUrl: './rule.component.html',
-  styleUrls: ['./rule.component.scss'],
-})
-export class RuleComponent implements OnInit {
-
-  constructor() { }
-
-  ngOnInit() {}
-
-}

+ 16 - 11
parth5/parth5/src/app/views/tapp/tab-study/tab-study.module.ts

@@ -1,24 +1,29 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {FormsModule} from '@angular/forms';
 
-import { IonicModule } from '@ionic/angular';
+import {IonicModule} from '@ionic/angular';
 
-import { TabStudyPageRoutingModule } from './tab-study-routing.module';
+import {TabStudyPageRoutingModule} from './tab-study-routing.module';
 
-import { routes } from "./tab-study.route";
+import {routes} from "./tab-study.route";
+import {PinchZoomModule} from "ngx-pinch-zoom";
+import {PdfViewerModule} from "ng2-pdf-viewer";
+import {ShowpdfComponent} from "../../../comm/modal/showpdf/showpdf.component";
 
-const pubComponents = [
 
-];
+const pubComponents = [];
 
 @NgModule({
   imports: [
     CommonModule,
     FormsModule,
     IonicModule,
-    TabStudyPageRoutingModule
+    PinchZoomModule,
+    PdfViewerModule,
+    TabStudyPageRoutingModule,
   ],
-  declarations: [...routes.map(e => e.component), ...pubComponents]
+  declarations: [...routes.map(e => e.component), ...pubComponents,ShowpdfComponent]
 })
-export class TabStudyPageModule {}
+export class TabStudyPageModule {
+}

+ 58 - 21
parth5/parth5/src/app/views/tapp/tab-study/tab-study.page.html

@@ -1,25 +1,62 @@
-<ion-header>
-  <ion-toolbar color="danger">
-    <ion-input clearInput placeholder="输入查询标题"></ion-input>
+<ion-header id="main-content">
+  <ion-toolbar>
+    <ion-label style="font-size: 20px;">制度学习</ion-label>
+    <ion-searchbar slot="end" mode="ios" enterkeyhint="search" placeholder="搜索文件名称" showCancelButton="never" (ionChange)="searchChange($event)"></ion-searchbar>
   </ion-toolbar>
+  <div class="panel-background search-panel">
+    <div class="search-label">
+      当前选中制度:
+    </div>
+    <div class="search-text">
+      <span>{{fileTypeData.fileTypeName}}</span>
+      <div class="select-right" (click)="selectFileType()">
+        <span>选目录</span>
+        <img src="assets/icon/icon-treeparty.png" height="16" width="16"/>
+      </div>
+    </div>
+  </div>
+  <ion-item class="item-filter item-title">
+  </ion-item>
 </ion-header>
 <ion-content>
-  <ion-tabs>
-    <ion-tab-bar slot="top" class="tab-bar">
-      <ion-tab-button tab="education">
-        <ion-label>专题教育</ion-label>
-      </ion-tab-button>
-      <ion-tab-button routerLink="/main/tabs/tab3/partycourse">
-        <ion-label>党课</ion-label>
-      </ion-tab-button>
-      <ion-tab-button tab="againt">
-        <ion-label>反腐倡廉</ion-label>
-      </ion-tab-button>
-      <ion-tab-button tab="rule">
-        <ion-label>法律法规</ion-label>
-      </ion-tab-button>
-    </ion-tab-bar>
-  </ion-tabs>
-
-
+  <ion-list>
+    <ion-item class="item1" (click)="ShowPdf(it)" *ngFor="let it of dataList$|async">
+      <ion-label>
+        <h4>{{it.FILENAME}}</h4>
+        <p class="item-fileno">类型:{{it.FILETYPENAME}}</p>
+      </ion-label>
+      <ion-img src="assets/icon/read-book.svg" class="img-read" slot="end"></ion-img>
+    </ion-item>
+  </ion-list>
+  <ion-infinite-scroll threshold="100px" (ionInfinite)="scroll($event)">
+    <ion-infinite-scroll-content
+      loadingSpinner="bubbles"
+      loadingText="{{total>searchParams.pageIndex*searchParams.pageSize?'正在加载...':'暂无更多'}}">
+    </ion-infinite-scroll-content>
+  </ion-infinite-scroll>
 </ion-content>
+<ion-menu menuId="typeRoot" side="end" type="overlay" class="menu-body" contentId="main-content">
+  <ion-header class="menu-header">
+    <ion-icon name="close-circle-outline" class="btn-close" (click)="CloseMenu()"></ion-icon>
+    <ion-toolbar>
+      <ion-buttons slot="start">
+        <ion-button [hidden]="fileTypeData.selectedParent==null" (click)="BackMenu()">
+          <ion-icon class="back-img" name="arrow-back-outline"></ion-icon>
+        </ion-button>
+      </ion-buttons>
+      <ion-label [class]="{'filetype-selected':selectedTitle()}" (click)="SelectTitleFileType()" class="header-title">{{fileTypeData.pSelectedName}}</ion-label>
+    </ion-toolbar>
+  </ion-header>
+  <ion-content class="menu-content">
+    <ion-list>
+      <ion-item *ngFor="let it of typeList" (click)="ShowKidsFileType(it)">
+        <ion-label [class]="{'filetype-selected':selectedItem(it)}" >{{it.filetypename}}</ion-label>
+        <ion-icon [hidden]="it.childcount==0"   name="chevron-forward-outline" slot="end"></ion-icon>
+      </ion-item>
+    </ion-list>
+  </ion-content>
+  <ion-toolbar id="menu-bar" class="toolbar-center">
+    <ion-button color="light" (click)="CloseMenu()" mode="ios">关闭</ion-button>
+    <ion-button color="danger" (click)="chooseFileType()" mode="ios">选择</ion-button>
+  </ion-toolbar>
+</ion-menu>

+ 156 - 10
parth5/parth5/src/app/views/tapp/tab-study/tab-study.page.scss

@@ -1,14 +1,160 @@
-ion-tab-button {
-  font-size: 16px;
-  color: black;
+:host{
+  --background:#000000;
 }
-ion-tab-button.tab-selected {
-  color: red;
-  text-decoration: red;
-  text-decoration-style: solid;
-  text-decoration-line: underline;
+
+.building {
+  display: flex;
+  flex-direction: column;
+  margin: 15px 0;
+  .building-img{
+    width: 20%;
+    display: flex;
+    align-self: center;
+  }
+  .building-text{
+    text-align: center;
+  }
+}
+.toolbar-label{
+  padding-left: 10px;
+}
+.search-panel {
+  padding: 5px 15px 15px 15px;
+  .search-label {
+    opacity: 0.75;
+    font-size: 14px;
+  }
+
+  .search-text {
+    display: flex;
+    justify-content: space-between;
+    padding-top: 15px;
+
+    div {
+      display: flex;
+      cursor: pointer;
+
+      img {
+        padding-left: 2px;
+      }
+    }
+  }
+}
+
+.filetype-selected {
+  color: #DE4F3F !important;
+}
+
+.back-btn {
+  padding: 10px;
 }
 
-.tab-bar{
-  --background:#ffeff1;
+#menu-bar{
+  margin-bottom: 40px;
+  :nth-child(1){
+    margin-right: 15px;
+    width: 100px;
+  }
+  :nth-child(2){
+    margin-left: 15px;
+    width: 100px;
+  }
 }
+
+.item-title{
+  height: 6px;
+}
+
+.item1{
+  --background:#F8F9FC;
+  --border-radius:10pt;
+  margin: 5px;
+
+  .img-read {
+    height: 22px;
+    width: 22px;
+  }
+}
+
+.search-panel {
+  padding: 5px 15px 15px 15px;
+
+  .search-label {
+    opacity: 0.75;
+    font-size: 14px;
+  }
+
+  .search-text {
+    display: flex;
+    justify-content: space-between;
+    padding-top: 15px;
+
+    ion-icon {
+      padding-top: 3px;
+    }
+
+    .select-right{
+      display: flex;
+      cursor: pointer;
+      margin-right: 15px;
+      img{
+        margin-left: 2px;
+        margin-top: 3px;
+      }
+    }
+  }
+}
+
+.selected {
+  color: #DE4F3F;
+
+  .img-check {
+    margin-right: 8px;
+  }
+}
+
+.menu-content {
+  .up-title {
+    color: #DE4F3F;
+  }
+
+}
+
+.menu-body {
+  --background: transparent;
+
+  .menu-header {
+    border-top-left-radius: 8px;
+    background: white;
+    --background: #fff;
+
+    ion-toolbar {
+      --background: #fff;
+      border-top-left-radius: 8px;
+    }
+    .back-img {
+      color: #380F0A;
+    }
+    .header-title {
+      padding: 20px 15px 10px 15px;
+      font-size: 15px;
+      color: #380F0A;
+      font-weight: bold;
+    }
+
+    .btn-close {
+      font-size: 22px;
+      padding: 10px 0 0 10px;
+      color: #5E4545;
+      cursor: pointer;
+    }
+  }
+
+  .toolbar-center {
+    border-bottom-left-radius: 8px;
+  }
+}
+
+
+
+

+ 288 - 2
parth5/parth5/src/app/views/tapp/tab-study/tab-study.page.ts

@@ -1,4 +1,15 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, Inject, OnInit} from '@angular/core';
+import {ActivatedRoute, Router} from "@angular/router";
+import {ConfigService, RequsetData} from "../../../service/config.service";
+import {UserService} from "../../../service/user.service";
+import {AlertController, MenuController, ModalController} from "@ionic/angular";
+import {Observable, Subject} from 'rxjs';
+import {
+  debounceTime, distinctUntilChanged, switchMap, map, tap
+} from 'rxjs/operators';
+import {DOCUMENT} from "@angular/common";
+import {ShowpdfComponent} from "../../../comm/modal/showpdf/showpdf.component";
+import {IFileParams, PartyCourseApi} from "../../../api/partycourse";
 
 @Component({
   selector: 'app-tab-study',
@@ -7,9 +18,284 @@ import { Component, OnInit } from '@angular/core';
 })
 export class TabStudyPage implements OnInit {
 
-  constructor() { }
+  private searchFiles = new Subject<any>();
+  dataList$: Observable<any[]>;
+  dataParams: any = {
+    target: null,
+    total: 10,
+    searchParams: null
+  };
+  searchParams: IFileParams = {
+    pageIndex: 1,
+    pageSize: 10,
+    fileTypeId: '',
+    fileName: ''
+  };
+
+  dataList: any[] = [];
+  typeList: any[] = [];
+
+  total: number = 30;
+  fileTypeData: any = {
+    title: '全部目录',
+    allTypeName: '制度查询',
+    pSelectedName: '全部目录',
+    rootKids: [],
+    selectedNode: null,
+    selectedParent: null,
+    fileTypeName: ''
+  };
+  sourceType: null;
+
+  constructor(private router: Router, private routeInfo: ActivatedRoute, private partyCourseApi: PartyCourseApi, private configService: ConfigService, private userService: UserService,
+              public alertController: AlertController, private menu: MenuController, private modal: ModalController, @Inject(DOCUMENT) private document: any) {
+
+
+  }
+
+  ionViewWillEnter(): void {
+    this.searchParams.pageIndex = 1;
+  }
 
   ngOnInit() {
+
+    this.dataList$ = this.searchFiles.pipe(
+      debounceTime(300),
+      distinctUntilChanged(null, x => x.searchParams.fileName + x.searchParams.fileTypeId + x.searchParams.pageIndex + x.searchParams.pageSize),
+      switchMap((params: any) => {
+
+        let sMap = this.partyCourseApi.GetFileListByType(params.searchParams).pipe(map(x => {
+
+          //this.total=x.item.total;
+          this.dataParams.total = x.item.total;
+
+          if (params.target) {
+            this.dataList = this.dataList.concat(x.item.list);
+            params.target.complete();
+          } else {
+            this.dataList = x.item.list;
+          }
+
+          return this.dataList;
+        }));
+
+        return sMap;
+      })
+    );
+    this.routeInfo.queryParams.subscribe(params => {
+      this.sourceType = params['sourceType'] == undefined ? null : params['sourceType'];
+      this.partyCourseApi.GetfileTypeRoot({sourceType: this.sourceType}).subscribe(next => {
+
+        this.fileTypeData.rootKids = next.item;
+        if (this.fileTypeData.rootKids.length > 0) {
+          if (this.sourceType != null) {
+            this.fileTypeData.selectedNode = this.fileTypeData.rootKids[0];
+            this.searchParams.fileTypeId = this.fileTypeData.selectedNode.filetypeid.toString();
+            this.fileTypeData.fileTypeName = this.fileTypeData.selectedNode.filetypename;
+          }
+          this.dataParams.searchParams = this.searchParams;
+          this.dataParams.target = null;
+          this.searchFiles.next(this.dataParams);
+          //this.loadFilesbyType();
+        }
+        this.typeList = this.fileTypeData.rootKids;
+      });
+    });
+  }
+
+
+  scroll(event) {
+
+    if (this.dataParams.total > this.searchParams.pageIndex * this.searchParams.pageSize) {
+      this.searchParams.pageIndex += 1;
+      //this.getList();
+      this.dataParams.target = event.target;
+      //this.dataParams.searchParams=this.searchParams;
+      this.searchFiles.next(this.dataParams);
+    } else {
+      setTimeout(() => {
+        event.target.complete();
+      }, 500);
+    }
+    /*
+      setTimeout(() => {
+        //event.target.complete();
+
+        }
+      }, 500);*/
+  }
+
+  back() {
+    this.router.navigateByUrl('/main/tabs/tab3');
+    //this.navCtrl.back();
+  }
+
+  searchChange(event) {
+    /*
+    this.fieldList[0].value = event.detail.value;
+    this.searchParams.dzzmc = event.detail.value;
+    this.reload();*/
+
+    //this.searchFiles.next(event.detail.value);
+
+    this.searchParams.fileName = event.detail.value;
+    this.searchParams.pageIndex = 1;
+    this.dataParams.target = null;
+    this.searchFiles.next(this.dataParams);
+    /*
+    this.searchParams.pageIndex=1;
+    this.dataList.length=0;
+    this.searchParams.fileTypeId=null;
+    this.fileTypeData.fileTypeName="";
+    this.loadFilesBySearch();*/
+  }
+
+  loadFilesBySearch() {
+
+    this.partyCourseApi.GetfileListByKey(this.searchParams).subscribe(next => {
+      //next.item
+      this.dataList = this.dataList.concat(next.item.list);
+    });
+
+  }
+
+  loadFilesbyType() {
+    //this.partycourseService.GetFileListByType(this.searchParams)
+
+    this.partyCourseApi.GetFileListByType(this.searchParams).subscribe(next => {
+      //next.item
+      //this.dataList=this.dataList.concat(next.item.list);
+
+    });
+  }
+
+  selectFileType() {
+    this.menu.enable(true, 'typeRoot').then(a => {
+    });
+    this.menu.open('typeRoot').then(a => {
+    });
+  }
+
+  ClickPFileType(it: any) {
+    /*
+    this.fileTypeData.pSelectedId=it.filetypeid;
+    this.fileTypeData.pSelectedName=it.filetypename;*/
+    //this.fileTypeData.selectedId=it.
+    this.fileTypeData.selectedNode = it;
+
+  }
+
+  selectedItem(it: any) {
+    let result = false;
+    if (this.fileTypeData.selectedNode != null) {
+      result = this.fileTypeData.selectedNode.filetypeid == it.filetypeid;
+    }
+    return result;
+  }
+
+  selectedTitle() {
+    let result = false;
+
+    if (this.fileTypeData.selectedNode == null) {
+      result = true;
+    } else {
+      if (this.fileTypeData.selectedParent != null) {
+        result = this.fileTypeData.selectedNode.filetypeid == this.fileTypeData.selectedParent.filetypeid;
+      }
+    }
+
+    return result;
+  }
+
+  SelectTitleFileType() {
+    this.fileTypeData.selectedNode = this.fileTypeData.selectedParent;
+  }
+
+  ShowKidsFileType(it: any) {
+    //this.ClickPFileType(it);
+    this.fileTypeData.selectedNode = it;
+
+    if (it.childcount == 0) {
+      return true;
+    }
+
+    this.fileTypeData.pSelectedName = it.filetypename;
+    this.fileTypeData.selectedParent = it;
+
+    if (it.kids != null) {
+      this.typeList = it.kids;
+
+    } else {
+      this.partyCourseApi.GetileTypesByParent(it.filetypeid).subscribe(req => {
+        it.kids = req.item;
+        it.kids.forEach(kit => {
+          kit.parent = it;
+        });
+        this.typeList = it.kids;
+
+      });
+    }
+
+  }
+
+  BackMenu() {
+    if (this.fileTypeData.selectedParent != null) {
+      this.fileTypeData.selectedNode = this.fileTypeData.selectedParent;
+      this.fileTypeData.selectedParent = this.fileTypeData.selectedParent.parent;
+    }
+
+    if (this.fileTypeData.selectedParent != null) {
+      this.typeList = this.fileTypeData.selectedParent.kids;
+    } else {
+      this.typeList = this.fileTypeData.rootKids;
+      this.fileTypeData.pSelectedName = this.fileTypeData.title;
+      this.fileTypeData.selectedNode = null;
+    }
+  }
+
+  CloseMenu() {
+    this.menu.close('typeRoot').then(a => {
+    });
+  }
+
+  chooseFileType() {
+    if (this.fileTypeData.selectedNode == null) {
+      this.searchParams.fileTypeId = '';
+      this.fileTypeData.fileTypeName = this.fileTypeData.title;
+    } else {
+      this.searchParams.fileTypeId = this.fileTypeData.selectedNode.filetypeid.toString();
+      this.fileTypeData.fileTypeName = this.fileTypeData.selectedNode.filetypename;
+    }
+    this.searchParams.pageIndex = 1;
+    this.dataParams.target = null;
+    //this.searchParams.fileName="";
+    //this.dataList.length=0;
+    this.searchFiles.next(this.dataParams);
+    //this.loadFilesbyType();
+    this.CloseMenu();
+  }
+
+  ShowPdf(it: any) {
+    let pdfModal = this.modal.create({
+      component: ShowpdfComponent,
+      componentProps: {
+        pdfTitle: it.FILENAME,
+        // pdfUrl:"/assets/study/pdf/"+it.URL
+        pdfUrl: '/appApi/fileMgr/showDoc/' + it.FILEID,
+        pointType: 2,
+        fileid: it.FILEID,
+        duration: it.DURATION
+      }
+    });
+    /*this.configService.HttpGetRomote('/appApi/onlineCourse/insertCourseRecord', {
+      courseId: it.FILEID,
+      studentUserId: this.userService.GetUser().userid, pointType: 2, title: it.FILENAME,
+      userName: this.userService.GetUser().username
+    }).subscribe((data: RequsetData) => {
+      if (data.success) {
+      }
+    });*/
+    pdfModal.then(a => a.present());
   }
 
 }

+ 2 - 1
parth5/parth5/tsconfig.json

@@ -12,7 +12,8 @@
     "importHelpers": true,
     "target": "es2015",
     "module": "es2020",
-    "lib": ["es2018", "dom"]
+    "lib": ["es2018", "dom"],
+    "types": ["ng2-pdf-viewer"]
   },
   "angularCompilerOptions": {
     "enableI18nLegacyMessageIdFormat": false,

+ 0 - 116
src/main/java/com/ghsc/partybuild/controller/AppFileMgrController.java

@@ -1,116 +0,0 @@
-package com.ghsc.partybuild.controller;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.github.pagehelper.PageInfo;
-import com.ghsc.partybuild.AppConfig;
-import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
-import com.ghsc.partybuild.model.DsjFilemrg;
-import com.ghsc.partybuild.service.FileMgrService;
-import com.ghsc.partybuild.util.Word2PdfUtil;
-import com.ghsc.partybuild.vo.DsjTreeFiletype;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Base64;
-import java.util.List;
-import java.util.Map;
-
-@Slf4j
-@RestController
-@RequestMapping(value = "/appApi/fileMgr")
-public class AppFileMgrController {
-
-    @Autowired
-    private FileMgrService fileMgrService;
-
-    @Autowired
-    private Word2PdfUtil word2PdfUtil;
-
-    @Autowired
-    private AppConfig appConfig;
-
-    @GetMapping("/GetFileTypeRoot")
-    @ResponseBody
-    public RequsetData<List<DsjTreeFiletype>> GetFileTypeRoot() {
-        RequsetData<List<DsjTreeFiletype>> res = new RequsetData<>();
-        //res.setItem(fileMgrService.getFileTypeRoot());
-        res.setItem(fileMgrService.getFileTreeByParent(""));
-        return res;
-    }
-
-    @PostMapping("/GetFileTypesByParent")
-    @ResponseBody
-    public RequsetData<List<DsjTreeFiletype>> GetFileTypesByParent(@RequestBody JsonNode reqMap) {
-
-        String parentId=reqMap.get("parentid").asText();
-        RequsetData<List<DsjTreeFiletype>> res = new RequsetData<>();
-        //@RequestParam("parentid") String parentId
-        List<DsjTreeFiletype> parents = fileMgrService.getFileTreeByParent(parentId);
-        res.setItem(parents);
-        return res;
-    }
-
-    @PostMapping("/GetFilesByKey")
-    @ResponseBody
-    public RequsetData<PageInfo<DsjFilemrg>> GetFilesByKey(@RequestBody JsonNode reqMap) {
-        RequsetData<PageInfo<DsjFilemrg>> res = new RequsetData<>();
-        String fileName=reqMap.get("fileName").asText();
-        int pageIndex=reqMap.get("pageIndex").asInt();
-        int pageSize=reqMap.get("pageSize").asInt();
-
-        res.setItem(fileMgrService.getFilesByKey(fileName, pageIndex, pageSize));
-
-        return res;
-    }
-
-    /**
-     * @Description //TODO 查询cf_file表附件
-     * @Date 17:32 2019/7/31
-     * @Param [fileRefID, fileTypeId, pageIndex, pageSize]
-     **/
-    @PostMapping("/getFileList")
-    @ResponseBody
-    public RequsetData<PageInfo<Map<String,Object>>> GetFileList(@RequestBody JsonNode reqMap) {
-        RequsetData<PageInfo<Map<String,Object>>> res = new RequsetData<>();
-
-        String fileName=reqMap.get("fileName")!=null?reqMap.get("fileName").asText():"";
-        String fileTypeId=reqMap.get("fileTypeId")!=null?reqMap.get("fileTypeId").asText():"";
-        int pageIndex=reqMap.get("pageIndex").asInt();
-        int pageSize=reqMap.get("pageSize").asInt();
-
-        res.setItem(fileMgrService.FindFilesApp(fileName,fileTypeId,pageIndex, pageSize));
-
-        return res;
-    }
-
-    @PostMapping({"/getFilePDF"})
-    @ResponseBody
-    public RequsetData<String> getFilePDF(@RequestBody JsonNode reqMap){
-        RequsetData<String> res=new RequsetData<>();
-        String fileId=reqMap.get("fileId").asText();
-        DsjFilemrg file = fileMgrService.getFileInfo(fileId);
-        Path pFileName = Paths.get(appConfig.fileMgrUrl, file.getFileurl() + file.getExtendedname());
-        if (Files.exists(pFileName)) {
-            ByteArrayOutputStream bout=new ByteArrayOutputStream();
-            try {
-                Files.copy(pFileName, bout);
-                String img= Base64.getEncoder().encodeToString(bout.toByteArray());
-                res.setItem(img);
-            }catch (Exception ex){
-                log.error("getFilePDF:",ex);
-                res.setSuccess(false);
-                res.setMsg(ex.getMessage());
-            }
-        }
-
-
-        return res;
-    }
-}

+ 2 - 2
src/main/java/com/ghsc/partybuild/controller/FileMgrController.java

@@ -115,7 +115,7 @@ public class FileMgrController {
     public RequsetData<List<DsjTreeFiletype>> GetFileTypeRoot() {
         RequsetData<List<DsjTreeFiletype>> res = new RequsetData<>();
         //res.setItem(fileMgrService.getFileTypeRoot());
-        res.setItem(fileMgrService.getFileTreeByParent(""));
+        res.setItem(fileMgrService.getFileTreeByParent("",null,null));
         return res;
     }
 
@@ -124,7 +124,7 @@ public class FileMgrController {
     public RequsetData<List<DsjTreeFiletype>> GetFileTypesByParent(@RequestParam("parentid") String parentId) {
         RequsetData<List<DsjTreeFiletype>> res = new RequsetData<>();
         //List<DsjFiletype> parents = fileMgrService.getFileTypeByParent(parentId);
-        List<DsjTreeFiletype> parents = fileMgrService.getFileTreeByParent(parentId);
+        List<DsjTreeFiletype> parents = fileMgrService.getFileTreeByParent(parentId,null,null);
         res.setItem(parents);
         return res;
     }

+ 160 - 0
src/main/java/com/ghsc/partybuild/controller/app/AppFileMgrController.java

@@ -0,0 +1,160 @@
+package com.ghsc.partybuild.controller.app;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.github.pagehelper.PageInfo;
+import com.ghsc.partybuild.AppConfig;
+import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
+import com.ghsc.partybuild.model.DsjFilemrg;
+import com.ghsc.partybuild.service.FileMgrService;
+import com.ghsc.partybuild.util.Word2PdfUtil;
+import com.ghsc.partybuild.vo.DsjTreeFiletype;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
+
+@Slf4j
+@RestController
+@RequestMapping(value = "/appApi/fileMgr")
+public class AppFileMgrController {
+
+    @Autowired
+    private FileMgrService fileMgrService;
+
+    @Autowired
+    private Word2PdfUtil word2PdfUtil;
+
+    @Autowired
+    private AppConfig appConfig;
+
+    @GetMapping("/GetFileTypeRoot")
+    @ResponseBody
+    public RequsetData<List<DsjTreeFiletype>> GetFileTypeRoot(@RequestParam(required = false) String sourceType) {
+        RequsetData<List<DsjTreeFiletype>> res = new RequsetData<>();
+        List<String> typeIds = new ArrayList<>();
+        List<String> passtypeIds = new ArrayList<>();
+        if (sourceType != null && !"null".equals(sourceType)) {
+            switch (Integer.parseInt(sourceType)) {
+                case 1:
+                    //党委工作手册
+                    typeIds.add("21");
+                    break;
+                case 2:
+                    //党支部工作手册
+                    typeIds.add("22");
+                    break;
+                case 3:
+                    typeIds.add("43");
+                    typeIds.add("44");
+                    typeIds.add("19");
+                    //线上课程打开制度文件
+                    passtypeIds.add("21");
+                    passtypeIds.add("22");
+                    break;
+                case 4:
+                    //党建工作制度拔萃
+                    typeIds.add("20");
+                    break;
+                default:
+                    break;
+            }
+        }
+        res.setItem(fileMgrService.getFileTreeByParent("", typeIds, passtypeIds));
+        return res;
+    }
+
+    @PostMapping("/GetFileTypesByParent")
+    @ResponseBody
+    public RequsetData<List<DsjTreeFiletype>> GetFileTypesByParent(@RequestParam(required = false) String parentId) {
+
+        RequsetData<List<DsjTreeFiletype>> res = new RequsetData<>();
+        //@RequestParam("parentid") String parentId
+        List<DsjTreeFiletype> parents = fileMgrService.getFileTreeByParent(parentId, null, null);
+        res.setItem(parents);
+        return res;
+    }
+
+    @PostMapping("/GetFilesByKey")
+    @ResponseBody
+    public RequsetData<PageInfo<DsjFilemrg>> GetFilesByKey(@RequestParam("pageIndex") Integer pageIndex, @RequestParam("pageSize") Integer pageSize, @RequestParam(required = false) String fileName) {
+        RequsetData<PageInfo<DsjFilemrg>> res = new RequsetData<>();
+
+        res.setItem(fileMgrService.getFilesByKey(fileName, pageIndex, pageSize));
+
+        return res;
+    }
+
+    /**
+     * @Description //TODO 查询cf_file表附件
+     * @Date 17:32 2019/7/31
+     * @Param [fileRefID, fileTypeId, pageIndex, pageSize]
+     **/
+    @GetMapping("/getFileList")
+    public RequsetData<PageInfo<Map<String, Object>>> GetFileList(@RequestParam("pageIndex") Integer pageIndex, @RequestParam("pageSize") Integer pageSize, @RequestParam(required = false) String fileName, @RequestParam(required = false) String fileTypeId) {
+        RequsetData<PageInfo<Map<String, Object>>> res = new RequsetData<>();
+
+        res.setItem(fileMgrService.FindFilesApp(fileName, fileTypeId, pageIndex, pageSize));
+
+        return res;
+    }
+
+    @PostMapping({"/getFilePDF"})
+    @ResponseBody
+    public RequsetData<String> getFilePDF(@RequestParam("fileId") String fileId) {
+        RequsetData<String> res = new RequsetData<>();
+        DsjFilemrg file = fileMgrService.getFileInfo(fileId);
+
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        try {
+            Path pFileName = Paths.get(appConfig.fileMgrUrl, file.getFileurl() + file.getExtendedname());
+            if (Files.exists(pFileName)) {
+                Files.copy(pFileName, bout);
+            } else {
+                pFileName = Paths.get(appConfig.fileMgrUrl, file.getFileid() + file.getExtendedname());
+                if (Files.exists(pFileName)) {
+                    Files.copy(pFileName, bout);
+                }
+            }
+            String img = Base64.getEncoder().encodeToString(bout.toByteArray());
+            res.setItem(img);
+        } catch (Exception ex) {
+            log.error("getFilePDF:", ex);
+            res.setSuccess(false);
+            res.setMsg(ex.getMessage());
+        }
+
+        return res;
+    }
+
+    @RequestMapping({"/showDoc/{fileId}"})
+    public void showDoc(HttpServletResponse response, @PathVariable("fileId") String fileId) throws IOException {
+        response.setContentType("application/pdf");
+        DsjFilemrg file = fileMgrService.getFileInfo(fileId);
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+
+        Path pFileName = Paths.get(appConfig.fileMgrUrl, file.getFileurl() + file.getExtendedname());
+
+        if (Files.exists(pFileName)) {
+            Files.copy(pFileName, bout);
+        } else {
+            pFileName = Paths.get(appConfig.fileMgrUrl, file.getFileid() + file.getExtendedname());
+            if (Files.exists(pFileName)) {
+                Files.copy(pFileName, bout);
+            }
+        }
+
+        OutputStream os = response.getOutputStream();
+
+        os.write(bout.toByteArray());
+
+        os.flush();
+    }
+}

+ 1 - 1
src/main/java/com/ghsc/partybuild/mapper/CfFileCQuery.java

@@ -10,7 +10,7 @@ import java.util.Map;
 
 @Repository
 public interface CfFileCQuery {
-    List<DsjTreeFiletype> selectTreeFiles(@Param("pFileId") String pFileId,@Param("typename") String typename);
+    List<DsjTreeFiletype> selectTreeFiles(@Param("pFileId") String pFileId,@Param("typename") String typename,@Param("typeIds") List<String> typeIds,@Param("passTypeIds") List<String> passTypeIds);
 
     List<Map<String,Object>> FindDSJ_File(@Param("fileName") String fileName,@Param("typeIds") List<String> typeIds);
 

+ 1 - 1
src/main/java/com/ghsc/partybuild/service/FileMgrService.java

@@ -50,7 +50,7 @@ public interface FileMgrService {
      * @param parentId 父id
      * @return 文件
      */
-    List<DsjTreeFiletype> getFileTreeByParent(String parentId);
+    List<DsjTreeFiletype> getFileTreeByParent(String parentId,List<String> typeIds,List<String> passTypeIds);
 
     /**
      * 获取文件树

+ 5 - 5
src/main/java/com/ghsc/partybuild/service/impl/FileMgrServiceImpl.java

@@ -139,16 +139,16 @@ public class FileMgrServiceImpl implements FileMgrService {
     }
 
     @Override
-    public List<DsjTreeFiletype> getFileTreeByParent(String parentId) {
-        
-        return cfFileCQuery.selectTreeFiles(parentId,null);
+    public List<DsjTreeFiletype> getFileTreeByParent(String parentId, List<String> typeIds, List<String> passTypeIds) {
+
+        return cfFileCQuery.selectTreeFiles(parentId, null, typeIds, passTypeIds);
     }
     @Override
     public PageInfo<Map<String, Object>> selectFiletypeList(String typename,String parentId ,int pageIndex, int pageSize) {
         PageHelper.startPage(pageIndex, pageSize);
-        List<DsjTreeFiletype> list= cfFileCQuery.selectTreeFiles(parentId,typename);
+        List<DsjTreeFiletype> list = cfFileCQuery.selectTreeFiles(parentId, typename, null, null);
         PageInfo<Map<String, Object>> pList = new PageInfo(list);
-        return  pList;
+        return pList;
     }
     @Override
     public DsjFiletype getFiletype(String typeid) {

+ 1 - 0
src/main/java/com/ghsc/partybuild/shiro/ShiroConfiguration.java

@@ -118,6 +118,7 @@ public class ShiroConfiguration {
         filterChainDefinitionMap.put("/wxapi/pay/order/notify", "anon");
         filterChainDefinitionMap.put("/wxapi/pay/OAuth", "anon");
         filterChainDefinitionMap.put("/wxapi/pay/getOpenID", "anon");
+        filterChainDefinitionMap.put("/appApi/fileMgr/showDoc/**", "anon");
         filterChainDefinitionMap.put("/**", "authc");
 
         // 如果不设置默认会自动寻找Web工程根目录下的"/login.jsp"页面

+ 15 - 3
src/main/resources/mapping/CfFileCQuery.xml

@@ -18,13 +18,25 @@
             and f.PARENTTYPEID = #{ pFileId }
         </if>
         <if test="typename !='' and typename!=null">
-            and f.FILETYPENAME like concat('%',#{typename},'%')
-
+            and f.FILETYPENAME like '%'||#{typename}||'%'
         </if>
         <if test="pFileId == null or pFileId ==''">
             and f.PARENTTYPEID is null
         </if>
-
+        <if test="typeIds!=null and typeIds.size()!=0">
+            and f.FILETYPEID in
+            <foreach collection="typeIds" item="typeId"
+                     index="index" open="(" close=")" separator=",">
+                #{typeId}
+            </foreach>
+        </if>
+        <if test="passTypeIds!=null and passTypeIds.size()!=0">
+            and f.FILETYPEID not in
+            <foreach collection="passTypeIds" item="typeId"
+                     index="index" open="(" close=")" separator=",">
+                #{typeId}
+            </foreach>
+        </if>
         order by treelevel asc
 
     </select>