chenjingyu 4 years ago
parent
commit
91f74e5ebf
  1. 110
      package-lock.json
  2. 2
      package.json
  3. 2
      src/app/_theming.scss
  4. 11
      src/app/examiner/create-test-score/addPlan.html
  5. 29
      src/app/examiner/create-test-score/addPlan.scss
  6. 77
      src/app/examiner/create-test-score/addPlanTwo.html
  7. 49
      src/app/examiner/create-test-score/addPlanTwo.scss
  8. 118
      src/app/examiner/create-test-score/create-test-score.component.html
  9. 64
      src/app/examiner/create-test-score/create-test-score.component.scss
  10. 254
      src/app/examiner/create-test-score/create-test-score.component.ts
  11. 11
      src/app/examiner/examiner.module.ts
  12. 477
      src/assets/css/ngZorroTree.css
  13. 13
      src/styles.scss

110
package-lock.json generated

@ -464,26 +464,26 @@
"integrity": "sha1-EXhPyM6cszFMfsEIP/m+fGERgcI="
},
"@ant-design/colors": {
"version": "3.2.2",
"resolved": "https://registry.npm.taobao.org/@ant-design/colors/download/@ant-design/colors-3.2.2.tgz?cache=0&sync_timestamp=1596611396536&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40ant-design%2Fcolors%2Fdownload%2F%40ant-design%2Fcolors-3.2.2.tgz",
"integrity": "sha1-WtQ9YZ6RHzSI66wwPWBuZqhCOQM=",
"version": "5.0.0",
"resolved": "https://registry.npm.taobao.org/@ant-design/colors/download/@ant-design/colors-5.0.0.tgz",
"integrity": "sha1-Rrc7TMaTWzX8i4RVXo5CyM/BkOY=",
"requires": {
"tinycolor2": "^1.4.1"
"@ctrl/tinycolor": "^3.1.6"
}
},
"@ant-design/icons-angular": {
"version": "10.0.1",
"resolved": "https://registry.npm.taobao.org/@ant-design/icons-angular/download/@ant-design/icons-angular-10.0.1.tgz?cache=0&sync_timestamp=1601105390624&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40ant-design%2Ficons-angular%2Fdownload%2F%40ant-design%2Ficons-angular-10.0.1.tgz",
"integrity": "sha1-0Rc/YpU1wegqBSiP2VuOBbwnLWE=",
"version": "10.2.0",
"resolved": "https://registry.npm.taobao.org/@ant-design/icons-angular/download/@ant-design/icons-angular-10.2.0.tgz",
"integrity": "sha1-zxOmozsUFZNLczG1jMOPoGU/o3Q=",
"requires": {
"@ant-design/colors": "^3.1.0",
"@ant-design/colors": "^5.0.0",
"tslib": "^2.0.0"
},
"dependencies": {
"tslib": {
"version": "2.0.2",
"resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.2.tgz?cache=0&sync_timestamp=1601998793819&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.2.tgz",
"integrity": "sha1-RiKVYxGF20SyGx6jYVtjzRwDgkI="
"version": "2.0.3",
"resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.3.tgz?cache=0&sync_timestamp=1602286632196&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.3.tgz",
"integrity": "sha1-jgdBrEX8DCJuWKF7/D5kubxsphw="
}
}
},
@ -2431,6 +2431,11 @@
"to-fast-properties": "^2.0.0"
}
},
"@ctrl/tinycolor": {
"version": "3.2.1",
"resolved": "https://registry.npm.taobao.org/@ctrl/tinycolor/download/@ctrl/tinycolor-3.2.1.tgz",
"integrity": "sha1-KaWoa8+qQVVchIOihylOUgzCjNY="
},
"@firebase/analytics": {
"version": "0.2.13",
"resolved": "https://registry.npm.taobao.org/@firebase/analytics/download/@firebase/analytics-0.2.13.tgz",
@ -6555,6 +6560,11 @@
"assert-plus": "^1.0.0"
}
},
"date-fns": {
"version": "2.16.1",
"resolved": "https://registry.npm.taobao.org/date-fns/download/date-fns-2.16.1.tgz",
"integrity": "sha1-BXdXksPzMx2oEq8lPhqTWFHTg0s="
},
"date-format": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/date-format/download/date-format-2.1.0.tgz?cache=0&sync_timestamp=1572559173297&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdate-format%2Fdownload%2Fdate-format-2.1.0.tgz",
@ -11415,11 +11425,11 @@
"dev": true
},
"ng-zorro-antd": {
"version": "10.0.0",
"resolved": "https://registry.npm.taobao.org/ng-zorro-antd/download/ng-zorro-antd-10.0.0.tgz?cache=0&sync_timestamp=1601298489342&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fng-zorro-antd%2Fdownload%2Fng-zorro-antd-10.0.0.tgz",
"integrity": "sha1-tLw3rZwAqcWbFvN6ccf+cadXOA4=",
"version": "10.2.0",
"resolved": "https://registry.npm.taobao.org/ng-zorro-antd/download/ng-zorro-antd-10.2.0.tgz",
"integrity": "sha1-pjJHBZwqdEODhz0M9m8nQfA6wg8=",
"requires": {
"@angular/cdk": "^10.0.0",
"@angular/cdk": "^10.2.4",
"@ant-design/icons-angular": "^10.0.0",
"date-fns": "^2.10.0",
"resize-observer-polyfill": "^1.5.1",
@ -11427,29 +11437,24 @@
},
"dependencies": {
"@angular/cdk": {
"version": "10.2.4",
"resolved": "https://registry.npm.taobao.org/@angular/cdk/download/@angular/cdk-10.2.4.tgz?cache=0&sync_timestamp=1601937314503&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40angular%2Fcdk%2Fdownload%2F%40angular%2Fcdk-10.2.4.tgz",
"integrity": "sha1-ZWCVZIrwBef6AsTMaIZb5L9Z/BA=",
"version": "10.2.7",
"resolved": "https://registry.npm.taobao.org/@angular/cdk/download/@angular/cdk-10.2.7.tgz",
"integrity": "sha1-D/guuRsmU+omkJxXpGDUWTtE8YY=",
"requires": {
"parse5": "^5.0.0",
"tslib": "^2.0.0"
}
},
"date-fns": {
"version": "2.16.1",
"resolved": "https://registry.npm.taobao.org/date-fns/download/date-fns-2.16.1.tgz?cache=0&sync_timestamp=1598884189690&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdate-fns%2Fdownload%2Fdate-fns-2.16.1.tgz",
"integrity": "sha1-BXdXksPzMx2oEq8lPhqTWFHTg0s="
},
"parse5": {
"version": "5.1.1",
"resolved": "https://registry.npm.taobao.org/parse5/download/parse5-5.1.1.tgz",
"resolved": "https://registry.npm.taobao.org/parse5/download/parse5-5.1.1.tgz?cache=0&sync_timestamp=1595849319979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fparse5%2Fdownload%2Fparse5-5.1.1.tgz",
"integrity": "sha1-9o5OW6GFKsLK3AD0VV//bCq7YXg=",
"optional": true
},
"tslib": {
"version": "2.0.2",
"resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.2.tgz?cache=0&sync_timestamp=1601998793819&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.2.tgz",
"integrity": "sha1-RiKVYxGF20SyGx6jYVtjzRwDgkI="
"version": "2.0.3",
"resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.3.tgz?cache=0&sync_timestamp=1602286632196&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.3.tgz",
"integrity": "sha1-jgdBrEX8DCJuWKF7/D5kubxsphw="
}
}
},
@ -15271,11 +15276,6 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
"tinycolor2": {
"version": "1.4.2",
"resolved": "https://registry.npm.taobao.org/tinycolor2/download/tinycolor2-1.4.2.tgz?cache=0&sync_timestamp=1601056446986&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftinycolor2%2Fdownload%2Ftinycolor2-1.4.2.tgz",
"integrity": "sha1-P2pNEHGtB2dtf6Ry4frECnGdiAM="
},
"tinyqueue": {
"version": "1.2.3",
"resolved": "https://registry.npm.taobao.org/tinyqueue/download/tinyqueue-1.2.3.tgz",
@ -16031,7 +16031,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -16074,7 +16075,8 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
@ -16085,7 +16087,8 @@
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -16202,7 +16205,8 @@
"inherits": {
"version": "2.0.4",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -16214,6 +16218,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -16243,6 +16248,7 @@
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -16261,6 +16267,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -16363,6 +16370,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -16448,7 +16456,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -16484,6 +16493,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -16503,6 +16513,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -16546,12 +16557,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@ -16989,7 +17002,8 @@
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -17106,7 +17120,8 @@
"inherits": {
"version": "2.0.4",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -17148,6 +17163,7 @@
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -17166,6 +17182,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -17268,6 +17285,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -17353,7 +17371,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -17389,6 +17408,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -17452,12 +17472,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},

2
package.json

@ -28,7 +28,7 @@
"e-ngx-cesium": "^6.3.2",
"echarts": "^4.6.0",
"firebase": "^7.6.2",
"ng-zorro-antd": "^10.0.0",
"ng-zorro-antd": "^10.2.0",
"ng2-file-upload": "^1.4.0",
"ngx-echarts": "^4.2.2",
"ngx-perfect-scrollbar": "^8.0.0",

2
src/app/_theming.scss

@ -705,7 +705,7 @@ $mat-blue: (
200: #90caf9,
300: #64b5f6,
400: #42a5f5,
500: #2196f3,
500: #07CDCF,
600: #1e88e5,
700: #1976d2,
800: #1565c0,

11
src/app/examiner/create-test-score/addPlan.html

@ -0,0 +1,11 @@
<div class="box">
<div style="font-size: 18px;">
请选择预案
</div>
<div class="btnbox">
<div (click)="selectType(1)">已存在的预案</div>
<div (click)="selectType(2)">自定义预案</div>
</div>
<span style="position: absolute;
right: 0;top: 0;cursor: pointer;" (click)="close()"><mat-icon>clear</mat-icon></span>
</div>

29
src/app/examiner/create-test-score/addPlan.scss

@ -0,0 +1,29 @@
.box{
position: relative;
div{
width: 100%;
text-align: center;
font-size: 16px;
}
.btnbox{
display: flex;
justify-content: center;
margin-top: 22px;
div{
margin: 0 10px;
width: 120px;
height: 36px;
line-height: 36px;
cursor: pointer;
opacity: 1;
border-radius: 8px;
color: #fff;
}
div:nth-child(1){
background: #07CDCF;
}
div:nth-child(2){
background: #FF8678;
}
}
}

77
src/app/examiner/create-test-score/addPlanTwo.html

@ -0,0 +1,77 @@
<div class="box">
<div *ngIf="planType">
<div class="title">
添加预案
</div>
<div class="tablebox">
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<!-- Checkbox Column -->
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<!-- <mat-checkbox (change)="$event ? masterToggle() : null"
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()">
</mat-checkbox> -->
选择
</th>
<td mat-cell *matCellDef="let row">
<mat-checkbox color="primary" (click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)">
</mat-checkbox>
</td>
</ng-container>
<!-- name Column -->
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> 预案名称 </th>
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
</ng-container>
<!-- people Column -->
<ng-container matColumnDef="people">
<th mat-header-cell *matHeaderCellDef> 添加人 </th>
<td mat-cell *matCellDef="let element"> {{element.people}} </td>
</ng-container>
<!-- time Column -->
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef> 添加时间 </th>
<td mat-cell *matCellDef="let element"> {{element.time}} </td>
</ng-container>
<!-- level Column -->
<ng-container matColumnDef="level">
<th mat-header-cell *matHeaderCellDef> 编制级别 </th>
<td mat-cell *matCellDef="let element"> {{element.level}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"
(click)="selection.toggle(row)">
</tr>
</table>
</div>
</div>
<div *ngIf="!planType">
<div class="title">
创建自定义预案
</div>
<div class="customPlanName">
<p style="font-size: 14px;margin: 5px 0;">
预案名称
</p>
<div class="input">
<input type="text" placeholder="请输入自定义名称">
</div>
</div>
</div>
<div class="btnbox">
<div class="btn">
确定
</div>
<div class="btn" (click)="close()">
取消
</div>
</div>
</div>

49
src/app/examiner/create-test-score/addPlanTwo.scss

@ -0,0 +1,49 @@
.box{
box-sizing: border-box;
padding: 15px;
.title{
width: 100%;
text-align: center;
height: 43px;
line-height: 43px;
font-size: 16px;
}
.tablebox{
width: 600px;
table{
width: 100%;
}
}
.customPlanName{
input{
width: 260px;
border: 0;
background-color: #F2F5F6;
box-sizing: border-box;
padding: 4px;
}
}
.btnbox{
display: flex;
justify-content: center;
margin-top: 15px;
.btn{
width: 100px;
height: 36px;
line-height: 36px;
text-align: center;
opacity: 1;
border-radius: 8px;
margin: 0 10px;
cursor: pointer;
}
.btn:nth-child(1){
background: #07CDCF;
color: #fff;
}
.btn:nth-child(2){
background:#F2F5F6;
}
}
}

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

@ -10,7 +10,7 @@
单位列表
</div>
<div>
总分: <span class="colorspan">120</span>
总分: <span class="colorspan">{{examScore}}</span>
</div>
</div>
<div class="unitList">
@ -19,13 +19,9 @@
<td>单位名称</td>
<td>总分</td>
</tr>
<tr>
<td>富力华大酒店</td>
<td class="colorspan">80</td>
</tr>
<tr>
<td>富力华大酒店</td>
<td class="colorspan">80</td>
<tr *ngFor="let item of unitDatas">
<td>{{item.name}}</td>
<td class="colorspan">{{item.score}}</td>
</tr>
</table>
</div>
@ -41,26 +37,118 @@
</div>
<div class="maincontantbox">
<div class="basicinfodiv" *ngIf="selectedTab == 1">
<div>
<div *ngFor="let unit of unitDatas;let key = index" style="margin-bottom: 30px;">
<!-- 选择的单位名称 -->
<p class="colorspan" style="margin: 0 0 12px 6px;">宇宙无敌酒店</p>
<p class="colorspan" style="margin: 0 0 12px 6px;">{{unit.name}}</p>
<!-- 基本信息 -->
<mat-accordion>
<mat-expansion-panel style="box-shadow: 0 0 black;">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
基本信息<span class="colorspan" style="margin-left: 20px;">30分</span>
基本信息
<span class="colorspan" style="margin-left: 20px;">{{unit.basicInfoScore ? unit.basicInfoScore : 0}}分</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px 20px;">
xxxxx
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.basicInfoNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label title="{{node.title}}" class="overflowText textNode">{{node.title}}</label>
<div class="scoreDiv" *ngIf="node.origin.zIndex == '0'">
<span class="colorspan lookitem">查看</span>
<span class="item">单项<input type="number" [(ngModel)]="node.origin.itemScore" (input)="itemScore(node,key)"></span>
<span class="item">总共<input type="number" [(ngModel)]="node.origin.sumScore" (input)="sumScore(node,key)"></span>
</div>
</div>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 四周毗邻 -->
<mat-accordion>
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
四周毗邻
<span class="colorspan" style="margin-left: 20px;">{{unit.aroundScore ? unit.aroundScore : 0}}分</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.aroundNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label title="{{node.title}}" class="overflowText textNode">{{node.title}}</label>
<div class="scoreDiv" *ngIf="node.origin.zIndex == '0'">
<span class="colorspan lookitem">查看</span>
<span class="item">单项<input type="number" [(ngModel)]="node.origin.itemScore" (input)="itemScore(node,key)"></span>
<span class="item">总共<input type="number" [(ngModel)]="node.origin.sumScore" (input)="sumScore(node,key)"></span>
</div>
</div>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<div class="fightdeploydiv" *ngIf="selectedTab == 2">
作战部署
<div class="addPlan" (click)="addPlan()">
<mat-icon style="vertical-align: text-top">add_circle_outline</mat-icon>添加预案
</div>
<div class="planList">
<table>
<tr >
<td>预案名称</td>
<td>添加人</td>
<td>修改时间</td>
<td>是否公开</td>
<td>编制级别</td>
<td>设置分数</td>
<td>操作</td>
</tr>
<tr *ngFor="let item of planDatas">
<td>{{item.name}}</td>
<td>{{item.or}}</td>
<td>{{item.time}}</td>
<td>{{item.isOpen}}</td>
<td>{{item.level}}</td>
<td>
<input (input)="planItemScore(item)" type="number" [(ngModel)]="item.score">
</td>
<td>
<span style="color: #07CDCF;">编辑</span>
<span style="color: #FF8678;">删除</span>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>

64
src/app/examiner/create-test-score/create-test-score.component.scss

@ -79,7 +79,7 @@ table { text-align: center; border-collapse: collapse; padding:2px;}
line-height: 46px;
width: 100px;
text-align: center;
color: #1E2323;
color: #788080;
border-radius: 0;
border-top: 2px solid #fff;
cursor: pointer;
@ -94,9 +94,69 @@ table { text-align: center; border-collapse: collapse; padding:2px;}
}
}
.maincontantbox{
flex: 1;
flex: 0px;
overflow-y: auto;
padding: 18px;
.basicinfodiv{
.treeNodeTemplate{
.scoreDiv{
display: inline-block;
input{
text-align: center;
width: 40px;
margin: 0 3px;
}
.lookitem{
margin: 0 20px;
}
.item{
cursor: default;
margin: 0 10px;
}
}
}
}
.fightdeploydiv{
.addPlan{
width: 130px;
height: 36px;
line-height: 36px;
background: #07CDCF;
opacity: 1;
border-radius: 8px;
color: #fff;
text-align: center;
cursor: pointer;
font-size: 16px;
margin-bottom: 15px;
}
.planList{
table{
width: 100%;
tr{
height: 42px;
font-size: 15px;
td{
input{
width: 62px;
height: 26px;
background: #F2F5F6;
border: none;
border-radius: 5px;
text-align: center;
}
span{
margin: 0 5px;
cursor: pointer;
}
}
}
tr:nth-child(1){
background: #F5FDFE;
}
}
}
}
}
}
}

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

