zenglf
2023-10-24 575a75a0519e53ceec6bb5d31f682124596c3bae
src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue
@@ -1,25 +1,31 @@
<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">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <!--<a-col :md="5" :sm="5">-->
            <!--<a-form-item label="名称">-->
              <!--<a-input placeholder="输入设备名称查询" :readOnly="readOnly" v-model="queryParam.tierName"></a-input>-->
            <!--</a-form-item>-->
          <!--</a-col>-->
          <a-col :md="5" :sm="5">
            <a-form-item label="名称">
              <a-input placeholder="输入设备名称查询" :readOnly="readOnly" v-model="queryParam.tierName"></a-input>
            <a-form-item label="驱动类型">
              <!--<j-dict-select-tag placeholder="请选择驱动类型"-->
                                 <!--:triggerChange="true" dictCode="mdc_driveType"-->
                                 <!--v-model="queryParam.driveType" allow-clear/>-->
              <a-auto-complete
                v-model="queryParam.driveType"
                :data-source="driveTypeList"
                placeholder="驱动类型"
                :filter-option="filterOption"
              />
            </a-form-item>
          </a-col>
          <!--<a-col :md="4" :sm="4">-->
          <!--<a-form-model-item label="驱动类型" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
            <!--<j-dict-select-tag :disabled="true" :readOnly="disableSubmit" placeholder="请选择驱动类型"-->
                               <!--:triggerChange="true" dictCode="mdc_driveType"-->
                               <!--v-model="model.driveType" allow-clear/>-->
          <!--</a-form-model-item>-->
        <!--</a-col>-->
          <a-col :md="9" :sm="9" :xs="4">
            <a-form-item label="时间">
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYY-MM-DD"/>
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYYMMDD"/>
            </a-form-item>
          </a-col>
          <a-col :md="2" :sm="3" :xs="3">
@@ -34,23 +40,20 @@
    <!-- table区域-begin -->
    <div id="DeviceList">
      <a-tabs :activeKey="activeKey" @change="tabChange" tabPosition="top">
        <a-tab-pane key="1" tab="图形" force-render>
          <comparative-analysis-bar></comparative-analysis-bar>
          <!--<log-list :dataList='normalList' ref="logList" :loadingequip='loadingstayus'></log-list>-->
        <a-tab-pane key="1" tab="图形">
          <comparative-analysis-bar ref="AnalysisBar" :dataList='AnalysisBarList'></comparative-analysis-bar>
        </a-tab-pane>
        <a-tab-pane key="2" tab="仪表">
          <comparative-analysis-gauge></comparative-analysis-gauge>
          <!--<work-log-list :dataList='runList' ref="workLogList" :loadingrun="loadingrunStatus"></work-log-list>-->
        <a-tab-pane key="2" tab="仪表" forceRender>
          <comparative-analysis-gauge ref="AnalysisGauge" :dataList="AnalysisGauge"></comparative-analysis-gauge>
        </a-tab-pane>
        <a-tab-pane key="3" tab="饼图">
          <conparative-analysis-pie></conparative-analysis-pie>
          <!--<alarm-log-list :dataList='waringList' ref="alarmLogList" :loadingwarn="loadingwarnStatus"></alarm-log-list>-->
        <a-tab-pane key="3" tab="饼图" forceRender>
          <conparative-analysis-pie ref="AnalysisPie" :dataList="AnalysisPie"></conparative-analysis-pie>
        </a-tab-pane>
      </a-tabs>
    </div>
    <!-- table区域-end -->
    </div>
  </a-card>
  </div>
