From 045e502fa06255c7ebe1ad6bb4ff503825006cbe Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期二, 14 十一月 2023 14:55:56 +0800 Subject: [PATCH] 去除ts --- src/views/data_management/DataAccessManagement.vue | 135 ++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 122 insertions(+), 13 deletions(-) diff --git a/src/views/data_management/DataAccessManagement.vue b/src/views/data_management/DataAccessManagement.vue index 5c36b21..97d10b7 100644 --- a/src/views/data_management/DataAccessManagement.vue +++ b/src/views/data_management/DataAccessManagement.vue @@ -1,25 +1,134 @@ <script> - export default { - data() { - return{ - - } +import getHistoryApi from '@/api/py/getHistoryApi.js' +import { ElMessage } from 'element-plus' +import exceptionApi from '@/api/exceptionApi.js' +export default { + data() { + return { + async: '鏈畬鎴�....', + normal: '鏈彉鍖�....' + } + }, + mounted() { + // this.query() + // this.getAnalysisData() + }, + methods: { + getData() { + getHistoryApi.fetchDustHistoryData().then((res) => { + print(res) + }) + setTimeout(() => { + ElMessage.success('鏁版嵁鑾峰彇涓�') + }, 600) }, - mounted() { + // 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= '鍙樺寲' + // }, - }, - methods: { + // 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'] + }) + } + } } </script> <template> <div> - 鏁版嵁鎺ュ叆绠$悊 + <!-- 鐐瑰嚮"鑾峰彇鏁版嵁"鍚�,姣忛殧涓�涓皬鏃舵墽琛屼竴娆� --> </div> + + <el-descriptions title="鏁版嵁鑾峰彇璇︽儏" direction="vertical" :column="4" :size="size" border> + <el-descriptions-item label="鏁版嵁鏉ユ簮">鎵皹</el-descriptions-item> + <el-descriptions-item label="鏁版嵁鑾峰彇棰戠巼">1灏忔椂</el-descriptions-item> + <el-descriptions-item label="鑷姩寮傚父鍒嗘瀽" :span="2" + ><el-tag size="small">鏄�</el-tag></el-descriptions-item + > + <el-descriptions-item label="绔欑偣鍩烘湰淇℃伅鏁版嵁"> + <el-tag size="small">鏄�</el-tag> + </el-descriptions-item> + <el-descriptions-item label="娴撳害鏁版嵁"><el-tag size="small">鏄�</el-tag> </el-descriptions-item> + </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> - -</style> \ No newline at end of file +<style scoped> +.el-descriptions, +.el-button { + margin: 20px; +} +</style> -- Gitblit v1.9.3