Browse Source

[完善]检查复查统计表

非煤矿山灾害智能感知和预警系统
邵佳豪 2 years ago
parent
commit
b338b85692
  1. 4
      proxy.config.json
  2. 3
      src/app/home/statistic-analysis/form/examine/examine.component.html
  3. 371
      src/app/home/statistic-analysis/form/examine/examine.component.ts
  4. 3
      src/app/home/statistic-analysis/form/review/review.component.html
  5. 345
      src/app/home/statistic-analysis/form/review/review.component.ts
  6. 219
      src/app/home/statistic-analysis/home/home.component.ts
  7. 1112
      src/app/home/task/zhi-indicators/zhi-indicators.component.ts
  8. 4
      src/index.html

4
proxy.config.json

@ -1,11 +1,11 @@
{ {
"/api": { "/api": {
"target": "https://121.36.37.70:8204", "target": "https://fx.anxincloud.cn/",
"secure": false, "secure": false,
"changeOrigin": true "changeOrigin": true
}, },
"/hubs": { "/hubs": {
"target": "https://121.36.37.70:8204", "target": "https://fx.anxincloud.cn/",
"secure": false, "secure": false,
"ws": true, "ws": true,
"logLevel": "debug" "logLevel": "debug"

3
src/app/home/statistic-analysis/form/examine/examine.component.html

@ -18,7 +18,8 @@
</div> </div>
<div class="table"> <div class="table">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading"> <nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading"
[nzPageSize]="100">
<thead> <thead>
<tr> <tr>
<th>组织机构名称 <span *ngIf="isSubordinate" (click)="tableBack()" style="margin-left: 3px;" class="blue" <th>组织机构名称 <span *ngIf="isSubordinate" (click)="tableBack()" style="margin-left: 3px;" class="blue"

371
src/app/home/statistic-analysis/form/examine/examine.component.ts

@ -9,20 +9,24 @@ import { NzMessageService } from 'ng-zorro-antd/message';
@Component({ @Component({
selector: 'app-examine', selector: 'app-examine',
templateUrl: './examine.component.html', templateUrl: './examine.component.html',
styleUrls: ['./examine.component.scss'] styleUrls: ['./examine.component.scss'],
}) })
export class ExamineComponent implements OnInit { export class ExamineComponent implements OnInit {
constructor(
private http: HttpClient,
private toTree: TreeService,
private methodService: MethodService,
private router: Router,
private message: NzMessageService
) {}
constructor(private http: HttpClient, private toTree: TreeService, private methodService: MethodService, private router: Router, private message: NzMessageService) { } echartsOfBar;
echartsOfBar
echartsOfBarOption = { echartsOfBarOption = {
grid: { grid: {
left: '2%', left: '2%',
right: '2%', right: '2%',
top: '18%', top: '18%',
bottom: '16%' bottom: '16%',
}, },
legend: { legend: {
top: '3%', top: '3%',
@ -30,44 +34,46 @@ export class ExamineComponent implements OnInit {
itemGap: 15, itemGap: 15,
itemWidth: 10, itemWidth: 10,
itemHeight: 10, itemHeight: 10,
orient: 'horizontal' orient: 'horizontal',
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
type: 'shadow' type: 'shadow',
} },
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data: [], data: [],
axisTick: { //x轴刻度尺 axisTick: {
show: false //x轴刻度尺
show: false,
}, },
axisLine: {//x轴线条颜色 axisLine: {
//x轴线条颜色
show: false, show: false,
lineStyle: { lineStyle: {
color: '#C7CAD0' color: '#C7CAD0',
} },
}, },
axisLabel: { axisLabel: {
show: true, show: true,
interval: 0,//使x轴上的文字显示完全, interval: 0, //使x轴上的文字显示完全,
//设置一行显示几个字,自己设置 //设置一行显示几个字,自己设置
formatter: function (params) { formatter: function (params) {
var newParamsName = ""; var newParamsName = '';
var paramsNameNumber = params.length; var paramsNameNumber = params.length;
var provideNumber = 6; var provideNumber = 6;
var rowNumber = Math.ceil(paramsNameNumber / provideNumber); var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
if (paramsNameNumber > provideNumber) { if (paramsNameNumber > provideNumber) {
for (var p = 0; p < rowNumber; p++) { for (var p = 0; p < rowNumber; p++) {
var tempStr = ""; var tempStr = '';
var start = p * provideNumber; var start = p * provideNumber;
var end = start + provideNumber; var end = start + provideNumber;
if (p == rowNumber - 1) { if (p == rowNumber - 1) {
tempStr = params.substring(start, paramsNameNumber); tempStr = params.substring(start, paramsNameNumber);
} else { } else {
tempStr = params.substring(start, end) + "\n"; tempStr = params.substring(start, end) + '\n';
} }
newParamsName += tempStr; newParamsName += tempStr;
} }
@ -75,22 +81,24 @@ export class ExamineComponent implements OnInit {
newParamsName = params; newParamsName = params;
} }
return newParamsName; return newParamsName;
} },
} },
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
splitLine: {//网格线 splitLine: {
//网格线
lineStyle: { lineStyle: {
type: 'solid', //设置网格线类型 dotted:虚线 solid:实线 type: 'solid', //设置网格线类型 dotted:虚线 solid:实线
color: '#ECEFF1' //网格线颜色 color: '#ECEFF1', //网格线颜色
}, },
}, },
axisLine: {//y轴线条颜色 axisLine: {
//y轴线条颜色
show: false, show: false,
lineStyle: { lineStyle: {
color: '#C7CAD0' color: '#C7CAD0',
} },
}, },
}, },
series: [ series: [
@ -99,221 +107,274 @@ export class ExamineComponent implements OnInit {
type: 'bar', type: 'bar',
barWidth: 16, // 柱子宽度 barWidth: 16, // 柱子宽度
label: { label: {
show: false show: false,
}, },
emphasis: { emphasis: {
focus: 'series' focus: 'series',
}, },
data: [] data: [],
}, },
{ {
name: '当场整改', name: '当场整改',
type: 'bar', type: 'bar',
barWidth: 16, // 柱子宽度 barWidth: 16, // 柱子宽度
label: { label: {
show: false show: false,
}, },
emphasis: { emphasis: {
focus: 'series' focus: 'series',
}, },
data: [] data: [],
}, },
{ {
name: '推送大队', name: '推送大队',
type: 'bar', type: 'bar',
barWidth: 16, // 柱子宽度 barWidth: 16, // 柱子宽度
label: { label: {
show: false show: false,
}, },
emphasis: { emphasis: {
focus: 'series' focus: 'series',
}, },
data: [] data: [],
}, },
{ {
name: '社会单位数量', name: '社会单位数量',
type: 'bar', type: 'bar',
barWidth: 16, // 柱子宽度 barWidth: 16, // 柱子宽度
label: { label: {
show: false show: false,
}, },
emphasis: { emphasis: {
focus: 'series' focus: 'series',
}, },
data: [] data: [],
} },
] ],
}; };
searchForm = { searchForm = {
or: '', or: '',
date: null date: null,
} };
ngOnInit(): void { ngOnInit(): void {
this.searchForm.date = this.methodService.getDateOf30();
this.searchForm.date = this.methodService.getDateOf30() this.getAllOrganization();
this.getAllOrganization()
setTimeout(() => { setTimeout(() => {
this.echartsOfBar = echarts.init(document.getElementById('echarts'), null, { devicePixelRatio: 2 }); this.echartsOfBar = echarts.init(
document.getElementById('echarts'),
null,
{ devicePixelRatio: 2 }
);
}, 0); }, 0);
} }
isLoading = false;
expandKeys;
isLoading = false defaultOrId: string;
expandKeys
defaultOrId: string
//获取所有组织机构 //获取所有组织机构
nodes: any = [] nodes: any = [];
getAllOrganization() { getAllOrganization() {
this.isLoading = true this.isLoading = true;
let organizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId let organizationId = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
let params = { let params = {
ContainsChildren: "true", ContainsChildren: 'true',
PageNumber: 1, PageNumber: 1,
PageSize: 9999, PageSize: 9999,
code: '0000' code: '0000',
} };
this.http.get('/api/Organizations', { this.http
params: params .get('/api/Organizations', {
}).subscribe((data: any) => { params: params,
console.log(data.items) })
data.items.forEach(element => { .subscribe((data: any) => {
if (element.id == organizationId) { console.log(data.items);
element.parentId = null data.items.forEach((element) => {
} if (element.id == organizationId) {
element.key = element.id element.parentId = null;
element.title = element.name }
if (element.level == 'squadron') { element.key = element.id;
element.isLeaf = true element.title = element.name;
} if (element.level == 'squadron') {
}); element.isLeaf = true;
this.nodes = [...this.toTree.toTree(data.items)] }
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId });
this.nodes = [...this.toTree.toTree(data.items)];
this.searchForm.or = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
this.getRecord() this.getRecord();
}) });
} }
search() { search() {
this.getRecord() this.getRecord();
} }
reset() { reset() {
this.searchForm = { this.searchForm = {
date: this.methodService.getDateOf30(), date: this.methodService.getDateOf30(),
or: JSON.parse(sessionStorage.getItem('userData')).organizationId or: JSON.parse(sessionStorage.getItem('userData')).organizationId,
} };
this.getRecord() this.getRecord();
} }
showArr = [
'济南市消防救援支队',
'特勤',
'市中',
'历下',
'槐荫',
'天桥',
'历城',
'长清',
'章丘',
'平阴',
'济阳',
'商河',
'莱芜',
'钢城',
'高新',
'南部',
'起步',
];
listOfData = []; listOfData = [];
getRecord() { getRecord() {
this.isLoading = true this.isLoading = true;
this.http.get('/api/PlanTasks/GetOrgRecheckStat', { this.http
params: { .get('/api/PlanTasks/GetOrgRecheckStat', {
OrganizationId: this.searchForm.or, params: {
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00', OrganizationId: this.searchForm.or,
CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59' CheckStartTime:
} moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
}).subscribe({ CheckEndTime:
next: (data: any) => { moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
this.listOfData = [...data] },
console.log('统计表格', data) })
this.isLoading = false .subscribe({
setTimeout(() => { next: (data: any) => {
this.echartsSetData(this.listOfData) let num = 100;
}, 0); data.forEach((item) => {
let sortId = this.showArr.findIndex((v) => {
}, return item['组织机构'].name.indexOf(v) !== -1;
error: (err) => { });
if (sortId === -1) {
sortId = num;
num += 1;
}
item.sortId = sortId;
});
data.sort(sort('sortId'));
this.listOfData = [...data];
this.isLoading = false;
setTimeout(() => {
this.echartsSetData(this.listOfData);
}, 0);
},
error: (err) => {},
});
} function sort(prop) {
}) return function (obj1, obj2) {
var val1 = obj1[prop];
var val2 = obj2[prop];
if (!isNaN(Number(val1)) && !isNaN(Number(val2))) {
val1 = Number(val1);
val2 = Number(val2);
}
if (val1 < val2) {
return -1;
} else if (val1 > val2) {
return 1;
} else {
return 0;
}
};
}
} }
echartsSetData(data) { echartsSetData(data) {
this.echartsOfBar.clear(); this.echartsOfBar.clear();
let barData = data let barData = data;
let Barx = [] let Barx = [];
let Bary1 = [] let Bary1 = [];
let Bary2 = [] let Bary2 = [];
let Bary3 = [] let Bary3 = [];
let Bary4 = [] let Bary4 = [];
barData.forEach(element => { barData.forEach((element) => {
Barx.push(element['组织机构'].name) Barx.push(element['组织机构'].name);
Bary1.push(element['总隐患数'])//已完成 Bary1.push(element['总隐患数']); //已完成
Bary2.push(element['当场整改数'])//未完成 Bary2.push(element['当场整改数']); //未完成
Bary3.push(element['上报数量'])//已完成 Bary3.push(element['上报数量']); //已完成
Bary4.push(element['单位数量'])//未完成 Bary4.push(element['单位数量']); //未完成
}); });
this.echartsOfBarOption.xAxis.data = Barx this.echartsOfBarOption.xAxis.data = Barx;
this.echartsOfBarOption.series[0].data = Bary1 this.echartsOfBarOption.series[0].data = Bary1;
this.echartsOfBarOption.series[1].data = Bary2 this.echartsOfBarOption.series[1].data = Bary2;
this.echartsOfBarOption.series[2].data = Bary3 this.echartsOfBarOption.series[2].data = Bary3;
this.echartsOfBarOption.series[3].data = Bary4 this.echartsOfBarOption.series[3].data = Bary4;
setTimeout(() => { setTimeout(() => {
this.echartsOfBar && this.echartsOfBar.setOption(this.echartsOfBarOption); this.echartsOfBar && this.echartsOfBar.setOption(this.echartsOfBarOption);
}, 0); }, 0);
} }
isSubordinate = false;
isSubordinate = false
openSubordinate(item) { openSubordinate(item) {
if (item.id != this.searchForm.or && item.level === 'battalion') { if (item.id != this.searchForm.or && item.level === 'battalion') {
this.isSubordinate = true this.isSubordinate = true;
this.searchForm.or = item.id this.searchForm.or = item.id;
this.getRecord() this.getRecord();
} }
} }
tableBack() { tableBack() {
this.isSubordinate = false this.isSubordinate = false;
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId this.searchForm.or = JSON.parse(
this.getRecord() sessionStorage.getItem('userData')
).organizationId;
this.getRecord();
} }
goback() { goback() {
this.router.navigate(['/statistic/home']) this.router.navigate(['/statistic/home']);
} }
exportExcel() { exportExcel() {
const httpOptions = { const httpOptions = {
responseType: 'blob' as 'json', responseType: 'blob' as 'json',
params: { params: {
OrganizationId: this.searchForm.or, OrganizationId: this.searchForm.or,
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00', CheckStartTime:
CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59', moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
RecheckStaType: '检查情况' CheckEndTime:
} moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
}; RecheckStaType: '检查情况',
this.http.get(`/api/PlanTasks/ExportOrgRecheckStat`, httpOptions).subscribe({
next: (data: any) => {
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', '检查情况统计' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create('success', `导出成功`);
}, },
error: err => { };
this.message.create('error', `导出失败`); this.http
} .get(`/api/PlanTasks/ExportOrgRecheckStat`, httpOptions)
}) .subscribe({
next: (data: any) => {
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', '检查情况统计' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create('success', `导出成功`);
},
error: (err) => {
this.message.create('error', `导出失败`);
},
});
} }
} }

