From 06cf1c7f78a33a22d075d116a3cf40e6b6915b6c Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期日, 29 九月 2024 23:28:42 +0800 Subject: [PATCH] 大屏定时器 --- src/views/screen/index.vue | 101 +++++++++++++++++++++++++++----------------------- 1 files changed, 55 insertions(+), 46 deletions(-) diff --git a/src/views/screen/index.vue b/src/views/screen/index.vue index 5080d2e..2156d89 100644 --- a/src/views/screen/index.vue +++ b/src/views/screen/index.vue @@ -213,6 +213,7 @@ return { deptList: [], deptId: '', + intervalId: null, // 鐢ㄤ簬瀛樺偍瀹氭椂鍣ㄧ殑ID carList: [], videoList: [], faceList: [], @@ -220,49 +221,49 @@ workOrderRegion: [], platformData: null, scoreData: { - 鑷祦浜曞尯: [ - { - value: 0, - name: '寰楀垎' - } - ], - 楂樻柊鍖�: [ - { - value: 0, - name: '寰楀垎' - } - ], - 澶у畨鍖�: [ - { - value: 0, - name: '寰楀垎' - } - ], - 娌挎哗鍖�: [ - { - value: 0, - name: '寰楀垎' - } - ], - 璐′簳鍖�: [ - { - value: 0, - name: '寰楀垎' - } - ], - 鑽e幙: [ - { - value: 0, - name: '寰楀垎' - } - ], - 瀵岄『鍘�: [ - { - value: 0, - name: '寰楀垎' - } - ] - }, + 鑷祦浜曞尯: [ + { + value: 0, + name: '寰楀垎' + } + ], + 楂樻柊鍖�: [ + { + value: 0, + name: '寰楀垎' + } + ], + 澶у畨鍖�: [ + { + value: 0, + name: '寰楀垎' + } + ], + 娌挎哗鍖�: [ + { + value: 0, + name: '寰楀垎' + } + ], + 璐′簳鍖�: [ + { + value: 0, + name: '寰楀垎' + } + ], + 鑽e幙: [ + { + value: 0, + name: '寰楀垎' + } + ], + 瀵岄『鍘�: [ + { + value: 0, + name: '寰楀垎' + } + ] + }, // 璁惧鏁版嵁 facilityData: { video: [], @@ -309,7 +310,14 @@ .catch((err) => { }); // 鏌ヨ鏁版嵁 - this.getData(); + this.intervalId = setInterval(this.getData, 3600000); //涓�灏忔椂涓�娆� + }, + beforeDestroy() { + // 缁勪欢閿�姣佸墠娓呴櫎瀹氭椂鍣紝闃叉鍐呭瓨娉勬紡 + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = null; + } }, methods: { getDeptId(deptName) { @@ -366,7 +374,7 @@ }); checkScore(this.activerBtnType, this.deptId) .then((res) => { - if(res.data && Object.keys(res.data).length > 0){ + if (res.data && Object.keys(res.data).length > 0) { this.scoreData = res.data; } }) @@ -374,7 +382,7 @@ }); getPlatform(this.activerBtnType, this.deptId) .then((res) => { - if(res.data && Object.keys(res.data).length > 0){ + if (res.data && Object.keys(res.data).length > 0) { this.platformData = res.data; } }) @@ -1118,6 +1126,7 @@ list-style-type: none; border-bottom: 1px dashed #223654; margin: 7px 0; + li { width: 25%; text-align: center; -- Gitblit v1.8.0