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
50
51
52
53
54
| <!-- 扬尘 异常文本按钮 点击查该店铺某时段的异常数据
|
| **父组件
| 将该站点某时段的异常数据返回给父组件,父组件再返回给祖先组件
| -->
| <script>
| export default {
| props: {
| siteName:String,
| exceptionType:String,
| beginTime:String,
| endTime:String,
| },
| emits: ['submitExceptionData'],
| data() {
| return {
| //某个异常类型的全部数据
| // exceptionData:[]
| };
| },
|
| methods: {
| requestExceptionData() {
| // 不分页
| this.$http
| .get('/dust/exceptiondata1', {
| params: {
| siteName: this.siteName,
| exceptionType: this.exceptionType,
| beginTime: this.beginTime,
| endTime: this.endTime
| }
| })
| .then((result) => {
| //将返回的结果传递给父组件
| this.$emit(
| 'submitExceptionData',
| result.data.data
| );
| });
| }
| }
| };
| </script>
|
| <template>
| <el-link @click="requestExceptionData" class="text"><slot /></el-link>
| </template>
|
| <style lang="scss" scoped>
| .text {
| color: #000000;
| }
| </style>
|
|