</template>
<script>
@@ -67,16 +70,14 @@
  import comparativeAnalysisGauge from'./comparativeAnalysisGauge'
  import conparativeAnalysisPie from './conparativeAnalysisPie'
  import '@/components/table2excel/table2excel'
  import {
    JeecgListMixin
  } from '@/mixins/JeecgListMixin'
  import JInput from '@/components/jeecg/JInput'
  import JEllipsis from '@/components/jeecg/JEllipsis'
  import Tooltip from 'ant-design-vue/es/tooltip'
  import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
  import api from '@/api/mdc'
  export default {
    name: 'comparativeAnalysismain',
    mixins: [JeecgListMixin],
    // mixins: [JeecgListMixin],
    components: {
      Tooltip,
      comparativeAnalysisBar,
@@ -94,6 +95,9 @@
        typeTree:"",
        typeParent:1,
        typeEquipment:1,
        AnalysisBarList:[],
        AnalysisGauge:[],
        AnalysisPie:[],
        dates: [],
        xianshi:"",
        readOnly:true,
@@ -102,52 +106,11 @@
        queryParamEquip:{},
        queryParamPeople:{},
        dataStartsoucre:[],
        columns: [
          {
            title: '设备编号',
            align: 'center',
            dataIndex: 'equipmentId'
          },
          {
            title: '设备名称',
            align: 'center',
            dataIndex: 'equipmentName',
            defaultSortOrder:'descend',
            sorter: (a, b) => {return a.equipmentName>b.equipmentName?1:-1}
          },
          {
            title: '维修类型',
            align: 'center',
            dataIndex: 'mdcRepairTypeDictText'
          },
          {
            title: '开始时间',
            align: 'center',
            dataIndex: 'startTime',
            // scopedSlots:{customRender:'startTime'},
            // customRender:(text,row,index) => {
            //   return moment(text).format("YYYY-MM-DD HH:mm:ss")
            // }
          },
          {
            title: '结束时间',
            align: 'center',
            dataIndex: 'endTime'
          },
          {
            title: '操作',
            dataIndex: 'action',
            scopedSlots: {customRender: 'action'},
            align: "center",
            width: 150
          }
        ],
        url: {
          list: '/mdc/mdcEquipmentRepair/pageList',
          deleteBatch: '/mdc/mdcEquipmentRepair/delete',
          getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid',
          getBaseTree: '/mdc/mdcEquipment/queryTreeListByProduction',
        }
          comparativeAnalysis:'/mdc/efficiencyReport/comparativeAnalysis'
        },
        AnalysisList:{},
        driveTypeList:[]
      }
    },
    watch:{
@@ -159,28 +122,29 @@
      nodeTree(val) { //监听currSelected 变化,将变化后的数值传递给 getCurrSelected 事件
        if (JSON.stringify(val) != '{}') {
          if (val.equipmentId) {
            this.$set(this.queryParam, 'tierName', val.title)
            // this.$set(this.queryParam, 'tierName', val.title)
            this.queryParamEquip.parentId =  ""
            this.queryParams.equipmentId = val.equipmentId
            this.queryParamEquip.equipmentId = val.equipmentId
          } else {
            this.$set(this.queryParam, 'tierName', val.title)
            // this.$set(this.queryParam, 'tierName', val.title)
            this.queryParamEquip.parentId = val.key
            this.queryParams.equipmentId = ''
          }
          this.searchQuery()
        }
      },
      nodePeople(val){
        if (JSON.stringify(val) != '{}') {
          if (val.equipmentId) {
            this.$set(this.queryParam, 'tierName', val.title)
            // this.$set(this.queryParam, 'tierName', val.title)
            this.queryParamEquip.parentId =  ""
            this.queryParams.equipmentId = val.equipmentId
            this.queryParamEquip.equipmentId = val.equipmentId
          } else {
            this.$set(this.queryParam, 'tierName', val.title)
            this.queryParamPeople.parentId = val.key
            // this.$set(this.queryParam, 'tierName', val.title)
            this.queryParamEquip.parentId = val.key
            this.queryParams.equipmentId = ''
          }
          this.searchQuery()
@@ -188,34 +152,6 @@
      }
    },
    methods: {
      initEquipmentNode(id) {
        let _this = this
        getAction(this.url.getBaseTree).then((res) => {
          if (res.success) {
            // console.log(res.result[0].entity.tierName)
            _this.$set(this.queryParam, 'tierName', res.result[0].title)
            _this.$set(this.queryParams, 'parentId', res.result[0].key)
            // _this.queryStatistical()
          } else {
            this.$message.warn(res.message)
          }
        }).finally(() => {
          this.loading = false
          this.cardLoading = false
        })
        // getAction(this.url.getEquipmentByPid, { pid: id }).then((res) => {
        //   if (res.success) {
        //     if (res.result) {
        //       _this.$set(this.queryParam, 'tierName', res.result.tierName)
        //       _this.$set(this.queryParam, 'equipmentId', res.result.equipmentId)
        //       // _this.quip = res.result
        //       _this.searchQuery()
        //     } else {
        //       _this.$message.warning('请配置设备!')
        //     }
        //   }
        // })
      },
      tabChange(val) {
        this.activeKey = val
      },
@@ -223,16 +159,69 @@
        // console.log(v1,v2)
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
        // console.log(v2[0],v2[1])
        console.log(v2[0],v2[1])
      },
      onChange(value, dateString) {
        // console.log('Selected Time: ', value);
        // console.log('Formatted Selected Time: ', dateString);
      loadAnalysis(){
        getAction(this.url.comparativeAnalysis,this.queryParam).then(res => {
          if (res.success) {
            this.AnalysisList = res.result
            this.AnalysisBarList = res.result.graphics
            this.AnalysisGauge = res.result.meters
            this.AnalysisPie.push(res.result.pieCharts)
          } else {
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      onOk(value) {
        console.log('onOk: ', value);
      searchQuery(){
        if(this.dates&&this.dates.length>0){
          this.AnalysisList = []
          this.AnalysisBarList = []
          this.AnalysisGauge = []
          this.AnalysisPie = []
          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.comparativeAnalysis,this.queryParam).then((res) => {
            if(res.success){
              this.AnalysisList = res.result
              this.AnalysisBarList = res.result.graphics
              this.AnalysisGauge = res.result.meters
              this.AnalysisPie.push(res.result.pieCharts)
            }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.AnalysisList = []
        this.AnalysisBarList = []
        this.AnalysisGauge = []
        this.AnalysisPie = []
        if(this.queryParams.typeTree == "1"){
          this.typeTree = this.queryParams.typeTree
          this.typeParent =  this.queryParams.parentId
@@ -250,295 +239,197 @@
            }else{
              this.queryParams.equipmentId = this.queryParamEquip.equipmentId
            }
          }
          this.ipagination.current = 1
          this.ResetloadData();
          getAction(this.url.comparativeAnalysis,this.queryParams).then((res) => {
            if(res.success){
              this.AnalysisList = res.result
              this.AnalysisBarList = res.result.graphics
              this.AnalysisGauge = res.result.meters
              this.AnalysisPie.push(res.result.pieCharts)
            }else{
              // this.$message.warning(res.message)
              this.$notification.warning({
                message:'消息',
                description:res.message
              });
            }
          }).finally(() => {
            this.loading = false
          })
        }else{
          this.typeTree = this.queryParams.typeTree
          this.typeParent =  this.queryParams.parentId
          // this.typeEquipment = this.queryParams.equipmentId
          this.typeEquipment = this.queryParams.equipmentId
          this.queryParams = {}
          this.queryParam = {}
          this.dates = []
          this.queryParams.typeTree = this.typeTree
          this.queryParams.parentId = this.typeParent
          // this.queryParams.equipmentId =  this.typeEquipment
          this.ipagination.current = 1
          this.ResetloadData();
        }
      },
      ResetloadData() {
        if(!this.url.list){
          this.$message.error("请设置url.list属性!")
          return
        }
        //加载数据 若传入参数1则加载第一页的内容
        var params = this.getQueryParams();//查询条件
        if(!params){
          return false;
        }
        params.typeTree = this.queryParams.typeTree
        params.parentId = this.queryParams.parentId
        params.equipmentId = this.queryParams.equipmentId
        this.loading = true;
        getAction(this.url.list, params).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records||res.result;
            // this.initDeviceType(this.dataSource)
            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
            // this.dataSource = res.result.records||res.result;
            if(res.result.total)
            {
              this.ipagination.total = res.result.total;
            }else{
              this.ipagination.total = 0;
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          if(this.queryParams.parentId !=  ""){
            this.queryParams.equipmentId =  ""
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      handleEdit: function (record) {
        this.$refs.modalFormedit.edit(record);
        this.$refs.modalFormedit.title = "编辑";
        this.$refs.modalFormedit.disableSubmit = false;
      },
      handleTableChange(pagination, filters, sorter) {
        this.dataSource = []
        //分页、排序、筛选变化时触发
        //TODO 筛选
        // console.log(pagination)
        if (Object.keys(sorter).length > 0) {
          this.isorter.column = sorter.field;
          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
        }
        this.ipagination = pagination;
        //获取查询条件
        let sqp = {}
        if(this.superQueryParams){
          sqp['superQueryParams']=encodeURI(this.superQueryParams)
          sqp['superQueryMatchType'] = this.superQueryMatchType
        }
        var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters);
        param.pageNo = this.ipagination.current;
        param.pageSize = this.ipagination.pageSize;
        param.field = this.getQueryField();
        param.parentId = this.queryParams.parentId;
        param.equipmentId = this.queryParams.equipmentId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        getAction(this.url.list,param).then((res) => {
          if(res.success){
            this.dataSource = res.result.records||res.result;
            if(res.result.total)
            {
              this.ipagination.total = res.result.total;
            if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){
              this.queryParams.equipmentId =  this.typeEquipment
            }else{
              this.ipagination.total = 0;
              this.queryParams.equipmentId = this.queryParamEquip.equipmentId
            }
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      searchQueryEdit(){
        if(this.queryParams.typeTree == "1"){
          this.queryParams.parentId =  this.queryParamEquip.parentId
        }else{
          this.queryParams.parentId = this.queryParamPeople.parentId
          this.queryParams.equipmentIds = ""
        }
        this.dataSource = [];
        //获取查询条件
        let sqp = {}
        if(this.superQueryParams){
          sqp['superQueryParams']=encodeURI(this.superQueryParams)
          sqp['superQueryMatchType'] = this.superQueryMatchType
        }
        var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters);
        param.pageNo = this.ipagination.current;
        param.pageSize = this.ipagination.pageSize;
        param.field = this.getQueryField();
        param.parentId = this.queryParams.parentId;
        param.equipmentId = this.queryParams.equipmentId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        getAction(this.url.list,param).then((res) => {
          if(res.success){
            this.dataSource = res.result.records||res.result;
            if(res.result.total)
            {
              this.ipagination.total = res.result.total;
          getAction(this.url.comparativeAnalysis,this.queryParams).then((res) => {
            if(res.success){
              this.AnalysisList = res.result
              this.AnalysisBarList = res.result.graphics
              this.AnalysisGauge = res.result.meters
              this.AnalysisPie.push(res.result.pieCharts)
            }else{
              this.ipagination.total = 0;
              // this.$message.warning(res.message)
              this.$notification.warning({
                message:'消息',
                description:res.message
              });
            }
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
          }).finally(() => {
            this.loading = false
          })
        }
      },
      /**
       * 调用接口获取控制系统类型
       */
      getDriveTypeByApi(){
        api.getDriveTypeApi().then((res)=>{
          this.driveTypeList=res.result.map(item=>item.value)
        })
      },
      searchQuery(){
        if(this.queryParams.typeTree == "1"){
          this.queryParams.parentId =  this.queryParamEquip.parentId
          // this.queryParams.equipmentId =  this.queryParamEquip.equipmentId
        }else{
          this.queryParams.parentId = this.queryParamPeople.parentId
          // this.queryParams.equipmentId = ""
        }
        this.dataSource = [];
        //获取查询条件
        let sqp = {}
        if(this.superQueryParams){
          sqp['superQueryParams']=encodeURI(this.superQueryParams)
          sqp['superQueryMatchType'] = this.superQueryMatchType
        }
        var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters);
        param.pageNo = 1;
        param.pageSize = this.ipagination.pageSize;
        param.field = this.getQueryField();
        param.parentId = this.queryParams.parentId;
        param.equipmentId = this.queryParams.equipmentId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        // console.log(param);
        getAction(this.url.list,param).then((res) => {
          if(res.success){
            this.dataSource = res.result.records||res.result;
            if(res.result.total)
            {
              this.ipagination.total = res.result.total;
            }else{
              this.ipagination.total = 0;
            }
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      /**
       * 联想输入框筛选功能
       * @param input 输入的内容
       * @param option 配置
       * @returns {boolean} 判断是否筛选
       */
      filterOption(input, option) {
        return (
          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
        );
      },
      loadData(arg) {
        if(!this.url.list){
          this.$message.error("请设置url.list属性!")
          return
        }
        //加载数据 若传入参数1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1;
        }
        var params = this.getQueryParams();//查询条件
        if(!params){
          return false;
        }
        this.loading = true;
        getAction(this.url.list, params).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records||res.result;
            // this.initDeviceType(this.dataSource)
            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
            // this.dataSource = res.result.records||res.result;
            if(res.result.total)
            {
              this.ipagination.total = res.result.total;
            }else{
              this.ipagination.total = 0;
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      modalFormOk(val) {
        // 新增/修改 成功时,重载列表
        this.searchQueryEdit();
        // this.$emit('openBasetree','')
        this.selectedRowKeys = []
      },
      handleDelete: function (id) {
        if(!this.url.deleteBatch){
          this.$message.error("请设置url.delete属性!")
          return
        }
        var that = this;
        deleteAction(that.url.deleteBatch, {id: id}).then((res) => {
          if (res.success) {
            //重新计算分页问题
            that.reCalculatePage(1)
            that.$message.success(res.message);
            that.searchQuery();
          } else {
            that.$message.warning(res.message);
          }
        });
      },
      handleAdd() {
        this.$refs.modalForm.add(this.node)
        this.$refs.modalForm.title = '新增'
        this.$refs.modalForm.disableSubmit = false
      },
      handleAddXIU() {
        this.$refs.modalFormadd.add()
        this.$refs.modalFormadd.title = '新增'
        this.$refs.modalFormadd.disableSubmit = false
      },
      pQuery(parentId) {
        this.queryParam.parentId = parentId[0]
        if(this.selectedRowKeys.length >= 1) {
          this.selectedRowKeys.length = 0
        }
        this.loadData()
      },
      onSelectChange(selectedRowKeys) {
        this.selectedRowKeys = selectedRowKeys
      },
      initEquipment(id) {
        let _this = this
        getAction(this.url.getEquipmentByPid, { pid: id }).then((res) => {
          if (res.success) {
            if (res.result) {
              _this.$set(this.queryParams, 'equipmentName', res.result.equipmentName)
              _this.$set(this.queryParams, 'equipmentId', res.result.equipmentId)
              _this.equipment = res.result
              _this.searchQuery()
            } else {
              _this.$message.warning('请配置设备!')
            }
          }
        })
      },
      exportExcel() {
        $("#DeviceList").table2excel({
          exclude: ".noExl",
          name: "Excel Document Name",
          filename: "设备维修详情",
          exclude_img: true,
          fileext: ".xls",
          exclude_links: true,
          exclude_inputs: true
        });
      },
      // onChange(value, dateString) {
      //   // console.log('Selected Time: ', value);
      //   // console.log('Formatted Selected Time: ', dateString);
      // },
      // searchReset() {
      //   if(this.queryParams.typeTree == "1"){
      //     this.typeTree = this.queryParams.typeTree
      //     this.typeParent =  this.queryParams.parentId
      //     this.typeEquipment = this.queryParams.equipmentId
      //     this.queryParams = {}
      //     this.queryParam = {}
      //     this.dates = []
      //     this.queryParams.typeTree = this.typeTree
      //     this.queryParams.parentId = this.typeParent
      //     if(this.queryParams.parentId !=  ""){
      //       this.queryParams.equipmentId =  ""
      //     }else{
      //       if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){
      //         this.queryParams.equipmentId =  this.typeEquipment
      //       }else{
      //         this.queryParams.equipmentId = this.queryParamEquip.equipmentId
      //       }
      //
      //     }
      //
      //     this.ipagination.current = 1
      //     this.ResetloadData();
      //   }else{
      //     this.typeTree = this.queryParams.typeTree
      //     this.typeParent =  this.queryParams.parentId
      //     // this.typeEquipment = this.queryParams.equipmentId
      //     this.queryParams = {}
      //     this.queryParam = {}
      //     this.dates = []
      //     this.queryParams.typeTree = this.typeTree
      //     this.queryParams.parentId = this.typeParent
      //     // this.queryParams.equipmentId =  this.typeEquipment
      //     this.ipagination.current = 1
      //     this.ResetloadData();
      //   }
      //
      // },
      // ResetloadData() {
      //   if(!this.url.list){
      //     this.$message.error("请设置url.list属性!")
      //     return
      //   }
      //   var params = {}
      //   params.typeTree = this.queryParams.typeTree
      //   params.parentId = this.queryParams.parentId
      //   params.equipmentId = this.queryParams.equipmentId
      //   this.loading = true;
      //   getAction(this.url.list, params).then((res) => {
      //     if (res.success) {
      //       this.dataSource = res.result.records||res.result;
      //     }else{
      //       this.$message.warning(res.message)
      //     }
      //   }).finally(() => {
      //     this.loading = false
      //   })
      // },
      // searchQuery(){
      //   if(this.queryParams.typeTree == "1"){
      //     this.queryParams.parentId =  this.queryParamEquip.parentId
      //     // this.queryParams.equipmentId =  this.queryParamEquip.equipmentId
      //
      //   }else{
      //     this.queryParams.parentId = this.queryParamPeople.parentId
      //
      //     // this.queryParams.equipmentId = ""
      //   }
      //   this.dataSource = [];
      //   //获取查询条件
      //   let  param = {}
      //   param.parentId = this.queryParams.parentId;
      //   param.equipmentId = this.queryParams.equipmentId;
      //   param.startTime = this.queryParam.startTime;
      //   param.driveType = this.queryParam.driveType;
      //   param.endTime =  this.queryParam.endTime;
      //   getAction(this.url.list,param).then((res) => {
      //     if(res.success){
      //       this.dataSource = res.result.records||res.result;
      //     }else{
      //       this.$message.warning(res.message)
      //     }
      //   }).finally(() => {
      //     this.loading = false
      //   })
      // },
      // loadData() {
      //   if(!this.url.list){
      //     this.$message.error("请设置url.list属性!")
      //     return
      //   }
      //   //加载数据 若传入参数1则加载第一页的内容
      //   var params = {}
      //   this.loading = true;
      //   params.startTime = this.queryParam.startTime;
      //   params.endTime =  this.queryParam.endTime;
      //   params.typeTree = this.queryParams.typeTree
      //   getAction(this.url.list, params).then((res) => {
      //     if (res.success) {
      //       this.dataSource = res.result.records||res.result;
      //     }else{
      //       this.$message.warning(res.message)
      //     }
      //   }).finally(() => {
      //     this.loading = false
      //   })
      // },
    },
    created() {
      this.dates = [moment().subtract('days', 7), moment().subtract('days', 0)]
      this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
      this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
      this.queryParam.typeTree = "1";
      this.initEquipmentNode()
      this.loadAnalysis();
      this.getDriveTypeByApi()
    }
  }
</script>