diff --git a/src/app/examiner/create-test-score/create-test-score.component.html b/src/app/examiner/create-test-score/create-test-score.component.html index ecd59ea..b5bf94a 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.html +++ b/src/app/examiner/create-test-score/create-test-score.component.html @@ -259,8 +259,7 @@ - - +
diff --git a/src/app/examiner/create-test-score/create-test-score.component.ts b/src/app/examiner/create-test-score/create-test-score.component.ts index 75cae92..95067d5 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.ts +++ b/src/app/examiner/create-test-score/create-test-score.component.ts @@ -30,10 +30,10 @@ export class CreateTestScoreComponent implements OnInit { pattern: any = this.route.snapshot.queryParams.pattern || '' ngOnInit(): void { if (this.route.snapshot.queryParams.status == 0) { - //已创建完成未开考 + //已创建完成 未开考 this.getSoloPaper() } else { - console.log('this.unitId',this.unitId) + console.log('this.unitId', this.unitId) this.unitId = JSON.parse(sessionStorage.getItem(sessionStorage.getItem('paperId'))) for (let y = 0, length = this.unitId.length; y < length; y++) { let element = this.unitId[y] @@ -85,13 +85,11 @@ export class CreateTestScoreComponent implements OnInit { console.log('试卷信息', this.editdata) if (data.paperDataInfo) { data.paperDataInfo.forEach(item => { + console.log('xxxx', JSON.parse(item.originalData)) this.unitId.push(JSON.parse(item.originalData)) }) - // console.log('试卷信息',this.unitId) this.planItemScore() - } else { } - }) } diff --git a/src/app/examiner/examiner-index/examiner-index.component.ts b/src/app/examiner/examiner-index/examiner-index.component.ts index 50f6589..5b37402 100644 --- a/src/app/examiner/examiner-index/examiner-index.component.ts +++ b/src/app/examiner/examiner-index/examiner-index.component.ts @@ -6,19 +6,19 @@ * @LastEditors: sueRimn * @LastEditTime: 2021-02-25 11:44:34 */ -import { Component, OnInit, ViewChild, Inject,Input } from '@angular/core'; -import {HttpClient} from '@angular/common/http' +import { Component, OnInit, ViewChild, Inject, Input } from '@angular/core'; +import { HttpClient } from '@angular/common/http' import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatPaginator } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { PageEvent } from '@angular/material/paginator'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; -import {FormControl} from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router'; +import { FormControl } from '@angular/forms'; +import { Router, ActivatedRoute } from '@angular/router'; import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; import { FlatTreeControl } from '@angular/cdk/tree'; import { TreeService } from '../../http-interceptors/tree.service' - +import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree' @Component({ selector: 'app-examiner-index', @@ -27,44 +27,43 @@ import { TreeService } from '../../http-interceptors/tree.service' }) export class ExaminerIndexComponent implements OnInit { - constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private tree: TreeService) { } + constructor(private router: Router, private activatedRoute: ActivatedRoute, public http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private tree: TreeService) { } //displayedColumns: string[] = ['name', 'organization', 'startTime', 'overTime', 'testState', 'operation']; ngOnInit(): void { - this.getunitdata(); - this.getOrganizations(); + this.getUnittype(); this.getAlltabledate(); this.getProfiles() } //获取登录账号的个人资料 - Profiles:any - getProfiles(){ - this.http.get('/api/ExamAccounts/Profiles').subscribe((data:any) => { - console.log(data) + Profiles: any + getProfiles() { + this.http.get('/api/ExamAccounts/Profiles').subscribe((data: any) => { this.Profiles = data - sessionStorage.setItem('creatorData',JSON.stringify(data)) + sessionStorage.setItem('creatorData', JSON.stringify(data)) + this.getOrganizations(); }) } - displayedColumns: string[] = ['name','startTime','endTime', 'examzhong','scc']; - tabledataSource:any + displayedColumns: string[] = ['name', 'startTime', 'endTime', 'examzhong', 'scc']; + tabledataSource: any accound helpName//消防救援对名称 optionId @ViewChild('son') son; //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any //第几页 - startTime:[] - endTime:[] - allorganizations:any - allunittype:any //获取所有的单位类型 - jscheck:any //辖区中队包含下级 + PageNumber: any //第几页 + startTime: [] + endTime: [] + allorganizations: any + allunittype: any //获取所有的单位类型 + jscheck: any //辖区中队包含下级 private _transformer = (node, level: number) => { //初始化tree return { expandable: !!node.children && node.children.length > 0, @@ -80,216 +79,211 @@ export class ExaminerIndexComponent implements OnInit { dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); hasChild = (_: number, node: any) => node.expandable; - //得到当前单位信息 - getunitdata(){ - this.http.get("/api/ExamAccounts/Profiles").subscribe( - (data:any)=>{ - this.organizationName = data.organizationName + //获得所有组织机构 + getOrganizations() { + this.http.get('/api/Organizations').subscribe( + (data: any) => { + this.allorganizations = data + console.log(this.allorganizations) + this.treedata = this.tree.toTree(data); + this.getpresentOrganization(); + } + ) + } + organizationName: any //当前单位组织机构名称 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 + newallorganizations2: any + //得到当前单位所在组织机构的tree型数据 + getpresentOrganization() { + this.newallorganizations = this.allorganizations + this.newallorganizations.forEach(item => { + item.children = [] + this.newallorganizations.forEach(element => { + if (element.parentId == item.id) { + item.children.push(element) } - ) - } - organizationName:any //当前单位组织机构名称 - treedata:any //组织机构树型数据 - newArr:any = [] - newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 - newallorganizations2:any - //得到当前单位所在组织机构的tree型数据 - getpresentOrganization(){ - this.newallorganizations = this.allorganizations - this.newallorganizations.forEach(item => { - item.children = [] - this.newallorganizations.forEach(element => { - if(element.parentId == item.id){ - item.children.push(element) - } - }); }); - this.http.get("/api/ExamAccounts/Profiles").subscribe( - (data:any)=>{ - this.organizationName = data.organizationName - if(this.organizationName){ - this.newallorganizations.forEach(item => { - if(item.name == this.organizationName){ - this.dataSource.data = [item] - this.newallorganizations2 = [item] - } - }); - }else{ - this.newallorganizations2 = this.treedata - this.dataSource.data = this.treedata - } + }); + this.organizationName = this.Profiles.organizationName + if (this.organizationName) { + this.newallorganizations.forEach(item => { + if (item.name == this.organizationName) { + this.dataSource.data = [item] + this.newallorganizations2 = [item] } - ) - + }); + } else { + this.newallorganizations2 = this.treedata + this.dataSource.data = this.treedata } + } - //编辑试卷 - editPaper(item){ - console.log(item) - if(item.status == 2){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('考试结束,不能编辑','确定',config); - }else if(item.status == 1){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('开考中,不能编辑','确定',config); - } - else{ - sessionStorage.setItem("paperId",item.id) - this.router.navigateByUrl(`/examiner/create-test-score?pattern=edit&status=${item.status}`) - } - } - lookPaper(item){ - sessionStorage.setItem("paperId",item.id) - this.router.navigateByUrl(`/examiner/create-test-score?pattern=look&status=${item.status}`) - } - //获得所有组织机构 - getOrganizations(){ - this.http.get('/api/Organizations').subscribe( - (data:any)=>{ - this.allorganizations = data - this.treedata = this.tree.toTree(data); - this.getpresentOrganization(); - } - ) + //编辑试卷 + editPaper(item) { + console.log(item) + if (item.status == 2) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('考试结束,不能编辑', '确定', config); + } else if (item.status == 1) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('开考中,不能编辑', '确定', config); } - - //获得所有单位类型 - getUnittype(){ - this.http.get('/api/BuildingTypes/Simple').subscribe( - data=>{ - this.allunittype = data - } - ) + else if (item.status == -1) {//未发布 + sessionStorage.setItem("paperId", item.id) + this.router.navigate(['/home/createexam-index/examiner-new-one']) //跳转试卷列表页面 + } else { + sessionStorage.setItem("paperId", item.id) + this.router.navigateByUrl(`/examiner/create-test-score?pattern=edit&status=${item.status}`) } + } + lookPaper(item) { + sessionStorage.setItem("paperId", item.id) + this.router.navigateByUrl(`/examiner/create-test-score?pattern=look&status=${item.status}`) + } - //获得查询支队信息 - help(){ - let paramsdata:any = { - PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], - Sort: null, - SortType: null, + + //获得所有单位类型 + getUnittype() { + this.http.get('/api/BuildingTypes/Simple').subscribe( + data => { + this.allunittype = data } - //console.log(paramsdata) - this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{ - this.tabledataSource=data - console.log(this.tabledataSource) - }) - } - //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 - this.getAlltabledate() + ) + } + + //获得查询支队信息 + help() { + let paramsdata: any = { + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + Sort: null, + SortType: null, } + //console.log(paramsdata) + this.http.get("/api/Papers", { params: paramsdata }).subscribe((data: any) => { + this.tabledataSource = data + console.log(this.tabledataSource) + }) + } + //分页事件 + chagePage(e) { + this.PageNumber = e.pageIndex + 1 + this.getAlltabledate() + } //获取表格信息 - getAlltabledate(){ - let paramsdata:any = { + getAlltabledate() { + let paramsdata: any = { PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], + PageSize: this.pageSizeOptions[0], OrganizationId: this.jsId || '', - HasChildren:this.jscheck || '', + HasChildren: this.jscheck || '', Sort: null, SortType: null, } - this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{ - this.tabledataSource=data.items - this.length=data.totalCount + this.http.get("/api/Papers", { params: paramsdata }).subscribe((data: any) => { + this.tabledataSource = data.items + this.length = data.totalCount //console.log(this.tabledataSource) }) } //获取消防救援对信息 - getHelp(){ - let paramsdata:any={ - Name:'', - IdentityCard:'', - Phone:'', - RealName:'', - OrganizationId:'', - PageNumber:'', - PageSize:'', - Sort:'', - RoleType:'1', - SortType:'' + getHelp() { + let paramsdata: any = { + Name: '', + IdentityCard: '', + Phone: '', + RealName: '', + OrganizationId: '', + PageNumber: '', + PageSize: '', + Sort: '', + RoleType: '1', + SortType: '' } - this.http.get("/api/ExamUsers",{params:paramsdata}).subscribe((data:any)=>{ - this.helpName=data.items + this.http.get("/api/ExamUsers", { params: paramsdata }).subscribe((data: any) => { + this.helpName = data.items }) } //获取optionid - getoption(){ - var selectIndex =document.getElementById("cars"); + getoption() { + var selectIndex = document.getElementById("cars"); //console.log(selectIndex) //var activeName_value =document.getElementById("usertype").options[selectIndex].id; } //查询按钮 - findClick(){ + findClick() { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - let paramsdata:any = { + let paramsdata: any = { PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], + PageSize: this.pageSizeOptions[0], OrganizationId: this.jsId || '', - HasChildren:this.jscheck || '', + HasChildren: this.jscheck || '', Sort: null, SortType: null, } - if(this.jsId==undefined){ - this.snackBar.open('请输入消防救援队名称','确定',config); + if (this.jsId == undefined) { + this.snackBar.open('请输入消防救援队名称', '确定', config); } - else{ - this.http.get(`/api/Papers`,{params:paramsdata}).subscribe((data:any)=>{ + else { + this.http.get(`/api/Papers`, { params: paramsdata }).subscribe((data: any) => { console.log(data) }) } //console.log(this.accound) - console.log(this.jscheck,this.jsId) + console.log(this.jscheck, this.jsId) this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.getAlltabledate() } //重置按钮 - Reset(){ + Reset() { //this.accound=undefined - this.jsId='' - this.js='' - this.jscheck='' + this.jsId = '' + this.js = '' + this.jscheck = '' this.getAlltabledate() } //删除一套考题 - deleteExam(examid){ + deleteExam(examid) { let isTrue = confirm('您确定要删除吗') - if(isTrue){ + if (isTrue) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.http.delete(`/api/Papers/${examid}`).subscribe((data:any)=>{ - this.snackBar.open('删除试卷成功','确定',config); - this.getAlltabledate() - }) + this.http.delete(`/api/Papers/${examid}`).subscribe((data: any) => { + this.snackBar.open('删除试卷成功', '确定', config); + this.getAlltabledate() + }) } - - + + } //新增考题跳转 - newExamination(){ + newExamination() { //this.router.navigate(['/home/createexam-index/examiner-new-one']) const dialogRef = this.dialog.open(FinishDia, { - width: '650px', - //data: paperDataInfo + width: '685px', + data: { + Profiles: this.Profiles, + treedata: this.treedata + } }); } //辖区中队div是否显示 - isorganizationbox:boolean = false - js:any //辖区中队输入框 - jsId:any //辖区中队选择的id - stopclose(e){ + isorganizationbox: boolean = false + js: any //辖区中队输入框 + jsId: any //辖区中队选择的id + stopclose(e) { e.stopPropagation(); } //点击辖区中队树,将选择的辖区中队添加到变量 @@ -305,11 +299,11 @@ export class ExaminerIndexComponent implements OnInit { //打开辖区中队隐藏框 openorganizationbox() { this.isorganizationbox = true - + } - + //关闭出现的组织机构div - closediv(){ + closediv() { this.isorganizationbox = false } @@ -321,55 +315,58 @@ export class ExaminerIndexComponent implements OnInit { templateUrl: 'finishDia.html', styleUrls: ['finishDia.scss'] }) -export class FinishDia{ +export class FinishDia { + // @ViewChild('nzTreSelect', { static: false }) nzTreSelect!: NzTreeComponent; + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } + //获取登录账号的个人资料 + Profiles: any + treedata + nodes = [] - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} ngOnInit(): void { - this.getProfiles() - } - //获取登录账号的个人资料 - Profiles:any - getProfiles(){ - this.http.get('/api/ExamAccounts/Profiles').subscribe((data:any) => { - console.log(data) - this.Profiles = data - sessionStorage.setItem('creatorData',JSON.stringify(data)) - }) + this.Profiles = this.data.Profiles + this.nodes = this.data.treedata } + selectedOr + + onChange($event: string[]): void { + console.log($event); + } - startTime:string//考试开始时间 - endTime:string//考试结束时间 - examName:string//考试名称 - indexid:string//创建考试的id + startTime: string//考试开始时间 + endTime: string//考试结束时间 + examName: string//考试名称 + indexid: string//创建考试的id tabledate - + //弹窗确定点击事件 onNoClick(): void { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if(this.startTime!=undefined&&this.endTime!=undefined&&this.examName!=undefined){ - if(this.startTime > this.endTime){ - this.snackBar.open('开始时间不能大于结束时间','确定',config); + if (this.startTime != undefined && this.endTime != undefined && this.examName != undefined && this.selectedOr != undefined) { + + if (this.startTime > this.endTime) { + this.snackBar.open('开始时间不能大于结束时间', '确定', config); } - else{ + else { //截取字符串,得到日期部分"2009-12-02",用split把字符串分隔成数组 - var begin1=this.startTime.substr(0,10).split("-"); - var end1=this.endTime.substr(0,10).split("-"); + var begin1 = this.startTime.substr(0, 10).split("-"); + var end1 = this.endTime.substr(0, 10).split("-"); //将拆分的数组重新组合,并实例成化新的日期对象 - var date1=new Date(begin1[1] + - + begin1[2] + - + begin1[0]); - var date2=new Date(end1[1] + - + end1[2] + - + end1[0]); + var date1 = new Date(begin1[1] + - + begin1[2] + - + begin1[0]); + var date2 = new Date(end1[1] + - + end1[2] + - + end1[0]); //得到两个日期之间的差值m,以分钟为单位 - var m=Number(Math.abs(Number(date2)-Number(date1))/1000/60); + var m = Number(Math.abs(Number(date2) - Number(date1)) / 1000 / 60); //小时数和分钟数相加得到总的分钟数 - var min1=parseInt(this.startTime.substr(11,2))*60+parseInt(this.startTime.substr(14,2)); - var min2=parseInt(this.endTime.substr(11,2))*60+parseInt(this.endTime.substr(14,2)); + var min1 = parseInt(this.startTime.substr(11, 2)) * 60 + parseInt(this.startTime.substr(14, 2)); + var min2 = parseInt(this.endTime.substr(11, 2)) * 60 + parseInt(this.endTime.substr(14, 2)); //两个分钟数相减得到时间部分的差值,以分钟为单位 - var n=min2-min1; + var n = min2 - min1; //将日期和时间两个部分计算出来的差值相加,即得到两个时间相减后的分钟数 - var minutes=m+n; - let params = { + var minutes = m + n; + let body = { id: null, title: this.examName, duration: minutes, @@ -379,38 +376,42 @@ export class FinishDia{ endTime: this.endTime, organizationId: this.Profiles.organizationId, creatorId: this.Profiles.id, - paperDataInfo: null + paperDataInfo: null, + organizationIds: this.selectedOr } - - this.http.post('/api/Papers',params).subscribe(data => { - this.snackBar.open('创建成功','确定',config); + + console.log(this.selectedOr) + this.http.post('/api/Papers', body).subscribe(data => { + this.snackBar.open('创建成功', '确定', config); this.dialogRef.close(); //sessionStorage.removeItem("checkedWork") - this.tabledate=data + this.tabledate = data console.log(this.tabledate) - sessionStorage.setItem("paperId",this.tabledate.id) + sessionStorage.setItem("paperId", this.tabledate.id) this.router.navigate(['/home/createexam-index/examiner-new-one']) //跳转试卷列表页面 - },err => { - this.snackBar.open(err,'确定',config); + }, err => { + this.snackBar.open(err, '确定', config); }) } } - else{ - if(this.startTime==undefined) - this.snackBar.open('请输入开始时间','确定',config); - else if(this.endTime==undefined) - this.snackBar.open('请输入结束时间','确定',config); - else if(this.examName==undefined) - this.snackBar.open('请输入试卷名称','确定',config); + else { + + if (this.startTime == undefined) + this.snackBar.open('请输入开始时间', '确定', config); + else if (this.endTime == undefined) + this.snackBar.open('请输入结束时间', '确定', config); + else if (this.examName == undefined) + this.snackBar.open('请输入试卷名称', '确定', config); + else if (this.selectedOr == undefined) + this.snackBar.open('请选择考核队站', '确定', config); } - + } - - close(){ + + close() { this.dialogRef.close(); } } - \ No newline at end of file diff --git a/src/app/examiner/examiner-index/finishDia.html b/src/app/examiner/examiner-index/finishDia.html index 7cd8b49..adb6717 100644 --- a/src/app/examiner/examiner-index/finishDia.html +++ b/src/app/examiner/examiner-index/finishDia.html @@ -9,24 +9,45 @@
-
+
+
+
+
+ + + + + + + + + expand_more + + + chevron_right + + + +
-
- -
+
+
-
+
- +
- -
- - + +
+ +
\ No newline at end of file diff --git a/src/app/examiner/examiner-index/finishDia.scss b/src/app/examiner/examiner-index/finishDia.scss index 93c9f42..9451607 100644 --- a/src/app/examiner/examiner-index/finishDia.scss +++ b/src/app/examiner/examiner-index/finishDia.scss @@ -1,44 +1,49 @@ -.box{ +.box { + display: flex; + flex-direction: column; + margin-left: 10px; + box-sizing: border-box; + padding: 16px; + input { + width: 280px; + height: 30px; + line-height: 30px; + border-radius: 2px; + padding-left: 5px; + outline: none; + border: 1px solid rgb(226, 211, 211); + } + + .diaone { display: flex; flex-direction: column; - margin-left: 20px; - input{ - width: 260px; - height: 40px; - line-height: 34px; - border-radius: 5px; - padding-left: 5px; - outline: none; - border: 1px solid rgb(226, 211, 211); - } - .diaone{ - display: flex; - flex-direction: column; - - button { - border: none; - color: white; - padding: 5px 25px; - text-align: center; - text-decoration: none; - display: inline-block; - font-size: 16px; - margin: 4px 2px; - cursor: pointer; - border-radius: 8px; - outline:0 none !important; - } + margin-bottom: 8px; + button { + border: none; + color: white; + padding: 5px 25px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; + border-radius: 8px; + outline: 0 none !important; } - .diatwo{ - margin-top: 20px; - display: flex; - flex-direction: row; - .endtime{ - margin-left: 20px; - } - .datepicker{ - height: 44px; - border-radius: 5px; - } + } + + .diatwo { + display: flex; + flex-direction: row; + + .endtime { + margin-left: 20px; + } + + .datepicker { + height: 44px; + border-radius: 5px; } + } } diff --git a/src/app/examiner/examiner-new-one/examiner-new-one.component.ts b/src/app/examiner/examiner-new-one/examiner-new-one.component.ts index d12fcc4..0f05c58 100644 --- a/src/app/examiner/examiner-new-one/examiner-new-one.component.ts +++ b/src/app/examiner/examiner-new-one/examiner-new-one.component.ts @@ -12,7 +12,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @@ -27,19 +27,19 @@ import { MatTableDataSource } from '@angular/material/table'; }) export class ExaminerNewOneComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } ngOnInit(): void { - + this.getunitdata(); this.getOrganizations(); this.getUnittype(); this.getAllKeyUnit(); } - pattern:any = this.route.snapshot.queryParams.pattern || '' - indexid=sessionStorage.getItem("paperId") //上个页面传过来的id + pattern: any = this.route.snapshot.queryParams.pattern || '' + indexid = sessionStorage.getItem("paperId") //上个页面传过来的id - removeClass=document.getElementsByClassName("mat-form-field-underline") + removeClass = document.getElementsByClassName("mat-form-field-underline") private _transformer = (node, level: number) => { //初始化tree return { expandable: !!node.children && node.children.length > 0, @@ -58,241 +58,261 @@ export class ExaminerNewOneComponent implements OnInit { @ViewChild(MatSort) sort: MatSort; - allunittype:any //获取所有的单位类型 + allunittype: any //获取所有的单位类型 //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any //第几页 - - displayedColumns: string[] = ['checked','unitname','jurisdictionsquadron', 'unittype','scc']; - tabledataSource:any - allorganizations:any - oldDataSource:any; //原始表格数据 + PageNumber: any //第几页 + + displayedColumns: string[] = ['checked', 'unitname', 'jurisdictionsquadron', 'unittype', 'scc']; + tabledataSource: any + allorganizations: any + oldDataSource: any; //原始表格数据 //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 + chagePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAllKeyUnit(); } //获得所有重点单位 wanzhengduArr = [ - {id:0,zong:94,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:10,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:22,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:7,totalpoints:10}, - {name:'实景图',score:10,totalpoints:10}, - {name:'CAD上传',score:10,totalpoints:10}, - ]}, - {id:1,zong:90,details:[ - {name:'单位信息',score:4,totalpoints:5}, - {name:'建筑信息',score:8,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:25,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:8,totalpoints:10}, - {name:'实景图',score:5,totalpoints:10}, - {name:'CAD上传',score:10,totalpoints:10}, - ]}, - {id:2,zong:89,details:[ - {name:'单位信息',score:4,totalpoints:5}, - {name:'建筑信息',score:10,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:22,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:8,totalpoints:10}, - {name:'实景图',score:5,totalpoints:10}, - {name:'CAD上传',score:10,totalpoints:10}, - ]}, - {id:3,zong:87,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:8,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:20,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:6,totalpoints:10}, - {name:'实景图',score:10,totalpoints:10}, - {name:'CAD上传',score:8,totalpoints:10}, - ]}, - {id:4,zong:86,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:10,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:18,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:8,totalpoints:10}, - {name:'实景图',score:5,totalpoints:10}, - {name:'CAD上传',score:10,totalpoints:10}, - ]}, - {id:5,zong:81,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:8,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:22,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:5,totalpoints:10}, - {name:'实景图',score:10,totalpoints:10}, - {name:'CAD上传',score:6,totalpoints:10}, - ]}, - {id:6,zong:80,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:8,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:20,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:7,totalpoints:10}, - {name:'实景图',score:0,totalpoints:10}, - {name:'CAD上传',score:10,totalpoints:10}, - ]}, - {id:7,zong:78,details:[ - {name:'单位信息',score:4,totalpoints:5}, - {name:'建筑信息',score:8,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:22,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:6,totalpoints:10}, - {name:'实景图',score:0,totalpoints:10}, - {name:'CAD上传',score:8,totalpoints:10}, - ]}, - {id:8,zong:78,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:8,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:20,totalpoints:25}, - {name:'消防设施',score:5,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:5,totalpoints:10}, - {name:'实景图',score:5,totalpoints:10}, - {name:'CAD上传',score:10,totalpoints:10}, - ]}, - {id:9,zong:73,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:7,totalpoints:10}, - {name:'平面图',score:10,totalpoints:10}, - {name:'四周毗邻',score:18,totalpoints:25}, - {name:'消防设施',score:0,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:5,totalpoints:10}, - {name:'实景图',score:10,totalpoints:10}, - {name:'CAD上传',score:8,totalpoints:10}, - ]} + { + id: 0, zong: 94, details: [ + { name: '单位信息', score: 5, totalpoints: 5 }, + { name: '建筑信息', score: 10, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 22, totalpoints: 25 }, + { name: '消防设施', score: 10, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 7, totalpoints: 10 }, + { name: '实景图', score: 10, totalpoints: 10 }, + { name: 'CAD上传', score: 10, totalpoints: 10 }, + ] + }, + { + id: 1, zong: 90, details: [ + { name: '单位信息', score: 4, totalpoints: 5 }, + { name: '建筑信息', score: 8, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 25, totalpoints: 25 }, + { name: '消防设施', score: 10, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 8, totalpoints: 10 }, + { name: '实景图', score: 5, totalpoints: 10 }, + { name: 'CAD上传', score: 10, totalpoints: 10 }, + ] + }, + { + id: 2, zong: 89, details: [ + { name: '单位信息', score: 4, totalpoints: 5 }, + { name: '建筑信息', score: 10, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 22, totalpoints: 25 }, + { name: '消防设施', score: 10, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 8, totalpoints: 10 }, + { name: '实景图', score: 5, totalpoints: 10 }, + { name: 'CAD上传', score: 10, totalpoints: 10 }, + ] + }, + { + id: 3, zong: 87, details: [ + { name: '单位信息', score: 5, totalpoints: 5 }, + { name: '建筑信息', score: 8, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 20, totalpoints: 25 }, + { name: '消防设施', score: 10, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 6, totalpoints: 10 }, + { name: '实景图', score: 10, totalpoints: 10 }, + { name: 'CAD上传', score: 8, totalpoints: 10 }, + ] + }, + { + id: 4, zong: 86, details: [ + { name: '单位信息', score: 5, totalpoints: 5 }, + { name: '建筑信息', score: 10, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 18, totalpoints: 25 }, + { name: '消防设施', score: 10, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 8, totalpoints: 10 }, + { name: '实景图', score: 5, totalpoints: 10 }, + { name: 'CAD上传', score: 10, totalpoints: 10 }, + ] + }, + { + id: 5, zong: 81, details: [ + { name: '单位信息', score: 5, totalpoints: 5 }, + { name: '建筑信息', score: 8, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 22, totalpoints: 25 }, + { name: '消防设施', score: 10, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 5, totalpoints: 10 }, + { name: '实景图', score: 10, totalpoints: 10 }, + { name: 'CAD上传', score: 6, totalpoints: 10 }, + ] + }, + { + id: 6, zong: 80, details: [ + { name: '单位信息', score: 5, totalpoints: 5 }, + { name: '建筑信息', score: 8, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 20, totalpoints: 25 }, + { name: '消防设施', score: 10, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 7, totalpoints: 10 }, + { name: '实景图', score: 0, totalpoints: 10 }, + { name: 'CAD上传', score: 10, totalpoints: 10 }, + ] + }, + { + id: 7, zong: 78, details: [ + { name: '单位信息', score: 4, totalpoints: 5 }, + { name: '建筑信息', score: 8, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 22, totalpoints: 25 }, + { name: '消防设施', score: 10, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 6, totalpoints: 10 }, + { name: '实景图', score: 0, totalpoints: 10 }, + { name: 'CAD上传', score: 8, totalpoints: 10 }, + ] + }, + { + id: 8, zong: 78, details: [ + { name: '单位信息', score: 5, totalpoints: 5 }, + { name: '建筑信息', score: 8, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 20, totalpoints: 25 }, + { name: '消防设施', score: 5, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 5, totalpoints: 10 }, + { name: '实景图', score: 5, totalpoints: 10 }, + { name: 'CAD上传', score: 10, totalpoints: 10 }, + ] + }, + { + id: 9, zong: 73, details: [ + { name: '单位信息', score: 5, totalpoints: 5 }, + { name: '建筑信息', score: 7, totalpoints: 10 }, + { name: '平面图', score: 10, totalpoints: 10 }, + { name: '四周毗邻', score: 18, totalpoints: 25 }, + { name: '消防设施', score: 0, totalpoints: 10 }, + { name: '重点部位', score: 10, totalpoints: 10 }, + { name: '功能分区', score: 5, totalpoints: 10 }, + { name: '实景图', score: 10, totalpoints: 10 }, + { name: 'CAD上传', score: 8, totalpoints: 10 }, + ] + } ] - allKeyUnitInfo:any //所有的重点单位 - getAllKeyUnit(){ + allKeyUnitInfo: any //所有的重点单位 + getAllKeyUnit() { // console.log(Boolean(Number(this.follow))) - let follow - if(this.follow == ''){ + let follow + if (this.follow == '') { follow = '' } - if(this.follow == '0'){ + if (this.follow == '0') { follow = false } - if(this.follow == '1'){ + if (this.follow == '1') { follow = true } - let paramsdata:any = { + let paramsdata: any = { Name: this.companyName || '', OrganizationId: this.jsId || '', - HasChildren:this.jscheck || '', - USCI:this.shehui || '', + HasChildren: this.jscheck || '', + USCI: this.shehui || '', IsFollowed: follow, - BuildingTypeId: this.unittype || '', + BuildingTypeId: this.unittype || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], + PageSize: this.pageSizeOptions[0], Sort: this.integritySort ? 'integrityscore' : '', SortType: this.integritySort || '', } //console.log(paramsdata) - this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => { //console.log(data) this.length = data.totalCount this.allKeyUnitInfo = data // data.items.sort( (a,b) => { // return a.usci - b.usci // }) - data.items.forEach( (item,index) => { + data.items.forEach((item, index) => { item.integrity = this.wanzhengduArr[index] }) //console.log(789,data.items) this.tabledataSource = new MatTableDataSource(data.items); //console.log(this.tabledataSource) - if(this.selectedunitArr.length!=0){ - for(var i=0;i{ - this.organizationName = data.organizationName + (data: any) => { + this.organizationName = data.organizationName } ) } - organizationName:any //当前单位组织机构名称 - treedata:any //组织机构树型数据 - newArr:any = [] - newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 - newallorganizations2:any + organizationName: any //当前单位组织机构名称 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 + newallorganizations2: any //得到当前单位所在组织机构的tree型数据 - getpresentOrganization(){ + getpresentOrganization() { this.newallorganizations = this.allorganizations this.newallorganizations.forEach(item => { item.children = [] this.newallorganizations.forEach(element => { - if(element.parentId == item.id){ + if (element.parentId == item.id) { item.children.push(element) } }); }); this.http.get("/api/ExamAccounts/Profiles").subscribe( - (data:any)=>{ + (data: any) => { this.organizationName = data.organizationName - if(this.organizationName){ + if (this.organizationName) { this.newallorganizations.forEach(item => { - if(item.name == this.organizationName){ + if (item.name == this.organizationName) { this.dataSource.data = [item] this.newallorganizations2 = [item] } }); - }else{ + } else { this.newallorganizations2 = this.treedata this.dataSource.data = this.treedata } } ) - + } //获得所有组织机构 - getOrganizations(){ + getOrganizations() { this.http.get('/api/Organizations').subscribe( - (data:any)=>{ + (data: any) => { this.allorganizations = data this.treedata = this.tree.toTree(data); this.getpresentOrganization(); @@ -301,127 +321,122 @@ export class ExaminerNewOneComponent implements OnInit { } //获得所有单位类型 - getUnittype(){ + getUnittype() { this.http.get('/api/BuildingTypes/Simple').subscribe( - data=>{ + data => { this.allunittype = data } ) } - selectedunitArr:any =JSON.parse(sessionStorage.getItem(this.indexid))||[] //选中单位的数组 - deleteByid=""//根据id取消选中 + selectedunitArr: any = JSON.parse(sessionStorage.getItem(this.indexid)) || [] //选中单位的数组 + deleteByid = ""//根据id取消选中 //勾选框事件 - checkChange(e,element){ - console.log(e,element) + checkChange(e, element) { + console.log(e, element) element.checked = e.checked - if(element.checked){ + if (element.checked) { this.selectedunitArr.push(element) } - else{ - for(var i=0;i { - if(item.checked){ + if (item.checked) { selectedunitArr.push(item.id) selectedunitobj.push(item) } }); - if(selectedunitArr.length == 0){ + if (selectedunitArr.length == 0) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请先选择要修改的单位','确定',config); + this.snackBar.open('请先选择要修改的单位', '确定', config); } - if(selectedunitArr.length != 1 && selectedunitArr.length != 0){ + if (selectedunitArr.length != 1 && selectedunitArr.length != 0) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('只能选择一个单位修改','确定',config); + this.snackBar.open('只能选择一个单位修改', '确定', config); } - if(selectedunitArr.length == 1){ //带着id跳到修改页面 + if (selectedunitArr.length == 1) { //带着id跳到修改页面 // console.log(778,selectedunitArr[0]) this.allKeyUnitInfo.items.forEach(item => { - if(item.id == selectedunitArr[0]){ + if (item.id == selectedunitArr[0]) { let companyName = item.name - sessionStorage.setItem("companyName",companyName) + sessionStorage.setItem("companyName", companyName) } }); - sessionStorage.setItem("editable","1") - sessionStorage.setItem(selectedunitobj[0].id,JSON.stringify(selectedunitobj[0].companyIntegrityScore)) + sessionStorage.setItem("editable", "1") + sessionStorage.setItem(selectedunitobj[0].id, JSON.stringify(selectedunitobj[0].companyIntegrityScore)) window.open(`/keyUnit/editplaninfo?id=${selectedunitArr[0]}`); } } //重置 - js:any //辖区中队输入框 - jsId:any //辖区中队选择的id - companyName:any //单位名称 - shehui:any //统一社会信用代码 - unittype:any //单位类型 - jscheck:any //辖区中队包含下级 + js: any //辖区中队输入框 + jsId: any //辖区中队选择的id + companyName: any //单位名称 + shehui: any //统一社会信用代码 + unittype: any //单位类型 + jscheck: any //辖区中队包含下级 OrganizationId // - follow:any = '' //是否为关注单位 - integritySort:any //完整度排序 - reset(){ - this.js='' //辖区中队输入框 - this.jscheck='' //辖区中队包含下级 - this.companyName='' //单位名称 - this.shehui='' //统一社会信用代码 - this.unittype='' //单位类型 + follow: any = '' //是否为关注单位 + integritySort: any //完整度排序 + reset() { + this.js = '' //辖区中队输入框 + this.jscheck = '' //辖区中队包含下级 + this.companyName = '' //单位名称 + this.shehui = '' //统一社会信用代码 + this.unittype = '' //单位类型 this.jsId = '' this.follow = '' this.PageNumber = 1 @@ -431,19 +446,19 @@ export class ExaminerNewOneComponent implements OnInit { } //提交查询表单 - onSubmit(value){ + onSubmit(value) { this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.getAllKeyUnit(); } - bigclosediv(e){ + bigclosediv(e) { this.isorganizationbox = false } - stopclose(e){ + stopclose(e) { e.stopPropagation(); } //辖区中队div是否显示 - isorganizationbox:boolean = false + isorganizationbox: boolean = false //点击辖区中队树,将选择的辖区中队添加到变量 add(node) { this.isorganizationbox = false @@ -457,14 +472,14 @@ export class ExaminerNewOneComponent implements OnInit { //打开辖区中队隐藏框 openorganizationbox() { this.isorganizationbox = true - + } - + //关闭出现的组织机构div - closediv(){ + closediv() { this.isorganizationbox = false } - + } diff --git a/src/app/examiner/examiner.module.ts b/src/app/examiner/examiner.module.ts index 161b344..0fab9bf 100644 --- a/src/app/examiner/examiner.module.ts +++ b/src/app/examiner/examiner.module.ts @@ -1,52 +1,52 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { examinerRoutingModule } from './examiner-routing'; -import {A11yModule} from '@angular/cdk/a11y'; -import {DragDropModule} from '@angular/cdk/drag-drop'; -import {PortalModule} from '@angular/cdk/portal'; -import {ScrollingModule} from '@angular/cdk/scrolling'; -import {CdkStepperModule} from '@angular/cdk/stepper'; -import {CdkTableModule} from '@angular/cdk/table'; -import {CdkTreeModule} from '@angular/cdk/tree'; -import {MatAutocompleteModule} from '@angular/material/autocomplete'; -import {MatBadgeModule} from '@angular/material/badge'; -import {MatBottomSheetModule} from '@angular/material/bottom-sheet'; -import {MatButtonModule} from '@angular/material/button'; -import {MatButtonToggleModule} from '@angular/material/button-toggle'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatStepperModule} from '@angular/material/stepper'; -import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatExpansionModule} from '@angular/material/expansion'; -import {MatGridListModule} from '@angular/material/grid-list'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatNativeDateModule, MatRippleModule, MatOption} from '@angular/material/core'; -import {MatPaginatorModule} from '@angular/material/paginator'; -import {MatProgressBarModule} from '@angular/material/progress-bar'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatRadioModule} from '@angular/material/radio'; -import {MatSelectModule} from '@angular/material/select'; -import {MatSidenavModule} from '@angular/material/sidenav'; -import {MatSliderModule} from '@angular/material/slider'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; -import {MatSnackBarModule} from '@angular/material/snack-bar'; -import {MatSortModule} from '@angular/material/sort'; -import {MatTableModule} from '@angular/material/table'; -import {MatTabsModule} from '@angular/material/tabs'; -import {MatToolbarModule} from '@angular/material/toolbar'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {MatTreeModule} from '@angular/material/tree'; +import { A11yModule } from '@angular/cdk/a11y'; +import { DragDropModule } from '@angular/cdk/drag-drop'; +import { PortalModule } from '@angular/cdk/portal'; +import { ScrollingModule } from '@angular/cdk/scrolling'; +import { CdkStepperModule } from '@angular/cdk/stepper'; +import { CdkTableModule } from '@angular/cdk/table'; +import { CdkTreeModule } from '@angular/cdk/tree'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatBottomSheetModule } from '@angular/material/bottom-sheet'; +import { MatButtonModule } from '@angular/material/button'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatCardModule } from '@angular/material/card'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatChipsModule } from '@angular/material/chips'; +import { MatStepperModule } from '@angular/material/stepper'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatGridListModule } from '@angular/material/grid-list'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatNativeDateModule, MatRippleModule, MatOption } from '@angular/material/core'; +import { MatPaginatorModule } from '@angular/material/paginator'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSidenavModule } from '@angular/material/sidenav'; +import { MatSliderModule } from '@angular/material/slider'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatSortModule } from '@angular/material/sort'; +import { MatTableModule } from '@angular/material/table'; +import { MatTabsModule } from '@angular/material/tabs'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatTreeModule } from '@angular/material/tree'; import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatPaginatorIntl } from '@angular/material/paginator'; import { myPaginator } from '../ui/my-paginator'; -import { AddPlanDialog, AddPlanTwoDialog, CreateTestScoreComponent,FinishDialog,LookTreeNodeDialog } from './create-test-score/create-test-score.component'; +import { AddPlanDialog, AddPlanTwoDialog, CreateTestScoreComponent, FinishDialog, LookTreeNodeDialog } from './create-test-score/create-test-score.component'; import { NavigationModule } from '../navigation/navigation.module'; import { NzTreeModule } from 'ng-zorro-antd/tree'; import { ExaminerIndexComponent } from './examiner-index/examiner-index.component'; @@ -56,13 +56,12 @@ import { PlanLevel } from '../pipes/size.pipe'; import { MarkPapersIndexComponent } from './mark-papers-index/mark-papers-index.component'; import { MarkPapersTwoComponent } from './mark-papers-two/mark-papers-two.component'; import { StatisticAnalysisComponent } from './statistic-analysis/statistic-analysis.component'; -import { FinishDia }from './examiner-index/examiner-index.component'; -import { ReviewFilesComponent,editRightWrongComponent } from './review-files/review-files.component' +import { FinishDia } from './examiner-index/examiner-index.component'; +import { ReviewFilesComponent, editRightWrongComponent } from './review-files/review-files.component' import { editorsDia } from './create-test-score/create-test-score.component' - - +import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select'; @NgModule({ - declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent,FinishDialog,PlanLevel,MarkPapersIndexComponent, MarkPapersTwoComponent, StatisticAnalysisComponent,FinishDia, ReviewFilesComponent,editRightWrongComponent,editorsDia], + declarations: [CreateTestScoreComponent, AddPlanDialog, AddPlanTwoDialog, LookTreeNodeDialog, ExaminerIndexComponent, ExaminerNewOneComponent, FinishDialog, PlanLevel, MarkPapersIndexComponent, MarkPapersTwoComponent, StatisticAnalysisComponent, FinishDia, ReviewFilesComponent, editRightWrongComponent, editorsDia], imports: [ CommonModule, examinerRoutingModule, @@ -113,8 +112,9 @@ import { editorsDia } from './create-test-score/create-test-score.component' NavigationModule, NzTreeModule, NzDatePickerModule, + NzTreeSelectModule ], - providers: [ { provide: MatPaginatorIntl, useValue: myPaginator() } ], - exports:[PlanLevel] + providers: [{ provide: MatPaginatorIntl, useValue: myPaginator() }], + exports: [PlanLevel] }) export class ExaminerModule { } diff --git a/src/app/http-interceptors/tree.service.ts b/src/app/http-interceptors/tree.service.ts index f6c9713..b631914 100644 --- a/src/app/http-interceptors/tree.service.ts +++ b/src/app/http-interceptors/tree.service.ts @@ -12,6 +12,8 @@ export class TreeService { }) } olddata.forEach(item => { + item.key = item.id + item.title = item.name var parentNode = getparentNode(item.parentId); if(parentNode){ if(!parentNode.children){ diff --git a/src/app/ui/collection-tools-examinee/collection-tools.component.ts b/src/app/ui/collection-tools-examinee/collection-tools.component.ts index fcc35dd..a7200a8 100644 --- a/src/app/ui/collection-tools-examinee/collection-tools.component.ts +++ b/src/app/ui/collection-tools-examinee/collection-tools.component.ts @@ -424,7 +424,7 @@ export class CollectionToolsExamineeComponent implements OnInit { } async ngOnInit(): Promise { - this.canvasData.gameMode = GameMode.Assignment + // this.canvasData.gameMode = GameMode.Assignment this.getAllLibrary('plan') //获取素材库 this.getAllBuildings() //获取所有建筑 this.getAllFirePlan() //获取当前单位灾情 @@ -869,7 +869,7 @@ export class CollectionToolsExamineeComponent implements OnInit { isRefresh ? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false isRefresh ? this.isShowProperty = true : null isRefresh ? this.isShowAttribute = true : null - + // this.canvas.allowEdit = false let beforeOneId = this.selectingSitePlan.id || '' //当前 选中 平面图 楼层/区域 id let companyBuildingData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData || {})) // 当前 单位/建筑 数据 let storeyData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData || {})) //当前 楼层 数据 diff --git a/src/styles.scss b/src/styles.scss index 4815574..fd28ff3 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1,125 +1,201 @@ - @import './app/theme.scss'; // @import "~ng-zorro-antd/date-picker/style/index.min.css"; /* 引入组件样式 */ -@import "./assets/css/ngZorroTree.css"; /* 引入组件样式 */ +@import "./assets/css/ngZorroTree.css"; +/* 引入组件样式 */ +@import "~ng-zorro-antd/tree-select/style/index.min.css"; + +/* 引入组件样式 */ @import "./assets/css/time.scss"; -html,body{ + +html, +body { width: 100%; height: 100%; - margin:0 auto; - padding:0; + margin: 0 auto; + padding: 0; } -ul,ol,dl,li,dt,dd,p,form,input,h1,h2,h3,h4,h5,h6,section,article,aside,header,footer,nav,figure,time,mark,main,canvas{ - margin:0; - padding:0; + +ul, +ol, +dl, +li, +dt, +dd, +p, +form, +input, +h1, +h2, +h3, +h4, +h5, +h6, +section, +article, +aside, +header, +footer, +nav, +figure, +time, +mark, +main, +canvas { + margin: 0; + padding: 0; } -b,strong,i,em,h1,h2,h3,h4,h5,h6{ - font-weight:500; - font-style:normal; + +b, +strong, +i, +em, +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 500; + font-style: normal; } -img{ - border:none; + +img { + border: none; } -a{ - text-decoration: none; - color:#000; + +a { + text-decoration: none; + color: #000; } -ul,ol,li{ - list-style:none; - overflow-x: hidden; + +ul, +ol, +li { + list-style: none; + overflow-x: hidden; } -.clearfn:after{ - content:""; - clear:both; - display: block; - overflow:hidden; - height:0; - visibility: hidden; + +.clearfn:after { + content: ""; + clear: both; + display: block; + overflow: hidden; + height: 0; + visibility: hidden; } //root标签 -app-root{ - height: 100%; +app-root { + height: 100%; } -h1{ - font-size: 16px; + +h1 { + font-size: 16px; } + .mat-expansion-panel-body { - padding: 0px !important; + padding: 0px !important; } + .mat-expansion-indicator::after { - color: white; + color: white; } + .example-sidenav .mat-drawer-inner-container { - overflow: hidden; + overflow: hidden; } -table th.mat-header-cell:last-of-type,table td.mat-cell:last-of-type, -table td.mat-footer-cell:last-of-type{ - padding-right: 0px; + +table th.mat-header-cell:last-of-type, +table td.mat-cell:last-of-type, +table td.mat-footer-cell:last-of-type { + padding-right: 0px; } -.mat-tab-body{ + +.mat-tab-body { height: 100%; overflow-y: auto; } -.mat-content { //可展开面板垂直居中 + +.mat-content { + //可展开面板垂直居中 align-items: center; } //滚动条样式 -::-webkit-scrollbar{ +::-webkit-scrollbar { width: 6px; background-color: white; } -::-webkit-scrollbar-thumb{ + +::-webkit-scrollbar-thumb { background-color: #07CDCF; } //x轴滚动条隐藏 -.example-sidenav-content { - overflow-x: hidden; - overflow-y: auto; - } +.example-sidenav-content { + overflow-x: hidden; + overflow-y: auto; +} -.mat-tab-body-wrapper{ - height: 100%; +.mat-tab-body-wrapper { + height: 100%; } -.mat-tab-body-content{ - overflow: hidden!important; + +.mat-tab-body-content { + overflow: hidden !important; } + .mat-select-panel { width: 210px; - font-size: 13px!important; + font-size: 13px !important; } -.mat-drawer-container{ +.mat-drawer-container { background-color: none; } //可展开面板按钮颜色 -#createtestscore,#materialBank{ - .mat-expansion-indicator::after { - color: #333333; - } +#createtestscore, +#materialBank { + .mat-expansion-indicator::after { + color: #333333; + } } -#materialBank{ - .mat-expansion-panel-header{ - background-color: #d6f4f5 - } + +#materialBank { + .mat-expansion-panel-header { + background-color: #d6f4f5 + } } //弹出框样式取消padding -#addPlanTwo,#lookTreeNode{ - padding: 0; - .mat-elevation-z8{ - box-shadow:none - } +#addPlanTwo, +#lookTreeNode { + padding: 0; + + .mat-elevation-z8 { + box-shadow: none + } +} + + +#nodeTree, +#basicinfodiv, +#uploadfiretree, +#readbasictree { + .ant-tree .ant-tree-switcher { + line-height: 22px; + } } -#nodeTree,#basicinfodiv,#uploadfiretree,#readbasictree{ - .ant-tree .ant-tree-switcher { - line-height: 22px; - } +.maxHeightTreeSelect { + max-height: 280px; +} + +.ant-select-selector { + max-height: 191px; + overflow-y: auto; }