| | |
| | | :clearable="false"
|
| | | :editable="false"
|
| | | type="datetime"
|
| | | :picker-options="pickerOptions"
|
| | | placeholder="选择日期时间"
|
| | | @change="changeData"
|
| | | />
|
| | |
| | | timerKey: '', // 用于重新渲染子组件
|
| | | map: null,
|
| | | code: [],
|
| | | pickerOptions: {
|
| | | disabledDate: (time) => {
|
| | | return time.getTime() > Date.now() - 1 * 24 * 3600 * 1000
|
| | | },
|
| | | },
|
| | | latlng: [],
|
| | | noneData: false,
|
| | | params: ['PM10', 'PM2.5', 'SO2', 'NO2', 'CO', 'O3', 'TVOC'],
|
| | |
| | | clickmac: '',
|
| | | childerItem: {},
|
| | | farterItem: {},
|
| | | indexsLaber: 0
|
| | | indexsLaber: 0,
|
| | | time: new Date()
|
| | | }
|
| | | },
|
| | | computed: {
|
| | |
| | | methods: {
|
| | | // 拿到某天的日期和星期
|
| | | getDayXQ (day) {
|
| | | var days = new Date().getDay() // 星期
|
| | | var days = new Date().getDay() // 星期 // 星期
|
| | | var rq = '' // 日期
|
| | | if (day === 'today') {
|
| | | rq = this.newData(0)
|
| | | rq = this.newData(0) // 今天日期
|
| | | } else if (day === 'yesterday') {
|
| | | days = (days + 7 - 1) % 7
|
| | | rq = this.newData(-1) // 昨天日期
|
| | |
| | | inText2.innerHTML = times + ':00'
|
| | | this.chooseTimeInfo = true // 选择时间点
|
| | | this.chooseTime = true // 选择时间点
|
| | | console.log('times', times)
|
| | | if ((i + 1) / 24 < 1) {
|
| | | this.nyr = this.newData(-2, 'nyr') + ' ' + times + ':00'
|
| | | } else if ((i + 1) / 24 < 2 && (i + 1) / 24 >= 1) {
|
| | |
| | | inText2.innerHTML = times + ':00'
|
| | | this.chooseTimeInfo = true // 选择时间点
|
| | | this.chooseTime = true // 选择时间点
|
| | | console.log('times', times)
|
| | | if (i / 24 < 1) {
|
| | | this.nyr = this.newData(-2, 'nyr') + ' ' + times + ':00'
|
| | | } else if (i / 24 < 2 && i / 24 >= 1) {
|
| | |
| | | window.map = map
|
| | | },
|
| | | changeData (val) {
|
| | | console.log(val)
|
| | | this.nyr = val + ':00'
|
| | | const date = new Date(this.nyr.replace(/(\d{4}-\d{2}-\d{2}) (\d{2})(?!\d)/, '$1 $2:00'))
|
| | |
|
| | | console.log(date)
|
| | | this.chooseTime = true
|
| | | // var p1 = document.querySelector('.p1')
|
| | | // var p2 = document.querySelector('.p2')
|
| | | // var p3 = document.querySelector('.p3')
|
| | | // this.time = date
|
| | | // p3.innerHTML = this.getDayXQ('today')
|
| | | // p2.innerHTML = this.getDayXQ('yesterday')
|
| | | // p1.innerHTML = this.getDayXQ('beforeYea')
|
| | | this.initData()
|
| | | },
|
| | | // 更改不同的值区间
|