From 6fbe935cc58d4c8b97874eaa2c146fac56437235 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 4 Mar 2022 10:38:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=8A=A5=E8=A1=A8=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=96=B0=E5=A2=9E=E8=BF=94=E5=9B=9E=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combined-query.component.html | 20 +++-- .../combined-query.component.scss | 3 + .../combined-query.component.ts | 88 ++++++++++++++++--- 3 files changed, 92 insertions(+), 19 deletions(-) diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.html b/src/app/statistic-analysis/combined-query/combined-query.component.html index 6fe91fa..1552b45 100644 --- a/src/app/statistic-analysis/combined-query/combined-query.component.html +++ b/src/app/statistic-analysis/combined-query/combined-query.component.html @@ -3,7 +3,7 @@ - +
@@ -134,22 +134,32 @@
- + - +
{{item}}{{item}}undo + +
{{eletd}}{{eletd}}
- + - +
{{item}}{{item}}undo + +
{{eletd}}{{eletd}}
diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.scss b/src/app/statistic-analysis/combined-query/combined-query.component.scss index b51bc0c..92ebd5e 100644 --- a/src/app/statistic-analysis/combined-query/combined-query.component.scss +++ b/src/app/statistic-analysis/combined-query/combined-query.component.scss @@ -176,6 +176,9 @@ mat-paginator { width: 100%; } + .pointer{ + cursor: pointer; + } } } diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.ts b/src/app/statistic-analysis/combined-query/combined-query.component.ts index 449ab69..6fb3ee0 100644 --- a/src/app/statistic-analysis/combined-query/combined-query.component.ts +++ b/src/app/statistic-analysis/combined-query/combined-query.component.ts @@ -59,10 +59,30 @@ export class CombinedQueryComponent implements OnInit { selected = new FormControl(0); //选项卡实例 //判断选了哪一个 selectedIndexChange(e) { - - + this.orRecord = [] this.selected.setValue(e) this.preparelevels = Number(e) + + if (this.preparelevels == 0) { + this.js = this.organizationName + this.jsId = this.organizationId + this.jscheck = true + this.unittype = [] + this.allunittype.forEach(element => { + this.unittype.push(element.id) + }); + this.preparelevel = [1] + this.dwaddtime = '2020-01-01'//单位查询开始时间 + this.dwendtime = this.getNowFormatDate()//单位结束时间 + } else if (this.preparelevels == 1) { + this.yuanjs = this.organizationName + this.yuanjsId = this.organizationId + this.yuanaddtime = '2020-01-01'//预案查询开始时间 + this.yuanendtime = this.getNowFormatDate()//预案查询结束时间 + this.yuanjscheck = true + this.reservePlanType = ['1', '2', '4', '16'] + this.planCategory = ['1', '2', '3', '4', '5'] + } this.getAllPlanInfo() } @@ -413,6 +433,7 @@ export class CombinedQueryComponent implements OnInit { //重置 reset() { + this.orRecord = [] if (this.preparelevels == 0) { this.js = this.organizationName this.jsId = this.organizationId @@ -437,27 +458,66 @@ export class CombinedQueryComponent implements OnInit { this.getAllPlanInfo(); } - + orRecord = [] //进入下一层 clicktd(key, element) { - // console.log(key) - // console.log(element) - // console.log(this.allorganizations) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 if (key == 0) { + let clickOr this.allorganizations.forEach(item => { if (element === item.name) { - if (this.preparelevels == 0) { - this.js = element - this.jsId = item.id - } else if (this.preparelevels == 1) { - this.yuanjs = element - this.yuanjsId = item.id - } - this.getAllPlanInfo(); + clickOr = item } }); + // console.log(clickOr) + if (this.preparelevels == 0) { + if (element == this.js) { + this.snackBar.open('已在当前查询的消防救援站下,无法下钻', '确定', config); + return + } + } else if (this.preparelevels == 1) { + if (element == this.yuanjs) { + this.snackBar.open('已在当前查询的消防救援站下,无法下钻', '确定', config); + return + } + } + if (clickOr.children.length == 0 && this.excelData.length == 1) { + this.snackBar.open('无下级消防救援站,无法下钻', '确定', config); + return + } + + //记录点击过的消防救援站 + this.orRecord.push({ name: this.js, id: this.jsId }) + + + if (this.preparelevels == 0) { + this.js = element + this.jsId = clickOr.id + } else if (this.preparelevels == 1) { + this.yuanjs = element + this.yuanjsId = clickOr.id + } + console.log(this.orRecord) + this.getAllPlanInfo(); } + + + } + + goBack() { + if (this.preparelevels == 0) { + this.js = this.orRecord[this.orRecord.length - 1].name + this.jsId = this.orRecord[this.orRecord.length - 1].id + } else if (this.preparelevels == 1) { + this.yuanjs = this.orRecord[this.orRecord.length - 1].name + this.yuanjsId = this.orRecord[this.orRecord.length - 1].id + } + this.orRecord.pop(); + console.log(this.orRecord) + this.getAllPlanInfo(); } exal() {