From e1cdea9222953a014786e3d034770b5dc757bbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Wed, 24 Jan 2024 18:39:04 +0800 Subject: [PATCH] =?UTF-8?q?statistics=20=E9=A1=B5=E9=9D=A2=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=9D=A1=E4=BB=B6=E6=B7=BB=E5=8A=A0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Statistics/statistics/index.vue | 63 +++++++++++++------ 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/src/views/statistics/Statistics/statistics/index.vue b/src/views/statistics/Statistics/statistics/index.vue index 7ec8453..6da3c84 100644 --- a/src/views/statistics/Statistics/statistics/index.vue +++ b/src/views/statistics/Statistics/statistics/index.vue @@ -274,7 +274,7 @@ export default { stationIds: [], queryParams: { systemType: undefined, - nuclideNames: undefined, + nuclideNames: [], dbName: undefined, startDate: moment().subtract(6, 'days').format('YYYY-MM-DD'), endDate: moment().format('YYYY-MM-DD'), @@ -373,26 +373,51 @@ export default { this.queryParams.endDate = dateString }, handleSearch() { - this.isDefault = false this.chartInitList = [] this.chartLayout = [] - this.stationIds.forEach((id, index) => { - this.chartLayout.push(id) - this.$nextTick(() => { - let currChartInit = echarts.init(document.getElementById(`chart_${id}`)) - this.chartInitList.push(currChartInit) - let params = { - ...this.queryParams, - stationId: id, - } - let options = cloneDeep(commonOptions) - if (this.queryParams.nuclideNames.length > 0) { - this.getChartDate(params, currChartInit, options, id) - } else { - this.$message.warning(`Please select nuclide!`) - } - }) - }) + if (this.queryParams.systemType) { + if (this.stationIds.length > 0) { + this.isDefault = false + this.stationIds.forEach((id, index) => { + this.chartLayout.push(id) + this.$nextTick(() => { + let currChartInit = echarts.init(document.getElementById(`chart_${id}`)) + this.chartInitList.push(currChartInit) + let params = { + ...this.queryParams, + stationId: id, + } + let options = cloneDeep(commonOptions) + + if (this.queryParams.nuclideNames.length < 1) { + this.$message.warning(`Please select nuclide!`) + // this.getChartDate(params, currChartInit, options, id) + } + if (!this.queryParams.dbName) { + this.$message.warning(`Please select Data Source!`) + } + if (!this.queryParams.startDate) { + this.$message.warning(`Please select start Date!`) + } + if (!this.queryParams.endDate) { + this.$message.warning(`Please select end Date!`) + } + if ( + this.queryParams.nuclideNames.length > 0 && + this.queryParams.dbName && + this.queryParams.startDate && + this.queryParams.endDate + ) { + this.getChartDate(params, currChartInit, options, id) + } + }) + }) + } else { + this.$message.warning(`Please select stations!`) + } + } else { + this.$message.warning(`Please select type!`) + } }, async getChartDate(params, chart, option, id) { this.spinning = true