|
@@ -17,6 +17,7 @@ import {
|
|
|
NonNullableFormBuilder,
|
|
|
Validators,
|
|
|
} from '@angular/forms';
|
|
|
+import { CompUploadComponent } from '../../../../app/comp-upload/comp-upload.component';
|
|
|
@Component({
|
|
|
selector: 'app-basic',
|
|
|
imports: [
|
|
@@ -25,7 +26,8 @@ import {
|
|
|
NzSelectModule,
|
|
|
NzRadioModule,
|
|
|
NzUploadModule,
|
|
|
- NzTagModule
|
|
|
+ NzTagModule,
|
|
|
+ CompUploadComponent
|
|
|
],
|
|
|
standalone: true,
|
|
|
templateUrl: './basic-in.component.html',
|
|
@@ -91,8 +93,8 @@ export class BasicInComponent implements OnInit {
|
|
|
printSum: [0, [Validators.required]],
|
|
|
importantProject: ['', [Validators.required]],
|
|
|
importantProjectOther: [''],
|
|
|
- copyrightImgUrl: ['https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf'],
|
|
|
- CIPImgUrl: ['https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf'],
|
|
|
+ copyrightImgUrl: [''],
|
|
|
+ CIPImgUrl: [''],
|
|
|
// remember: [true],
|
|
|
});
|
|
|
//教材应用对象及所诉学科专业类
|
|
@@ -219,7 +221,13 @@ export class BasicInComponent implements OnInit {
|
|
|
this.msg.error(`${info.file.name} file upload failed.`);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ upload(e: any, type:string) {
|
|
|
+ console.log(e);
|
|
|
+ let file = e[0];
|
|
|
+ if(type == 'copyrightImgUrl' || type == 'CIPImgUrl' ){
|
|
|
+ this.validateForm.value[type] = file
|
|
|
+ }
|
|
|
+ }
|
|
|
async submitForm(event?: string): Promise<void> {
|
|
|
console.log(this.validateForm.value);
|
|
|
if (this.validateForm.valid) {
|
|
@@ -327,6 +335,13 @@ export class BasicInComponent implements OnInit {
|
|
|
this.eduTextbook?.set('importantProjectOther', params.importantProjectOther);
|
|
|
this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl);
|
|
|
this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl);
|
|
|
+ if(this.tbookSer.profile?.user?.department.objectId){
|
|
|
+ this.eduTextbook?.set('department', {
|
|
|
+ __type: 'Pointer',
|
|
|
+ className: 'Department',
|
|
|
+ objectId: this.tbookSer.profile.user.department.objectId,
|
|
|
+ });
|
|
|
+ }
|
|
|
await this.eduTextbook?.save();
|
|
|
return
|
|
|
}
|