| | |
| | | <input type="checkbox" v-model="switch_status" class="control" /> |
| | | </label> |
| | | </div> |
| | | <div class="">轮播间隙:<el-input class="timeInput" placeholder="请输入时间间隔" v-model.number="battList.delayTime" @input="timeChange"></el-input></div> |
| | | <div class="">轮播间隙(秒):<el-input class="timeInput" placeholder="请输入时间间隔" v-model.number="battList.delayTime" @input="timeChange"></el-input>{{countDown}}秒</div> |
| | | <div class="btn_3d" @click="prev">上一个</div> |
| | | <div class="btn_3d" @click="next">下一个</div> |
| | | </div> |
| | |
| | | timer: new Timeout(), |
| | | delayTime: 4 |
| | | }, |
| | | // 倒计时 |
| | | countDown: 0, |
| | | countDownTimer: new Timeout(), |
| | | rtstate: { |
| | | timer: new Timeout(), |
| | | data: { |
| | |
| | | this.startFindrtstate(); |
| | | // 开始查询电池组实时信息 |
| | | this.startFindrtdata(); |
| | | if (this.switch_status) { |
| | | this.countDownStart(); |
| | | } |
| | | }, |
| | | startFindrtstate() { |
| | | this.rtstate.timer.start(()=>{ |
| | |
| | | }, 4000); |
| | | }, |
| | | startLB () { |
| | | if (!this.battList.delayTime || this.battList.delayTime < 0.6) { |
| | | this.battList.delayTime = 0.6; |
| | | if (!this.battList.delayTime || this.battList.delayTime < 1) { |
| | | this.battList.delayTime = 1; |
| | | } |
| | | |
| | | this.countDownStart(); |
| | | this.battList.timer.start(() => { |
| | | let data = this.$store.state.allBattList; |
| | | let len = data.length; |
| | | this.$store.dispatch('changeBattGroup', data[idx]); |
| | | idx++; |
| | | idx = idx % len; |
| | | this.$store.dispatch('changeBattGroup', data[idx]); |
| | | this.battList.timer.open(); |
| | | }, this.battList.delayTime * 1000); |
| | | }, |
| | |
| | | }, |
| | | stopLB () { |
| | | this.battList.timer.stop(); |
| | | this.countDownStop(); |
| | | }, |
| | | // 上一个站 |
| | | prev () { |
| | | this.switch_status = false; |
| | | this.countDownStop(); |
| | | let data = this.$store.state.allBattList; |
| | | let len = data.length; |
| | | idx--; |
| | |
| | | // 下一个站 |
| | | next () { |
| | | this.switch_status = false; |
| | | this.countDownStop(); |
| | | let data = this.$store.state.allBattList; |
| | | let len = data.length; |
| | | idx++; |
| | | idx = idx % len; |
| | | this.$store.dispatch('changeBattGroup', data[idx]); |
| | | }, |
| | | countDownStop () { |
| | | this.countDownTimer.stop(); |
| | | }, |
| | | countDownStart () { |
| | | this.countDownTimer.stop(); |
| | | this.countDown = this.battList.delayTime; |
| | | this.countDownTimer.startDelay(() => { |
| | | this.countDown--; |
| | | this.countDownTimer.open(); |
| | | }, 1000); |
| | | }, |
| | | initRtState() { // 初始化rtstate |
| | | var data = { |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.countDown = this.battList.delayTime; |
| | | this.getAllBattGrp(); |
| | | // 设置导航栏 |
| | | this.$store.dispatch('changeNavActive', 0); |
| | |
| | | } |
| | | .timeInput { |
| | | background: transparent; |
| | | width: 10rem; |
| | | |
| | | width: 6rem; |
| | | margin-left: 1rem; |
| | | margin-right: 1rem; |
| | | } |
| | | .btn_3d { |
| | | margin-left: 1rem; |