zenglf
2023-09-28 997835429a1d66643364091e8437ebbbeb8ff97a
src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue
@@ -12,9 +12,15 @@
          <!--</a-col>-->
          <a-col :md="5" :sm="5">
            <a-form-item label="驱动类型">
              <j-dict-select-tag placeholder="请选择驱动类型"
                                 :triggerChange="true" dictCode="mdc_driveType"
                                 v-model="queryParam.driveType" allow-clear/>
              <!--<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="9" :sm="9" :xs="4">
@@ -68,6 +74,7 @@
  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],
@@ -102,7 +109,8 @@
        url: {
          comparativeAnalysis:'/mdc/efficiencyReport/comparativeAnalysis'
        },
        AnalysisList:{}
        AnalysisList:{},
        driveTypeList:[]
      }
    },
    watch:{
@@ -128,7 +136,6 @@
        }
      },
      nodePeople(val){
        if (JSON.stringify(val) != '{}') {
          if (val.equipmentId) {
            // this.$set(this.queryParam, 'tierName', val.title)
@@ -169,40 +176,46 @@
        })
      },
      searchQuery(){
        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)
        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.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description: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.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 = []
@@ -278,7 +291,25 @@
            this.loading = false
          })
        }
      },
      /**
       * 调用接口获取控制系统类型
       */
      getDriveTypeByApi(){
        api.getDriveTypeApi().then((res)=>{
          this.driveTypeList=res.result.map(item=>item.value)
        })
      },
      /**
       * 联想输入框筛选功能
       * @param input 输入的内容
       * @param option 配置
       * @returns {boolean} 判断是否筛选
       */
      filterOption(input, option) {
        return (
          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
        );
      },
      // onChange(value, dateString) {
      //   // console.log('Selected Time: ', value);
@@ -398,6 +429,7 @@
      this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
      this.queryParam.typeTree = "1";
      this.loadAnalysis();
      this.getDriveTypeByApi()
    }
  }
</script>