diff --git a/src/app/examiner/create-test-score/addPlanTwo.html b/src/app/examiner/create-test-score/addPlanTwo.html index 39c4545..d0b35ce 100644 --- a/src/app/examiner/create-test-score/addPlanTwo.html +++ b/src/app/examiner/create-test-score/addPlanTwo.html @@ -67,7 +67,7 @@
-
+
确定
diff --git a/src/app/examiner/create-test-score/addPlanTwo.scss b/src/app/examiner/create-test-score/addPlanTwo.scss index cd1d240..633afa1 100644 --- a/src/app/examiner/create-test-score/addPlanTwo.scss +++ b/src/app/examiner/create-test-score/addPlanTwo.scss @@ -11,6 +11,7 @@ } .tablebox{ width: 600px; + margin: 3px 0; table{ width: 100%; } @@ -18,6 +19,7 @@ .customPlanName{ input{ width: 260px; + height: 36px; border: 0; background-color: #F2F5F6; box-sizing: border-box; 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 edf5de0..f10846f 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 @@ -46,7 +46,15 @@ 基本信息 - {{unit.basicInfoScore ? unit.basicInfoScore : 0}}分 + + + 总分值: 分, + 单项 + + {{unit.basicInfoItemScore ? unit.basicInfoItemScore : 0}} + 分 + @@ -66,11 +74,9 @@
- -
+ +
查看 - 单项 - 总共
@@ -84,7 +90,13 @@ 四周毗邻 - {{unit.aroundScore ? unit.aroundScore : 0}}分 + + 总分值: 分, + 单项 + {{unit.aroundItemScore ? unit.aroundItemScore : 0}} + 分 + @@ -104,11 +116,9 @@
- -
+ +
查看 - 单项 - 总共
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 7745752..2378a17 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 @@ -98,14 +98,15 @@ table { text-align: center; border-collapse: collapse; padding:2px;} overflow-y: auto; padding: 18px; .basicinfodiv{ + .scoreInput{ + text-align: center; + width: 60px; + color: #FF8678; + } .treeNodeTemplate{ .scoreDiv{ display: inline-block; - input{ - text-align: center; - width: 40px; - margin: 0 3px; - } + .lookitem{ margin: 0 20px; } 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 f2fcd8f..1d174d9 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 @@ -18,98 +18,91 @@ 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 : [ + {name:'富丽华大酒店1',score:0,basicInfoScore:0,basicInfoItemScore:0,basicInfoNodes : [ { - title: '单位信息', + name: '单位信息', key: '0-0', + type:'基本信息', 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} + {name: '统一社会信用代码',key: '1',isLeaf:true}, + {name: '单位类型',key: '2',isLeaf:true}, + {name: '联系人',key: '3',isLeaf:true}, + {name: '联系电话',key: '4',isLeaf:true}, + {name: '辖区中队',key: '5',isLeaf:true}, + {name: '单位地址',key: '6',isLeaf:true} ] }, { - title: '建筑信息', + name: '建筑信息', key: '0-1', + type:'基本信息', 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} + { name: '面积', key: '0-1-0-0',isLeaf:true}, + { name: '高度', key: '0-1-0-1',isLeaf:true}, + { name: '层数', key: '0-1-0-2',isLeaf:true} ] }, - ],aroundScore:0,aroundNodes :[ + ],aroundScore:0,aroundItemScore:0,aroundNodes :[ { - title: '单位四周毗邻', + name: '单位四周毗邻', key: '11', expanded: true, - zIndex : '0', - itemScore: 0, - sumScore: 0, + type:'四周毗邻', children: [ - {title: '东方向',key: '55',isLeaf:true}, + {name: '东方向',key: '55',isLeaf:true}, ] }, { - title: '建筑四周毗邻', + name: '建筑四周毗邻', key: '22', expanded: true, - zIndex : '0', - itemScore: 0, - sumScore: 0, + type:'四周毗邻', children: [ - {title: '东方向',key: '55',isLeaf:true}, + {name: '东方向',key: '55',isLeaf:true}, ] }, ]}, - {name:'富丽华大酒店2',score:0,basicInfoScore:0} + // {name:'富丽华大酒店2',score:0,basicInfoScore:0} ] + unitId:any = [{name:'富丽华大酒店1'}] + //获取单位数据 + getUnitData(){ + + } + - 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 + //阻止input事件冒泡 + stopPropagation($event){ + console.log($event) + $event.stopPropagation() + } + //模拟预案数据 + 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//整个试卷的总分 + + + + //计算分数 + calculateScore(key){ + //key代表第几个建筑 //计算整个单位的总分 - var unitScore = 0 - this.unitDatas[key].score = basicInfoScore + aroundScore + 0 + + this.unitDatas[key].score = this.unitDatas[key].basicInfoScore + this.unitDatas[key].aroundScore //计算整个试卷的总分 let examScore = 0 @@ -121,51 +114,67 @@ export class CreateTestScoreComponent implements OnInit { //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) + + if(event.node.origin.type == '基本信息' || (event.node.parentNode && event.node.parentNode.origin.type == '基本信息')){ + let selectedNum = [] + this.unitDatas[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 + }else{ + this.unitDatas[key].basicInfoItemScore = 0 } - }) - 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) + } + if(event.node.origin.type == '四周毗邻' || (event.node.parentNode && event.node.parentNode.origin.type == '四周毗邻')){ + let selectedNum = [] + this.unitDatas[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 + }else{ + this.unitDatas[key].aroundItemScore = 0 } - }) - 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) + //单位各项总分数动态计算 + sumScore(type,key){ + //key代表第几个建筑 type代表哪个部分 + if(type == '基本信息'){ + let selectedNum = 0 + this.unitDatas[key].basicInfoNodes.forEach(item => { + item.children.forEach(i => { + i.checked ? selectedNum++ : '' + }) + }) + if(selectedNum != 0){ + this.unitDatas[key].basicInfoItemScore = this.unitDatas[key].basicInfoScore / selectedNum + }else{ + this.unitDatas[key].basicInfoItemScore = 0 } - }) - 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) + + } + if(type == '四周毗邻'){ + let selectedNum = 0 + this.unitDatas[key].aroundNodes.forEach(item => { + item.children.forEach(i => { + i.checked ? selectedNum++ : '' + }) + }) + if(selectedNum != 0){ + this.unitDatas[key].aroundItemScore = this.unitDatas[key].aroundScore / selectedNum + }else{ + this.unitDatas[key].aroundItemScore = 0 } - }) - node.origin.itemScore = node.origin.sumScore / itemTrue.length + + } this.calculateScore(key)//更新标题栏分数 } @@ -258,7 +267,15 @@ export class AddPlanTwoDialog { onNoClick(): void { this.dialogRef.close(); } + //确定 + confirm(){ + if(this.planType == 1){ + console.log(this.selection) + }else{ + } + } + //取消 close(){ this.dialogRef.close(); } diff --git a/src/app/navigation/navigation.component.scss b/src/app/navigation/navigation.component.scss index 8f50918..2f14447 100644 --- a/src/app/navigation/navigation.component.scss +++ b/src/app/navigation/navigation.component.scss @@ -9,7 +9,6 @@ mat-accordion{ mat-sidenav{ box-shadow: 2px 0px 5px #888888; color: white; - //background: url(../../assets/images/main_bg.png) 100% 100%; background-color: #07CDCF; width: 216px; overflow-x: hidden; @@ -34,9 +33,6 @@ mat-sidenav{ text-overflow:ellipsis; white-space: nowrap; } - li:hover{ - background-color: #5d9cf2; - } } } diff --git a/src/app/navigation/navigation.component.ts b/src/app/navigation/navigation.component.ts index b7c2586..96108e3 100644 --- a/src/app/navigation/navigation.component.ts +++ b/src/app/navigation/navigation.component.ts @@ -21,7 +21,7 @@ export class NavigationComponent implements OnInit { allDataBank:any //所有的资料库 selectedDataBank:any //当前选中的资料库 - hoverDataBank:any //当前鼠标移入的资料库 + hoverDataBank:any//当前鼠标移入的资料库 isOneClick:boolean //是否第一次进入网页 leftMenuname="" diff --git a/src/app/tabbar/tabbar.component.html b/src/app/tabbar/tabbar.component.html index d6a537f..4d40b2d 100644 --- a/src/app/tabbar/tabbar.component.html +++ b/src/app/tabbar/tabbar.component.html @@ -13,10 +13,10 @@ -