From 5ff66ad13b99eff1049094ad7ab705938e3093e0 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 11 Dec 2020 10:09:19 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=96=B0=E5=A2=9E=E8=AF=95?= =?UTF-8?q?=E5=8D=B7=E9=A1=B5=E9=9D=A2ui=E5=9F=BA=E6=9C=AC=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 110 ++-- package.json | 2 +- src/app/_theming.scss | 2 +- .../examiner/create-test-score/addPlan.html | 11 + .../examiner/create-test-score/addPlan.scss | 29 ++ .../create-test-score/addPlanTwo.html | 77 +++ .../create-test-score/addPlanTwo.scss | 49 ++ .../create-test-score.component.html | 118 ++++- .../create-test-score.component.scss | 64 ++- .../create-test-score.component.ts | 254 +++++++++- src/app/examiner/examiner.module.ts | 9 +- src/assets/css/ngZorroTree.css | 477 ++++++++++++++++++ src/styles.scss | 13 +- 13 files changed, 1143 insertions(+), 72 deletions(-) create mode 100644 src/app/examiner/create-test-score/addPlan.html create mode 100644 src/app/examiner/create-test-score/addPlan.scss create mode 100644 src/app/examiner/create-test-score/addPlanTwo.html create mode 100644 src/app/examiner/create-test-score/addPlanTwo.scss create mode 100644 src/assets/css/ngZorroTree.css diff --git a/package-lock.json b/package-lock.json index 0492bc2..fba3d06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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 } } }, diff --git a/package.json b/package.json index a5c6b81..7c23474 100644 --- a/package.json +++ b/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", diff --git a/src/app/_theming.scss b/src/app/_theming.scss index e30383b..4fba0ec 100644 --- a/src/app/_theming.scss +++ b/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, diff --git a/src/app/examiner/create-test-score/addPlan.html b/src/app/examiner/create-test-score/addPlan.html new file mode 100644 index 0000000..4773682 --- /dev/null +++ b/src/app/examiner/create-test-score/addPlan.html @@ -0,0 +1,11 @@ +
+
+ 请选择预案 +
+
+
已存在的预案
+
自定义预案
+
+ clear +
\ No newline at end of file diff --git a/src/app/examiner/create-test-score/addPlan.scss b/src/app/examiner/create-test-score/addPlan.scss new file mode 100644 index 0000000..0b40626 --- /dev/null +++ b/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; + } + } +} \ No newline at end of file diff --git a/src/app/examiner/create-test-score/addPlanTwo.html b/src/app/examiner/create-test-score/addPlanTwo.html new file mode 100644 index 0000000..39c4545 --- /dev/null +++ b/src/app/examiner/create-test-score/addPlanTwo.html @@ -0,0 +1,77 @@ +
+
+
+ 添加预案 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 选择 + + + + 预案名称 {{element.name}} 添加人 {{element.people}} 添加时间 {{element.time}} 编制级别 {{element.level}}
+
+
+
+
+ 创建自定义预案 +
+
+

+ 预案名称 +

+
+ +
+
+
+
+
+ 确定 +
+
+ 取消 +
+
+
\ No newline at end of file diff --git a/src/app/examiner/create-test-score/addPlanTwo.scss b/src/app/examiner/create-test-score/addPlanTwo.scss new file mode 100644 index 0000000..cd1d240 --- /dev/null +++ b/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; + } + } +} \ No newline at end of file diff --git a/src/app/examiner/create-test-score/create-test-score.component.html b/src/app/examiner/create-test-score/create-test-score.component.html index cc5c643..edf5de0 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.html +++ b/src/app/examiner/create-test-score/create-test-score.component.html @@ -10,7 +10,7 @@ 单位列表
- 总分: 120 + 总分: {{examScore}}
@@ -19,13 +19,9 @@ 单位名称 总分 - - 富力华大酒店 - 80 - - - 富力华大酒店 - 80 + + {{item.name}} + {{item.score}}
@@ -41,26 +37,118 @@
-
+
-

宇宙无敌酒店

+

{{unit.name}}

+ - + - 基本信息30分 + 基本信息 + {{unit.basicInfoScore ? unit.basicInfoScore : 0}}分 -
- xxxxx +
+ + + +
+ +
+ 查看 + 单项 + 总共 +
+ +
+
+
+ + + + + + + + 四周毗邻 + {{unit.aroundScore ? unit.aroundScore : 0}}分 + + + +
+ + + +
+ +
+ 查看 + 单项 + 总共 +
+ +
+
- 作战部署 +
+ add_circle_outline添加预案 +
+
+ + + + + + + + + + + + + + + + + + + +
预案名称添加人修改时间是否公开编制级别设置分数操作
{{item.name}}{{item.or}}{{item.time}}{{item.isOpen}}{{item.level}} + + + 编辑 + 删除 +
+
diff --git a/src/app/examiner/create-test-score/create-test-score.component.scss b/src/app/examiner/create-test-score/create-test-score.component.scss index bf8e027..7745752 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.scss +++ b/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; + } + } + } + } } } } diff --git a/src/app/examiner/create-test-score/create-test-score.component.ts b/src/app/examiner/create-test-score/create-test-score.component.ts index 848c829..f2fcd8f 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.ts +++ b/src/app/examiner/create-test-score/create-test-score.component.ts @@ -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,@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,@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(ELEMENT_DATA); + selection = new SelectionModel(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(); + } + } diff --git a/src/app/examiner/examiner.module.ts b/src/app/examiner/examiner.module.ts index 830b575..e00fda0 100644 --- a/src/app/examiner/examiner.module.ts +++ b/src/app/examiner/examiner.module.ts @@ -47,11 +47,11 @@ 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 { 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'; @NgModule({ - declarations: [CreateTestScoreComponent], + declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog], imports: [ CommonModule, examinerRoutingModule, @@ -99,7 +99,8 @@ import { NavigationModule } from '../navigation/navigation.module'; ScrollingModule, ReactiveFormsModule, FormsModule, - NavigationModule + NavigationModule, + NzTreeModule ], providers: [ { provide: MatPaginatorIntl, useValue: myPaginator() } ] }) diff --git a/src/assets/css/ngZorroTree.css b/src/assets/css/ngZorroTree.css new file mode 100644 index 0000000..d04cca9 --- /dev/null +++ b/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 +} \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index 7ae1033..6ba0a06 100644 --- a/src/styles.scss +++ b/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; } -} \ No newline at end of file +} +//弹出框样式取消padding +#addPlanTwo{ + padding: 0; + .mat-elevation-z8{ + box-shadow:none + } +} +