|
|
|
@ -64,27 +64,14 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
allorganizations: any |
|
|
|
|
allunittype: any //获取所有的单位类型
|
|
|
|
|
jscheck: any //辖区中队包含下级
|
|
|
|
|
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 |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
treeControl = new FlatTreeControl<any>(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); |
|
|
|
|
hasChild = (_: number, node: any) => node.expandable; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获得所有组织机构
|
|
|
|
|
getOrganizations() { |
|
|
|
|
this.http.get('/api/Organizations').subscribe( |
|
|
|
|
(data: any) => { |
|
|
|
|
this.allorganizations = data |
|
|
|
|
console.log(this.allorganizations) |
|
|
|
|
console.log('组织机构列表', this.allorganizations) |
|
|
|
|
this.treedata = this.tree.toTree(data); |
|
|
|
|
this.getpresentOrganization(); |
|
|
|
|
} |
|
|
|
@ -92,9 +79,9 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
organizationName: any //当前单位组织机构名称
|
|
|
|
|
treedata: any //组织机构树型数据
|
|
|
|
|
newArr: any = [] |
|
|
|
|
newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
|
|
|
|
|
newallorganizations2: any |
|
|
|
|
nodes: any = [] |
|
|
|
|
expandedKeys: any = []//默认展开tree节点
|
|
|
|
|
//得到当前单位所在组织机构的tree型数据
|
|
|
|
|
getpresentOrganization() { |
|
|
|
|
this.newallorganizations = this.allorganizations |
|
|
|
@ -110,13 +97,13 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
if (this.organizationName) { |
|
|
|
|
this.newallorganizations.forEach(item => { |
|
|
|
|
if (item.name == this.organizationName) { |
|
|
|
|
this.dataSource.data = [item] |
|
|
|
|
this.newallorganizations2 = [item] |
|
|
|
|
this.expandedKeys = [item.key] |
|
|
|
|
this.nodes = [item] |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.newallorganizations2 = this.treedata |
|
|
|
|
this.dataSource.data = this.treedata |
|
|
|
|
this.expandedKeys = this.nodes[0].key |
|
|
|
|
this.nodes = this.tree.toTree(this.treedata); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -183,7 +170,7 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
let paramsdata: any = { |
|
|
|
|
PageNumber: this.PageNumber || '1', |
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
OrganizationId: this.jsId || '', |
|
|
|
|
OrganizationId: this.js || '', |
|
|
|
|
HasChildren: this.jscheck || '', |
|
|
|
|
Sort: null, |
|
|
|
|
SortType: null, |
|
|
|
@ -191,7 +178,6 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
this.http.get("/api/Papers", { params: paramsdata }).subscribe((data: any) => { |
|
|
|
|
this.tabledataSource = data.items |
|
|
|
|
this.length = data.totalCount |
|
|
|
|
//console.log(this.tabledataSource)
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//获取消防救援对信息
|
|
|
|
@ -224,32 +210,27 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
console.log(this.js) |
|
|
|
|
let paramsdata: any = { |
|
|
|
|
PageNumber: this.PageNumber || '1', |
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
OrganizationId: this.jsId || '', |
|
|
|
|
OrganizationId: this.js || '', |
|
|
|
|
HasChildren: this.jscheck || '', |
|
|
|
|
Sort: null, |
|
|
|
|
SortType: null, |
|
|
|
|
} |
|
|
|
|
if (this.jsId == undefined) { |
|
|
|
|
this.snackBar.open('请输入消防救援队名称', '确定', config); |
|
|
|
|
if (!this.js) { |
|
|
|
|
this.snackBar.open('请选择消防救援队', '确定', config); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.http.get(`/api/Papers`, { params: paramsdata }).subscribe((data: any) => { |
|
|
|
|
console.log(data) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//console.log(this.accound)
|
|
|
|
|
console.log(this.jscheck, this.jsId) |
|
|
|
|
this.PageNumber = 1 |
|
|
|
|
this.pageEvent.pageIndex = 0 |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//重置按钮
|
|
|
|
|
Reset() { |
|
|
|
|
//this.accound=undefined
|
|
|
|
|
this.jsId = '' |
|
|
|
|
this.js = '' |
|
|
|
|
this.jscheck = '' |
|
|
|
|
this.getAlltabledate() |
|
|
|
@ -280,33 +261,9 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//辖区中队div是否显示
|
|
|
|
|
isorganizationbox: boolean = false |
|
|
|
|
js: any //辖区中队输入框
|
|
|
|
|
jsId: any //辖区中队选择的id
|
|
|
|
|
stopclose(e) { |
|
|
|
|
e.stopPropagation(); |
|
|
|
|
} |
|
|
|
|
//点击辖区中队树,将选择的辖区中队添加到变量
|
|
|
|
|
add(node) { |
|
|
|
|
this.isorganizationbox = false |
|
|
|
|
this.js = node.name |
|
|
|
|
this.jsId = node.id |
|
|
|
|
} |
|
|
|
|
//关闭辖区中队隐藏框
|
|
|
|
|
closeorganizationbox() { |
|
|
|
|
this.isorganizationbox = false |
|
|
|
|
} |
|
|
|
|
//打开辖区中队隐藏框
|
|
|
|
|
openorganizationbox() { |
|
|
|
|
this.isorganizationbox = true |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
js: any //辖区中队输入框
|
|
|
|
|
|
|
|
|
|
//关闭出现的组织机构div
|
|
|
|
|
closediv() { |
|
|
|
|
this.isorganizationbox = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|