pull/43/head
pangdundun 2023-11-18 22:07:59 +08:00
parent cc2378663b
commit 0d2b98af85
2 changed files with 34 additions and 14 deletions

View File

@ -770,13 +770,6 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer_) && this.timer_; clearInterval(this.timer_) && this.timer_;
if (this.player) {
// this.player.dispose();
this.player.stop();
this.player.destroy();
this.player = null;
}
}, },
methods: { methods: {
// id // id
@ -892,7 +885,7 @@ export default {
// Copy // Copy
getVideoData(cameraid, channelid, index) { getVideoData(cameraid, channelid, index) {
this.api.camera_gethls(cameraid, channelid).then((res) => { this.api.camera_gethls(cameraid, channelid).then((res) => {
console.log("获取摄像头得地址 Copy", res); // console.log(" Copy", res);
if (res.data.code == 200) { if (res.data.code == 200) {
// this.url = res.data.data.ezopen // this.url = res.data.data.ezopen
this.createVideoNew( this.createVideoNew(
@ -1039,7 +1032,7 @@ export default {
} else { } else {
this.timer_ = setTimeout(() => { this.timer_ = setTimeout(() => {
this.$router.push({ path: "/largeScreen1" }); this.$router.push({ path: "/largeScreen1" });
}, 10000); }, 20000);
} }
}, },
@ -1053,7 +1046,7 @@ export default {
localStorage.setItem("autoPlay", JSON.stringify(this.autoPlay)); localStorage.setItem("autoPlay", JSON.stringify(this.autoPlay));
this.timer_ = setTimeout(() => { this.timer_ = setTimeout(() => {
this.$router.push({ path: "/largeScreen1" }); this.$router.push({ path: "/largeScreen1" });
}, 10000); }, 20000);
}, },
createVideoNew(accessToken, url, index) { createVideoNew(accessToken, url, index) {

View File

@ -9,11 +9,11 @@
<div class="calendar"> <div class="calendar">
<img src="../../assets/img/calendar.png" alt="" /> <img src="../../assets/img/calendar.png" alt="" />
<span>2023.10.30</span> <span>{{ getNowTime() }}</span>
<span class="line"></span> <span class="line"></span>
<span>星期一</span> <span>{{ time.week }}</span>
<span class="line"></span> <span class="line"></span>
<span>14:17</span> <span>{{ time.time }}</span>
</div> </div>
<div class="content"> <div class="content">
@ -184,6 +184,7 @@
</template> </template>
<script> <script>
import { getnowtime } from "../../assets/js/nowTime";
export default { export default {
name: "largeScreen1", name: "largeScreen1",
data() { data() {
@ -233,6 +234,8 @@ export default {
// //
autoPlay: false, //false true autoPlay: false, //false true
time: "", //
typeList: [ typeList: [
{ {
label: "无意义的传感器", label: "无意义的传感器",
@ -594,6 +597,12 @@ export default {
this.drag_boxHandler(); this.drag_boxHandler();
this.login(); this.login();
this.getTime();
setInterval(() => {
this.getNowTime();
}, 1000);
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer2) && this.timer2; clearInterval(this.timer2) && this.timer2;
@ -602,7 +611,7 @@ export default {
// id // id
dataInit(userid) { dataInit(userid) {
this.api.Bigdata_getAllControl(userid).then((res) => { this.api.Bigdata_getAllControl(userid).then((res) => {
console.log("根据用户id查询对应的设备大数据信息", res); // console.log("id", res);
this.popContentList = res.data.data; this.popContentList = res.data.data;
this.popContentList = this.popContentList.map((item) => { this.popContentList = this.popContentList.map((item) => {
return { return {
@ -690,6 +699,24 @@ export default {
} }
}, },
getTime() {
this.time = getnowtime();
// console.log(this.time);
const that = this;
setInterval(() => {
that.time = getnowtime();
}, 1000);
},
getNowTime() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, "0");
const day = now.getDate().toString().padStart(2, "0");
const formattedDate = `${year}.${month}.${day}`;
return formattedDate;
},
cancelHandler() { cancelHandler() {
this.popContentCurrent = -1; this.popContentCurrent = -1;
let that = this; let that = this;