3
src/app/home/statistic-analysis/form/review/review.component.html

@ -18,7 +18,8 @@
</div> </div>
<div class="table"> <div class="table">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading"> <nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading"
[nzPageSize]="100">
<thead> <thead>
<tr> <tr>
<th>组织机构名称 <span *ngIf="isSubordinate" (click)="tableBack()" style="margin-left: 3px;" class="blue" <th>组织机构名称 <span *ngIf="isSubordinate" (click)="tableBack()" style="margin-left: 3px;" class="blue"

345
src/app/home/statistic-analysis/form/review/review.component.ts

@ -9,21 +9,24 @@ import { NzMessageService } from 'ng-zorro-antd/message';
@Component({ @Component({
selector: 'app-review', selector: 'app-review',
templateUrl: './review.component.html', templateUrl: './review.component.html',
styleUrls: ['./review.component.scss'] styleUrls: ['./review.component.scss'],
}) })
export class ReviewComponent implements OnInit { export class ReviewComponent implements OnInit {
constructor(
private http: HttpClient,
private toTree: TreeService,
private methodService: MethodService,
private router: Router,
private message: NzMessageService
) {}
echartsOfBar;
constructor(private http: HttpClient, private toTree: TreeService, private methodService: MethodService, private router: Router, private message: NzMessageService) { }
echartsOfBar
echartsOfBarOption = { echartsOfBarOption = {
grid: { grid: {
left: '2%', left: '2%',
right: '2%', right: '2%',
top: '18%', top: '18%',
bottom: '16%' bottom: '16%',
}, },
legend: { legend: {
top: '3%', top: '3%',
@ -31,44 +34,46 @@ export class ReviewComponent implements OnInit {
itemGap: 15, itemGap: 15,
itemWidth: 10, itemWidth: 10,
itemHeight: 10, itemHeight: 10,
orient: 'horizontal' orient: 'horizontal',
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
type: 'shadow' type: 'shadow',
} },
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data: [], data: [],
axisTick: { //x轴刻度尺 axisTick: {
show: false //x轴刻度尺
show: false,
}, },
axisLine: {//x轴线条颜色 axisLine: {
//x轴线条颜色
show: false, show: false,
lineStyle: { lineStyle: {
color: '#C7CAD0' color: '#C7CAD0',
} },
}, },
axisLabel: { axisLabel: {
show: true, show: true,
interval: 0,//使x轴上的文字显示完全, interval: 0, //使x轴上的文字显示完全,
//设置一行显示几个字,自己设置 //设置一行显示几个字,自己设置
formatter: function (params) { formatter: function (params) {
var newParamsName = ""; var newParamsName = '';
var paramsNameNumber = params.length; var paramsNameNumber = params.length;
var provideNumber = 6; var provideNumber = 6;
var rowNumber = Math.ceil(paramsNameNumber / provideNumber); var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
if (paramsNameNumber > provideNumber) { if (paramsNameNumber > provideNumber) {
for (var p = 0; p < rowNumber; p++) { for (var p = 0; p < rowNumber; p++) {
var tempStr = ""; var tempStr = '';
var start = p * provideNumber; var start = p * provideNumber;
var end = start + provideNumber; var end = start + provideNumber;
if (p == rowNumber - 1) { if (p == rowNumber - 1) {
tempStr = params.substring(start, paramsNameNumber); tempStr = params.substring(start, paramsNameNumber);
} else { } else {
tempStr = params.substring(start, end) + "\n"; tempStr = params.substring(start, end) + '\n';
} }
newParamsName += tempStr; newParamsName += tempStr;
} }
@ -76,22 +81,24 @@ export class ReviewComponent implements OnInit {
newParamsName = params; newParamsName = params;
} }
return newParamsName; return newParamsName;
} },
} },
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
splitLine: {//网格线 splitLine: {
//网格线
lineStyle: { lineStyle: {
type: 'solid', //设置网格线类型 dotted:虚线 solid:实线 type: 'solid', //设置网格线类型 dotted:虚线 solid:实线
color: '#ECEFF1' //网格线颜色 color: '#ECEFF1', //网格线颜色
}, },
}, },
axisLine: {//y轴线条颜色 axisLine: {
//y轴线条颜色
show: false, show: false,
lineStyle: { lineStyle: {
color: '#C7CAD0' color: '#C7CAD0',
} },
}, },
}, },
series: [ series: [
@ -100,188 +107,242 @@ export class ReviewComponent implements OnInit {
type: 'bar', type: 'bar',
barWidth: 16, // 柱子宽度 barWidth: 16, // 柱子宽度
label: { label: {
show: false show: false,
}, },
emphasis: { emphasis: {
focus: 'series' focus: 'series',
}, },
data: [] data: [],
}, },
{ {
name: '已复查隐患', name: '已复查隐患',
type: 'bar', type: 'bar',
barWidth: 16, // 柱子宽度 barWidth: 16, // 柱子宽度
label: { label: {
show: false show: false,
}, },
emphasis: { emphasis: {
focus: 'series' focus: 'series',
}, },
data: [] data: [],
} },
] ],
}; };
searchForm = { searchForm = {
or: '', or: '',
date: null date: null,
} };
ngOnInit(): void { ngOnInit(): void {
this.searchForm.date = this.methodService.getDateOf30() this.searchForm.date = this.methodService.getDateOf30();
this.getAllOrganization() this.getAllOrganization();
setTimeout(() => { setTimeout(() => {
this.echartsOfBar = echarts.init(document.getElementById('echarts'), null, { devicePixelRatio: 2 }); this.echartsOfBar = echarts.init(
document.getElementById('echarts'),
null,
{ devicePixelRatio: 2 }
);
}, 0); }, 0);
} }
isLoading = false;
expandKeys;
isLoading = false defaultOrId: string;
expandKeys
defaultOrId: string
//获取所有组织机构 //获取所有组织机构
nodes: any = [] nodes: any = [];
getAllOrganization() { getAllOrganization() {
this.isLoading = true this.isLoading = true;
let organizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId let organizationId = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
let params = { let params = {
ContainsChildren: "true", ContainsChildren: 'true',
PageNumber: 1, PageNumber: 1,
PageSize: 9999, PageSize: 9999,
code: '0000' code: '0000',
} };
this.http.get('/api/Organizations', { this.http
params: params .get('/api/Organizations', {
}).subscribe((data: any) => { params: params,
console.log(data.items) })
data.items.forEach(element => { .subscribe((data: any) => {
if (element.id == organizationId) { console.log(data.items);
element.parentId = null data.items.forEach((element) => {
} if (element.id == organizationId) {
element.key = element.id element.parentId = null;
element.title = element.name }
if (element.level == 'squadron') { element.key = element.id;
element.isLeaf = true element.title = element.name;
} if (element.level == 'squadron') {
}); element.isLeaf = true;
this.nodes = [...this.toTree.toTree(data.items)] }
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId });
this.nodes = [...this.toTree.toTree(data.items)];
this.searchForm.or = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
this.getRecord() this.getRecord();
}) });
} }
search() { search() {
this.getRecord() this.getRecord();
} }
reset() { reset() {
this.searchForm = { this.searchForm = {
date: this.methodService.getDateOf30(), date: this.methodService.getDateOf30(),
or: JSON.parse(sessionStorage.getItem('userData')).organizationId or: JSON.parse(sessionStorage.getItem('userData')).organizationId,
} };
this.getRecord() this.getRecord();
} }
showArr = [
'济南市消防救援支队',
'特勤',
'市中',
'历下',
'槐荫',
'天桥',
'历城',
'长清',
'章丘',
'平阴',
'济阳',
'商河',
'莱芜',
'钢城',
'高新',
'南部',
'起步',
];
listOfData = []; listOfData = [];
getRecord() { getRecord() {
this.isLoading = true this.isLoading = true;
this.http.get('/api/PlanTasks/GetOrgRecheckStat', { this.http
params: { .get('/api/PlanTasks/GetOrgRecheckStat', {
OrganizationId: this.searchForm.or, params: {
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00', OrganizationId: this.searchForm.or,
CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59' CheckStartTime:
} moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
}).subscribe({ CheckEndTime:
next: (data: any) => { moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
this.listOfData = [...data] },
console.log('统计表格', data) })
this.isLoading = false .subscribe({
setTimeout(() => { next: (data: any) => {
this.echartsSetData(this.listOfData) let num = 100;
}, 0); data.forEach((item) => {
let sortId = this.showArr.findIndex((v) => {
}, return item['组织机构'].name.indexOf(v) !== -1;
error: (err) => { });
if (sortId === -1) {
} sortId = num;
}) num += 1;
}
item.sortId = sortId;
});
data.sort(sort('sortId'));
this.listOfData = [...data];
this.isLoading = false;
setTimeout(() => {
this.echartsSetData(this.listOfData);
}, 0);
},
error: (err) => {},
});
function sort(prop) {
return function (obj1, obj2) {
var val1 = obj1[prop];
var val2 = obj2[prop];
if (!isNaN(Number(val1)) && !isNaN(Number(val2))) {
val1 = Number(val1);
val2 = Number(val2);
}
if (val1 < val2) {
return -1;
} else if (val1 > val2) {
return 1;
} else {
return 0;
}
};
}
} }
echartsSetData(data) { echartsSetData(data) {
this.echartsOfBar.clear(); this.echartsOfBar.clear();
let barData = data let barData = data;
let Barx = [] let Barx = [];
let Bary1 = [] let Bary1 = [];
let Bary2 = [] let Bary2 = [];
barData.forEach(element => { barData.forEach((element) => {
Barx.push(element['组织机构'].name) Barx.push(element['组织机构'].name);
Bary1.push(element['需要复查数'])//已完成 Bary1.push(element['需要复查数']); //已完成
Bary2.push(element['复查通过数'])//未完成 Bary2.push(element['复查通过数']); //未完成
}); });
this.echartsOfBarOption.xAxis.data = Barx this.echartsOfBarOption.xAxis.data = Barx;
this.echartsOfBarOption.series[0].data = Bary1 this.echartsOfBarOption.series[0].data = Bary1;
this.echartsOfBarOption.series[1].data = Bary2 this.echartsOfBarOption.series[1].data = Bary2;
setTimeout(() => { setTimeout(() => {
this.echartsOfBar && this.echartsOfBar.setOption(this.echartsOfBarOption); this.echartsOfBar && this.echartsOfBar.setOption(this.echartsOfBarOption);
}, 0); }, 0);
} }
isSubordinate = false;
isSubordinate = false
openSubordinate(item) { openSubordinate(item) {
if (item.id != this.searchForm.or && item.level === 'battalion') { if (item.id != this.searchForm.or && item.level === 'battalion') {
this.isSubordinate = true this.isSubordinate = true;
this.searchForm.or = item.id this.searchForm.or = item.id;
this.getRecord() this.getRecord();
} }
} }
tableBack() { tableBack() {
this.isSubordinate = false this.isSubordinate = false;
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId this.searchForm.or = JSON.parse(
this.getRecord() sessionStorage.getItem('userData')
).organizationId;
this.getRecord();
} }
goback() { goback() {
this.router.navigate(['/statistic/home']) this.router.navigate(['/statistic/home']);
} }
exportExcel() { exportExcel() {
const httpOptions = { const httpOptions = {
responseType: 'blob' as 'json', responseType: 'blob' as 'json',
params: { params: {
OrganizationId: this.searchForm.or, OrganizationId: this.searchForm.or,
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00', CheckStartTime:
CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59', moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
RecheckStaType: '复查情况' CheckEndTime:
} moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
}; RecheckStaType: '复查情况',
this.http.get(`/api/PlanTasks/ExportOrgRecheckStat`, httpOptions).subscribe({
next: (data: any) => {
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', '复查情况统计' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create('success', `导出成功`);
}, },
error: err => { };
this.message.create('error', `导出失败`); this.http
} .get(`/api/PlanTasks/ExportOrgRecheckStat`, httpOptions)
}) .subscribe({
next: (data: any) => {
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', '复查情况统计' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create('success', `导出成功`);
},
error: (err) => {
this.message.create('error', `导出失败`);
},
});
} }
} }

