diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.html b/src/app/plan-audit/wait-examineer/wait-examineer.component.html index f18dbe5..a3f48d7 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.html +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.html @@ -277,7 +277,7 @@ -
+
diff --git a/src/app/ui/collection-tools-building/collection-tools.component.ts b/src/app/ui/collection-tools-building/collection-tools.component.ts index 99717c6..1ce5d4a 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.ts +++ b/src/app/ui/collection-tools-building/collection-tools.component.ts @@ -1919,6 +1919,7 @@ export class CollectionToolsBuildingComponent implements OnInit { //复制图层 平面图 楼层/区域 duplicateLayer(item) { + this.maskLayerService.sendMessage(true) let paramsData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data || {})) Object.keys(paramsData).forEach((key) => { if (key != '图例') { @@ -1941,7 +1942,46 @@ export class CollectionToolsBuildingComponent implements OnInit { sitePlanId: data.id } this.http.post('/api/SitePlanData', newData, { params: this.params }).subscribe(data => { - this.renovateSitePlan() + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { + this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; + }); + let list = [] + //保存建筑数据 + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + this.http.post("/api/CompanyData", CompanyData, {params: {companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存单位毗邻 + let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() + this.http.post("/api/CompanyAdjoins/Batch", CompanyAdjoins, {params:{companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if (err == 'infos 有重复方向!') { + this.snackBar.open('单位毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('单位毗邻同步失败', '确定', config); + } + }) + //批量保存单位重点部位 + let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() + this.http.post("/api/CompanyImportantLocations/Batch", CompanyImportantLocations, {params:{companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存单位消防设施素材 + let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() + this.http.post("/api/CompanyFacilityAssets/Batch", CompanyFacilityAssets, {params: {companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) }) }) @@ -1958,13 +1998,88 @@ export class CollectionToolsBuildingComponent implements OnInit { buildingAreaId: data.id } this.http.post('/api/BuildingAreaData', newData, { params: this.params }).subscribe(data => { - this.renovateBuilding() + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { + this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; + }); + let list = [] + //建筑数据 + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + this.http.post("/api/BuildingData", CompanyData, {params: { companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存建筑毗邻 + let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() + this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingAdjoins).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if (err == 'infos 有重复方向!') { + this.snackBar.open('建筑毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('建筑毗邻同步失败', '确定', config); + } + }) + //批量保存建筑重点部位 + let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() + this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingImportantLocations).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存建筑消防设施素材 + let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() + this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingFacilityAssets).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) }) }) } } + //复制完楼层后 刷新视图 + updateCurrentFloor() { + if (this.checkedBuildingIndex == -1) { //总平面图 + let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 + let planData = this.getSitePlanCompanyData() //获取 单位 数据 + this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length-1] || {} + this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length-1] || {} //服务中 存一份数据 + this.selectSitePlanIndex = this.sitePlanData.length-1 + + Promise.all([fireData, planData]).then((res) => { + this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 + this.maskLayerService.sendMessage(false) + }) + + }) //重新加载 新楼层 + } else { //楼层/区域 + let params = { buildingId: this.beforeOneCheckedBuilding.id } + let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素 + let planData = this.getBuildingData(params) //获取 建筑 数据 + this.http.get('/api/BuildingAreas', { params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length-1] || {} + this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length-1] || {} //服务中 存一份数据 + this.selectSitePlanIndex = this.sitePlanData.length-1 + + Promise.all([fireData, planData]).then((res) => { + this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 + this.maskLayerService.sendMessage(false) + }) + + }) //重新加载 新楼层 + } + } + //平面图 楼层/区域 替换底图 replaceBaseMap(e, item) { e.stopPropagation(); diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.ts b/src/app/ui/collection-tools-plan/collection-tools.component.ts index 8431ded..7e0ec8b 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -1844,7 +1844,6 @@ export class CollectionToolsPlanComponent implements OnInit { //复制图层 平面图 楼层/区域 duplicateLayer(item) { - if (item.isGis) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; @@ -1852,6 +1851,7 @@ export class CollectionToolsPlanComponent implements OnInit { this.snackBar.open('gis底图不允许复制', '确定', config); return } + this.maskLayerService.sendMessage(true) let paramsData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data || {})) Object.keys(paramsData).forEach((key) => { if (key != '图例') { @@ -1874,7 +1874,46 @@ export class CollectionToolsPlanComponent implements OnInit { sitePlanId: data.id } this.http.post('/api/SitePlanData', newData, { params: this.params }).subscribe(data => { - this.renovateSitePlan() + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { + this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; + }); + let list = [] + //保存建筑数据 + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + this.http.post("/api/CompanyData", CompanyData, {params: {companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存单位毗邻 + let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() + this.http.post("/api/CompanyAdjoins/Batch", CompanyAdjoins, {params:{companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if (err == 'infos 有重复方向!') { + this.snackBar.open('单位毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('单位毗邻同步失败', '确定', config); + } + }) + //批量保存单位重点部位 + let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() + this.http.post("/api/CompanyImportantLocations/Batch", CompanyImportantLocations, {params:{companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存单位消防设施素材 + let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() + this.http.post("/api/CompanyFacilityAssets/Batch", CompanyFacilityAssets, {params: {companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) }) }) @@ -1891,13 +1930,88 @@ export class CollectionToolsPlanComponent implements OnInit { buildingAreaId: data.id } this.http.post('/api/BuildingAreaData', newData, { params: this.params }).subscribe(data => { - this.renovateBuilding() + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { + this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; + }); + let list = [] + //建筑数据 + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + this.http.post("/api/BuildingData", CompanyData, {params: { companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存建筑毗邻 + let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() + this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingAdjoins).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if (err == 'infos 有重复方向!') { + this.snackBar.open('建筑毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('建筑毗邻同步失败', '确定', config); + } + }) + //批量保存建筑重点部位 + let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() + this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingImportantLocations).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存建筑消防设施素材 + let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() + this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingFacilityAssets).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) }) }) } } + //复制完楼层后 刷新视图 + updateCurrentFloor() { + if (this.checkedBuildingIndex == -1) { //总平面图 + let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 + let planData = this.getSitePlanCompanyData() //获取 单位 数据 + this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length-1] || {} + this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length-1] || {} //服务中 存一份数据 + this.selectSitePlanIndex = this.sitePlanData.length-1 + + Promise.all([fireData, planData]).then((res) => { + this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 + this.maskLayerService.sendMessage(false) + }) + + }) //重新加载 新楼层 + } else { //楼层/区域 + let params = { buildingId: this.beforeOneCheckedBuilding.id } + let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素 + let planData = this.getBuildingData(params) //获取 建筑 数据 + this.http.get('/api/BuildingAreas', { params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length-1] || {} + this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length-1] || {} //服务中 存一份数据 + this.selectSitePlanIndex = this.sitePlanData.length-1 + + Promise.all([fireData, planData]).then((res) => { + this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 + this.maskLayerService.sendMessage(false) + }) + + }) //重新加载 新楼层 + } + } + //平面图 楼层/区域 替换底图 replaceBaseMap(e, item) { e.stopPropagation(); diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 1b665a4..c2d5bd2 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -1988,6 +1988,7 @@ export class CollectionToolsComponent implements OnInit { //复制图层 平面图 楼层/区域 duplicateLayer(item) { + this.maskLayerService.sendMessage(true) let paramsData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data || {})) Object.keys(paramsData).forEach((key) => { if (key != '图例') { @@ -2010,7 +2011,46 @@ export class CollectionToolsComponent implements OnInit { sitePlanId: data.id } this.http.post('/api/SitePlanData', newData, { params: this.params }).subscribe(data => { - this.renovateSitePlan() + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { + this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; + }); + let list = [] + //保存建筑数据 + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + this.http.post("/api/CompanyData", CompanyData, {params: {companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存单位毗邻 + let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() + this.http.post("/api/CompanyAdjoins/Batch", CompanyAdjoins, {params:{companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if (err == 'infos 有重复方向!') { + this.snackBar.open('单位毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('单位毗邻同步失败', '确定', config); + } + }) + //批量保存单位重点部位 + let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() + this.http.post("/api/CompanyImportantLocations/Batch", CompanyImportantLocations, {params:{companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存单位消防设施素材 + let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() + this.http.post("/api/CompanyFacilityAssets/Batch", CompanyFacilityAssets, {params: {companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) }) }) @@ -2027,13 +2067,88 @@ export class CollectionToolsComponent implements OnInit { buildingAreaId: data.id } this.http.post('/api/BuildingAreaData', newData, { params: this.params }).subscribe(data => { - this.renovateBuilding() + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { + this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; + }); + let list = [] + //建筑数据 + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + this.http.post("/api/BuildingData", CompanyData, {params: { companyId: this.params.companyId}}).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存建筑毗邻 + let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() + this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingAdjoins).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if (err == 'infos 有重复方向!') { + this.snackBar.open('建筑毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('建筑毗邻同步失败', '确定', config); + } + }) + //批量保存建筑重点部位 + let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() + this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingImportantLocations).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存建筑消防设施素材 + let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() + this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingFacilityAssets).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) }) }) } } + //复制完楼层后 刷新视图 + updateCurrentFloor() { + if (this.checkedBuildingIndex == -1) { //总平面图 + let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 + let planData = this.getSitePlanCompanyData() //获取 单位 数据 + this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length-1] || {} + this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length-1] || {} //服务中 存一份数据 + this.selectSitePlanIndex = this.sitePlanData.length-1 + + Promise.all([fireData, planData]).then((res) => { + this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 + this.maskLayerService.sendMessage(false) + }) + + }) //重新加载 新楼层 + } else { //楼层/区域 + let params = { buildingId: this.beforeOneCheckedBuilding.id } + let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素 + let planData = this.getBuildingData(params) //获取 建筑 数据 + this.http.get('/api/BuildingAreas', { params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length-1] || {} + this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length-1] || {} //服务中 存一份数据 + this.selectSitePlanIndex = this.sitePlanData.length-1 + + Promise.all([fireData, planData]).then((res) => { + this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 + this.maskLayerService.sendMessage(false) + }) + + }) //重新加载 新楼层 + } + } + //平面图 楼层/区域 替换底图 replaceBaseMap(e, item) { e.stopPropagation(); diff --git a/src/app/ui/plan-template/addattinf.html b/src/app/ui/plan-template/addattinf.html index e99a611..cce8e19 100644 --- a/src/app/ui/plan-template/addattinf.html +++ b/src/app/ui/plan-template/addattinf.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-05-26 14:54:36 * @LastEditors: sueRimn - * @LastEditTime: 2021-05-29 15:12:23 + * @LastEditTime: 2021-06-01 10:25:05 -->
@@ -20,6 +20,16 @@ {{item.propertyName}}
+
+
+ {{item.name}} +
+
+
+
+ {{item.name}} +
+
diff --git a/src/app/ui/plan-template/addgroup.html b/src/app/ui/plan-template/addgroup.html index 81754bb..05916d2 100644 --- a/src/app/ui/plan-template/addgroup.html +++ b/src/app/ui/plan-template/addgroup.html @@ -4,15 +4,16 @@ * @Author: sueRimn * @Date: 2021-05-24 10:08:22 * @LastEditors: sueRimn - * @LastEditTime: 2021-05-25 14:11:23 + * @LastEditTime: 2021-06-01 14:25:50 -->
新增分组
-
- {{item.groupName}} +
+ + {{item.groupName}}
diff --git a/src/app/ui/plan-template/plan-template.component.html b/src/app/ui/plan-template/plan-template.component.html index 0f39a8f..345d496 100644 --- a/src/app/ui/plan-template/plan-template.component.html +++ b/src/app/ui/plan-template/plan-template.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-05-19 15:50:20 * @LastEditors: sueRimn - * @LastEditTime: 2021-05-29 16:52:44 + * @LastEditTime: 2021-06-01 16:43:14 -->
@@ -78,6 +78,7 @@ +
+
+ + + + +
+
+ {{attinf.name}} +
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + +
名称类型操作
{{facilityItems.name}}文本类型 删除
+
+
+
+
+ +
+
+
+
+ +
+
+ + + + +
+
+
+
+
+ + +
+
+
+
+
diff --git a/src/app/ui/plan-template/plan-template.component.scss b/src/app/ui/plan-template/plan-template.component.scss index 14629e9..39680d4 100644 --- a/src/app/ui/plan-template/plan-template.component.scss +++ b/src/app/ui/plan-template/plan-template.component.scss @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-05-19 15:50:20 * @LastEditors: sueRimn - * @LastEditTime: 2021-05-28 13:52:54 + * @LastEditTime: 2021-06-01 16:46:43 */ .box{ height: 97%; @@ -215,6 +215,60 @@ } } } + .attack{ + width: 100%; + display: flex; + flex-direction: row; + .attackLeft{ + width: 70%; + display: flex; + flex-direction: column; + .attackleftHead{ + width: 100%; + height: 40px; + background-color: #FFD91D; + input{ + background-color: #FFD91D; + color: #B99A00; + text-align: center; + height: 100%; + width: 100%; + font-size: 16px; + border: none; + outline: none; + } + } + .attackleftTable{ + width: 100%; + thead,table{ + width: 100%; + + } + th{ + background-color: #F9F9F9; + height: 40px; + font-size: 16px; + text-align: center; + input{ + background-color: #FFFFFF; + text-align: center; + height: 100%; + width: 100%; + font-size: 16px; + border: none; + outline: none; + } + } + } + } + .attackRight{ + width: 30%; + .rightButton{ + margin-top: 20px; + margin-left: 40%; + } + } + } } } } \ No newline at end of file diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index 2fcaf86..660219b 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-05-19 15:50:20 * @LastEditors: sueRimn - * @LastEditTime: 2021-05-29 16:50:13 + * @LastEditTime: 2021-06-01 16:39:49 */ import { Component, Inject, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -42,6 +42,7 @@ export class PlanTemplateComponent implements OnInit { buildData.forEach((element,i,buildArray) => { if(value.buildingTypeId==element.id){ array[index].unitname=buildArray[i].name + array[index].facilityCategoryId=buildArray[i].facilityCategoryId } }); }) @@ -122,7 +123,7 @@ export class PlanTemplateComponent implements OnInit { unitName leftclicki=-1//点了第几个模板 planClick(item){ - //console.log(item) + console.log(item) this.Id=item.id this.planCategory=item.planCategory this.unitName=item.unitname @@ -155,7 +156,7 @@ export class PlanTemplateComponent implements OnInit { data:this.group }); dialogRef.afterClosed().subscribe(result => { - //console.log(result,this.newleftTabledata) + console.log(result,this.newleftTabledata) this.newleftTabledata.forEach((value,index,array)=>{ if(array[index].buildingTypeId==this.buildingTypeId){ if(result!=undefined){ @@ -185,6 +186,7 @@ export class PlanTemplateComponent implements OnInit { } }) } + this.newleftTabledata[this.leftclicki].data=this.group } //新增属性 addAttribute(groupName){ @@ -197,7 +199,7 @@ export class PlanTemplateComponent implements OnInit { data:this.group }); dialogRef.afterClosed().subscribe(result => { - //console.log(result) + console.log(result) if(result!=undefined){ this.group.forEach((value,index,array)=>{ if(array[index].groupName=='单位概况'){ @@ -223,12 +225,16 @@ export class PlanTemplateComponent implements OnInit { } }) } + this.newleftTabledata[this.leftclicki].data=this.group console.log(this.newleftTabledata) } //新增属性信息 danweiInfTable=[] addAttInfo(surveyName){ - this.attPanle=true + if(surveyName=='进攻通道'){ + this.attack.push({head:'进出口',tableth:[]}) + }else{ + this.attPanle=true const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去 width: '240px', height:'400px', @@ -236,13 +242,8 @@ export class PlanTemplateComponent implements OnInit { data:{newleftTabledata:this.newleftTabledata,surveyName:surveyName,leftclicki:this.leftclicki} }); dialogRef.afterClosed().subscribe(result => { - //console.log(result) + console.log(result) if(result!=undefined){ - /* this.group.forEach((value,index,array)=>{ - if(array[index].groupName=='单位概况'){ - array[index].attribute=result - } - }) */ this.newleftTabledata[this,this.leftclicki].data.forEach((value,index,array)=>{ if(value.groupName=='单位概况'){ array[index].attribute.forEach((element,i,attary) => { @@ -257,7 +258,69 @@ export class PlanTemplateComponent implements OnInit { } console.log(this.newleftTabledata) }); + } + + } + //删除属性信息 + delAttInfo(groupName,surveyName,propertyName){ + let isTrue = confirm('您确定要删除该条信息吗') + if(isTrue){ + this.group.forEach((value,index,array)=>{ + if (array[index].groupName==groupName) { + array[index].attribute.forEach((element,i,attarr) => { + if(element.surveyName==surveyName){ + //array[index].attribute[i].completed=false + attarr[i].attinf.forEach((attinfValue,attinfi,attinfarr) => { + if(attinfValue.propertyName==propertyName){ + attinfarr[attinfi].completed=false + } + }); + } + }); + } + }) + } + this.newleftTabledata[this.leftclicki].data=this.group + console.log(this.newleftTabledata) + } + //消防设施具体属性编辑 + fileAdd(facilityItems,filei){ + const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去 + width: '240px', + height:'400px', + disableClose:true, + data:{facilityItems:facilityItems} + }); + dialogRef.afterClosed().subscribe(result => { + console.log(result) + if(result!=undefined){ + this.newleftTabledata[this,this.leftclicki].data.forEach((value,index,array)=>{ + if(value.groupName=='单位概况'){ + array[index].attribute.forEach((element,i,attary) => { + if(element.surveyName=='消防设施'){ + attary[i].attinf[filei].facilityItems=result + } + }); + } + }) + this.group=this.newleftTabledata[this,this.leftclicki].data + } + console.log(this.newleftTabledata) + }); + } + //消防设施具体属性删除 + fileDel(i,f){ + let isTrue = confirm('您确定要删除该条信息吗') + if(isTrue){ + this.group[0].attribute[3].attinf[i].facilityItems[f].completed=false + } + + } + //进攻通道 + attack=[] + attackAdd(){ + this.attack.length+1 } //保存 save(){ @@ -362,7 +425,7 @@ export class addPlanname{ styleUrls: ['./addKeyname.scss'] }) export class upPlanname{ - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} name//预案名称 level=this.data.item.planCategory//预案级别 unitName=this.data.item.unitname//单位类型 @@ -429,7 +492,7 @@ export class upPlanname{ styleUrls: ['./addgroup.scss'] }) export class addGroup{ - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} addgtoup=[ {groupName:'单位概况',completed:false},{groupName:'灾情设定',completed:false},{groupName:'力量调集',completed:false}, {groupName:'组织指挥',completed:false},{groupName:'作战行动',completed:false},{groupName:'社会联动',completed:false}, @@ -439,15 +502,7 @@ export class addGroup{ groupName=[] ngOnInit(): void{ //console.log(this.data) - /* this.addgtoup.forEach((value,index,array)=>{ - this.data.forEach(element => { - if(element.groupName==array[index].groupName){ - array[index].completed=true - } - }); - }) */ - console.log(this.data) - if(this.data!=null){ + if(this.data.length!=0||this.data!=null){ this.addgtoup=this.data } @@ -457,9 +512,11 @@ export class addGroup{ this.dialogRef.close(); } //复选框点击事件 - checkClick(e,item){ + clicki + checkClick(i){ + this.clicki=i //console.log(e,item) - if (e.checked) { + /* if (e.checked) { this.groupName.push(item) }else { this.groupName.forEach((value,index,array)=>{ @@ -467,8 +524,8 @@ export class addGroup{ this.groupName.splice(index,1) } }) - } - //console.log(this.groupName) + } */ + //console.log(this.data) } //确定提交 newGroup(){ @@ -497,14 +554,14 @@ export class addGroup{ styleUrls: ['./addgroup.scss'] }) export class adddwsurvey{ - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} addwsurvey=[ {surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false},{surveyName:'四周毗邻',completed:false}, {surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false},{surveyName:'重点部位',completed:false}, {surveyName:'功能分区',completed:false},{surveyName:'行车路线',completed:false},{surveyName:'千米水源',completed:false},{surveyName:'实景图',completed:false} ] ngOnInit(): void{ - //console.log(this.data) + console.log(this.data) this.data.forEach(element => { if(element.groupName=='单位概况'&&element.attribute!=undefined){ this.addwsurvey=element.attribute @@ -513,7 +570,7 @@ ngOnInit(): void{ } //取消按钮 close(){ - this.dialogRef.close(); + this.dialogRef.close(undefined); } //确定按钮 defineClick(){ @@ -527,7 +584,7 @@ defineClick(){ styleUrls: ['./addgroup.scss'] }) export class addattinf{ - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} addAttinf=[ {propertyName:'统一社会信用代码',completed:false,propertyType:0}, {propertyName:'单位类型',completed:false,propertyType:0}, @@ -538,34 +595,57 @@ export class addattinf{ {propertyName:'单位照片',completed:false,propertyType:0}//,default:'-',must:'是',danwei:'-' ] addAttinfBuild +addAttinfFile +facilityItems ngOnInit(): void{ - //console.log(this.data) + console.log(this.data) this.getattinf() } //获取弹窗信息 getattinf(){ - this.data.newleftTabledata[this.data.leftclicki].data.forEach(element => { - if(element.groupName=='单位概况'&&element.attribute!=undefined){ - element.attribute.forEach(value => { - if(value.surveyName=='单位基本信息'&&value.attinf!=undefined){ - this.addAttinf=value.attinf - }else if(value.surveyName=='建筑信息'&&value.attinf==undefined){ - let paramsdata:any ={ - categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId + if(this.data.facilityItems==undefined){ + this.data.newleftTabledata[this.data.leftclicki].data.forEach(element => { + if(element.groupName=='单位概况'&&element.attribute!=undefined){ + element.attribute.forEach(value => { + if(value.surveyName=='单位基本信息'&&value.attinf!=undefined){ + this.addAttinf=value.attinf + }else if(value.surveyName=='建筑信息'&&value.attinf==undefined){ + let paramsdata:any ={ + categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId + } + this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{ + this.addAttinfBuild=data[0].propertyInfos + this.addAttinfBuild.forEach(element => { + element.completed=false + }); + console.log(this.addAttinfBuild) + }) + }else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){ + this.addAttinfBuild=value.attinf + }else if(value.surveyName=='消防设施'&&value.attinf==undefined){ + let paramsdata:any ={ + categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId + } + this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ + this.addAttinfFile=data + this.addAttinfFile.forEach(element => { + element.completed=false + }); + }) + }else if(value.surveyName=='消防设施'&&value.attinf!=undefined){ + this.addAttinfFile=value.attinf } - this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{ - this.addAttinfBuild=data[0].propertyInfos - this.addAttinfBuild.forEach(element => { - element.completed=false - }); - console.log(this.addAttinfBuild) - }) - }else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){ - this.addAttinfBuild=value.attinf - } - }); - } - }); + }); + } + }); + }else{ + this.facilityItems=this.data.facilityItems + console.log(this.facilityItems) + this.facilityItems.forEach(element => { + element.completed=false + }); + } + } //取消按钮 close(){ @@ -573,6 +653,7 @@ close(){ } //确定按钮 defineClick(){ - this.dialogRef.close(this.data.surveyName=='单位基本信息'?this.addAttinf:this.addAttinfBuild) + this.dialogRef.close(this.data.surveyName=='单位基本信息'?this.addAttinf:this.data.surveyName=='建筑信息'? + this.addAttinfBuild:this.data.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems) } } \ No newline at end of file