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
47
48
49
| <!-- 异常分析折叠框中的按钮组件
| 根据父组件传递的设备编号和异常类型,异常开始时间和结束时间
| 返回对应的异常信息 -->
| <script >
| import axios from 'axios';
|
| export default {
| props:{
| devId:String,
| exceptionValue:String,
| beginTime:String,
| endTime:String,
| },
| emits:['submitExceptionData'],
| data() {
| return{
| //某个异常类型的全部数据
| exceptionData:[]
| }
| },
| methods: {
|
| requestExceptionData(){
| axios.get('http://localhost:8080/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>
| <!-- <button @click="requestExceptionData">
| <slot/>
| </button> -->
| <el-button class="button_info" type='' @click="requestExceptionData">
| <slot/>
| </el-button>
| </template>
|
|
| <style scoped>
| .button_info {
| width: 100%;
| text-align: left;
| }
| </style>
|
|