From 8b4e2bc60132080f2cc8c6aa17d332b97627400c Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Thu, 17 Dec 2020 11:37:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8F=90=E9=86=92=EF=BC=8C=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=82=A8=E7=BD=90=E5=90=8D=E7=A7=B0=EF=BC=8C=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E6=95=B0=E9=87=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-test-score/addPlanTwo.html | 5 +- .../create-test-score.component.html | 8 +- .../create-test-score.component.ts | 589 ++++++++++-------- .../create-test-score/lookTreeNode.html | 2 +- 4 files changed, 339 insertions(+), 265 deletions(-) diff --git a/src/app/examiner/create-test-score/addPlanTwo.html b/src/app/examiner/create-test-score/addPlanTwo.html index 63fdd29..e509b01 100644 --- a/src/app/examiner/create-test-score/addPlanTwo.html +++ b/src/app/examiner/create-test-score/addPlanTwo.html @@ -3,7 +3,7 @@
添加预案
-
+
@@ -47,6 +47,9 @@
+
+ 该单位暂无审核通过的二维预案 +
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 4a5b95b..a87ec3d 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 @@ -49,12 +49,14 @@ 基本信息 - 总分值: 分, 单项 {{unit.basicInfoItemScore ? unit.basicInfoItemScore : 0}} 分 + + (已选择 {{unit.basicInfoSelectedNum}} 项) @@ -97,6 +99,7 @@ 单项 {{unit.aroundItemScore ? unit.aroundItemScore : 0}} 分 + (已选择 {{unit.aroundSelectedNum}} 项) @@ -139,6 +142,7 @@ 单项 {{unit.keySiteItemScore ? unit.keySiteItemScore : 0}} 分 + (已选择 {{unit.keySiteSelectedNum}} 项) @@ -181,6 +185,7 @@ 单项 {{unit.funDivItemScore ? unit.funDivItemScore : 0}} 分 + (已选择 {{unit.funDivSelectedNum}} 项) @@ -223,6 +228,7 @@ 单项 {{unit.fireFacItemScore ? unit.fireFacItemScore : 0}} 分 + (已选择 {{unit.fireFacSelectedNum}} 项) 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 0b073ba..a9ef808 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 @@ -127,6 +127,7 @@ export class CreateTestScoreComponent implements OnInit { buildingsData.name = data[i].name buildingsData.buildingType = data[i].buildingTypes[0].name buildingsData[0].buildingBasicGroups.forEach((y,m) => { + let propertyInfosArr = [] let tabledata if(y.type == 1){//如果是表格类 @@ -158,14 +159,38 @@ export class CreateTestScoreComponent implements OnInit { }) y.tabledata = dest tabledata = dest - 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) + if(y.tabledata[0].propertyName == '罐区'){ + + if(y.tabledata[1].propertyName != '储罐编号'){ + let index + y.tabledata.forEach((element,key) => { + if(element.propertyName == '储罐编号'){ + index = key + } + }) + y.tabledata[1] = y.tabledata.splice(index, 1, y.tabledata[1])[0]; } - }) + + 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 + '-' + y.tabledata[1].data[key].propertyValue + propertyInfosArr.push(x) + } + }) + }else{ + 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){ @@ -581,6 +606,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].basicInfoItemScore = 0 } + this.unitId[key].basicInfoSelectedNum = selectedNum.length } if(event.node.origin.type == '四周毗邻' || (event.node.parentNode && event.node.parentNode.origin.type == '四周毗邻')){ let selectedNum = [] @@ -594,6 +620,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].aroundItemScore = 0 } + this.unitId[key].aroundSelectedNum = selectedNum.length } if(event.node.origin.type == '重点部位' || (event.node.parentNode && event.node.parentNode.origin.type == '重点部位')){ let selectedNum = [] @@ -607,6 +634,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].keySiteItemScore = 0 } + this.unitId[key].keySiteSelectedNum = selectedNum.length } if(event.node.origin.type == '功能分区' || (event.node.parentNode && event.node.parentNode.origin.type == '功能分区')){ let selectedNum = [] @@ -620,6 +648,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].funDivItemScore = 0 } + this.unitId[key].funDivSelectedNum = selectedNum.length } if(event.node.origin.type == '消防设施' || (event.node.parentNode && event.node.parentNode.origin.type == '消防设施')){ let selectedNum = [] @@ -633,6 +662,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].fireFacItemScore = 0 } + this.unitId[key].fireFacSelectedNum = selectedNum.length } } @@ -730,6 +760,7 @@ export class CreateTestScoreComponent implements OnInit { } }); } + //每条预案分数增加在试卷分数 planItemScore(item){ //计算整个试卷的总分 @@ -750,6 +781,7 @@ export class CreateTestScoreComponent implements OnInit { }) this.examScore = examScore + examScore2 } + //编辑每条预案试卷 edit(item){ const config = new MatSnackBarConfig(); @@ -757,6 +789,7 @@ export class CreateTestScoreComponent implements OnInit { config.duration = 3000 this.snackBar.open('暂不能编辑','确定',config); } + //删除每条预案试卷 deletePlan(item){ this.unitId[this.selectedUnitIndex].planList.forEach((element,key)=>{ @@ -771,271 +804,268 @@ export class CreateTestScoreComponent implements OnInit { } //保存 save(){ - let copyDatas = JSON.parse(JSON.stringify(this.unitId)) - - //循环每个建筑处理数据筛选出选中数据 - copyDatas.forEach(item => { - //建筑的基本信息模块处理 - item.basicInfoNodes.forEach((i,key) => { - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - // console.log(i) - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - // newArr.length == 0 ? item.basicInfoNodes.splice(key,1) : i.children = newArr - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.basicInfoNodes = item.basicInfoNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } - //将children处理成指定形式 - if(i.name =='单位信息'){ - let newChildren = [] - i.children.forEach((element,index) => { - let newChildrenItem:any= {} - newChildrenItem.name = element.name//题目名称 - newChildrenItem.result = element.value//题目答案 - newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 - newChildrenItem.propertyType = 0//输入框类型 - newChildren.push(newChildrenItem) - }) - i.children = newChildren - }else if(!i.tabledata){ - let newChildren = [] - i.children.forEach((element,index) => { - let newChildrenItem:any= {} - newChildrenItem.name = element.propertyName//题目名称 - newChildrenItem.result = element.propertyValue//题目答案 - newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 - newChildrenItem.propertyType = element.propertyType//输入框类型 - newChildren.push(newChildrenItem) - }) - i.children = newChildren - }else if(i.tabledata){//如果是表格类 - let newChildren = [] - i.children.forEach((element,index) => { - let newChildrenItem:any= {} - newChildrenItem.name = element.propertyValue//题目名称 - newChildrenItem.result = element.tag//代表第几行 - newChildrenItem.physicalUnit = ''//计量单位 - newChildrenItem.propertyType = ''//输入框类型 - newChildren.push(newChildrenItem) - }) - i.children = newChildren - i.tabledata.forEach(element => { - let newData = [] - element.data.forEach(ele => { - let newObj:any = {} - newObj.name = ele.propertyName//题目名称 - newObj.result = ele.propertyValue//代表第几行 - newObj.physicalUnit = ele.physicalUnit//计量单位 - newObj.propertyType = ele.propertyType//输入框类型 - newObj.tag = ele.tag//第几行 - newData.push(newObj) - }) - element.data = newData - }) - } - delete i.selected - - }) - //建筑的四周毗邻模块处理 - item.aroundNodes.forEach((i,key) => { - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.aroundNodes = item.aroundNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } - let newChildren = [] - i.children.forEach((element,index) => { - let newChildrenItem:any= {} - newChildrenItem.name = element.title//题目名称 - newChildrenItem.result = element.name//题目答案 - newChildrenItem.physicalUnit = ''//计量单位 - newChildrenItem.propertyType = 0//输入框类型 - newChildren.push(newChildrenItem) - }) - i.children = newChildren - delete i.selected - }) - console.log(111,item) - //建筑的重点部位模块处理 - item.keySiteNodes ? item.keySiteNodes.forEach((i,key) => { - i.selected ? i.selected = null : null - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.keySiteNodes = item.keySiteNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } - i.tabledata = [{propertyName: "重点部位名称",data:[]}, - {propertyName: "重点部位所在位置",data:[]}, - {propertyName: "建筑结构",data:[]}, - {propertyName: "使用性质",data:[]}, - {propertyName: "主要危险性",data:[]}] + let copyDatas = JSON.parse(JSON.stringify(this.unitId)) + //循环每个建筑处理数据筛选出选中数据 + copyDatas.forEach(item => { + //建筑的基本信息模块处理 + item.basicInfoNodes.forEach((i,key) => { + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + // console.log(i) + let newArr = [] i.children.forEach(element => { - i.tabledata[0].data.push({ - name: "重点部位名称", - physicalUnit: '', - propertyType: 0, - result: element.name, - tag: "" - }) - i.tabledata[1].data.push({ - name: "重点部位所在位置", - physicalUnit: '', - propertyType: 0, - result: element.position, - tag: "" - }) - i.tabledata[2].data.push({ - name: "建筑结构", - physicalUnit: '', - propertyType: 0, - result: element.structure, - tag: "" - }) - i.tabledata[3].data.push({ - name: "使用性质", - physicalUnit: '', - propertyType: 0, - result: element.nature, - tag: "" - }) - i.tabledata[4].data.push({ - name: "主要危险性", - physicalUnit: '', - propertyType: 0, - result: element.hazards, - tag: "" - }) + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + // newArr.length == 0 ? item.basicInfoNodes.splice(key,1) : i.children = newArr + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.basicInfoNodes = item.basicInfoNodes.filter(items => { + if (!discard.includes(items)) return items; }) + } + //将children处理成指定形式 + if(i.name =='单位信息'){ let newChildren = [] i.children.forEach((element,index) => { let newChildrenItem:any= {} - // newChildrenItem.name = element.name//重点部位题目名称 - // newChildrenItem.position = element.position//重点部位所在位置 - // newChildrenItem.structure = element.structure//重点部位建筑结构 - // newChildrenItem.nature = element.nature//重点部位使用性质 - // newChildrenItem.hazards = element.hazards//重点部位主要危险性 newChildrenItem.name = element.name//题目名称 - newChildrenItem.result = element.position + element.structure + element.nature + element.hazards//题目答案 + newChildrenItem.result = element.value//题目答案 newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 newChildrenItem.propertyType = 0//输入框类型 newChildren.push(newChildrenItem) }) i.children = newChildren - delete i.selected - - - }) : null - //建筑的功能分区模块处理 - item.funDivNodes ? item.funDivNodes.forEach((i,key) => { - - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.funDivNodes = item.funDivNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } - - i.tabledata = [{propertyName: "区域",data:[]}, - {propertyName: "面积",data:[]}, - {propertyName: "基本情况",data:[]}] - i.children.forEach(element => { - i.tabledata[0].data.push({ - name: "区域", - physicalUnit: '', - propertyType: 0, - result: element.region, - tag: "" - }) - i.tabledata[1].data.push({ - name: "面积", - physicalUnit: '', - propertyType: 0, - result: element.area, - tag: "" - }) - i.tabledata[2].data.push({ - name: "基本情况", - physicalUnit: '', - propertyType: 0, - result: element.details, - tag: "" - }) - }) + }else if(!i.tabledata){ let newChildren = [] i.children.forEach((element,index) => { let newChildrenItem:any= {} - // newChildrenItem.name = element.region//功能分区题目名称 - // newChildrenItem.area = element.area//功能分区面积 - // newChildrenItem.details = element.details//功能分区基本情况 - newChildrenItem.name = element.region//题目名称 - newChildrenItem.result = element.area + element.details//题目答案 + newChildrenItem.name = element.propertyName//题目名称 + newChildrenItem.result = element.propertyValue//题目答案 newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 - newChildrenItem.propertyType = 0//输入框类型 + newChildrenItem.propertyType = element.propertyType//输入框类型 newChildren.push(newChildrenItem) }) i.children = newChildren - delete i.selected - }) : null - //建筑的数据核验模块处理 - item.fireFacNodes ? item.fireFacNodes.forEach((i,key) => { - i.selected ? i.selected = null : null - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.fireFacNodes = item.fireFacNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } + }else if(i.tabledata){//如果是表格类 let newChildren = [] i.children.forEach((element,index) => { let newChildrenItem:any= {} - newChildrenItem.name = element.name//题目名称 - newChildrenItem.result = element.total//题目答案 + newChildrenItem.name = element.propertyValue//题目名称 + newChildrenItem.result = element.tag//代表第几行 newChildrenItem.physicalUnit = ''//计量单位 - newChildrenItem.propertyType = 0//输入框类型 + newChildrenItem.propertyType = ''//输入框类型 newChildren.push(newChildrenItem) }) i.children = newChildren - delete i.selected - }) : null - }) + i.tabledata.forEach(element => { + let newData = [] + element.data.forEach(ele => { + let newObj:any = {} + newObj.name = ele.propertyName//题目名称 + newObj.result = ele.propertyValue//代表第几行 + newObj.physicalUnit = ele.physicalUnit//计量单位 + newObj.propertyType = ele.propertyType//输入框类型 + newObj.tag = ele.tag//第几行 + newData.push(newObj) + }) + element.data = newData + }) + } + delete i.selected - //循环每个建筑处理数据 - console.log(copyDatas) - - let paperDataInfo = [] - copyDatas.forEach((item,key) =>{ + }) + //建筑的四周毗邻模块处理 + item.aroundNodes.forEach((i,key) => { + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + let newArr = [] + i.children.forEach(element => { + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.aroundNodes = item.aroundNodes.filter(items => { + if (!discard.includes(items)) return items; + }) + } + let newChildren = [] + i.children.forEach((element,index) => { + let newChildrenItem:any= {} + newChildrenItem.name = element.title//题目名称 + newChildrenItem.result = element.name//题目答案 + newChildrenItem.physicalUnit = ''//计量单位 + newChildrenItem.propertyType = 0//输入框类型 + newChildren.push(newChildrenItem) + }) + i.children = newChildren + delete i.selected + }) + console.log(111,item) + //建筑的重点部位模块处理 + item.keySiteNodes ? item.keySiteNodes.forEach((i,key) => { + i.selected ? i.selected = null : null + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + let newArr = [] + i.children.forEach(element => { + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.keySiteNodes = item.keySiteNodes.filter(items => { + if (!discard.includes(items)) return items; + }) + } + i.tabledata = [{propertyName: "重点部位名称",data:[]}, + {propertyName: "重点部位所在位置",data:[]}, + {propertyName: "建筑结构",data:[]}, + {propertyName: "使用性质",data:[]}, + {propertyName: "主要危险性",data:[]}] + i.children.forEach(element => { + i.tabledata[0].data.push({ + name: "重点部位名称", + physicalUnit: '', + propertyType: 0, + result: element.name, + tag: "" + }) + i.tabledata[1].data.push({ + name: "重点部位所在位置", + physicalUnit: '', + propertyType: 0, + result: element.position, + tag: "" + }) + i.tabledata[2].data.push({ + name: "建筑结构", + physicalUnit: '', + propertyType: 0, + result: element.structure, + tag: "" + }) + i.tabledata[3].data.push({ + name: "使用性质", + physicalUnit: '', + propertyType: 0, + result: element.nature, + tag: "" + }) + i.tabledata[4].data.push({ + name: "主要危险性", + physicalUnit: '', + propertyType: 0, + result: element.hazards, + tag: "" + }) + }) + let newChildren = [] + i.children.forEach((element,index) => { + let newChildrenItem:any= {} + // newChildrenItem.name = element.name//重点部位题目名称 + // newChildrenItem.position = element.position//重点部位所在位置 + // newChildrenItem.structure = element.structure//重点部位建筑结构 + // newChildrenItem.nature = element.nature//重点部位使用性质 + // newChildrenItem.hazards = element.hazards//重点部位主要危险性 + newChildrenItem.name = element.name//题目名称 + newChildrenItem.result = element.position + element.structure + element.nature + element.hazards//题目答案 + newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 + newChildrenItem.propertyType = 0//输入框类型 + newChildren.push(newChildrenItem) + }) + i.children = newChildren + delete i.selected + + + }) : null + //建筑的功能分区模块处理 + item.funDivNodes ? item.funDivNodes.forEach((i,key) => { + + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + let newArr = [] + i.children.forEach(element => { + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.funDivNodes = item.funDivNodes.filter(items => { + if (!discard.includes(items)) return items; + }) + } + + i.tabledata = [{propertyName: "区域",data:[]}, + {propertyName: "面积",data:[]}, + {propertyName: "基本情况",data:[]}] + i.children.forEach(element => { + i.tabledata[0].data.push({ + name: "区域", + physicalUnit: '', + propertyType: 0, + result: element.region, + tag: "" + }) + i.tabledata[1].data.push({ + name: "面积", + physicalUnit: '', + propertyType: 0, + result: element.area, + tag: "" + }) + i.tabledata[2].data.push({ + name: "基本情况", + physicalUnit: '', + propertyType: 0, + result: element.details, + tag: "" + }) + }) + let newChildren = [] + i.children.forEach((element,index) => { + let newChildrenItem:any= {} + // newChildrenItem.name = element.region//功能分区题目名称 + // newChildrenItem.area = element.area//功能分区面积 + // newChildrenItem.details = element.details//功能分区基本情况 + newChildrenItem.name = element.region//题目名称 + newChildrenItem.result = element.area + element.details//题目答案 + newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 + newChildrenItem.propertyType = 0//输入框类型 + newChildren.push(newChildrenItem) + }) + i.children = newChildren + delete i.selected + }) : null + //建筑的数据核验模块处理 + item.fireFacNodes ? item.fireFacNodes.forEach((i,key) => { + i.selected ? i.selected = null : null + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + let newArr = [] + i.children.forEach(element => { + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.fireFacNodes = item.fireFacNodes.filter(items => { + if (!discard.includes(items)) return items; + }) + } + let newChildren = [] + i.children.forEach((element,index) => { + let newChildrenItem:any= {} + newChildrenItem.name = element.name//题目名称 + newChildrenItem.result = element.total//题目答案 + newChildrenItem.physicalUnit = ''//计量单位 + newChildrenItem.propertyType = 0//输入框类型 + newChildren.push(newChildrenItem) + }) + i.children = newChildren + delete i.selected + }) : null + }) + + //将筛选出来的数据变为服务器提交数据 + let paperDataInfo = [] + copyDatas.forEach((item,key) =>{ paperDataInfo[key] = {} paperDataInfo[key].id = null paperDataInfo[key].paperId = null @@ -1050,19 +1080,48 @@ export class CreateTestScoreComponent implements OnInit { paperDataInfo[key].functionalDivisionScore = item.funDivScore paperDataInfo[key].facilityData = item.fireFacNodes ? JSON.stringify(item.fireFacNodes) : '[]' paperDataInfo[key].facilityScore = item.fireFacScore - }) - - console.log(paperDataInfo) - - const dialogRef = this.dialog.open(FinishDialog, { - width: '650px', - data: paperDataInfo - }); + }) - dialogRef.afterClosed().subscribe(result => { - + // console.log(123456,paperDataInfo) + //判断是否存在总分填写后没有勾选 或者勾选了没有填写总分的情况 + paperDataInfo.forEach(element => { + //判断存在总分填写后没有勾选题目 + if( (element.basicInfoScore != 0 && JSON.parse(element.basicInfoData).length == 0) || + (element.adjoinScore != 0 && JSON.parse(element.adjoinData).length == 0) || + (element.importLocationScore != 0 && JSON.parse(element.importLocationData).length == 0) || + (element.functionalDivisionScore != 0 && JSON.parse(element.functionalDivisionData).length == 0) || + (element.facilityScore != 0 && JSON.parse(element.facilityData).length == 0) ){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('存在填写过总分,但未勾选题目的分组','确定',config); + return + }else + //勾选了题目存在没有填写总分 + if( + (element.basicInfoScore == 0 && JSON.parse(element.basicInfoData).length != 0) || + (element.adjoinScore == 0 && JSON.parse(element.adjoinData).length != 0) || + (element.importLocationScore == 0 && JSON.parse(element.importLocationData).length != 0) || + (element.functionalDivisionScore == 0 && JSON.parse(element.functionalDivisionData).length != 0) || + (element.facilityScore == 0 && JSON.parse(element.facilityData).length != 0) ){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('存在勾选过题目,但未填写总分的分组','确定',config); + return + }else{ + const dialogRef = this.dialog.open(FinishDialog, { + width: '650px', + data: paperDataInfo + }); + dialogRef.afterClosed().subscribe(result => { + + }); + } - }); + + }) + } //上一步 goBack(){ @@ -1142,7 +1201,8 @@ export class AddPlanTwoDialog { companyId:this.data.companyData.companyData.id }}).subscribe((data:any) => { data.items.forEach(item => { - item.planType == 1 ? planArr.push(item) : null + //二维预案并且审核通过 + (item.planType == 1 && item.auditStatus == 2) ? planArr.push(item) : null }) this.dataSource = planArr }) @@ -1162,10 +1222,15 @@ export class AddPlanTwoDialog { sessionStorage.setItem('companyId',this.data.companyData.companyData.id) window.open('/canvasTool') }else{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('请选择要添加的预案','确定',config); + if(this.dataSource.length == 0){ + this.dialogRef.close(); + }else{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请选择要添加的预案','确定',config); + } + } }else{//如果选择的是自定义预案 diff --git a/src/app/examiner/create-test-score/lookTreeNode.html b/src/app/examiner/create-test-score/lookTreeNode.html index f05b3eb..fb85e7e 100644 --- a/src/app/examiner/create-test-score/lookTreeNode.html +++ b/src/app/examiner/create-test-score/lookTreeNode.html @@ -14,7 +14,7 @@ {{item.propertyName}} - {{i.data[key]. propertyValue}} + {{i.data[key]. propertyValue ? i.data[key]. propertyValue : '无'}} From 8c3e6cced1a42c2643ac2352ae24ffbda4ec40da Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Thu, 17 Dec 2020 14:15:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=9F=A5=E7=9C=8B=E6=8F=92=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B4=A0=E6=9D=90icon=E7=82=B9=E5=87=BBbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- angular.json | 3 ++- package.json | 10 ++++----- .../collection-tools.component.html | 5 +++-- .../collection-tools.component.scss | 3 +++ .../collection-tools.component.ts | 22 +++++++++++++------ 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/angular.json b/angular.json index b7c2067..07cf0ab 100644 --- a/angular.json +++ b/angular.json @@ -29,7 +29,8 @@ "src/assets" ], "styles": [ - "src/styles.scss" + "src/styles.scss", + "node_modules/viewerjs/dist/viewer.css" ], "scripts": [ "node_modules/echarts/dist/echarts.js", diff --git a/package.json b/package.json index 77587c1..d86f914 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@angular/router": "~9.0.0", "@types/cesium": "^1.59.5", "angular-calendar": "^0.28.2", + "bson-objectid": "^1.3.1", "cesium": "^1.64.0", "e-ngx-cesium": "^6.3.2", "echarts": "^4.6.0", @@ -32,13 +33,12 @@ "ng2-file-upload": "^1.4.0", "ngx-echarts": "^4.2.2", "ngx-perfect-scrollbar": "^8.0.0", - "rxjs": "~6.5.4", - "tslib": "^1.10.0", - "viewerjs": "^1.6.2", - "swiper": "^5.3.7", "pixi-filters": "^3.1.1", "pixi.js": "^5.3.2", - "bson-objectid": "^1.3.1", + "rxjs": "~6.5.4", + "swiper": "^5.3.7", + "tslib": "^1.10.0", + "viewerjs": "^1.9.0", "zone.js": "~0.10.2" }, "devDependencies": { diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index f5daa5e..30e94a0 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -103,8 +103,9 @@
+ - + @@ -126,7 +127,7 @@ {{node.name}} - ({{node.children.length}}) + ({{node.children.length}}) visibility diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index be59497..ad57cdc 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/src/app/ui/collection-tools/collection-tools.component.scss @@ -1,4 +1,7 @@ @import './panel.scss'; +::-webkit-scrollbar { + display: none; /* Chrome Safari */ +} .content { width: 100%; height: 100%; diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index cd4e9d3..815a037 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -1134,15 +1134,15 @@ export class CollectionToolsComponent implements OnInit { //处理 tree 数据结构 handleTreeData (storeyData) { - + //storeyData为当前楼层拥有的消防设施 this.storeyData = storeyData let data = this.allFireElements //所有消防要素模板 let treeData = [] //tree型 处理完成后的数据 + data.forEach(element => { element.isTemplate = true //添加模板标识 element.isLook = true //添加是否可见标识 - element.name!='其他'? element.children = [] : null - + element.name != '其他' ? element.children = [] : null if(storeyData){ for(let key in storeyData.data){ storeyData.data[key].isLookPattern = true @@ -1161,8 +1161,6 @@ export class CollectionToolsComponent implements OnInit { } }) } - // - element.children.push(storeyData.data[key]) } } @@ -1172,7 +1170,9 @@ export class CollectionToolsComponent implements OnInit { data.forEach(element => { if (!element.parentId) { treeData.push(element) } }); + this.dataSource.data = treeData + this.treeControl.expandAll() } @@ -1203,7 +1203,7 @@ export class CollectionToolsComponent implements OnInit { this.canvas.setHighlight(iconHighLightArr) } - //点击数节点的显示隐藏icon + //点击树节点的显示隐藏icon clickLookItem(node){ //修改真实素材islook属性 @@ -1214,9 +1214,16 @@ export class CollectionToolsComponent implements OnInit { } //所有消防要素模板变化islook值 + if(node.isTemplate && node.name == "其他"){ + this.allFireElements.forEach(item=>{ + if(item.name == "其他"){ + item.isLook = !item.isLook + } + }) + } if(node.isTemplate){ this.allFireElements.forEach(item=>{ - if(item.id == node.id || item.name == "其他"){ + if(item.id == node.id){ item.isLook = !item.isLook } }) @@ -1270,6 +1277,7 @@ export class CollectionToolsComponent implements OnInit { iconVisibleArr.push(node.id) } this.canvas.setIconVisible(iconVisibleArr,!node.isLook) + } //计算 可视区域内宽度, 是否缩放背景图 From 0db3a4639c97c313eb666421bc7d76db3f8f5769 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 18 Dec 2020 09:59:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E9=80=92=E5=BD=92?= =?UTF-8?q?=E8=BF=87=E6=BB=A4tree=E5=9E=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.html | 8 ++-- .../collection-tools.component.ts | 38 ++++++++++++++++++- src/app/working-area/model/singlePointIcon.ts | 2 +- .../working-area/working-area.component.ts | 2 +- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index 30e94a0..f15e4cf 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -38,7 +38,7 @@
-
+