|
@@ -18,6 +18,7 @@ import {
|
|
|
Validators,
|
|
|
} from '@angular/forms';
|
|
|
import { CompUploadComponent } from '../../../../app/comp-upload/comp-upload.component';
|
|
|
+import { NzInputModule } from 'ng-zorro-antd/input';
|
|
|
@Component({
|
|
|
selector: 'app-basic',
|
|
|
imports: [
|
|
@@ -26,6 +27,7 @@ import { CompUploadComponent } from '../../../../app/comp-upload/comp-upload.com
|
|
|
NzSelectModule,
|
|
|
NzRadioModule,
|
|
|
NzUploadModule,
|
|
|
+ NzInputModule,
|
|
|
NzTagModule,
|
|
|
CompUploadComponent
|
|
|
],
|
|
@@ -39,6 +41,32 @@ export class BasicInComponent implements OnInit {
|
|
|
@Output() state: EventEmitter<any> = new EventEmitter<any>();
|
|
|
@Output() save: EventEmitter<any> = new EventEmitter<any>();
|
|
|
|
|
|
+ /**
|
|
|
+ * 书号自动补全函数
|
|
|
+ * @param isbn 书号
|
|
|
+ */
|
|
|
+ async autoCompleteByISBN(){
|
|
|
+ let isbn = this.validateForm.value?.ISBN;
|
|
|
+ let result = await Parse.Cloud.run("tbookISBN",{
|
|
|
+ isbn:isbn
|
|
|
+ })
|
|
|
+ if(!result?.isbn){
|
|
|
+ this.msg.warning('未找到该书号的图书信息,请手动填写')
|
|
|
+ }
|
|
|
+
|
|
|
+ // 其他字段,需补充接口与数据库对应关系
|
|
|
+ this.validateForm.get("title")?.setValue(result?.book_name)
|
|
|
+ this.validateForm.get("author")?.setValue(result?.author_name)
|
|
|
+ this.validateForm.get("authors")?.setValue(result?.author)
|
|
|
+ this.validateForm.get("majorPoniter")?.setValue(result?.major)
|
|
|
+ this.validateForm.get("lang")?.setValue(languages.options?.[result?.languages]?.name)
|
|
|
+ this.validateForm.get("editionUnit")?.setValue(result?.publisher)
|
|
|
+ this.validateForm.get("editionDate")?.setValue(new Date(result?.publish_time))
|
|
|
+ this.validateForm.get("carrierShape")?.setValue(result?.publication_class)
|
|
|
+
|
|
|
+ console.log(result)
|
|
|
+ }
|
|
|
+
|
|
|
validateForm: FormGroup<{
|
|
|
title: FormControl<string>; //申报教材名称
|
|
|
ISBN: FormControl<string>; //国际标准书号
|
|
@@ -111,21 +139,25 @@ export class BasicInComponent implements OnInit {
|
|
|
name: '生物工程学',
|
|
|
code: 'M003',
|
|
|
},
|
|
|
+ {
|
|
|
+ name: '工商管理',
|
|
|
+ code: 'M004',
|
|
|
+ },
|
|
|
];
|
|
|
//语言选择
|
|
|
selectLang: Array<any> = languages.options;
|
|
|
//载体形式
|
|
|
carrierOptions: Array<any> = [
|
|
|
{
|
|
|
- name: '载体一',
|
|
|
+ name: '纸质教材',
|
|
|
code: 'Z001',
|
|
|
},
|
|
|
{
|
|
|
- name: '载体二',
|
|
|
+ name: '电子教材',
|
|
|
code: 'Z002',
|
|
|
},
|
|
|
{
|
|
|
- name: '载体三',
|
|
|
+ name: '其他教材',
|
|
|
code: 'Z003',
|
|
|
},
|
|
|
];
|