219
src/app/home/statistic-analysis/home/home.component.ts

@ -759,123 +759,124 @@ export class HomeComponent implements OnInit {
this.completionOfTaskBar.setOption(this.completionOfTaskBarOption); this.completionOfTaskBar.setOption(this.completionOfTaskBarOption);
} }
// map;
// mapInit() {
// //创建地图
// this.map = new AMap.Map('mapbox', {
// cursor: 'default',
// zooms: [8, 16],
// mapStyle: 'amap://styles/light',
// // bubble: true
// });
// let colors = [
// '#EE30B3',
// '#B37CF0',
// '#BD2CE6',
// '#7768EE',
// '#359EEF',
// '#7B95CA',
// '#CAFBF8',
// '#43D0E1',
// '#72C6EF',
// ];
// AMapUI.loadUI(['geo/DistrictExplorer'], (DistrictExplorer) => {
// //创建一个实例
// let districtExplorer = new DistrictExplorer({
// map: this.map,
// eventSupport: true, //打开事件支持
// });
// // let adcode = this.adcode; //行政编码
// let adcode = 370100;
// districtExplorer.loadAreaNode(adcode, (error, areaNode) => {
// //更新地图视野
// this.map.setBounds(areaNode.getBounds(), null, null, true);
// //设置定位节点,支持鼠标位置识别
// //注意节点的顺序,前面的高优先级
// districtExplorer.setAreaNodesForLocating(areaNode);
// //清除已有的绘制内容
// districtExplorer.clearFeaturePolygons();
// //绘制子区域
// districtExplorer.renderSubFeatures(areaNode, (feature, i) => {
// // console.log(111, feature)
// let fillColor = colors[i % colors.length];
// let strokeColor = colors[colors.length - 1 - (i % colors.length)];
// return {
// cursor: 'default',
// bubble: true,
// strokeColor: strokeColor, //线颜色
// strokeOpacity: 1, //线透明度
// strokeWeight: 1, //线宽
// fillColor: fillColor, //填充色
// fillOpacity: 0.8, //填充透明度
// };
// });
// //绘制父区域
// districtExplorer.renderParentFeature(areaNode, {
// cursor: 'default',
// bubble: true,
// strokeColor: 'black', //线颜色
// strokeOpacity: 1, //线透明度
// strokeWeight: 1, //线宽
// fillColor: null, //填充色
// fillOpacity: 0.5, //填充透明度
// });
// // 更新地图视野以适合区划面
// this.map.setFitView(districtExplorer.getAllFeaturePolygons());
// });
// });
// }
countries = [];
map; map;
mapInit() { mapInit() {
var T = window['T']; //创建地图
var d3 = window['d3']; this.map = new AMap.Map('mapbox', {
var countries = []; cursor: 'default',
var countriesOverlay = new T.D3Overlay(init, redraw); zooms: [8, 16],
mapStyle: 'amap://styles/light',
// bubble: true
});
this.map = new T.Map('mapbox'); let colors = [
this.map.centerAndZoom(new T.LngLat(117.03862, 36.664169), 9); '#EE30B3',
'#B37CF0',
'#BD2CE6',
'#7768EE',
'#359EEF',
'#7B95CA',
'#CAFBF8',
'#43D0E1',
'#72C6EF',
];
d3.json( AMapUI.loadUI(['geo/DistrictExplorer'], (DistrictExplorer) => {
'https://geo.datav.aliyun.com/areas_v3/bound/370100_full.json', //创建一个实例
(data) => { let districtExplorer = new DistrictExplorer({
countries = data.features; map: this.map,
this.map.addOverLay(countriesOverlay); eventSupport: true, //打开事件支持
countriesOverlay.bringToBack(); });
}
);
function init(sel, transform) { // let adcode = this.adcode; //行政编码
var upd = sel.selectAll('path.geojson').data(countries); let adcode = 370100;
upd
.enter() districtExplorer.loadAreaNode(adcode, (error, areaNode) => {
.append('path') //更新地图视野
.attr('class', 'geojson') this.map.setBounds(areaNode.getBounds(), null, null, true);
.attr('stroke', 'black')
.attr('fill', function (d, i) { //设置定位节点,支持鼠标位置识别
return d3.hsl(Math.random() * 360, 0.9, 0.5); //注意节点的顺序,前面的高优先级
}) districtExplorer.setAreaNodesForLocating(areaNode);
.attr('fill-opacity', '0.5');
} //清除已有的绘制内容
districtExplorer.clearFeaturePolygons();
//绘制子区域
districtExplorer.renderSubFeatures(areaNode, (feature, i) => {
// console.log(111, feature)
let fillColor = colors[i % colors.length];
let strokeColor = colors[colors.length - 1 - (i % colors.length)];
return {
cursor: 'default',
bubble: true,
strokeColor: strokeColor, //线颜色
strokeOpacity: 1, //线透明度
strokeWeight: 1, //线宽
fillColor: fillColor, //填充色
fillOpacity: 0.8, //填充透明度
};
});
function redraw(sel, transform) { //绘制父区域
sel.selectAll('path.geojson').each(function (d, i) { districtExplorer.renderParentFeature(areaNode, {
d3.select(this).attr('d', transform.pathFromGeojson); cursor: 'default',
// .on("mouseover",function(){ bubble: true,
// console.log('这是点击了',); strokeColor: 'black', //线颜色
// }) strokeOpacity: 1, //线透明度
strokeWeight: 1, //线宽
fillColor: null, //填充色
fillOpacity: 0.5, //填充透明度
});
// 更新地图视野以适合区划面
this.map.setFitView(districtExplorer.getAllFeaturePolygons());
}); });
} });
} }
// countries = [];
// map;
// mapInit() {
// var T = window['T'];
// var d3 = window['d3'];
// var countries = [];
// var countriesOverlay = new T.D3Overlay(init, redraw);
// this.map = new T.Map('mapbox');
// this.map.centerAndZoom(new T.LngLat(117.03862, 36.664169), 9);
// d3.json(
// 'https://geo.datav.aliyun.com/areas_v3/bound/370100_full.json',
// (data) => {
// countries = data.features;
// this.map.addOverLay(countriesOverlay);
// countriesOverlay.bringToBack();
// }
// );
// function init(sel, transform) {
// var upd = sel.selectAll('path.geojson').data(countries);
// upd
// .enter()
// .append('path')
// .attr('class', 'geojson')
// .attr('stroke', 'black')
// .attr('fill', function (d, i) {
// return d3.hsl(Math.random() * 360, 0.9, 0.5);
// })
// .attr('fill-opacity', '0.5');
// }
// function redraw(sel, transform) {
// sel.selectAll('path.geojson').each(function (d, i) {
// d3.select(this)
// .attr('d', transform.pathFromGeojson)
// .on('onclick', function () {
// console.log('这是点击了');
// });
// });
// }
// }
formroute() { formroute() {
this.router.navigate(['/statistic/form']); this.router.navigate(['/statistic/form']);

1112
src/app/home/task/zhi-indicators/zhi-indicators.component.ts

File diff suppressed because it is too large Load Diff

4
src/index.html

@ -13,9 +13,9 @@
<app-root></app-root> <app-root></app-root>
<div id="viewerjs" style="display:none"></div> <div id="viewerjs" style="display:none"></div>
</body> </body>
<script src="http://api.tianditu.gov.cn/api?v=4.0&tk=0c77efd395c0cd7654d9d808059595ca" type="text/javascript"></script> <!-- <script src="http://api.tianditu.gov.cn/api?v=4.0&tk=0c77efd395c0cd7654d9d808059595ca" type="text/javascript"></script>
<script src="http://cdn.bootcss.com/d3/3.5.17/d3.js " charset="utf-8"></script> <script src="http://cdn.bootcss.com/d3/3.5.17/d3.js " charset="utf-8"></script>
<script src="http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/D3SvgOverlay.js"></script> <script src="http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/D3SvgOverlay.js"></script> -->
<script type="text/javascript" src="/assets/wordexport/jquery.js"></script> <script type="text/javascript" src="/assets/wordexport/jquery.js"></script>
<script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script> <script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script> <script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script>

Loading…
Cancel
Save