Compare commits

...

49 Commits

Author SHA1 Message Date
邵佳豪 8e5070c1e4 [完善]考核队站修改 2 years ago
邵佳豪 e823ddd89e [完善]增加阅卷留痕功能 2 years ago
jongbowen 146053832a 作战部署分数修改 2 years ago
jongbowen f6f47aea46 记录阅卷修改 2 years ago
jongbowen f2b4c7b550 记录修改评分 2 years ago
邵佳豪 0121c1497b [完善]修改名称 2 years ago
邵佳豪 ff97b08738 [完善]根据文档内容修改 2 years ago
邵佳豪 8fca224083 Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
邵佳豪 4aca1930c8 [完善]增加管理员创建的页面 2 years ago
jongbowen 255cf42faf 修改描述 2 years ago
邵佳豪 e86f71c2d4 [完善]统计分析列表真实数据 2 years ago
邵佳豪 89fe3b76ab Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
邵佳豪 43225f29e4 [完善]能力分析 2 years ago
jongbowen d8b268e2c6 替换数据 2 years ago
邵佳豪 a065cec8e4 [完善]跳转阅卷 2 years ago
jongbowen 9b671dd79a Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
jongbowen 3e6e3cccd4 倾斜 2 years ago
邵佳豪 1e8b63785f [完善]阅卷后页面关闭 2 years ago
邵佳豪 107e21893b Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
邵佳豪 65b74a0b7f [完善]处置节点默认选中 2 years ago
jongbowen 5c3e735447 Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
jongbowen 9e0a0f5044 字体大小 2 years ago
邵佳豪 eb11e31653 [完善]处置素材bug修改 2 years ago
邵佳豪 56aaa09034 [完善]去掉bug 2 years ago
邵佳豪 8bf779ef58 [完善]编辑企业用户 2 years ago
邵佳豪 96ea91424c Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
邵佳豪 eef2034cda [完善]nav bug 2 years ago
jongbowen 89d9445073 添加清空图表 2 years ago
jongbowen 381acc3920 添加清空图表 2 years ago
jongbowen 9141a2abd8 Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
jongbowen 6593b8930e 图表样式 2 years ago
邵佳豪 8df6a9f166 Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
邵佳豪 adae5f87d8 [完善]nav默认选中 2 years ago
jongbowen d2b8862b52 样式 2 years ago
jongbowen ec5cc46255 添加返回 2 years ago
jongbowen 6f31baa0c3 添加返回 2 years ago
邵佳豪 4b1f568c35 Merge branch 'guangxi' of http://121.36.37.70:3000/shaojiahao/examSystem-Anxin into guangxi 2 years ago
邵佳豪 e0dc1fb1d5 [新增]列表页 2 years ago
jongbowen 11aa0ff208 图表 2 years ago
jongbowen 8ec9eff110 图表 2 years ago
邵佳豪 8c0ad138f8 [完善]左侧菜单 2 years ago
邵佳豪 882f1a5f79 [完善]点击平面图处置素材不消失问题 2 years ago
邵佳豪 9da755edd9 [完善]新增编辑和删除 2 years ago
邵佳豪 a3c8dd58f6 [完善]节点删除 2 years ago
邵佳豪 89c3530fe7 [完善]选择试卷bug 2 years ago
邵佳豪 38dadbe23f [完善]考试系统预案编辑功能 2 years ago
邵佳豪 ec7460b17b [完善]bug 2 years ago
邵佳豪 6929391652 [修改]修改名称 2 years ago
邵佳豪 08cdbc9c0f [修改]上海端口 2 years ago
  1. 2
      src/app/examiner/create-test-score/create-test-score.component.html
  2. 2149
      src/app/examiner/create-test-score/create-test-score.component.ts
  3. 22
      src/app/examiner/examiner-index/examiner-index.component.html
  4. 488
      src/app/examiner/examiner-index/examiner-index.component.ts
  5. 318
      src/app/examiner/examiner-new-one/examiner-new-one.component.ts
  6. 10
      src/app/examiner/examiner-routing.ts
  7. 172
      src/app/examiner/examiner.module.ts
  8. 20
      src/app/examiner/mark-papers-index/mark-papers-index.component.html
  9. 16
      src/app/examiner/mark-papers-index/mark-papers-index.component.scss
  10. 171
      src/app/examiner/mark-papers-index/mark-papers-index.component.ts
  11. 14
      src/app/examiner/mark-papers-two/mark-papers-two.component.html
  12. 42
      src/app/examiner/mark-papers-two/mark-papers-two.component.scss
  13. 98
      src/app/examiner/mark-papers-two/mark-papers-two.component.ts
  14. 28
      src/app/examiner/mark-papers-two/review-record/review-record.component.html
  15. 29
      src/app/examiner/mark-papers-two/review-record/review-record.component.scss
  16. 12
      src/app/examiner/mark-papers-two/review-record/review-record.component.spec.ts
  17. 56
      src/app/examiner/mark-papers-two/review-record/review-record.component.ts
  18. 10
      src/app/examiner/review-files/editFraction.html
  19. 11
      src/app/examiner/review-files/evaluate/evaluate.component.html
  20. 0
      src/app/examiner/review-files/evaluate/evaluate.component.scss
  21. 25
      src/app/examiner/review-files/evaluate/evaluate.component.spec.ts
  22. 28
      src/app/examiner/review-files/evaluate/evaluate.component.ts
  23. 76
      src/app/examiner/review-files/review-files.component.html
  24. 8
      src/app/examiner/review-files/review-files.component.scss
  25. 706
      src/app/examiner/review-files/review-files.component.ts
  26. 56
      src/app/examiner/statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component.html
  27. 116
      src/app/examiner/statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component.scss
  28. 25
      src/app/examiner/statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component.spec.ts
  29. 128
      src/app/examiner/statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component.ts
  30. 19
      src/app/examiner/statistic-analysis/examStatistics/echarts/echarts.component.html
  31. 51
      src/app/examiner/statistic-analysis/examStatistics/echarts/echarts.component.scss
  32. 25
      src/app/examiner/statistic-analysis/examStatistics/echarts/echarts.component.spec.ts
  33. 226
      src/app/examiner/statistic-analysis/examStatistics/echarts/echarts.component.ts
  34. 62
      src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.html
  35. 118
      src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.scss
  36. 25
      src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.spec.ts
  37. 164
      src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.ts
  38. 53
      src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.html
  39. 118
      src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.scss
  40. 25
      src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.spec.ts
  41. 118
      src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.ts
  42. 29
      src/app/examiner/statistic-analysis/statistic-analysis.component.html
  43. 101
      src/app/examiner/statistic-analysis/statistic-analysis.component.ts
  44. 93
      src/app/http-interceptors/base-interceptor.ts
  45. 31
      src/app/navigation/navigation.component.html
  46. 72
      src/app/navigation/navigation.component.scss
  47. 79
      src/app/navigation/navigation.component.ts
  48. 71
      src/app/pages/lockscreen/lockscreen.component.ts
  49. 3
      src/app/pages/login/login.component.html
  50. 66
      src/app/pages/login/login.component.ts
  51. 20
      src/app/student/student-exam-record/student-exam-record.component.html
  52. 82
      src/app/student/student-exam-record/student-exam-record.component.ts
  53. 6
      src/app/student/student-index/student-index.component.html
  54. 175
      src/app/student/student-index/student-index.component.ts
  55. 9
      src/app/theme.scss
  56. 46
      src/app/ui/administrators/add-edit-admin/add-edit-admin.component.html
  57. 0
      src/app/ui/administrators/add-edit-admin/add-edit-admin.component.scss
  58. 25
      src/app/ui/administrators/add-edit-admin/add-edit-admin.component.spec.ts
  59. 110
      src/app/ui/administrators/add-edit-admin/add-edit-admin.component.ts
  60. 73
      src/app/ui/administrators/administrators.component.html
  61. 115
      src/app/ui/administrators/administrators.component.scss
  62. 25
      src/app/ui/administrators/administrators.component.spec.ts
  63. 200
      src/app/ui/administrators/administrators.component.ts
  64. 8
      src/app/ui/collection-tools-read/collection-tools.component.html
  65. 1756
      src/app/ui/collection-tools-read/collection-tools.component.ts
  66. 1
      src/app/ui/collection-tools-read/remark/remark.component.html
  67. 0
      src/app/ui/collection-tools-read/remark/remark.component.scss
  68. 25
      src/app/ui/collection-tools-read/remark/remark.component.spec.ts
  69. 22
      src/app/ui/collection-tools-read/remark/remark.component.ts
  70. 17
      src/app/ui/collection-tools-read/score.html
  71. 35
      src/app/ui/collection-tools-read/score.scss
  72. 9
      src/app/ui/collection-tools/collection-tools.component.html
  73. 2710
      src/app/ui/collection-tools/collection-tools.component.ts
  74. 459
      src/app/ui/collection-tools/examinationQuestions.ts
  75. 171
      src/app/ui/collection-tools/leftFunctionalDomain.ts
  76. 3
      src/app/ui/collection-tools/uploadDisposalNodes.html
  77. 34
      src/app/ui/enterpriseuser/enterpriseuser.component.html
  78. 53
      src/app/ui/enterpriseuser/enterpriseuser.component.scss
  79. 382
      src/app/ui/enterpriseuser/enterpriseuser.component.ts
  80. 6
      src/app/ui/teacherManagement/editenterpriseuser.html
  81. 37
      src/app/ui/teacherManagement/enterpriseuser.component.html
  82. 55
      src/app/ui/teacherManagement/enterpriseuser.component.scss
  83. 392
      src/app/ui/teacherManagement/enterpriseuser.component.ts
  84. 19
      src/app/ui/ui-routing.module.ts
  85. 227
      src/app/ui/ui.module.ts
  86. 14
      src/app/working-area/model/axArrowConnector.ts
  87. 204
      src/app/working-area/model/axImageShape.ts
  88. 7
      src/app/working-area/model/axLegend.ts
  89. 26
      src/app/working-area/model/axShape.ts
  90. 2
      src/app/working-area/model/configuration.ts
  91. 70
      src/app/working-area/working-area.component.ts
  92. 1
      src/styles.scss

2
src/app/examiner/create-test-score/create-test-score.component.html

@ -287,7 +287,7 @@
<input onchange="if(!value)value=0" (input)="planItemScore()" type="number" [(ngModel)]="item.score">
</td>
<td *ngIf="!(pattern=='look')">
<!-- <span style="color: #07CDCF;" (click)="edit(item)" >编辑</span> -->
<span style="color: #07CDCF;" (click)="edit(item)" >编辑</span>
<span style="color: #FF8678;" (click)="deletePlan(item)">删除</span>
</td>
</tr>

2149
src/app/examiner/create-test-score/create-test-score.component.ts

File diff suppressed because it is too large Load Diff

22
src/app/examiner/examiner-index/examiner-index.component.html

