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": {
"target": "https://121.36.37.70:8204",
"target": "https://fx.anxincloud.cn/",
"secure": false,
"changeOrigin": true
},
"/hubs": {
"target": "https://121.36.37.70:8204",
"target": "https://fx.anxincloud.cn/",
"secure": false,
"ws": true,
"logLevel": "debug"

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

@ -18,7 +18,8 @@
</div>
<div class="table">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading"
[nzPageSize]="100">
<thead>
<tr>
<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({
selector: 'app-examine',
templateUrl: './examine.component.html',
styleUrls: ['./examine.component.scss']
styleUrls: ['./examine.component.scss'],
})
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 = {
grid: {
left: '2%',
right: '2%',
top: '18%',
bottom: '16%'
bottom: '16%',
},
legend: {
top: '3%',
@ -30,44 +34,46 @@ export class ExamineComponent implements OnInit {
itemGap: 15,
itemWidth: 10,
itemHeight: 10,
orient: 'horizontal'
orient: 'horizontal',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
type: 'shadow',
},
},
xAxis: {
type: 'category',
data: [],
axisTick: { //x轴刻度尺
show: false
axisTick: {
//x轴刻度尺
show: false,
},
axisLine: {//x轴线条颜色
axisLine: {
//x轴线条颜色
show: false,
lineStyle: {
color: '#C7CAD0'
}
color: '#C7CAD0',
},
},
axisLabel: {
show: true,
interval: 0,//使x轴上的文字显示完全,
interval: 0, //使x轴上的文字显示完全,
//设置一行显示几个字,自己设置
formatter: function (params) {
var newParamsName = "";
var newParamsName = '';
var paramsNameNumber = params.length;
var provideNumber = 6;
var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
if (paramsNameNumber > provideNumber) {
for (var p = 0; p < rowNumber; p++) {
var tempStr = "";
var tempStr = '';
var start = p * provideNumber;
var end = start + provideNumber;
if (p == rowNumber - 1) {
tempStr = params.substring(start, paramsNameNumber);
} else {
tempStr = params.substring(start, end) + "\n";
tempStr = params.substring(start, end) + '\n';
}
newParamsName += tempStr;
}
@ -75,22 +81,24 @@ export class ExamineComponent implements OnInit {
newParamsName = params;
}
return newParamsName;
}
}
},
},
},
yAxis: {
type: 'value',
splitLine: {//网格线
splitLine: {
//网格线
lineStyle: {
type: 'solid', //设置网格线类型 dotted:虚线 solid:实线
color: '#ECEFF1' //网格线颜色
type: 'solid', //设置网格线类型 dotted:虚线 solid:实线
color: '#ECEFF1', //网格线颜色
},
},
axisLine: {//y轴线条颜色
axisLine: {
//y轴线条颜色
show: false,
lineStyle: {
color: '#C7CAD0'
}
color: '#C7CAD0',
},
},
},
series: [
@ -99,221 +107,274 @@ export class ExamineComponent implements OnInit {
type: 'bar',
barWidth: 16, // 柱子宽度
label: {
show: false
show: false,
},
emphasis: {
focus: 'series'
focus: 'series',
},
data: []
data: [],
},
{
name: '当场整改',
type: 'bar',
barWidth: 16, // 柱子宽度
label: {
show: false
show: false,
},
emphasis: {
focus: 'series'
focus: 'series',
},
data: []
data: [],
},
{
name: '推送大队',
type: 'bar',
barWidth: 16, // 柱子宽度
label: {
show: false
show: false,
},
emphasis: {
focus: 'series'
focus: 'series',
},
data: []
data: [],
},
{
name: '社会单位数量',
type: 'bar',
barWidth: 16, // 柱子宽度
label: {
show: false
show: false,
},
emphasis: {
focus: 'series'
focus: 'series',
},
data: []
}
]
data: [],
},
],
};
searchForm = {
or: '',
date: null
}
date: null,
};
ngOnInit(): void {
this.searchForm.date = this.methodService.getDateOf30()
this.getAllOrganization()
this.searchForm.date = this.methodService.getDateOf30();
this.getAllOrganization();
setTimeout(() => {
this.echartsOfBar = echarts.init(document.getElementById('echarts'), null, { devicePixelRatio: 2 });
this.echartsOfBar = echarts.init(
document.getElementById('echarts'),
null,
{ devicePixelRatio: 2 }
);
}, 0);
}
isLoading = false
expandKeys
defaultOrId: string
isLoading = false;
expandKeys;
defaultOrId: string;
//获取所有组织机构
nodes: any = []
nodes: any = [];
getAllOrganization() {
this.isLoading = true
let organizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.isLoading = true;
let organizationId = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
let params = {
ContainsChildren: "true",
ContainsChildren: 'true',
PageNumber: 1,
PageSize: 9999,
code: '0000'
}
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
console.log(data.items)
data.items.forEach(element => {
if (element.id == organizationId) {
element.parentId = null
}
element.key = element.id
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
code: '0000',
};
this.http
.get('/api/Organizations', {
params: params,
})
.subscribe((data: any) => {
console.log(data.items);
data.items.forEach((element) => {
if (element.id == organizationId) {
element.parentId = null;
}
element.key = element.id;
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.getRecord()
})
this.getRecord();
});
}
search() {
this.getRecord()
this.getRecord();
}
reset() {
this.searchForm = {
date: this.methodService.getDateOf30(),
or: JSON.parse(sessionStorage.getItem('userData')).organizationId
}
this.getRecord()
or: JSON.parse(sessionStorage.getItem('userData')).organizationId,
};
this.getRecord();
}
showArr = [
'济南市消防救援支队',
'特勤',
'市中',
'历下',
'槐荫',
'天桥',
'历城',
'长清',
'章丘',
'平阴',
'济阳',
'商河',
'莱芜',
'钢城',
'高新',
'南部',
'起步',
];
listOfData = [];
getRecord() {
this.isLoading = true
this.http.get('/api/PlanTasks/GetOrgRecheckStat', {
params: {
OrganizationId: this.searchForm.or,
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59'
}
}).subscribe({
next: (data: any) => {
this.listOfData = [...data]
console.log('统计表格', data)
this.isLoading = false
setTimeout(() => {
this.echartsSetData(this.listOfData)
}, 0);
},
error: (err) => {
this.isLoading = true;
this.http
.get('/api/PlanTasks/GetOrgRecheckStat', {
params: {
OrganizationId: this.searchForm.or,
CheckStartTime:
moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
CheckEndTime:
moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
},
})
.subscribe({
next: (data: any) => {
let num = 100;
data.forEach((item) => {
let sortId = this.showArr.findIndex((v) => {
return item['组织机构'].name.indexOf(v) !== -1;
});
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) {
this.echartsOfBar.clear();
let barData = data
let Barx = []
let Bary1 = []
let Bary2 = []
let Bary3 = []
let Bary4 = []
barData.forEach(element => {
Barx.push(element['组织机构'].name)
Bary1.push(element['总隐患数'])//已完成
Bary2.push(element['当场整改数'])//未完成
Bary3.push(element['上报数量'])//已完成
Bary4.push(element['单位数量'])//未完成
let barData = data;
let Barx = [];
let Bary1 = [];
let Bary2 = [];
let Bary3 = [];
let Bary4 = [];
barData.forEach((element) => {
Barx.push(element['组织机构'].name);
Bary1.push(element['总隐患数']); //已完成
Bary2.push(element['当场整改数']); //未完成
Bary3.push(element['上报数量']); //已完成
Bary4.push(element['单位数量']); //未完成
});
this.echartsOfBarOption.xAxis.data = Barx
this.echartsOfBarOption.series[0].data = Bary1
this.echartsOfBarOption.series[1].data = Bary2
this.echartsOfBarOption.series[2].data = Bary3
this.echartsOfBarOption.series[3].data = Bary4
this.echartsOfBarOption.xAxis.data = Barx;
this.echartsOfBarOption.series[0].data = Bary1;
this.echartsOfBarOption.series[1].data = Bary2;
this.echartsOfBarOption.series[2].data = Bary3;
this.echartsOfBarOption.series[3].data = Bary4;
setTimeout(() => {
this.echartsOfBar && this.echartsOfBar.setOption(this.echartsOfBarOption);
}, 0);
}
isSubordinate = false
isSubordinate = false;
openSubordinate(item) {
if (item.id != this.searchForm.or && item.level === 'battalion') {
this.isSubordinate = true
this.searchForm.or = item.id
this.getRecord()
this.isSubordinate = true;
this.searchForm.or = item.id;
this.getRecord();
}
}
tableBack() {
this.isSubordinate = false
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.getRecord()
this.isSubordinate = false;
this.searchForm.or = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
this.getRecord();
}
goback() {
this.router.navigate(['/statistic/home'])
this.router.navigate(['/statistic/home']);
}
exportExcel() {
const httpOptions = {
responseType: 'blob' as 'json',
params: {
OrganizationId: this.searchForm.or,
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
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', `导出成功`);
CheckStartTime:
moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
CheckEndTime:
moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
RecheckStaType: '检查情况',
},
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 class="table">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading">
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading"
[nzPageSize]="100">
<thead>
<tr>
<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({
selector: 'app-review',
templateUrl: './review.component.html',
styleUrls: ['./review.component.scss']
styleUrls: ['./review.component.scss'],
})
export class ReviewComponent 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 = {
grid: {
left: '2%',
right: '2%',
top: '18%',
bottom: '16%'
bottom: '16%',
},
legend: {
top: '3%',
@ -31,44 +34,46 @@ export class ReviewComponent implements OnInit {
itemGap: 15,
itemWidth: 10,
itemHeight: 10,
orient: 'horizontal'
orient: 'horizontal',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
type: 'shadow',
},
},
xAxis: {
type: 'category',
data: [],
axisTick: { //x轴刻度尺
show: false
axisTick: {
//x轴刻度尺
show: false,
},
axisLine: {//x轴线条颜色
axisLine: {
//x轴线条颜色
show: false,
lineStyle: {
color: '#C7CAD0'
}
color: '#C7CAD0',
},
},
axisLabel: {
show: true,
interval: 0,//使x轴上的文字显示完全,
interval: 0, //使x轴上的文字显示完全,
//设置一行显示几个字,自己设置
formatter: function (params) {
var newParamsName = "";
var newParamsName = '';
var paramsNameNumber = params.length;
var provideNumber = 6;
var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
if (paramsNameNumber > provideNumber) {
for (var p = 0; p < rowNumber; p++) {
var tempStr = "";
var tempStr = '';
var start = p * provideNumber;
var end = start + provideNumber;
if (p == rowNumber - 1) {
tempStr = params.substring(start, paramsNameNumber);
} else {
tempStr = params.substring(start, end) + "\n";
tempStr = params.substring(start, end) + '\n';
}
newParamsName += tempStr;
}
@ -76,22 +81,24 @@ export class ReviewComponent implements OnInit {
newParamsName = params;
}
return newParamsName;
}
}
},
},
},
yAxis: {
type: 'value',
splitLine: {//网格线
splitLine: {
//网格线
lineStyle: {
type: 'solid', //设置网格线类型 dotted:虚线 solid:实线
color: '#ECEFF1' //网格线颜色
type: 'solid', //设置网格线类型 dotted:虚线 solid:实线
color: '#ECEFF1', //网格线颜色
},
},
axisLine: {//y轴线条颜色
axisLine: {
//y轴线条颜色
show: false,
lineStyle: {
color: '#C7CAD0'
}
color: '#C7CAD0',
},
},
},
series: [
@ -100,188 +107,242 @@ export class ReviewComponent implements OnInit {
type: 'bar',
barWidth: 16, // 柱子宽度
label: {
show: false
show: false,
},
emphasis: {
focus: 'series'
focus: 'series',
},
data: []
data: [],
},
{
name: '已复查隐患',
type: 'bar',
barWidth: 16, // 柱子宽度
label: {
show: false
show: false,
},
emphasis: {
focus: 'series'
focus: 'series',
},
data: []
}
]
data: [],
},
],
};
searchForm = {
or: '',
date: null
}
date: null,
};
ngOnInit(): void {
this.searchForm.date = this.methodService.getDateOf30()
this.getAllOrganization()
this.searchForm.date = this.methodService.getDateOf30();
this.getAllOrganization();
setTimeout(() => {
this.echartsOfBar = echarts.init(document.getElementById('echarts'), null, { devicePixelRatio: 2 });
this.echartsOfBar = echarts.init(
document.getElementById('echarts'),
null,
{ devicePixelRatio: 2 }
);
}, 0);
}
isLoading = false
expandKeys
defaultOrId: string
isLoading = false;
expandKeys;
defaultOrId: string;
//获取所有组织机构
nodes: any = []
nodes: any = [];
getAllOrganization() {
this.isLoading = true
let organizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.isLoading = true;
let organizationId = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
let params = {
ContainsChildren: "true",
ContainsChildren: 'true',
PageNumber: 1,
PageSize: 9999,
code: '0000'
}
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
console.log(data.items)
data.items.forEach(element => {
if (element.id == organizationId) {
element.parentId = null
}
element.key = element.id
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
code: '0000',
};
this.http
.get('/api/Organizations', {
params: params,
})
.subscribe((data: any) => {
console.log(data.items);
data.items.forEach((element) => {
if (element.id == organizationId) {
element.parentId = null;
}
element.key = element.id;
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.getRecord()
})
this.getRecord();
});
}
search() {
this.getRecord()
this.getRecord();
}
reset() {
this.searchForm = {
date: this.methodService.getDateOf30(),
or: JSON.parse(sessionStorage.getItem('userData')).organizationId
}
this.getRecord()
or: JSON.parse(sessionStorage.getItem('userData')).organizationId,
};
this.getRecord();
}
showArr = [
'济南市消防救援支队',
'特勤',
'市中',
'历下',
'槐荫',
'天桥',
'历城',
'长清',
'章丘',
'平阴',
'济阳',
'商河',
'莱芜',
'钢城',
'高新',
'南部',
'起步',
];
listOfData = [];
getRecord() {
this.isLoading = true
this.http.get('/api/PlanTasks/GetOrgRecheckStat', {
params: {
OrganizationId: this.searchForm.or,
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59'
}
}).subscribe({
next: (data: any) => {
this.listOfData = [...data]
console.log('统计表格', data)
this.isLoading = false
setTimeout(() => {
this.echartsSetData(this.listOfData)
}, 0);
},
error: (err) => {
}
})
this.isLoading = true;
this.http
.get('/api/PlanTasks/GetOrgRecheckStat', {
params: {
OrganizationId: this.searchForm.or,
CheckStartTime:
moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
CheckEndTime:
moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
},
})
.subscribe({
next: (data: any) => {
let num = 100;
data.forEach((item) => {
let sortId = this.showArr.findIndex((v) => {
return item['组织机构'].name.indexOf(v) !== -1;
});
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) {
this.echartsOfBar.clear();
let barData = data
let Barx = []
let Bary1 = []
let Bary2 = []
barData.forEach(element => {
Barx.push(element['组织机构'].name)
Bary1.push(element['需要复查数'])//已完成
Bary2.push(element['复查通过数'])//未完成
let barData = data;
let Barx = [];
let Bary1 = [];
let Bary2 = [];
barData.forEach((element) => {
Barx.push(element['组织机构'].name);
Bary1.push(element['需要复查数']); //已完成
Bary2.push(element['复查通过数']); //未完成
});
this.echartsOfBarOption.xAxis.data = Barx
this.echartsOfBarOption.series[0].data = Bary1
this.echartsOfBarOption.series[1].data = Bary2
this.echartsOfBarOption.xAxis.data = Barx;
this.echartsOfBarOption.series[0].data = Bary1;
this.echartsOfBarOption.series[1].data = Bary2;
setTimeout(() => {
this.echartsOfBar && this.echartsOfBar.setOption(this.echartsOfBarOption);
}, 0);
}
isSubordinate = false
isSubordinate = false;
openSubordinate(item) {
if (item.id != this.searchForm.or && item.level === 'battalion') {
this.isSubordinate = true
this.searchForm.or = item.id
this.getRecord()
this.isSubordinate = true;
this.searchForm.or = item.id;
this.getRecord();
}
}
tableBack() {
this.isSubordinate = false
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.getRecord()
this.isSubordinate = false;
this.searchForm.or = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
this.getRecord();
}
goback() {
this.router.navigate(['/statistic/home'])
this.router.navigate(['/statistic/home']);
}
exportExcel() {
const httpOptions = {
responseType: 'blob' as 'json',
params: {
OrganizationId: this.searchForm.or,
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
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', `导出成功`);
CheckStartTime:
moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
CheckEndTime:
moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
RecheckStaType: '复查情况',
},
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);
}
// 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;
mapInit() {
var T = window['T'];
var d3 = window['d3'];
var countries = [];
var countriesOverlay = new T.D3Overlay(init, redraw);
//创建地图
this.map = new AMap.Map('mapbox', {
cursor: 'default',
zooms: [8, 16],
mapStyle: 'amap://styles/light',
// bubble: true
});
this.map = new T.Map('mapbox');
this.map.centerAndZoom(new T.LngLat(117.03862, 36.664169), 9);
let colors = [
'#EE30B3',
'#B37CF0',
'#BD2CE6',
'#7768EE',
'#359EEF',
'#7B95CA',
'#CAFBF8',
'#43D0E1',
'#72C6EF',
];
d3.json(
'https://geo.datav.aliyun.com/areas_v3/bound/370100_full.json',
(data) => {
countries = data.features;
this.map.addOverLay(countriesOverlay);
countriesOverlay.bringToBack();
}
);
AMapUI.loadUI(['geo/DistrictExplorer'], (DistrictExplorer) => {
//创建一个实例
let districtExplorer = new DistrictExplorer({
map: this.map,
eventSupport: true, //打开事件支持
});
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');
}
// 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, //填充透明度
};
});
function redraw(sel, transform) {
sel.selectAll('path.geojson').each(function (d, i) {
d3.select(this).attr('d', transform.pathFromGeojson);
// .on("mouseover",function(){
// console.log('这是点击了',);
// })
//绘制父区域
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;
// 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() {
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>
<div id="viewerjs" style="display:none"></div>
</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://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/FileSaver.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script>

Loading…
Cancel
Save