src/views/mdc/base/modules/equipmentDayAvail/equipmentDayAvailMain.vue
@@ -1,5 +1,5 @@
<template>
  <a-card :bordered="false" class="device_list">
  <div :bordered="false" class="device_list">
    <div class="com_box">
      <!-- 查询区域 -->
      <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
@@ -15,7 +15,7 @@
                <a-input placeholder="输入设备名称查询" :readOnly="readOnly" v-model="queryParams.equipmentName"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="5" :sm="5" :xs="5">
            <a-col :md="4" :sm="4" :xs="4">
              <a-form-item label="日期">
                <a-date-picker v-model="queryParam.dateTime" :disabledDate="disabledDate" format='YYYYMMDD' @change="dataChange"/>
              </a-form-item>
@@ -38,7 +38,7 @@
                </a-select>小时
              </a-form-item>
            </a-col>
            <a-col :md="2" :sm="3" :xs="3">
            <a-col :md="3" :sm="3" :xs="3">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
            </a-col>
            <!--<a-col :md="2" :sm="2" :xs="2">-->
@@ -57,7 +57,7 @@
      </div>
      <!-- table区域-end -->
    </div>
  </a-card>
  </div>
</template>
<script>
@@ -163,6 +163,7 @@
      }
    },
    methods: {
      moment,
      drawTu(){
        let dayAvailBar = this.$echarts.init(document.getElementById('dayAvailBar'), 'macarons');
        //dayAvailLine = echarts.init(document.getElementById('dayAvailLine'));
@@ -208,7 +209,7 @@
          series: [
            {
              name: '利用率',
              type: 'bar',
              type: 'line',
              barWidth: 50,
              itemStyle: {
                normal: {
@@ -236,7 +237,7 @@
      },
      handleChange(value) {
        this.queryParam.timeType = value
        console.log(this.queryParam.timeType)
        // console.log(this.queryParam.timeType)
      },
      tabChange(val) {
        this.activeKey = val
@@ -254,10 +255,14 @@
            for(var i = 0;i<res.result.dayRateDto.length;i++){
              this.useingRates.push(res.result.dayRateDto[i].utilizationRate)
            }
            console.log(this,spaceTime)
            // console.log(this,spaceTime)
            this.drawTu()
          } else {
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() => {
          this.loading = false
@@ -271,35 +276,47 @@
        }
      },
      searchQuery(){
        this.spaceTime = []
        this.useingRates = []
        if(this.queryParams.typeTree == "1"){
          this.queryParams.parentId =  this.queryParamEquip.parentId
          // this.queryParams.equipmentId =  this.queryParamEquip.equipmentId
        if(this.queryParam.dateTime){
          this.spaceTime = []
          this.useingRates = []
          if(this.queryParams.typeTree == "1"){
            this.queryParams.parentId =  this.queryParamEquip.parentId
            // this.queryParams.equipmentId =  this.queryParamEquip.equipmentId
        }else{
          this.queryParams.parentId = this.queryParamEquip.parentId
          // this.queryParams.equipmentId = ""
        }
        this.AnalysisList = [];
        //获取查询条件
        this.queryParam.parentId = this.queryParams.parentId;
        this.queryParam.equipmentId = this.queryParams.equipmentId;
        this.queryParam.typeTree = this.queryParams.typeTree
        getAction(this.url.dayUtilizationRate,this.queryParam).then((res) => {
          if(res.success){
            this.spaceTime=res.result.dateList
            for(var i = 0;i<res.result.dayRateDto.length;i++){
              this.useingRates.push(this.numFilter(res.result.dayRateDto[i].utilizationRate))
            }
            this.drawTu()
          }else{
            this.$message.warning(res.message)
            this.queryParams.parentId = this.queryParamEquip.parentId
            // this.queryParams.equipmentId = ""
          }
        }).finally(() => {
          this.loading = false
        })
          this.AnalysisList = [];
          //获取查询条件
          this.queryParam.parentId = this.queryParams.parentId;
          this.queryParam.equipmentId = this.queryParams.equipmentId;
          this.queryParam.typeTree = this.queryParams.typeTree
          getAction(this.url.dayUtilizationRate,this.queryParam).then((res) => {
            if(res.success){
              this.spaceTime=res.result.dateList
              for(var i = 0;i<res.result.dayRateDto.length;i++){
                this.useingRates.push(this.numFilter(res.result.dayRateDto[i].utilizationRate))
              }
              this.drawTu()
            }else{
              // this.$message.warning(res.message)
              this.$notification.warning({
                message:'消息',
                description:res.message
              });
            }
          }).finally(() => {
            this.loading = false
          })
        }else{
          this.$notification.warning({
            message:'消息',
            description:'请选择时间'
          });
        }
      },
      searchReset() {
        this.spaceTime = []
@@ -330,7 +347,11 @@
              }
              this.drawTu()
            }else{
              this.$message.warning(res.message)
              // this.$message.warning(res.message)
              this.$notification.warning({
                message:'消息',
                description:res.message
              });
            }
          }).finally(() => {
            this.loading = false
@@ -362,7 +383,11 @@
              }
              this.drawTu()
            }else{
              this.$message.warning(res.message)
              // this.$message.warning(res.message)
              this.$notification.warning({
                message:'消息',
                description:res.message
              });
            }
          }).finally(() => {
            this.loading = false
@@ -384,10 +409,19 @@
              this.queryParams = {}
              // this.queryList()
              this.equipment = {}
              _this.$message.warning('请联系管理员,开放设备权限!')
              // _this.$message.warning('请联系管理员,开放设备权限!')
              _this.$notification.warning({
                message:'消息',
                description:'请联系管理员,开放设备权限!'
              });
            }
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            _this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        })
      },
@@ -405,10 +439,18 @@
              this.queryParams = {}
              // this.queryList()
              this.equipment = {}
              _this.$message.warning('请联系管理员,开放设备权限!')
              // _this.$message.warning('请联系管理员,开放设备权限!')
              _this.$notification.warning({
                message:'消息',
                description:'请联系管理员,开放设备权限!'
              });
            }
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            _this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        })
      }