From ad5b0f728ae494442a4c726313ab01a4d7ef0851 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 11 Dec 2020 16:55:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=80=83=E9=A2=98=E5=89=A9=E4=BD=99=E7=9F=B3=E6=B2=B9=E5=8C=96?= =?UTF-8?q?=E5=B7=A5=E7=9A=84=E6=A0=91=E5=BD=A2=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 28 ++-- src/app/_theming.scss | 6 +- .../create-test-score.component.html | 8 +- .../create-test-score.component.ts | 133 +++++++++++++++--- 4 files changed, 143 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c835b1..5eccfb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10532,7 +10532,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -10741,12 +10742,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.9.0", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -10765,6 +10768,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -10953,7 +10957,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -11009,6 +11014,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -11052,12 +11058,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 } } }, @@ -16895,7 +16903,8 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.9.0", @@ -17010,7 +17019,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -17598,7 +17608,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -18079,6 +18090,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } diff --git a/src/app/_theming.scss b/src/app/_theming.scss index 4fba0ec..bcfb325 100644 --- a/src/app/_theming.scss +++ b/src/app/_theming.scss @@ -529,7 +529,7 @@ $dark-disabled-text: rgba(black, 0.38); $dark-dividers: rgba(black, 0.12); $dark-focused: rgba(black, 0.12); $light-primary-text: white; -$light-secondary-text: rgba(white, 0.7); +$light-secondary-text: rgba(black, 0.7); $light-disabled-text: rgba(white, 0.5); $light-dividers: rgba(white, 0.12); $light-focused: rgba(white, 0.12); @@ -2135,7 +2135,7 @@ $_mat-button-ripple-opacity: 0.1; // ensure that the button is readable on custom background colors. It's wrong to always assume // that those buttons are always placed inside of containers with the default background // color of the theme (e.g. themed toolbars). - color: inherit; + color: black; background: transparent; @include _mat-button-theme-property($theme, 'color', text); @@ -4190,7 +4190,7 @@ $mat-tooltip-handset-vertical-padding: // Use the primary text on the dark theme, even though the lighter one uses // a secondary, because the contrast on the light primary text is poor. color: if($is-dark-theme, $dark-primary-text, $light-secondary-text); - background: if($is-dark-theme, map-get($mat-grey, 50), #323232); + background: if($is-dark-theme, map-get($mat-grey, 50), #fff); @include _mat-theme-elevation(6, $theme); } 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 f10846f..03126f6 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 @@ -19,7 +19,7 @@ 单位名称 总分 - + {{item.name}} {{item.score}} @@ -37,7 +37,7 @@
-
+

{{unit.name}}

