Selaa lähdekoodia

update 信息填写

warrior 10 kuukautta sitten
vanhempi
commit
d40bddee80

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

@@ -1,3 +1,43 @@
-<p>
-  apply works!
-</p>
+<nz-page-header class="site-page-header" nzTitle="" nzSubtitle="">
+  <nz-breadcrumb nz-page-header-breadcrumb>
+    <nz-breadcrumb-item>个人空间</nz-breadcrumb-item>
+    <nz-breadcrumb-item>
+      <a>创建材料</a>
+    </nz-breadcrumb-item>
+  </nz-breadcrumb>
+</nz-page-header>
+<div class="content">
+  <div class="top">
+    <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-steps>
+  </div>
+  <div class="state-title">{{stateMap}}</div>
+  <div class="submit-block">
+    <div class="entry">
+
+      
+    </div>
+    <div class="footer">
+      <button nz-button nzType="primary">下一步</button>
+      <button nz-button nzType="default">保存</button>
+    </div>
+  </div>
+  @switch (state) {
+    @case (1) {
+
+    }
+    @case (1) {
+
+    }
+    @case (1) {
+
+    }
+    @case (1) {
+
+    }
+  }
+</div>

+ 25 - 0
projects/textbook/src/modules/nav-author/apply/apply.component.scss

@@ -0,0 +1,25 @@
+.content{
+  padding:10px 20px;
+  .state-title{
+    font-size: 18px;
+    margin: 20px 0;
+    font-weight: bold;
+  }
+  .submit-block{
+    min-width: 800px;
+    max-width: 1000px;
+    min-height: 600px;
+    margin: 10px auto;
+    .entry{
+      min-height: 500px;
+      border: 1px solid;
+    }
+    .footer{
+      display: flex;
+      margin: 10px auto;
+      align-items: center;
+      justify-content: space-evenly;
+      width: 200px;
+    }
+  }
+}

+ 13 - 3
projects/textbook/src/modules/nav-author/apply/apply.component.ts

@@ -1,7 +1,6 @@
 import { Component, OnInit } from '@angular/core';
 import { CommonCompModule } from '../../../services/common.modules'
 import { Router } from '@angular/router';
-
 @Component({
   selector: 'app-apply',
   imports: [CommonCompModule],
@@ -10,8 +9,19 @@ import { Router } from '@angular/router';
   styleUrls: ['./apply.component.scss']
 })
 export class ApplyComponent implements OnInit {
-
-  constructor() { }
+  state:number = 0
+  get stateMap(){
+    let map:any = {
+      '0':'填写基本信息',
+      '1':'填写材料适用情况',
+      '2':'填写材料内容',
+      '3':'上传附件及承诺',
+    }
+    return map[this.state]
+  }
+  constructor(
+    private router:Router
+  ) { }
 
   ngOnInit() {
   }

+ 37 - 36
projects/textbook/src/modules/nav-author/page-home/page-home.component.ts

@@ -1,18 +1,17 @@
 import { Component, OnInit } from '@angular/core';
-import { CompNavComponent } from '../../../app/comp-nav/comp-nav.component'
+import { CompNavComponent } from '../../../app/comp-nav/comp-nav.component';
 import { RouterOutlet, Router } from '@angular/router';
-import { CommonCompModule } from '../../../services/common.modules'
+import { CommonCompModule } from '../../../services/common.modules';
 
 @Component({
   selector: 'app-page-home',
   standalone: true,
-  imports: [CompNavComponent,RouterOutlet,CommonCompModule],
+  imports: [CompNavComponent, RouterOutlet, CommonCompModule],
   templateUrl: './page-home.component.html',
   styleUrls: ['./page-home.component.scss'],
 })
-export class PageHomeComponent  implements OnInit {
-
-  options:Array<any> = [
+export class PageHomeComponent implements OnInit {
+  options: Array<any> = [
     // {
     //   name:'教材管理',
     //   id:'5',
@@ -25,46 +24,48 @@ export class PageHomeComponent  implements OnInit {
     //   ]
     // },
     {
-      name:'个人空间',
-      id:'1',
-      child:[
+      name: '个人空间',
+      id: '1',
+      child: [
         {
-          name:'创建教材',
-          id:'1-1',
-          path:"/nav-author/manage/apply"
+          name: '创建教材',
+          id: '1-1',
+          path: '/nav-author/manage/apply',
         },
         {
-          name:'教材列表',
-          id:'1-2',
-          path:"/nav-author/manage/textbook",
+          name: '教材列表',
+          id: '1-2',
+          path: '/nav-author/manage/textbook',
         },
-      ]
+      ],
     },
     {
-      name:'回收站',
-      id:'2',
-      path:'/nav-author/manage/textbook',
-      params:{
-        isDeleted:true
-      }
+      name: '回收站',
+      id: '2',
+      path: '/nav-author/manage/textbook',
+      params: {
+        isDeleted: true,
+      },
     },
     {
-      name:'个人信息',
-      id:'3',
-      path:"/nav-author/profile"
+      name: '个人信息',
+      id: '3',
+      path: '/nav-author/profile',
     },
-  ]
-  active:string = localStorage.getItem('active') || this.options[0].id
-  constructor(
-    public router: Router,
-  ) { }
+  ];
+  active: string = localStorage.getItem('active') || this.options[0].id;
+  constructor(public router: Router) {}
 
   ngOnInit() {}
-  toUrl(child:any){
-    let cateid = child.id
-    this.active = cateid
-    localStorage.setItem('active', cateid)
-    console.log(child)
-    child?.path&&this.router.navigateByUrl(child?.path)
+  toUrl(child: any) {
+    let cateid = child.id;
+    this.active = cateid;
+    localStorage.setItem('active', cateid);
+    console.log(child);
+    if (child.params) {
+      this.router.navigate([child.path, child?.params]);
+    } else {
+      this.router.navigate([child.path]);
+    }
   }
 }

+ 10 - 1
projects/textbook/src/modules/nav-author/page-textbook/page-textbook.component.ts

@@ -24,6 +24,7 @@ export class PageTextbookComponent  implements OnInit {
 
   constructor(
     private route: ActivatedRoute,
+    private activeRoute: ActivatedRoute,
     // private translate:TranslateService,
   ) {
     this.user = Parse.User.current();
@@ -36,7 +37,15 @@ export class PageTextbookComponent  implements OnInit {
   }
 
   ngOnInit(): void {
-    
+    this.activeRoute.paramMap.subscribe(async (params) => {
+      let isDeleted = params.get('isDeleted')
+      if(isDeleted){
+        this.queryParams.where['isDeleted'] = {$eq:true}
+      }else{
+        this.queryParams.where['isDeleted'] = {$ne:true}
+      }
+      this.list?.ngOnInit()
+    });
   }
 
 }

+ 9 - 1
projects/textbook/src/services/common.modules.ts

@@ -6,6 +6,10 @@ import { NzTableModule } from "ng-zorro-antd/table";
 import { NzTagModule } from "ng-zorro-antd/tag";
 import { NzDropDownModule } from "ng-zorro-antd/dropdown";
 import { NzMenuModule } from 'ng-zorro-antd/menu';
+import { NzPageHeaderModule } from 'ng-zorro-antd/page-header';
+import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
+import { NzStepsModule } from 'ng-zorro-antd/steps';
+import { NzButtonModule } from 'ng-zorro-antd/button';
 @NgModule({
   exports: [
     FormsModule,
@@ -14,7 +18,11 @@ import { NzMenuModule } from 'ng-zorro-antd/menu';
     NzTableModule,
     NzTagModule,
     NzDropDownModule,
-    NzMenuModule
+    NzMenuModule,
+    NzPageHeaderModule,
+    NzBreadCrumbModule,
+    NzStepsModule,
+    NzButtonModule
   ]
 })
 export class CommonCompModule { }