diff --git a/angular.json b/angular.json index a5689c7..46e73e8 100644 --- a/angular.json +++ b/angular.json @@ -46,12 +46,10 @@ }, "configurations": { "production": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], + "fileReplacements": [{ + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + }], "optimization": true, "outputHashing": "all", "sourceMap": false, @@ -60,8 +58,7 @@ "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, - "budgets": [ - { + "budgets": [{ "type": "initial", "maximumWarning": "18mb", "maximumError": "18mb" @@ -142,4 +139,4 @@ "cli": { "analytics": "6210f5d0-2cd7-43dc-b245-2140372d1b89" } -} \ No newline at end of file +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4186af4..338921c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -26,7 +26,9 @@ import { TestComponent } from './test/test.component'; import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component'; import { SearchDownList } from '../modules/map/declare/component/SearchDownListPlugins/SearchDownList'; import { ExportExcelComponent } from './export-excel/export-excel.component'; - +import { registerLocaleData } from '@angular/common'; +import zh from '@angular/common/locales/zh'; +registerLocaleData(zh); @NgModule({ declarations: [ AppComponent, diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.html b/src/app/key-unit/key-unit-management/key-unit-management.component.html index 93418da..9b70d6c 100644 --- a/src/app/key-unit/key-unit-management/key-unit-management.component.html +++ b/src/app/key-unit/key-unit-management/key-unit-management.component.html @@ -16,8 +16,8 @@ 更多筛选条件 - 收起 + 收起
@@ -44,9 +44,11 @@ 更多筛选条件 + (click)='pcInfo()'>更多筛选条件 收起 + (click)='pcInfo()'>收起
@@ -112,11 +114,13 @@
- + - + -
+ @@ -155,8 +159,8 @@ 单位状态 - 新增 - 维护更新 + 新增 + 维护更新 @@ -348,6 +352,7 @@ 操作 + 演练 查看详情 { //初始化tree + pcMore; //pc更多 + pcput = false; //pc收起 + pcfind; //pc查询 + padjt = false; + padMore = true; //pad收缩控制 + padput = false; //pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png"; + imgsrcdown = "../../../assets/images/routup2.png"; + pcInfo() { + this.pcMore = !this.pcMore; + this.pcput = !this.pcput; + } + padInfo() { + this.padMore = !this.padMore; + this.padput = !this.padput; + } + 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 + 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); + }; + 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 //获取所有的单位类型 + allunittype: any; //获取所有的单位类型 //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 - pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any //第几页 - - displayedColumns: string[] = ['checked','Follow','state','unitname','integrity','jurisdictionsquadron', 'unittype','scc', 'time','addstate','weihustate','operation']; - tabledataSource:any - allorganizations:any - oldDataSource:any; //原始表格数据 - integrityScoreMin//下界 - integrityScoreMax//上界 + length: any; //共多少条数据 + pageSize: any; //每页条数 + pageSizeOptions: number[] = [10]; //设置每页条数 + PageNumber: any; //第几页 + + displayedColumns: string[] = [ + "checked", + "Follow", + "state", + "unitname", + "integrity", + "jurisdictionsquadron", + "unittype", + "scc", + "time", + "addstate", + "weihustate", + "operation", + ]; + tabledataSource: any; + allorganizations: any; + oldDataSource: any; //原始表格数据 + integrityScoreMin; //下界 + integrityScoreMax; //上界 //表头排序 - sortData (e) { + sortData(e) { let data = this.tabledataSource.filteredData; //console.log(data.filteredData) // data.filteredData.forEach(element => { @@ -83,141 +119,152 @@ export class KeyUnitManagementComponent implements OnInit { // element.type = typeArr[typeArr.length - 1] // element.newTime = new Date(element.lastModified).getTime() // } - + // }); - if( e.direction=='asc' ) { //从小到大排序 - data.sort( function(a,b) { - return a.newTime - b.newTime - } ) + if (e.direction == "asc") { + //从小到大排序 + data.sort(function (a, b) { + return a.newTime - b.newTime; + }); this.tabledataSource = new MatTableDataSource(data); - } else if ( e.direction=='desc' ) {//从大到小排序 - data.sort( function(a,b) { - return b.newTime - a.newTime - } ) + } else if (e.direction == "desc") { + //从大到小排序 + data.sort(function (a, b) { + return b.newTime - a.newTime; + }); this.tabledataSource = new MatTableDataSource(data); - } else { //原始数据 + } else { + //原始数据 this.tabledataSource = new MatTableDataSource(this.oldDataSource); } } - - colorRgb(sColor){ + + colorRgb(sColor) { var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var sColor = sColor.toLowerCase(); if (sColor && reg.test(sColor)) { - if (sColor.length === 4) { - var sColorNew = "#"; - for (var i = 1; i < 4; i += 1) { - sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); - } - sColor = sColorNew; - } - //处理六位的颜色值 - var sColorChange = []; - for (var i = 1; i < 7; i += 2) { - sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); + if (sColor.length === 4) { + var sColorNew = "#"; + for (var i = 1; i < 4; i += 1) { + sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); } - return sColorChange; + sColor = sColorNew; + } + //处理六位的颜色值 + var sColorChange = []; + for (var i = 1; i < 7; i += 2) { + sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); + } + return sColorChange; } else { - return sColor; + return sColor; } } - colorHex(rgb){ + colorHex(rgb) { var _this = rgb; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; if (/^(rgb|RGB)/.test(_this)) { - var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); - var strHex = "#"; - for (var i = 0; i < aColor.length; i++) { - var hex:any = Number(aColor[i]).toString(16); - hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 - if (hex === "0") { - hex += hex; - } - strHex += hex; - } - if (strHex.length !== 7) { - strHex = _this; + var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); + var strHex = "#"; + for (var i = 0; i < aColor.length; i++) { + var hex: any = Number(aColor[i]).toString(16); + hex = hex < 10 ? 0 + "" + hex : hex; // 保证每个rgb的值为2位 + if (hex === "0") { + hex += hex; } - return strHex; + strHex += hex; + } + if (strHex.length !== 7) { + strHex = _this; + } + return strHex; } else if (reg.test(_this)) { - var aNum = _this.replace(/#/, "").split(""); - if (aNum.length === 6) { - return _this; - } else if (aNum.length === 3) { - var numHex = "#"; - for (var i = 0; i < aNum.length; i += 1) { - numHex += (aNum[i] + aNum[i]); - } - return numHex; + var aNum = _this.replace(/#/, "").split(""); + if (aNum.length === 6) { + return _this; + } else if (aNum.length === 3) { + var numHex = "#"; + for (var i = 0; i < aNum.length; i += 1) { + numHex += aNum[i] + aNum[i]; } + return numHex; + } } else { - return _this; + return _this; } } gradientColor(startColor, endColor, step) { - let _this = this - let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 - let startR = startRGB[0]; - let startG = startRGB[1]; - let startB = startRGB[2]; + let _this = this; + let startRGB = _this.colorRgb(startColor); //转换为rgb数组模式 + let startR = startRGB[0]; + let startG = startRGB[1]; + let startB = startRGB[2]; - let endRGB = _this.colorRgb(endColor); - let endR = endRGB[0]; - let endG = endRGB[1]; - let endB = endRGB[2]; + let endRGB = _this.colorRgb(endColor); + let endR = endRGB[0]; + let endG = endRGB[1]; + let endB = endRGB[2]; - let sR = (endR - startR) / step;//总差值 - let sG = (endG - startG) / step; - let sB = (endB - startB) / step; + let sR = (endR - startR) / step; //总差值 + let sG = (endG - startG) / step; + let sB = (endB - startB) / step; var colorArr = []; for (var i = 0; i < step; i++) { - //计算每一步的hex值 - var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')'); - colorArr.push(hex); + //计算每一步的hex值 + var hex = _this.colorHex( + "rgb(" + + parseInt(sR * i + startR) + + "," + + parseInt(sG * i + startG) + + "," + + parseInt(sB * i + startB) + + ")" + ); + colorArr.push(hex); } return colorArr; -} - integrity(width){ - let _this = this - - let style:any = {} - style.width = width +'%'; - if(width < 30){ - let colorArr = this.gradientColor('#D50000', '#E53935', 30); - for(let i = 0; i < 30; i++){ - if( i == width){ - style.background = colorArr[i] + } + integrity(width) { + let _this = this; + + let style: any = {}; + style.width = width + "%"; + if (width < 30) { + let colorArr = this.gradientColor("#D50000", "#E53935", 30); + for (let i = 0; i < 30; i++) { + if (i == width) { + style.background = colorArr[i]; } } } - if(width >= 30 && width < 60){ - let colorArr = this.gradientColor('#FF9800', '#E65100', 30); - for(let i = 30; i < 60; i++){ - if( i == width){ - style.background = colorArr[i-30] + if (width >= 30 && width < 60) { + let colorArr = this.gradientColor("#FF9800", "#E65100", 30); + for (let i = 30; i < 60; i++) { + if (i == width) { + style.background = colorArr[i - 30]; } } } - if(width >= 60){ - let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); - for(let i = 60; i <= 100; i++){ - if( i == width){ - style.background = colorArr[i-60] + if (width >= 60) { + let colorArr = this.gradientColor("#81C784", "#2E7D32", 41); + for (let i = 60; i <= 100; i++) { + if (i == width) { + style.background = colorArr[i - 60]; } } } - return style + return style; } - integrityDetails(width,zong){ - let style:any = {} - style.width = (width/zong)*100 +'%'; - return style + integrityDetails(width, zong) { + let style: any = {}; + style.width = (width / zong) * 100 + "%"; + return style; } //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 + chagePage(e) { + this.PageNumber = e.pageIndex + 1; this.getAllKeyUnit(); } ngOnInit(): void { @@ -226,570 +273,638 @@ export class KeyUnitManagementComponent implements OnInit { this.getOrganizations(); this.getUnittype(); this.getAllKeyUnit(); - if(window.matchMedia("(max-width: 1290px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1290px)").matches) { + this.pcMore = false; + this.padMore = true; + this.pcfind = false; + this.padjt = true; + } else { + this.pcfind = true; + this.pcMore = true; + this.padMore = false; + this.padjt = false; } } //获得所有重点单位 wanzhengduArr = [ - {id:0,zong:94,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:8,totalpoints:10}, - {name:'平面图',score:8,totalpoints:10}, - {name:'四周毗邻',score:25,totalpoints:25}, - {name:'消防设施',score:10,totalpoints:10}, - {name:'重点部位',score:10,totalpoints:10}, - {name:'功能分区',score:8,totalpoints:10}, - {name:'实景图',score:10,totalpoints:10}, - {name:'CAD上传',score:10,totalpoints:10}, - ]}, - {id:1,zong:82,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:8,totalpoints:10}, - {name:'平面图',score:8,totalpoints:10}, - {name:'四周毗邻',score:25,totalpoints:25}, - {name:'消防设施',score:8,totalpoints:10}, - {name:'重点部位',score:8,totalpoints:10}, - {name:'功能分区',score:6,totalpoints:10}, - {name:'实景图',score:8,totalpoints:10}, - {name:'CAD上传',score:6,totalpoints:10}, - ]}, - {id:2,zong:72,details:[ - {name:'单位信息',score:3,totalpoints:5}, - {name:'建筑信息',score:5,totalpoints:10}, - {name:'平面图',score:8,totalpoints:10}, - {name:'四周毗邻',score:22,totalpoints:25}, - {name:'消防设施',score:7,totalpoints:10}, - {name:'重点部位',score:7,totalpoints:10}, - {name:'功能分区',score:6,totalpoints:10}, - {name:'实景图',score:8,totalpoints:10}, - {name:'CAD上传',score:6,totalpoints:10}, - ]}, - {id:3,zong:61,details:[ - {name:'单位信息',score:3,totalpoints:5}, - {name:'建筑信息',score:5,totalpoints:10}, - {name:'平面图',score:7,totalpoints:10}, - {name:'四周毗邻',score:18,totalpoints:25}, - {name:'消防设施',score:5,totalpoints:10}, - {name:'重点部位',score:3,totalpoints:10}, - {name:'功能分区',score:5,totalpoints:10}, - {name:'实景图',score:8,totalpoints:10}, - {name:'CAD上传',score:6,totalpoints:10}, - ]}, - {id:4,zong:60,details:[ - {name:'单位信息',score:3,totalpoints:5}, - {name:'建筑信息',score:5,totalpoints:10}, - {name:'平面图',score:6,totalpoints:10}, - {name:'四周毗邻',score:18,totalpoints:25}, - {name:'消防设施',score:5,totalpoints:10}, - {name:'重点部位',score:3,totalpoints:10}, - {name:'功能分区',score:5,totalpoints:10}, - {name:'实景图',score:8,totalpoints:10}, - {name:'CAD上传',score:6,totalpoints:10}, - ]}, - {id:5,zong:53,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:5,totalpoints:10}, - {name:'平面图',score:5,totalpoints:10}, - {name:'四周毗邻',score:10,totalpoints:25}, - {name:'消防设施',score:5,totalpoints:10}, - {name:'重点部位',score:5,totalpoints:10}, - {name:'功能分区',score:5,totalpoints:10}, - {name:'实景图',score:7,totalpoints:10}, - {name:'CAD上传',score:6,totalpoints:10}, - ]}, - {id:6,zong:45,details:[ - {name:'单位信息',score:3,totalpoints:5}, - {name:'建筑信息',score:5,totalpoints:10}, - {name:'平面图',score:5,totalpoints:10}, - {name:'四周毗邻',score:15,totalpoints:25}, - {name:'消防设施',score:5,totalpoints:10}, - {name:'重点部位',score:5,totalpoints:10}, - {name:'功能分区',score:3,totalpoints:10}, - {name:'实景图',score:5,totalpoints:10}, - {name:'CAD上传',score:4,totalpoints:10}, - ]}, - {id:7,zong:30,details:[ - {name:'单位信息',score:3,totalpoints:5}, - {name:'建筑信息',score:0,totalpoints:10}, - {name:'平面图',score:4,totalpoints:10}, - {name:'四周毗邻',score:2,totalpoints:25}, - {name:'消防设施',score:5,totalpoints:10}, - {name:'重点部位',score:5,totalpoints:10}, - {name:'功能分区',score:2,totalpoints:10}, - {name:'实景图',score:6,totalpoints:10}, - {name:'CAD上传',score:3,totalpoints:10}, - ]}, - {id:8,zong:20,details:[ - {name:'单位信息',score:3,totalpoints:5}, - {name:'建筑信息',score:2,totalpoints:10}, - {name:'平面图',score:0,totalpoints:10}, - {name:'四周毗邻',score:3,totalpoints:25}, - {name:'消防设施',score:3,totalpoints:10}, - {name:'重点部位',score:3,totalpoints:10}, - {name:'功能分区',score:3,totalpoints:10}, - {name:'实景图',score:2,totalpoints:10}, - {name:'CAD上传',score:1,totalpoints:10}, - ]}, - {id:9,zong:13,details:[ - {name:'单位信息',score:5,totalpoints:5}, - {name:'建筑信息',score:3,totalpoints:10}, - {name:'平面图',score:0,totalpoints:10}, - {name:'四周毗邻',score:2,totalpoints:25}, - {name:'消防设施',score:0,totalpoints:10}, - {name:'重点部位',score:3,totalpoints:10}, - {name:'功能分区',score:0,totalpoints:10}, - {name:'实景图',score:0,totalpoints:10}, - {name:'CAD上传',score:0,totalpoints:10}, - ]} - ] + { + id: 0, + zong: 94, + details: [ + { name: "单位信息", score: 5, totalpoints: 5 }, + { name: "建筑信息", score: 8, totalpoints: 10 }, + { name: "平面图", score: 8, totalpoints: 10 }, + { name: "四周毗邻", score: 25, totalpoints: 25 }, + { name: "消防设施", score: 10, totalpoints: 10 }, + { name: "重点部位", score: 10, totalpoints: 10 }, + { name: "功能分区", score: 8, totalpoints: 10 }, + { name: "实景图", score: 10, totalpoints: 10 }, + { name: "CAD上传", score: 10, totalpoints: 10 }, + ], + }, + { + id: 1, + zong: 82, + details: [ + { name: "单位信息", score: 5, totalpoints: 5 }, + { name: "建筑信息", score: 8, totalpoints: 10 }, + { name: "平面图", score: 8, totalpoints: 10 }, + { name: "四周毗邻", score: 25, totalpoints: 25 }, + { name: "消防设施", score: 8, totalpoints: 10 }, + { name: "重点部位", score: 8, totalpoints: 10 }, + { name: "功能分区", score: 6, totalpoints: 10 }, + { name: "实景图", score: 8, totalpoints: 10 }, + { name: "CAD上传", score: 6, totalpoints: 10 }, + ], + }, + { + id: 2, + zong: 72, + details: [ + { name: "单位信息", score: 3, totalpoints: 5 }, + { name: "建筑信息", score: 5, totalpoints: 10 }, + { name: "平面图", score: 8, totalpoints: 10 }, + { name: "四周毗邻", score: 22, totalpoints: 25 }, + { name: "消防设施", score: 7, totalpoints: 10 }, + { name: "重点部位", score: 7, totalpoints: 10 }, + { name: "功能分区", score: 6, totalpoints: 10 }, + { name: "实景图", score: 8, totalpoints: 10 }, + { name: "CAD上传", score: 6, totalpoints: 10 }, + ], + }, + { + id: 3, + zong: 61, + details: [ + { name: "单位信息", score: 3, totalpoints: 5 }, + { name: "建筑信息", score: 5, totalpoints: 10 }, + { name: "平面图", score: 7, totalpoints: 10 }, + { name: "四周毗邻", score: 18, totalpoints: 25 }, + { name: "消防设施", score: 5, totalpoints: 10 }, + { name: "重点部位", score: 3, totalpoints: 10 }, + { name: "功能分区", score: 5, totalpoints: 10 }, + { name: "实景图", score: 8, totalpoints: 10 }, + { name: "CAD上传", score: 6, totalpoints: 10 }, + ], + }, + { + id: 4, + zong: 60, + details: [ + { name: "单位信息", score: 3, totalpoints: 5 }, + { name: "建筑信息", score: 5, totalpoints: 10 }, + { name: "平面图", score: 6, totalpoints: 10 }, + { name: "四周毗邻", score: 18, totalpoints: 25 }, + { name: "消防设施", score: 5, totalpoints: 10 }, + { name: "重点部位", score: 3, totalpoints: 10 }, + { name: "功能分区", score: 5, totalpoints: 10 }, + { name: "实景图", score: 8, totalpoints: 10 }, + { name: "CAD上传", score: 6, totalpoints: 10 }, + ], + }, + { + id: 5, + zong: 53, + details: [ + { name: "单位信息", score: 5, totalpoints: 5 }, + { name: "建筑信息", score: 5, totalpoints: 10 }, + { name: "平面图", score: 5, totalpoints: 10 }, + { name: "四周毗邻", score: 10, totalpoints: 25 }, + { name: "消防设施", score: 5, totalpoints: 10 }, + { name: "重点部位", score: 5, totalpoints: 10 }, + { name: "功能分区", score: 5, totalpoints: 10 }, + { name: "实景图", score: 7, totalpoints: 10 }, + { name: "CAD上传", score: 6, totalpoints: 10 }, + ], + }, + { + id: 6, + zong: 45, + details: [ + { name: "单位信息", score: 3, totalpoints: 5 }, + { name: "建筑信息", score: 5, totalpoints: 10 }, + { name: "平面图", score: 5, totalpoints: 10 }, + { name: "四周毗邻", score: 15, totalpoints: 25 }, + { name: "消防设施", score: 5, totalpoints: 10 }, + { name: "重点部位", score: 5, totalpoints: 10 }, + { name: "功能分区", score: 3, totalpoints: 10 }, + { name: "实景图", score: 5, totalpoints: 10 }, + { name: "CAD上传", score: 4, totalpoints: 10 }, + ], + }, + { + id: 7, + zong: 30, + details: [ + { name: "单位信息", score: 3, totalpoints: 5 }, + { name: "建筑信息", score: 0, totalpoints: 10 }, + { name: "平面图", score: 4, totalpoints: 10 }, + { name: "四周毗邻", score: 2, totalpoints: 25 }, + { name: "消防设施", score: 5, totalpoints: 10 }, + { name: "重点部位", score: 5, totalpoints: 10 }, + { name: "功能分区", score: 2, totalpoints: 10 }, + { name: "实景图", score: 6, totalpoints: 10 }, + { name: "CAD上传", score: 3, totalpoints: 10 }, + ], + }, + { + id: 8, + zong: 20, + details: [ + { name: "单位信息", score: 3, totalpoints: 5 }, + { name: "建筑信息", score: 2, totalpoints: 10 }, + { name: "平面图", score: 0, totalpoints: 10 }, + { name: "四周毗邻", score: 3, totalpoints: 25 }, + { name: "消防设施", score: 3, totalpoints: 10 }, + { name: "重点部位", score: 3, totalpoints: 10 }, + { name: "功能分区", score: 3, totalpoints: 10 }, + { name: "实景图", score: 2, totalpoints: 10 }, + { name: "CAD上传", score: 1, totalpoints: 10 }, + ], + }, + { + id: 9, + zong: 13, + details: [ + { name: "单位信息", score: 5, totalpoints: 5 }, + { name: "建筑信息", score: 3, totalpoints: 10 }, + { name: "平面图", score: 0, totalpoints: 10 }, + { name: "四周毗邻", score: 2, totalpoints: 25 }, + { name: "消防设施", score: 0, totalpoints: 10 }, + { name: "重点部位", score: 3, totalpoints: 10 }, + { name: "功能分区", score: 0, totalpoints: 10 }, + { name: "实景图", score: 0, totalpoints: 10 }, + { name: "CAD上传", score: 0, totalpoints: 10 }, + ], + }, + ]; - allKeyUnitInfo:any //所有的重点单位 - IsNewData=''//是否是新增或者维护更新 - getAllKeyUnit(){ + allKeyUnitInfo: any; //所有的重点单位 + IsNewData = ""; //是否是新增或者维护更新 + getAllKeyUnit() { // console.log(Boolean(Number(this.follow))) - let follow - if(this.follow == ''){ - follow = '' + let follow; + if (this.follow == "") { + follow = ""; } - if(this.follow == '0'){ - follow = false + if (this.follow == "0") { + follow = false; } - if(this.follow == '1'){ - follow = true + if (this.follow == "1") { + follow = true; } - let paramsdata:any = { - Name: this.companyName || '', - OrganizationId: this.jsId || '', - HasChildren:this.jscheck || '', - USCI:this.shehui || '', + 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 || '', - IsNewData:this.IsNewData, - IntegrityScoreMin:this.integrityScoreMin/100||0, - IntegrityScoreMax:this.integrityScoreMax/100||1 - } - 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 = data.items - }) + BuildingTypeId: this.unittype || "", + PageNumber: this.PageNumber || "1", + PageSize: this.pageSizeOptions[0], + Sort: this.integritySort ? "integrityscore" : "", + SortType: this.integritySort || "", + IsNewData: this.IsNewData, + IntegrityScoreMin: this.integrityScoreMin / 100 || 0, + IntegrityScoreMax: this.integrityScoreMax / 100 || 1, + }; + 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 = data.items; + }); } //得到当前单位信息 - getunitdata(){ - this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ - this.organizationName = data.organizationName - } - ) + 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 + 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) + 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 - } + 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(); - } - ) + 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 - } - ) + getUnittype() { + this.http.get("/api/BuildingTypes/Simple").subscribe((data) => { + this.allunittype = data; + }); } - selectedunitArr:any =[] //选中单位的数组 + selectedunitArr: any = []; //选中单位的数组 //勾选框事件 - verifyState //判断是否可以修改 - checkChange(e,element){ - if(element.contentVerify!=null){ - this.verifyState=element.contentVerify.verifyState - - }else{ - this.verifyState=null + verifyState; //判断是否可以修改 + checkChange(e, element) { + if (element.contentVerify != null) { + this.verifyState = element.contentVerify.verifyState; + } else { + this.verifyState = null; } - if(e.checked){ + if (e.checked) { //this.deleteArr=element - this.deleteAll.push(element) - }else{ - for(var i=0;i { - if(item.checked){ - selectedunitArr.push(item.id) - selectedunitobj.push(item) + config.verticalPosition = "top"; + config.duration = 3000; + let selectedunitArr = []; + let selectedunitobj = []; + this.allKeyUnitInfo.items.forEach((item) => { + if (item.checked) { + selectedunitArr.push(item.id); + selectedunitobj.push(item); } }); - if(selectedunitArr.length == 0){ - this.snackBar.open('请先选择要修改的单位','确定',config); + if (selectedunitArr.length == 0) { + this.snackBar.open("请先选择要修改的单位", "确定", config); } - if(selectedunitArr.length != 1 && selectedunitArr.length != 0){ + if (selectedunitArr.length != 1 && selectedunitArr.length != 0) { const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('只能选择一个单位修改','确定',config); + config.verticalPosition = "top"; + config.duration = 3000; + this.snackBar.open("只能选择一个单位修改", "确定", config); } - if(selectedunitArr.length == 1){ //带着id跳到修改页面 - this.allKeyUnitInfo.items.forEach(item => { - if(item.id == selectedunitArr[0]){ - let companyName = item.name - sessionStorage.setItem("companyName",companyName) - sessionStorage.setItem("companyId",item.id) + if (selectedunitArr.length == 1) { + //带着id跳到修改页面 + this.allKeyUnitInfo.items.forEach((item) => { + if (item.id == selectedunitArr[0]) { + let companyName = item.name; + sessionStorage.setItem("companyName", companyName); + sessionStorage.setItem("companyId", item.id); } }); - sessionStorage.setItem("editable","1") - sessionStorage.setItem(selectedunitobj[0].id,JSON.stringify(selectedunitobj[0].companyIntegrityScore)) - window.open(`/keyUnit/editplaninfo?id=${selectedunitArr[0]}&usci=${selectedunitobj[0].usci}`); + sessionStorage.setItem("editable", "1"); + sessionStorage.setItem( + selectedunitobj[0].id, + JSON.stringify(selectedunitobj[0].companyIntegrityScore) + ); + window.open( + `/keyUnit/editplaninfo?id=${selectedunitArr[0]}&usci=${selectedunitobj[0].usci}` + ); } } //关注重点单位 - Follow(element){ + Follow(element) { // console.log(element) - this.http.put(`/api/Companies/${element.id}/Follow`,'').subscribe(data=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('设为重点单位成功','确定',config); - this.getAllKeyUnit(); - - }) + this.http + .put(`/api/Companies/${element.id}/Follow`, "") + .subscribe((data) => { + const config = new MatSnackBarConfig(); + config.verticalPosition = "top"; + config.duration = 3000; + this.snackBar.open("设为重点单位成功", "确定", config); + this.getAllKeyUnit(); + }); } //取消关注 - unFollow(element){ + unFollow(element) { // console.log(element) - this.http.put(`/api/Companies/${element.id}/Unfollow`,'').subscribe(data=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('设为一般单位成功','确定',config); - this.getAllKeyUnit(); - }) + this.http + .put(`/api/Companies/${element.id}/Unfollow`, "") + .subscribe((data) => { + const config = new MatSnackBarConfig(); + config.verticalPosition = "top"; + config.duration = 3000; + this.snackBar.open("设为一般单位成功", "确定", config); + this.getAllKeyUnit(); + }); } //删除单位信息 - deleteAudia=[]//批量删除提交数组 - deleteunit(){ - this.deleteAudia=[] + deleteAudia = []; //批量删除提交数组 + deleteunit() { + this.deleteAudia = []; const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 + config.verticalPosition = "top"; + config.duration = 3000; //console.log(this.deleteAll) - if(this.verifyState==0||this.verifyState==3){ - this.snackBar.open('审核中,不能删除','确定',config); - }else{ - let selectedunitArr = [] - this.allKeyUnitInfo.items.forEach(item => { - if(item.checked){ - selectedunitArr.push(item.id) - } - }); + if (this.verifyState == 0 || this.verifyState == 3) { + this.snackBar.open("审核中,不能删除", "确定", config); + } else { + let selectedunitArr = []; + this.allKeyUnitInfo.items.forEach((item) => { + if (item.checked) { + selectedunitArr.push(item.id); + } + }); - if(selectedunitArr.length == 0){ - - this.snackBar.open('请先选择要删除的单位','确定',config); - } - /* if(selectedunitArr.length != 1 && selectedunitArr.length != 0){ + if (selectedunitArr.length == 0) { + 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(this.deleteAll.length == 1){ //带着id跳到删除页面 - let isTrue = confirm('重点单位删除需审核员审核,审核通过方可删除') - if(isTrue){ - let body:any = { - title:this.deleteAll[0].name, - Operation:2, - itemId:this.deleteAll[0].id, - verifyState:3, - contentType:11 - } - this.http.post(`/api/ContentVerifies`,body).subscribe(data=>{ - this.snackBar.open('操作成功','确定',config); - this.getAllKeyUnit() - },err=>{ - this.snackBar.open(err,'确定',config); - }) - } - - }else if(this.deleteAll.length > 1){ - let isTrue = confirm('重点单位删除需审核员审核,审核通过方可删除') - if(isTrue){ - for(var i=0;i { + this.snackBar.open("操作成功", "确定", config); + this.getAllKeyUnit(); + }, + (err) => { + this.snackBar.open(err, "确定", config); + } + ); + } + } else if (this.deleteAll.length > 1) { + let isTrue = confirm("重点单位删除需审核员审核,审核通过方可删除"); + if (isTrue) { + for (var i = 0; i < this.deleteAll.length; i++) { + let body: any = { + title: this.deleteAll[i].name, + Operation: 2, + itemId: this.deleteAll[i].id, + verifyState: 3, + contentType: 11, + }; + this.deleteAudia.push(body); + } + + this.http + .post(`/api/ContentVerifies/Batch`, this.deleteAudia) + .subscribe( + (data) => { + this.snackBar.open("操作成功", "确定", config); + this.getAllKeyUnit(); + this.deleteAll = []; + }, + (err) => { + this.snackBar.open(err, "确定", config); + } + ); } - - this.http.post(`/api/ContentVerifies/Batch`,this.deleteAudia).subscribe(data=>{ - this.snackBar.open('操作成功','确定',config); - this.getAllKeyUnit() - this.deleteAll=[] - },err=>{ - this.snackBar.open(err,'确定',config); - }) } } - } - } - //重置 - 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.integrityScoreMax=undefined - this.integrityScoreMin=undefined - this.IsNewData='' - + 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.integrityScoreMax = undefined; + this.integrityScoreMin = undefined; + this.IsNewData = ""; + this.getAllKeyUnit(); } //编辑单位名称 - editUnitName(element){ + editUnitName(element) { //console.log(element) const dialogRef = this.dialog.open(upname, { - width: '340px', - height:'280px', - data: element + width: "340px", + height: "280px", + data: element, }); - dialogRef.afterClosed().subscribe(result => { - //console.log(result); - element.name=result + dialogRef.afterClosed().subscribe((result) => { + //console.log(result); + element.name = result; }); } - + //跳转查看基本信息页面 - unitdetails(element){ + unitdetails(element) { // console.log(element) - sessionStorage.setItem("editable","0") - sessionStorage.setItem("companyName",element.name) - sessionStorage.setItem("companyId",element.id) - sessionStorage.setItem(element.id,JSON.stringify(element.companyIntegrityScore)) - window.open(`/keyUnit/viewunitinfo?id=${element.id}&usci=${element.usci}`,'_blank'); + sessionStorage.setItem("editable", "0"); + sessionStorage.setItem("companyName", element.name); + sessionStorage.setItem("companyId", element.id); + sessionStorage.setItem( + element.id, + JSON.stringify(element.companyIntegrityScore) + ); + window.open( + `/keyUnit/viewunitinfo?id=${element.id}&usci=${element.usci}`, + "_blank" + ); } //提交查询表单 - onSubmit(value){ - this.PageNumber = 1 - this.pageEvent.pageIndex = 0 - this.getAllKeyUnit() - + onSubmit(value) { + this.PageNumber = 1; + this.pageEvent.pageIndex = 0; + this.getAllKeyUnit(); } - bigclosediv(e){ - this.isorganizationbox = false + bigclosediv(e) { + this.isorganizationbox = false; } - stopclose(e){ + stopclose(e) { e.stopPropagation(); } //辖区中队div是否显示 - isorganizationbox:boolean = false + isorganizationbox: boolean = false; //点击辖区中队树,将选择的辖区中队添加到变量 add(node) { - this.isorganizationbox = false - this.js = node.name - this.jsId = node.id + this.isorganizationbox = false; + this.js = node.name; + this.jsId = node.id; } //关闭辖区中队隐藏框 closeorganizationbox() { - this.isorganizationbox = false + this.isorganizationbox = false; } //打开辖区中队隐藏框 openorganizationbox() { - this.isorganizationbox = true - + this.isorganizationbox = true; } - + //关闭出现的组织机构div - closediv(){ - this.isorganizationbox = false + closediv() { + this.isorganizationbox = false; } //新增重点单位 - createunit(){ + createunit() { // console.log(this.newallorganizations2) - const dialogRef = this.dialog.open(CreateUnit, {//调用open方法打开对话框并且携带参数过去 - width: '625px', - data: {allunittype:this.allunittype,allorganizations:this.newallorganizations2} + const dialogRef = this.dialog.open(CreateUnit, { + //调用open方法打开对话框并且携带参数过去 + width: "625px", + data: { + allunittype: this.allunittype, + allorganizations: this.newallorganizations2, + }, }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('创建成功','确定',config); - this.getAllKeyUnit(); - sessionStorage.setItem("companyName",data.name) - sessionStorage.setItem("editable","1") - sessionStorage.setItem("companyId",data.id) - window.open(`/keyUnit/editplaninfo?id=${data.id}&usci=${data.usci}`); - } + dialogRef.afterClosed().subscribe((data) => { + if (data) { + const config = new MatSnackBarConfig(); + config.verticalPosition = "top"; + config.duration = 3000; + this.snackBar.open("创建成功", "确定", config); + this.getAllKeyUnit(); + sessionStorage.setItem("companyName", data.name); + sessionStorage.setItem("editable", "1"); + sessionStorage.setItem("companyId", data.id); + window.open(`/keyUnit/editplaninfo?id=${data.id}&usci=${data.usci}`); } - ); + }); } //提交审核 - submitAudit(element){ - console.log(element) - let body:any = { - title:element.name, - Operation:element.contentVerify==null&&element.isNewData? 0:1, - itemId:element.id, - verifyState:3, - contentType:11 - } - this.http.post(`/api/ContentVerifies`,body).subscribe(data=>{ - this.getAllKeyUnit() - },err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open(err,'确定',config); - }) - + submitAudit(element) { + console.log(element); + let body: any = { + title: element.name, + Operation: element.contentVerify == null && element.isNewData ? 0 : 1, + itemId: element.id, + verifyState: 3, + contentType: 11, + }; + this.http.post(`/api/ContentVerifies`, body).subscribe( + (data) => { + this.getAllKeyUnit(); + }, + (err) => { + const config = new MatSnackBarConfig(); + config.verticalPosition = "top"; + config.duration = 3000; + this.snackBar.open(err, "确定", config); + } + ); } //撤销审核 - cancelAudit(element){ - this.deleteAll=[] - this.http.delete(`/api/ContentVerifies/${element.contentVerify.id}`).subscribe(data=>{ - this.getAllKeyUnit() - }, - err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open(err,'确定',config); - }) + cancelAudit(element) { + this.deleteAll = []; + this.http + .delete(`/api/ContentVerifies/${element.contentVerify.id}`) + .subscribe( + (data) => { + this.getAllKeyUnit(); + }, + (err) => { + const config = new MatSnackBarConfig(); + config.verticalPosition = "top"; + config.duration = 3000; + this.snackBar.open(err, "确定", config); + } + ); } //审核结果 - auditResult(element){ + auditResult(element) { const dialogRef = this.dialog.open(companyAuditResult, { - width:"400px", + width: "400px", //height:"300px", - data: {element:element} + data: { element: element }, }); - } -} + //上传演练记录 + drill(element) { + console.log(element); + const dialogRef = this.dialog.open(UploadDrillComponent, { + width: "700px", + data: { unitInfo: element }, + }); + dialogRef.afterClosed().subscribe((result) => { + console.log("The dialog was closed"); + }); + } +} //创建重点单位 @Component({ - selector: 'createunit', - templateUrl: './createunit.component.html', - styleUrls: ['./key-unit-management.component.scss'] + selector: "createunit", + templateUrl: "./createunit.component.html", + styleUrls: ["./key-unit-management.component.scss"], }) export class CreateUnit { myControl = new FormControl(); @@ -800,31 +915,45 @@ export class CreateUnit { level: level, id: node.id, parentId: node.parentId, - enabled:node.enabled, - order:node.order, + enabled: node.enabled, + order: node.order, }; - } - treeControl = new FlatTreeControl(node => node.level, node => node.expandable); - treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => 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); - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar,private tree: TreeService) {} + constructor( + private http: HttpClient, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data, + public snackBar: MatSnackBar, + private tree: TreeService + ) {} hasChild = (_: number, node: any) => node.expandable; - allunittype = this.data.allunittype - js:any //所属辖区中队 - jsId:any //所属辖区中队的id + allunittype = this.data.allunittype; + js: any; //所属辖区中队 + jsId: any; //所属辖区中队的id ngOnInit(): void { - this.dataSource.data = this.data.allorganizations + this.dataSource.data = this.data.allorganizations; } onNoClick(): void { this.dialogRef.close(); } - add(node){ - this.js = node.name - this.jsId = node.id + add(node) { + this.js = node.name; + this.jsId = node.id; } - onSubmit(value){ + onSubmit(value) { let myDate = new Date(); - let usci = new Date().getTime() + '00000' + let usci = new Date().getTime() + "00000"; let body = { id: "", name: value.name, @@ -835,7 +964,7 @@ export class CreateUnit { imageUrl: "", location: { x: 0, - y: 0 + y: 0, }, modifiedTime: myDate, organizationId: this.jsId, @@ -843,93 +972,110 @@ export class CreateUnit { buildingTypes: [ { id: value.unittype, - name: "" - } - ] - } - this.http.post("/api/Companies",body).subscribe( - data=>{ - this.dialogRef.close(data); - }, - err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open(err,'确定',config); - }) + name: "", + }, + ], + }; + this.http.post("/api/Companies", body).subscribe( + (data) => { + this.dialogRef.close(data); + }, + (err) => { + const config = new MatSnackBarConfig(); + config.verticalPosition = "top"; + config.duration = 3000; + this.snackBar.open(err, "确定", config); + } + ); } } //修改单位名称 @Component({ - selector: 'upname', - templateUrl: './upname.html', - styleUrls: ['./upname.scss'] + selector: "upname", + templateUrl: "./upname.html", + styleUrls: ["./upname.scss"], }) -export class upname{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} - unitname:string//修改后的名称 - oldname=this.data.name//原名 - oldid=this.data.id +export class upname { + constructor( + private router: Router, + private http: HttpClient, + public dialog: MatDialog, + public snackBar: MatSnackBar, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} + unitname: string; //修改后的名称 + oldname = this.data.name; //原名 + oldid = this.data.id; //取消 - close(){ + close() { this.dialogRef.close(this.oldname); } //确定 - updateName(){ + updateName() { //console.log(this.unitname) const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - if(this.unitname==''||this.unitname==undefined){ - this.snackBar.open('请填写新单位名称','确定',config); - }else if(this.unitname==this.oldname){ - this.snackBar.open('新单位名称不能和旧单位名称一样','确定',config); - } - else{ - let paramsdata:any = { - id:this.oldid, - name: this.unitname - } - this.http.put(`/api/Companies/${this.oldid}/UpdateName`,paramsdata).subscribe((data:any)=>{ - this.snackBar.open("修改名字成功",'确定',config); - },err => { - this.snackBar.open(err,'确定',config); - }) + config.verticalPosition = "top"; + config.duration = 3000; + if (this.unitname == "" || this.unitname == undefined) { + this.snackBar.open("请填写新单位名称", "确定", config); + } else if (this.unitname == this.oldname) { + this.snackBar.open("新单位名称不能和旧单位名称一样", "确定", config); + } else { + let paramsdata: any = { + id: this.oldid, + name: this.unitname, + }; + this.http + .put(`/api/Companies/${this.oldid}/UpdateName`, paramsdata) + .subscribe( + (data: any) => { + this.snackBar.open("修改名字成功", "确定", config); + }, + (err) => { + this.snackBar.open(err, "确定", config); + } + ); this.dialogRef.close(this.unitname); } - } } //查看审核结果 @Component({ - selector: 'resultmeet', - templateUrl: './resultcompanyPlan.html', - styleUrls: ['./key-unit-management.component.scss'] + selector: "resultmeet", + templateUrl: "./resultcompanyPlan.html", + styleUrls: ["./key-unit-management.component.scss"], }) -export class companyAuditResult{ - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} - planName:any = this.data.element.name - createTime='' - organizationName=this.data.element.organizationName - verifyTime='' - remark='' - verifyOrganizationName - verifyState=100 +export class companyAuditResult { + constructor( + private http: HttpClient, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data, + public snackBar: MatSnackBar + ) {} + planName: any = this.data.element.name; + createTime = ""; + organizationName = this.data.element.organizationName; + verifyTime = ""; + remark = ""; + verifyOrganizationName; + verifyState = 100; ngOnInit(): void { - if(this.data.element.contentVerify!=null){ - this.createTime=this.data.element.contentVerify.createTime + if (this.data.element.contentVerify != null) { + this.createTime = this.data.element.contentVerify.createTime; //this.organizationName=this.data.element.organizationName - this.verifyTime=this.data.element.contentVerify.verifyTime + this.verifyTime = this.data.element.contentVerify.verifyTime; //this.remark=this.data.element.remark - this.verifyState=this.data.element.contentVerify.verifyState - this.verifyOrganizationName=this.data.element.contentVerify.verifyOrganizationName - this.remark=this.data.element.contentVerify.remark + this.verifyState = this.data.element.contentVerify.verifyState; + this.verifyOrganizationName = + this.data.element.contentVerify.verifyOrganizationName; + this.remark = this.data.element.contentVerify.remark; } } onNoClick(): void { this.dialogRef.close(); } -} \ No newline at end of file +} diff --git a/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html new file mode 100644 index 0000000..1247ec7 --- /dev/null +++ b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html @@ -0,0 +1,112 @@ +

上传演练记录

+
+
+
+ 单位信息 +
+
+
+ 单位名称: + {{data.unitInfo.name}} +
+
+ 单位地址: + {{data.unitInfo.address}} +
+
+ 联系人: + {{data.unitInfo.contacts}} +
+
+ 联系电话: + {{data.unitInfo.phone}} +
+
+
+
+
+ 调研人员 +
+
+
+ 带队人员: + +
+
+ 熟悉时间: + +
+
+ 调研照片: +
+ + +
    +
  • + + cancel + +
  • +
+
+
+
+
+
+
+ 熟悉内容 +
+
+
+ 水源照片: +
+ + +
    +
  • + + cancel + +
  • +
+
+
+
+ 疏散通道: +
+ + +
    +
  • + + cancel + +
  • +
+
+
+
+ 消控室: +
+ + +
    +
  • + + cancel + +
  • +
+
+
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.scss b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.scss new file mode 100644 index 0000000..b1ec3b1 --- /dev/null +++ b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.scss @@ -0,0 +1,120 @@ +.box { + width: 100%; + position: relative; + + .contentItem { + display: flex; + margin: 6px 0; + border-bottom: 1px dashed rgb(180, 178, 178); + + .title { + width: 75px; + color: #1890ff; + display: flex; + align-items: center; + } + + .content { + flex: 1; + display: flex; + flex-wrap: wrap; + + div { + margin-bottom: 3px; + + .name { + display: inline-block; + width: 70px; + margin-right: 3px; + text-align: right; + } + } + } + + .peoplecontent, + .photocontent { + flex-direction: column; + + div { + display: flex; + align-items: center; + + input, + nz-range-picker { + flex: 1; + } + } + } + + .textbox { + height: 32px; + line-height: 32px; + width: 50%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + } + + .uploadbox { + position: relative; + display: flex; + align-items: center; + + input { + width: 88px; + height: 32px; + position: absolute; + left: 0; + top: 0; + opacity: 0; + z-index: 2; + cursor: pointer; + } + + button { + z-index: 1; + cursor: pointer; + } + + .imgbox { + height: 100%; + display: flex; + align-items: center; + + li { + display: flex; + align-items: center; + position: relative; + } + + img { + width: 50px; + height: 50px; + margin: 0 5px; + cursor: pointer; + } + .close{ + position: absolute; + right: 0; + top: 0; + font-size: 15px; + cursor: pointer; + } + } + } + } + + .mask { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.2); + display: flex; + justify-content: center; + align-items: center; + z-index: 3; + } +} diff --git a/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.spec.ts b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.spec.ts new file mode 100644 index 0000000..55bd2c8 --- /dev/null +++ b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UploadDrillComponent } from './upload-drill.component'; + +describe('UploadDrillComponent', () => { + let component: UploadDrillComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UploadDrillComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UploadDrillComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts new file mode 100644 index 0000000..0628272 --- /dev/null +++ b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts @@ -0,0 +1,175 @@ +import { HttpClient } from "@angular/common/http"; +import { Component, OnInit, Inject } from "@angular/core"; +import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; +import { ObjectsService } from "@src/app/services/objects.service"; +import { DatePipe } from "@angular/common"; +import { MatSnackBar } from "@angular/material/snack-bar"; +@Component({ + selector: "app-upload-drill", + templateUrl: "./upload-drill.component.html", + styleUrls: ["./upload-drill.component.scss"], + providers: [DatePipe], +}) +export class UploadDrillComponent implements OnInit { + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private objectsSer: ObjectsService, + private http: HttpClient, + private datePipe: DatePipe, + public snackBar: MatSnackBar + ) {} + + ngOnInit(): void { + console.log(this.data); + this.getData(); + } + + isHttpPost; + getData() { + this.http + .get("/api/DrillRecords", { + params: { + CompanyId: this.data.unitInfo.id, + }, + }) + .subscribe((data: any) => { + console.log("演练记录数据", data); + if (data.totalCount === 0) { + this.isHttpPost = true; + } else { + this.isHttpPost = false; + let item = data.items[0]; + this.drillId = item.id; + this.teamLeader = item.teamLeader; + this.time = [item.startTime, item.endTime]; + this.surveyPhoto = JSON.parse(item.images); + this.waterPhoto = JSON.parse(item.waterSource); + this.routePhoto = JSON.parse(item.escapeRoute); + this.fireControlPhoto = JSON.parse(item.fireControlRoom); + } + }); + } + + surveyPhoto = [ + // "../../../../assets/images/yiyuan.png", + // "../../../../assets/images/homeHeader.png", + // "../../../../assets/images/add.png", + ]; //调研人员照片 + waterPhoto = []; //水源照片 + routePhoto = []; //疏散照片 + fireControlPhoto = []; //消控室照片 + + //设置文件路径并上传 + postFilePath; + isLoading = false; + async upload(e, type) { + this.isLoading = true; + let file = e.target.files[0] || null; //获取上传的文件 + let fileSize = file.size || null; //上传文件的总大小 + let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传 + this.postFilePath = "演练记录/" + this.data.unitInfo.id; + if (fileSize >= shardSize) { + await this.postFileByMul(file, type); + } else { + await this.postFile(file, type); + } + this.isLoading = false; + } + + //直接上传 + async postFile(file: File, type) { + await new Promise((resolve, reject) => { + this.objectsSer.postFile(this.postFilePath, file).subscribe((data) => { + let dataObj = data as any; + let filePath: string = ObjectsService.baseUrl + dataObj.objectName; + this.setFileUrl(type, filePath); + resolve("success"); + }); + }); + } + //分块上传 + async postFileByMul(file: File, type) { + await new Promise((resolve, reject) => { + this.objectsSer + .postFile_MultipartUpload(this.postFilePath, file) + .then((value) => { + console.log("分块上传成功", value); + let dataObj = value as any; + this.setFileUrl(type, dataObj.filePath + dataObj.fileName); + resolve("success"); + }); + }); + } + + setFileUrl(type, filePath) { + switch (type) { + case "调研": + this.surveyPhoto.push(filePath); + break; + case "水源": + this.waterPhoto.push(filePath); + break; + case "疏散通道": + this.routePhoto.push(filePath); + break; + case "消控室": + this.fireControlPhoto.push(filePath); + break; + } + } + deleteImg(arr, key) { + if (confirm("确认删除此照片吗")) { + arr.splice(key, 1); + } + } + teamLeader; + time; + drillId; + isLoadingSave = false; + save() { + if (!this.teamLeader || !this.time) { + this.snackBar.open("请输入带队人员和熟悉时间", "确定", { + verticalPosition: "top", + duration: 3000, + }); + return; + } + this.isLoadingSave = true; + let body: any = { + companyId: this.data.unitInfo.id, + teamLeader: this.teamLeader, + startTime: this.datePipe.transform(this.time[0], "yyyy-MM-ddTHH:mm:ss"), + endTime: this.datePipe.transform(this.time[1], "yyyy-MM-ddTHH:mm:ss"), + images: JSON.stringify(this.surveyPhoto), + waterSource: JSON.stringify(this.waterPhoto), + escapeRoute: JSON.stringify(this.routePhoto), + fireControlRoom: JSON.stringify(this.fireControlPhoto), + }; + console.log(body); + if (this.isHttpPost) { + this.http.post("/api/DrillRecords", body).subscribe((data: any) => { + this.drillId = data.id; + this.isHttpPost = false; + this.isLoadingSave = false; + this.snackBar.open("保存成功", "确定", { + verticalPosition: "top", + duration: 3000, + }); + this.dialogRef.close(); + }); + } else { + body.id = this.drillId; + this.http + .put(`/api/DrillRecords/${this.drillId}`, body) + .subscribe((data: any) => { + this.isLoadingSave = false; + this.snackBar.open("保存成功", "确定", { + verticalPosition: "top", + duration: 3000, + }); + this.dialogRef.close(); + }); + } + } +} diff --git a/src/app/key-unit/key-unit.module.ts b/src/app/key-unit/key-unit.module.ts index c5e5041..03baead 100644 --- a/src/app/key-unit/key-unit.module.ts +++ b/src/app/key-unit/key-unit.module.ts @@ -1,94 +1,191 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { KeyUnitRoutingModule } from './key-unit-routing.module'; -import { KeyUnitManagementComponent, CreateUnit } from './key-unit-management/key-unit-management.component'; -import {A11yModule} from '@angular/cdk/a11y'; -import {DragDropModule} from '@angular/cdk/drag-drop'; -import {PortalModule} from '@angular/cdk/portal'; -import {ScrollingModule} from '@angular/cdk/scrolling'; -import {CdkStepperModule} from '@angular/cdk/stepper'; -import {CdkTableModule} from '@angular/cdk/table'; -import {CdkTreeModule} from '@angular/cdk/tree'; -import {MatAutocompleteModule} from '@angular/material/autocomplete'; -import {MatBadgeModule} from '@angular/material/badge'; -import {MatBottomSheetModule} from '@angular/material/bottom-sheet'; -import {MatButtonModule} from '@angular/material/button'; -import {MatButtonToggleModule} from '@angular/material/button-toggle'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatStepperModule} from '@angular/material/stepper'; -import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatExpansionModule} from '@angular/material/expansion'; -import {MatGridListModule} from '@angular/material/grid-list'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatNativeDateModule, MatRippleModule, MatOption} from '@angular/material/core'; -import {MatPaginatorModule} from '@angular/material/paginator'; -import {MatProgressBarModule} from '@angular/material/progress-bar'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatRadioModule} from '@angular/material/radio'; -import {MatSelectModule} from '@angular/material/select'; -import {MatSidenavModule} from '@angular/material/sidenav'; -import {MatSliderModule} from '@angular/material/slider'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; -import {MatSnackBarModule} from '@angular/material/snack-bar'; -import {MatSortModule} from '@angular/material/sort'; -import {MatTableModule} from '@angular/material/table'; -import {MatTabsModule} from '@angular/material/tabs'; -import {MatToolbarModule} from '@angular/material/toolbar'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {MatTreeModule} from '@angular/material/tree'; -import { EditUnitInfoComponent } from './edit-unit-info/edit-unit-info.component'; -import { ViewUnitDetailsComponent } from './view-unit-details/view-unit-details.component'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { AddHouseInfo } from './basicinfo/addhouseinfo.component'; -import { LookMaster } from './basicinfo/lookmaster.component'; -import { BasicinfoComponent, StatisticsOfFireFightingFacilities } from './basicinfo/basicinfo.component'; -import { EditPlanInfoComponent } from './edit-plan-info/edit-plan-info.component'; -import { CountdownModule } from 'ngx-countdown'; -import { BasicinfoLookComponent } from './basicinfo-look/basicinfo.component'; -import { ViewUnitDetailsPlanComponent } from './view-unit-details-plan/view-unit-details-plan.component'; -import { FunctionDivisionComponent, addPartition, addPartitionAttribute } from './function-division/function-division.component'; -import {AllaroundComponent} from './allaround/allaround.component' -import {ImgDetails} from './allaround/imgdetails.component' -import { RealisticPictureComponent, previewImg, addRealPicture, editRealPicture } from './realistic-picture/realistic-picture.component'; -import { FileUploadModule } from 'ng2-file-upload'; -import {KeySiteComponent} from './key-site/key-site.component' -import {KeySiteImgs} from './key-site/keysiteimgs.component' -import {UploadingCADComponent,readFile,editFile} from './uploading-cad/uploading-cad.component' -import { KeySiteLookComponent } from './key-site-look/key-site.component'; -import { KeySiteImgs2 } from './key-site-look/keysiteimgs.component'; -import { FunctionDivisionLookComponent, addPartitionAttribute2 } from './function-division-look/function-division.component'; -import { RealisticPictureLookComponent, previewImg3 } from './realistic-picture-look/realistic-picture.component'; -import { UploadingCADLookComponent } from './uploading-cad-look/uploading-cad.component'; -import { FireFightingDeviceComponent } from './fire-fighting-device/fire-fighting-device.component'; -import { ImagesData, previewBigImg } from './fire-fighting-device/imagesdata.component'; -import { ImgsDataDetail } from './fire-fighting-device/addGrouping.component'; -import { FireFightingDeviceLookComponent } from './fire-fighting-device-look/fire-fighting-device.component'; -import { ImagesData2, previewBigImg2 } from './fire-fighting-device-look/imagesdata.component'; -import { ImgsDataDetail2 } from './fire-fighting-device-look/addGrouping.component'; -import { UiModule } from '../../app/ui/ui.module'; -import { SixFamiliarityComponent,routerMapComponent } from './six-familiarity/six-familiarity.component'; -import { ActualCombatDrillComponent } from './actual-combat-drill/actual-combat-drill.component'; -import { SixFamiliarListComponent } from './six-familiar-list/six-familiar-list.component' -import { TrainingRecordinfoComponent } from './training-recordinfo/training-recordinfo.component'; -import { RouterGISComponent } from './router-gis/router-gis.component'; -import { WaterRoadComponent } from './water-road/water-road.component'; -import { PhotoofthesceneComponent } from './photoofthescene/photoofthescene.component'; -import { KnowRouteComponent } from './know-route/know-route.component'; -import { FindProblemComponent } from './find-problem/find-problem.component'; -import { upname } from './key-unit-management/key-unit-management.component'; -import { companyAuditResult } from './key-unit-management/key-unit-management.component'; -import { SpecialWarningComponent } from './special-warning/special-warning.component' +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { KeyUnitRoutingModule } from "./key-unit-routing.module"; +import { + KeyUnitManagementComponent, + CreateUnit, +} from "./key-unit-management/key-unit-management.component"; +import { A11yModule } from "@angular/cdk/a11y"; +import { DragDropModule } from "@angular/cdk/drag-drop"; +import { PortalModule } from "@angular/cdk/portal"; +import { ScrollingModule } from "@angular/cdk/scrolling"; +import { CdkStepperModule } from "@angular/cdk/stepper"; +import { CdkTableModule } from "@angular/cdk/table"; +import { CdkTreeModule } from "@angular/cdk/tree"; +import { MatAutocompleteModule } from "@angular/material/autocomplete"; +import { MatBadgeModule } from "@angular/material/badge"; +import { MatBottomSheetModule } from "@angular/material/bottom-sheet"; +import { MatButtonModule } from "@angular/material/button"; +import { MatButtonToggleModule } from "@angular/material/button-toggle"; +import { MatCardModule } from "@angular/material/card"; +import { MatCheckboxModule } from "@angular/material/checkbox"; +import { MatChipsModule } from "@angular/material/chips"; +import { MatStepperModule } from "@angular/material/stepper"; +import { MatDatepickerModule } from "@angular/material/datepicker"; +import { MatDialogModule } from "@angular/material/dialog"; +import { MatDividerModule } from "@angular/material/divider"; +import { MatExpansionModule } from "@angular/material/expansion"; +import { MatGridListModule } from "@angular/material/grid-list"; +import { MatIconModule } from "@angular/material/icon"; +import { MatInputModule } from "@angular/material/input"; +import { MatListModule } from "@angular/material/list"; +import { MatMenuModule } from "@angular/material/menu"; +import { + MatNativeDateModule, + MatRippleModule, + MatOption, +} from "@angular/material/core"; +import { MatPaginatorModule } from "@angular/material/paginator"; +import { MatProgressBarModule } from "@angular/material/progress-bar"; +import { MatProgressSpinnerModule } from "@angular/material/progress-spinner"; +import { MatRadioModule } from "@angular/material/radio"; +import { MatSelectModule } from "@angular/material/select"; +import { MatSidenavModule } from "@angular/material/sidenav"; +import { MatSliderModule } from "@angular/material/slider"; +import { MatSlideToggleModule } from "@angular/material/slide-toggle"; +import { MatSnackBarModule } from "@angular/material/snack-bar"; +import { MatSortModule } from "@angular/material/sort"; +import { MatTableModule } from "@angular/material/table"; +import { MatTabsModule } from "@angular/material/tabs"; +import { MatToolbarModule } from "@angular/material/toolbar"; +import { MatTooltipModule } from "@angular/material/tooltip"; +import { MatTreeModule } from "@angular/material/tree"; +import { EditUnitInfoComponent } from "./edit-unit-info/edit-unit-info.component"; +import { ViewUnitDetailsComponent } from "./view-unit-details/view-unit-details.component"; +import { ReactiveFormsModule, FormsModule } from "@angular/forms"; +import { AddHouseInfo } from "./basicinfo/addhouseinfo.component"; +import { LookMaster } from "./basicinfo/lookmaster.component"; +import { + BasicinfoComponent, + StatisticsOfFireFightingFacilities, +} from "./basicinfo/basicinfo.component"; +import { EditPlanInfoComponent } from "./edit-plan-info/edit-plan-info.component"; +import { CountdownModule } from "ngx-countdown"; +import { BasicinfoLookComponent } from "./basicinfo-look/basicinfo.component"; +import { ViewUnitDetailsPlanComponent } from "./view-unit-details-plan/view-unit-details-plan.component"; +import { + FunctionDivisionComponent, + addPartition, + addPartitionAttribute, +} from "./function-division/function-division.component"; +import { AllaroundComponent } from "./allaround/allaround.component"; +import { ImgDetails } from "./allaround/imgdetails.component"; +import { + RealisticPictureComponent, + previewImg, + addRealPicture, + editRealPicture, +} from "./realistic-picture/realistic-picture.component"; +import { FileUploadModule } from "ng2-file-upload"; +import { KeySiteComponent } from "./key-site/key-site.component"; +import { KeySiteImgs } from "./key-site/keysiteimgs.component"; +import { + UploadingCADComponent, + readFile, + editFile, +} from "./uploading-cad/uploading-cad.component"; +import { KeySiteLookComponent } from "./key-site-look/key-site.component"; +import { KeySiteImgs2 } from "./key-site-look/keysiteimgs.component"; +import { + FunctionDivisionLookComponent, + addPartitionAttribute2, +} from "./function-division-look/function-division.component"; +import { + RealisticPictureLookComponent, + previewImg3, +} from "./realistic-picture-look/realistic-picture.component"; +import { UploadingCADLookComponent } from "./uploading-cad-look/uploading-cad.component"; +import { FireFightingDeviceComponent } from "./fire-fighting-device/fire-fighting-device.component"; +import { + ImagesData, + previewBigImg, +} from "./fire-fighting-device/imagesdata.component"; +import { ImgsDataDetail } from "./fire-fighting-device/addGrouping.component"; +import { FireFightingDeviceLookComponent } from "./fire-fighting-device-look/fire-fighting-device.component"; +import { + ImagesData2, + previewBigImg2, +} from "./fire-fighting-device-look/imagesdata.component"; +import { ImgsDataDetail2 } from "./fire-fighting-device-look/addGrouping.component"; +import { UiModule } from "../../app/ui/ui.module"; +import { + SixFamiliarityComponent, + routerMapComponent, +} from "./six-familiarity/six-familiarity.component"; +import { ActualCombatDrillComponent } from "./actual-combat-drill/actual-combat-drill.component"; +import { SixFamiliarListComponent } from "./six-familiar-list/six-familiar-list.component"; +import { TrainingRecordinfoComponent } from "./training-recordinfo/training-recordinfo.component"; +import { RouterGISComponent } from "./router-gis/router-gis.component"; +import { WaterRoadComponent } from "./water-road/water-road.component"; +import { PhotoofthesceneComponent } from "./photoofthescene/photoofthescene.component"; +import { KnowRouteComponent } from "./know-route/know-route.component"; +import { FindProblemComponent } from "./find-problem/find-problem.component"; +import { upname } from "./key-unit-management/key-unit-management.component"; +import { companyAuditResult } from "./key-unit-management/key-unit-management.component"; +import { SpecialWarningComponent } from "./special-warning/special-warning.component"; +import { UploadDrillComponent } from "./key-unit-management/upload-drill/upload-drill.component"; +import { NzDatePickerModule } from "ng-zorro-antd/date-picker"; +import { NzInputModule } from "ng-zorro-antd/input"; +import { NzButtonModule } from "ng-zorro-antd/button"; @NgModule({ - declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname,companyAuditResult,StatisticsOfFireFightingFacilities, SpecialWarningComponent], - exports:[ViewUnitDetailsPlanComponent,WaterRoadComponent], + declarations: [ + KeyUnitManagementComponent, + EditUnitInfoComponent, + ViewUnitDetailsComponent, + CreateUnit, + BasicinfoComponent, + LookMaster, + AddHouseInfo, + EditPlanInfoComponent, + BasicinfoLookComponent, + ViewUnitDetailsPlanComponent, + FunctionDivisionComponent, + addPartition, + addPartitionAttribute, + AllaroundComponent, + ImgDetails, + RealisticPictureComponent, + previewImg, + addRealPicture, + editRealPicture, + KeySiteComponent, + KeySiteImgs, + UploadingCADComponent, + readFile, + editFile, + KeySiteLookComponent, + KeySiteImgs2, + FunctionDivisionLookComponent, + RealisticPictureLookComponent, + previewImg3, + UploadingCADLookComponent, + FireFightingDeviceComponent, + ImagesData, + previewBigImg, + ImgsDataDetail, + FireFightingDeviceLookComponent, + ImagesData2, + ImgsDataDetail2, + previewBigImg2, + addPartitionAttribute2, + SixFamiliarityComponent, + ActualCombatDrillComponent, + routerMapComponent, + SixFamiliarListComponent, + TrainingRecordinfoComponent, + RouterGISComponent, + WaterRoadComponent, + PhotoofthesceneComponent, + KnowRouteComponent, + FindProblemComponent, + upname, + companyAuditResult, + StatisticsOfFireFightingFacilities, + SpecialWarningComponent, + UploadDrillComponent, + ], + exports: [ViewUnitDetailsPlanComponent, WaterRoadComponent], imports: [ CommonModule, KeyUnitRoutingModule, @@ -139,6 +236,9 @@ import { SpecialWarningComponent } from './special-warning/special-warning.compo FileUploadModule, UiModule, ReactiveFormsModule, - ] + NzDatePickerModule, + NzInputModule, + NzButtonModule, + ], }) -export class KeyUnitModule { } +export class KeyUnitModule {} diff --git a/src/app/services/objects.service.ts b/src/app/services/objects.service.ts index 3d35746..07b9651 100644 --- a/src/app/services/objects.service.ts +++ b/src/app/services/objects.service.ts @@ -66,13 +66,16 @@ export class ObjectsService { PartNumberETag.push(result) if (PartNumberETag.length === allSlice) { //分块上传完成 + console.log("分块上传成功00"); let data = PartNumberETag let paramsData = { uploadId: uploadId }; let path = ObjectsService.c_apiRoot_Multipart + 'CompleteMultipartUpload/PlanPlatform/' + objectName; this.http.post(path, data, { params: paramsData }).subscribe(data => { + let objData: any = new Object(); objData.fileName = file.name; objData.filePath = (ObjectsService.baseUrl + objectName).replace(file.name, ""); + console.log("分块上传成功11",objData); resolve(objData) }) } diff --git a/src/index.html b/src/index.html index ae5fbd1..49446f5 100644 --- a/src/index.html +++ b/src/index.html @@ -1,11 +1,3 @@ - diff --git a/src/styles.scss b/src/styles.scss index 1029384..a9b41c2 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -3,6 +3,9 @@ /* 引入组件样式 */ // @import "~ng-zorro-antd/style/index.min.css"; /* 引入基本样式 */ @import "~ng-zorro-antd/tree-select/style/index.min.css"; +@import "~ng-zorro-antd/date-picker/style/index.min.css"; +@import "~ng-zorro-antd/input/style/index.min.css"; +@import "~ng-zorro-antd/button/style/index.min.css"; /* 引入组件样式 */ @font-face {