@ -1,18 +1,11 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-11 09:06:03
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-29 10:11:11
-->
<div class="content">
<div class="header">
<div class="queryBox">
<div class="queryField ordiv">
<label style="margin-right: 10px;font-size: 15px;">消防救援站:</label>
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 250px" [(ngModel)]="js"
[nzNodes]="nodes" nzPlaceHolder="请选择" [nzExpandedIcon]="multiExpandedIconTpl" [nzExpandedKeys]="expandedKeys" (click)="zIndex()">
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 250px" [(ngModel)]="orId"
[nzNodes]="nodes" nzPlaceHolder="请选择" [nzExpandedIcon]="multiExpandedIconTpl"
[nzExpandedKeys]="expandedKeys">
</nz-tree-select>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
@ -28,7 +21,7 @@
</ng-template>
</ng-template>
<mat-checkbox color="primary" style="margin-left: 26px;" [(ngModel)]="jscheck" name="jscheck">包含下级
<mat-checkbox color="primary" style="margin-left: 26px;" [(ngModel)]="orIdcheck" name="jscheck">包含下级
</mat-checkbox>
</div>
<div class="queryField">
@ -36,7 +29,8 @@
<button style="margin-left: 10px; background-color: #FF8678;" (click)="Reset()">重置</button>
</div>
<div class="queryField">
<button style="background-color: #07CDCF;" (click)="newExamination()"><img style="vertical-align: bottom;" src="../../../assets/images/add.png"> 新增考题</button>
<button style="background-color: #07CDCF;" (click)="newExamination()"><img
style="vertical-align: bottom;" src="../../../assets/images/add.png"> 新增考题</button>
</div>
</div>
</div>
@ -53,7 +47,9 @@
<tbody>
<tr *ngFor="let item of tabledataSource">
<td>{{item.title}}</td>
<td>{{item.organizationsName}}</td>
<td>
<span style="margin: 0px 2px;" *ngFor="let i of item.organizationNames">{{i}}</span>
</td>
<td>{{item.startTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td>{{item.endTime|date:'yyyy-MM-dd HH:mm'}}</td>
<!-- <td [ngClass]="{'green': item.testState == '开考中','red':item.testState == '已结束'}">{{item.testState}}</td> -->

488
src/app/examiner/examiner-index/examiner-index.component.ts

@ -1,341 +1,314 @@
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-11 09:06:03
* @LastEditors: sueRimn
* @LastEditTime: 2021-02-25 11:44:34
*/
import { Component, OnInit, ViewChild, Inject, Input, ViewContainerRef } 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 { 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'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import {
Component,
OnInit,
ViewChild,
Inject,
Input,
ViewContainerRef,
} 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 {
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";
import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
@Component({
selector: 'app-examiner-index',
templateUrl: './examiner-index.component.html',
styleUrls: ['./examiner-index.component.scss']
selector: "app-examiner-index",
templateUrl: "./examiner-index.component.html",
styleUrls: ["./examiner-index.component.scss"],
})
export class ExaminerIndexComponent implements OnInit {
constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
private tree: TreeService,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef
) {}
constructor(private router: Router, private activatedRoute: ActivatedRoute, public http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private tree: TreeService, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { }
//获取登录账号的个人资料
Profiles: any;
ngOnInit(): void {
this.Profiles = JSON.parse(sessionStorage.getItem("creatorData"));
this.getOrganizations();
this.getUnittype();
this.getAlltabledate();
this.getProfiles()
}
//获取登录账号的个人资料
Profiles: any
getProfiles() {
this.http.get('/api/ExamAccounts/Profiles').subscribe((data: any) => {
this.Profiles = data
sessionStorage.setItem('creatorData', JSON.stringify(data))
this.getOrganizations();
})
}
displayedColumns: string[] = ['name', 'startTime', 'endTime', 'examzhong', 'scc'];
tabledataSource: any
accound
helpName//消防救援对名称
optionId
@ViewChild('son') son;
displayedColumns: string[] = [
"name",
"startTime",
"endTime",
"examzhong",
"scc",
];
tabledataSource: any;
accound;
helpName; //消防救援对名称
optionId;
@ViewChild("son") son;
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber: any //第几页
startTime: []
endTime: []
allorganizations: any
allunittype: any //获取所有的单位类型
jscheck: any //辖区中队包含下级
pageSize: any = 10; //每页条数
pageSizeOptions: number[] = [10]; //设置每页条数
PageNumber: any; //第几页
startTime: [];
endTime: [];
allorganizations: any;
allunittype: any; //获取所有的单位类型
jscheck: any; //辖区中队包含下级
//获得所有组织机构
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 //组织机构树型数据
newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
nodes: any = []
expandedKeys: any = []//默认展开tree节点
//得到当前单位所在组织机构的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/Organizations", {
params: {
strict: "true",
},
})
.subscribe((data: any) => {
this.allorganizations = data;
this.allorganizations.forEach((element) => {
if (element.id === this.Profiles.organizationId) {
element.parentId = null;
}
});
this.nodes = [...this.tree.toTree(data)];
this.orId = this.Profiles.organizationId;
});
this.organizationName = this.Profiles.organizationName
if (this.organizationName) {
this.newallorganizations.forEach(item => {
if (item.name == this.organizationName) {
this.expandedKeys = [item.key]
this.nodes = [item]
}
});
} else {
this.expandedKeys = this.nodes[0].key
this.nodes = this.tree.toTree(this.treedata);
}
}
organizationName: any; //当前单位组织机构名称
newallorganizations: any; //用于存储在原始数据基础上的每个机构增加children字段
nodes: any = [];
expandedKeys: any = []; //默认展开tree节点
//编辑试卷
editPaper(item) {
console.log(item)
console.log(item);
if (item.status == 2) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('考试结束,不能编辑', '确定', config);
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 if (item.status == -1) {//未发布
sessionStorage.setItem("paperId", item.id)
this.router.navigate(['/home/createexam-index/examiner-new-one']) //跳转试卷列表页面
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("开考中,不能编辑", "确定", config);
} 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}`)
sessionStorage.setItem("paperId", item.id);
this.router.navigateByUrl(
`/examiner/create-test-score?pattern=edit&status=${item.status}`
);
}
}
lookPaper(item) {
sessionStorage.setItem("paperId", item.id)
console.log(item)
this.router.navigateByUrl(`/examiner/create-test-score?pattern=look&status=${item.status}`)
sessionStorage.setItem("paperId", item.id);
console.log(item);
this.router.navigateByUrl(
`/examiner/create-test-score?pattern=look&status=${item.status}`
);
}
//获得所有单位类型
getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe(
data => {
this.allunittype = data
}
)
this.http.get("/api/BuildingTypes/Simple").subscribe((data) => {
this.allunittype = data;
});
}
//获得查询支队信息
help() {
let paramsdata: any = {
PageNumber: this.PageNumber || '1',
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)
})
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()
this.PageNumber = e.pageIndex + 1;
this.getAlltabledate();
}
orId;
orIdcheck = true;
//获取表格信息
getAlltabledate() {
let paramsdata: any = {
PageNumber: this.PageNumber || '1',
OrganizationId: this.orId || "",
HasChildren: this.orIdcheck || "",
PageNumber: this.PageNumber || "1",
PageSize: this.pageSizeOptions[0],
OrganizationId: this.js || '',
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;
});
}
//获取消防救援对信息
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
})
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;
});
}
//获取optionid
getoption() {
var selectIndex = document.getElementById("cars");
//console.log(selectIndex)
//var activeName_value =document.getElementById("usertype").options[selectIndex].id;
}
//查询按钮
findClick() {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
console.log(this.js)
let paramsdata: any = {
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
OrganizationId: this.js || '',
HasChildren: this.jscheck || '',
Sort: null,
SortType: null,
}
if (!this.js) {
this.snackBar.open('请选择消防救援队', '确定', config);
}
else {
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.getAlltabledate()
config.verticalPosition = "top";
config.duration = 3000;
if (!this.orId) {
this.snackBar.open("请选择消防救援队", "确定", config);
} else {
this.PageNumber = 1;
this.pageEvent.pageIndex = 0;
this.getAlltabledate();
}
}
//重置按钮
Reset() {
this.js = ''
this.jscheck = ''
this.getAlltabledate()
this.orId = this.Profiles.organizationId;
this.orIdcheck = true;
this.getAlltabledate();
}
//删除一套考题
deleteExam(examid) {
let isTrue = confirm('您确定要删除吗')
let isTrue = confirm("您确定要删除吗");
if (isTrue) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
config.verticalPosition = "top";
config.duration = 3000;
this.http.delete(`/api/Papers/${examid}`).subscribe((data: any) => {
this.snackBar.open('删除试卷成功', '确定', config);
this.getAlltabledate()
})
this.snackBar.open("删除试卷成功", "确定", config);
this.getAlltabledate();
});
}
}
//新增考题跳转
newExamination() {
// const dialogRef = this.dialog.open(FinishDia, {
// width: '685px',
// data: {
// Profiles: this.Profiles,
// treedata: this.treedata,
// }
// });
const modal: any = this.modal.create({
nzTitle: '新增考题',
nzTitle: "新增考题",
nzContent: FinishDia,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 688,
nzFooter: null,
nzComponentParams: {
Profiles: this.Profiles,
treedata: this.treedata,
treedata: this.nodes,
},
nzOnOk: async () => {
}
nzOnOk: async () => {},
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
// Return a result when closed
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
js: any //辖区中队输入框
zIndex() {
}
}
//创建试题弹窗
@Component({
selector: 'finish-dialog',
templateUrl: 'finishDia.html',
styleUrls: ['finishDia.scss']
selector: "finish-dialog",
templateUrl: "finishDia.html",
styleUrls: ["finishDia.scss"],
})
export class FinishDia {
// @ViewChild('nzTreSelect', { static: false }) nzTreSelect!: NzTreeComponent;
constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private modal: NzModalRef) { }
constructor(
private router: Router,
private http: HttpClient,
public dialog: MatDialog,
public dialog2: NzModalRef,
public snackBar: MatSnackBar,
private modal: NzModalRef
) {}
//获取登录账号的个人资料
Profiles: any
treedata: any
selectedOr
nodes = []
expandedKeys = []
Profiles: any;
treedata: any;
selectedOr;
nodes = [];
expandedKeys = [];
ngOnInit(): void {
this.Profiles = this.Profiles
this.nodes = [...this.treedata]
this.expandedKeys = [this.treedata[0].key]
this.Profiles = this.Profiles;
this.nodes = [...this.treedata];
this.expandedKeys = [this.treedata[0].key];
}
onChange($event: string[]): void {
console.log($event);
}
startTime: string//考试开始时间
endTime: string//考试结束时间
examName: string//考试名称
indexid: string//创建考试的id
tabledate
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 && this.selectedOr != undefined) {
config.verticalPosition = "top";
config.duration = 3000;
if (
this.startTime != undefined &&
this.endTime != undefined &&
this.examName != undefined &&
this.selectedOr != undefined
) {
if (this.startTime > this.endTime) {
this.snackBar.open('开始时间不能大于结束时间', '确定', config);
}
else {
this.snackBar.open("开始时间不能大于结束时间", "确定", config);
} else {
//截取字符串,得到日期部分"2009-12-02",用split把字符串分隔成数组
var begin1 = this.startTime.substr(0, 10).split("-");
var end1 = this.endTime.substr(0, 10).split("-");
@ -345,8 +318,12 @@ export class FinishDia {
//得到两个日期之间的差值m,以分钟为单位
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;
//将日期和时间两个部分计算出来的差值相加,即得到两个时间相减后的分钟数
@ -362,40 +339,37 @@ export class FinishDia {
organizationId: this.Profiles.organizationId,
creatorId: this.Profiles.id,
paperDataInfo: null,
organizationIds: this.selectedOr
}
console.log(this.selectedOr)
this.http.post('/api/Papers', body).subscribe(data => {
this.snackBar.open('创建成功', '确定', config);
this.modal.triggerOk()
this.tabledate = data
console.log(this.tabledate)
sessionStorage.setItem("paperId", this.tabledate.id)
this.router.navigate(['/home/createexam-index/examiner-new-one']) //跳转试卷列表页面
}, err => {
this.snackBar.open(err, '确定', config);
})
organizationIds: this.selectedOr,
};
console.log(this.selectedOr);
this.http.post("/api/Papers", body).subscribe(
(data) => {
this.snackBar.open("创建成功", "确定", config);
this.modal.triggerOk();
this.tabledate = data;
console.log(this.tabledate);
sessionStorage.setItem("paperId", this.tabledate.id);
this.router.navigate(["/home/createexam-index/examiner-new-one"]); //跳转试卷列表页面
},
(err) => {
this.snackBar.open(err, "确定", config);
}
);
}
else {
} else {
if (this.startTime == undefined)
this.snackBar.open('请输入开始时间', '确定', config);
this.snackBar.open("请输入开始时间", "确定", config);
else if (this.endTime == undefined)
this.snackBar.open('请输入结束时间', '确定', config);
this.snackBar.open("请输入结束时间", "确定", config);
else if (this.examName == undefined)
this.snackBar.open('请输入试卷名称', '确定', config);
this.snackBar.open("请输入试卷名称", "确定", config);
else if (this.selectedOr == undefined)
this.snackBar.open('请选择考核队站', '确定', config);
this.snackBar.open("请选择考核队站", "确定", config);
}
}
close() {
// this.dialogRef.close();
this.dialog2.close();
}
}

318
src/app/examiner/examiner-new-one/examiner-new-one.component.ts

@ -6,46 +6,60 @@
* @LastEditors: sueRimn
* @LastEditTime: 2021-02-23 17:13:27
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
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 { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { Component, OnInit, ViewChild, Inject } from "@angular/core";
import { HttpClient } from "@angular/common/http";
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 { PageEvent } from "@angular/material/paginator";
import {
MatDialogRef,
MatDialog,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import { TreeService } from "../../http-interceptors/tree.service";
import { MatSort } from "@angular/material/sort";
import { MatTableDataSource } from "@angular/material/table";
@Component({
selector: 'app-examiner-new-one',
templateUrl: './examiner-new-one.component.html',
styleUrls: ['./examiner-new-one.component.scss']
selector: "app-examiner-new-one",
templateUrl: "./examiner-new-one.component.html",
styleUrls: ["./examiner-new-one.component.scss"],
})
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) { }
Profiles: any;
ngOnInit(): void {
this.Profiles = JSON.parse(sessionStorage.getItem("creatorData"));
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");
myControl = new FormControl();
@ViewChild(MatSort) sort: MatSort;
allunittype: any //获取所有的单位类型
allunittype: any; //获取所有的单位类型
//分页
@ViewChild(MatPaginator, { static: true })
@ -53,240 +67,250 @@ export class ExaminerNewOneComponent implements OnInit {
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber: any //第几页
pageSizeOptions: number[] = [10]; //设置每页条数
PageNumber: any; //第几页
displayedColumns: string[] = ['checked', 'unitname', 'jurisdictionsquadron', 'unittype', 'scc'];
tabledataSource: any
allorganizations: any
displayedColumns: string[] = [
"checked",
"unitname",
"jurisdictionsquadron",
"unittype",
"scc",
];
tabledataSource: any;
allorganizations: any;
oldDataSource: any; //原始表格数据
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex + 1
this.PageNumber = e.pageIndex + 1;
this.getAllKeyUnit();
}
submit() {
this.PageNumber = '1'
this.getAllKeyUnit()
this.PageNumber = "1";
this.getAllKeyUnit();
}
//获得所有重点单位
allKeyUnitInfo: any //所有的重点单位
allKeyUnitInfo: any; //所有的重点单位
getAllKeyUnit() {
let paramsdata: any = {
Name: this.companyName || '',
OrganizationId: this.js || '',
HasChildren: this.jscheck || '',
USCI: this.shehui || '',
PageNumber: this.PageNumber || '1',
Name: this.companyName || "",
OrganizationId: this.js || "",
HasChildren: this.jscheck || "",
USCI: this.shehui || "",
PageNumber: this.PageNumber || "1",
PageSize: this.pageSizeOptions[0],
}
this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => {
this.length = data.totalCount
this.allKeyUnitInfo = data
};
this.http
.get("/api/Companies", { params: paramsdata })
.subscribe((data: any) => {
this.length = data.totalCount;
this.allKeyUnitInfo = data;
this.tabledataSource = new MatTableDataSource(data.items);
if (this.selectedunitArr.length != 0) {
for (var i = 0; i < this.tabledataSource.filteredData.length; i++) {
for (var j = 0; j < this.selectedunitArr.length; j++) {
if (this.tabledataSource.filteredData[i].id == this.selectedunitArr[j].id) {
this.tabledataSource.filteredData[i].checked = this.selectedunitArr[j].checked
if (
this.tabledataSource.filteredData[i].id ==
this.selectedunitArr[j].id
) {
this.tabledataSource.filteredData[i].checked =
this.selectedunitArr[j].checked;
}
}
}
}
})
});
}
//得到当前单位信息
getunitdata() {
this.http.get("/api/ExamAccounts/Profiles").subscribe(
(data: any) => {
this.organizationName = data.organizationName
}
)
this.http.get("/api/ExamAccounts/Profiles").subscribe((data: any) => {
this.organizationName = data.organizationName;
});
}
organizationName: any //当前单位组织机构名称
treedata: any //组织机构树型数据
newArr: any = []
newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
organizationName: any; //当前单位组织机构名称
treedata: any; //组织机构树型数据
newArr: any = [];
newallorganizations: any; //用于存储在原始数据基础上的每个机构增加children字段
nodes: any = []
expandedKeys: any = []//默认展开tree节点
nodes: any = [];
expandedKeys: any = []; //默认展开tree节点
//得到当前单位所在组织机构的tree型数据
getpresentOrganization() {
this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => {
item.children = []
this.newallorganizations.forEach(element => {
this.newallorganizations = this.allorganizations;
this.newallorganizations.forEach((item) => {
item.children = [];
this.newallorganizations.forEach((element) => {
if (element.parentId == item.id) {
item.children.push(element)
item.children.push(element);
}
});
});
this.http.get("/api/ExamAccounts/Profiles").subscribe(
(data: any) => {
this.organizationName = data.organizationName
this.http.get("/api/ExamAccounts/Profiles").subscribe((data: any) => {
this.organizationName = data.organizationName;
if (this.organizationName) {
this.newallorganizations.forEach(item => {
this.newallorganizations.forEach((item) => {
if (item.name == this.organizationName) {
this.expandedKeys = [item.key]
this.nodes = [item]
this.expandedKeys = [item.key];
this.nodes = [item];
}
});
} else {
this.expandedKeys = this.nodes[0].key
this.expandedKeys = this.nodes[0].key;
this.nodes = this.tree.toTree(this.treedata);
}
});
}
)
}
//获得所有组织机构
getOrganizations() {
this.http.get('/api/Organizations').subscribe(
(data: any) => {
this.allorganizations = data
this.http
.get("/api/Organizations", {
params: {
strict: "true",
},
})
.subscribe((data: any) => {
this.allorganizations = data;
this.allorganizations.forEach((element) => {
if (element.id === this.Profiles.organizationId) {
element.parentId = null;
}
});
this.treedata = this.tree.toTree(data);
this.getpresentOrganization();
}
)
});
}
//获得所有单位类型
getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe(
data => {
this.allunittype = data
}
)
this.http.get("/api/BuildingTypes/Simple").subscribe((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)
element.checked = e.checked
console.log(e, element);
element.checked = e.checked;
if (element.checked) {
this.selectedunitArr.push(element)
}
else {
this.selectedunitArr.push(element);
} else {
for (var i = 0; i < this.selectedunitArr.length; i++) {
if (this.selectedunitArr[i].id == element.companyIntegrityScore.companyId) {
this.selectedunitArr.splice(i, 1)
if (this.selectedunitArr[i].id == element.id) {
this.selectedunitArr.splice(i, 1);
}
}
}
console.log(this.selectedunitArr)
console.log(this.selectedunitArr);
}
//删除某一个单位信息
deleteWork(e) {
console.log(e.target.id)
console.log(this.tabledataSource.data)
console.log(e.target.id);
console.log(this.tabledataSource.data);
for (var i = 0; i < this.selectedunitArr.length; i++) {
if (this.selectedunitArr[i].id == e.target.id) {
this.selectedunitArr.splice(i, 1)
this.selectedunitArr.splice(i, 1);
}
}
for (var i = 0; i < this.tabledataSource.data.length; i++) {
if (this.tabledataSource.data[i].id == e.target.id) {
this.tabledataSource.data[i].checked = false
this.tabledataSource.data[i].checked = false;
}
}
}
//下一步事件
nextClick() {
console.log(this.pattern)
console.log(this.pattern);
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
config.verticalPosition = "top";
config.duration = 3000;
if (this.selectedunitArr.length == 0) {
this.snackBar.open('请选择单位', '确定', config);
}
else {
if (this.pattern == 'edit') {
this.router.navigateByUrl("/examiner/create-test-score?pattern=edit")
this.snackBar.open("请选择单位", "确定", config);
} else {
sessionStorage.setItem(this.indexid, JSON.stringify(this.selectedunitArr))
this.router.navigateByUrl("/examiner/create-test-score")
if (this.pattern == "edit") {
this.router.navigateByUrl("/examiner/create-test-score?pattern=edit");
} else {
sessionStorage.setItem(
this.indexid,
JSON.stringify(this.selectedunitArr)
);
this.router.navigateByUrl("/examiner/create-test-score");
}
}
}
//编辑单位信息
editunit() {
sessionStorage.setItem("six", "edit")
let selectedunitArr = []
let selectedunitobj = []
this.allKeyUnitInfo.items.forEach(item => {
sessionStorage.setItem("six", "edit");
let selectedunitArr = [];
let selectedunitobj = [];
this.allKeyUnitInfo.items.forEach((item) => {
if (item.checked) {
selectedunitArr.push(item.id)
selectedunitobj.push(item)
selectedunitArr.push(item.id);
selectedunitobj.push(item);
}
});
if (selectedunitArr.length == 0) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请先选择要修改的单位', '确定', config);
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("请先选择要修改的单位", "确定", config);
}
if (selectedunitArr.length != 1 && selectedunitArr.length != 0) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('只能选择一个单位修改', '确定', config);
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("只能选择一个单位修改", "确定", config);
}
if (selectedunitArr.length == 1) { //带着id跳到修改页面
if (selectedunitArr.length == 1) {
//带着id跳到修改页面
// console.log(778,selectedunitArr[0])
this.allKeyUnitInfo.items.forEach(item => {
this.allKeyUnitInfo.items.forEach((item) => {
if (item.id == selectedunitArr[0]) {
let companyName = item.name
sessionStorage.setItem("companyName", companyName)
let companyName = item.name;
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 //辖区中队输入框
companyName: any //单位名称
shehui: any //统一社会信用代码
unittype: any //单位类型
jscheck: any //辖区中队包含下级
OrganizationId //
follow: any = '' //是否为关注单位
integritySort: any //完整度排序
js: any; //辖区中队输入框
companyName: any; //单位名称
shehui: any; //统一社会信用代码
unittype: any; //单位类型
jscheck: any; //辖区中队包含下级
OrganizationId; //
follow: any = ""; //是否为关注单位
integritySort: any; //完整度排序
reset() {
this.js = '' //辖区中队输入框
this.jscheck = '' //辖区中队包含下级
this.companyName = '' //单位名称
this.shehui = '' //统一社会信用代码
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.js = ""; //辖区中队输入框
this.jscheck = ""; //辖区中队包含下级
this.companyName = ""; //单位名称
this.shehui = ""; //统一社会信用代码
this.PageNumber = 1;
this.pageEvent.pageIndex = 0;
this.getAllKeyUnit();
}
//提交查询表单
onSubmit(value) {
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.PageNumber = 1;
this.pageEvent.pageIndex = 0;
this.getAllKeyUnit();
}
stopclose(e) {
e.stopPropagation();
}
}

10
src/app/examiner/examiner-routing.ts

@ -12,14 +12,20 @@ import { ExaminerIndexComponent } from './examiner-index/examiner-index.componen
import { ExaminerNewOneComponent} from './examiner-new-one/examiner-new-one.component'
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 { EchartsComponent } from './statistic-analysis/examStatistics/echarts/echarts.component';
import { ExamineeCapacityComponent } from './statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component';
import { StationExamineeComponent } from './statistic-analysis/examStatistics/station-examinee/station-examinee.component';
import { ExamineePapersComponent } from './statistic-analysis/examStatistics/examinee-papers/examinee-papers.component';
const routes: Routes = [
{ path: 'createexam-index', component:ExaminerIndexComponent },
{ path: 'createexam-index/examiner-new-one', component:ExaminerNewOneComponent },
{ path: 'mark-papers-index',component:MarkPapersIndexComponent},
{ path: 'mark-papers-index/mark-papers-two',component:MarkPapersTwoComponent},
{ path: 'statistic-anaily',component:StatisticAnalysisComponent}
{ path: 'statistic-examination',component:EchartsComponent},
{ path: 'statistic-examination/station-examinee',component:StationExamineeComponent},
{ path: 'statistic-examination/examinee-papers',component:ExamineePapersComponent},
{ path: 'statistic-capacity',component:ExamineeCapacityComponent}
]
@NgModule({
imports: [RouterModule.forChild(routes)],

172
src/app/examiner/examiner.module.ts

@ -1,67 +1,109 @@
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 { 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 { NavigationModule } from '../navigation/navigation.module';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { ExaminerIndexComponent } from './examiner-index/examiner-index.component';
import { ExaminerNewOneComponent } from './examiner-new-one/examiner-new-one.component';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
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 { editorsDia } from './create-test-score/create-test-score.component'
import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
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 { 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 { NavigationModule } from "../navigation/navigation.module";
import { NzTreeModule } from "ng-zorro-antd/tree";
import { ExaminerIndexComponent } from "./examiner-index/examiner-index.component";
import { ExaminerNewOneComponent } from "./examiner-new-one/examiner-new-one.component";
import { NzDatePickerModule } from "ng-zorro-antd/date-picker";
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 { FinishDia } from "./examiner-index/examiner-index.component";
import {
ReviewFilesComponent,
editRightWrongComponent,
editFractionComponent
} from "./review-files/review-files.component";
import { editorsDia } from "./create-test-score/create-test-score.component";
import { NzTreeSelectModule } from "ng-zorro-antd/tree-select";
import { EchartsComponent } from "./statistic-analysis/examStatistics/echarts/echarts.component";
import { StationExamineeComponent } from "./statistic-analysis/examStatistics/station-examinee/station-examinee.component";
import { ExamineePapersComponent } from "./statistic-analysis/examStatistics/examinee-papers/examinee-papers.component";
import { ExamineeCapacityComponent } from "./statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component";
import { NzRateModule } from "ng-zorro-antd/rate";
import { EvaluateComponent } from "./review-files/evaluate/evaluate.component";
import { ReviewRecordComponent } from './mark-papers-two/review-record/review-record.component';
@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,
FinishDia,
ReviewFilesComponent,
editRightWrongComponent,
editFractionComponent,
editorsDia,
EchartsComponent,
StationExamineeComponent,
ExamineePapersComponent,
ExamineeCapacityComponent,
EvaluateComponent,
ReviewRecordComponent,
],
imports: [
CommonModule,
examinerRoutingModule,
@ -113,10 +155,10 @@ import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
NzTreeModule,
NzDatePickerModule,
NzTreeSelectModule,
NzRateModule,
],
providers: [{ provide: MatPaginatorIntl, useValue: myPaginator() }],
exports: [PlanLevel],
entryComponents:[FinishDia]
entryComponents: [FinishDia],
})
export class ExaminerModule {}

20
src/app/examiner/mark-papers-index/mark-papers-index.component.html

@ -10,12 +10,12 @@
<div class="header">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;font-size: 18px;">试卷名称:</label>
<input type="text" placeholder="请输入试卷名称" style="font-size: 16px;" [(ngModel)]="markName"/>
<label style="margin-right: 10px;font-size: 15px;">试卷名称:</label>
<input type="text" placeholder="请输入试卷名称" style="font-size: 15px;" [(ngModel)]="markName" />
</div>
<div class="queryField">
<label style="margin-right: 10px;font-size: 18px;">考试日期:</label>
<input type="date" placeholder="请输入考试日期" style="font-size: 16px;" [(ngModel)]="markDate"/>
<label style="margin-right: 10px;font-size: 15px;">考试日期:</label>
<input type="date" placeholder="请输入考试日期" style="font-size: 15px;" [(ngModel)]="markDate" />
</div>
<div class="queryField">
<button style="background-color: #07CDCF;" (click)='findClick()'>查询</button>
@ -28,7 +28,7 @@
<table>
<thead>
<th style="width: 15%;">试卷名称</th>
<th style="width: 15%;">考核</th>
<th style="width: 15%;">考核队</th>
<th style="width: 15%;">开始时间</th>
<th style="width: 15%;">结束时间</th>
<th style="width: 20%;">操作</th>
@ -36,19 +36,19 @@
<tbody>
<tr *ngFor="let item of dataSource">
<td>{{item.title}}</td>
<td>{{item.organizationsName}}</td>
<td><span *ngFor="let item2 of item.organizationNames">{{item2+' '}}</span></td>
<td>{{item.startTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td>{{item.endTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td>
<span id={{item.name}} style="color: #07CDCF;cursor: pointer;" (click)="markTwo(item.title,item.id,item.organizationsName)">阅卷</span>
<!-- <span (click)="look(item)">批阅记录</span> -->
<span style="color: #07CDCF;cursor: pointer;"
(click)="markTwo(item.title,item.id,item.organizationsName)">阅卷</span>
</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
<mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>

16
src/app/examiner/mark-papers-index/mark-papers-index.component.scss

@ -27,13 +27,13 @@ table {
align-items:center;
justify-content:left;
.queryField {
margin: 0 25px;
margin: 0 20px;
font-size: 14px;
input {
width: 320px;
height: 44px;
line-height: 34px;
border-radius: 5px;
height: 32px;
line-height:32px;
border-radius: 2px;
padding-left: 5px;
outline: none;
border: 1px solid rgb(226, 211, 211);
@ -41,14 +41,14 @@ table {
button {
border: none;
color: white;
padding: 10px 25px;
padding: 6px 18px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
font-size: 14px;
margin: 4px 2px;
cursor: pointer;
border-radius: 8px;
border-radius: 3px;
outline:0 none !important;
}
}
@ -65,7 +65,7 @@ table {
table{
td,th{
height: 48px;
font-size: 16px;
font-size: 14px;
}
td{
border-bottom: 1px solid #F2F5F6;

171
src/app/examiner/mark-papers-index/mark-papers-index.component.ts

@ -6,96 +6,161 @@
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-04 16:53:04
*/
import { Component, OnInit, ViewChild, Inject } 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 { Component, OnInit, ViewChild, Inject } 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";
const ELEMENT_DATA = [
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'未开考'},
{name: "富华酒店", organization: '黄埔支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'未开考'},
{name: "雁山园", organization: '徐汇支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'开考中'},
{name: "富华酒店", organization: '普陀支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'开考中'},
{name: "立新加油站", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'开考中'},
{name: "富华酒店", organization: '宝山支队', startTime: "2020-07-19 10:00", overTime: '2020-07-19 12:00',testState:'已结束'},
{name: "裕达国际酒店", organization: '浦东支队', startTime: "2020-08-19 10:00", overTime: '2020-08-19 12:00',testState:'已结束'},
{name: "锦德大酒店", organization: '长宁支队', startTime: "2019-09-19 10:00", overTime: '2019-09-19 12:00',testState:'已结束'},
{
name: "富华酒店",
organization: "浦东支队",
startTime: "2020-09-19 10:00",
overTime: "2020-09-19 12:00",
testState: "未开考",
},
{
name: "富华酒店",
organization: "黄埔支队",
startTime: "2020-09-19 10:00",
overTime: "2020-09-19 12:00",
testState: "未开考",
},
{
name: "雁山园",
organization: "徐汇支队",
startTime: "2020-09-19 10:00",
overTime: "2020-09-19 12:00",
testState: "开考中",
},
{
name: "富华酒店",
organization: "普陀支队",
startTime: "2020-09-19 10:00",
overTime: "2020-09-19 12:00",
testState: "开考中",
},
{
name: "立新加油站",
organization: "浦东支队",
startTime: "2020-09-19 10:00",
overTime: "2020-09-19 12:00",
testState: "开考中",
},
{
name: "富华酒店",
organization: "宝山支队",
startTime: "2020-07-19 10:00",
overTime: "2020-07-19 12:00",
testState: "已结束",
},
{
name: "裕达国际酒店",
organization: "浦东支队",
startTime: "2020-08-19 10:00",
overTime: "2020-08-19 12:00",
testState: "已结束",
},
{
name: "锦德大酒店",
organization: "长宁支队",
startTime: "2019-09-19 10:00",
overTime: "2019-09-19 12:00",
testState: "已结束",
},
];
@Component({
selector: 'app-mark-papers-index',
templateUrl: './mark-papers-index.component.html',
styleUrls: ['./mark-papers-index.component.scss']
selector: "app-mark-papers-index",
templateUrl: "./mark-papers-index.component.html",
styleUrls: ["./mark-papers-index.component.scss"],
})
export class MarkPapersIndexComponent implements OnInit {
constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar
) {}
ngOnInit(): void {
this.getAlltabledate()
this.getAlltabledate();
}
dataSource
markName//试卷名称
markDate//考试日期
dataSource;
markName; //试卷名称
markDate; //考试日期
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any //第几页
pageSizeOptions: number[] = [10]; //设置每页条数
PageNumber: any; //第几页
//查询
findClick() {
let paramsdata: any = {
PageNumber: this.PageNumber || '1',
PageNumber: this.PageNumber || "1",
PageSize: this.pageSizeOptions[0],
Title:this.markName||'',
StartTime:this.markDate||'',
Title: this.markName || "",
StartTime: this.markDate || "",
Sort: null,
SortType: null,
}
this.http.get(`/api/Papers`,{params:paramsdata}).subscribe((data:any)=>{
console.log(data)
this.dataSource=data.items
})
this.PageNumber = 1
this.pageEvent.pageIndex = 0
};
this.http
.get(`/api/Papers`, { params: paramsdata })
.subscribe((data: any) => {
console.log(data);
this.dataSource = data.items;
});
this.PageNumber = 1;
this.pageEvent.pageIndex = 0;
//this.getAlltabledate()
}
//重置功能
resert() {
this.markName=''
this.markDate=''
this.getAlltabledate()
this.markName = "";
this.markDate = "";
this.getAlltabledate();
}
//点击阅卷跳转
markTwo(e, id, name) {
console.log(e)
this.router.navigate(['/home/mark-papers-index/mark-papers-two'],{queryParams:{'level':e,'id':id,'name':name}})
console.log(e);
this.router.navigate(["/home/mark-papers-index/mark-papers-two"], {
queryParams: { level: e, id: id, name: name },
});
}
//获取表格信息
getAlltabledate() {
let paramsdata: any = {
PageNumber: this.PageNumber || '1',
PageNumber: this.PageNumber || "1",
PageSize: this.pageSizeOptions[0],
Sort: null,
SortType: null,
}
this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{
this.dataSource=data.items
this.length=data.totalCount
console.log(this.dataSource)
})
};
this.http
.get("/api/Papers", { params: paramsdata })
.subscribe((data: any) => {
this.dataSource = data.items;
this.length = data.totalCount;
console.log(this.dataSource);
});
}
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex+1
this.getAlltabledate()
this.PageNumber = e.pageIndex + 1;
this.getAlltabledate();
}
look(item) {
console.log(item);
}
}

14
src/app/examiner/mark-papers-two/mark-papers-two.component.html

@ -25,25 +25,27 @@
<th style="width: 15%;">交卷时间</th>
<th style="width: 15%;">是否已阅</th>
<th style="width: 15%;">分数</th>
<th style="width: 20%;">操作</th>
<th style="width: 10%;">评价</th>
<th style="width: 10%;">操作</th>
</thead>
<tbody>
<tr *ngFor="let item of dataSource">
<td>{{item.examineeName}}</td>
<td>{{getname}}</td>
<td>{{item.endTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td [ngClass]="{'green': item.isMarked == true,'red':item.isMarked == false}">{{item.isMarked== true?"已阅卷":"未阅卷"}}</td>
<td [ngClass]="{'green': item.isMarked == true,'red':item.isMarked == false}">{{item.isMarked==
true?"已阅卷":"未阅卷"}}</td>
<td>{{item.totalScore}}</td>
<td>{{item.comment}}</td>
<td>
<span style="color: #01CFD5;cursor: pointer;" (click)='reviewFiles(item)'>阅卷</span>
<span (click)="look(item)">批阅记录</span>
<span (click)='reviewFiles(item)'>阅卷</span>
</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
<mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>

42
src/app/examiner/mark-papers-two/mark-papers-two.component.scss

@ -1,6 +1,7 @@
table {
width: 100%;
text-align: center;
.cdk-header-cell {
text-align: center;
}
@ -13,11 +14,13 @@ table {
background: #F2F5F6;
overflow-y: auto;
}
.header {
width: 100%;
padding: 10px;
margin-bottom: 10px;
box-sizing: border-box;
.queryBox {
box-sizing: border-box;
padding: 5px 15px;
@ -26,9 +29,11 @@ table {
flex-wrap: wrap;
align-items: center;
justify-content: left;
.queryField {
margin: 0 25px;
font-size: 14px;
input {
width: 320px;
height: 44px;
@ -38,6 +43,7 @@ table {
outline: none;
border: 1px solid rgb(226, 211, 211);
}
button {
border: none;
color: white;
@ -52,44 +58,70 @@ table {
outline: 0 none !important;
}
}
.headerright {
float: right;
}
} //queryBox
}
//queryBox
}
.centertable {
width: 95%;
margin-right: 40px;
margin-left: 40px;
background-color: #FFFFFF;
table {
td,th{
td,
th {
height: 48px;
font-size: 16px;
}
td {
border-bottom: 1px solid #F2F5F6;
}
thead {
background-color: #F5FDFE;
}
.green {
color: #07CDCF;
}
.red {
color: #FF8678;
}
}
span {
cursor: pointer;
margin: 0 5px;
color: #01CFD5
}
}
.operationSpan {
margin: 0 10px;
.spanbtn {
font-weight: 550;
cursor: pointer;
}
.green{ color: #04ced1; }
.red{ color: #FF8678 }
.gray{ color: gray; }
.green {
color: #04ced1;
}
.red {
color: #FF8678
}
.gray {
color: gray;
}
}

98
src/app/examiner/mark-papers-two/mark-papers-two.component.ts

@ -6,46 +6,60 @@
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-29 14:53:15
*/
import { Component, OnInit, ViewChild, Inject } 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 { Component, OnInit, ViewChild, Inject } 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 { ReviewRecordComponent } from "./review-record/review-record.component";
@Component({
selector: 'app-mark-papers-two',
templateUrl: './mark-papers-two.component.html',
styleUrls: ['./mark-papers-two.component.scss']
selector: "app-mark-papers-two",
templateUrl: "./mark-papers-two.component.html",
styleUrls: ["./mark-papers-two.component.scss"],
})
export class MarkPapersTwoComponent implements OnInit {
constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar
) {}
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(param=>{
this.headtext=param.level
this.getid=param.id
this.getname=param.name
this.activatedRoute.queryParams.subscribe((param) => {
this.headtext = param.level;
this.getid = param.id;
this.getname = param.name;
});
this.getAlltabledate()
this.getAlltabledate();
//监听 此HTML标签焦点事件
document.addEventListener('visibilitychange', ()=>{
let isHidden = document.hidden
document.addEventListener("visibilitychange", () => {
let isHidden = document.hidden;
if (!isHidden) {
this.getAlltabledate()
this.getAlltabledate();
}
})
});
}
ngOnDestroy(): void {
document.removeEventListener("visibilitychange", () => {});
}
headtext
getid//试卷id
getname//考核中队
dataSource
headtext;
getid; //试卷id
getname; //考核中队
dataSource;
//分页
@ViewChild(MatPaginator, { static: true })
@ -53,33 +67,39 @@ export class MarkPapersTwoComponent implements OnInit {
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any //第几页
pageSizeOptions: number[] = [10]; //设置每页条数
PageNumber: any; //第几页
//获取表格信息
getAlltabledate() {
let paramsdata: any = {
PaperId: this.getid,
PageNumber: this.PageNumber || '1',
PageNumber: this.PageNumber || "1",
PageSize: this.pageSizeOptions[0],
Sort: null,
SortType: null,
}
this.http.get("/api/Examinations",{params:paramsdata}).subscribe((data:any)=>{
this.dataSource=data.items
this.length=data.totalCount
})
};
this.http
.get("/api/Examinations", { params: paramsdata })
.subscribe((data: any) => {
this.dataSource = data.items;
this.length = data.totalCount;
});
}
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex+1
this.getAlltabledate()
this.PageNumber = e.pageIndex + 1;
this.getAlltabledate();
}
//阅卷
reviewFiles(e) {
window.open(`/reviewFiles?examId=${e.id}&paperType=1`)
window.open(`/reviewFiles?examId=${e.id}&paperType=1`);
}
look(item) {
console.log(item);
const dialogRef = this.dialog.open(ReviewRecordComponent, { data: item });
dialogRef.afterClosed().subscribe((res) => {});
}
}

28
src/app/examiner/mark-papers-two/review-record/review-record.component.html

@ -0,0 +1,28 @@
<div class="box">
<h1>批改记录</h1>
<div class="content" *ngFor="let item of this.modifyHistory">
<div class="itembox">
<span>批改人:</span>
<div>
{{item.modifiedBy.realName}}
</div>
</div>
<div class="itembox">
<span>批改时间:</span>
<div>
{{item.modifiedTime | date:'yyyy-MM-dd HH:mm'}}
</div>
</div>
<div class="itembox">
<span>批改内容:</span>
<div>
<div *ngFor="let i of item.data">
<p style="color: #1890ff;">{{i.name}} : </p>
<p *ngFor="let e of i.data">
<span>{{e.name}} : </span>由{{ e.oldIsRight }}修改为{{ e.newIsRight }}
</p>
</div>
</div>
</div>
</div>
</div>

29
src/app/examiner/mark-papers-two/review-record/review-record.component.scss

@ -0,0 +1,29 @@
.box {
width: 550px;
font-size: 14px;
max-height: 500px;
overflow-y: auto;
}
h1{
font-weight: 600;
text-align: center;
}
.content {
box-sizing: border-box;
padding: 12px 0;
border-bottom: 1px dashed rgb(182, 180, 180);
}
.itembox {
display: flex;
span {
margin-right: 6px;
}
div {
p {
margin-bottom: 3px;
}
}
}

12
src/app/examiner/statistic-analysis/statistic-analysis.component.spec.ts → src/app/examiner/mark-papers-two/review-record/review-record.component.spec.ts

@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { StatisticAnalysisComponent } from './statistic-analysis.component';
import { ReviewRecordComponent } from './review-record.component';
describe('StatisticAnalysisComponent', () => {
let component: StatisticAnalysisComponent;
let fixture: ComponentFixture<StatisticAnalysisComponent>;
describe('ReviewRecordComponent', () => {
let component: ReviewRecordComponent;
let fixture: ComponentFixture<ReviewRecordComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StatisticAnalysisComponent ]
declarations: [ ReviewRecordComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(StatisticAnalysisComponent);
fixture = TestBed.createComponent(ReviewRecordComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

56
src/app/examiner/mark-papers-two/review-record/review-record.component.ts

@ -0,0 +1,56 @@
import { HttpClient } from "@angular/common/http";
import { Component, OnInit, Inject } from "@angular/core";
import {
MAT_DIALOG_DATA,
MatDialog,
MatDialogRef,
} from "@angular/material/dialog";
import { MatSnackBar } from "@angular/material/snack-bar";
@Component({
selector: "app-review-record",
templateUrl: "./review-record.component.html",
styleUrls: ["./review-record.component.scss"],
})
export class ReviewRecordComponent implements OnInit {
constructor(
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
@Inject(MAT_DIALOG_DATA) public data: any,
public dialogRef: MatDialogRef<any>
) {}
modifyHistory = [];
ngOnInit(): void {
console.log(this.data);
this.http
.get(`/api/Examinations/${this.data.id}`)
.subscribe((data: any) => {
if (!data.modifyHistory) {
return;
}
let modifyHistory = JSON.parse(data.modifyHistory);
modifyHistory.forEach((element) => {
element.data.forEach((item) => {
item.data.forEach((i) => {
if (i.name.indexOf("作战部署") == -1) {
i.oldIsRight
? (i.oldIsRight = "正确")
: (i.oldIsRight = "错误");
i.newIsRight
? (i.newIsRight = "正确")
: (i.newIsRight = "错误");
}else{
i.oldIsRight = i.oldIsRight+'分'
i.newIsRight = i.newIsRight+'分'
}
});
});
});
this.modifyHistory = modifyHistory.reverse();
console.log(888, this.modifyHistory);
});
}
}

10
src/app/examiner/review-files/editFraction.html

@ -0,0 +1,10 @@
<div class="editRightWrong">
<p style="margin-bottom: 12px;">得分(最高分{{data.paperPlanInfo.score}}分):</p>
<div class="content">
<input type="number" [(ngModel)]="isScore">
</div>
<div mat-dialog-actions>
<button mat-raised-button color="primary" (click)='submit()'>确定</button>
<button mat-raised-button mat-dialog-close>取消</button>
</div>
</div>

11
src/app/examiner/review-files/evaluate/evaluate.component.html

@ -0,0 +1,11 @@
<h1 mat-dialog-title>考试评价:</h1>
<div mat-dialog-content>
<mat-form-field appearance="fill">
<mat-label>评价</mat-label>
<input matInput [(ngModel)]="data.Evaluate">
</mat-form-field>
</div>
<div mat-dialog-actions>
<button mat-button (click)="onNoClick(false)">取消</button>
<button mat-button (click)="onNoClick(true)">确定</button>
</div>

0
src/app/ui/enterpriseuser/seeenterpriseuser.html → src/app/examiner/review-files/evaluate/evaluate.component.scss

25
src/app/examiner/review-files/evaluate/evaluate.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EvaluateComponent } from './evaluate.component';
describe('EvaluateComponent', () => {
let component: EvaluateComponent;
let fixture: ComponentFixture<EvaluateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EvaluateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EvaluateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

28
src/app/examiner/review-files/evaluate/evaluate.component.ts

@ -0,0 +1,28 @@
import { Component, OnInit, Inject } from "@angular/core";
import {
MatDialog,
MAT_DIALOG_DATA,
MatDialogRef,
} from "@angular/material/dialog";
@Component({
selector: "app-evaluate",
templateUrl: "./evaluate.component.html",
styleUrls: ["./evaluate.component.scss"],
})
export class EvaluateComponent implements OnInit {
constructor(
public dialogRef: MatDialogRef<EvaluateComponent>,
@Inject(MAT_DIALOG_DATA) public data: any
) {}
ngOnInit(): void {
// throw new Error("Method not implemented.");
}
onNoClick(type): void {
let obj = {
type: type,
value: this.data.Evaluate,
};
this.dialogRef.close(obj);
}
}

76
src/app/examiner/review-files/review-files.component.html

@ -9,8 +9,12 @@
<label style="color: #07CDCF;">{{examScore}}</label>
</div>
</div>
<div class="centerLeft" style="background: #F5FDFE;"><div class="overflowText">单位名称</div><div class="overflowText">总分</div></div>
<div class="centerLeft" *ngFor="let item of paperCompanyData" [ngClass]="{'selectPaper': selectPaper.id == item.id}" (click)='togglePaper(item)'>
<div class="centerLeft" style="background: #F5FDFE;">
<div class="overflowText">单位名称</div>
<div class="overflowText">总分</div>
</div>
<div class="centerLeft" *ngFor="let item of paperCompanyData"
[ngClass]="{'selectPaper': selectPaper.id == item.id}" (click)='togglePaper(item)'>
<div class="overflowText">{{item.companyInfo? item.companyInfo.name:'暂无单位名称'}}</div>
<div class="overflowText">{{item.score}}+{{item.planScore}}</div>
</div>
@ -32,21 +36,26 @@
<mat-expansion-panel *ngIf="selectPaper.basicInfoData && selectPaper.basicInfoData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">基本信息</label>
<label>总分: <label class="mark"> {{selectPaper.basicInfoScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.basicInfoItemScore}}</label></label>
<button class="headerButton" *ngIf="selectPaper.basicInfoScore == selectPaper.basicInfoTotalPoints && paperType==1">全部正确</button>
<label>总分: <label class="mark"> {{selectPaper.basicInfoScore}}</label>分, </label><label>单项<label
class="mark"> {{selectPaper.basicInfoItemScore}}</label></label>
<button class="headerButton"
*ngIf="selectPaper.basicInfoScore == selectPaper.basicInfoTotalPoints && paperType==1">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.basicInfoData;let itemkey = index">
<div class="publicTitle">{{item.name}}</div>
<div class="publicTable" *ngIf="item.tabledata && item.tabledata.length">
<div class="tableRow" *ngFor="let element of item.tabledata; let key = index">
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}</div>
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}
</div>
<ng-container *ngFor="let elements of element.data">
<div class="tabelCenter tableInput" *ngIf="rowIsShow(selectPaper.basicInfoData[itemkey].children,elements.tag)">
<div class="tabelCenter tableInput"
*ngIf="rowIsShow(selectPaper.basicInfoData[itemkey].children,elements.tag)">
<label *ngIf="key===0" class="overflowText">{{elements.result}}</label>
<input type="text" [(ngModel)]="elements.userAnswer" name="userAnswer" *ngIf="key!=0" readonly>
<mat-icon *ngIf="key!=0 && elements.isRight" class="rightWrong">done</mat-icon>
<mat-icon *ngIf="key!=0 && !elements.isRight" class="mistakeIcon rightWrong">clear</mat-icon>
<mat-icon *ngIf="key!=0 && paperType==1" title="修改结果" (click)='editResults(elements)'>create</mat-icon>
<mat-icon *ngIf="key!=0 && paperType==1" title="修改结果"
(click)='editResults(elements)'>create</mat-icon>
<p *ngIf="key!=0 && paperType==1" class="rightKey">{{elements.result}}</p>
</div>
</ng-container>
@ -54,10 +63,12 @@
</div>
<ng-container *ngIf="!item.tabledata || !item.tabledata.length">
<div class="publicInput" *ngFor="let element of item.children">
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer" readonly>
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer"
name="userAnswer" readonly>
<mat-icon *ngIf="element.isRight">done</mat-icon>
<mat-icon class="mistakeIcon" *ngIf="!element.isRight">clear</mat-icon>
<button class="modificationResults" (click)='editResults(element)' *ngIf="paperType==1">修改结果</button>
<button class="modificationResults" (click)='editResults(element)'
*ngIf="paperType==1">修改结果</button>
<p class="rightKey" *ngIf="paperType==1">{{element.result}}</p>
</div>
</ng-container>
@ -68,13 +79,16 @@
<mat-expansion-panel *ngIf="selectPaper.adjoinData && selectPaper.adjoinData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">四周毗邻</label>
<label>总分: <label class="mark"> {{selectPaper.adjoinScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.adjoinItemScore}}</label></label>
<button class="headerButton" *ngIf="selectPaper.adjoinScore == selectPaper.adjoinTotalPoints && paperType==1">全部正确</button>
<label>总分: <label class="mark"> {{selectPaper.adjoinScore}}</label>分, </label><label>单项<label
class="mark"> {{selectPaper.adjoinItemScore}}</label></label>
<button class="headerButton"
*ngIf="selectPaper.adjoinScore == selectPaper.adjoinTotalPoints && paperType==1">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.adjoinData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicInput" *ngFor="let element of item.children">
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer" readonly>
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer"
readonly>
<mat-icon *ngIf="element.isRight">done</mat-icon>
<mat-icon class="mistakeIcon" *ngIf="!element.isRight">clear</mat-icon>
<button class="modificationResults" (click)='editResults(element)' *ngIf="paperType==1">修改结果</button>
@ -87,20 +101,24 @@
<mat-expansion-panel *ngIf="selectPaper.importLocationData && selectPaper.importLocationData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">重点部位</label>
<label>总分: <label class="mark"> {{selectPaper.importLocationScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.importLocationItemScore}}</label></label>
<button class="headerButton" *ngIf="selectPaper.importLocationScore == selectPaper.importLocationTotalPoints && paperType==1">全部正确</button>
<label>总分: <label class="mark"> {{selectPaper.importLocationScore}}</label>分, </label><label>单项<label
class="mark"> {{selectPaper.importLocationItemScore}}</label></label>
<button class="headerButton"
*ngIf="selectPaper.importLocationScore == selectPaper.importLocationTotalPoints && paperType==1">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.importLocationData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicTable">
<div class="tableRow" *ngFor="let element of item.tabledata; let key = index">
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}</div>
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}
</div>
<div class="tabelCenter" *ngFor="let elements of element.data">
<label *ngIf="key===0" class="overflowText">{{elements.result}}</label>
<input type="text" [(ngModel)]="elements.userAnswer" name="userAnswer" *ngIf="key!=0" readonly>
<mat-icon *ngIf="key!=0 && elements.isRight">done</mat-icon>
<mat-icon *ngIf="key!=0 && !elements.isRight" class="mistakeIcon">clear</mat-icon>
<mat-icon *ngIf="key!=0 && paperType==1" title="修改结果" (click)='editResults(elements)'>create</mat-icon>
<mat-icon *ngIf="key!=0 && paperType==1" title="修改结果"
(click)='editResults(elements)'>create</mat-icon>
<p *ngIf="key!=0 && paperType==1" class="rightKey">{{elements.result}}</p>
</div>
</div>
@ -109,23 +127,28 @@
</mat-expansion-panel>
<!-- 重点部位 -->
<!-- 功能分区 -->
<mat-expansion-panel *ngIf="selectPaper.functionalDivisionData && selectPaper.functionalDivisionData.length">
<mat-expansion-panel
*ngIf="selectPaper.functionalDivisionData && selectPaper.functionalDivisionData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">功能分区</label>
<label>总分: <label class="mark"> {{selectPaper.functionalDivisionScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.functionalDivisionItemSocre}}</label></label>
<button class="headerButton" *ngIf="selectPaper.functionalDivisionScore == selectPaper.functionalDivisionTotalPoints && paperType==1">全部正确</button>
<label>总分: <label class="mark"> {{selectPaper.functionalDivisionScore}}</label>分,
</label><label>单项<label class="mark"> {{selectPaper.functionalDivisionItemSocre}}</label></label>
<button class="headerButton"
*ngIf="selectPaper.functionalDivisionScore == selectPaper.functionalDivisionTotalPoints && paperType==1">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.functionalDivisionData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicTable">
<div class="tableRow" *ngFor="let element of item.tabledata; let key = index">
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}</div>
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}
</div>
<div class="tabelCenter" *ngFor="let elements of element.data">
<label *ngIf="key===0" class="overflowText">{{elements.result}}</label>
<input type="text" [(ngModel)]="elements.userAnswer" name="userAnswer" *ngIf="key!=0" readonly>
<mat-icon *ngIf="key!=0 && elements.isRight">done</mat-icon>
<mat-icon *ngIf="key!=0 && !elements.isRight" class="mistakeIcon">clear</mat-icon>
<mat-icon *ngIf="key!=0 && paperType==1" title="修改结果" (click)='editResults(elements)'>create</mat-icon>
<mat-icon *ngIf="key!=0 && paperType==1" title="修改结果"
(click)='editResults(elements)'>create</mat-icon>
<p *ngIf="key!=0 && paperType==1" class="rightKey">{{elements.result}}</p>
</div>
</div>
@ -137,13 +160,16 @@
<mat-expansion-panel *ngIf="selectPaper.facilityData && selectPaper.facilityData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">数据核验</label>
<label>总分: <label class="mark"> {{selectPaper.facilityScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.facilityItemScore}}</label></label>
<button class="headerButton" *ngIf="selectPaper.facilityScore == selectPaper.facilityTotalPoints && paperType==1">全部正确</button>
<label>总分: <label class="mark"> {{selectPaper.facilityScore}}</label>分, </label><label>单项<label
class="mark"> {{selectPaper.facilityItemScore}}</label></label>
<button class="headerButton"
*ngIf="selectPaper.facilityScore == selectPaper.facilityTotalPoints && paperType==1">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.facilityData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicInput" *ngFor="let element of item.children">
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer" readonly>
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer"
readonly>
<mat-icon *ngIf="element.isRight">done</mat-icon>
<mat-icon class="mistakeIcon" *ngIf="!element.isRight">clear</mat-icon>
<button class="modificationResults" (click)='editResults(element)' *ngIf="paperType==1">修改结果</button>
@ -178,6 +204,7 @@
<td>
<span style="color: #07CDCF;" (click)="readExam(item,0)" *ngIf="paperType==1">阅卷</span>
<span style="color: #07CDCF;" (click)="readExam(item,1)" *ngIf="paperType!=1">查看</span>
<span style="color: #07CDCF;" (click)="editFraction(item)" *ngIf="paperType==1">修改得分</span>
</td>
</tr>
</table>
@ -193,4 +220,3 @@
</div>
</div>

8
src/app/examiner/review-files/review-files.component.scss

@ -71,11 +71,19 @@ button {
.editRightWrong {
button { margin: 0 10px; }
.content { margin-bottom: 10px; text-align: center; }
input{
height: 24px;
border: 1px solid #d4cdcd;
}
input[type=text]:focus {
outline: none;
}
.mat-radio-button {
height: 22px;
line-height: 22px;
display: inline-block;
margin: 0 10px;
}
}
.refresh{

706
src/app/examiner/review-files/review-files.component.ts

@ -1,342 +1,662 @@
import { HttpClient } from '@angular/common/http';
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
import { HttpClient } from "@angular/common/http";
import { Component, Inject, OnInit } from "@angular/core";
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import { ActivatedRoute } from "@angular/router";
import { EvaluateComponent } from "./evaluate/evaluate.component";
@Component({
selector: 'app-review-files',
templateUrl: './review-files.component.html',
styleUrls: ['../../student/examination-details/examination-details.component.scss','./review-files.component.scss']
selector: "app-review-files",
templateUrl: "./review-files.component.html",
styleUrls: [
"../../student/examination-details/examination-details.component.scss",
"./review-files.component.scss",
],
})
export class ReviewFilesComponent implements OnInit {
constructor(public http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route:ActivatedRoute) { }
constructor(
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public route: ActivatedRoute
) {}
async ngOnInit(): Promise<void> {
this.paperType = this.route.snapshot.queryParams.paperType || 1
await this.getTest()
this.getUnitPlans()//将试卷的预案考题放进数据中
this.paperType = this.route.snapshot.queryParams.paperType || 1;
await this.getTest();
this.getUnitPlans(); //将试卷的预案考题放进数据中
//监听 此HTML标签焦点事件
document.addEventListener('visibilitychange', ()=>{
let isHidden = document.hidden
document.addEventListener("visibilitychange", () => {
let isHidden = document.hidden;
if (!isHidden) {
this.getUnitPlans(false)
this.getUnitPlans(false);
// console.log("此HTML标签焦点事件", this.correctionRecordData);
}
})
});
}
paperType: any = 1; //阅卷/查看
examId: any = this.route.snapshot.queryParams.examId; //考卷id
paperId: any; //试卷id
paperData:any //试卷信息
examScore:number = 0//整个试卷的总分
paperData: any; //试卷信息
examScore: number = 0; //整个试卷的总分
paperCompanyData: any = []; //考生具体考卷
selectPaper: any = { id: null }; //选择当前考卷
selectPaperType:string = '1'; //选择当前考卷内容 基本信息/作战部署
selectPaperType: string = "1"; //选择当前考卷内容 基本信息/作战部署
//获取考生试卷
async getTest() {
await new Promise((resolve, reject) => {
this.http.get(`/api/Examinations/${this.examId}`).subscribe((data:any)=>{
this.paperData = data
this.paperId = this.paperData.paperId
this.http
.get(`/api/Examinations/${this.examId}`)
.subscribe((data: any) => {
this.paperData = data;
this.paperId = this.paperData.paperId;
this.paperData.examinationDataInfo.forEach((element, index) => {
element.adjoinData? element.adjoinData = JSON.parse(element.adjoinData) : null
element.basicInfoData? element.basicInfoData = JSON.parse(element.basicInfoData) : null
element.facilityData? element.facilityData = JSON.parse(element.facilityData) : null
element.functionalDivisionData? element.functionalDivisionData = JSON.parse(element.functionalDivisionData) : null
element.importLocationData? element.importLocationData = JSON.parse(element.importLocationData) : null
element.adjoinItemScore = data.paperInfo.paperDataInfo[index].adjoinItemScore //四周毗邻单项分
element.basicInfoItemScore = data.paperInfo.paperDataInfo[index].basicInfoItemScore //基本信息单项分
element.facilityItemScore = data.paperInfo.paperDataInfo[index].facilityItemScore //消防设施单项分
element.functionalDivisionItemSocre = data.paperInfo.paperDataInfo[index].functionalDivisionItemSocre //功能分区单选分
element.importLocationItemScore = data.paperInfo.paperDataInfo[index].importLocationItemScore //重点部位单项分
if (this.paperType == 1) { //阅卷
element.adjoinScore = data.paperInfo.paperDataInfo[index].adjoinScore //四周毗邻 总分
element.basicInfoScore = data.paperInfo.paperDataInfo[index].basicInfoScore //基本信息 总分
element.facilityScore = data.paperInfo.paperDataInfo[index].facilityScore //消防设施 总分
element.functionalDivisionScore = data.paperInfo.paperDataInfo[index].functionalDivisionScore //功能分区 总分
element.importLocationScore = data.paperInfo.paperDataInfo[index].importLocationScore //重点部位 总分
}
element.score = element.adjoinScore + element.basicInfoScore + element.facilityScore + element.functionalDivisionScore + element.importLocationScore
});
this.paperCompanyData = JSON.parse( JSON.stringify(data.examinationDataInfo) ) //具体考卷
this.selectPaper = this.paperCompanyData[0]
resolve(1)
})
})
element.adjoinData
? (element.adjoinData = JSON.parse(element.adjoinData))
: null;
element.basicInfoData
? (element.basicInfoData = JSON.parse(element.basicInfoData))
: null;
element.facilityData
? (element.facilityData = JSON.parse(element.facilityData))
: null;
element.functionalDivisionData
? (element.functionalDivisionData = JSON.parse(
element.functionalDivisionData
))
: null;
element.importLocationData
? (element.importLocationData = JSON.parse(
element.importLocationData
))
: null;
element.adjoinItemScore =
data.paperInfo.paperDataInfo[index].adjoinItemScore; //四周毗邻单项分
element.basicInfoItemScore =
data.paperInfo.paperDataInfo[index].basicInfoItemScore; //基本信息单项分
element.facilityItemScore =
data.paperInfo.paperDataInfo[index].facilityItemScore; //消防设施单项分
element.functionalDivisionItemSocre =
data.paperInfo.paperDataInfo[index].functionalDivisionItemSocre; //功能分区单选分
element.importLocationItemScore =
data.paperInfo.paperDataInfo[index].importLocationItemScore; //重点部位单项分
if (this.paperType == 1) {
//阅卷
element.adjoinScore =
data.paperInfo.paperDataInfo[index].adjoinScore; //四周毗邻 总分
element.basicInfoScore =
data.paperInfo.paperDataInfo[index].basicInfoScore; //基本信息 总分
element.facilityScore =
data.paperInfo.paperDataInfo[index].facilityScore; //消防设施 总分
element.functionalDivisionScore =
data.paperInfo.paperDataInfo[index].functionalDivisionScore; //功能分区 总分
element.importLocationScore =
data.paperInfo.paperDataInfo[index].importLocationScore; //重点部位 总分
}
element.score =
element.adjoinScore +
element.basicInfoScore +
element.facilityScore +
element.functionalDivisionScore +
element.importLocationScore;
});
this.paperCompanyData = JSON.parse(
JSON.stringify(data.examinationDataInfo)
); //具体考卷
this.selectPaper = this.paperCompanyData[0];
resolve(1);
});
});
}
//获得单位预案设定
async getUnitPlans(type: boolean = true) {
for (let index = 0; index < this.paperCompanyData.length; index++) {
const item = this.paperCompanyData[index];
item.planScore = 0 //预案总分
item.planList = [] //预案data
item.planScore = 0; //预案总分
item.planList = []; //预案data
let params = {
examinationId: this.route.snapshot.queryParams.examId,
companyId : item.companyInfo.id
}
companyId: item.companyInfo.id,
};
await new Promise((resolve, reject) => {
this.http.get(`/api/ExaminationPlans`,{params:params}).subscribe(data => {
item.planList = data
item.planList.forEach(element => { item.planScore = item.planScore + element.paperPlanInfo.score });
this.http
.get(`/api/ExaminationPlans`, { params: params })
.subscribe((data) => {
item.planList = data;
item.planList.forEach((element) => {
item.planScore = item.planScore + element.paperPlanInfo.score;
});
if (type == false) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 5000
this.snackBar.open('刷新成功','确定',config);
config.verticalPosition = "top";
config.duration = 5000;
// this.snackBar.open('刷新成功','确定',config);
}
resolve(1)
})
})
resolve(1);
});
});
}
type? this.handleResults() : null //计算答案正确错误
type ? this.handleResults() : null; //计算答案正确错误
}
//处理数据 计算答案正确错误
handleResults() {
this.examScore = 0
this.paperCompanyData.forEach(element => {
this.examScore = this.examScore + element.score + element.planScore //试卷总分
this.examScore = 0;
this.paperCompanyData.forEach((element) => {
this.examScore = this.examScore + element.score + element.planScore; //试卷总分
//forEach
element.adjoinData.forEach(item => { //四周毗邻
item.children.forEach(items => {
element.adjoinData.forEach((item) => {
//四周毗邻
item.children.forEach((items) => {
if (items.isRight === undefined) {
items.result == items.userAnswer? items.isRight = true : items.isRight = false
items.result == items.userAnswer
? (items.isRight = true)
: (items.isRight = false);
}
});
});
element.basicInfoData.forEach(item => { //基本信息
if (item.tabledata && item.tabledata.length) { //表格
element.basicInfoData.forEach((item) => {
//基本信息
if (item.tabledata && item.tabledata.length) {
//表格
item.tabledata.forEach((itemss, index) => {
if (index != 0) {
itemss.data.forEach(items => {
if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false }
itemss.data.forEach((items) => {
if (items.isRight === undefined) {
items.result == items.userAnswer
? (items.isRight = true)
: (items.isRight = false);
}
});
}
});
} else {
//input
item.children.forEach((items) => {
if (items.isRight === undefined) {
items.result == items.userAnswer
? (items.isRight = true)
: (items.isRight = false);
}
});
}
});
} else { //input
item.children.forEach(items => { if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false } });
element.facilityData.forEach((item) => {
//消防设施
item.children.forEach((items) => {
if (items.isRight === undefined) {
items.result == items.userAnswer
? (items.isRight = true)
: (items.isRight = false);
}
});
element.facilityData.forEach(item => { //消防设施
item.children.forEach(items => { if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false } });
});
element.functionalDivisionData.forEach(item => { //功能分区
element.functionalDivisionData.forEach((item) => {
//功能分区
item.tabledata.forEach((itemss, index) => {
if (index != 0) {
itemss.data.forEach(items => { if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false } });
itemss.data.forEach((items) => {
if (items.isRight === undefined) {
items.result == items.userAnswer
? (items.isRight = true)
: (items.isRight = false);
}
});
}
});
});
element.importLocationData.forEach(item => { //重点部位
element.importLocationData.forEach((item) => {
//重点部位
item.tabledata.forEach((itemss, index) => {
if (index != 0) {
itemss.data.forEach(items => { if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false } });
itemss.data.forEach((items) => {
if (items.isRight === undefined) {
items.result == items.userAnswer
? (items.isRight = true)
: (items.isRight = false);
}
});
}
});
});
//forEach
});
this.getPaperGrade()
this.getPaperGrade();
}
//循环 获取最新得分
getPaperGrade() {
this.paperCompanyData.forEach(element => {
this.paperCompanyData.forEach((element) => {
//forEach
element.adjoinTotalPoints = 0 //四周毗邻 分数
element.adjoinData.forEach(item => { //四周毗邻
item.children.forEach(items => { items.isRight? element.adjoinTotalPoints = element.adjoinTotalPoints + element.adjoinItemScore : null });
});
element.basicInfoTotalPoints = 0 //基本信息总分
element.basicInfoData.forEach(item => { //基本信息
if (item.tabledata && item.tabledata.length) { //表格
let indexList = []
item.tabledata[0].data.forEach((e,index) => { let everyRow = { isRight: true, index: index }; indexList.push(everyRow) }); //表格 行数
element.adjoinTotalPoints = 0; //四周毗邻 分数
element.adjoinData.forEach((item) => {
//四周毗邻
item.children.forEach((items) => {
items.isRight
? (element.adjoinTotalPoints =
element.adjoinTotalPoints + element.adjoinItemScore)
: null;
});
});
element.basicInfoTotalPoints = 0; //基本信息总分
element.basicInfoData.forEach((item) => {
//基本信息
if (item.tabledata && item.tabledata.length) {
//表格
let indexList = [];
item.tabledata[0].data.forEach((e, index) => {
let everyRow = { isRight: true, index: index };
indexList.push(everyRow);
}); //表格 行数
item.tabledata.forEach((itemss, index) => {
indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } })
indexList.forEach((ele) => {
if (
itemss.data[ele.index].isRight != undefined &&
itemss.data[ele.index].isRight === false
) {
ele.isRight = false;
}
});
});
indexList.forEach((item) => {
item.isRight
? (element.basicInfoTotalPoints =
element.basicInfoTotalPoints + element.basicInfoItemScore)
: null;
});
} else {
//input
item.children.forEach((items) => {
items.isRight
? (element.basicInfoTotalPoints =
element.basicInfoTotalPoints + element.basicInfoItemScore)
: null;
});
indexList.forEach(item=>{
item.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + element.basicInfoItemScore : null
})
} else { //input
item.children.forEach(items => { items.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + element.basicInfoItemScore : null });
}
});
element.facilityTotalPoints = 0 //消防设施总分
element.facilityData.forEach(item => { //消防设施
item.children.forEach(items => { items.isRight? element.facilityTotalPoints = element.facilityTotalPoints + element.facilityItemScore : null });
element.facilityTotalPoints = 0; //消防设施总分
element.facilityData.forEach((item) => {
//消防设施
item.children.forEach((items) => {
items.isRight
? (element.facilityTotalPoints =
element.facilityTotalPoints + element.facilityItemScore)
: null;
});
});
element.functionalDivisionTotalPoints = 0 //功能分区总分
element.functionalDivisionData.forEach(item => { //功能分区
element.functionalDivisionTotalPoints = 0; //功能分区总分
element.functionalDivisionData.forEach((item) => {
//功能分区
if (item.tabledata && item.tabledata.length) {
let indexList = []
item.tabledata[0].data.forEach((e,index) => { let everyRow = { isRight: true, index: index }; indexList.push(everyRow) }); //表格 行数
let indexList = [];
item.tabledata[0].data.forEach((e, index) => {
let everyRow = { isRight: true, index: index };
indexList.push(everyRow);
}); //表格 行数
item.tabledata.forEach((itemss, index) => {
indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } })
indexList.forEach((ele) => {
if (
itemss.data[ele.index].isRight != undefined &&
itemss.data[ele.index].isRight === false
) {
ele.isRight = false;
}
});
});
indexList.forEach((item) => {
item.isRight
? (element.functionalDivisionTotalPoints =
element.functionalDivisionTotalPoints +
element.functionalDivisionItemSocre)
: null;
});
indexList.forEach(item=>{
item.isRight? element.functionalDivisionTotalPoints = element.functionalDivisionTotalPoints + element.functionalDivisionItemSocre : null
})
}
});
element.importLocationTotalPoints = 0 //重点部位总分
element.importLocationData.forEach(item => { //重点部位
element.importLocationTotalPoints = 0; //重点部位总分
element.importLocationData.forEach((item) => {
//重点部位
if (item.tabledata && item.tabledata.length) {
let indexList = []
item.tabledata[0].data.forEach((e,index) => { let everyRow = { isRight: true, index: index }; indexList.push(everyRow) }); //表格 行数
let indexList = [];
item.tabledata[0].data.forEach((e, index) => {
let everyRow = { isRight: true, index: index };
indexList.push(everyRow);
}); //表格 行数
item.tabledata.forEach((itemss, index) => {
indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } })
indexList.forEach((ele) => {
if (
itemss.data[ele.index].isRight != undefined &&
itemss.data[ele.index].isRight === false
) {
ele.isRight = false;
}
});
});
indexList.forEach((item) => {
item.isRight
? (element.importLocationTotalPoints =
element.importLocationTotalPoints +
element.importLocationItemScore)
: null;
});
indexList.forEach(item=>{
item.isRight? element.importLocationTotalPoints = element.importLocationTotalPoints + element.importLocationItemScore : null
})
}
});
//forEach
});
}
correctionRecordData = []; //批改记录
//修改结果
editResults(e) {
let data = e
console.log("e", e);
let data = e;
const dialogRef = this.dialog.open(editRightWrongComponent, { data });
dialogRef.afterClosed().subscribe(data => {
if (data) {
if (e.isRight != data.isChecked) {
e.isRight = data.isChecked
this.getPaperGrade()
dialogRef.afterClosed().subscribe((res) => {
if (!res) {
return;
}
let isExist = this.correctionRecordData.findIndex(
(item) => item.name === this.selectPaper.companyInfo.name
);
let correctionRecordDataIndex;
if (isExist !== -1) {
correctionRecordDataIndex = isExist;
} else {
this.correctionRecordData.push({
name: this.selectPaper.companyInfo.name,
data: [],
});
correctionRecordDataIndex = this.correctionRecordData.length - 1;
}
//如果值变了
if (e.isRight != res.isChecked) {
let isFind = this.correctionRecordData[
correctionRecordDataIndex
].data.findIndex((ele) => ele.name === e.name);
if (isFind === -1) {
this.correctionRecordData[correctionRecordDataIndex].data.push({
name: e.name,
oldIsRight: e.isRight,
newIsRight: res.isChecked,
});
} else {
//如果数组中已经有值 说明改过但又改回来了
this.correctionRecordData[correctionRecordDataIndex].data.splice(
isFind,
1
);
}
e.isRight = res.isChecked;
this.getPaperGrade();
}
})
});
}
editFraction(e) {
console.log("e", e);
let data = e;
const dialogRef = this.dialog.open(editFractionComponent, { data });
dialogRef.afterClosed().subscribe((res) => {
if (!res) {
return;
}
let isExist = this.correctionRecordData.findIndex(
(item) => item.name === this.selectPaper.companyInfo.name
);
let correctionRecordDataIndex;
if (isExist !== -1) {
correctionRecordDataIndex = isExist;
} else {
this.correctionRecordData.push({
name: this.selectPaper.companyInfo.name,
data: [],
});
correctionRecordDataIndex = this.correctionRecordData.length - 1;
}
//如果值变了
if (e.score != res.isScore) {
let isFind = this.correctionRecordData[
correctionRecordDataIndex
].data.findIndex((ele) => ele.name === e.name);
if (isFind === -1) {
this.correctionRecordData[correctionRecordDataIndex].data.push({
name: "作战部署-" + e.paperPlanInfo.title,
oldIsRight: e.score,
newIsRight: res.isScore,
});
} else {
//如果数组中已经有值 说明改过但又改回来了
this.correctionRecordData[correctionRecordDataIndex].data.splice(
isFind,
1
);
}
console.log(this.correctionRecordData);
e.score = res.isScore;
this.getPaperGrade();
}
});
}
//刷新预案设定表格
refreshTable() {
this.getUnitPlans(false)
this.getUnitPlans(false);
}
//基本信息表格 是否展示当前行
rowIsShow(children, tag) {
let isShow:boolean = false
children.forEach(element => {
element.result == tag? isShow = true : null
let isShow: boolean = false;
children.forEach((element) => {
element.result == tag ? (isShow = true) : null;
});
return isShow
return isShow;
}
//切换 选择考卷
togglePaper(e) {
if (this.selectPaper.id != e.id) {
this.selectPaper = e
this.selectPaper = e;
}
}
//切换 选择考卷内容
togglePaperType(e) {
if (this.selectPaperType != e) {
this.selectPaperType = e
this.selectPaperType = e;
}
}
//提交阅卷结果
submitResult() {
let bodyData = {
const dialogRef = this.dialog.open(EvaluateComponent, {
data: { Evaluate: "" },
});
dialogRef.afterClosed().subscribe((result) => {
// console.log("The dialog was closed", result);
if (result.type) {
let bodyData: any = {
id: this.paperData.id,
isMarked: true,
totalScore: 0,
examinationDataInfo: [],
}
let paramsData = JSON.parse(JSON.stringify( this.paperCompanyData )) //考卷
paramsData.forEach(element => {
comment: result.value,
};
let paramsData = JSON.parse(JSON.stringify(this.paperCompanyData)); //考卷
paramsData.forEach((element) => {
//计算总分
bodyData.totalScore = bodyData.totalScore+element.adjoinTotalPoints+element.basicInfoTotalPoints+element.facilityTotalPoints+element.functionalDivisionTotalPoints+element.importLocationTotalPoints
element.planList.forEach(item => {
bodyData.totalScore = bodyData.totalScore + item.score || 0
bodyData.totalScore =
bodyData.totalScore +
element.adjoinTotalPoints +
element.basicInfoTotalPoints +
element.facilityTotalPoints +
element.functionalDivisionTotalPoints +
element.importLocationTotalPoints;
element.planList.forEach((item) => {
bodyData.totalScore = bodyData.totalScore + item.score || 0;
});
//计算总分
element.adjoinScore = element.adjoinTotalPoints //四周毗邻
delete element.adjoinTotalPoints
delete element.adjoinItemScore
element.basicInfoScore = element.basicInfoTotalPoints //基本信息
delete element.basicInfoTotalPoints
delete element.basicInfoItemScore
element.facilityScore = element.facilityTotalPoints //消防设施
delete element.facilityTotalPoints
delete element.facilityItemScore
element.functionalDivisionScore = element.functionalDivisionTotalPoints //功能分区
delete element.functionalDivisionTotalPoints
delete element.functionalDivisionItemSocre
element.importLocationScore = element.importLocationTotalPoints //重点部位
delete element.importLocationTotalPoints
delete element.importLocationItemScore
delete element.planList
delete element.planScore
delete element.score
element.adjoinData = JSON.stringify(element.adjoinData)
element.basicInfoData = JSON.stringify(element.basicInfoData)
element.facilityData = JSON.stringify(element.facilityData)
element.functionalDivisionData = JSON.stringify(element.functionalDivisionData)
element.importLocationData = JSON.stringify(element.importLocationData)
});
bodyData.examinationDataInfo = paramsData
this.http.put(`/api/Examinations/${this.paperData.id}`,bodyData).subscribe(data=>{
element.adjoinScore = element.adjoinTotalPoints; //四周毗邻
delete element.adjoinTotalPoints;
delete element.adjoinItemScore;
element.basicInfoScore = element.basicInfoTotalPoints; //基本信息
delete element.basicInfoTotalPoints;
delete element.basicInfoItemScore;
element.facilityScore = element.facilityTotalPoints; //消防设施
delete element.facilityTotalPoints;
delete element.facilityItemScore;
element.functionalDivisionScore =
element.functionalDivisionTotalPoints; //功能分区
delete element.functionalDivisionTotalPoints;
delete element.functionalDivisionItemSocre;
element.importLocationScore = element.importLocationTotalPoints; //重点部位
delete element.importLocationTotalPoints;
delete element.importLocationItemScore;
delete element.planList;
delete element.planScore;
delete element.score;
element.adjoinData = JSON.stringify(element.adjoinData);
element.basicInfoData = JSON.stringify(element.basicInfoData);
element.facilityData = JSON.stringify(element.facilityData);
element.functionalDivisionData = JSON.stringify(
element.functionalDivisionData
);
element.importLocationData = JSON.stringify(
element.importLocationData
);
console.log(this.correctionRecordData);
// console.log("element", element);
});
// console.log(456, this.paperData);
let arr = [];
if (this.paperData.modifyHistory) {
arr = JSON.parse(this.paperData.modifyHistory);
}
let obj = {
modifiedBy: JSON.parse(sessionStorage.getItem("creatorData")),
modifiedTime: new Date(),
data: this.correctionRecordData,
};
arr.push(obj);
bodyData.examinationDataInfo = paramsData;
bodyData.modifyHistory = JSON.stringify(arr);
this.http
.put(`/api/Examinations/${this.paperData.id}`, bodyData)
.subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 5000
this.snackBar.open('阅卷结果提交成功','确定',config);
})
config.verticalPosition = "top";
config.duration = 5000;
this.snackBar.open(
"阅卷结果提交成功,页面将于一秒后关闭!",
"确定",
config
);
setTimeout(() => {
window.close();
}, 1000);
});
}
});
}
//作战部署 阅卷
readExam(item, e) {
sessionStorage.setItem('companyName', this.selectPaper.companyInfo.name)
sessionStorage.setItem('planId', item.paperPlanInfo.planComponentId)
sessionStorage.setItem('buildingTypeId', this.selectPaper.companyInfo.buildingTypes[0].id)
sessionStorage.setItem('companyId', this.selectPaper.companyInfo.id)
let openType
item.paperPlanInfo.examPlanType == 0 ? openType = 1 : openType = 2
window.open(`/canvasToolRead?planName=${item.paperPlanInfo.title}&paperplanId=${item.paperPlanId}&openType=${openType}&paperId=${this.paperId}&examId=${this.route.snapshot.queryParams.examId}&planComponentId=${item.paperPlanInfo.planComponentId}&paperType=${e}`)
sessionStorage.setItem("companyName", this.selectPaper.companyInfo.name);
sessionStorage.setItem("planId", item.paperPlanInfo.planComponentId);
sessionStorage.setItem(
"buildingTypeId",
this.selectPaper.companyInfo.buildingTypes[0].id
);
sessionStorage.setItem("companyId", this.selectPaper.companyInfo.id);
sessionStorage.setItem("remark", item.remark);
let openType;
item.paperPlanInfo.examPlanType == 0 ? (openType = 1) : (openType = 2);
window.open(
`/canvasToolRead?planName=${item.paperPlanInfo.title}&paperplanId=${item.paperPlanId}&openType=${openType}&paperId=${this.paperId}&examId=${this.route.snapshot.queryParams.examId}&planComponentId=${item.paperPlanInfo.planComponentId}&paperType=${e}`
);
}
}
export interface radioType {
isRight: boolean,
name: string,
isRight: boolean;
name: string;
}
@Component({
selector: 'app-edit-rightWrong',
templateUrl: './editRightWrong.html',
styleUrls: ['./review-files.component.scss']
selector: "app-edit-rightWrong",
templateUrl: "./editRightWrong.html",
styleUrls: ["./review-files.component.scss"],
})
export class editRightWrongComponent implements OnInit {
constructor(public http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route:ActivatedRoute,@Inject(MAT_DIALOG_DATA) public data: any,public dialogRef: MatDialogRef<any>,) { }
constructor(
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public route: ActivatedRoute,
@Inject(MAT_DIALOG_DATA) public data: any,
public dialogRef: MatDialogRef<any>
) {}
ngOnInit(): void {
this.isChecked = JSON.parse( JSON.stringify(this.data.isRight) )
this.isChecked = JSON.parse(JSON.stringify(this.data.isRight));
}
isChecked: boolean; //是否正确
radioList: radioType[] = [
{ isRight: true, name: '正确', },
{ isRight: false, name: '错误', },
{ isRight: true, name: "正确" },
{ isRight: false, name: "错误" },
];
submit() {
let data = {isChecked : this.isChecked}
this.dialogRef.close(data)
let data = { isChecked: this.isChecked };
this.dialogRef.close(data);
}
}
@Component({
selector: "app-edit-Fraction",
templateUrl: "./editFraction.html",
styleUrls: ["./review-files.component.scss"],
})
export class editFractionComponent implements OnInit {
constructor(
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public route: ActivatedRoute,
@Inject(MAT_DIALOG_DATA) public data: any,
public dialogRef: MatDialogRef<any>
) {}
ngOnInit(): void {
console.log(this.data);
this.isScore = JSON.parse(JSON.stringify(this.data.score));
}
isScore: Number; //分数
submit() {
if (this.isScore > this.data.paperPlanInfo.score) {
alert("超出最大分值!");
} else {
let params: any = {
paperPlanId: this.data.paperPlanId,
examinationId: this.data.examinationId,
score: this.isScore,
remark: this.data.remark,
};
this.http
.put("/api/ExaminationPlans/ModifyScore", "", { params: params })
.subscribe((res) => {
let data = { isScore: this.isScore };
this.dialogRef.close(data);
});
}
}
}

56
src/app/examiner/statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component.html

@ -0,0 +1,56 @@
<div class="content">
<div class="header">
<div class="queryBox">
<div class="queryField">
<label>考生姓名:</label>
<input type="text" placeholder="请输入考生姓名" [(ngModel)]="name" />
</div>
<div class="queryField">
<label>消防救援站:</label>
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 250px" [(ngModel)]="orId"
[nzNodes]="nodes" nzPlaceHolder="请选择">
</nz-tree-select>
<mat-checkbox color="primary" style="margin-left: 26px;" [(ngModel)]="orIdChecked">包含下级
</mat-checkbox>
</div>
<div class="queryField">
<button style="background-color: #07CDCF;" (click)="Submit()">查询</button>
<button style="margin-left: 10px; background-color: #FF8678;" (click)="Reset()">重置</button>
</div>
</div>
</div>
<div class="centertable">
<table>
<thead>
<th style="width: 15%;">编号</th>
<th style="width: 15%;">考生姓名</th>
<th style="width: 25%;">所属机构</th>
<th style="width: 15%;">综合素质评分</th>
<th style="width: 15%;">作战能力评分</th>
<th style="width: 15%;">综合评分</th>
</thead>
<tbody>
<tr *ngFor="let item of tabledataSource;let key = index">
<td>{{(PageNumber-1)*10+(key + 1)}}</td>
<td>{{item.examineeRealName || '/'}}</td>
<td>{{item.organizationName}}</td>
<td class="ratebox">
<nz-rate [ngModel]="item.overallQualityRating" [nzDisabled]="true"></nz-rate>
<div class="mask"></div>
</td>
<td class="ratebox">
<nz-rate [ngModel]="item.combatCapabilityRating" [nzDisabled]="true"></nz-rate>
<div class="mask"></div>
<td class="ratebox">
<nz-rate [ngModel]="item.overallRating" [nzDisabled]="true"></nz-rate>
<div class="mask"></div>
</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="length" [pageSize]="10" (page)="chagePage($event)">
</mat-paginator>
</div>
</div>

116
src/app/examiner/statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component.scss

@ -0,0 +1,116 @@
table {
width: 100%;
text-align: center;
.cdk-header-cell {
text-align: center;
}
}
.content {
width: 100%;
height: 100%;
overflow: hidden;
background: #F2F5F6;
overflow-y: auto;
}
.header {
width: 100%;
padding: 10px;
box-sizing: border-box;
display: flex;
align-items: center;
.queryBox {
box-sizing: border-box;
padding: 5px 15px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: left;
.queryField {
margin: 0 25px;
font-size: 13px;
label {
margin-right: 10px;
font-size: 15px;
}
input {
font-size: 13px;
width: 320px;
height: 30px;
line-height: 30px;
border-radius: 3px;
padding-left: 5px;
outline: none;
border: 1px solid rgb(226, 211, 211);
}
button {
border: none;
color: white;
padding: 8px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 13px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
outline: 0 none !important;
}
}
.headerright {
float: right;
}
}
}
.centertable {
width: 95%;
margin-right: 40px;
margin-left: 40px;
background-color: #FFFFFF;
table {
td,
th {
height: 48px;
font-size: 13px;
}
td {
border-bottom: 1px solid #F2F5F6;
}
.ratebox{
position: relative;
.mask{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
}
thead {
background-color: #F5FDFE;
}
.green {
color: #07CDCF;
}
.red {
color: #FF8678;
}
}
}

25
src/app/examiner/statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ExamineeCapacityComponent } from './examinee-capacity.component';
describe('ExamineeCapacityComponent', () => {
let component: ExamineeCapacityComponent;
let fixture: ComponentFixture<ExamineeCapacityComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ExamineeCapacityComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ExamineeCapacityComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

128
src/app/examiner/statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component.ts

@ -0,0 +1,128 @@
import { Component, OnInit } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { MatSnackBar } from "@angular/material/snack-bar";
import { Router } from "@angular/router";
import { TreeService } from "src/app/http-interceptors/tree.service";
@Component({
selector: "app-examinee-capacity",
templateUrl: "./examinee-capacity.component.html",
styleUrls: ["./examinee-capacity.component.scss"],
})
export class ExamineeCapacityComponent implements OnInit {
constructor(
private router: Router,
public http: HttpClient,
public snackBar: MatSnackBar,
private tree: TreeService
) {}
Profiles: any;
ngOnInit(): void {
this.Profiles = JSON.parse(sessionStorage.getItem("creatorData"));
this.getOrganizations();
this.getAlltabledate();
}
//获得所有组织机构
allorganizations;
treedata;
nodes = [];
expandedKeys = [];
getOrganizations() {
this.http
.get("/api/Organizations", {
params: {
strict: "true",
},
})
.subscribe((data: any) => {
this.allorganizations = data;
this.allorganizations.forEach((element) => {
if (element.id === this.Profiles.organizationId) {
element.parentId = null;
}
});
this.treedata = this.tree.toTree(data);
this.orId = this.Profiles.organizationId;
this.getpresentOrganization();
});
}
//得到当前单位所在组织机构的tree型数据
organizationName;
newallorganizations;
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.organizationName = this.Profiles.organizationName;
if (this.organizationName) {
this.newallorganizations.forEach((item) => {
if (item.name == this.organizationName) {
this.nodes = [item];
this.expandedKeys = [item.key];
}
});
} else {
this.nodes = this.tree.toTree(this.treedata);
this.expandedKeys = this.nodes[0].key;
}
}
//获取表格信息
PageNumber = 1;
PageSize = 10;
name;
orId;
orIdChecked = true;
tabledataSource;
length;
getAlltabledate() {
let paramsdata: any = {
ExamineeRealName: this.name || "",
OrganizationId: this.Profiles.organizationId,
ContainsChildren: this.orIdChecked,
PageNumber: this.PageNumber,
PageSize: this.PageSize,
};
this.http
.get("/api/ExamStatisticalAnalyses/AbilityAnalysis", {
params: paramsdata,
})
.subscribe((data: any) => {
console.log("数据", data);
this.tabledataSource = data.items;
this.length = data.totalCount;
});
}
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex + 1;
this.getAlltabledate();
}
//查询按钮
Submit() {
if (!this.orId) {
this.snackBar.open("组织机构不能为空", "确定", {
verticalPosition: "top",
duration: 3000,
});
return;
}
this.getAlltabledate();
}
//重置按钮
Reset() {
this.name = "";
this.orId = this.Profiles.organizationId;
this.orIdChecked = true;
this.getAlltabledate();
}
}

19
src/app/examiner/statistic-analysis/examStatistics/echarts/echarts.component.html

@ -0,0 +1,19 @@
<div class="conter">
<div class="left">
<div class="top">
<div class="top-left">
<button *ngIf="level!=0" (click)="back()">返回上一级</button>
</div>
<div class="top-right">
<span (click)="switch('频次')" [ngClass]="{ select: !examinationIndex }"
>考试频次</span
>
|
<span (click)="switch('人数')" [ngClass]="{ select: examinationIndex }"
>考试人数</span
>
</div>
</div>
<div id="zhidui"></div>
</div>
</div>

51
src/app/examiner/statistic-analysis/statistic-analysis.component.scss → src/app/examiner/statistic-analysis/examStatistics/echarts/echarts.component.scss

@ -6,16 +6,55 @@
display: flex;
overflow-y: auto;
.left{
width: 80%;
width: 100%;
height: 60%;
margin: 20px 20px 10px 50px;
margin: 20px 20px 10px 20px;
background-color: #FFFFFF;
border-radius: 16px ;
.top{
width: 100%;
box-sizing: border-box;
display: flex;
cursor:pointer;
// height: 40px;
font-size: 18px;
line-height: 40px;
padding: 10px 60px 20px 0;
font-weight: 600;
color: rgb(161, 161,161);
// text-align: right;
button {
border: none;
// color: white;
padding: 8px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 13px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
outline: 0 none !important;
}
.top-left{
width: 50%;
padding-left: 50px;
text-align: left;
}
.top-right{
width: 50%;
text-align: right;
}
}
.select{
color: rgb(38,38,38);
}
#zhidui{
width: 80%;
height: 50%;
position: absolute;
top: 100px;
width: 100%;
height: 82%;
// margin-top: -60px;
// position: absolute;
// top: 100px;
//left: 40%;
//top: 45%;
//transform: translate(-50%,-60%);

25
src/app/examiner/statistic-analysis/examStatistics/echarts/echarts.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EchartsComponent } from './echarts.component';
describe('EchartsComponent', () => {
let component: EchartsComponent;
let fixture: ComponentFixture<EchartsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EchartsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EchartsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

226
src/app/examiner/statistic-analysis/examStatistics/echarts/echarts.component.ts

@ -0,0 +1,226 @@
import { Component, OnInit } from "@angular/core";
import { Router, NavigationExtras } from "@angular/router";
import { HttpClient, HttpHeaders } from "@angular/common/http";
declare var echarts: any;
@Component({
selector: "app-echarts",
templateUrl: "./echarts.component.html",
styleUrls: ["./echarts.component.scss"],
})
export class EchartsComponent implements OnInit {
constructor(public router: Router, private http: HttpClient) {}
ngOnInit(): void {
this.getProfiles();
// window.setTimeout(() => {
// this.initCharts();
// }, 0);
}
zhutu; //柱状图实例
echartsData;
zhiData = {
name: [],
number: [],
};
Profiles: any;
getProfiles() {
this.http.get("/api/ExamAccounts/Profiles").subscribe((data: any) => {
this.Profiles = data;
sessionStorage.setItem("creatorData", JSON.stringify(data));
this.getExamStatisticalAnalyses();
});
}
organizationId;
oldOrganizationId;
queryMode = 0;
getExamStatisticalAnalyses() {
let params: any = {
QueryMode: this.queryMode,
OrganizationId: this.organizationId
? this.organizationId
: this.Profiles.organizationId,
PageNumber: 1,
PageSize: 9999,
};
this.http
.get("/api/ExamStatisticalAnalyses/ExaminationStatistics", {
params: params,
})
.subscribe((res: any) => {
console.log(res);
if (this.level == 1) {
this.oldOrganizationId = params.OrganizationId;
}
this.echartsData = res;
this.zhiData = {
name: [],
number: [],
};
this.echartsData.forEach((element) => {
this.zhiData.name.push(element.organizationName);
this.zhiData.number.push(element.count);
});
this.initCharts();
});
}
title = "考试频次(次)";
examinationIndex = false;
color = "#41CDFC";
//切换
switch(e) {
if (e == "频次") {
this.title = "考试频次(次)";
this.examinationIndex = false;
this.color = "#41CDFC";
this.queryMode = 0;
} else {
this.title = "考试人数(个)";
this.examinationIndex = true;
this.color = "#FF8678";
this.queryMode = 1;
}
let myChart = echarts.init(document.getElementById("zhidui"));
myChart.dispose();
this.getProfiles();
}
//后退
level = 0;
back() {
if (this.level == 1) {
this.organizationId = this.Profiles.organizationId;
} else if (this.level == 2) {
this.organizationId = this.oldOrganizationId;
}
this.level = this.level - 1;
let myChart = echarts.init(document.getElementById("zhidui"));
myChart.dispose();
this.getExamStatisticalAnalyses();
}
initCharts() {
var detailPlanEchart = echarts.init(document.getElementById("zhidui"));
var option = {
title: {
text: this.title,
left: "5%", // 位置
textStyle: {
color: "#A1A1A1",
fontSize: "16px",
textAlign: "left",
},
},
xAxis: {
type: "category",
data: this.zhiData.name,
axisLabel: {
fontSize: 12,
lineHeight: 31,
interval: 0,
rotate: this.zhiData.name.length < 15 ? 0 : 40,
},
axisLine: {
show: false,
},
splitLine: {
show: false,
},
axisTick: {
show: false,
},
},
yAxis: {
type: "value",
axisLabel: {
fontSize: 18,
lineHeight: 31,
},
axisTick: {
show: false,
},
axisLine: {
show: false,
},
splitLine: {
show: true,
lineStyle: {
opacity: 0.6,
type: "dashed",
},
},
show: true,
},
grid: {
left: "5%",
right: "5%",
bottom: "1%",
containLabel: true,
},
series: [
{
data: this.zhiData.number,
type: "bar",
// showBackground: true,
backgroundStyle: {
color: "#F2F5F6",
},
// barWidth: 30,
barMaxWidth: 40,
color: this.color,
itemStyle: {
normal: {
label: {
show: true, //开启显示
position: "top", //在上方显示
textStyle: {
//数值样式
color: "black",
fontSize: 12,
},
},
},
},
// barWidth:"24px"
},
],
};
detailPlanEchart.on("click", (e) => {
this.clickFunc(e);
});
detailPlanEchart.setOption(option);
}
clickFunc(e) {
let myChart = echarts.init(document.getElementById("zhidui"));
console.log(e);
this.echartsData.forEach((element) => {
if (element.organizationName == e.name && element.level != 3) {
this.organizationId = element.organizationId;
this.level = this.level + 1;
myChart.dispose();
this.getExamStatisticalAnalyses();
} else if (element.organizationName == e.name && element.level == 3) {
window.open(
"home/statistic-examination/station-examinee?organizationId=" +
element.organizationId
);
}
});
// if (e.name.indexOf("支队") != -1) {
// this.zhiData = this.daData;
// this.level = 1;
// myChart.dispose();
// this.initCharts();
// } else if (e.name.indexOf("大队") != -1) {
// this.zhiData = this.jiuData;
// this.level = 2;
// myChart.dispose();
// this.initCharts();
// } else {
// window.open("home/statistic-examination/station-examinee");
// }
}
}

62
src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.html

@ -0,0 +1,62 @@
<div class="content">
<div class="header">
<div class="queryBox">
<div class="queryField">
<label>试卷名称:</label>
<input type="text" placeholder="请输入试卷名称" [(ngModel)]="name" />
</div>
<div class="queryField">
<label>考试开始时间:</label>
<input type="date" placeholder="请选择考试开始时间" [(ngModel)]="starttime" />
</div>
<div class="queryField">
<label>考试结束时间:</label>
<input type="date" placeholder="请选择考试结束时间" [(ngModel)]="endtime" />
</div>
<div class="queryField">
<button style="background-color: #07CDCF;" (click)="Submit()">查询</button>
<button style="margin-left: 10px; background-color: #FF8678;" (click)="Reset()">重置</button>
<button style="margin-left: 10px; background-color: #07CDCF;" (click)="Export()">导出</button>
<button style="margin-left: 10px; background-color: #07CDCF;" (click)="goback()">返回</button>
</div>
</div>
</div>
<div class="centertable">
<table>
<thead>
<th style="width: 15%;">编号</th>
<th style="width: 15%;">试卷名称</th>
<th style="width: 25%;">考核机构</th>
<th style="width: 15%;">考试结束时间</th>
<th style="width: 10%;">试卷得分</th>
<th style="width: 10%;">试卷评价</th>
<th style="width: 10%;">操作</th>
</thead>
<tbody>
<tr *ngFor="let item of tabledataSource;let key = index">
<td>{{(PageNumber-1)*10+(key + 1)}}</td>
<td>{{item.examinationName}}</td>
<td>
<span style="margin: 0 2px;" *ngFor="let i of item.organizationNames">{{i}}</span>
</td>
<td>
{{item.endTime|date:'yyyy-MM-dd HH:mm'}}
</td>
<td>
{{item.score}}
</td>
<td>
{{item.comment}}
</td>
<td>
<span style="color: #07CDCF;cursor: pointer;" (click)="To(item)">详情</span>
</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="length" [pageSize]="10" (page)="chagePage($event)">
</mat-paginator>
</div>
</div>

118
src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.scss

@ -0,0 +1,118 @@
table {
width: 100%;
text-align: center;
.cdk-header-cell {
text-align: center;
}
}
.content {
width: 100%;
height: 100%;
overflow: hidden;
background: #F2F5F6;
overflow-y: auto;
}
.header {
width: 100%;
padding: 10px;
box-sizing: border-box;
display: flex;
align-items: center;
.queryBox {
box-sizing: border-box;
padding: 5px 15px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: left;
.queryField {
margin: 0 20px;
font-size: 13px;
label {
margin-right: 10px;
font-size: 15px;
}
input {
font-size: 13px;
width:250px;
height: 30px;
line-height: 30px;
border-radius: 3px;
padding-left: 5px;
outline: none;
border: 1px solid rgb(226, 211, 211);
}
button {
border: none;
color: white;
padding: 8px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 13px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
outline: 0 none !important;
}
}
.headerright {
float: right;
}
}
}
.centertable {
width: 95%;
margin-right: 40px;
margin-left: 40px;
background-color: #FFFFFF;
table {
td,
th {
height: 48px;
font-size: 13px;
}
td {
border-bottom: 1px solid #F2F5F6;
}
.ratebox {
position: relative;
.mask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
}
thead {
background-color: #F5FDFE;
}
.green {
color: #07CDCF;
}
.red {
color: #FF8678;
}
}
}

25
src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ExamineePapersComponent } from './examinee-papers.component';
describe('ExamineePapersComponent', () => {
let component: ExamineePapersComponent;
let fixture: ComponentFixture<ExamineePapersComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ExamineePapersComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ExamineePapersComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

164
src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.ts

@ -0,0 +1,164 @@
import { Component, OnInit } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { MatSnackBar } from "@angular/material/snack-bar";
import { ActivatedRoute, Router } from "@angular/router";
import { TreeService } from "src/app/http-interceptors/tree.service";
@Component({
selector: "app-examinee-papers",
templateUrl: "./examinee-papers.component.html",
styleUrls: ["./examinee-papers.component.scss"],
})
export class ExamineePapersComponent implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute,
public http: HttpClient,
public snackBar: MatSnackBar,
private tree: TreeService
) {}
examineeId;
examineeRealName;
//获取登录账号的个人资料
Profiles: any;
ngOnInit(): void {
this.Profiles = JSON.parse(sessionStorage.getItem("creatorData"));
this.examineeId = this.route.snapshot.queryParams.examineeId;
this.examineeRealName = this.route.snapshot.queryParams.examineeRealName;
this.getAlltabledate();
}
//获得所有组织机构
allorganizations;
treedata;
nodes;
expandedKeys = [];
getOrganizations() {
this.http
.get("/api/Organizations", {
params: {
strict: "true",
},
})
.subscribe((data: any) => {
this.allorganizations = data;
this.allorganizations.forEach((element) => {
if (element.id === this.Profiles.organizationId) {
element.parentId = null;
}
});
this.treedata = this.tree.toTree(data);
this.getpresentOrganization();
});
}
//得到当前单位所在组织机构的tree型数据
organizationName;
newallorganizations;
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.organizationName = this.Profiles.organizationName;
if (this.organizationName) {
this.newallorganizations.forEach((item) => {
if (item.name == this.organizationName) {
this.nodes = [item];
this.expandedKeys = [item.key];
}
});
} else {
this.nodes = this.tree.toTree(this.treedata);
this.expandedKeys = this.nodes[0].key;
}
}
//获取表格信息
PageNumber = 1;
PageSize = 10;
name;
starttime;
endtime;
orId;
orIdChecked;
tabledataSource;
length;
getAlltabledate() {
let paramsdata: any = {
ExamineeId: this.examineeId,
ExaminationName: this.name || "",
EndTimeBegin: this.starttime ? this.starttime + " " + "0:0:0" : "",
EndTimeEnd: this.endtime ? this.endtime + " " + "23:59:59" : "",
PageNumber: this.PageNumber,
PageSize: this.PageSize,
};
this.http
.get("/api/ExamStatisticalAnalyses/ExaminationStatistics/Examinations", {
params: paramsdata,
})
.subscribe((data: any) => {
this.tabledataSource = data.items;
this.length = data.totalCount;
});
}
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex + 1;
this.getAlltabledate();
}
To(item) {
window.open(`/reviewFiles?examId=${item.examinationId}&paperType=1`);
}
//查询按钮
Submit() {
this.getAlltabledate();
}
//重置按钮
Reset() {
this.name = "";
this.starttime = "";
this.endtime = "";
this.getAlltabledate();
}
Export() {
let paramsdata: any = {
ExamineeId: this.examineeId,
ExaminationName: this.name || "",
EndTimeBegin: this.starttime ? this.starttime + " " + "0:0:0" : "",
EndTimeEnd: this.endtime ? this.endtime + " " + "23:59:59" : "",
};
this.http
.get(
"/api/ExamStatisticalAnalyses/ExaminationStatistics/ExportExaminations",
{
responseType: "blob" as "json",
params: paramsdata,
}
)
.subscribe((data: any) => {
console.log("导出成功", data);
const link = document.createElement("a");
const blob = new Blob([data], { type: "application/vnd.ms-excel" });
link.setAttribute("href", window.URL.createObjectURL(blob));
link.setAttribute(
"download",
this.examineeRealName + "考试记录" + ".xls"
);
link.style.visibility = "hidden";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// this.message.create("success", `导出成功`);
});
}
goback() {
history.go(-1);
}
}

53
src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.html

@ -0,0 +1,53 @@
<div class="content">
<div class="header">
<div class="queryBox">
<div class="queryField">
<label>考生姓名:</label>
<input type="text" placeholder="请输入考生姓名" [(ngModel)]="name" />
</div>
<div class="queryField">
<label>消防救援站:</label>
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 250px" [(ngModel)]="orId"
[nzNodes]="nodes" nzPlaceHolder="请选择">
</nz-tree-select>
<!-- <mat-checkbox color="primary" style="margin-left: 26px;" [(ngModel)]="orIdChecked">包含下级
</mat-checkbox> -->
</div>
<div class="queryField">
<button style="background-color: #07CDCF;" (click)="Submit()">查询</button>
<button style="margin-left: 10px; background-color: #FF8678;" (click)="Reset()">重置</button>
</div>
</div>
</div>
<div class="centertable">
<table>
<thead>
<th style="width: 15%;">编号</th>
<th style="width: 15%;">考生姓名</th>
<th style="width: 25%;">所属机构</th>
<th style="width: 15%;">考试次数</th>
<th style="width: 15%;">平均成绩</th>
<th style="width: 15%;">操作</th>
</thead>
<tbody>
<tr *ngFor="let item of tabledataSource;let key = index">
<td>{{(PageNumber-1)*10+(key + 1)}}</td>
<td>{{item.examineeRealName}}</td>
<td>{{item.organizationName}}</td>
<td>
{{item.examinationTimes}}次
</td>
<td>
{{item.averageScore}}分
<td>
<span style="color: #07CDCF;cursor: pointer;" (click)="To(item)">详情</span>
</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="length" [pageSize]="10" (page)="chagePage($event)">
</mat-paginator>
</div>
</div>

118
src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.scss

@ -0,0 +1,118 @@
table {
width: 100%;
text-align: center;
.cdk-header-cell {
text-align: center;
}
}
.content {
width: 100%;
height: 100%;
overflow: hidden;
background: #F2F5F6;
overflow-y: auto;
}
.header {
width: 100%;
padding: 10px;
box-sizing: border-box;
display: flex;
align-items: center;
.queryBox {
box-sizing: border-box;
padding: 5px 15px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: left;
.queryField {
margin: 0 25px;
font-size: 13px;
label {
margin-right: 10px;
font-size: 15px;
}
input {
font-size: 13px;
width: 320px;
height: 30px;
line-height: 30px;
border-radius: 3px;
padding-left: 5px;
outline: none;
border: 1px solid rgb(226, 211, 211);
}
button {
border: none;
color: white;
padding: 8px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 13px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
outline: 0 none !important;
}
}
.headerright {
float: right;
}
}
}
.centertable {
width: 95%;
margin-right: 40px;
margin-left: 40px;
background-color: #FFFFFF;
table {
td,
th {
height: 48px;
font-size: 13px;
}
td {
border-bottom: 1px solid #F2F5F6;
}
.ratebox {
position: relative;
.mask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
}
thead {
background-color: #F5FDFE;
}
.green {
color: #07CDCF;
}
.red {
color: #FF8678;
}
}
}

25
src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { StationExamineeComponent } from './station-examinee.component';
describe('StationExamineeComponent', () => {
let component: StationExamineeComponent;
let fixture: ComponentFixture<StationExamineeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StationExamineeComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(StationExamineeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

118
src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.ts

@ -0,0 +1,118 @@
import { Component, OnInit } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { MatSnackBar } from "@angular/material/snack-bar";
import { ActivatedRoute, Router } from "@angular/router";
import { TreeService } from "src/app/http-interceptors/tree.service";
@Component({
selector: "app-station-examinee",
templateUrl: "./station-examinee.component.html",
styleUrls: ["./station-examinee.component.scss"],
})
export class StationExamineeComponent implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute,
public http: HttpClient,
public snackBar: MatSnackBar,
private tree: TreeService
) {}
loginUserInfo;
ngOnInit() {
this.loginUserInfo = JSON.parse(sessionStorage.getItem("creatorData"));
this.orId = this.route.snapshot.queryParams.organizationId;
this.getOrganizations();
this.getAlltabledate();
}
//获取登录账号的个人资料
Profiles: any;
getProfiles() {
return new Promise((resolve) => {
this.http.get("/api/ExamAccounts/Profiles").subscribe((data: any) => {
this.Profiles = data;
sessionStorage.setItem("creatorData", JSON.stringify(data));
resolve(data);
});
});
}
//获得所有组织机构
allorganizations;
treedata;
nodes = [];
expandedKeys = [];
getOrganizations() {
this.http
.get("/api/Organizations", {
params: {
strict: "true",
},
})
.subscribe((data: any) => {
this.allorganizations = data;
this.allorganizations.forEach((element) => {
if (element.id === this.loginUserInfo.organizationId) {
element.parentId = null;
}
});
this.nodes = [...this.tree.toTree(data)];
});
}
//获取表格信息
PageNumber = 1;
PageSize = 10;
name;
orId;
orIdChecked;
tabledataSource;
length;
getAlltabledate() {
let paramsdata: any = {
ExamineeRealName: this.name || "",
OrganizationId: this.orId || "",
PageNumber: this.PageNumber,
PageSize: this.PageSize,
};
this.http
.get("/api/ExamStatisticalAnalyses/ExaminationStatistics/Examinees", {
params: paramsdata,
})
.subscribe((data: any) => {
console.log("数据", data);
this.tabledataSource = data.items;
this.length = data.totalCount;
});
}
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex + 1;
this.getAlltabledate();
}
To(item) {
this.router.navigate(["/home/statistic-examination/examinee-papers"], {
queryParams: {
examineeId: item.examineeId,
examineeRealName: item.examineeRealName,
},
}); //登陆成功跳转页面
}
//查询按钮
Submit() {
if (!this.orId) {
this.snackBar.open("组织机构不能为空", "确定", {
verticalPosition: "top",
duration: 3000,
});
return;
}
this.getAlltabledate();
}
//重置按钮
Reset() {
this.name = "";
this.orId = this.route.snapshot.queryParams.organizationId;
// this.orIdChecked = true;
this.getAlltabledate();
}
}

29
src/app/examiner/statistic-analysis/statistic-analysis.component.html

@ -1,29 +0,0 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-15 14:19:50
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-17 14:30:16
-->
<div class="conter">
<div class="left">
<div id="zhidui">
</div>
</div>
<div class="right">
<img src="../../../assets/images/statictop.png" style="height: 90px;width: 90px;">
<div class="rightone">
<div><span style="font-size: 24px;">STATISTICS</span></div>
<div style="margin-top: 10px;"><span style="font-size: 20px;">消防救援单位信息</span></div>
<div style="margin-top: 10px;"><span style="font-size: 20px;"> 考核统计分析</span></div>
</div>
<div class="righttwo">
<div><button [ngClass]="{'clickButton':upStatic}" (click)="upexam()"><img src="../../../assets/images/upload.png" > 发布统计</button></div>
<div style="margin-top: 20px;"><button [ngClass]="{'clickButton':staticExam}" (click)="staticecam()"><img src="../../../assets/images/examstatic.png" [ngStyle]="{'background-color':staticExam==true?'#07CDCF':''}"> 考试统计</button></div>
</div>
<div class="rightthree">
<img src="../../../assets/images/examdown.png">
</div>
</div>
</div>

101
src/app/examiner/statistic-analysis/statistic-analysis.component.ts

@ -1,101 +0,0 @@
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-15 14:19:50
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-17 16:02:43
*/
import { Component, OnInit } from '@angular/core';
//import {EchartsDataService} from '../../echarts-data.service';
declare var echarts: any;
@Component({
selector: 'app-statistic-analysis',
templateUrl: './statistic-analysis.component.html',
styleUrls: ['./statistic-analysis.component.scss']
})
export class StatisticAnalysisComponent implements OnInit {
constructor() { }
ngOnInit(): void {
window.setTimeout(()=>{
this.initCharts()
},0)
}
zhutu//柱状图实例
zhiNameData =["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队"]
staticExam=false//考试统计
upStatic=false//发布考试统计
//考试统计按钮
staticecam(){
this.staticExam=true
this.upStatic=false
}
//发布考试按钮
upexam(){
this.staticExam=false
this.upStatic=true
}
initCharts() {
var detailPlanEchart = echarts.init(document.getElementById('zhidui'));
var option = {
xAxis: {
type: 'category',
data: this.zhiNameData,
axisLabel:{
fontSize:18,
lineHeight:31,
},
axisLine:{
show:false
},
splitLine:{
show:false
},
axisTick:{
show:false
},
},
yAxis: {
type: 'value',
axisLabel:{
fontSize:18,
lineHeight:31
},
axisTick:{
show:false
},
axisLine:{
show:false
},
splitLine:{
show:true,
lineStyle:{
opacity:0.2,
type:'dashed'
}
},
show:true
},
series: [{
data: [160, 150,140,130, 120, 100,90, 80, 60, 40,30],
type: 'bar',
showBackground: true,
backgroundStyle: {
color: '#F2F5F6'
},
itemStyle:{
color:"#FF8678",
barBorderRadius:12
},
barWidth:"24px"
}]
};
detailPlanEchart.setOption(option);
}
}

93
src/app/http-interceptors/base-interceptor.ts

@ -1,42 +1,49 @@
import { Injectable } from '@angular/core';
import { Injectable } from "@angular/core";
import {
HttpClient, HttpEvent, HttpInterceptor, HttpHandler, HttpRequest,
HttpErrorResponse
} from '@angular/common/http';
import { throwError } from 'rxjs'
import { catchError, retry } from 'rxjs/operators';
import { Router,ActivatedRoute } from '@angular/router'
import { CacheTokenService } from './cache-token.service'
import { IsLoginService } from '../is-login.service'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
HttpClient,
HttpEvent,
HttpInterceptor,
HttpHandler,
HttpRequest,
HttpErrorResponse,
} from "@angular/common/http";
import { throwError } from "rxjs";
import { catchError, retry } from "rxjs/operators";
import { Router, ActivatedRoute } from "@angular/router";
import { CacheTokenService } from "./cache-token.service";
import { IsLoginService } from "../is-login.service";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
//baseurl
// const baseurl = 'http://39.106.78.171:8008';
@Injectable()
export class BaseInterceptor implements HttpInterceptor {
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public snackBar: MatSnackBar,public isLogin: IsLoginService) {}
constructor(
private http: HttpClient,
private router: Router,
private route: ActivatedRoute,
public token: CacheTokenService,
public snackBar: MatSnackBar,
public isLogin: IsLoginService
) {}
intercept(req, next: HttpHandler) {
let newReq = req.clone({
url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
});
if (!req.cancelToken) {
/*获取token*/
let token = sessionStorage.getItem("token") || ''
let token = sessionStorage.getItem("token") || "";
/*此处设置额外请求头,token令牌*/
newReq.headers =
newReq.headers.set('Authorization', `Bearer ${token}`)
newReq.headers = newReq.headers.set("Authorization", `Bearer ${token}`);
}
// 携带请求头发送下一次请求
return next.handle(newReq)
.pipe(
return next.handle(newReq).pipe(
//箭头函数,注意this指向
catchError((err) => this.handleError(err))
)
);
}
// 捕获错误
@ -45,39 +52,41 @@ export class BaseInterceptor implements HttpInterceptor {
private handleError(error: HttpErrorResponse) {
// 用户认证失败返回登录页
if (error.status === 401 || error.status === 614) {
sessionStorage.clear()
localStorage.clear()
this.router.navigate(['/login'])
sessionStorage.clear();
localStorage.clear();
this.router.navigate(["/login"]);
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('用户认证信息过期,请重新登录','确定',config);
}
if (error.status === 403) {
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("用户认证信息过期,请重新登录", "确定", config);
} else if (error.status === 403) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('对不起,您无此权限','确定',config);
}
if (error.status === 400) {
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("对不起,您无此权限", "确定", config);
} else if (error.status === 400) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('您输入的参数有误','确定',config);
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("您输入的参数有误", "确定", config);
} else {
// console.log(error.error)
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open(error.error, "确定", config);
}
if (error.error instanceof ErrorEvent) {
// 发生客户端或网络错误。相应处理。
console.error('An error occurred:', error.error.message);
console.error("An error occurred:", error.error.message);
} else {
// 服务端返回http状态码
// 服务端返回错误信息
console.error(
`Backend returned code ${error.status}, ` +
`body was: ${error.error}`);
`Backend returned code ${error.status}, ` + `body was: ${error.error}`
);
}
// 返回带有面向用户的错误信息
return throwError(
error.error);
};
return throwError(error.error);
}
}

31
src/app/navigation/navigation.component.html

@ -17,37 +17,46 @@
<img src="../../assets/images/logo.png" alt="logo">
</div>
<div class="biglogospan">
<div class="top"><span style="font-size: 22px;font-weight: 800;margin-left: 3px;">上海消防救援</span></div>
<div class="down"><span style="font-size: 4px;font-weight: 400;width: 125px;">shanghai fire and rescue</span></div>
<div class="top"><span style="font-size: 22px;font-weight: 800;margin-left: 3px;">广西消防救援</span></div>
<div class="down"><span style="font-size: 4px;font-weight: 400;width: 125px;">guangxi fire and rescue</span>
</div>
</div>
</div>
<div class="navbox">
<ul class="teacher" *ngIf="roleType == '1'">
<li [routerLink]="['/home/createexam-index']" routerLinkActive="clickStyle">
<img src="../../assets/images/found.png" style="background-color: #fff;"><label>创建考试</label>
<ul class="examiner" *ngIf="roleType == '1'">
<li (click)="routerTo('创建考试')" [ngClass]="{'clickStyle': selectedNav ==='创建考试'}">
<img class="create" src="../../assets/images/found.png"><label>创建考试</label>
</li>
<li [routerLink]="['/home/mark-papers-index']" routerLinkActive="clickStyle">
<img src="../../assets/images/papers.png" style="background-color: #07CDCF;"><label>阅卷</label>
<li (click)="routerTo('阅卷')" [ngClass]="{'clickStyle': selectedNav ==='阅卷'}">
<img class="look" src="../../assets/images/papers.png"><label>阅卷</label>
</li>
<li [routerLink]="['/home/statistic-anaily']" routerLinkActive="clickStyle">
<img src="../../assets/images/Statistics.png" style="background-color: #07CDCF;"><label>统计分析</label>
<li (click)="routerTo('统计分析')" [ngClass]="{'clickStyle': selectedNav ==='统计分析'}">
<img class="statistics" src="../../assets/images/Statistics.png"><label>统计分析</label>
</li>
<div class="nav2" *ngIf="selectedNav ==='统计分析'">
<span (click)="routerTo2('考试统计')" [ngClass]="{'clickStyle2': selectedNav2 ==='考试统计'}">考试统计</span>
<span (click)="routerTo2('能力分析')" [ngClass]="{'clickStyle2': selectedNav2 ==='能力分析'}">能力分析</span>
</div>
</ul>
<ul class="teacher" *ngIf="roleType == '0'">
<ul *ngIf="roleType == '0'">
<li [routerLink]="['/home/teachear']" routerLinkActive="clickStyle">
<label>考官管理</label>
</li>
<li [routerLink]="['/home/examinee']" routerLinkActive="clickStyle">
<label>考生管理</label>
</li>
<li [routerLink]="['/home/admin']" routerLinkActive="clickStyle">
<label>管理员管理</label>
</li>
</ul>
<ul class="teacher" *ngIf="roleType == '2'">
<ul *ngIf="roleType == '2'">
<li [routerLink]="['/home/student-index']" routerLinkActive="clickStyle">
<img src="../../assets/images/joinexam.png" style="background-color: #FFFFFF;"> <label>参加考试</label>
</li>
<li [routerLink]="['/home/student-exarecord']" routerLinkActive="clickStyle">
<img src="../../assets/images/examrecord.png" style="background-color: #07CDCF;"> <label>考试记录</label>
</li>
</ul>
<img style="width: 191px;height: 113px; position: absolute; bottom: 0;" src="../../assets/images/backbottom.png">
</div>

72
src/app/navigation/navigation.component.scss

@ -1,25 +1,29 @@
.example-container {
width: 100%;
height: 100%;
}
mat-accordion {
height: 100%;
}
mat-sidenav {
box-shadow: 2px 0px 5px #888888;
color: white;
background-color: #07CDCF;
width: 216px;
overflow-x: hidden;
p {
height: 48px;
cursor: pointer;
font-size: 16px;
line-height: 48px;
}
ul {
width: 100%;
li {
list-style: none;
height: 48px;
@ -31,6 +35,7 @@ mat-sidenav{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
img {
display: inline-block;
margin: 5px;
@ -39,6 +44,7 @@ mat-sidenav{
vertical-align: middle;
cursor: pointer;
}
label {
display: inline-block;
vertical-align: middle;
@ -48,32 +54,40 @@ mat-sidenav{
}
}
.shownav {
position: absolute;
top: 13px;
z-index: 200;
}
.mat-accordion .mat-expansion-panel:first-of-type {
border-top-right-radius: 0px;
border-top-left-radius: 0px;
}
.mat-accordion .mat-expansion-panel:last-of-type {
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
}
.mat-expansion-panel {
border-radius: 0px;
}
.mat-expansion-panel-spacing {
margin: 0px;
}
.superdiv {
padding-left: 31px;
}
mat-icon {
color: white;
}
.navbox {
position: absolute;
overflow: hidden;
@ -83,6 +97,7 @@ mat-sidenav{
bottom: 0px;
overflow-y: scroll;
font-size: 15px;
ul {
li {
width: 198px;
@ -95,27 +110,65 @@ mat-sidenav{
outline: none;
border-radius: 8px;
}
li:hover {
background-color: #FFFFFF;
color: #07CDCF;
.look,
.statistics {
background-color: #07CDCF;
}
}
}
.examiner {
.create {
background-color: #fff;
}
}
.nav2 {
display: flex;
flex-direction: column;
span {
display: inline-block;
height: 40px;
line-height: 40px;
text-align: center;
cursor: pointer;
border-left: 3px solid #07CDCF;
margin-top: 3px;
}
.clickStyle2 {
background: #6FE2E3;
border-left: 3px solid #fff;
}
}
}
mat-sidenav-container.myapp-dark-theme {
background-color: #fafafa;
color: black;
mat-panel-title {
color: black;
}
ul li {
background-color: white;
}
.biglogobox {
background-color: #d50000;
}
color: black;
}
.biglogobox {
width: 220px;
height: 56px;
@ -124,41 +177,50 @@ mat-sidenav{
display: flex;
color: #FFF;
margin: 0 auto;
.biglogoimg {
margin-left: 20px;
height: 40px;
width: 36px;
}
.biglogospan {
display: flex;
flex-direction: column;
.down {
position: relative;
bottom: 7px;
width: 125px;
span {
white-space: nowrap;
}
}
}
img {
width: 32px;
height: 34px;
margin-top: 6px;
}
}
mat-panel-title mat-icon {
color: #afb2bb;
font-size: 16px;
line-height: 24px;
margin-right: 6px;
}
mat-expansion-panel {
background-color: #4699f6;
mat-expansion-panel-header {
padding-left: 15px;
color: white;
}
ul {
li {
text-align: left;
@ -176,13 +238,21 @@ mat-sidenav{
.clickStyle {
background-color: #FFFFFF;
color: #07CDCF;
.look,
.statistics {
background-color: #07CDCF;
}
}
.btn {
text-align: center;
button {
margin: 0 5px;
}
}
.example-sidenav-content {
height: 100%;
overflow: hidden;

79
src/app/navigation/navigation.component.ts

@ -1,22 +1,71 @@
import { Component, OnInit ,Inject,ViewChild} from '@angular/core';
import { CacheTokenService } from '../http-interceptors/cache-token.service'//引入服务
import { HttpClient,HttpHeaders } from '@angular/common/http';
import { FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { IsLoginService } from '../is-login.service'
import { ComponentServiceService } from '../component-service.service';
import { Router,ActivatedRoute } from '@angular/router'
import { Component, OnInit, Inject, ViewChild } from "@angular/core";
import { CacheTokenService } from "../http-interceptors/cache-token.service"; //引入服务
import { HttpClient, HttpHeaders } from "@angular/common/http";
import { FormControl } from "@angular/forms";
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import { IsLoginService } from "../is-login.service";
import { ComponentServiceService } from "../component-service.service";
import { Router, ActivatedRoute } from "@angular/router";
@Component({
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.scss']
selector: "app-navigation",
templateUrl: "./navigation.component.html",
styleUrls: ["./navigation.component.scss"],
})
export class NavigationComponent implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute,
public emitService: ComponentServiceService,
public navmenus: CacheTokenService,
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public islogin: IsLoginService
) {}
constructor(private router:Router,public emitService: ComponentServiceService,public navmenus:CacheTokenService,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public islogin:IsLoginService) { }
roleType = sessionStorage.getItem("roleType");
ngOnInit() {
if (this.router.url.indexOf("createexam-index") !== -1) {
this.selectedNav = "创建考试";
}
if (this.router.url.indexOf("mark-papers-index") !== -1) {
this.selectedNav = "阅卷";
}
if (this.router.url.indexOf("statistic") !== -1) {
this.selectedNav = "统计分析";
if (this.router.url.indexOf("statistic-examination") !== -1) {
this.selectedNav2 = "考试统计";
} else {
this.selectedNav2 = "能力分析";
}
}
}
roleType = sessionStorage.getItem('roleType')
ngOnInit() {}
selectedNav;
selectedNav2;
routerTo(name) {
this.selectedNav = name;
if (name === "统计分析") {
this.selectedNav2 = "考试统计";
this.router.navigate([RouterUrl["考试统计"]]); //登陆成功跳转页面
} else {
this.router.navigate([RouterUrl[name]]); //登陆成功跳转页面
}
}
routerTo2(name) {
this.selectedNav2 = name;
this.router.navigate([RouterUrl[name]]); //登陆成功跳转页面
}
}
enum RouterUrl {
"创建考试" = "/home/createexam-index",
"阅卷" = "/home/mark-papers-index",
"考试统计" = "/home/statistic-examination",
"能力分析" = "/home/statistic-capacity",
}

71
src/app/pages/lockscreen/lockscreen.component.ts

@ -1,62 +1,69 @@
import { Component, OnInit } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router'
import { MatSnackBarConfig, MatSnackBar } from '@angular/material/snack-bar';
import { HttpClient } from '@angular/common/http';
import { IsLoginService } from '../../is-login.service'//引入服务
import {CacheTokenService} from '../../http-interceptors/cache-token.service'//引入服务
import { Component, OnInit } from "@angular/core";
import { Router, ActivatedRoute } from "@angular/router";
import { MatSnackBarConfig, MatSnackBar } from "@angular/material/snack-bar";
import { HttpClient } from "@angular/common/http";
import { IsLoginService } from "../../is-login.service"; //引入服务
import { CacheTokenService } from "../../http-interceptors/cache-token.service"; //引入服务
@Component({
selector: 'app-lockscreen',
templateUrl: './lockscreen.component.html',
styleUrls: ['./lockscreen.component.scss']
selector: "app-lockscreen",
templateUrl: "./lockscreen.component.html",
styleUrls: ["./lockscreen.component.scss"],
})
export class LockscreenComponent implements OnInit {
constructor(
private http: HttpClient,
private router: Router,
private route: ActivatedRoute,
public token: CacheTokenService,
public snackBar: MatSnackBar,
private isLogin: IsLoginService
) {}
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public snackBar: MatSnackBar,private isLogin:IsLoginService) { }
ngOnInit() {
}
roleType:string = '1'; //登录角色
errmsg :string = ''; //错误信息
ngOnInit() {}
roleType: string = "1"; //登录角色
errmsg: string = ""; //错误信息
//登录
onSubmit(e) {
let params = { roleType: this.roleType }
this.http.post('/api/ExamAccounts/SignIn',e,{params}).subscribe((data:any)=>{
let params = { roleType: this.roleType };
this.http.post("/api/ExamAccounts/SignIn", e, { params }).subscribe(
(data: any) => {
sessionStorage.setItem("realName", data.realName);
sessionStorage.setItem("roleType", data.roleType);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
sessionStorage.setItem("level", data.level);
this.http.get("/api/ExamAccounts/Profiles").subscribe((v: any) => {
this.token.startUp(); //登陆成功启动定时器刷新token
this.roleType == '1'? this.router.navigate(['/home/createexam-index']) : this.router.navigate(['/home/student-index'])
},(err) => {this.errmsg = err})
this.roleType == "1"
? this.router.navigate(["/home/createexam-index"])
: this.router.navigate(["/home/student-index"]);
sessionStorage.setItem("creatorData", JSON.stringify(v));
});
},
(err) => {
this.errmsg = err;
}
);
}
//切换登录角色
toggle(e) {
this.roleType = e
this.roleType = e;
}
//跳转管理员登录页面
toAdminLogin() {
this.router.navigate(['/adminLogin']) //跳转管理员登录页面
this.router.navigate(["/adminLogin"]); //跳转管理员登录页面
}
//忘记密码弹窗
forget() {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请联系管理员重置密码','确定',config);
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("请联系管理员重置密码", "确定", config);
}
}

3
src/app/pages/login/login.component.html

@ -20,7 +20,8 @@
<div class="forget"><label (click)='forget()'>忘记密码?</label></div>
<div *ngIf="errmsg" class="alert-danger">{{errmsg}}</div>
<button type="submit" [disabled]="!form.form.valid" class="loginBtn" mat-raised-button>登录</button>
<label class="toAdmin" (click)='toAdminLogin()'><mat-icon style="vertical-align: middle; font-size: 22px;">replay</mat-icon>返回</label>
<label class="toAdmin" (click)='toAdminLogin()'><mat-icon
style="vertical-align: middle; font-size: 22px;">replay</mat-icon>返回</label>
</form>

66
src/app/pages/login/login.component.ts

@ -1,57 +1,61 @@
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router,ActivatedRoute } from '@angular/router'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { IsLoginService } from '../../is-login.service'//引入服务
import {CacheTokenService} from '../../http-interceptors/cache-token.service'//引入服务
import { Component, OnInit } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Router, ActivatedRoute } from "@angular/router";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import { IsLoginService } from "../../is-login.service"; //引入服务
import { CacheTokenService } from "../../http-interceptors/cache-token.service"; //引入服务
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss'],
selector: "app-login",
templateUrl: "./login.component.html",
styleUrls: ["./login.component.scss"],
})
export class LoginComponent implements OnInit {
constructor(
private http: HttpClient,
private router: Router,
private route: ActivatedRoute,
public token: CacheTokenService,
public snackBar: MatSnackBar,
private isLogin: IsLoginService
) {}
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public snackBar: MatSnackBar,private isLogin:IsLoginService) { }
ngOnInit() {
}
errmsg :string = ''; //错误信息
ngOnInit() {}
errmsg: string = ""; //错误信息
//登录
onSubmit(e) {
let params = { roleType: '0' }
this.http.post('/api/ExamAccounts/SignIn',e,{params}).subscribe((data:any)=>{
let params = { roleType: "0" };
this.http.post("/api/ExamAccounts/SignIn", e, { params }).subscribe(
(data: any) => {
sessionStorage.setItem("realName", data.realName);
sessionStorage.setItem("roleType", data.roleType);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
sessionStorage.setItem("level", data.level);
this.http.get("/api/ExamAccounts/Profiles").subscribe((v: any) => {
this.token.startUp(); //登陆成功启动定时器刷新token
this.router.navigate(['/home/teachear']) //登陆成功跳转页面
},(err) => {this.errmsg = err})
this.router.navigate(["/home/teachear"]); //登陆成功跳转页面
sessionStorage.setItem("creatorData", JSON.stringify(v));
});
},
(err) => {
this.errmsg = err;
}
);
}
//跳转教员学员登录页面
toAdminLogin() {
this.router.navigate(['/login']) //跳转管理员登录页面
this.router.navigate(["/login"]); //跳转管理员登录页面
}
//忘记密码弹窗
forget() {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请联系 系统维护技术人员','确定',config);
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("请联系 系统维护技术人员", "确定", config);
}
}

20
src/app/student/student-exam-record/student-exam-record.component.html

@ -14,24 +14,30 @@
<th style="width: 10%;">参加人</th>
<th style="width: 20%;">考核队站</th>
<th style="width: 20%;">考试时间</th>
<th style="width: 15%;">考试成绩</th>
<th style="width: 15%;">操作</th>
<th style="width: 10%;">考试成绩</th>
<th style="width: 10%;">考试评价</th>
<th style="width: 10%;">操作</th>
</thead>
<tbody>
<tr *ngFor="let item of tabledataSource">
<td>{{item.name}}</td>
<td>{{item.examineeName}}</td>
<td>{{item.paperInfo.organizationsName}}</td>
<td>
<!-- {{item.paperInfo.organizationsName}} -->
<span *ngFor="let item of item.paperInfo.organizationNames" style="margin: 0 2px;">
{{item}}
</span>
</td>
<td>{{item.paperInfo.startTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td style="color: #FF8678;">{{ item.totalScore && item.totalScore!=0 ? item.totalScore+'分' : '未阅卷' }}</td>
<td style="color: #FF8678;">{{ item.totalScore && item.totalScore!=0 ? item.totalScore+'分' : '未阅卷'
}}</td>
<td>{{item.comment}}</td>
<td style="color: #07CDCF;cursor: pointer;" (click)='seePaper(item)'>查看</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
<mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>

82
src/app/student/student-exam-record/student-exam-record.component.ts

@ -6,30 +6,43 @@
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-23 10:33:24
*/
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 { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { FlatTreeControl } from '@angular/cdk/tree';
import { TreeService } from '../../http-interceptors/tree.service'
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 {
MatTreeFlatDataSource,
MatTreeFlattener,
} from "@angular/material/tree";
import { FlatTreeControl } from "@angular/cdk/tree";
import { TreeService } from "../../http-interceptors/tree.service";
@Component({
selector: 'app-student-exam-record',
templateUrl: './student-exam-record.component.html',
styleUrls: ['./student-exam-record.component.scss']
selector: "app-student-exam-record",
templateUrl: "./student-exam-record.component.html",
styleUrls: ["./student-exam-record.component.scss"],
})
export class StudentExamRecordComponent 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
) {}
ngOnInit(): void {
this.getAlltabledate()
this.getAlltabledate();
}
//分页
@ -38,35 +51,36 @@ export class StudentExamRecordComponent implements OnInit {
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any //第几页
startTime:[]
endTime:[]
tabledataSource//表格数据
pageSizeOptions: number[] = [10]; //设置每页条数
PageNumber: any; //第几页
startTime: [];
endTime: [];
tabledataSource; //表格数据
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex+1
this.getAlltabledate()
this.PageNumber = e.pageIndex + 1;
this.getAlltabledate();
}
//获取表格信息
getAlltabledate() {
let paramsdata: any = {
PageNumber: this.PageNumber || '1',
PageNumber: this.PageNumber || "1",
PageSize: this.pageSizeOptions[0],
Sort: null,
SortType: null
}
this.http.get("/api/Examinations",{params:paramsdata}).subscribe((data:any)=>{
this.tabledataSource=data.items
this.length=data.totalCount
})
SortType: null,
};
this.http
.get("/api/Examinations", { params: paramsdata })
.subscribe((data: any) => {
this.tabledataSource = data.items;
this.length = data.totalCount;
});
}
//查看试卷
seePaper(e) {
window.open(`/reviewFiles?examId=${e.id}&paperType=2`)
window.open(`/reviewFiles?examId=${e.id}&paperType=2`);
}
}

6
src/app/student/student-index/student-index.component.html

@ -20,7 +20,11 @@
<tbody>
<tr *ngFor="let item of tabledataSource">
<td>{{item.title}}</td>
<td>{{item.organizationsName}}</td>
<td>
<span *ngFor="let item of item.organizationNames" style="margin: 0 2px;">
{{item}}
</span>
</td>
<td>{{item.startTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td>{{item.endTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td>{{item.duration}}分钟</td>

175
src/app/student/student-index/student-index.component.ts

@ -6,116 +6,131 @@
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-24 10:49:54
*/
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 { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { FlatTreeControl } from '@angular/cdk/tree';
import { TreeService } from '../../http-interceptors/tree.service'
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 {
MatTreeFlatDataSource,
MatTreeFlattener,
} from "@angular/material/tree";
import { FlatTreeControl } from "@angular/cdk/tree";
import { TreeService } from "../../http-interceptors/tree.service";
@Component({
selector: 'app-student-index',
templateUrl: './student-index.component.html',
styleUrls: ['./student-index.component.scss']
selector: "app-student-index",
templateUrl: "./student-index.component.html",
styleUrls: ["./student-index.component.scss"],
})
export class StudentIndexComponent 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
) {}
ngOnInit(): void {
this.getAlltabledate()
this.tableInterval = setInterval(() => this.getAlltabledate(), 60000)
this.getAlltabledate();
this.tableInterval = setInterval(() => this.getAlltabledate(), 60000);
//this.gettime("2020-12-22T18:40:00+08:00","2020-12-22T18:39:00+08:00")
//this.idtime=setInterval(()=>this.newjsq(),1000)
//this.newjsq()
}
ngOnDestroy() {
clearInterval(this.idtime)
clearInterval(this.tableInterval)
clearInterval(this.idtime);
clearInterval(this.tableInterval);
}
idtime
tableInterval
idtime;
tableInterval;
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber: any //第几页
startTime: []
endTime: []
tabledataSource//表格数据
timecha
pageSize: any = 10; //每页条数
pageSizeOptions: number[] = [10]; //设置每页条数
PageNumber: any; //第几页
startTime: [];
endTime: [];
tabledataSource; //表格数据
timecha;
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex + 1
this.getAlltabledate()
this.PageNumber = e.pageIndex + 1;
this.getAlltabledate();
}
//获取表格信息
getAlltabledate() {
let paramsdata: any = {
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
PageNumber: this.PageNumber || "1",
PageSize: this.pageSize,
Sort: null,
SortType: null,
Status: 1
}
this.http.get("/api/Papers", { params: paramsdata }).subscribe((data: any) => {
this.tabledataSource = data.items
this.length = data.totalCount
Status: 1,
};
this.http
.get("/api/Papers", { params: paramsdata })
.subscribe((data: any) => {
this.tabledataSource = data.items;
this.length = data.totalCount;
//console.log(this.tabledataSource)
})
});
}
//计时器
jishi(startTime, endTime) {
//startTime=new Date
var nowtime = new Date(startTime), //获取开始时间
endtime = new Date(endTime); //定义结束时间
var jieshu = nowtime.getTime()
setInterval(() => { jieshu-- })
var jieshu = nowtime.getTime();
setInterval(() => {
jieshu--;
});
//console.log(endtime.getSeconds()-1)
var lefttime = jieshu - nowtime.getTime(), //距离结束时间的毫秒数
leftd = Math.floor(lefttime / (1000 * 60 * 60 * 24)), //计算天数
lefth = Math.floor(lefttime / (1000 * 60 * 60)), //计算小时数
leftm = Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数
lefts = Math.floor(lefttime / 1000 % 60); //计算秒数
this.timecha = lefth + ":" + leftm + ":" + lefts
leftm = Math.floor((lefttime / (1000 * 60)) % 60), //计算分钟数
lefts = Math.floor((lefttime / 1000) % 60); //计算秒数
this.timecha = lefth + ":" + leftm + ":" + lefts;
if (this.timecha == '0:0:0') {
this.timecha = "已结束"
clearInterval(this.idtime)
if (this.timecha == "0:0:0") {
this.timecha = "已结束";
clearInterval(this.idtime);
}
console.log(this.timecha)
console.log(this.timecha);
}
timerID;
//time_end=new Date("2020-12-22T18:40:00+08:00").getTime();//结束的时间
time_end
time_end;
//time_now_server=new Date("2020-12-22T18:30:00+08:00").getTime();//开始的时间
time_now_server
time_now_server;
time_now_client = new Date().getTime();
//time_server_client=this.time_now_server-this.time_now_client;
time_server_client
str_time = ""
time_server_client;
str_time = "";
gettime(endtime, stearttime) {
this.time_end = new Date(endtime).getTime()
this.time_now_server = new Date(stearttime).getTime()
this.time_server_client = this.time_now_server - this.time_now_client
this.idtime = setInterval(() => this.newtimer(), 1000)
this.time_end = new Date(endtime).getTime();
this.time_now_server = new Date(stearttime).getTime();
this.time_server_client = this.time_now_server - this.time_now_client;
this.idtime = setInterval(() => this.newtimer(), 1000);
}
//新计时器
newtimer() {
@ -125,25 +140,24 @@ export class StudentIndexComponent implements OnInit {
time_now = time_now + this.time_server_client;
time_distance = this.time_end - time_now;
if (time_distance > 0) {
int_day = Math.floor(time_distance / 86400000)
int_day = Math.floor(time_distance / 86400000);
time_distance -= int_day * 86400000;
int_hour = Math.floor(time_distance / 3600000)
int_hour = Math.floor(time_distance / 3600000);
time_distance -= int_hour * 3600000;
int_minute = Math.floor(time_distance / 60000)
int_minute = Math.floor(time_distance / 60000);
time_distance -= int_minute * 60000;
int_second = Math.floor(time_distance / 1000)
if (int_hour < 10)
int_hour = "0" + int_hour;
if (int_minute < 10)
int_minute = "0" + int_minute;
if (int_second < 10)
int_second = "0" + int_second;
int_second = Math.floor(time_distance / 1000);
if (int_hour < 10) int_hour = "0" + int_hour;
if (int_minute < 10) int_minute = "0" + int_minute;
if (int_second < 10) int_second = "0" + int_second;
this.str_time = int_hour + ":" + int_minute + ":" + int_second;
if (this.str_time == "00:00:00") { this.str_time = "已结束" }
if (this.str_time == "00:00:00") {
this.str_time = "已结束";
}
//console.log(this.str_time)
} else {
//timer=timer;
clearTimeout(this.timerID)
clearTimeout(this.timerID);
}
}
@ -153,14 +167,17 @@ export class StudentIndexComponent implements OnInit {
let body = {
name: e.title,
paperId: e.id,
}
this.http.post('/api/Examinations', body).subscribe((data: any) => {
window.open(`/examinationDetails?paperId=${e.id}&examId=${data.id}`)
}, err => {
};
this.http.post("/api/Examinations", body).subscribe(
(data: any) => {
window.open(`/examinationDetails?paperId=${e.id}&examId=${data.id}`);
},
(err) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err, '确定', config);
})
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open(err, "确定", config);
}
);
}
}

9
src/app/theme.scss

@ -16,3 +16,12 @@ $my-dark-theme :mat-dark-theme($my-dark-primary,$my-dark-accent,$my-dark-warn);
.myapp-dark-theme {
@include angular-material-theme($my-dark-theme);
}
.ant-rate-star:not(:last-child) {
margin-right: 0;
}
.ant-rate {
box-sizing: border-box;
padding-top: 10px;
}

46
src/app/ui/administrators/add-edit-admin/add-edit-admin.component.html

@ -0,0 +1,46 @@
<h2 mat-dialog-title>新增/编辑管理员</h2>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div>
<mat-form-field>
<input matInput name="name" [(ngModel)]="name" required placeholder="登录账号" autocomplete="off">
</mat-form-field>
</div>
<div>
<mat-form-field>
<input matInput name="realName" [(ngModel)]="realName" required placeholder="用户姓名" autocomplete="off">
</mat-form-field>
</div>
<div style="margin-bottom: 10px;">
<p style="font-size: 14px;">消防救援站: <label style="margin-left: 10px;">{{organizationName}}</label></p>
</div>
<div class="treeDiv">
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='selectTree(node)'>
<button type="button" mat-icon-button disabled></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='selectTree(node)'>
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon mat-icon class="mat-icon-rtl-mirror">{{treeControl.isExpanded(node) ? 'expand_more' :
'chevron_right'}}</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
<div mat-dialog-content *ngIf="errmsg">
<p style="font-size: 14px; color: red;">{{errmsg}}</p>
</div>
<div mat-dialog-actions>
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid">确定</button>
<button mat-raised-button mat-dialog-close>取消</button>
</div>
</form>

0
src/app/ui/teacherManagement/seeenterpriseuser.html → src/app/ui/administrators/add-edit-admin/add-edit-admin.component.scss

25
src/app/ui/administrators/add-edit-admin/add-edit-admin.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddEditAdminComponent } from './add-edit-admin.component';
describe('AddEditAdminComponent', () => {
let component: AddEditAdminComponent;
let fixture: ComponentFixture<AddEditAdminComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddEditAdminComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddEditAdminComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

110
src/app/ui/administrators/add-edit-admin/add-edit-admin.component.ts

@ -0,0 +1,110 @@
import { HttpClient } from "@angular/common/http";
import { Component, OnInit, Inject } from "@angular/core";
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import {
MatTreeFlatDataSource,
MatTreeFlattener,
} from "@angular/material/tree";
import { FlatTreeControl } from "@angular/cdk/tree";
@Component({
selector: "app-add-edit-admin",
templateUrl: "./add-edit-admin.component.html",
styleUrls: ["./add-edit-admin.component.scss"],
})
export class AddEditAdminComponent implements OnInit {
constructor(
private http: HttpClient,
public dialogRef: MatDialogRef<AddEditAdminComponent>,
@Inject(MAT_DIALOG_DATA) public data,
public snackBar: MatSnackBar
) {}
ngOnInit(): void {
this.dataSource.data = this.data.treeData;
if (this.data.userData) {
this.name = JSON.parse(JSON.stringify(this.data.userData.name));
this.realName = JSON.parse(JSON.stringify(this.data.userData.realName));
this.organizationId = JSON.parse(
JSON.stringify(this.data.userData.organizationId)
);
this.organizationName = JSON.parse(
JSON.stringify(this.data.userData.organizationName)
);
}
}
errmsg: string = null; //捕获错误信息
name: string = null;
realName: string = null;
organizationId: string = null;
organizationName: string = null;
private _transformer = (node, level: number) => {
//初始化tree
return {
expandable: !!node.children && node.children.length > 0,
name: node.name,
level: level,
id: node.id,
parentId: node.parentId,
children: node.children,
};
};
treeControl = new FlatTreeControl<any>(
(node) => node.level,
(node) => node.expandable
);
treeFlattener = new MatTreeFlattener(
this._transformer,
(node) => node.level,
(node) => node.expandable,
(node) => node.children
);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
hasChild = (_: number, node: any) => node.expandable;
//选择tree节点
selectTree(e) {
this.organizationId = e.id;
this.organizationName = e.name;
}
//提交创建表单
onSubmit(e) {
if (this.organizationId && this.organizationName) {
if (this.data.userData) {
e.phone = this.data.userData.phone;
e.identityCard = this.data.userData.identityCard;
e.roleType = 0;
e.id = this.data.userData.id;
e.enabled = this.data.userData.enabled;
e.creationTime = new Date();
e.organizationId = this.organizationId;
e.organizationName = this.organizationName;
this.http
.put(`/api/ExamUsers/${this.data.userData.id}`, e)
.subscribe((data) => {
this.dialogRef.close("success");
});
} else {
e.phone = '13864512542';
e.identityCard = '370304199809261911';
e.roleType = 0;
e.enabled = true;
e.creationTime = new Date();
e.organizationId = this.organizationId;
e.organizationName = this.organizationName;
this.http.post(`/api/ExamUsers`, e).subscribe((data) => {
this.dialogRef.close("success");
});
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("请选择消防救援站", "确定", config);
}
}
}

73
src/app/ui/administrators/administrators.component.html

@ -0,0 +1,73 @@
<div class="content">
<div class="header">
<form #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">用户账号:</label>
<input type="text" [(ngModel)]="identityCard" name="identityCard" autocomplete="off"
placeholder="请输入用户账号">
</div>
<div class="queryField">
<label style="margin-right: 10px;">用户姓名:</label>
<input type="text" [(ngModel)]="name" name="name" autocomplete="off" placeholder="请输入用户姓名">
</div>
<div class="queryField" style="position: relative;">
<label style="margin-right: 10px;">消防救援站:</label>
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 180px" [nzNodes]="nodes"
nzShowSearch nzPlaceHolder="请选择救援站" name="orTree" [(ngModel)]="organizationId"
[nzAllowClear]="false">
</nz-tree-select>
</div>
<div class="queryField">
<button mat-raised-button (click)='getAllUsers()' style="background-color: #07CDCF;">查询</button>
<button mat-raised-button (click)='empty()'
style="margin-left: 10px; background-color: #FF8678;">重置</button>
</div>
<div class="queryField">
<button mat-raised-button (click)='open()' style="background-color: #07CDCF;">新增管理员</button>
</div>
</div>
</form>
</div>
<table mat-table [dataSource]="dataSource">
<ng-container matColumnDef="identitycard">
<th mat-header-cell *matHeaderCellDef>用户帐号</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>用户姓名</th>
<td mat-cell *matCellDef="let element">{{element.realName}}</td>
</ng-container>
<ng-container matColumnDef="post">
<th mat-header-cell *matHeaderCellDef>消防救援站</th>
<td mat-cell *matCellDef="let element">{{element.organizationName}}</td>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>创建时间</th>
<td mat-cell *matCellDef="let element">{{element.creationTime | date:'yyyy-MM-dd'}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span class="operationSpan"><span class="spanbtn green" (click)="reset(element)">重置密码</span></span>
<span class="operationSpan"><span class="spanbtn green" (click)="edit(element)">编辑</span></span>
<span *ngIf="element.enabled" class="operationSpan"><span class="spanbtn red"
(click)="noEnabled(element)">禁用</span></span>
<span *ngIf="!element.enabled" class="operationSpan"><span class="spanbtn gray"
(click)="enabled(element)">启用</span></span>
<span class="operationSpan"><span class="spanbtn red" (click)="delete(element)">删除</span></span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length" [pageSize]="pageSize" (page)="chagePage($event)">
</mat-paginator>
</div>

115
src/app/ui/administrators/administrators.component.scss

@ -0,0 +1,115 @@
table {
width: 100%;
text-align: center;
.cdk-header-cell {
text-align: center;
}
}
.content {
width: 100%;
height: 100%;
overflow: hidden;
background: #F2F5F6;
}
.header {
width: 100%;
padding: 10px;
margin-bottom: 10px;
box-sizing: border-box;
.queryBox {
box-sizing: border-box;
padding: 5px 15px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: center;
.queryField {
margin: 0 25px;
font-size: 14px;
input {
width: 160px;
height: 30px;
line-height: 30px;
border-radius: 2px;
padding-left: 6px;
outline: none;
border: 1px solid rgb(226, 211, 211);
}
button {
color: #fff;
}
}
}
//queryBox
}
.operationSpan {
margin: 0 10px;
.spanbtn {
font-weight: 550;
cursor: pointer;
}
.green {
color: #04ced1;
}
.red {
color: #FF8678
}
.gray {
color: gray;
}
}
//tree
.treeDiv {
max-height: 300px;
overflow-y: auto;
.mat-icon-button {
width: 20px;
height: 20px;
line-height: 20px;
}
li {
cursor: pointer;
}
.mat-tree-node:hover {
background-color: rgb(240, 236, 236);
}
}
.closeTree {
cursor: pointer;
position: absolute;
top: 40px;
right: -95px;
z-index: 100;
}
.searchTree {
.mat-tree-node button .mat-icon {
color: #000;
}
border: 1px solid rgb(207, 204, 204);
width: 350px;
max-height: 150px;
position: absolute;
top: 40px;
left: 0;
}

25
src/app/ui/administrators/administrators.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AdministratorsComponent } from './administrators.component';
describe('AdministratorsComponent', () => {
let component: AdministratorsComponent;
let fixture: ComponentFixture<AdministratorsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AdministratorsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AdministratorsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

200
src/app/ui/administrators/administrators.component.ts

@ -0,0 +1,200 @@
import { Component, OnInit, ViewChild, Inject } 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 { FlatTreeControl } from "@angular/cdk/tree";
import {
MatTreeFlatDataSource,
MatTreeFlattener,
} from "@angular/material/tree";
import { TreeService } from "src/app/http-interceptors/tree.service";
import { AddEditAdminComponent } from "./add-edit-admin/add-edit-admin.component";
@Component({
selector: "app-administrators",
templateUrl: "./administrators.component.html",
styleUrls: ["./administrators.component.scss"],
})
export class AdministratorsComponent implements OnInit {
constructor(
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public treeService: TreeService
) {}
loginUserInfo;
ngOnInit() {
this.loginUserInfo = JSON.parse(sessionStorage.getItem("creatorData"));
this.getOrganizations();
}
name: any; //用户姓名
identityCard: any; //用户账号
organizationId;
allOrganizations: any; //所有组织机构
nodes = [];
//获取所有组织机构
getOrganizations() {
this.http
.get("/api/Organizations", {
params: {
strict: "true",
},
})
.subscribe((data: any) => {
this.allOrganizations = data;
this.allOrganizations.forEach((element) => {
if (element.id === this.loginUserInfo.organizationId) {
element.parentId = null;
}
});
this.nodes = [...this.treeService.toTree(this.allOrganizations)];
this.organizationId = this.loginUserInfo.organizationId;
this.getAllUsers();
});
}
displayedColumns: string[] = [
"identitycard",
"name",
"post",
"time",
"operation",
];
dataSource: any; //所有企业用户表格数据
//更新当前页数据
pageNumber: number = 1; //第几页
pageSize: any = "10"; //每页条数
getAllUsers() {
let data = {
Name: this.identityCard || "",
RealName: this.name || "",
OrganizationId: this.organizationId || "",
RoleType: "0",
PageNumber: String(this.pageNumber),
PageSize: this.pageSize,
};
this.http.get("/api/ExamUsers", { params: data }).subscribe((data: any) => {
this.length = data.totalCount;
this.pageSize = data.pageSize;
this.dataSource = new MatTableDataSource<any>(data.items);
});
}
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length: any; //共多少条数据
//分页切换
chagePage(e) {
this.pageNumber = e.pageIndex + 1;
this.getAllUsers();
}
//清空搜索
empty() {
this.pageNumber = 1;
this.name = "";
this.identityCard = "";
this.organizationId = this.loginUserInfo.organizationId;
this.getAllUsers();
}
//创建教员
open() {
let data = { treeData: this.nodes, userData: null };
let dialogRef = this.dialog.open(AddEditAdminComponent, { data });
dialogRef.afterClosed().subscribe((data) => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("创建成功!", "确定", config);
this.getAllUsers();
}
});
}
//编辑企业用户
edit(e) {
let data = { treeData: this.nodes, userData: e };
let dialogRef = this.dialog.open(AddEditAdminComponent, { data });
dialogRef.afterClosed().subscribe((data) => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("修改成功!", "确定", config);
this.getAllUsers();
}
});
}
//重置密码
reset(e) {
this.http.put(`/api/ExamUsers/${e.id}/ResetPassword`, {}).subscribe(
(data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("重置密码成功!", "确定", config);
},
(err) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("重置密码失败!", "确定", config);
}
);
}
//启用
enabled(e) {
e.date = new Date();
e.enabled = true;
this.http.put(`/api/ExamUsers/${e.id}`, e).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("启用成功!", "确定", config);
this.getAllUsers();
});
}
//禁用
noEnabled(e) {
e.date = new Date();
e.enabled = false;
this.http.put(`/api/ExamUsers/${e.id}`, e).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("禁用成功!", "确定", config);
this.getAllUsers();
});
}
//删除
delete(e) {
let isTrue = confirm("您确定要删除吗");
if (isTrue) {
this.http.delete(`/api/ExamUsers/${e.id}`).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("删除成功!", "确定", config);
this.getAllUsers();
});
}
}
}

8
src/app/ui/collection-tools-read/collection-tools.component.html

@ -19,7 +19,12 @@
<mat-icon>open_in_browser</mat-icon>提交
</button>
</div>
<div class="headerRight" *ngIf="paperType != 0" style="text-align: right; padding-right: 30px;">
<button style="border: 1px solid #07CDCF; border-radius: 5px; margin-right: 6px;" *ngIf="paperType == 1"
(click)="notes()">
<mat-icon>visibility</mat-icon>查看阅卷备注
</button>
<button style="border: 1px solid #07CDCF; border-radius: 5px;" (click)='openFireExamination()'>
<mat-icon>visibility</mat-icon>
查看消防设施
@ -36,7 +41,8 @@
<!-- 天气 -->
<div class="weatherBox">
<span class="name">天气</span>
<input disabled class="weatherInput" [(ngModel)]="weatherData.weather" type="text" placeholder="最多输入10字节" maxlength="10">
<input disabled class="weatherInput" [(ngModel)]="weatherData.weather" type="text" placeholder="最多输入10字节"
maxlength="10">
<span class="name">气温</span>
<div style="display: inline-block;position: relative;">
<input disabled [(ngModel)]="weatherData.airTemperature" style="width: 60px;" type="number" value="0"

1756
src/app/ui/collection-tools-read/collection-tools.component.ts

File diff suppressed because it is too large Load Diff

1
src/app/ui/collection-tools-read/remark/remark.component.html

@ -0,0 +1 @@
{{Remark}}

0
src/app/ui/collection-tools-read/remark/remark.component.scss

25
src/app/ui/collection-tools-read/remark/remark.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RemarkComponent } from './remark.component';
describe('RemarkComponent', () => {
let component: RemarkComponent;
let fixture: ComponentFixture<RemarkComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RemarkComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RemarkComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

22
src/app/ui/collection-tools-read/remark/remark.component.ts

@ -0,0 +1,22 @@
import { Component, OnInit, Inject } from "@angular/core";
import {
MatDialog,
MAT_DIALOG_DATA,
MatDialogRef,
} from "@angular/material/dialog";
@Component({
selector: "app-remark",
templateUrl: "./remark.component.html",
styleUrls: ["./remark.component.scss"],
})
export class RemarkComponent implements OnInit {
constructor(
public dialogRef: MatDialogRef<RemarkComponent>,
@Inject(MAT_DIALOG_DATA) public data: any
) {}
Remark;
ngOnInit(): void {
this.Remark = sessionStorage.getItem("remark");
}
}

17
src/app/ui/collection-tools-read/score.html

@ -1,10 +1,15 @@
<div style="width: 200px;" >
<div class="box">
<div style="text-align: center;font-weight: 550;">请为此预案答卷评分</div>
<div class="contant">
<form class="example-form">
<mat-form-field class="example-full-width">
<input name="score" matInput [placeholder]="score" type="number" (input)="inputNum()" [(ngModel)]="scoreNum">
</mat-form-field>
<div class="content">
<form>
<div class="formItem">
<span>得分(最高分为{{data.score}}分):</span>
<input name="score" type="number" [(ngModel)]="scoreNum">
</div>
<div class="formItem">
<span>备注:</span>
<textarea name="notes" [(ngModel)]="notes"></textarea>
</div>
</form>
</div>
<div style="text-align: center;" class="btnbox">

35
src/app/ui/collection-tools-read/score.scss

@ -1,10 +1,35 @@
.box{
width: 280px;
height: 280px;
display: flex;
flex-direction: column;
}
.content{
width: 100%;
flex: 1;
margin: 15px 0;
.formItem{
display: flex;
flex-direction: column;
margin: 5px 0;
span{
font-size: 14px;
}
input{
width: 100%;
height: 36px;
}
textarea{
width: 278px;
height: 90px;
}
}
}
.btnbox{
button{
margin: 0 5px;
}
}
.contant{
height: 60px;
width: 100%;
margin: 15px 0;
}

9
src/app/ui/collection-tools/collection-tools.component.html

@ -104,12 +104,11 @@
<div id="terrNodePublic" (click)='selectanelPoint(node.origin)'
[ngClass]="{'selectanelPoint': selectDisposalNode==node.origin.id}">
<label title="{{node.title}}" class="overflowText textNode">{{node.title}}</label>
<!-- <div class="planIconDiv" *ngIf="isEditPattern">
<mat-icon *ngIf="!node.origin.sitePlanId && !node.origin.buildingAreaId" (click)='editPanelPoint($event,node)'>edit</mat-icon>
<mat-icon *ngIf="node.level===0" (click)='addPanelPoint($event,node.origin,null)'>add</mat-icon>
<mat-icon *ngIf="!node.origin.sitePlanId && !node.origin.buildingAreaId" (click)='copyPanelPoint($event,node,treeData)'>library_books</mat-icon>
<div class="planIconDiv">
<mat-icon *ngIf="!node.origin.sitePlanId && !node.origin.buildingAreaId"
(click)='editPanelPoint($event,node)'>edit</mat-icon>
<mat-icon (click)='deletePanelPoint($event,node.origin)'>delete_forever</mat-icon>
</div> -->
</div>
</div>
</ng-template>

2710
src/app/ui/collection-tools/collection-tools.component.ts

File diff suppressed because it is too large Load Diff

459
src/app/ui/collection-tools/examinationQuestions.ts

@ -1,217 +1,263 @@
import { Component, OnInit, Inject, ViewChild } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { CanvasShareDataService, DisposalNodeData } from '../../canvas-share-data.service' //引入服务
import { FlatTreeControl } from '@angular/cdk/tree';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent, NzTreeComponent } from 'ng-zorro-antd/tree';
import { ActivatedRoute } from '@angular/router';
import { Component, OnInit, Inject, ViewChild } from "@angular/core";
import { HttpClient, HttpHeaders } from "@angular/common/http";
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import {
CanvasShareDataService,
DisposalNodeData,
} from "../../canvas-share-data.service"; //引入服务
import { FlatTreeControl } from "@angular/cdk/tree";
import {
MatTreeFlatDataSource,
MatTreeFlattener,
} from "@angular/material/tree";
import {
NzFormatBeforeDropEvent,
NzFormatEmitEvent,
NzTreeComponent,
} from "ng-zorro-antd/tree";
import { ActivatedRoute } from "@angular/router";
@Component({
selector: 'dialog-examination-questions',
templateUrl: './examinationQuestions.html',
styleUrls: ['./collection-tools.component.scss',]
selector: "dialog-examination-questions",
templateUrl: "./examinationQuestions.html",
styleUrls: ["./collection-tools.component.scss"],
})
export class examinationQuestions {
constructor(
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data
) {}
constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data) { }
@ViewChild('nzTreeComponent3', { static: false }) nzTreeComponent!: NzTreeComponent;
@ViewChild("nzTreeComponent3", { static: false })
nzTreeComponent!: NzTreeComponent;
defaultCheckedKeys = []; //指定选中复选框的树节点 key值
defaultExpandedKeys = []; //展开指定的树节点 key值
defaultSelectedKeys = []; //指定选中的树节点 key值
renderData: any
renderData: any;
ngOnInit(): void {
this.renderData = this.data.treeData
if (JSON.parse(sessionStorage.getItem('tree型数据')) && JSON.parse(sessionStorage.getItem('tree型数据'))[this.data.buildFloorData.floorData.id]) {
this.defaultCheckedKeys = JSON.parse(sessionStorage.getItem('tree型数据'))[this.data.buildFloorData.floorData.id]
}
this.data.treeData.forEach(element => {
this.renderData = this.data.treeData;
if (
JSON.parse(sessionStorage.getItem("tree型数据")) &&
JSON.parse(sessionStorage.getItem("tree型数据"))[
this.data.buildFloorData.floorData.id
]
) {
this.defaultCheckedKeys = JSON.parse(
sessionStorage.getItem("tree型数据")
)[this.data.buildFloorData.floorData.id];
}
this.data.treeData.forEach((element) => {
if (element.isTemplate) {
element.isLeaf = false
element.isLeaf = false;
} else {
element.isLeaf = true
element.isLeaf = true;
}
if (element.children && element.children.length != 0) {
element.children.forEach(ele => {
element.children.forEach((ele) => {
if (ele.isTemplate) {
ele.isLeaf = false
ele.isLeaf = false;
} else {
ele.isLeaf = true
ele.isLeaf = true;
}
if (ele.children && ele.children.length != 0) {
ele.children.forEach(item => {
ele.children.forEach((item) => {
if (item.isTemplate) {
item.isLeaf = false
item.isLeaf = false;
} else {
item.isLeaf = true
item.isLeaf = true;
}
});
}
})
});
}
})
});
//阻止 滚轮滚动事件穿透
window.setTimeout(() => {
(document.getElementById('nodeTree') as any).onmousewheel = (e)=>{
(document.getElementById("nodeTree") as any).onmousewheel = (e) => {
e.stopPropagation();
}
}, 0)
};
}, 0);
}
nzEvent($event) {
console.log($event)
console.log($event);
}
//提交
submit() {
let oldTreeData = this.nzTreeComponent.getCheckedNodeList();
let oldTreeData = this.nzTreeComponent.getCheckedNodeList()
// console.log(oldTreeData)
let alltreedata = JSON.parse(sessionStorage.getItem("tree型数据"))
let keyArr = []
oldTreeData.forEach(element => {
keyArr.push(element.origin.key)
})
let alltreedata = JSON.parse(sessionStorage.getItem("tree型数据"));
let keyArr = [];
oldTreeData.forEach((element) => {
keyArr.push(element.origin.key);
});
if (alltreedata) {
//如果已经保存过当前楼层则替换
alltreedata[this.data.buildFloorData.floorData.id] = keyArr
sessionStorage.setItem('tree型数据', JSON.stringify(alltreedata))
alltreedata[this.data.buildFloorData.floorData.id] = keyArr;
sessionStorage.setItem("tree型数据", JSON.stringify(alltreedata));
} else {
alltreedata = {}
alltreedata[this.data.buildFloorData.floorData.id] = keyArr
sessionStorage.setItem('tree型数据', JSON.stringify(alltreedata))
alltreedata = {};
alltreedata[this.data.buildFloorData.floorData.id] = keyArr;
sessionStorage.setItem("tree型数据", JSON.stringify(alltreedata));
}
let checkList = [] //只存真实素材
let checkList = []; //只存真实素材
for (const key in this.data.oldRealData.data) {
let element = this.data.oldRealData.data[key]
let isChecked = (this.nzTreeComponent.getTreeNodeByKey(key)).isChecked
isChecked ? checkList.push(element) : null
let element = this.data.oldRealData.data[key];
let isChecked = this.nzTreeComponent.getTreeNodeByKey(key).isChecked;
isChecked ? checkList.push(element) : null;
}
//存储真实素材数据
let basicAssetsId = []
let basicAssetsId = [];
if (checkList && checkList.length != 0) {
checkList.forEach(item => {
basicAssetsId.push(item.TemplateId)
})
checkList.forEach((item) => {
basicAssetsId.push(item.TemplateId);
});
}
basicAssetsId = Array.from(new Set(basicAssetsId))
console.log(123, this.data.buildFloorData)
basicAssetsId = Array.from(new Set(basicAssetsId));
console.log(123, this.data.buildFloorData);
let obj = {
name: this.data.buildFloorData.buildingData.name + '-' + this.data.buildFloorData.floorData.name,
name:
this.data.buildFloorData.buildingData.name +
"-" +
this.data.buildFloorData.floorData.name,
key: this.data.buildFloorData.floorData.id,
buildingId: this.data.buildFloorData.buildingData.id,
children: checkList,
basicAssetsId: basicAssetsId
}
basicAssetsId: basicAssetsId,
};
let data = JSON.parse(sessionStorage.getItem("消防设施" + sessionStorage.getItem('paperId')))
let data = JSON.parse(
sessionStorage.getItem("消防设施" + sessionStorage.getItem("paperId"))
);
if (data && data.length != 0) {
console.log(1)
let ind = null
console.log(1);
let ind = null;
data.forEach((item, index) => {
if (item.key == obj.key) {
ind = index + 1
ind = index + 1;
}
})
});
if (ind) {
if (checkList.length != 0) {
data[ind - 1].children = checkList
data[ind - 1].children = checkList;
} else {
data.splice(ind - 1, 1)
data.splice(ind - 1, 1);
}
} else {
data.push(obj)
data.push(obj);
}
sessionStorage.setItem("消防设施" + sessionStorage.getItem('paperId'), JSON.stringify(data))
sessionStorage.setItem(
"消防设施" + sessionStorage.getItem("paperId"),
JSON.stringify(data)
);
} else {
console.log(2)
data = []
data[0] = obj
sessionStorage.setItem("消防设施" + sessionStorage.getItem('paperId'), JSON.stringify(data))
console.log(2);
data = [];
data[0] = obj;
sessionStorage.setItem(
"消防设施" + sessionStorage.getItem("paperId"),
JSON.stringify(data)
);
}
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('当层消防设施考题设置完成', '确定', config);
this.dialogRef.close()
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("当层消防设施考题设置完成", "确定", config);
this.dialogRef.close();
}
}
//上传按钮
@Component({
selector: 'dialog-upload-questions',
templateUrl: './uploadQuestions.html',
styleUrls: ['./collection-tools.component.scss',]
selector: "dialog-upload-questions",
templateUrl: "./uploadQuestions.html",
styleUrls: ["./collection-tools.component.scss"],
})
export class uploadQuestions {
constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data, private route: ActivatedRoute) { }
constructor(
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data,
private route: ActivatedRoute
) {}
defaultCheckedKeys = []; //指定选中复选框的树节点 key值
defaultExpandedKeys = []; //展开指定的树节点 key值
defaultSelectedKeys = []; //指定选中的树节点 key值
renderData: any
renderData: any;
ngOnInit(): void {
let data = JSON.parse(sessionStorage.getItem("消防设施" + sessionStorage.getItem('paperId')))
data ? data.forEach(item => {
let realData = item.children
let allFireElements = JSON.parse(JSON.stringify(this.data.allFireElements))
item.children = this.processingData(allFireElements, realData)
}) : null
this.renderData = data
this.getProfiles()
this.nodeInit()
let data = JSON.parse(
sessionStorage.getItem("消防设施" + sessionStorage.getItem("paperId"))
);
console.log(888, data);
data
? data.forEach((item) => {
let realData = item.children;
let allFireElements = JSON.parse(
JSON.stringify(this.data.allFireElements)
);
item.children = this.processingData(allFireElements, realData);
})
: null;
this.renderData = data;
this.getProfiles();
this.nodeInit();
console.log('天气信息', this.data.weatherData)
console.log("天气信息", this.data.weatherData);
}
//处理数据 将消防要素模板与真实素材结合
processingData(allFireElements, realData) {
allFireElements[allFireElements.length - 1].children = []
realData.forEach(item => {
item.isLeaf = true
let noMatch = allFireElements.find(every => every.id === item.FireElementId)
allFireElements[allFireElements.length - 1].children = [];
realData.forEach((item) => {
item.isLeaf = true;
let noMatch = allFireElements.find(
(every) => every.id === item.FireElementId
);
if (!noMatch) {
allFireElements[allFireElements.length - 1].children.push(item)
allFireElements[allFireElements.length - 1].children.push(item);
}
})
let treeData = [] //tree型 处理完成后的数据
allFireElements.forEach(element => {
element.key = element.id
element.name != '其他' ? element.children = [] : null
});
let treeData = []; //tree型 处理完成后的数据
allFireElements.forEach((element) => {
element.key = element.id;
element.name != "其他" ? (element.children = []) : null;
if (realData) {
realData.forEach(item => {
realData.forEach((item) => {
if (element.id == item.FireElementId) {
element.children.push(item)
element.children.push(item);
}
})
});
}
allFireElements.forEach((item) => {
if (item.parentId == element.id) {
element.children.push(item);
}
allFireElements.forEach(item => { if (item.parentId == element.id) { element.children.push(item) } });
});
allFireElements.forEach(element => {
if (!element.parentId) { treeData.push(element) }
});
allFireElements.forEach((element) => {
if (!element.parentId) {
treeData.push(element);
}
});
function recursionFilterEmpty(originalList, result) {
for (let i = 0, length = originalList.length; i < length; i++) {
@ -228,7 +274,7 @@ export class uploadQuestions {
item.children = newChildren;
// 子项有真实的数据,就保留这一项
result.push(item);
} // 如果没有这一项就会被删除
} // 如果没有这一项就会被删除
}
}
}
@ -237,53 +283,55 @@ export class uploadQuestions {
recursionFilterEmpty(listData, result);
return result;
}
return filterEmpty(treeData)
return filterEmpty(treeData);
}
//获取登录账号的个人资料
Profiles: any
Profiles: any;
getProfiles() {
this.http.get('/api/ExamAccounts/Profiles').subscribe(data => {
this.Profiles = data
})
this.http.get("/api/ExamAccounts/Profiles").subscribe((data) => {
this.Profiles = data;
});
}
nodeTreeData: any = []; //处置节点tree
//节点初始化
nodeInit() {
let treeData = []
this.data.node.forEach(element => {
element.title = element.name //name
element.key = element.id //id
element.children = [] //children
if (element.sitePlanId || element.buildingAreaId) { //是数据节点
element.isLeaf = true
element.isDataNode = true
} else { //不是数据节点
element.isLeaf = false
element.isDataNode = false
}
this.data.node.forEach(item => {
item.parentId === element.id ? element.children.push(item) : null
})
let treeData = [];
console.log(9999, this.data.node);
this.data.node.forEach((element) => {
element.title = element.name; //name
element.key = element.id; //id
element.children = []; //children
if (element.sitePlanId || element.buildingAreaId) {
//是数据节点
element.isLeaf = true;
element.isDataNode = true;
} else {
//不是数据节点
element.isLeaf = false;
element.isDataNode = false;
}
this.data.node.forEach((item) => {
item.parentId === element.id ? element.children.push(item) : null;
});
this.data.node.forEach(element => {
!element.parentId ? treeData.push(element) : null
})
this.nodeTreeData = [...treeData]
});
this.data.node.forEach((element) => {
!element.parentId ? treeData.push(element) : null;
});
this.nodeTreeData = [...treeData];
}
nzEvent($event) {
console.log($event)
console.log($event);
}
//上传
submit() {
console.log(this.data.question)
console.log(this.data.question);
let body: any = {
id: this.route.snapshot.queryParams.paperplanId,
paperId: sessionStorage.getItem('paperId'),
planComponentId: sessionStorage.getItem('planId'),
paperId: sessionStorage.getItem("paperId"),
planComponentId: sessionStorage.getItem("planId"),
examPlanType: this.route.snapshot.queryParams.openType == 1 ? 0 : 1,
creatorId: this.Profiles.id,
modifiedTime: new Date(),
@ -291,70 +339,93 @@ export class uploadQuestions {
title: this.route.snapshot.queryParams.planName,
mainPoint: this.data.question.keynote,
score: 0,
examFacilityAssetsData: sessionStorage.getItem('消防设施' + sessionStorage.getItem('paperId')) ? sessionStorage.getItem('消防设施' + sessionStorage.getItem('paperId')) : null,
examDisposalNodesData: sessionStorage.getItem('examNodeList') ? sessionStorage.getItem('examNodeList') : null,
companyId: sessionStorage.getItem('companyId'),
weather: JSON.stringify(this.data.weatherData)
}
this.http.put(`/api/PaperPlans/${this.route.snapshot.queryParams.paperplanId}`, body).subscribe(data => {
examFacilityAssetsData: sessionStorage.getItem(
"消防设施" + sessionStorage.getItem("paperId")
)
? sessionStorage.getItem("消防设施" + sessionStorage.getItem("paperId"))
: null,
examDisposalNodesData: sessionStorage.getItem("examNodeList")
? sessionStorage.getItem("examNodeList")
: null,
companyId: sessionStorage.getItem("companyId"),
weather: JSON.stringify(this.data.weatherData),
};
this.http
.put(
`/api/PaperPlans/${this.route.snapshot.queryParams.paperplanId}`,
body
)
.subscribe(
(data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('设置完成,页面将于一秒后关闭', '确定', config);
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("设置完成,页面将于一秒后关闭", "确定", config);
setTimeout(() => {
window.close()
window.close();
}, 1000);
})
},
(err) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("保存失败", "确定", config);
}
);
}
}
//保存考的节点
@Component({
selector: 'dialog-disposal-nodes',
templateUrl: './uploadDisposalNodes.html',
styleUrls: ['./collection-tools.component.scss',]
selector: "dialog-disposal-nodes",
templateUrl: "./uploadDisposalNodes.html",
styleUrls: ["./collection-tools.component.scss"],
})
export class uploadDisposalNodes {
constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data) { }
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
constructor(
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data
) {}
@ViewChild("nzTreeComponent", { static: false })
nzTreeComponent!: NzTreeComponent;
defaultCheckedKeys = [];
ngOnInit(): void {
this.treeData = [...this.data.treeData]
this.treeData = [...this.data.treeData];
let checkedArr = [];
// console.log(666, JSON.parse(sessionStorage.getItem("examNodeList")));
JSON.parse(sessionStorage.getItem("examNodeList")).forEach((element) => {
checkedArr.push(element.id);
});
this.defaultCheckedKeys = [...checkedArr];
}
treeData: any = []; //tree
//提交 保存考试节点
submit() {
let checkList = []
this.data.oldTreeData.forEach(element => {
let isChecked = (this.nzTreeComponent.getTreeNodeByKey(element.id)).isChecked
isChecked ? checkList.push(element) : null
let checkList = [];
this.data.oldTreeData.forEach((element) => {
let isChecked = this.nzTreeComponent.getTreeNodeByKey(
element.id
).isChecked;
isChecked ? checkList.push(element) : null;
});
let galfList = this.nzTreeComponent.getHalfCheckedNodeList()
this.data.oldTreeData.forEach(element => {
galfList.forEach(elements => {
element.id == elements.origin.id ? checkList.push(element) : null
let galfList = this.nzTreeComponent.getHalfCheckedNodeList();
this.data.oldTreeData.forEach((element) => {
galfList.forEach((elements) => {
element.id == elements.origin.id ? checkList.push(element) : null;
});
});
if (checkList.length) {
this.dialogRef.close(checkList);
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择节点', '确定', config);
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("请选择节点", "确定", config);
}
}
}

171
src/app/ui/collection-tools/leftFunctionalDomain.ts

@ -1,45 +1,49 @@
import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { Component, OnInit, Inject } from "@angular/core";
import { HttpClient, HttpHeaders } from "@angular/common/http";
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
@Component({
selector: 'app-leftFunctionalDomain',
templateUrl: './addPlaneFigure.html',
styleUrls: ['./panel.scss']
selector: "app-leftFunctionalDomain",
templateUrl: "./addPlaneFigure.html",
styleUrls: ["./panel.scss"],
})
export class leftFunctionalDomainComponent implements OnInit {
constructor(
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data) { }
ngOnInit(): void {
@Inject(MAT_DIALOG_DATA) public data
) {}
}
ngOnInit(): void {}
params = { companyId: sessionStorage.getItem('companyId') }
params = { companyId: sessionStorage.getItem("companyId") };
checked: boolean = false; //是否为避难层
//提交表单创建平面图
onSubmit(e) {
if (!this.data.isBuilding) { //总平面图 创建平面图
if (!this.data.isBuilding) {
//总平面图 创建平面图
let data = {
companyId: sessionStorage.getItem('companyId'),
companyId: sessionStorage.getItem("companyId"),
name: e.name,
order: this.data.order,
area: e.area,
details: e.details,
enabled: true,
modifiedTime: new Date(),
}
this.http.post('/api/SitePlans', data).subscribe(data => {
this.dialogRef.close('总平面图');
})
} else { //建筑 创建楼层/区域
};
this.http.post("/api/SitePlans", data).subscribe((data) => {
this.dialogRef.close("总平面图");
});
} else {
//建筑 创建楼层/区域
let data = {
isRefugeStorey: e.isRefugeStorey,
buildingId: this.data.Panel.id,
@ -49,35 +53,39 @@ export class leftFunctionalDomainComponent implements OnInit {
details: e.details,
enabled: true,
modifiedTime: new Date(),
}
this.http.post('/api/BuildingAreas', data, { params: this.params }).subscribe(data => {
this.dialogRef.close('建筑');
})
};
this.http
.post("/api/BuildingAreas", data, { params: this.params })
.subscribe((data) => {
this.dialogRef.close("建筑");
});
}
}
}
//编辑平面图 楼层/区域
@Component({
selector: 'app-editPlaneFigure',
templateUrl: './editPlaneFigure.html',
styleUrls: ['./panel.scss']
selector: "app-editPlaneFigure",
templateUrl: "./editPlaneFigure.html",
styleUrls: ["./panel.scss"],
})
export class editPlaneFigureComponent implements OnInit {
constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<any>, @Inject(MAT_DIALOG_DATA) public data) { }
constructor(
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data
) {}
ngOnInit(): void {
this.name = this.data.buildingData.name || ''
this.checked = this.data.buildingData.isRefugeStorey || false
this.area = this.data.buildingData.area || 0
this.details = this.data.buildingData.details || ''
this.name = this.data.buildingData.name || "";
this.checked = this.data.buildingData.isRefugeStorey || false;
this.area = this.data.buildingData.area || 0;
this.details = this.data.buildingData.details || "";
}
params = { companyId: sessionStorage.getItem('companyId') }
params = { companyId: sessionStorage.getItem("companyId") };
name: any; //name
checked: boolean = false; //是否为避难层
area: number; //面积
@ -85,9 +93,10 @@ export class editPlaneFigureComponent implements OnInit {
//提交表单修改平面图
onSubmit(e) {
if (!this.data.isBuilding) { //总平面图 修改平面图
if (!this.data.isBuilding) {
//总平面图 修改平面图
let data = {
companyId: sessionStorage.getItem('companyId'),
companyId: sessionStorage.getItem("companyId"),
id: this.data.buildingData.id,
name: e.name,
cadUrl: this.data.buildingData.cadUrl,
@ -98,11 +107,14 @@ export class editPlaneFigureComponent implements OnInit {
details: e.details,
enabled: this.data.buildingData.enabled,
modifiedTime: new Date(),
}
this.http.put(`/api/SitePlans/${this.data.buildingData.id}`, data).subscribe(data => {
this.dialogRef.close('总平面图');
})
} else { //建筑 修改楼层/区域
};
this.http
.put(`/api/SitePlans/${this.data.buildingData.id}`, data)
.subscribe((data) => {
this.dialogRef.close("总平面图");
});
} else {
//建筑 修改楼层/区域
let data = {
isRefugeStorey: e.isRefugeStorey,
buildingId: this.data.Panel.id,
@ -116,65 +128,72 @@ export class editPlaneFigureComponent implements OnInit {
details: e.details,
enabled: this.data.buildingData.enabled,
modifiedTime: new Date(),
}
this.http.put(`/api/BuildingAreas/${this.data.buildingData.id}`, data, { params: this.params }).subscribe(data => {
this.dialogRef.close('建筑');
};
this.http
.put(`/api/BuildingAreas/${this.data.buildingData.id}`, data, {
params: this.params,
})
.subscribe((data) => {
this.dialogRef.close("建筑");
});
}
}
}
//创建 处置预案 节点
@Component({
selector: 'app-addDisposalNode',
templateUrl: './addDisposalNode.html',
styleUrls: ['./panel.scss']
selector: "app-addDisposalNode",
templateUrl: "./addDisposalNode.html",
styleUrls: ["./panel.scss"],
})
export class addDisposalNodeComponent implements OnInit {
constructor(
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data
) {}
constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<any>, @Inject(MAT_DIALOG_DATA) public data) { }
ngOnInit(): void {
}
ngOnInit(): void {}
//提交表单
onSubmit(e) {
this.data.name = e.name
this.http.post('/api/DisposalNodes', this.data).subscribe(data => {
this.dialogRef.close('success');
})
this.data.name = e.name;
this.http.post("/api/DisposalNodes", this.data).subscribe((data) => {
this.dialogRef.close("success");
});
}
}
//编辑 处置预案 节点
@Component({
selector: 'app-editDisposalNode',
templateUrl: './editDisposalNode.html',
styleUrls: ['./panel.scss']
selector: "app-editDisposalNode",
templateUrl: "./editDisposalNode.html",
styleUrls: ["./panel.scss"],
})
export class editDisposalNodeComponent implements OnInit {
constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<any>, @Inject(MAT_DIALOG_DATA) public data) { }
constructor(
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data
) {}
ngOnInit(): void {
this.nodeName = JSON.parse(JSON.stringify(this.data.name || ''))
console.log(666, this.data);
this.nodeName = JSON.parse(JSON.stringify(this.data.name || ""));
}
nodeName: string;
//提交表单
onSubmit(e) {
this.data.name = e.name
this.http.put(`/api/DisposalNodes/${this.data.id}`, this.data).subscribe(data => {
this.data.name = e.name;
this.http
.put(`/api/ExamDisposalNodes/${this.data.id}`, this.data)
.subscribe((data) => {
this.dialogRef.close(e.name);
})
});
}
}

3
src/app/ui/collection-tools/uploadDisposalNodes.html

@ -1,7 +1,8 @@
<div id="disposalNodeTree">
<div
style="max-height: 500px;overflow-x: hidden;overflow-y: auto;margin-bottom: 25px;width: 330px;padding-right: 10px;">
<nz-tree #nzTreeComponent [nzData]="treeData" nzCheckable nzMultiple [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
<nz-tree #nzTreeComponent [nzData]="treeData" nzCheckable nzMultiple [nzTreeTemplate]="nzTreeTemplate"
[nzCheckedKeys]="defaultCheckedKeys"></nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div id="terrNodePublic">
<label title="{{node.title}}" class="overflowText textNode">{{node.title}}</label>

34
src/app/ui/enterpriseuser/enterpriseuser.component.html

@ -13,29 +13,16 @@
</div>
<div class="queryField" style="position: relative;">
<label style="margin-right: 10px;">消防救援站:</label>
<input type="text" [(ngModel)]="organizationName" name="organizationName" readonly autocomplete="off" placeholder="请选择消防救援站" (click)='showTree()'>
<mat-icon class="closeTree" *ngIf="isShowTree" (click)='hideTree()'>highlight_off</mat-icon>
<div class="treeDiv searchTree" *ngIf="isShowTree">
<mat-tree [dataSource]="dataSources" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='selectTree(node)'>
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='selectTree(node)'>
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon mat-icon class="mat-icon-rtl-mirror">{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 180px" [nzNodes]="nodes"
nzShowSearch nzPlaceHolder="请选择救援站" name="orTree" [(ngModel)]="organizationId" [nzAllowClear]="false">
</nz-tree-select>
</div>
<div class="queryField">
<button mat-raised-button (click)='initData()' style="background-color: #07CDCF;">查询</button>
<button mat-raised-button (click)='getAllUsers()' style="background-color: #07CDCF;">查询</button>
<button mat-raised-button (click)='empty()' style="margin-left: 10px; background-color: #FF8678;">重置</button>
</div>
<div class="queryField">
<button mat-raised-button (click)='open()' style="background-color: #07CDCF;">新增用户</button>
<button mat-raised-button (click)='open()' style="background-color: #07CDCF;">新增考生</button>
</div>
</div>
@ -74,8 +61,10 @@
<td mat-cell *matCellDef="let element">
<span class="operationSpan"><span class="spanbtn green" (click)="reset(element)">重置密码</span></span>
<span class="operationSpan"><span class="spanbtn green" (click)="edit(element)">编辑</span></span>
<span *ngIf="element.enabled" class="operationSpan"><span class="spanbtn red" (click)="noEnabled(element)">禁用</span></span>
<span *ngIf="!element.enabled" class="operationSpan"><span class="spanbtn gray" (click)="enabled(element)">启用</span></span>
<span *ngIf="element.enabled" class="operationSpan"><span class="spanbtn red"
(click)="noEnabled(element)">禁用</span></span>
<span *ngIf="!element.enabled" class="operationSpan"><span class="spanbtn gray"
(click)="enabled(element)">启用</span></span>
<span class="operationSpan"><span class="spanbtn red" (click)="delete(element)">删除</span></span>
</td>
</ng-container>
@ -83,10 +72,7 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
<mat-paginator [length]="length" [pageSize]="pageSize" (page)="chagePage($event)">
</mat-paginator>
</div>

53
src/app/ui/enterpriseuser/enterpriseuser.component.scss

@ -1,6 +1,7 @@
table {
width: 100%;
text-align: center;
.cdk-header-cell {
text-align: center;
}
@ -12,11 +13,13 @@ table {
overflow: hidden;
background: #F2F5F6;
}
.header {
width: 100%;
padding: 10px;
margin-bottom: 10px;
box-sizing: border-box;
.queryBox {
box-sizing: border-box;
padding: 5px 15px;
@ -25,45 +28,69 @@ table {
flex-wrap: wrap;
align-items: center;
justify-content: center;
.queryField {
margin: 0 25px;
font-size: 14px;
input {
width: 160px;
height: 34px;
line-height: 34px;
border-radius: 5px;
height: 30px;
line-height: 30px;
border-radius: 2px;
padding-left: 5px;
outline: none;
border: 1px solid rgb(226, 211, 211);
}
button { color: #fff; }
button {
color: #fff;
}
}
} //queryBox
}
//queryBox
}
.operationSpan {
margin: 0 10px;
.spanbtn {
font-weight: 550;
cursor: pointer;
}
.green{ color: #04ced1; }
.red{ color: #FF8678 }
.gray{ color: gray; }
.green {
color: #04ced1;
}
.red {
color: #FF8678
}
.gray {
color: gray;
}
}
//tree
.treeDiv {
max-height: 300px;
overflow-y: auto;
.mat-icon-button {
width: 20px;
height: 20px;
line-height: 20px;
}
li { cursor: pointer; }
.mat-tree-node:hover { background-color: rgb(240, 236, 236); }
li {
cursor: pointer;
}
.mat-tree-node:hover {
background-color: rgb(240, 236, 236);
}
}
.closeTree {
@ -73,8 +100,12 @@ table {
right: -95px;
z-index: 100;
}
.searchTree {
.mat-tree-node button .mat-icon { color: #000; }
.mat-tree-node button .mat-icon {
color: #000;
}
border: 1px solid rgb(207, 204, 204);
width: 350px;
max-height: 150px;

382
src/app/ui/enterpriseuser/enterpriseuser.component.ts

@ -1,192 +1,166 @@
import { Component, OnInit, ViewChild, Inject } 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 { AddEnterpriserUser } from './addenterpriseuser.component'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {FormControl} from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router'
import { FlatTreeControl } from '@angular/cdk/tree';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { Component, OnInit, ViewChild, Inject } 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 { AddEnterpriserUser } from "./addenterpriseuser.component";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import { FormControl } from "@angular/forms";
import { Router, ActivatedRoute } from "@angular/router";
import { FlatTreeControl } from "@angular/cdk/tree";
import {
MatTreeFlatDataSource,
MatTreeFlattener,
} from "@angular/material/tree";
import { TreeService } from "src/app/http-interceptors/tree.service";
@Component({
selector: 'app-enterpriseuser',
templateUrl: './enterpriseuser.component.html',
styleUrls: ['./enterpriseuser.component.scss']
selector: "app-enterpriseuser",
templateUrl: "./enterpriseuser.component.html",
styleUrls: ["./enterpriseuser.component.scss"],
})
export class EnterpriseuserComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private router:Router,private route:ActivatedRoute) { }
constructor(
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public treeService: TreeService
) {}
loginUserInfo;
ngOnInit() {
this.initData()
this.getOrganizations()
this.loginUserInfo = JSON.parse(sessionStorage.getItem("creatorData"));
this.getOrganizations();
}
allOrganizations: any; //所有组织机构
treeData:any = []; //tree型 data
isShowTree:boolean = false; //树形结构是否展示
showTree () { this.isShowTree = true }
hideTree () { this.isShowTree = false }
//获取所有组织机构
nodes;
organizationId;
getOrganizations() {
this.http.get('/api/Organizations').subscribe((data:any)=>{
this.allOrganizations = data
data.forEach(element => {
element.children = []
data.forEach(item => { item.parentId === element.id? element.children.push(item) : null });
this.http
.get("/api/Organizations", {
params: {
strict: "true",
},
})
.subscribe((data: any) => {
this.allOrganizations = data;
this.allOrganizations.forEach((element) => {
if (element.id === this.loginUserInfo.organizationId) {
element.parentId = null;
}
});
data.forEach(element => {
!element.parentId? this.treeData.push(element) : null
this.nodes = [...this.treeService.toTree(this.allOrganizations)];
this.organizationId = this.loginUserInfo.organizationId;
this.getAllUsers();
});
this.dataSources.data = this.treeData
}) //http
}
organizationId:string = null;
organizationName:string = null;
private _transformer = (node, level: number) => { //初始化tree
return {
expandable: !!node.children && node.children.length > 0,
name: node.name,
level: level,
id: node.id,
parentId: node.parentId,
children: node.children
};
}
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable);
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children);
dataSources = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
hasChild = (_: number, node: any) => node.expandable;
//选择tree节点
selectTree (e) {
this.organizationId = e.id
this.organizationName = e.name
this.isShowTree = false
}
displayedColumns: string[] = [ 'name','identitycard', 'post', 'tel', 'time', 'operation',];
displayedColumns: string[] = [
"name",
"identitycard",
"post",
"tel",
"time",
"operation",
];
dataSource: any; //所有企业用户
name:any //姓名
identityCard:any //身份证
name: any; //姓名
identityCard: any; //身份证
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length: any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
pageSize: any = 10; //每页条数
pageNumber: number = 1; //第几页
//分页切换
chagePage(e) {
this.pageNumber = e.pageIndex+1
let data= {
RealName: this.name || '',
IdentityCard: this.identityCard || '',
OrganizationId: this.organizationId || '',
RoleType: '2',
PageNumber: String(this.pageNumber),
}
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{
this.length = data.totalCount
this.pageSize = data.pageSize
this.dataSource = new MatTableDataSource<any>(data.items)
})
}
//页面初始化 + 查询 + 重置
initData () {
let data= {
RealName: this.name || '',
IdentityCard: this.identityCard || '',
OrganizationId: this.organizationId || '',
RoleType: '2',
}
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{
this.length = data.totalCount
this.pageSize = data.pageSize
this.pageEvent.pageIndex = 0
this.dataSource = new MatTableDataSource<any>(data.items)
})
this.pageNumber = e.pageIndex + 1;
this.getAllUsers();
}
//更新当前页数据
getAllUsers() {
let data = {
RealName: this.name || '',
IdentityCard: this.identityCard || '',
OrganizationId: this.organizationId || '',
RoleType: '2',
RealName: this.name || "",
IdentityCard: this.identityCard || "",
OrganizationId: this.organizationId || "",
RoleType: "2",
PageNumber: String(this.pageNumber),
}
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{
this.length = data.totalCount
this.pageSize = data.pageSize
this.dataSource = new MatTableDataSource<any>(data.items)
})
pageSize: this.pageSize,
};
this.http.get("/api/ExamUsers", { params: data }).subscribe((data: any) => {
this.length = data.totalCount;
this.pageSize = data.pageSize;
this.dataSource = new MatTableDataSource<any>(data.items);
});
}
//清空搜索
empty() {
this.name = '',
this.identityCard = '',
this.organizationId = '',
this.organizationName = '',
this.initData()
this.name = "";
this.identityCard = "";
this.organizationId = this.loginUserInfo.organizationId;
this.getAllUsers();
}
//创建用户
open() {
let data = this.treeData
let data = this.nodes;
let dialogRef = this.dialog.open(AddEnterpriserUser, { data });
dialogRef.afterClosed().subscribe(data=>{
dialogRef.afterClosed().subscribe((data) => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('创建成功!','确定',config);
this.getAllUsers()
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("创建成功!", "确定", config);
this.getAllUsers();
}
});
}
//编辑企业用户
edit(e) {
let data = {treeData: this.treeData, userData: e}
let data = { treeData: this.nodes, userData: e };
let dialogRef = this.dialog.open(editenterpriseuser, { data });
dialogRef.afterClosed().subscribe(data=>{
dialogRef.afterClosed().subscribe((data) => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('修改成功!','确定',config);
this.getAllUsers()
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("修改成功!", "确定", config);
this.getAllUsers();
}
});
}
//重置密码
reset(e) {
this.http.put(`/api/ExamUsers/${e.id}/ResetPassword`,{}).subscribe(data=>{
this.http.put(`/api/ExamUsers/${e.id}/ResetPassword`, {}).subscribe(
(data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('重置密码成功!','确定',config);
},err=>{
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("重置密码成功!", "确定", config);
},
(err) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('重置密码失败!','确定',config);
})
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("重置密码失败!", "确定", config);
}
);
}
//启用
@ -202,14 +176,14 @@ export class EnterpriseuserComponent implements OnInit {
phone: e.phone,
realName: e.realName,
roleType: e.roleType,
}
this.http.put(`/api/ExamUsers/${e.id}`,body).subscribe(data => {
};
this.http.put(`/api/ExamUsers/${e.id}`, body).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open('启用成功!','确定',config);
this.snackBar.open("启用成功!", "确定", config);
this.getAllUsers();
})
});
}
//禁用
@ -225,53 +199,58 @@ export class EnterpriseuserComponent implements OnInit {
phone: e.phone,
realName: e.realName,
roleType: e.roleType,
}
this.http.put(`/api/ExamUsers/${e.id}`,body).subscribe(data => {
};
this.http.put(`/api/ExamUsers/${e.id}`, body).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open('禁用成功!','确定',config);
this.snackBar.open("禁用成功!", "确定", config);
this.getAllUsers();
})
});
}
//删除
delete(e) {
let isTrue = confirm('您确定要删除吗')
let isTrue = confirm("您确定要删除吗");
if (isTrue) {
this.http.delete(`/api/ExamUsers/${e.id}`).subscribe(data=>{
this.http.delete(`/api/ExamUsers/${e.id}`).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除成功!','确定',config);
this.getAllUsers()
})
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("删除成功!", "确定", config);
this.getAllUsers();
});
}
}
}
//编辑企业用户
@Component({
selector: 'app-editenterpriseuser',
templateUrl: './editenterpriseuser.html',
styleUrls: ['./enterpriseuser.component.scss']
selector: "app-editenterpriseuser",
templateUrl: "./editenterpriseuser.html",
styleUrls: ["./enterpriseuser.component.scss"],
})
export class editenterpriseuser {
constructor(private http: HttpClient,public dialogRef: MatDialogRef<editenterpriseuser>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar,) {}
constructor(
private http: HttpClient,
public dialogRef: MatDialogRef<editenterpriseuser>,
@Inject(MAT_DIALOG_DATA) public data,
public snackBar: MatSnackBar
) {}
ngOnInit(): void {
this.dataSource.data = this.data.treeData
this.realName = JSON.parse(JSON.stringify(this.data.userData.realName))
this.identityCard = JSON.parse(JSON.stringify(this.data.userData.identityCard))
this.phone = JSON.parse(JSON.stringify(this.data.userData.phone))
this.organizationId = JSON.parse(JSON.stringify(this.data.userData.organizationId))
this.organizationName = JSON.parse(JSON.stringify(this.data.userData.organizationName))
this.dataSource.data = this.data.treeData;
this.realName = JSON.parse(JSON.stringify(this.data.userData.realName));
this.identityCard = JSON.parse(
JSON.stringify(this.data.userData.identityCard)
);
this.phone = JSON.parse(JSON.stringify(this.data.userData.phone));
this.organizationId = JSON.parse(
JSON.stringify(this.data.userData.organizationId)
);
this.organizationName = JSON.parse(
JSON.stringify(this.data.userData.organizationName)
);
}
errmsg: string = null; //捕获错误信息
@ -282,69 +261,64 @@ export class editenterpriseuser {
organizationId: string = null;
organizationName: string = null;
private _transformer = (node, level: number) => { //初始化tree
private _transformer = (node, level: number) => {
//初始化tree
return {
expandable: !!node.children && node.children.length > 0,
name: node.name,
level: level,
id: node.id,
parentId: node.parentId,
children: node.children
children: node.children,
};
}
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable);
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children);
};
treeControl = new FlatTreeControl<any>(
(node) => node.level,
(node) => node.expandable
);
treeFlattener = new MatTreeFlattener(
this._transformer,
(node) => node.level,
(node) => node.expandable,
(node) => node.children
);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
hasChild = (_: number, node: any) => node.expandable;
//选择tree节点
selectTree(e) {
this.organizationId = e.id
this.organizationName = e.name
this.organizationId = e.id;
this.organizationName = e.name;
}
//提交创建表单
onSubmit(e) {
console.log(666, e);
if (this.organizationId && this.organizationName) {
e.phone = String(e.phone)
e.roleType = 2
e.name = this.data.userData.name
e.id = this.data.userData.id
e.enabled = this.data.userData.enabled
e.creationTime = new Date()
e.organizationId = this.organizationId
e.organizationName = this.organizationName
this.http.put(`/api/ExamUsers/${this.data.userData.id}`,e).subscribe(data => {
this.dialogRef.close('success');
},err => {
e.phone = String(e.phone);
e.roleType = 2;
// e.name = this.data.userData.name
e.id = this.data.userData.id;
e.enabled = this.data.userData.enabled;
// e.creationTime = new Date()
e.organizationId = this.organizationId;
e.organizationName = this.organizationName;
this.http.put(`/api/ExamUsers/${this.data.userData.id}`, e).subscribe(
(data) => {
this.dialogRef.close("success");
},
(err) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open(err, "确定", config);
}
);
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择消防救援站','确定',config);
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("请选择消防救援站", "确定", config);
}
}
}
//查看企业用户
@Component({
selector: 'app-seeenterpriseuser',
templateUrl: './seeenterpriseuser.html',
styleUrls: ['./enterpriseuser.component.scss']
})
export class seeenterpriseuser {
constructor(public http: HttpClient,public dialog: MatDialog,
@Inject(MAT_DIALOG_DATA) public data) { }
ngOnInit() {}
}

6
src/app/ui/teacherManagement/editenterpriseuser.html

@ -10,7 +10,8 @@
<div>
<mat-form-field>
<input matInput id="realName" name="realName" [(ngModel)]="realName" required placeholder="用户姓名" autocomplete="off">
<input matInput id="realName" name="realName" [(ngModel)]="realName" required placeholder="用户姓名"
autocomplete="off">
</mat-form-field>
</div>
@ -26,7 +27,8 @@
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='selectTree(node)'>
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon mat-icon class="mat-icon-rtl-mirror">{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}</mat-icon>
<mat-icon mat-icon class="mat-icon-rtl-mirror">{{treeControl.isExpanded(node) ? 'expand_more' :
'chevron_right'}}</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>

37
src/app/ui/teacherManagement/enterpriseuser.component.html

@ -2,7 +2,6 @@
<div class="header">
<form #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">用户账号:</label>
<input type="text" [(ngModel)]="identityCard" name="identityCard" autocomplete="off" placeholder="请输入用户账号">
@ -13,37 +12,22 @@
</div>
<div class="queryField" style="position: relative;">
<label style="margin-right: 10px;">消防救援站:</label>
<input type="text" [(ngModel)]="organizationName" name="organizationName" readonly autocomplete="off" placeholder="请选择消防救援站" (click)='showTree()'>
<mat-icon class="closeTree" *ngIf="isShowTree" (click)='hideTree()'>highlight_off</mat-icon>
<div class="treeDiv searchTree" *ngIf="isShowTree">
<mat-tree [dataSource]="dataSources" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='selectTree(node)'>
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='selectTree(node)'>
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon mat-icon class="mat-icon-rtl-mirror">{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 180px" [nzNodes]="nodes"
nzShowSearch nzPlaceHolder="请选择救援站" name="orTree" [(ngModel)]="organizationId" [nzAllowClear]="false">
</nz-tree-select>
</div>
<div class="queryField">
<button mat-raised-button (click)='initData()' style="background-color: #07CDCF;">查询</button>
<button mat-raised-button (click)='getAllUsers()' style="background-color: #07CDCF;">查询</button>
<button mat-raised-button (click)='empty()' style="margin-left: 10px; background-color: #FF8678;">重置</button>
</div>
<div class="queryField">
<button mat-raised-button (click)='open()' style="background-color: #07CDCF;">新增用户</button>
<button mat-raised-button (click)='open()' style="background-color: #07CDCF;">新增考官</button>
</div>
</div>
</form>
</div>
<table mat-table [dataSource]="dataSource">
<ng-container matColumnDef="identitycard">
<th mat-header-cell *matHeaderCellDef>用户帐号</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
@ -69,8 +53,10 @@
<td mat-cell *matCellDef="let element">
<span class="operationSpan"><span class="spanbtn green" (click)="reset(element)">重置密码</span></span>
<span class="operationSpan"><span class="spanbtn green" (click)="edit(element)">编辑</span></span>
<span *ngIf="element.enabled" class="operationSpan"><span class="spanbtn red" (click)="noEnabled(element)">禁用</span></span>
<span *ngIf="!element.enabled" class="operationSpan"><span class="spanbtn gray" (click)="enabled(element)">启用</span></span>
<span *ngIf="element.enabled" class="operationSpan"><span class="spanbtn red"
(click)="noEnabled(element)">禁用</span></span>
<span *ngIf="!element.enabled" class="operationSpan"><span class="spanbtn gray"
(click)="enabled(element)">启用</span></span>
<span class="operationSpan"><span class="spanbtn red" (click)="delete(element)">删除</span></span>
</td>
</ng-container>
@ -78,10 +64,7 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
<mat-paginator [length]="length" [pageSize]="pageSize" (page)="chagePage($event)">
</mat-paginator>
</div>

55
src/app/ui/teacherManagement/enterpriseuser.component.scss

@ -1,6 +1,7 @@
table {
width: 100%;
text-align: center;
.cdk-header-cell {
text-align: center;
}
@ -12,11 +13,13 @@ table {
overflow: hidden;
background: #F2F5F6;
}
.header {
width: 100%;
padding: 10px;
margin-bottom: 10px;
box-sizing: border-box;
.queryBox {
box-sizing: border-box;
padding: 5px 15px;
@ -25,45 +28,69 @@ table {
flex-wrap: wrap;
align-items: center;
justify-content: center;
.queryField {
margin: 0 25px;
font-size: 14px;
input {
width: 160px;
height: 34px;
line-height: 34px;
border-radius: 5px;
padding-left: 5px;
height: 30px;
line-height: 30px;
border-radius: 2px;
padding-left: 6px;
outline: none;
border: 1px solid rgb(226, 211, 211);
}
button { color: #fff; }
button {
color: #fff;
}
}
} //queryBox
}
//queryBox
}
.operationSpan {
margin: 0 10px;
.spanbtn {
font-weight: 550;
cursor: pointer;
}
.green{ color: #04ced1; }
.red{ color: #FF8678 }
.gray{ color: gray; }
.green {
color: #04ced1;
}
.red {
color: #FF8678
}
.gray {
color: gray;
}
}
//tree
.treeDiv {
max-height: 300px;
overflow-y: auto;
.mat-icon-button {
width: 20px;
height: 20px;
line-height: 20px;
}
li { cursor: pointer; }
.mat-tree-node:hover { background-color: rgb(240, 236, 236); }
li {
cursor: pointer;
}
.mat-tree-node:hover {
background-color: rgb(240, 236, 236);
}
}
.closeTree {
@ -73,8 +100,12 @@ table {
right: -95px;
z-index: 100;
}
.searchTree {
.mat-tree-node button .mat-icon { color: #000; }
.mat-tree-node button .mat-icon {
color: #000;
}
border: 1px solid rgb(207, 204, 204);
width: 350px;
max-height: 150px;

392
src/app/ui/teacherManagement/enterpriseuser.component.ts

@ -1,174 +1,141 @@
import { Component, OnInit, ViewChild, Inject } 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 { AddTeacher } from './addenterpriseuser.component'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {FormControl} from '@angular/forms';
import { FlatTreeControl } from '@angular/cdk/tree';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { Component, OnInit, ViewChild, Inject } 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 { AddTeacher } from "./addenterpriseuser.component";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import { FormControl } from "@angular/forms";
import { FlatTreeControl } from "@angular/cdk/tree";
import {
MatTreeFlatDataSource,
MatTreeFlattener,
} from "@angular/material/tree";
import { TreeService } from "src/app/http-interceptors/tree.service";
@Component({
selector: 'app-enterpriseuser',
templateUrl: './enterpriseuser.component.html',
styleUrls: ['./enterpriseuser.component.scss']
selector: "app-enterpriseuser",
templateUrl: "./enterpriseuser.component.html",
styleUrls: ["./enterpriseuser.component.scss"],
})
export class TeacherManagementComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(
public http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar,
public treeService: TreeService
) {}
loginUserInfo;
ngOnInit() {
this.initData()
this.getOrganizations()
this.loginUserInfo = JSON.parse(sessionStorage.getItem("creatorData"));
this.getOrganizations();
}
name: any; //用户姓名
identityCard: any; //用户账号
organizationId;
allOrganizations: any; //所有组织机构
treeData:any = []; //tree型 data
isShowTree:boolean = false; //树形结构是否展示
showTree () { this.isShowTree = true }
hideTree () { this.isShowTree = false }
nodes = [];
//获取所有组织机构
getOrganizations() {
this.http.get('/api/Organizations').subscribe((data:any)=>{
this.allOrganizations = data
data.forEach(element => {
element.children = []
data.forEach(item => { item.parentId === element.id? element.children.push(item) : null });
this.http
.get("/api/Organizations", {
params: {
strict: "true",
},
})
.subscribe((data: any) => {
this.allOrganizations = data;
this.allOrganizations.forEach((element) => {
if (element.id === this.loginUserInfo.organizationId) {
element.parentId = null;
}
});
data.forEach(element => {
!element.parentId? this.treeData.push(element) : null
this.nodes = [...this.treeService.toTree(this.allOrganizations)];
this.organizationId = this.loginUserInfo.organizationId;
this.getAllUsers();
});
this.dataSources.data = this.treeData
}) //http
}
organizationId:string = null;
organizationName:string = null;
displayedColumns: string[] = [
"identitycard",
"name",
"post",
"time",
"operation",
];
private _transformer = (node, level: number) => { //初始化tree
return {
expandable: !!node.children && node.children.length > 0,
name: node.name,
level: level,
id: node.id,
parentId: node.parentId,
children: node.children
dataSource: any; //所有企业用户表格数据
//更新当前页数据
pageNumber: number = 1; //第几页
pageSize: any = "10"; //每页条数
getAllUsers() {
let data = {
Name: this.identityCard || "",
RealName: this.name || "",
OrganizationId: this.organizationId || "",
RoleType: "1",
PageNumber: String(this.pageNumber),
PageSize: this.pageSize,
};
this.http.get("/api/ExamUsers", { params: data }).subscribe((data: any) => {
this.length = data.totalCount;
this.pageSize = data.pageSize;
this.dataSource = new MatTableDataSource<any>(data.items);
});
}
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable);
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children);
dataSources = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
hasChild = (_: number, node: any) => node.expandable;
//选择tree节点
selectTree (e) {
this.organizationId = e.id
this.organizationName = e.name
this.isShowTree = false
}
displayedColumns: string[] = ['identitycard', 'name', 'post', 'time', 'operation',];
dataSource:any; //所有企业用户
name:any //用户姓名
identityCard:any //用户账号
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length: any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
pageNumber:number = 1; //第几页
//分页切换
chagePage(e) {
this.pageNumber = e.pageIndex+1
let data= {
name: this.identityCard || '',
realName: this.name || '',
OrganizationId: this.organizationId || '',
RoleType: '1',
PageNumber: String(this.pageNumber),
}
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{
this.length = data.totalCount
this.pageSize = data.pageSize
this.dataSource = new MatTableDataSource<any>(data.items)
})
}
//页面初始化 + 查询 + 重置
initData () {
let data= {
name: this.identityCard || '',
realName: this.name || '',
OrganizationId: this.organizationId || '',
RoleType: '1',
}
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{
this.length = data.totalCount
this.pageSize = data.pageSize
this.pageEvent.pageIndex = 0
this.dataSource = new MatTableDataSource<any>(data.items)
})
}
//更新当前页数据
getAllUsers () {
let data= {
name: this.identityCard || '',
realName: this.name || '',
OrganizationId: this.organizationId || '',
RoleType: '1',
PageNumber: String(this.pageNumber),
}
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{
this.length = data.totalCount
this.pageSize = data.pageSize
this.dataSource = new MatTableDataSource<any>(data.items)
})
this.pageNumber = e.pageIndex + 1;
this.getAllUsers();
}
//清空搜索
empty() {
this.name = '',
this.identityCard = '',
this.organizationId = '',
this.organizationName = '',
this.initData()
this.pageNumber = 1;
this.name = "";
this.identityCard = "";
this.organizationId = this.loginUserInfo.organizationId;
this.getAllUsers();
}
//创建教员
open() {
let data = this.treeData
let data = this.nodes;
let dialogRef = this.dialog.open(AddTeacher, { data });
dialogRef.afterClosed().subscribe(data=>{
dialogRef.afterClosed().subscribe((data) => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('创建成功!','确定',config);
this.getAllUsers()
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("创建成功!", "确定", config);
this.getAllUsers();
}
});
}
//编辑企业用户
edit(e) {
let data = {treeData: this.treeData, userData: e}
let data = { treeData: this.nodes, userData: e };
let dialogRef = this.dialog.open(editTeacher, { data });
dialogRef.afterClosed().subscribe(data=>{
dialogRef.afterClosed().subscribe((data) => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('修改成功!','确定',config);
this.getAllUsers()
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("修改成功!", "确定", config);
this.getAllUsers();
}
});
}
@ -176,81 +143,86 @@ export class TeacherManagementComponent implements OnInit {
//重置密码
reset(e) {
this.http.put(`/api/ExamUsers/${e.id}/ResetPassword`, {}).subscribe(
data=>{
(data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('重置密码成功!','确定',config);
},err=>{
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("重置密码成功!", "确定", config);
},
(err) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('重置密码失败!','确定',config);
})
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("重置密码失败!", "确定", config);
}
);
}
//启用
enabled(e) {
e.date = new Date()
e.enabled = true
this.http.put(`/api/ExamUsers/${e.id}`,e).subscribe(data => {
e.date = new Date();
e.enabled = true;
this.http.put(`/api/ExamUsers/${e.id}`, e).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open('启用成功!','确定',config);
this.snackBar.open("启用成功!", "确定", config);
this.getAllUsers();
})
});
}
//禁用
noEnabled(e) {
e.date = new Date()
e.enabled = false
this.http.put(`/api/ExamUsers/${e.id}`,e).subscribe(data => {
e.date = new Date();
e.enabled = false;
this.http.put(`/api/ExamUsers/${e.id}`, e).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open('禁用成功!','确定',config);
this.snackBar.open("禁用成功!", "确定", config);
this.getAllUsers();
})
});
}
//删除
delete(e) {
let isTrue = confirm('您确定要删除吗')
let isTrue = confirm("您确定要删除吗");
if (isTrue) {
this.http.delete(`/api/ExamUsers/${e.id}`).subscribe(data=>{
this.http.delete(`/api/ExamUsers/${e.id}`).subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除成功!','确定',config);
this.getAllUsers()
})
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("删除成功!", "确定", config);
this.getAllUsers();
});
}
}
}
//编辑企业用户
@Component({
selector: 'app-editenterpriseuser',
templateUrl: './editenterpriseuser.html',
styleUrls: ['./enterpriseuser.component.scss']
selector: "app-editenterpriseuser",
templateUrl: "./editenterpriseuser.html",
styleUrls: ["./enterpriseuser.component.scss"],
})
export class editTeacher {
constructor(private http: HttpClient,public dialogRef: MatDialogRef<editTeacher>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar,) {}
constructor(
private http: HttpClient,
public dialogRef: MatDialogRef<editTeacher>,
@Inject(MAT_DIALOG_DATA) public data,
public snackBar: MatSnackBar
) {}
ngOnInit(): void {
this.dataSource.data = this.data.treeData
this.name = JSON.parse(JSON.stringify(this.data.userData.name))
this.realName = JSON.parse(JSON.stringify(this.data.userData.realName))
this.organizationId = JSON.parse(JSON.stringify(this.data.userData.organizationId))
this.organizationName = JSON.parse(JSON.stringify(this.data.userData.organizationName))
this.dataSource.data = this.data.treeData;
this.name = JSON.parse(JSON.stringify(this.data.userData.name));
this.realName = JSON.parse(JSON.stringify(this.data.userData.realName));
this.organizationId = JSON.parse(
JSON.stringify(this.data.userData.organizationId)
);
this.organizationName = JSON.parse(
JSON.stringify(this.data.userData.organizationName)
);
}
errmsg: string = null; //捕获错误信息
@ -260,69 +232,63 @@ export class editTeacher {
organizationId: string = null;
organizationName: string = null;
private _transformer = (node, level: number) => { //初始化tree
private _transformer = (node, level: number) => {
//初始化tree
return {
expandable: !!node.children && node.children.length > 0,
name: node.name,
level: level,
id: node.id,
parentId: node.parentId,
children: node.children
children: node.children,
};
}
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable);
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children);
};
treeControl = new FlatTreeControl<any>(
(node) => node.level,
(node) => node.expandable
);
treeFlattener = new MatTreeFlattener(
this._transformer,
(node) => node.level,
(node) => node.expandable,
(node) => node.children
);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
hasChild = (_: number, node: any) => node.expandable;
//选择tree节点
selectTree(e) {
this.organizationId = e.id
this.organizationName = e.name
this.organizationId = e.id;
this.organizationName = e.name;
}
//提交创建表单
onSubmit(e) {
if (this.organizationId && this.organizationName) {
e.phone = this.data.userData.phone
e.identityCard = this.data.userData.identityCard
e.roleType = 1
e.id = this.data.userData.id
e.enabled = this.data.userData.enabled
e.creationTime = new Date()
e.organizationId = this.organizationId
e.organizationName = this.organizationName
this.http.put(`/api/ExamUsers/${this.data.userData.id}`,e).subscribe(data => {
this.dialogRef.close('success');
},err => {
e.phone = this.data.userData.phone;
e.identityCard = this.data.userData.identityCard;
e.roleType = 1;
e.id = this.data.userData.id;
e.enabled = this.data.userData.enabled;
e.creationTime = new Date();
e.organizationId = this.organizationId;
e.organizationName = this.organizationName;
this.http.put(`/api/ExamUsers/${this.data.userData.id}`, e).subscribe(
(data) => {
this.dialogRef.close("success");
},
(err) => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open(err, "确定", config);
}
);
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择消防救援站','确定',config);
}
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("请选择消防救援站", "确定", config);
}
}
//查看企业用户
@Component({
selector: 'app-seeenterpriseuser',
templateUrl: './seeenterpriseuser.html',
styleUrls: ['./enterpriseuser.component.scss']
})
export class seeTeacher {
constructor(public http: HttpClient,public dialog: MatDialog,
@Inject(MAT_DIALOG_DATA) public data) { }
ngOnInit() {}
}

19
src/app/ui/ui-routing.module.ts

@ -1,14 +1,15 @@
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { TeacherManagementComponent } from './teacherManagement/enterpriseuser.component';
import { EnterpriseuserComponent } from './enterpriseuser/enterpriseuser.component';
import { Routes, RouterModule } from "@angular/router";
import { NgModule } from "@angular/core";
import { TeacherManagementComponent } from "./teacherManagement/enterpriseuser.component";
import { EnterpriseuserComponent } from "./enterpriseuser/enterpriseuser.component";
import { AdministratorsComponent } from "./administrators/administrators.component";
const routes: Routes = [
{ path: 'teachear', component:TeacherManagementComponent }, //管理员 教员页面
{ path: 'examinee', component:EnterpriseuserComponent }, //管理员 考生页面
]
{ path: "teachear", component: TeacherManagementComponent }, //管理员 教员页面
{ path: "examinee", component: EnterpriseuserComponent }, //管理员 考生页面
{ path: "admin", component: AdministratorsComponent }, //管理员 考生页面
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
exports: [RouterModule],
})
export class UiRoutingModule {}

227
src/app/ui/ui.module.ts

@ -1,74 +1,155 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UiRoutingModule } from './ui-routing.module';
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 {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 { ChangepasswordComponent } from './changepassword/changepassword.component';
import { testState} from '../pipes/size.pipe';
import {ConfirmpswDirective} from './changepassword/equal-validator.directive';
import { FileUploadModule } from 'ng2-file-upload'
import { ChangeuserdataComponent } from './changeuserdata/changeuserdata.component';
import { IsLoginService } from '../is-login.service';
import { myPaginator } from "./my-paginator"
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import {CollectionToolsComponent,CreateBuilding,EditBuilding,ViewDetailss,} from './collection-tools/collection-tools.component'
import {leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent} from './collection-tools/leftFunctionalDomain'
import {saveOneDialog,saveTwoDialog} from './collection-tools/save'
import {WorkingAreaComponent} from '../working-area/working-area.component'
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { examinationQuestions,uploadQuestions,uploadDisposalNodes } from './collection-tools/examinationQuestions'
import {AddEnterpriserUser} from './enterpriseuser/addenterpriseuser.component'
import {EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser} from './enterpriseuser/enterpriseuser.component'
import {AddTeacher} from './teacherManagement/addenterpriseuser.component'
import {TeacherManagementComponent,editTeacher,seeTeacher} from './teacherManagement/enterpriseuser.component'
import { CollectionToolsExamineeComponent } from './collection-tools-examinee/collection-tools.component';
import { examinationQuestionsExaminee, uploadDisposalNodesExaminee, uploadQuestionsExaminee } from './collection-tools-examinee/examinationQuestions';
import { saveOneDialogExaminee, saveTwoDialogExaminee } from './collection-tools-examinee/save';
import { CollectionToolsReadComponent, Score } from './collection-tools-read/collection-tools.component';
import { examinationQuestionsRead, uploadDisposalNodesRead, uploadQuestionsRead } from './collection-tools-read/examinationQuestions';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { UiRoutingModule } from "./ui-routing.module";
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 { 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 { ChangepasswordComponent } from "./changepassword/changepassword.component";
import { testState } from "../pipes/size.pipe";
import { ConfirmpswDirective } from "./changepassword/equal-validator.directive";
import { FileUploadModule } from "ng2-file-upload";
import { ChangeuserdataComponent } from "./changeuserdata/changeuserdata.component";
import { IsLoginService } from "../is-login.service";
import { myPaginator } from "./my-paginator";
import { NzDatePickerModule } from "ng-zorro-antd/date-picker";
import {
CollectionToolsComponent,
CreateBuilding,
EditBuilding,
ViewDetailss,
} from "./collection-tools/collection-tools.component";
import {
leftFunctionalDomainComponent,
editPlaneFigureComponent,
addDisposalNodeComponent,
editDisposalNodeComponent,
} from "./collection-tools/leftFunctionalDomain";
import { saveOneDialog, saveTwoDialog } from "./collection-tools/save";
import { WorkingAreaComponent } from "../working-area/working-area.component";
import { NzTreeModule } from "ng-zorro-antd/tree";
import {
examinationQuestions,
uploadQuestions,
uploadDisposalNodes,
} from "./collection-tools/examinationQuestions";
import { AddEnterpriserUser } from "./enterpriseuser/addenterpriseuser.component";
import {
EnterpriseuserComponent,
editenterpriseuser,
} from "./enterpriseuser/enterpriseuser.component";
import { AddTeacher } from "./teacherManagement/addenterpriseuser.component";
import {
TeacherManagementComponent,
editTeacher,
} from "./teacherManagement/enterpriseuser.component";
import { CollectionToolsExamineeComponent } from "./collection-tools-examinee/collection-tools.component";
import {
examinationQuestionsExaminee,
uploadDisposalNodesExaminee,
uploadQuestionsExaminee,
} from "./collection-tools-examinee/examinationQuestions";
import {
saveOneDialogExaminee,
saveTwoDialogExaminee,
} from "./collection-tools-examinee/save";
import {
CollectionToolsReadComponent,
Score,
} from "./collection-tools-read/collection-tools.component";
import {
examinationQuestionsRead,
uploadDisposalNodesRead,
uploadQuestionsRead,
} from "./collection-tools-read/examinationQuestions";
import { NzTreeSelectModule } from "ng-zorro-antd/tree-select";
import { AdministratorsComponent } from "./administrators/administrators.component";
import { AddEditAdminComponent } from "./administrators/add-edit-admin/add-edit-admin.component";
import { RemarkComponent } from './collection-tools-read/remark/remark.component';
@NgModule({
declarations: [ChangepasswordComponent,ConfirmpswDirective, ChangeuserdataComponent,testState,CollectionToolsComponent,CreateBuilding,EditBuilding,ViewDetailss,leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,saveOneDialog,saveTwoDialog,WorkingAreaComponent,examinationQuestions,uploadQuestions,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,AddTeacher,TeacherManagementComponent,editTeacher,seeTeacher,uploadDisposalNodes,CollectionToolsExamineeComponent,examinationQuestionsExaminee,uploadQuestionsExaminee,uploadDisposalNodesExaminee,saveOneDialogExaminee,saveTwoDialogExaminee,CollectionToolsReadComponent,examinationQuestionsRead,uploadQuestionsRead,uploadDisposalNodesRead,Score],
declarations: [
ChangepasswordComponent,
ConfirmpswDirective,
ChangeuserdataComponent,
testState,
CollectionToolsComponent,
CreateBuilding,
EditBuilding,
ViewDetailss,
leftFunctionalDomainComponent,
editPlaneFigureComponent,
addDisposalNodeComponent,
editDisposalNodeComponent,
saveOneDialog,
saveTwoDialog,
WorkingAreaComponent,
examinationQuestions,
uploadQuestions,
AddEnterpriserUser,
EnterpriseuserComponent,
editenterpriseuser,
AddTeacher,
TeacherManagementComponent,
editTeacher,
uploadDisposalNodes,
CollectionToolsExamineeComponent,
examinationQuestionsExaminee,
uploadQuestionsExaminee,
uploadDisposalNodesExaminee,
saveOneDialogExaminee,
saveTwoDialogExaminee,
CollectionToolsReadComponent,
examinationQuestionsRead,
uploadQuestionsRead,
uploadDisposalNodesRead,
Score,
AdministratorsComponent,
AddEditAdminComponent,
RemarkComponent,
],
imports: [
NzDatePickerModule,
CommonModule,
@ -117,9 +198,9 @@ import { examinationQuestionsRead, uploadDisposalNodesRead, uploadQuestionsRead
ReactiveFormsModule,
FormsModule,
FileUploadModule,
NzTreeModule
NzTreeModule,
NzTreeSelectModule,
],
providers: [ { provide: MatPaginatorIntl, useValue: myPaginator() } ]
providers: [{ provide: MatPaginatorIntl, useValue: myPaginator() }],
})
export class UiModule {}

14
src/app/working-area/model/axArrowConnector.ts

@ -154,20 +154,22 @@ export class AxArrowConnector extends AxShape {
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
const strokeWidth = 1;
const edgeWidth = this.assetData.Thickness === 0 ? 5 : this.assetData.Thickness; // 宽度
const edgeWidth = this.assetData.Thickness === 0 ? 1 : this.assetData.Thickness; // 宽度
const startWidth = edgeWidth * 2 + strokeWidth;
const endWidth = edgeWidth * 2 + strokeWidth;
const startScale = this.assetData.Thickness <= 5 ? 5 : 2; // 宽度
const startWidth = edgeWidth * startScale + strokeWidth;
const endWidth = edgeWidth * startScale + strokeWidth;
const openEnded = false;
const spacing = (openEnded) ? 0 : 0 + strokeWidth / 2;
const startSize = edgeWidth * 2 + strokeWidth;
const endSize = edgeWidth * 2 + strokeWidth;
const startSize = edgeWidth * startScale + strokeWidth;
const endSize = edgeWidth * startScale + strokeWidth;
const isRounded = true;
const lineColor = 0x000000;
const lineColor : number = this.assetData.Color.substring(0, 7).replace('#', '0x');
const fillColor: number = this.assetData.Color.substring(0, 7).replace('#', '0x');
const pe = pts[pts.length - 1];

204
src/app/working-area/model/axImageShape.ts

@ -93,7 +93,9 @@ export class AxImageShape extends AxShape {
this.up.on('pointerdown', event => {
this.upDrag = true;
this.image.anchor.set(0.5, 1);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
this.position.set(this.x, this.y + this.image.height * 0.5);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.up.on('pointermove', event => {
@ -104,6 +106,7 @@ export class AxImageShape extends AxShape {
var dY = Math.abs(pos.y - this.image.y);
this.assetData.Height = Math.abs(dY);
this.refresh();
this.text.y = this.image.y - this.image.height / 2;
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
@ -112,14 +115,18 @@ export class AxImageShape extends AxShape {
if (this.upDrag) {
this.upDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x, this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.up.on('pointerupoutside', event => {
if (this.upDrag) {
this.upDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x, this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.up.visible = false;
@ -132,7 +139,9 @@ export class AxImageShape extends AxShape {
this.down.on('pointerdown', event => {
this.downDrag = true;
this.image.anchor.set(0.5, 0);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
this.position.set(this.x, this.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.down.on('pointermove', event => {
@ -151,14 +160,18 @@ export class AxImageShape extends AxShape {
if (this.downDrag) {
this.downDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
this.position.set(this.x, this.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.down.on('pointerupoutside', event => {
if (this.downDrag) {
this.downDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
this.position.set(this.x, this.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.down.visible = false;
@ -171,7 +184,9 @@ export class AxImageShape extends AxShape {
this.left.on('pointerdown', event => {
this.leftDrag = true;
this.image.anchor.set(1, 0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x + (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.left.on('pointermove', event => {
@ -190,14 +205,18 @@ export class AxImageShape extends AxShape {
if (this.leftDrag) {
this.leftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x - (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.left.on('pointerupoutside', event => {
if (this.leftDrag) {
this.leftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x - (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.left.visible = false;
@ -210,7 +229,9 @@ export class AxImageShape extends AxShape {
this.right.on('pointerdown', event => {
this.rightDrag = true;
this.image.anchor.set(0, 0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x - (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.right.on('pointermove', event => {
@ -229,14 +250,18 @@ export class AxImageShape extends AxShape {
if (this.rightDrag) {
this.rightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x + (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.right.on('pointerupoutside', event => {
if (this.rightDrag) {
this.rightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.right.visible = false;
@ -249,7 +274,9 @@ export class AxImageShape extends AxShape {
this.upLeft.on('pointerdown', event => {
this.upLeftDrag = true;
this.image.anchor.set(1);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.upLeft.on('pointermove', event => {
@ -271,14 +298,18 @@ export class AxImageShape extends AxShape {
if (this.upLeftDrag) {
this.upLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.upLeft.on('pointerupoutside', event => {
if (this.upLeftDrag) {
this.upLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.upLeft.visible = false;
@ -291,7 +322,9 @@ export class AxImageShape extends AxShape {
this.upRight.on('pointerdown', event => {
this.upRightDrag = true;
this.image.anchor.set(0, 1);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.upRight.on('pointermove', event => {
@ -313,14 +346,18 @@ export class AxImageShape extends AxShape {
if (this.upRightDrag) {
this.upRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.upRight.on('pointerupoutside', event => {
if (this.upRightDrag) {
this.upRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.upRight.visible = false;
@ -333,7 +370,9 @@ export class AxImageShape extends AxShape {
this.downLeft.on('pointerdown', event => {
this.downLeftDrag = true;
this.image.anchor.set(1, 0);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.downLeft.on('pointermove', event => {
@ -355,14 +394,18 @@ export class AxImageShape extends AxShape {
if (this.downLeftDrag) {
this.downLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.downLeft.on('pointerupoutside', event => {
if (this.downLeftDrag) {
this.downLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.downLeft.visible = false;
@ -375,7 +418,9 @@ export class AxImageShape extends AxShape {
this.downRight.on('pointerdown', event => {
this.downRightDrag = true;
this.image.anchor.set(0, 0);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.downRight.on('pointermove', event => {
@ -397,14 +442,18 @@ export class AxImageShape extends AxShape {
if (this.downRightDrag) {
this.downRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.downRight.on('pointerupoutside', event => {
if (this.downRightDrag) {
this.downRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.downRight.visible = false;
@ -422,7 +471,8 @@ export class AxImageShape extends AxShape {
* @param value
*/
public setPointVisiable(value: boolean) {
const rect = this.getLocalBounds();
const rect1 = this.image.getLocalBounds();
const rect = new Rectangle(rect1.x * this.image.scale.x, rect1.y * this.image.scale.y, rect1.width * this.image.scale.x, rect1.height * this.image.scale.y);
this.up.x = rect.right - rect.width / 2;
this.up.y = rect.top;
this.down.x = rect.right - rect.width / 2;
@ -452,28 +502,28 @@ export class AxImageShape extends AxShape {
*
* @param scale
*/
public drawBorder(scale: number) {
public drawBorder() {
const visible = this.upLeft.visible;
this.setPointVisiable(false);
const scale = this.assetData.FixedSize ? 1 : 1 / this.workingArea.backgroundImage.scale.x;
this.border.clear();
const rect1 = this.image.getLocalBounds();
const rect = new Rectangle(rect1.x * this.image.scale.x, rect1.y * this.image.scale.y, rect1.width * this.image.scale.x, rect1.height * this.image.scale.y);
const p1 = new PIXI.Point(rect.left, rect.top);
const p2 = new PIXI.Point(rect.right, rect.top);
const p3 = new PIXI.Point(rect.right, rect.bottom);
const p4 = new PIXI.Point(rect.left, rect.bottom);
this.border.lineStyle(scale * 1, 0x00a8ff);
const spaceLength = scale * 1;
const lineLenght = rect.width + 0.5 + 0.5;
const dashLength = scale * (lineLenght + spaceLength - Math.floor((rect.width + rect.height) / 2 / 4.1)) / Math.floor((rect.width + rect.height) / 2 / 4.1);
this.drawDash(this.border, p1.x - 0.5 * scale, p1.y, p2.x + 0.5 * scale, p2.y, dashLength, spaceLength);
this.drawDash(this.border, p2.x, p2.y - 0.5 * scale, p3.x, p3.y + 0.5 * scale, dashLength, spaceLength);
this.drawDash(this.border, p3.x + 0.5 * scale, p3.y, p4.x - 0.5 * scale, p4.y, dashLength, spaceLength);
this.drawDash(this.border, p4.x, p4.y + 0.5 * scale, p1.x, p1.y - 0.5 * scale, dashLength, spaceLength);
super.drawBorder(scale);
const rect = this.getLocalBounds();
this.up.x = rect.right - rect.width / 2;
this.up.y = rect.top;
this.down.x = rect.right - rect.width / 2;
this.down.y = rect.bottom;
this.left.x = rect.left;
this.left.y = rect.bottom - rect.height / 2;
this.right.x = rect.right;
this.right.y = rect.bottom - rect.height / 2;
this.upLeft.x = rect.left;
this.upLeft.y = rect.top;
this.upRight.x = rect.right;
this.upRight.y = rect.top;
this.downLeft.x = rect.left;
this.downLeft.y = rect.bottom;
this.downRight.x = rect.right;
this.downRight.y = rect.bottom;
this.setPointVisiable(visible);
}
public setItemScale(scale: number) {
@ -501,41 +551,41 @@ export class AxImageShape extends AxShape {
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
if (this.image.anchor.x == 0) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y - this.image.height / 2;
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y - this.image.height;
}
// if (this.image.anchor.x == 0) {
// if (this.image.anchor.y == 0) {
// this.text.x = this.image.x + this.image.width / 2;
// this.text.y = this.image.y;
// } else if (this.image.anchor.y == 0.5) {
// this.text.x = this.image.x + this.image.width / 2;
// this.text.y = this.image.y - this.image.height / 2;
// } else if (this.image.anchor.y == 1) {
// this.text.x = this.image.x + this.image.width / 2;
// this.text.y = this.image.y - this.image.height;
// }
} else if (this.image.anchor.x == 0.5) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
// } else if (this.image.anchor.x == 0.5) {
// if (this.image.anchor.y == 0) {
// this.text.x = this.image.x;
// this.text.y = this.image.y;
// } else if (this.image.anchor.y == 0.5) {
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x;
this.text.y = this.image.y - this.image.height;
}
} else if (this.image.anchor.x == 1) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y - this.image.height / 2;
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y - this.image.height;
}
}
// } else if (this.image.anchor.y == 1) {
// this.text.x = this.image.x;
// this.text.y = this.image.y - this.image.height;
// }
// } else if (this.image.anchor.x == 1) {
// if (this.image.anchor.y == 0) {
// this.text.x = this.image.x - this.image.width / 2;
// this.text.y = this.image.y;
// } else if (this.image.anchor.y == 0.5) {
// this.text.x = this.image.x - this.image.width / 2;
// this.text.y = this.image.y - this.image.height / 2;
// } else if (this.image.anchor.y == 1) {
// this.text.x = this.image.x - this.image.width / 2;
// this.text.y = this.image.y - this.image.height;
// }
// }
this.angle = -this.workingArea.backgroundImage.angle;
this.drawBorder(1 / this.workingArea.backgroundImage.scale.x);
this.drawBorder();
}
}

7
src/app/working-area/model/axLegend.ts

@ -1,6 +1,3 @@
import { Constructor } from '@angular/material/core/common-behaviors/constructor';
import { MatGridTileHeaderCssMatStyler } from '@angular/material/grid-list';
import { DefaultProxy } from 'cesium';
import { Sprite, Texture, Text, Graphics, Point } from 'pixi.js';
import { WorkingAreaComponent } from '../working-area.component';
import { AxShape } from './axShape';
@ -27,10 +24,10 @@ export class AxLegend extends AxShape {
super(assetData, workingArea);
this.angle = -this.workingArea.backgroundImage.angle;
this.name = this.assetData.Id;
this.pivot.set(this.assetData.PivotX, this.assetData.PivotY);
this.pivot.set(this.assetData.PivotX == undefined ? 0 : this.assetData.PivotX, this.assetData.PivotY == undefined ? 0 : this.assetData.PivotY);
this.x = this.assetData.Point.x;
this.y = this.assetData.Point.y;
this.scale.set(this.assetData.Scale);
this.scale.set(this.assetData.Scale == undefined ? 1 : this.assetData.Scale);
this.shapeMap = shapeMap;
this.createPoint();
this.refresh();

26
src/app/working-area/model/axShape.ts

@ -2,6 +2,7 @@ import { Constructor } from '@angular/material/core/common-behaviors/constructor
import * as PIXI from 'pixi.js';
import { Point, Rectangle, Graphics, Container } from 'pixi.js';
import { WorkingAreaComponent } from '../working-area.component';
import { PaintMode } from './paintModel';
/**
*
@ -35,6 +36,7 @@ export class AxShape extends Graphics {
// this.buttonMode = true;
this
.on('pointerdown', event => {
if (workingArea.getPaintMode() !== PaintMode.Pipeline) {
event.stopPropagation();
if (this.allowSelect
&& event.data.button === 0) {
@ -42,7 +44,8 @@ export class AxShape extends Graphics {
}
if (this.allowEdit) {
this.mouseDragging = true;
this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y);
this.mousePosition = event.data.getLocalPosition(this.workingArea.backgroundImage);
}
}
})
.on('pointerup', event => {
@ -53,15 +56,26 @@ export class AxShape extends Graphics {
})
.on('pointermove', event => {
if (this.mouseDragging) {
// const newPosition = event.data.getLocalPosition(this.workingArea.backgroundImage);
// const x = newPosition.x - this.x;
// const y = newPosition.y - this.y;
// this.workingArea.selection.all().forEach(item => {
// item.x += x;
// item.y += y;
// item.assetData.Point = new PIXI.Point(item.x, item.y);
// this.workingArea.canvasData.isChange = true;
// });
const newPosition = event.data.getLocalPosition(this.workingArea.backgroundImage);
const offsetX = newPosition.x - this.mousePosition.x;
const offsetY = newPosition.y - this.mousePosition.y;
this.workingArea.selection.all().forEach(item => {
const x = event.data.global.x - this.mousePosition.x;
const y = event.data.global.y - this.mousePosition.y;
item.x += x * (1 / this.workingArea.camera2D.scale.x);
item.y += y * (1 / this.workingArea.camera2D.scale.y);
item.x += offsetX;
item.y += offsetY;
item.assetData.Point = new PIXI.Point(item.x, item.y);
this.workingArea.canvasData.isChange = true;
});
this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y);
this.mousePosition = newPosition;
}
})
.on('rightclick', event => {

2
src/app/working-area/model/configuration.ts

@ -77,7 +77,7 @@ export var config = {
directionalDrag: true,
boundsX: 500,
boundsY: 500,
viewBounds: 60000
viewBounds: 100000
};
export var wallInformation = { exterior: false, interior: false, midline: true, labels: true, exteriorlabel: 'e:', interiorlabel: 'i:', midlinelabel: 'm:' };

70
src/app/working-area/working-area.component.ts

@ -16,7 +16,6 @@ import { PropertyInfo } from './model/PropertyInfo';
import { AxPreviewImageShape } from './model/axPreviewImageShape';
import { AxArrowConnector } from './model/axArrowConnector';
import { AxLegend, Legend } from './model/axLegend';
import { AxGrid } from './model/axGrid';
import { AxSelection } from './model/axSelection';
import { AxMessageSystem } from './model/axMessageSystem';
import { Grid2D } from './model/grid2D';
@ -24,7 +23,7 @@ import { Viewport } from 'pixi-viewport';
import { EVENT_IMAGE_RESIZE, EVENT_SELECTION_CHANGED } from './model/events';
import { Dimensioning } from './model/dimensioning';
import { Configuration, viewBounds } from './model/configuration';
import { id } from 'date-fns/locale';
@Component({
@ -64,6 +63,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*
*/
public loader = PIXI.Loader.shared;
/**
*
*/
public backgroundContainer = new PIXI.Container();
/**
*
*/
@ -171,7 +174,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* -
* -
*/
public VERSION = '1.4.3.20210415_rc';
public VERSION = '1.5.2.20210719';
/**
*
*/
@ -223,6 +226,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.camera2D.drag();
}
}
/**
*
*/
@ -401,6 +405,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.camera2D.on('wheel', event => {
this.updateCamera2D();
this.enterPaintEndButton.scale.set(1/this.camera2D.scale.x);
});
this.camera2D.on('pointerdown', event => {
@ -478,7 +483,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.deselectAll();
this.setPaintMode(PaintMode.endPaint);
});
}
/**
* 2D相机
@ -610,17 +614,38 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
}
(axShape.assetData.PropertyInfos.find(i => i.PropertyName == "名称/编号")).PropertyValue = index;
}
axShape.refresh();
this.emit('canvasDataChanged');
this.canvasData.isChange = true;
this.updateCamera2D();
});
}
/**
*
*/
takeScreenshot() {
this.backgroundContainer.setParent(this.app.stage);
this.app.renderer.extract.canvas(this.backgroundContainer).toBlob((b) => {
const a = document.createElement('a');
document.body.append(a);
a.download = 'screenshot';
a.href = URL.createObjectURL(b);
a.click();
a.remove();
}, 'image/png');
this.backgroundContainer.setParent(this.camera2D);
}
/**
*
*/
public resetCanvas() {
if (!this.init.isGis) {
this.app.renderer.resize(this.content.nativeElement.clientWidth, this.content.nativeElement.clientHeight);
}
}
/**
*
* @param value true false
@ -742,8 +767,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*
*/
private createEnterPaintEndButton() {
this.enterPaintEndButton.width = 60;
this.enterPaintEndButton.height = 60;
// this.enterPaintEndButton.width = 20;
// this.enterPaintEndButton.height = 20;
// this.enterPaintEndButton.scale.set(1/this.camera2D.scale.x);
this.enterPaintEndButton.anchor.set(0.5);
this.enterPaintEndButton.position = new PIXI.Point(0, 0);
this.enterPaintEndButton.interactive = true;
@ -754,7 +781,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.enterPaint();
});
this.backgroundImage.addChild(this.enterPaintEndButton);
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length + 200;
this.enterPaintEndButton.visible = false;
}
/**
@ -785,6 +812,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
TemplateId: this.canvasData.selectTemplateData.id,
CanConnect: this.canvasData.selectTemplateData.canConnect,
Pipelines: new Array(),
BuildingId: this.canvasData.selectStorey.buildingId,
FloorId: this.canvasData.selectStorey.id,
Angle: this.canvasData.selectTemplateData.angle,
Color: this.canvasData.selectTemplateData.color,
@ -808,6 +836,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
GameMode: this.canvasData.gameMode,
Tag: this.canvasData.selectTemplateData.tag
};
const singleIcon = new AxImageShape(assetData, this);
this.emit('createIcon', singleIcon);
break;
@ -838,7 +867,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
if (this.paintPoints.length >= 2) {
this.enterPaintEndButton.position = this.circleShadow.position;
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length + 200;
}
if (this.paintingIcon !== null) {
@ -905,7 +934,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.enterPaintEndButton.position = this.circleShadow.position;
} else if (this.paintPoints.length >= 3) {
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length + 200;
}
this.paintPoints.forEach((value, index, array) => {
if (index === 0) {
@ -934,7 +963,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.previewLineSegment.visible = true;
this.enterPaintEndButton.position = this.circleShadow.position;
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length + 200;
// this.currentClickPoint.position = new PIXI.Point(this.circleShadow.x, this.circleShadow.y);
// this.paintPoints.push(new PIXI.Point(this.circleShadow.x, this.circleShadow.y));
var point = new PIXI.Point(this.circleShadow.x, this.circleShadow.y);
@ -1035,7 +1064,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.previewImage.visible = false;
}
});
this.camera2D.addChild(this.backgroundImage);
this.backgroundContainer.addChild(this.backgroundImage);
this.camera2D.addChild(this.backgroundContainer);
this.createPreviewImage();
this.createPreviewLineSegment();
this.createCircleShadow();
@ -1071,10 +1101,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
imageWidth: number = this.canvasData.selectStorey.imageWidth,
imageHeight: number = this.canvasData.selectStorey.imageHeight,
): Promise<void> {
console.log('当前背景图',imageUrl)
if (imageAngle === undefined || imageAngle === null) {
imageAngle = 0;
}
this.backgroundImage.scale.set(1);
this.backgroundImage.scale ? this.backgroundImage.scale.set(1) : null;
// this.backgroundImage.pivot.set(0);
if (imageUrl === undefined || imageUrl === null || imageUrl === '') {
this.backgroundImage.texture = this.backgroundTexture;
@ -1246,6 +1277,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.emit('createIcon', axLegend);
} else {
const axLegend = new AxLegend(data, this, shapeMap);
axLegend.assetData.PropertyInfos[0].PropertyType = Number(axLegend.assetData.PropertyInfos[0].PropertyType);
axLegend.assetData.PropertyInfos[0].PropertyValue = String(axLegend.assetData.PropertyInfos[0].PropertyValue);
}
}
// /**
@ -1449,7 +1482,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
const property = new PropertyInfo(element);
propertyList.push(property);
});
const assetData = {
const assetData: AssetData = {
TemplateId: this.canvasData.selectTemplateData.id,
FloorId: this.canvasData.selectStorey.id,
Angle: this.canvasData.selectTemplateData.angle,
@ -1460,6 +1493,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
FixedSize: this.canvasData.selectTemplateData.fixedSize,
Height: 32,
Width: 32,
BuildingId: this.canvasData.selectStorey.buildingId,
CompanyId: "",
FloorName: "",
Id: ObjectID.default.generate(),
ImageUrl: this.canvasData.selectTemplateData.imageUrl,
InteractiveMode: this.canvasData.selectTemplateData.interactiveMode,
@ -1599,7 +1635,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.backgroundImage.getChildByName(item).destroy();
});
// 创建楼层图形
// this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
// 创建楼层图形
this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
// 创建处置预案图形
@ -1613,9 +1649,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* -
*/
public async onExaminerClickFloor_CreateTestpaper() {
console.log("abc")
await this.refreshBackgroundImage(this.canvasData.selectStorey.imageUrl, this.canvasData.selectStorey.imageAngle);
// 清空所有图形
this.deselectAll();
// // 清空所有图形
// this.deselectAll();
const itemList = [];
this.backgroundImage.children.forEach(item => {
if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) {
@ -1708,6 +1745,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
ids.forEach(item => {
const obj = this.backgroundImage.getChildByName(item);
shapes.push(obj as AxShape);
console.log((obj as AxShape).assetData);
});
this.selectAllWithClear(shapes);
}

1
src/styles.scss

@ -4,6 +4,7 @@
/* 引入组件样式 */
@import "~ng-zorro-antd/tree-select/style/index.min.css";
@import "~ng-zorro-antd/modal/style/index.min.css";
@import "~ng-zorro-antd/rate/style/index.min.css";
/* 引入组件样式 */
@import "./assets/css/time.scss";

Loading…
Cancel
Save