Commit 6d541859 authored by qjeslks's avatar qjeslks

报警间隔改成一分钟

parent 7be83717
......@@ -5,7 +5,7 @@
<el-select placement="bottom" v-model="searchValue" clearable filterable remote reserve-keyword
:placeholder="'请输入关键字搜索...'" :remote-method="remoteMethod" @change="selectChange" :loading="loading">
<template #prefix><i class="el-icon-search"></i></template>
<el-option v-for="item in menus.childs" :key="item.menuId" :label="item.menuName" :value="item.menuName" />
<el-option v-for="item in options" :key="item.menuId" :label="item.menuName" :value="item.menuName" />
</el-select>
</div>
......@@ -79,11 +79,11 @@
Menu as IconMenu
} from '@element-plus/icons-vue'
// const searchValue = ref('');
const searchValue = ref('');
// const proxy = getCurrentInstance();
// const props = defineProps(['meun', 'thisIndex']);
// const emit = defineEmits(['subEvent']);
// const options = ref([]);
const options = ref([]);
// const loading = ref(false);
const store = useStore()
......@@ -95,6 +95,23 @@
return store.state.menus
})
setTimeout(() => {
getoptions(); // 调用你的函数
}, 1000);
function getoptions(){
var menus = store.state.menus;
console.log(menus[1].childs[0])
for(let i = 0;i < 100;i++){
if(menus[i] === undefined)break;
for(let j = 0;j < 100;j++){
if(menus[i].childs[j] === undefined)break;
options.value.push(menus[i].childs[j])
}
}
console.log(options.value)
// options.value.push()
}
onMounted(()=>{
const isdefaultActive = window.sessionStorage.getItem('activePath')
if(isdefaultActive){
......
......@@ -605,7 +605,7 @@ export default defineComponent({
function alarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if(result.data !== null && sta.value === 0){
if(result.data !== null && sta.value === 0 && result.data.lengh > 0){
console.log(result)
sta.value = 1;
title.value = result.data[0].title;
......@@ -616,7 +616,7 @@ export default defineComponent({
dangerouslyUseHTMLString: true,
message: msg.value.replace('\n','<br />'),
position: 'bottom-right',
type: 'error',
type: 'warning',
duration: 0,
onClick() {
activeTable.value = '/Video'
......@@ -638,7 +638,7 @@ export default defineComponent({
}
function countalarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if(result.data !== null && consta.value === 0){
if(result.data !== null && consta.value === 0 && result.data.lengh > 0){
console.log(result)
consta.value = 1;
counttitle.value = result.data[1].title;
......@@ -649,7 +649,7 @@ export default defineComponent({
dangerouslyUseHTMLString: true,
message: countmsg.value.replace('\n','<br />'),
position: 'bottom-right',
type: 'error',
type: 'warning',
duration: 0,
onClick() {
activeTable.value = '/Video'
......@@ -674,7 +674,7 @@ export default defineComponent({
getinfo();
alarm();
countalarm();
}, 10 * 1000); // 每分钟执行一次
}, 60 * 1000); // 每分钟执行一次
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment