zmc
2023-08-14 172d73cbe737c04b3d2c3fe8908db2460c241543
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!-- 异常分析折叠框中的按钮组件 
  根据父组件传递的设备编号和异常类型,异常开始时间和结束时间
  返回对应的异常信息 -->
<script >
import axiosInstance from '../utils/request.js'
 
  export default {
    props:{
        devId:String,
        exceptionValue:String,
        beginTime:String,
        endTime:String,
    },
    emits:['submitExceptionData'],
    data() {
      return{
        //某个异常类型的全部数据
        exceptionData:[]
      }
    },
    methods: {
        
        requestExceptionData(){
            axiosInstance.get('/fume/abnormaltwo',{params:{"devId":this.devId,"exceptionValue":this.exceptionValue,"beginTime":this.beginTime,"endTime":this.endTime }}).then(result =>{
                //将返回的结果传递给父组件
                this.$emit('submitExceptionData',result.data.data)
            })
        }
 
     }
}
</script>
 
<template>
  <el-button class="button_info" type='' text  @click="requestExceptionData">
    <slot/>
  </el-button>
</template>
 
 
<style scoped>
.button_info {
  width: 100%;
  text-align: left;
}
</style>