|
@@ -9,6 +9,7 @@ import { AttachmentComponent } from '../components/attachment/attachment.compone
|
|
|
import { FaithComponent } from '../components/faith/faith.component';
|
|
|
// import { NzLayoutModule } from 'ng-zorro-antd/layout';
|
|
|
import Parse from 'parse';
|
|
|
+import { textbookServer } from '../../../services/textbook';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-apply',
|
|
@@ -19,7 +20,7 @@ import Parse from 'parse';
|
|
|
TextbookPertainComponent,
|
|
|
TextbookContentComponent,
|
|
|
AttachmentComponent,
|
|
|
- FaithComponent
|
|
|
+ FaithComponent,
|
|
|
],
|
|
|
standalone: true,
|
|
|
templateUrl: './apply.component.html',
|
|
@@ -33,30 +34,39 @@ export class ApplyComponent implements OnInit {
|
|
|
'0': '教材基本信息',
|
|
|
'1': '教材适用情况',
|
|
|
'2': '申报教材建设历程',
|
|
|
- '3':'',
|
|
|
+ '3': '',
|
|
|
'4': '附件材料',
|
|
|
};
|
|
|
return map[this.state];
|
|
|
}
|
|
|
showFrom: boolean = false;
|
|
|
|
|
|
- constructor(private router: Router, private activeRoute: ActivatedRoute) {}
|
|
|
-/** 路由传递教材id*/
|
|
|
-eduId:any
|
|
|
+ constructor(
|
|
|
+ // private router: Router,
|
|
|
+ private activeRoute: ActivatedRoute,
|
|
|
+ private tbookSer: textbookServer
|
|
|
+ ) {}
|
|
|
+ /** 路由传递教材id*/
|
|
|
+ eduId: any;
|
|
|
async ngOnInit() {
|
|
|
- let that = this
|
|
|
+ let that = this;
|
|
|
this.activeRoute.paramMap.subscribe(async (params) => {
|
|
|
let id = params.get('id');
|
|
|
- that.eduId = id
|
|
|
- console.log(that.eduId)
|
|
|
+ that.eduId = id;
|
|
|
+ // console.log(that.eduId);
|
|
|
if (id) {
|
|
|
let query = new Parse.Query('EduTextbook');
|
|
|
query.equalTo('objectId', id);
|
|
|
this.textBook = await query.first();
|
|
|
- console.log(this.textBook);
|
|
|
- if(this.textBook?.get('render')){
|
|
|
- window.alert("已提交,禁止编辑")
|
|
|
- history.back()
|
|
|
+ // console.log(this.textBook);
|
|
|
+ if(this.tbookSer?.profile?.user?.objectId != this.textBook?.get('user').id && this.tbookSer.profile.identity != '国家级管理员'){
|
|
|
+ window.alert('非创建用户,不可编辑');
|
|
|
+ history.back();
|
|
|
+ return
|
|
|
+ }
|
|
|
+ else if (this.textBook?.get('render') && this.tbookSer.profile.identity != '国家级管理员') {
|
|
|
+ window.alert('已提交,禁止编辑');
|
|
|
+ history.back();
|
|
|
}
|
|
|
}
|
|
|
this.showFrom = true;
|
|
@@ -64,16 +74,16 @@ eduId:any
|
|
|
}
|
|
|
changeState(event: string | any) {
|
|
|
console.log(event);
|
|
|
- if(event?.textBook){
|
|
|
- this.textBook = event?.textBook
|
|
|
+ if (event?.textBook) {
|
|
|
+ this.textBook = event?.textBook;
|
|
|
}
|
|
|
if (event?.type == 'pre') {
|
|
|
this.state--;
|
|
|
- } else if(event?.type == 'next'){
|
|
|
+ } else if (event?.type == 'next') {
|
|
|
this.state++;
|
|
|
}
|
|
|
- let topEle = document.getElementById('top')
|
|
|
- if(topEle){
|
|
|
+ let topEle = document.getElementById('top');
|
|
|
+ if (topEle) {
|
|
|
topEle.scrollIntoView({ behavior: 'smooth' });
|
|
|
}
|
|
|
}
|