From e055d2d93b516985fbc2df0f6f5a135f3230cccf Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期四, 14 三月 2024 11:13:47 +0800 Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/vue_mdc_430 into develop --- src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue | 75 ++++++++++++++----------------------- 1 files changed, 28 insertions(+), 47 deletions(-) diff --git a/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue b/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue index ecbcaae..b65eec2 100644 --- a/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue +++ b/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue @@ -11,7 +11,7 @@ </a-col> <a-col :md="4" :sm="4" :xs="4"> <a-form-item label="鏃ユ湡"> - <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' @change="dataChange"/> + <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' @change="dataChange" :allowClear="false"/> </a-form-item> </a-col> <a-col :md="2" :sm="2" :xs="2"> @@ -20,12 +20,6 @@ <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> </a-space> </a-col> - <!--<a-col :md="2" :sm="2" :xs="2">--> - <!--<a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>--> - <!--</a-col>--> - <!--<a-col :md="2" :sm="2" :xs="2">--> - <!--<a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>--> - <!--</a-col>--> </a-row> </a-form> </div> @@ -97,14 +91,9 @@ import moment from 'moment' import { putAction, getAction } from '@/api/manage' import $ from 'jquery' - import AFormItem from 'ant-design-vue/es/form/FormItem' import * as echarts from 'echarts' export default { name: 'StatisticsLegend', - components:{ - AFormItem - - }, props: { equip: {} }, data(){ return{ @@ -136,16 +125,11 @@ } }, created(){ - - let collectTime = moment(moment().add(-1,'d'),'YYYY-MM-DD'); - - - this.queryParams.collectTime = collectTime; - - this.queryParams.dateTime = this.queryParams.collectTime.format('YYYYMMDD') - this.initEquipmentNode('-1') - this.queryStatistical(); + this.queryParams.collectTime = moment().add(-1,'d').format('YYYY-MM-DD') + this.queryParams.dateTime = moment().add(-1,'d').format('YYYYMMDD') + this.initEquipmentNode() + // this.queryStatistical(); // this.getTime(37800); }, @@ -595,45 +579,38 @@ StartupLine.setOption(StartupLine_option); }, queryStatistical(){ - if(this.queryParams.collectTime){ - getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{ - if(res.success){ - this.StatCharOpeningRate = res.result.openRate; - this.StatCharUsedRate = res.result.utilizationRate; - this.UtilizationHeight = res.result.openRate; - this.StatCharUsedopeningRate = res.result.usedOpenRate; - this.StartupHeight = res.result.usedOpenRate; - this.openingLong = this.getTime(res.result.openLong) - this.waitingLong = this.getTime(res.result.waitLong); - this.processLong = this.getTime(res.result.processLong); - this.closedLong = this.getTime(res.result.closeLong); - this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong); - this.draw(); - } - }) - }else{ - this.$notification.warning({ - message:'娑堟伅', - description:'璇烽�夋嫨鏃堕棿' - }) - } + getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{ + if(res.success){ + this.StatCharOpeningRate = res.result.openRate; + this.StatCharUsedRate = res.result.utilizationRate; + this.UtilizationHeight = res.result.openRate; + this.StatCharUsedopeningRate = res.result.usedOpenRate; + this.StartupHeight = res.result.usedOpenRate; + this.openingLong = this.getTime(res.result.openLong) + this.waitingLong = this.getTime(res.result.waitLong); + this.processLong = this.getTime(res.result.processLong); + this.closedLong = this.getTime(res.result.closeLong); + this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong); + this.draw(); + } + }) }, dataChange(val) { - this.queryParam.collectTime1 = ""; if(val){ this.queryParams.dateTime = val.format('YYYYMMDD') this.queryParams.collectTime = val.format('YYYY-MM-DD'); } }, - initEquipmentNode(id) { + initEquipmentNode() { let _this = this getAction(this.url.getBaseTree).then((res) => { if (res.success) { if(res.result[0]){ _this.$set(this.queryParam, 'tierName', res.result[0].title) + _this.$set(this.queryParams, 'parentId', res.result[0].key) } + this.queryStatistical() // console.log(res.result[0].entity.tierName) - } else { // this.$message.warn(res.message) this.$notification.warning({ @@ -660,7 +637,11 @@ }, searchReset() { this.queryParam = {} - this.queryParams = {} + this.queryParams = { + collectTime:moment().add(-1,'d').format('YYYY-MM-DD'), + dateTime:moment().add(-1,'d').format('YYYYMMDD') + } + this.initEquipmentNode() // this.dates = [] // this.queryStatistical() // this.onClearSelected() -- Gitblit v1.9.3