qushaowei
2024-03-14 e055d2d93b516985fbc2df0f6f5a135f3230cccf
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()