@@ -85,7 +85,7 @@ - +
diff --git a/src/app/examiner/create-test-score/create-test-score.component.ts b/src/app/examiner/create-test-score/create-test-score.component.ts index 1d174d9..8aef403 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,4 +1,5 @@ import { SelectionModel } from '@angular/cdk/collections'; +import { HttpClient } from '@angular/common/http'; import { Component, Inject, OnInit } from '@angular/core'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatTableDataSource } from '@angular/material/table'; @@ -10,12 +11,16 @@ import { NzFormatEmitEvent } from 'ng-zorro-antd/tree'; }) export class CreateTestScoreComponent implements OnInit { - constructor(public dialog: MatDialog) { } + constructor(public dialog: MatDialog,private http: HttpClient) { } selectedTab:number = 1 //选中的选项卡 selectTab(index){ this.selectedTab = index } ngOnInit(): void { + this.unitId.forEach(item => { + + }) + this.getUnitData() } //模拟单位数据 @@ -69,17 +74,110 @@ export class CreateTestScoreComponent implements OnInit { // {name:'富丽华大酒店2',score:0,basicInfoScore:0} ] - unitId:any = [{name:'富丽华大酒店1'}] + + //上个页面传过来的单位数据 + unitId:any = [{name:'最最最最最',id:'5fb76c42919f2b44e464016f'}, + // {name:'华南城集团有限公司',id:'5ee19fe06f91049f5e23e937'}, + // {name:'贵港油库',id:'5fa35d68f8eb762cb03c662e'} + ] + //获取单位数据 getUnitData(){ + this.unitId.forEach((element,index) => { + element.score = 0 + element.basicInfoScore = 0 + element.basicInfoItemScore = 0 + + this.http.get(`/api/Companies/${element.id}`).subscribe((data:any)=>{ + console.log('单位信息',index,data) + let unitData = { + name: '单位信息', + type:'基本信息', + expanded: false, + key:element.id + '单位信息' + index, + children:[] + } + data.usci ? unitData.children.push({ + name: '统一社会信用代码',key: element.id+'统一社会信用代码',isLeaf:true,value:data.usci + }) : null + data.buildingTypes[0].name ? unitData.children.push({ + name: '单位类型',key: element.id+'单位类型',isLeaf:true,value:data.buildingTypes[0].name + }) : null + data.contacts ? unitData.children.push({ + name: '联系人',key: element.id+'联系人',isLeaf:true,value:data.contacts + }) : null + data.phone ? unitData.children.push({ + name: '联系电话',key: element.id+'联系电话',isLeaf:true,value:data.phone + }) : null + data.organizationName ? unitData.children.push({ + name: '辖区中队',key: element.id+'辖区中队',isLeaf:true,value:data.organizationName + }) : null + data.address ? unitData.children.push({ + name: '单位地址',key: element.id+'单位地址',isLeaf:true,value:data.address + }) : null + + element.basicInfoNodes = [] + element.basicInfoNodes.push(unitData) + + var buildingsData:any + this.http.get("/api/Buildings",{ + params:{ + companyId:element.id + } + }).subscribe(async (data:any)=>{ + buildingsData = data + for (let i = 0, length = data.length; i < length; i++){ + const result = await new Promise((resolve) =>{ + this.http.get("/api/BuildingBasicInfos",{ // 循环请求当前单位建筑每一个建筑的信息保存到数组中 + params:{ + companyId :element.id, + buildingId:data[i].id, + buildingType:data[i].buildingTypes[0].id + } + }).subscribe((buildingsData:any)=>{ + console.log(1234,buildingsData) + buildingsData.name = data[i].name + buildingsData.buildingType = data[i].buildingTypes[0].name + let propertyInfosArr = [] + buildingsData[0].buildingBasicGroups[0].propertyInfos.forEach((x,key) => { + if(x.propertyValue){ + x.key = data[i].name + x.propertyName + key + x.isLeaf = true + x.name = x.propertyName + propertyInfosArr.push(x) + } + }) + element.basicInfoNodes.push({ + name: buildingsData.name, + type:'基本信息', + expanded: false, + key:buildingsData[0].id, + children:propertyInfosArr + }) + + element.basicInfoNodes = [...element.basicInfoNodes] + resolve(i) + }) + }) + } + console.log(987,this.unitId) + }) + + }) + + }) } + //获得建筑信息 + getAllBuildingsInfo(unitId){ + + + } //阻止input事件冒泡 stopPropagation($event){ - console.log($event) $event.stopPropagation() } //模拟预案数据 @@ -102,11 +200,11 @@ export class CreateTestScoreComponent implements OnInit { //key代表第几个建筑 //计算整个单位的总分 - this.unitDatas[key].score = this.unitDatas[key].basicInfoScore + this.unitDatas[key].aroundScore + this.unitId[key].score = this.unitId[key].basicInfoScore + 0 //计算整个试卷的总分 let examScore = 0 - this.unitDatas.forEach(element => { + this.unitId.forEach(element => { examScore += Number(element.score) }) this.examScore = examScore @@ -116,30 +214,31 @@ export class CreateTestScoreComponent implements OnInit { nzEvent(event: NzFormatEmitEvent,key): void { if(event.node.origin.type == '基本信息' || (event.node.parentNode && event.node.parentNode.origin.type == '基本信息')){ + let selectedNum = [] - this.unitDatas[key].basicInfoNodes.forEach(item => { + this.unitId[key].basicInfoNodes.forEach(item => { item.children.forEach(i => { i.checked ? selectedNum.push(i) : '' }) }) if(selectedNum.length != 0 ){ - this.unitDatas[key].basicInfoScore ? this.unitDatas[key].basicInfoItemScore = this.unitDatas[key].basicInfoScore / selectedNum.length : null + this.unitId[key].basicInfoScore ? this.unitId[key].basicInfoItemScore = this.unitId[key].basicInfoScore / selectedNum.length : null }else{ - this.unitDatas[key].basicInfoItemScore = 0 + this.unitId[key].basicInfoItemScore = 0 } } if(event.node.origin.type == '四周毗邻' || (event.node.parentNode && event.node.parentNode.origin.type == '四周毗邻')){ let selectedNum = [] - this.unitDatas[key].aroundNodes.forEach(item => { + this.unitId[key].aroundNodes.forEach(item => { item.children.forEach(i => { i.checked ? selectedNum.push(i) : '' }) }) console.log(7894,selectedNum) if(selectedNum.length != 0 ){ - this.unitDatas[key].aroundScore ? this.unitDatas[key].aroundItemScore = this.unitDatas[key].aroundScore / selectedNum.length : null + this.unitId[key].aroundScore ? this.unitId[key].aroundItemScore = this.unitId[key].aroundScore / selectedNum.length : null }else{ - this.unitDatas[key].aroundItemScore = 0 + this.unitId[key].aroundItemScore = 0 } } } @@ -149,29 +248,29 @@ export class CreateTestScoreComponent implements OnInit { //key代表第几个建筑 type代表哪个部分 if(type == '基本信息'){ let selectedNum = 0 - this.unitDatas[key].basicInfoNodes.forEach(item => { + this.unitId[key].basicInfoNodes.forEach(item => { item.children.forEach(i => { i.checked ? selectedNum++ : '' }) }) if(selectedNum != 0){ - this.unitDatas[key].basicInfoItemScore = this.unitDatas[key].basicInfoScore / selectedNum + this.unitId[key].basicInfoItemScore = this.unitId[key].basicInfoScore / selectedNum }else{ - this.unitDatas[key].basicInfoItemScore = 0 + this.unitId[key].basicInfoItemScore = 0 } } if(type == '四周毗邻'){ let selectedNum = 0 - this.unitDatas[key].aroundNodes.forEach(item => { + this.unitId[key].aroundNodes.forEach(item => { item.children.forEach(i => { i.checked ? selectedNum++ : '' }) }) if(selectedNum != 0){ - this.unitDatas[key].aroundItemScore = this.unitDatas[key].aroundScore / selectedNum + this.unitId[key].aroundItemScore = this.unitId[key].aroundScore / selectedNum }else{ - this.unitDatas[key].aroundItemScore = 0 + this.unitId[key].aroundItemScore = 0 } } From 84adb48f5be875a8090cca3e5763b399c1d6b4f6 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 11 Dec 2020 19:59:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E7=B1=BBtree=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-test-score.component.html | 2 +- .../create-test-score.component.ts | 103 +++++++++++++----- 2 files changed, 77 insertions(+), 28 deletions(-) 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 03126f6..78d2e7b 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 @@ -76,7 +76,7 @@
- 查看 + 查看
diff --git a/src/app/examiner/create-test-score/create-test-score.component.ts b/src/app/examiner/create-test-score/create-test-score.component.ts index 8aef403..cc63096 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 @@ -17,9 +17,7 @@ export class CreateTestScoreComponent implements OnInit { this.selectedTab = index } ngOnInit(): void { - this.unitId.forEach(item => { - - }) + console.log(12345,) this.getUnitData() } @@ -77,10 +75,14 @@ export class CreateTestScoreComponent implements OnInit { //上个页面传过来的单位数据 unitId:any = [{name:'最最最最最',id:'5fb76c42919f2b44e464016f'}, - // {name:'华南城集团有限公司',id:'5ee19fe06f91049f5e23e937'}, - // {name:'贵港油库',id:'5fa35d68f8eb762cb03c662e'} + {name:'华南城集团有限公司',id:'5ee19fe06f91049f5e23e937'}, + {name:'贵港油库',id:'5fa35d68f8eb762cb03c662e'} ] + + + + //获取单位数据 getUnitData(){ this.unitId.forEach((element,index) => { @@ -94,7 +96,7 @@ export class CreateTestScoreComponent implements OnInit { name: '单位信息', type:'基本信息', expanded: false, - key:element.id + '单位信息' + index, + key:(Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), children:[] } data.usci ? unitData.children.push({ @@ -138,25 +140,71 @@ export class CreateTestScoreComponent implements OnInit { console.log(1234,buildingsData) buildingsData.name = data[i].name buildingsData.buildingType = data[i].buildingTypes[0].name - let propertyInfosArr = [] - buildingsData[0].buildingBasicGroups[0].propertyInfos.forEach((x,key) => { - if(x.propertyValue){ - x.key = data[i].name + x.propertyName + key - x.isLeaf = true - x.name = x.propertyName - propertyInfosArr.push(x) + + buildingsData[0].buildingBasicGroups.forEach((y,m) => { + let propertyInfosArr = [] + let tabledata + if(y.type == 1){//如果是表格类 + var map = {}, + dest:any = []; + for(var i = 0; i < y.propertyInfos.length; i++){ + var ai = y.propertyInfos[i]; + if(!map[ai.propertyName]){ + dest.push({ + propertyName: ai.propertyName, + data: [ai] + }); + map[ai.propertyName] = ai; + }else{ + for(var j = 0; j < dest.length; j++){ + var dj = dest[j]; + if(dj.propertyName == ai.propertyName){ + dj.data.push(ai); + break; + } + } + } + } + //根据行数确定在循环数组中的index + dest.forEach(item => { + item.data.sort(function(a,b){ + return Number(a.tag) - Number(b.tag) + }) + }) + y.tabledata = dest + tabledata = dest + console.log('pppp',y) + y.tabledata[0].data.forEach((x,key) => { + if(x.propertyValue){ + x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) + x.isLeaf = true + x.name = x.propertyValue + propertyInfosArr.push(x) + } + }) + }else{ + y.propertyInfos.forEach((x,key) => { + if(x.propertyValue){ + x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) + x.isLeaf = true + x.name = x.propertyName + propertyInfosArr.push(x) + } + }) } + + element.basicInfoNodes.push({ + name:y.name != '基本信息' ? buildingsData.name + '-' + y.name : buildingsData.name , + type:'基本信息', + expanded: false, + key:(Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5), + children:propertyInfosArr, + tabledata:tabledata ? tabledata : null + }) + + element.basicInfoNodes = [...element.basicInfoNodes] }) - - element.basicInfoNodes.push({ - name: buildingsData.name, - type:'基本信息', - expanded: false, - key:buildingsData[0].id, - children:propertyInfosArr - }) - - element.basicInfoNodes = [...element.basicInfoNodes] + resolve(i) }) }) @@ -169,10 +217,11 @@ export class CreateTestScoreComponent implements OnInit { }) } - //获得建筑信息 - getAllBuildingsInfo(unitId){ - - + + + //查看树节点 + lookTreeNode(node){ + console.log(node.origin) } From d99029f884e8e184d2d83da699c47fad8a1e08ee Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Sat, 12 Dec 2020 09:14:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E8=80=83=E5=AE=98?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E9=9D=A2=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examiner-index.component.html | 70 +++- .../examiner-index.component.scss | 94 +++++ .../examiner-index.component.ts | 38 +- .../examiner-new-one.component.html | 39 ++ .../examiner-new-one.component.scss | 111 +++++ .../examiner-new-one.component.spec.ts | 25 ++ .../examiner-new-one.component.ts | 395 ++++++++++++++++++ src/app/examiner/examiner-routing.ts | 6 +- src/app/examiner/examiner.module.ts | 6 +- src/app/navigation/navigation.component.ts | 2 +- src/assets/images/add.png | Bin 0 -> 441 bytes 11 files changed, 777 insertions(+), 9 deletions(-) create mode 100644 src/app/examiner/examiner-new-one/examiner-new-one.component.html create mode 100644 src/app/examiner/examiner-new-one/examiner-new-one.component.scss create mode 100644 src/app/examiner/examiner-new-one/examiner-new-one.component.spec.ts create mode 100644 src/app/examiner/examiner-new-one/examiner-new-one.component.ts create mode 100644 src/assets/images/add.png diff --git a/src/app/examiner/examiner-index/examiner-index.component.html b/src/app/examiner/examiner-index/examiner-index.component.html index 1e89125..f81a5a6 100644 --- a/src/app/examiner/examiner-index/examiner-index.component.html +++ b/src/app/examiner/examiner-index/examiner-index.component.html @@ -1 +1,69 @@ -

examiner-index works!

+ +
+
+
+
+ + + + +
+
+ + +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
试卷名称考核中队开始时间结束时间考试状态操作
{{item.name}}{{item.organization}}{{item.startTime}}{{item.overTime}}{{item.testState}} + 编辑 + 详情 + 删除 +
+ + +
+ +
\ No newline at end of file diff --git a/src/app/examiner/examiner-index/examiner-index.component.scss b/src/app/examiner/examiner-index/examiner-index.component.scss index e69de29..e7510fe 100644 --- a/src/app/examiner/examiner-index/examiner-index.component.scss +++ b/src/app/examiner/examiner-index/examiner-index.component.scss @@ -0,0 +1,94 @@ +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:left; + .queryField { + margin: 0 25px; + font-size: 14px; + input { + width: 320px; + height: 44px; + line-height: 34px; + border-radius: 5px; + padding-left: 5px; + outline: none; + border: 1px solid rgb(226, 211, 211); + } + button { + border: none; + color: white; + padding: 10px 25px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; + border-radius: 8px; + outline:0 none !important; + } + } + .headerright{ + float: right; + } + } //queryBox + } + .centertable{ + width: 1632px; + margin-right: 40px; + margin-left: 40px; + background-color: #FFFFFF; + table{ + td,th{ + height: 48px; + font-size: 18px; + } + td{ + border-bottom: 1px solid #F2F5F6; + } + thead{ + background-color:#F5FDFE; + } + .green{ + color: #07CDCF; + } + .red{ + color: #FF8678; + } + } + } + + .operationSpan{ + margin: 0 10px; + .spanbtn { + font-weight: 550; + cursor: pointer; + } + .green{ color: #04ced1; } + .red{ color: #FF8678 } + .gray{ color: gray; } + } + \ No newline at end of file diff --git a/src/app/examiner/examiner-index/examiner-index.component.ts b/src/app/examiner/examiner-index/examiner-index.component.ts index 426699d..91558ff 100644 --- a/src/app/examiner/examiner-index/examiner-index.component.ts +++ b/src/app/examiner/examiner-index/examiner-index.component.ts @@ -1,4 +1,31 @@ -import { Component, OnInit } from '@angular/core'; +/* + * @Descripttion: + * @version: + * @Author: sueRimn + * @Date: 2020-12-11 09:06:03 + * @LastEditors: sueRimn + * @LastEditTime: 2020-12-11 19:38:25 + */ +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:'已结束'}, +]; @Component({ selector: 'app-examiner-index', @@ -7,9 +34,16 @@ import { Component, OnInit } from '@angular/core'; }) export class ExaminerIndexComponent implements OnInit { - constructor() { } + constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } + displayedColumns: string[] = ['name', 'organization', 'startTime', 'overTime', 'testState', 'operation']; + dataSource = ELEMENT_DATA; ngOnInit(): void { + + } + //新增考题跳转 + newExamination(){ + this.router.navigate(['/home/examiner-new-one']) } } diff --git a/src/app/examiner/examiner-new-one/examiner-new-one.component.html b/src/app/examiner/examiner-new-one/examiner-new-one.component.html new file mode 100644 index 0000000..75a1628 --- /dev/null +++ b/src/app/examiner/examiner-new-one/examiner-new-one.component.html @@ -0,0 +1,39 @@ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 包含下级 + + +
+
+ +
+
+
+
+
+
+
+
+
diff --git a/src/app/examiner/examiner-new-one/examiner-new-one.component.scss b/src/app/examiner/examiner-new-one/examiner-new-one.component.scss new file mode 100644 index 0000000..ac8deaa --- /dev/null +++ b/src/app/examiner/examiner-new-one/examiner-new-one.component.scss @@ -0,0 +1,111 @@ +table { + width: 100%; + text-align: center; + .cdk-header-cell { + text-align: center; + } + } + + .content { + width: 100%; + height: 100%; + overflow: hidden; + background: #F2F5F6; + display: flex; + .contentLeft{ + width: 1270px; + height: 850px; + margin: 20px 20px 10px 50px; + background-color: #FFFFFF; + border-radius: 16px ; + } + .contentRight{ + width: 320px; + height: 850px; + margin: 20px 20px 10px 10px; + background-color: #FFFFFF; + border-radius: 16px ; + } + } + .header { + width: 100%; + padding: 10px; + margin-bottom: 10px; + box-sizing: border-box; + .queryBox { + box-sizing: border-box; + padding: 5px 10px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items:center; + justify-content:left; + .queryField { + margin: 0 10px; + font-size: 14px; + display: flex; + flex-direction: column; + input { + width: 260px; + height: 44px; + line-height: 34px; + border-radius: 5px; + padding-left: 5px; + outline: none; + border: 1px solid rgb(226, 211, 211); + } + button { + border: none; + color: white; + padding: 5px 25px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; + border-radius: 8px; + outline:0 none !important; + } + } + .headerright{ + float: right; + } + } //queryBox + } + .centertable{ + width: 1632px; + margin-right: 40px; + margin-left: 40px; + background-color: #FFFFFF; + table{ + td,th{ + height: 48px; + font-size: 18px; + } + td{ + border-bottom: 1px solid #F2F5F6; + } + thead{ + background-color:#F5FDFE; + } + .green{ + color: #07CDCF; + } + .red{ + color: #FF8678; + } + } + } + + .operationSpan{ + margin: 0 10px; + .spanbtn { + font-weight: 550; + cursor: pointer; + } + .green{ color: #04ced1; } + .red{ color: #FF8678 } + .gray{ color: gray; } + } + \ No newline at end of file diff --git a/src/app/examiner/examiner-new-one/examiner-new-one.component.spec.ts b/src/app/examiner/examiner-new-one/examiner-new-one.component.spec.ts new file mode 100644 index 0000000..c142b26 --- /dev/null +++ b/src/app/examiner/examiner-new-one/examiner-new-one.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ExaminerNewOneComponent } from './examiner-new-one.component'; + +describe('ExaminerNewOneComponent', () => { + let component: ExaminerNewOneComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ExaminerNewOneComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ExaminerNewOneComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/examiner/examiner-new-one/examiner-new-one.component.ts b/src/app/examiner/examiner-new-one/examiner-new-one.component.ts new file mode 100644 index 0000000..6940fe3 --- /dev/null +++ b/src/app/examiner/examiner-new-one/examiner-new-one.component.ts @@ -0,0 +1,395 @@ +/* + * @Descripttion: + * @version: + * @Author: sueRimn + * @Date: 2020-12-11 16:34:26 + * @LastEditors: sueRimn + * @LastEditTime: 2020-12-12 09:13:04 + */ +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'] +}) +export class ExaminerNewOneComponent implements OnInit { + + constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } + + ngOnInit(): void { + //this.getAllKeyUnit(); + } + + 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(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); + myControl = new FormControl(); + hasChild = (_: number, node: any) => node.expandable; + + @ViewChild(MatSort) sort: MatSort; + + allunittype:any //获取所有的单位类型 + + //分页 + @ViewChild(MatPaginator, {static: true}) + pageEvent: PageEvent; + paginator: MatPaginator; + length:any; //共多少条数据 + pageSize:any; //每页条数 + pageSizeOptions: number[] = [10] //设置每页条数 + PageNumber:any //第几页 + + displayedColumns: string[] = ['checked','Follow','unitname','integrity','jurisdictionsquadron', 'unittype','scc', 'time','operation']; + tabledataSource:any + allorganizations:any + oldDataSource:any; //原始表格数据 + + //分页事件 + chagePage(e){ + this.PageNumber = e.pageIndex+1 + this.getAllKeyUnit(); + } + //获得所有重点单位 + + wanzhengduArr = [ + {id:0,zong:94,details:[ + {name:'单位信息',score:5,totalpoints:5}, + {name:'建筑信息',score:10,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:22,totalpoints:25}, + {name:'消防设施',score:10,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:7,totalpoints:10}, + {name:'实景图',score:10,totalpoints:10}, + {name:'CAD上传',score:10,totalpoints:10}, + ]}, + {id:1,zong:90,details:[ + {name:'单位信息',score:4,totalpoints:5}, + {name:'建筑信息',score:8,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:25,totalpoints:25}, + {name:'消防设施',score:10,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:8,totalpoints:10}, + {name:'实景图',score:5,totalpoints:10}, + {name:'CAD上传',score:10,totalpoints:10}, + ]}, + {id:2,zong:89,details:[ + {name:'单位信息',score:4,totalpoints:5}, + {name:'建筑信息',score:10,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:22,totalpoints:25}, + {name:'消防设施',score:10,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:8,totalpoints:10}, + {name:'实景图',score:5,totalpoints:10}, + {name:'CAD上传',score:10,totalpoints:10}, + ]}, + {id:3,zong:87,details:[ + {name:'单位信息',score:5,totalpoints:5}, + {name:'建筑信息',score:8,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:20,totalpoints:25}, + {name:'消防设施',score:10,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:6,totalpoints:10}, + {name:'实景图',score:10,totalpoints:10}, + {name:'CAD上传',score:8,totalpoints:10}, + ]}, + {id:4,zong:86,details:[ + {name:'单位信息',score:5,totalpoints:5}, + {name:'建筑信息',score:10,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:18,totalpoints:25}, + {name:'消防设施',score:10,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:8,totalpoints:10}, + {name:'实景图',score:5,totalpoints:10}, + {name:'CAD上传',score:10,totalpoints:10}, + ]}, + {id:5,zong:81,details:[ + {name:'单位信息',score:5,totalpoints:5}, + {name:'建筑信息',score:8,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:22,totalpoints:25}, + {name:'消防设施',score:10,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:5,totalpoints:10}, + {name:'实景图',score:10,totalpoints:10}, + {name:'CAD上传',score:6,totalpoints:10}, + ]}, + {id:6,zong:80,details:[ + {name:'单位信息',score:5,totalpoints:5}, + {name:'建筑信息',score:8,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:20,totalpoints:25}, + {name:'消防设施',score:10,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:7,totalpoints:10}, + {name:'实景图',score:0,totalpoints:10}, + {name:'CAD上传',score:10,totalpoints:10}, + ]}, + {id:7,zong:78,details:[ + {name:'单位信息',score:4,totalpoints:5}, + {name:'建筑信息',score:8,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:22,totalpoints:25}, + {name:'消防设施',score:10,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:6,totalpoints:10}, + {name:'实景图',score:0,totalpoints:10}, + {name:'CAD上传',score:8,totalpoints:10}, + ]}, + {id:8,zong:78,details:[ + {name:'单位信息',score:5,totalpoints:5}, + {name:'建筑信息',score:8,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:20,totalpoints:25}, + {name:'消防设施',score:5,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:5,totalpoints:10}, + {name:'实景图',score:5,totalpoints:10}, + {name:'CAD上传',score:10,totalpoints:10}, + ]}, + {id:9,zong:73,details:[ + {name:'单位信息',score:5,totalpoints:5}, + {name:'建筑信息',score:7,totalpoints:10}, + {name:'平面图',score:10,totalpoints:10}, + {name:'四周毗邻',score:18,totalpoints:25}, + {name:'消防设施',score:0,totalpoints:10}, + {name:'重点部位',score:10,totalpoints:10}, + {name:'功能分区',score:5,totalpoints:10}, + {name:'实景图',score:10,totalpoints:10}, + {name:'CAD上传',score:8,totalpoints:10}, + ]} + ] + + allKeyUnitInfo:any //所有的重点单位 + getAllKeyUnit(){ + // console.log(Boolean(Number(this.follow))) + let follow + if(this.follow == ''){ + follow = '' + } + if(this.follow == '0'){ + follow = false + } + if(this.follow == '1'){ + follow = true + } + + let paramsdata:any = { + Name: this.companyName || '', + OrganizationId: this.jsId || '', + HasChildren:this.jscheck || '', + USCI:this.shehui || '', + IsFollowed: follow, + BuildingTypeId: this.unittype || '', + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + Sort: this.integritySort ? 'integrityscore' : '', + SortType: this.integritySort || '', + } + console.log(paramsdata) + this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{ + console.log(data) + this.length = data.totalCount + this.allKeyUnitInfo = data + // data.items.sort( (a,b) => { + // return a.usci - b.usci + // }) + data.items.forEach( (item,index) => { + item.integrity = this.wanzhengduArr[index] + }) + console.log(789,data.items) + this.tabledataSource = new MatTableDataSource(data.items); + }) + } + //得到当前单位信息 + getunitdata(){ + this.http.get("/api/Account/Profiles").subscribe( + (data:any)=>{ + this.organizationName = data.organizationName + } + ) + } + organizationName:any //当前单位组织机构名称 + treedata:any //组织机构树型数据 + newArr:any = [] + newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 + newallorganizations2:any + //得到当前单位所在组织机构的tree型数据 + getpresentOrganization(){ + this.newallorganizations = this.allorganizations + this.newallorganizations.forEach(item => { + item.children = [] + this.newallorganizations.forEach(element => { + if(element.parentId == item.id){ + item.children.push(element) + } + }); + }); + this.http.get("/api/Account/Profiles").subscribe( + (data:any)=>{ + this.organizationName = data.organizationName + if(this.organizationName){ + this.newallorganizations.forEach(item => { + if(item.name == this.organizationName){ + this.dataSource.data = [item] + this.newallorganizations2 = [item] + } + }); + }else{ + this.newallorganizations2 = this.treedata + this.dataSource.data = this.treedata + } + } + ) + + } + //获得所有组织机构 + getOrganizations(){ + this.http.get('/api/Organizations').subscribe( + (data:any)=>{ + this.allorganizations = data + this.treedata = this.tree.toTree(data); + this.getpresentOrganization(); + } + ) + } + + //获得所有单位类型 + getUnittype(){ + this.http.get('/api/BuildingTypes/Simple').subscribe( + data=>{ + this.allunittype = data + } + ) + } + selectedunitArr:any =[] //选中单位的数组 + //勾选框事件 + checkChange(e,element){ + element.checked = e.checked + } + //编辑单位信息 + editunit(){ + sessionStorage.setItem("six","edit") + let selectedunitArr = [] + let selectedunitobj = [] + this.allKeyUnitInfo.items.forEach(item => { + if(item.checked){ + 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); + } + if(selectedunitArr.length != 1 && selectedunitArr.length != 0){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('只能选择一个单位修改','确定',config); + } + if(selectedunitArr.length == 1){ //带着id跳到修改页面 + // console.log(778,selectedunitArr[0]) + this.allKeyUnitInfo.items.forEach(item => { + if(item.id == selectedunitArr[0]){ + let companyName = item.name + sessionStorage.setItem("companyName",companyName) + } + }); + sessionStorage.setItem("editable","1") + sessionStorage.setItem(selectedunitobj[0].id,JSON.stringify(selectedunitobj[0].companyIntegrityScore)) + window.open(`/keyUnit/editplaninfo?id=${selectedunitArr[0]}`); + } + } + + + //重置 + js:any //辖区中队输入框 + jsId:any //辖区中队选择的id + companyName:any //单位名称 + shehui:any //统一社会信用代码 + unittype:any //单位类型 + jscheck:any //辖区中队包含下级 + OrganizationId // + follow:any = '' //是否为关注单位 + integritySort:any //完整度排序 + reset(){ + this.js='' //辖区中队输入框 + this.jscheck='' //辖区中队包含下级 + this.companyName='' //单位名称 + this.shehui='' //统一社会信用代码 + this.unittype='' //单位类型 + this.jsId = '' + this.follow = '' + this.PageNumber = 1 + this.pageEvent.pageIndex = 0 + this.integritySort = '' + this.getAllKeyUnit(); + } + + //提交查询表单 + onSubmit(value){ + this.PageNumber = 1 + this.pageEvent.pageIndex = 0 + this.getAllKeyUnit(); + } + bigclosediv(e){ + this.isorganizationbox = false + } + stopclose(e){ + e.stopPropagation(); + } + //辖区中队div是否显示 + isorganizationbox:boolean = false + //点击辖区中队树,将选择的辖区中队添加到变量 + add(node) { + this.isorganizationbox = false + this.js = node.name + this.jsId = node.id + } + //关闭辖区中队隐藏框 + closeorganizationbox() { + this.isorganizationbox = false + } + //打开辖区中队隐藏框 + openorganizationbox() { + this.isorganizationbox = true + + } + + //关闭出现的组织机构div + closediv(){ + this.isorganizationbox = false + } + +} diff --git a/src/app/examiner/examiner-routing.ts b/src/app/examiner/examiner-routing.ts index c511108..3ac82b2 100644 --- a/src/app/examiner/examiner-routing.ts +++ b/src/app/examiner/examiner-routing.ts @@ -4,15 +4,17 @@ * @Author: sueRimn * @Date: 2020-12-10 12:11:26 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-11 09:15:24 + * @LastEditTime: 2020-12-11 16:40:36 */ import { Routes, RouterModule } from '@angular/router'; import { NgModule } from '@angular/core'; import { ExaminerIndexComponent } from './examiner-index/examiner-index.component' +import { ExaminerNewOneComponent} from './examiner-new-one/examiner-new-one.component' const routes: Routes = [ // { path: '', component:CreateExamComponent } - { path: 'createexam-index', component:ExaminerIndexComponent } + { path: 'createexam-index', component:ExaminerIndexComponent }, + { path: 'examiner-new-one', component:ExaminerNewOneComponent } ] @NgModule({ diff --git a/src/app/examiner/examiner.module.ts b/src/app/examiner/examiner.module.ts index 00361b2..dc39eda 100644 --- a/src/app/examiner/examiner.module.ts +++ b/src/app/examiner/examiner.module.ts @@ -51,12 +51,12 @@ import { AddPlanDialog, AddPlanTwoDialog, CreateTestScoreComponent } from './cre 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'; @NgModule({ - declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog], + declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,ExaminerIndexComponent, ExaminerNewOneComponent], imports: [ CommonModule, examinerRoutingModule, @@ -105,7 +105,7 @@ import { ExaminerIndexComponent } from './examiner-index/examiner-index.componen ReactiveFormsModule, FormsModule, NavigationModule, - NzTreeModule + NzTreeModule, ], providers: [ { provide: MatPaginatorIntl, useValue: myPaginator() } ] }) diff --git a/src/app/navigation/navigation.component.ts b/src/app/navigation/navigation.component.ts index bdc4947..b7c2586 100644 --- a/src/app/navigation/navigation.component.ts +++ b/src/app/navigation/navigation.component.ts @@ -23,7 +23,7 @@ export class NavigationComponent implements OnInit { selectedDataBank:any //当前选中的资料库 hoverDataBank:any //当前鼠标移入的资料库 isOneClick:boolean //是否第一次进入网页 - leftMenuname="found" + leftMenuname="" //左侧菜单点击事件 clickLeftmenu(name){ diff --git a/src/assets/images/add.png b/src/assets/images/add.png new file mode 100644 index 0000000000000000000000000000000000000000..eba853372fa4b5980a0bd900ad8f46e4aec0a644 GIT binary patch literal 441 zcmV;q0Y?6bP)*Ee4Xori>IN9|NTfC>x4R84Qf- z=-kfxdfo1O@8CYu>FJ!`bI$*q^N1?P%*KEjU>N8Kmp9-7*pqZx8K&%one_mh0r&!r zftT><0*XLe085gdllT;5W&^+>@C~d2JCfW^kD0Xq^S~P5_N1gMcPN7*lWV}!pOBPf zQLS?K_w0_M?0!j43FsW?1^lumBq0av26&J(A~PEYPJkszTa_u8nG4%2$%X%O%xp0< zErYhBL+zECMA>IRQx3>=`Y3nO%pQR|Nz*x_kPC{3_JM+fK0Q52E1CMeoTQ_Luy4~= zOQRXzb)b|7^1(|^Ul{ipP^y=irJ#nD_8+lZf%io0dhM^(wPj!f7;4-=Mhm+EpHg3u zqNLZVyAhXW))@=!Kf~{e1Z)sEsI#=L$y_Y0hfPVkOqVt@6P}ri@9nMkjV$=GrX!Iv j%?_H)`Pg=oEV8jb;#18@6?^=~00000NkvXXu0mjfHX_LH literal 0 HcmV?d00001