From fd934f83afae1e3fce46db8610837d0e0f4d9393 Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期四, 02 十一月 2023 10:44:56 +0800 Subject: [PATCH] 按开发清单已修改 --- src/views/data_management/DataAccessManagement.vue | 91 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 87 insertions(+), 4 deletions(-) diff --git a/src/views/data_management/DataAccessManagement.vue b/src/views/data_management/DataAccessManagement.vue index 2ba327a..97d10b7 100644 --- a/src/views/data_management/DataAccessManagement.vue +++ b/src/views/data_management/DataAccessManagement.vue @@ -1,12 +1,17 @@ <script> import getHistoryApi from '@/api/py/getHistoryApi.js' import { ElMessage } from 'element-plus' +import exceptionApi from '@/api/exceptionApi.js' export default { data() { - return {} + return { + async: '鏈畬鎴�....', + normal: '鏈彉鍖�....' + } }, mounted() { - + // this.query() + // this.getAnalysisData() }, methods: { getData() { @@ -16,6 +21,83 @@ setTimeout(() => { ElMessage.success('鏁版嵁鑾峰彇涓�') }, 600) + }, + // async query() { + // await exceptionApi.analysisdata('','2023-08-01','2023-10-01', 'day').then((response) => { + // const chartData = response.data.data + // this.async = '瀹屾垚' + // }) + // this.normal= '鍙樺寲' + // }, + // query() { + // exceptionApi.analysisdata('','2023-08-01','2023-10-01', 'day').then((response) => { + // const chartData = response.data.data + // this.async = '瀹屾垚' + // }) + // this.normal= '鍙樺寲' + // }, + + // query() { + // exceptionApi.analysisdata('','2023-08-01','2023-10-01', 'day') + // .then((response) => { + // return response.data.data + // }).then((res)=>{ + // a = exceptionApi.analysisdataByType('2023-09-01','month') + + // }) + // }, + + // getd1(){ + // return exceptionApi.analysisdataByType('2023-09-01','month') + // }, + // async query() { + // const analysis = await exceptionApi.analysisdata('','2023-08-01','2023-10-01', 'day') + // console.log('鍒嗘瀽鏁版嵁涓猴細',analysis); + // const exception = await exceptionApi.analysisdataByType('2023-09-01','month') + // console.log('寮傚父鏁版嵁涓猴細',exception); + // } + getAnalysisData() { + const analysis = exceptionApi.analysisdata( + this.form.name, + this.form.beginTime, + this.form.endTime, + 'day' + ) + const exception = exceptionApi.exceptiondata1({ + siteName: this.form.name, + beginTime: this.form.beginTime, + endTime: this.form.endTime + }) + this.loading = true + this.queryButton = true + Promise.all([analysis, exception]).then((res) => { + this.chartData = res[0].data.data + let exceptionData = res[1].data.data + // console.log('鍒嗘瀽鏁版嵁锛�',analysisData); + // console.log('寮傚父鏁版嵁锛�',exceptionData); + // 寰楀埌鏈夋晥鏁版嵁鐨勮捣濮嬫椂闂� + this.begin = this.chartData[0].lst + this.end = this.chartData[this.chartData.length - 1].lst + // 绉婚櫎绌烘暟鎹姸鎬� + this.isNoData = false + // 鐢熸垚鎶樼嚎鍥炬暟鎹厤缃� + this.setChart() + + // 鏃ョ粺璁℃暟鎹� + let temp = index.calBillData(this.chartData, this.begin, this.end) + // 寮傚父鏁版嵁 + let obj = index.calRecur(exceptionData) + + this.bill.min = temp['min'] + this.bill.max = temp['max'] + this.bill.avg = temp['avg'] + this.bill.online = temp['online'] + this.bill.valid = temp['valid'] + this.bill.exceeding = temp['exceeding'] + + this.bill.exceptionRecurrence = obj['exceptionRecurrence'] + this.bill.exceptionTypeAggregation = obj['exceptionTypeAggregation'] + }) } } } @@ -39,12 +121,13 @@ </el-descriptions> <el-button type="primary" @click="getData"> 鑷姩鑾峰彇 </el-button> + <div>寮傛鍑芥暟锛歿{ async }}</div> + <div style="margin-bottom: 20px"></div> + <div>鍚庨潰锛� {{ normal }}</div> </template> - <style scoped> .el-descriptions, - .el-button { margin: 20px; } -- Gitblit v1.9.3