zmc
2023-12-01 5244fdb5f7932f2cbce43f4bfaa9dc06c9dd4c95
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
55
56
57
58
59
60
61
62
63
64
<script>
import MonthSelect from '@/sfc/MonthSelect.vue'
import exceptionApi from '@/api/exceptionApi.js'
import dayjs from 'dayjs'
export default {
  components: {
    MonthSelect
  },
  data() {
    return {
      month: ''
    }
  },
  mounted() {
    this.get()
  },
  methods: {
    giveTime(val) {
      //将中国标准时间转为指定格式(该组件返回的标准时间的格式,所以必须的加这个函数)
      this.month = dayjs(val).format('YYYY-MM-DD HH:mm:ss')
    },
    async getExceptionData() {
      await exceptionApi
        .exceptiondata1({
          siteName: '',
          beginTime: '2023-07-01 00:00:00',
          endTime: '2023-07-05 00:00:00'
        }).then(res=>{
          console.log(res);
       exceptionApi
        .exceptiondata1({
          siteName: '',
          beginTime: '2023-07-01 00:00:00',
          endTime: '2023-07-05 00:00:00'
        })
        // .then((res) => {
        //   const data = res.data.data
        //   console.log('data', data)
          
        // })
        return a
        })
     
        
    },
    get() {
      this.getExceptionData().then( b=>{
        console.log('b',b.data.data);
      })
     
    }
  }
}
</script>
 
<template>
  <div>
    业务报表
    <MonthSelect @submit-value="giveTime"></MonthSelect>
    {{ month }}
  </div>
</template>
 
<style scoped></style>