@ -1,5 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { SelectionModel } from '@angular/cdk/collections';
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatTableDataSource } from '@angular/material/table';
import { NzFormatEmitEvent } from 'ng-zorro-antd/tree';
@Component({
selector: 'app-create-test-score',
templateUrl: './create-test-score.component.html',
@ -7,7 +10,7 @@ import { Component, OnInit } from '@angular/core';
})
export class CreateTestScoreComponent implements OnInit {
constructor() { }
constructor(public dialog: MatDialog) { }
selectedTab:number = 1 //选中的选项卡
selectTab(index){
this.selectedTab = index
@ -15,4 +18,249 @@ export class CreateTestScoreComponent implements OnInit {
ngOnInit(): void {
}
//模拟预案数据
planDatas:any = [
{name:'5楼电路故障灾情扑救',or:'上海总队',time:'2020-09-24',isOpen:'未公开',level:'总队',scroe:0},
{name:'6楼电路故障灾情扑救',or:'上海总队',time:'2020-09-24',isOpen:'未公开',level:'总队',scroe:0},
{name:'7楼电路故障灾情扑救',or:'上海总队',time:'2020-09-24',isOpen:'未公开',level:'总队',scroe:0}
]
defaultCheckedKeys = []; //指定选中复选框的树节点 key值
defaultExpandedKeys = []; //展开指定的树节点 key值
defaultSelectedKeys = []; //指定选中的树节点 key值
examScore:any = 0//整个试卷的总分
//模拟单位数据
unitDatas:any = [
{name:'富丽华大酒店1',score:0,basicInfoScore:0,basicInfoNodes : [
{
title: '单位信息',
key: '0-0',
expanded: true,
zIndex : '0',
itemScore: 0,
sumScore: 0,
children: [
{title: '统一社会信用代码',key: '1',isLeaf:true},
{title: '单位类型',key: '2',isLeaf:true},
{title: '联系人',key: '3',isLeaf:true},
{title: '联系电话',key: '4',isLeaf:true},
{title: '辖区中队',key: '5',isLeaf:true},
{title: '单位地址',key: '6',isLeaf:true}
]
},
{
title: '建筑信息',
key: '0-1',
expanded: true,
zIndex : '0',
itemScore: 0,
sumScore: 0,
children: [
{ title: '面积', key: '0-1-0-0',isLeaf:true},
{ title: '高度', key: '0-1-0-1',isLeaf:true},
{ title: '层数', key: '0-1-0-2',isLeaf:true}
]
},
],aroundScore:0,aroundNodes :[
{
title: '单位四周毗邻',
key: '11',
expanded: true,
zIndex : '0',
itemScore: 0,
sumScore: 0,
children: [
{title: '东方向',key: '55',isLeaf:true},
]
},
{
title: '建筑四周毗邻',
key: '22',
expanded: true,
zIndex : '0',
itemScore: 0,
sumScore: 0,
children: [
{title: '东方向',key: '55',isLeaf:true},
]
},
]},
{name:'富丽华大酒店2',score:0,basicInfoScore:0}
]
calculateScore(key){//计算分数
//key代表第几个建筑
//计算当前建筑基本信息分数
var basicInfoScore = 0
this.unitDatas[key].basicInfoNodes.forEach(element => {
basicInfoScore += Number(element.sumScore)
})
this.unitDatas[key].basicInfoScore = basicInfoScore
//计算当前建筑四周毗邻分数
var aroundScore = 0
this.unitDatas[key].aroundNodes.forEach(element => {
aroundScore += Number(element.sumScore)
})
this.unitDatas[key].aroundScore = aroundScore
//计算整个单位的总分
var unitScore = 0
this.unitDatas[key].score = basicInfoScore + aroundScore + 0
//计算整个试卷的总分
let examScore = 0
this.unitDatas.forEach(element => {
examScore += Number(element.score)
})
this.examScore = examScore
}
//tree的选择事件
nzEvent(event: NzFormatEmitEvent,key): void {
if(event.node.level == 0){//如果点击第一层
let itemTrue = []
event.node.origin.children.forEach(item => {
if(item.checked){
itemTrue.push(item)
}
})
event.node.origin.sumScore = event.node.origin.itemScore * itemTrue.length
this.calculateScore(key)//更新标题栏分数
}else{
let itemTrue = []
event.node.parentNode.origin.children.forEach(item => {
if(item.checked){
itemTrue.push(item)
}
})
event.node.parentNode.origin.sumScore = event.node.parentNode.origin.itemScore * itemTrue.length
this.calculateScore(key)//更新标题栏分数
}
}
//每项分数动态计算
itemScore(node,key){
let itemTrue = []
node.origin.children.forEach(item => {
if(item.checked){
itemTrue.push(item)
}
})
node.origin.sumScore = node.origin.itemScore * itemTrue.length
this.calculateScore(key)//更新标题栏分数
}
//总分数动态计算
sumScore(node,key){
//key代表第几个建筑
let itemTrue = []
node.origin.children.forEach(item => {
if(item.checked){
itemTrue.push(item)
}
})
node.origin.itemScore = node.origin.sumScore / itemTrue.length
this.calculateScore(key)//更新标题栏分数
}
//添加预案
addPlan(){
const dialogRef = this.dialog.open(AddPlanDialog, {
width: '380px',
height: '136px',
data: {}
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
});
}
//每条预案分数增加在试卷分数
planItemScore(item){
this.examScore += item.score
}
}
//添加预案1
@Component({
selector: 'addplan-dialog',
templateUrl: 'addPlan.html',
styleUrls: ['addPlan.scss']
})
export class AddPlanDialog {
constructor(public dialog: MatDialog,public dialogRef: MatDialogRef<AddPlanDialog>,@Inject(MAT_DIALOG_DATA) public data: any) {}
onNoClick(): void {
this.dialogRef.close();
}
close(){
this.dialogRef.close();
}
//选择想要添加的预案类型 (已存在或者自定义)
selectType(type){
const dialogRef = this.dialog.open(AddPlanTwoDialog, {
id:'addPlanTwo',
data: {type}
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
});
}
}
const ELEMENT_DATA: any = [
{id: 1, name: '五楼电梯故障', people:'上海总队',time:'2020-06-15',level:'总队'},
{id: 2, name: '故障搜救', people:'超级管理员',time:'2020-06-15',level:'总队'},
{id: 3, name: '故障搜救', people:'超级管理员',time:'2020-06-15',level:'总队'},
{id: 4, name: '五楼电梯故障', people:'上海总队',time:'2020-06-15',level:'总队'},
];
//添加预案2
@Component({
selector: 'addplantwo-dialog',
templateUrl: 'addPlanTwo.html',
styleUrls: ['addPlanTwo.scss']
})
export class AddPlanTwoDialog {
constructor(public dialog: MatDialog,public dialogRef: MatDialogRef<AddPlanTwoDialog>,@Inject(MAT_DIALOG_DATA) public data: any) {}
planType:any = this.data.type == 1 ? true : false//显示的预案类型
displayedColumns: string[] = ['select', 'name', 'people', 'time', 'level'];
dataSource = new MatTableDataSource<any>(ELEMENT_DATA);
selection = new SelectionModel<any>(true, []);
isAllSelected() {
const numSelected = this.selection.selected.length;
const numRows = this.dataSource.data.length;
return numSelected === numRows;
}
masterToggle() {
this.isAllSelected() ?
this.selection.clear() :
this.dataSource.data.forEach(row => this.selection.select(row));
}
ngOnInit(): void {
}
onNoClick(): void {
this.dialogRef.close();
}
close(){
this.dialogRef.close();
}
}

11
src/app/examiner/examiner.module.ts

@ -47,14 +47,16 @@ 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 { ExaminerIndexComponent } from './examiner-index/examiner-index.component';
import { CreateTestScoreComponent } from './create-test-score/create-test-score.component';
import { AddPlanDialog, AddPlanTwoDialog, CreateTestScoreComponent } 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';
@NgModule({
declarations: [CreateTestScoreComponent],
declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog],
imports: [
CommonModule,
examinerRoutingModule,
@ -102,7 +104,8 @@ import { NavigationModule } from '../navigation/navigation.module';
ScrollingModule,
ReactiveFormsModule,
FormsModule,
NavigationModule
NavigationModule,
NzTreeModule
],
providers: [ { provide: MatPaginatorIntl, useValue: myPaginator() } ]
})

477
src/assets/css/ngZorroTree.css

@ -0,0 +1,477 @@
.ant-tree-checkbox,
.ant-tree-checkbox-wrapper {
margin: 0;
padding: 0;
list-style: none;
font-feature-settings: 'tnum';
font-size: 14px
}
@keyframes antCheckboxEffect {
0% {
transform: scale(1);
opacity: .5
}
100% {
transform: scale(1.6);
opacity: 0
}
}
.ant-tree.ant-tree-directory .ant-tree-treenode {
position: relative
}
.ant-tree.ant-tree-directory .ant-tree-treenode::before {
position: absolute;
top: 0;
right: 0;
bottom: 4px;
left: 0;
transition: background-color .3s;
content: '';
pointer-events: none
}
.ant-tree.ant-tree-directory .ant-tree-treenode:hover::before {
background: #f5f5f5
}
.ant-tree.ant-tree-directory .ant-tree-treenode>* {
z-index: 1
}
.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-switcher {
transition: color .3s
}
.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper {
border-radius: 0;
user-select: none
}
.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper:hover {
background: 0 0
}
.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper.ant-tree-node-selected {
color: #fff;
background: 0 0
}
.ant-tree.ant-tree-directory .ant-tree-treenode-selected::before,
.ant-tree.ant-tree-directory .ant-tree-treenode-selected:hover::before {
background: #07CDCF
}
.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-switcher {
color: #fff
}
.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-node-content-wrapper {
color: #fff;
background: 0 0
}
.ant-tree-checkbox {
box-sizing: border-box;
color: rgba(0, 0, 0, .65);
font-variant: tabular-nums;
position: relative;
top: -.09em;
display: inline-block;
line-height: 1;
white-space: nowrap;
vertical-align: middle;
outline: 0;
cursor: pointer
}
.ant-tree-checkbox-input:focus+.ant-tree-checkbox-inner,
.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-inner,
.ant-tree-checkbox:hover .ant-tree-checkbox-inner {
border-color: #07CDCF
}
.ant-tree-checkbox-checked::after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 1px solid #07CDCF;
border-radius: 2px;
visibility: hidden;
animation: antCheckboxEffect .36s ease-in-out;
animation-fill-mode: backwards;
content: ''
}
.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox::after,
.ant-tree-checkbox:hover::after {
visibility: visible
}
.ant-tree-checkbox-inner {
position: relative;
top: 0;
left: 0;
display: block;
width: 16px;
height: 16px;
direction: ltr;
background-color: #fff;
border: 1px solid #d9d9d9;
border-radius: 2px;
border-collapse: separate;
transition: all .3s
}
.ant-tree-checkbox-inner::after {
position: absolute;
top: 50%;
left: 20%;
display: table;
width: 5.71px;
height: 9.14px;
border: 2px solid #fff;
border-top: 0;
border-left: 0;
transform: rotate(45deg) scale(0) translate(-50%, -50%);
opacity: 0;
transition: all .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s;
content: ' '
}
.ant-tree-checkbox-input {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1;
width: 100%;
height: 100%;
cursor: pointer;
opacity: 0
}
.ant-tree-checkbox-disabled,
.ant-tree-checkbox-disabled .ant-tree-checkbox-input,
.ant-tree-checkbox-disabled+span {
cursor: not-allowed
}
.ant-tree-checkbox-checked .ant-tree-checkbox-inner::after {
position: absolute;
display: table;
border: 2px solid #fff;
border-top: 0;
border-left: 0;
transform: rotate(45deg) scale(1) translate(-50%, -50%);
opacity: 1;
transition: all .2s cubic-bezier(.12, .4, .29, 1.46) .1s;
content: ' '
}
.ant-tree-checkbox-checked .ant-tree-checkbox-inner {
background-color: #07CDCF;
border-color: #07CDCF
}
.ant-tree-checkbox-disabled.ant-tree-checkbox-checked .ant-tree-checkbox-inner::after {
border-color: rgba(0, 0, 0, .25);
animation-name: none
}
/* .ant-tree-checkbox-disabled .ant-tree-checkbox-inner {
background-color: #f5f5f5;
border-color: #d9d9d9 !important
} */
.ant-tree-checkbox-disabled .ant-tree-checkbox-inner::after {
border-color: #f5f5f5;
border-collapse: separate;
animation-name: none
}
.ant-tree-checkbox-disabled+span {
color: rgba(0, 0, 0, .25)
}
.ant-tree-checkbox-disabled:hover::after,
.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-disabled::after {
visibility: hidden
}
.ant-tree-checkbox-wrapper {
box-sizing: border-box;
color: rgba(0, 0, 0, .65);
font-variant: tabular-nums;
display: inline-block;
line-height: unset;
cursor: pointer
}
.ant-tree-checkbox-wrapper.ant-tree-checkbox-wrapper-disabled {
cursor: not-allowed
}
.ant-tree-checkbox-wrapper+.ant-tree-checkbox-wrapper {
margin-left: 8px
}
.ant-tree-checkbox+span {
padding-right: 8px;
padding-left: 8px
}
.ant-tree,
.ant-tree-checkbox-group {
box-sizing: border-box;
padding: 0;
color: rgba(0, 0, 0, .65);
font-variant: tabular-nums;
line-height: 1.5715;
list-style: none;
font-feature-settings: 'tnum'
}
.ant-tree-checkbox-group {
margin: 0;
font-size: 14px;
display: inline-block
}
.ant-tree-checkbox-group-item {
display: inline-block;
margin-right: 8px
}
.ant-tree-checkbox-group-item:last-child {
margin-right: 0
}
.ant-tree-checkbox-group-item+.ant-tree-checkbox-group-item {
margin-left: 0
}
.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner {
background-color: #fff;
border-color: #d9d9d9
}
.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner::after {
top: 50%;
left: 50%;
width: 8px;
height: 8px;
background-color: #07CDCF;
border: 0;
transform: translate(-50%, -50%) scale(1);
opacity: 1;
content: ' '
}
.ant-tree-checkbox-indeterminate.ant-tree-checkbox-disabled .ant-tree-checkbox-inner::after {
background-color: rgba(0, 0, 0, .25);
border-color: rgba(0, 0, 0, .25)
}
.ant-tree {
margin: 0;
font-size: 14px;
background: #fff;
border-radius: 2px;
transition: background-color .3s
}
.ant-tree-focused:not(:hover):not(.ant-tree-active-focused) {
background: #e6f7ff
}
.ant-tree-list-holder-inner {
align-items: flex-start
}
.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner {
align-items: stretch
}
.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper {
flex: auto
}
.ant-tree .ant-tree-treenode {
display: flex;
align-items: flex-start;
padding: 0;
outline: 0
}
.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper {
color: rgba(0, 0, 0, .25);
cursor: not-allowed
}
.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper:hover {
background: 0 0
}
.ant-tree .ant-tree-treenode-active .ant-tree-node-content-wrapper {
background: #f5f5f5
}
.ant-tree-indent {
align-self: stretch;
white-space: nowrap;
user-select: none
}
.ant-tree-indent-unit {
display: inline-block;
width: 24px
}
.ant-tree .ant-tree-switcher {
flex: none;
width: 24px;
height: 35px;
margin: 0;
line-height: 22px;
font-size: 18px;
text-align: center;
cursor: pointer
}
.ant-tree .ant-tree-switcher .ant-select-tree-switcher-icon,
.ant-tree .ant-tree-switcher .ant-tree-switcher-icon {
font-size: 10px;
display: inline-block;
font-weight: 700
}
.ant-tree .ant-tree-switcher .ant-select-tree-switcher-icon svg,
.ant-tree .ant-tree-switcher .ant-tree-switcher-icon svg {
transition: transform .3s
}
.ant-tree .ant-tree-switcher-noop {
cursor: default
}
.ant-tree .ant-tree-switcher_close .ant-tree-switcher-icon svg {
transform: rotate(-90deg)
}
.ant-tree .ant-tree-checkbox {
top: initial;
margin: 4px 8px 0 0
}
.ant-tree .ant-tree-node-content-wrapper {
min-height: 24px;
margin: 0;
padding: 0;
color: inherit;
line-height: 24px;
background: 0 0;
border-radius: 2px;
cursor: pointer;
transition: all .3s
}
.ant-tree .ant-tree-node-content-wrapper:hover {
background-color: #f5f5f5
}
/* .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
background-color: #bae7ff
} */
.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle {
display: inline-block;
width: 24px;
height: 24px;
line-height: 24px;
text-align: center;
vertical-align: top
}
.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle:empty,
.ant-tree .ant-tree-treenode-loading .ant-tree-iconEle,
.ant-tree-show-line .ant-tree-indent-unit-end::before,
.ant-tree-show-line .ant-tree-treenode-motion:not(.ant-motion-collapse-leave):not(.ant-motion-collapse-appear-active) .ant-tree-indent-unit::before {
display: none
}
.ant-tree-node-content-wrapper[draggable=true] {
overflow: hidden;
width: 100%;
line-height: 35px;
/* border-top: 2px transparent solid;
border-bottom: 2px transparent solid; */
user-select: none
}
.ant-tree .ant-tree-treenode.drag-over>[draggable] {
color: #fff;
background-color: #07CDCF;
opacity: .8
}
.ant-tree .ant-tree-treenode.drag-over-gap-top>[draggable] {
border-top-color: #07CDCF
}
.ant-tree .ant-tree-treenode.drag-over-gap-bottom>[draggable] {
border-bottom-color: #07CDCF
}
.ant-tree-show-line .ant-tree-indent-unit {
position: relative;
height: 100%
}
.ant-tree-show-line .ant-tree-indent-unit::before {
position: absolute;
top: calc(100% - 4px);
right: -12px;
bottom: -28px;
border-right: 1px solid #d9d9d9;
content: ''
}
.ant-tree-show-line .ant-tree-switcher {
z-index: 1;
background: #fff
}
.ant-tree .ant-tree-treenode-rtl,
.ant-tree-rtl {
direction: rtl
}
.ant-tree-rtl.ant-tree .ant-tree-switcher_close .ant-tree-switcher-icon svg {
transform: rotate(90deg)
}
.ant-tree-rtl.ant-tree-show-line .ant-tree-indent-unit::before {
right: auto;
left: -12px;
border-right: none;
border-left: 1px solid #d9d9d9
}
.font-highlight {
color: #ff4d4f
}
.ant-tree-child-tree {
overflow: hidden
}
nz-tree {
display: block
}

13
src/styles.scss

@ -1,6 +1,7 @@
@import './app/theme.scss';
@import "~ng-zorro-antd/date-picker/style/index.min.css"; /* 引入组件样式 */
// @import "~ng-zorro-antd/date-picker/style/index.min.css"; /* 引入组件样式 */
@import "./assets/css/ngZorroTree.css"; /* 引入组件样式 */
html,body{
width: 100%;
height: 100%;
@ -93,4 +94,12 @@ table td.mat-footer-cell:last-of-type{
.mat-expansion-indicator::after {
color: #333333;
}
}
}
//弹出框样式取消padding
#addPlanTwo{
padding: 0;
.mat-elevation-z8{
box-shadow:none
}
}

Loading…
Cancel
Save