施工管控添加定时刷新数据
This commit is contained in:
parent
434743dc43
commit
4e5127aa75
|
|
@ -184,10 +184,8 @@ export default {
|
||||||
pageNum: 0,
|
pageNum: 0,
|
||||||
pageSize: 10
|
pageSize: 10
|
||||||
},
|
},
|
||||||
// 预警信息定时刷新
|
// 定时刷新
|
||||||
intervalId: null,
|
intervalId: null,
|
||||||
// 选中的吊装设备
|
|
||||||
checkDevCode: null
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -207,7 +205,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
startRefresh() {
|
startRefresh() {
|
||||||
// 每10分钟刷新一次
|
// 每10分钟刷新一次
|
||||||
this.intervalId = setInterval(this.refreshData, 1000 * 60 * 10);
|
this.intervalId = setInterval(this.refreshData, 1000 * 60 * 5);
|
||||||
},
|
},
|
||||||
stopRefresh() {
|
stopRefresh() {
|
||||||
if (this.intervalId) {
|
if (this.intervalId) {
|
||||||
|
|
|
||||||
|
|
@ -314,10 +314,10 @@ export default {
|
||||||
this.getPersonsTree();
|
this.getPersonsTree();
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
alert('页面初始化完成');
|
// alert('页面初始化完成');
|
||||||
},
|
},
|
||||||
destroyed(){
|
destroyed(){
|
||||||
alert('页面销毁了');
|
// alert('页面销毁了');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 当前日期
|
// 当前日期
|
||||||
|
|
@ -440,14 +440,19 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 自动验证配置详情
|
// 自动验证配置详情
|
||||||
getCheckConfigDetail() {
|
async getCheckConfigDetail() {
|
||||||
getCheckConfig().then((res) => {
|
let loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: "数据加载中,请稍候...",
|
||||||
|
background: 'rgba(0,0,0,0.2)'
|
||||||
|
})
|
||||||
|
await getCheckConfig().then((res) => {
|
||||||
if (res.data && res.data.length > 0) {
|
if (res.data && res.data.length > 0) {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
const configType = data[0].configType + '';
|
const configType = data[0].configType + '';
|
||||||
if (configType === '1') {
|
if (configType === '1') {
|
||||||
data.forEach((item, index) => {
|
data.forEach((item, index) => {
|
||||||
this.form.times.push({ value: item.time, key: Date.now() })
|
this.form.times.push({ value: item.time, key: Date.now() + index })
|
||||||
})
|
})
|
||||||
} else if (configType === '2') {
|
} else if (configType === '2') {
|
||||||
this.form.timeNum = parseInt(res.data[0].time);
|
this.form.timeNum = parseInt(res.data[0].time);
|
||||||
|
|
@ -456,9 +461,11 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.form.configType = '1';
|
this.form.configType = '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch((res) => {
|
}).catch((res) => {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
loading.close();
|
||||||
this.dialogVisible2 = true;
|
this.dialogVisible2 = true;
|
||||||
},
|
},
|
||||||
// 模式选择为固定时间-添加多个时间
|
// 模式选择为固定时间-添加多个时间
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- 违章识别 -->
|
<!-- 违章识别 -->
|
||||||
<div class="vio-box">
|
<div class="vio-box">
|
||||||
<el-carousel height="200px" indicator-position="outside" :interval="100000" @change="loadVioInfos"
|
<el-carousel height="200px" indicator-position="outside" :interval="15000" @change="loadVioInfos"
|
||||||
v-if="vioArr.length > 0">
|
v-if="vioArr.length > 0">
|
||||||
<el-carousel-item v-for="(itemArr, arrIndex) in vioArr" :key="arrIndex">
|
<el-carousel-item v-for="(itemArr, arrIndex) in vioArr" :key="arrIndex">
|
||||||
<div class="vio-box-info layout">
|
<div class="vio-box-info layout">
|
||||||
|
|
@ -164,7 +164,11 @@ export default {
|
||||||
// 窗口数量
|
// 窗口数量
|
||||||
boxNum: 1,//1窗口或4窗口
|
boxNum: 1,//1窗口或4窗口
|
||||||
boxIndex:1,//视频下标
|
boxIndex:1,//视频下标
|
||||||
classStyle: 'ball-content'
|
classStyle: 'ball-content',
|
||||||
|
// 定时刷新
|
||||||
|
intervalId: null,
|
||||||
|
// 选中树节点ID
|
||||||
|
checkNodeId:null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -175,11 +179,45 @@ export default {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.busy = false;
|
this.busy = false;
|
||||||
});
|
});
|
||||||
|
this.startRefresh();
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
this.stopRefresh();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
startRefresh() {
|
||||||
|
// 每10分钟刷新一次
|
||||||
|
this.intervalId = setInterval(this.refreshData, 1000 * 60 * 10);
|
||||||
|
},
|
||||||
|
stopRefresh() {
|
||||||
|
if (this.intervalId) {
|
||||||
|
clearInterval(this.intervalId);
|
||||||
|
this.intervalId = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async refreshData() {
|
||||||
|
// 定时刷新球机树数据
|
||||||
|
this.treeData.splice(0);
|
||||||
|
this.idArr.splice(0);
|
||||||
|
await this.laodBallDeviceLists();
|
||||||
|
if(this.filterText){
|
||||||
|
this.$refs.tree.filter();
|
||||||
|
}
|
||||||
|
if(this.checkNodeId){
|
||||||
|
this.$refs.tree.setCurrentKey(this.checkNodeId);
|
||||||
|
}
|
||||||
|
// 定时刷新预警信息
|
||||||
|
this.warnInfoArr.splice(0);
|
||||||
|
this.queryParams.pageNum = 0;
|
||||||
|
this.isHasData = true;
|
||||||
|
this.loadWarnInfoData();
|
||||||
|
// 刷新球机违章识别
|
||||||
|
this.vioArr.splice(0);
|
||||||
|
this.loadBallWarnLists();
|
||||||
|
},
|
||||||
/* 加载球机树 */
|
/* 加载球机树 */
|
||||||
laodBallDeviceLists() {
|
async laodBallDeviceLists() {
|
||||||
getBallDeviceLists().then(res => {
|
await getBallDeviceLists().then(res => {
|
||||||
const treeData = res.data;
|
const treeData = res.data;
|
||||||
if (treeData && treeData.length > 0) {
|
if (treeData && treeData.length > 0) {
|
||||||
this.treeData = treeData
|
this.treeData = treeData
|
||||||
|
|
@ -293,7 +331,7 @@ export default {
|
||||||
},
|
},
|
||||||
//球机树节点点击
|
//球机树节点点击
|
||||||
handleNodeClick(data, node, item) {// 点击球机时触发的事件
|
handleNodeClick(data, node, item) {// 点击球机时触发的事件
|
||||||
console.log(node)
|
this.checkNodeId = data.id;
|
||||||
if (node.level === 2) {
|
if (node.level === 2) {
|
||||||
if(this.boxNum==1){
|
if(this.boxNum==1){
|
||||||
this.$refs[`monitor`+1].closeVideo()
|
this.$refs[`monitor`+1].closeVideo()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue