Browse Source

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

ryanemax 8 months ago
parent
commit
ee30a627fd

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

@@ -85,7 +85,7 @@ export class CompManageComponent implements OnInit {
         id:'1',
       },
     ],
-    "流程管理员登录":[
+    "合集管理员":[
       {
         name:'报送流程',
         id:'1',

+ 20 - 1
projects/textbook/src/modules/nav-admin/create-collection/create-collection.component.ts

@@ -3,6 +3,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { CommonCompModule } from '../../../services/common.modules';
 import { Router, ActivatedRoute } from '@angular/router';
 import { NzSelectModule } from 'ng-zorro-antd/select';
+import Parse from 'parse';
 import {
   FormControl,
   FormGroup,
@@ -25,6 +26,7 @@ import { ProfileComponent } from '../components/profile/profile.component'
   styleUrls: ['./create-collection.component.scss'],
 })
 export class CreateCollectionComponent  implements OnInit {
+  eduCollection:Parse.Object|undefined
   provinces: Array<string> = provinces.options
   showEdit:boolean = false
 
@@ -40,6 +42,7 @@ export class CreateCollectionComponent  implements OnInit {
     area: ['', [Validators.required]],
   })
   constructor(
+    private activeRoute: ActivatedRoute,
     private router: Router,
     public tbookSer: textbookServer,
     private fb: NonNullableFormBuilder,
@@ -47,7 +50,23 @@ export class CreateCollectionComponent  implements OnInit {
     private modal: NzModalService
   ) { }
 
-  ngOnInit() {}
+  ngOnInit() {
+    this.activeRoute.paramMap.subscribe(async (params) => {
+      let id = params.get('id');
+      if (id) {
+        let query = new Parse.Query('EduCollection');
+        query.equalTo('objectId', id);
+        this.eduCollection = await query.first()
+      }
+      this.validateForm = this.fb.group({
+        name: [this.eduCollection?.get('this.eduCollection') ||'', [Validators.required]],
+        desc: [this.eduCollection?.get('this.desc') ||'', [Validators.required]],
+        code: [this.eduCollection?.get('this.code') ||'', [Validators.required]],
+        area: [this.eduCollection?.get('this.area') ||'', [Validators.required]],
+      })
+    });
+  }
+
   submitForm(): void {
     if (this.validateForm.valid) {
       console.log('submit', this.validateForm.value);

+ 0 - 3
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.scss

@@ -40,9 +40,6 @@
       line-height: 22px;
       text-align: left;
     }
-    .explain{
-      
-    }
   }
   .tips{
     margin-top: 10px;

+ 12 - 0
server/db/schemas/EduCollection.js

@@ -13,6 +13,18 @@ export const EduCollection = {
             "type": "String",
             "required": false
         },
+        "code": {
+            "type": "String",
+            "required": false
+        },
+        "area": {//所属省份
+            "type": "String",
+            "required": false
+        },
+        "num": {
+            "type": "Number",//流程数量
+            "required": false
+        },
         "profileSubmitted": {
             "type": "Pointer",
             "targetClass":"Profile",