|
@@ -212,66 +212,85 @@ export class TextbookPertainComponent implements OnInit {
|
|
|
}
|
|
|
}
|
|
|
async submitForm(event?: string): Promise<void> {
|
|
|
- if (event == 'pre') {
|
|
|
- this.state.emit({ type: 'pre' });
|
|
|
- return
|
|
|
- }
|
|
|
- let authorListVrifly = !this.authorList.some(item => Object.values(item).some(val => val == '' || val == undefined))
|
|
|
- let achievementOptionsVrifly = !this.achievementOptions.some(item => Object.values(item).some(val => val == '' || val == undefined))
|
|
|
-
|
|
|
- if (this.validateForm.valid) {
|
|
|
- let params: any = this.validateForm.value;
|
|
|
- if (event == 'next') {
|
|
|
- if (!authorListVrifly) {
|
|
|
- this.msg.warning('作者信息填写不完整')
|
|
|
- return
|
|
|
- } else if (!achievementOptionsVrifly) {
|
|
|
- this.msg.warning('相关科学研究项目、成果或论文专著填写不完整')
|
|
|
- return
|
|
|
- }
|
|
|
- await this.saveEduTextbook(params, true);
|
|
|
- this.state.emit({ type: 'next', textBook: this.eduTextbook });
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (event == 'save') {
|
|
|
- let params: any = this.validateForm.value;
|
|
|
- await this.saveEduTextbook(params, (this.validateForm.valid && authorListVrifly && achievementOptionsVrifly));
|
|
|
- this.modal.success({
|
|
|
- nzTitle: '保存成功',
|
|
|
- nzContent: '<p>已保存并且至空间</p>',
|
|
|
- nzOnOk: () => console.log('Info OK'),
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- if (event == 'next') {
|
|
|
- // if(!authorListVrifly){
|
|
|
- // this.msg.warning('作者信息填写不完整')
|
|
|
- // return
|
|
|
- // }else if(!achievementOptionsVrifly){
|
|
|
- // this.msg.warning('相关科学研究项目、成果或论文专著填写不完整')
|
|
|
- // return
|
|
|
- // }
|
|
|
let params: any = this.validateForm.value;
|
|
|
await this.saveEduTextbook(params, false);
|
|
|
- this.state.emit({ type: 'next', textBook: this.eduTextbook });
|
|
|
- }
|
|
|
- // Object.values(this.validateForm.controls).forEach((control) => {
|
|
|
- // if (control.invalid) {
|
|
|
- // control.markAsDirty();
|
|
|
- // control.updateValueAndValidity({ onlySelf: true });
|
|
|
- // }
|
|
|
- // });
|
|
|
- // this.msg.warning('请填写完整信息');
|
|
|
- }
|
|
|
- if (event == 'save') {
|
|
|
- let params = this.validateForm.value;
|
|
|
- await this.saveEduTextbook(params, (this.validateForm.valid && authorListVrifly && achievementOptionsVrifly));
|
|
|
- this.modal.success({
|
|
|
- nzTitle: '保存成功',
|
|
|
- nzContent: '<p>已保存并且至空间</p>',
|
|
|
- nzOnOk: () => console.log('Info OK'),
|
|
|
- });
|
|
|
- }
|
|
|
+ if (event == 'pre') {
|
|
|
+ this.state.emit({ type: 'pre' });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (event == 'next') {
|
|
|
+ this.state.emit({ type: 'next', textBook: this.eduTextbook });
|
|
|
+ }
|
|
|
+ if (event == 'save') {
|
|
|
+ this.modal.success({
|
|
|
+ nzTitle: '保存成功',
|
|
|
+ nzContent: '<p>已保存并且至空间</p>',
|
|
|
+ nzOnOk: () => console.log('Info OK'),
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // if (event == 'pre') {
|
|
|
+ // this.state.emit({ type: 'pre' });
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // let authorListVrifly = !this.authorList.some(item => Object.values(item).some(val => val == '' || val == undefined))
|
|
|
+ // let achievementOptionsVrifly = !this.achievementOptions.some(item => Object.values(item).some(val => val == '' || val == undefined))
|
|
|
+
|
|
|
+ // if (this.validateForm.valid) {
|
|
|
+ // let params: any = this.validateForm.value;
|
|
|
+ // if (event == 'next') {
|
|
|
+ // if (!authorListVrifly) {
|
|
|
+ // this.msg.warning('作者信息填写不完整')
|
|
|
+ // return
|
|
|
+ // } else if (!achievementOptionsVrifly) {
|
|
|
+ // this.msg.warning('相关科学研究项目、成果或论文专著填写不完整')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // await this.saveEduTextbook(params, true);
|
|
|
+ // this.state.emit({ type: 'next', textBook: this.eduTextbook });
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (event == 'save') {
|
|
|
+ // let params: any = this.validateForm.value;
|
|
|
+ // await this.saveEduTextbook(params, (this.validateForm.valid && authorListVrifly && achievementOptionsVrifly));
|
|
|
+ // this.modal.success({
|
|
|
+ // nzTitle: '保存成功',
|
|
|
+ // nzContent: '<p>已保存并且至空间</p>',
|
|
|
+ // nzOnOk: () => console.log('Info OK'),
|
|
|
+ // });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if (event == 'next') {
|
|
|
+ // // if(!authorListVrifly){
|
|
|
+ // // this.msg.warning('作者信息填写不完整')
|
|
|
+ // // return
|
|
|
+ // // }else if(!achievementOptionsVrifly){
|
|
|
+ // // this.msg.warning('相关科学研究项目、成果或论文专著填写不完整')
|
|
|
+ // // return
|
|
|
+ // // }
|
|
|
+ // let params: any = this.validateForm.value;
|
|
|
+ // await this.saveEduTextbook(params, false);
|
|
|
+ // this.state.emit({ type: 'next', textBook: this.eduTextbook });
|
|
|
+ // }
|
|
|
+ // // Object.values(this.validateForm.controls).forEach((control) => {
|
|
|
+ // // if (control.invalid) {
|
|
|
+ // // control.markAsDirty();
|
|
|
+ // // control.updateValueAndValidity({ onlySelf: true });
|
|
|
+ // // }
|
|
|
+ // // });
|
|
|
+ // // this.msg.warning('请填写完整信息');
|
|
|
+ // }
|
|
|
+ // if (event == 'save') {
|
|
|
+ // let params = this.validateForm.value;
|
|
|
+ // await this.saveEduTextbook(params, (this.validateForm.valid && authorListVrifly && achievementOptionsVrifly));
|
|
|
+ // this.modal.success({
|
|
|
+ // nzTitle: '保存成功',
|
|
|
+ // nzContent: '<p>已保存并且至空间</p>',
|
|
|
+ // nzOnOk: () => console.log('Info OK'),
|
|
|
+ // });
|
|
|
+ // }
|
|
|
}
|
|
|
changeCode() { }
|
|
|
getCode(e: any) { }
|
|
@@ -365,13 +384,13 @@ export class TextbookPertainComponent implements OnInit {
|
|
|
// let obj = Parse.Object.extend('EduTextbook');
|
|
|
// this.eduTextbook = new obj();
|
|
|
}
|
|
|
- //如果填写未完整,仅保存,状态修改待完善101
|
|
|
- if (this.eduTextbook.get('status') == '102' && !isComplete) {
|
|
|
- this.eduTextbook?.set('status', '101');
|
|
|
- this.eduTextbook.set('complete', false)
|
|
|
- } else if (!this.eduTextbook.get('status')) {
|
|
|
- this.eduTextbook?.set('status', '101');
|
|
|
- }
|
|
|
+ // //如果填写未完整,仅保存,状态修改待完善101
|
|
|
+ // if (this.eduTextbook.get('status') == '102' && !isComplete) {
|
|
|
+ // this.eduTextbook?.set('status', '101');
|
|
|
+ // this.eduTextbook.set('complete', false)
|
|
|
+ // } else if (!this.eduTextbook.get('status')) {
|
|
|
+ // this.eduTextbook?.set('status', '101');
|
|
|
+ // }
|
|
|
this.eduTextbook?.set('user', Parse.User.current()?.toPointer());
|
|
|
this.eduTextbook?.set('company', {
|
|
|
__type: 'Pointer',
|
|
@@ -392,7 +411,6 @@ export class TextbookPertainComponent implements OnInit {
|
|
|
await this.eduTextbook?.save();
|
|
|
return;
|
|
|
}
|
|
|
- // http://hep-textbook.oss-cn-beijing.aliyuncs.com/66988340e4964b67e5c0d7b4/2024-7-19/1721355300725-%E5%A4%9A%E8%82%89.jpg
|
|
|
|
|
|
/**获取文件名 */
|
|
|
getFileName(url: string) {
|