Commit 6d541859 authored by qjeslks's avatar qjeslks

报警间隔改成一分钟

parent 7be83717
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-select placement="bottom" v-model="searchValue" clearable filterable remote reserve-keyword <el-select placement="bottom" v-model="searchValue" clearable filterable remote reserve-keyword
:placeholder="'请输入关键字搜索...'" :remote-method="remoteMethod" @change="selectChange" :loading="loading"> :placeholder="'请输入关键字搜索...'" :remote-method="remoteMethod" @change="selectChange" :loading="loading">
<template #prefix><i class="el-icon-search"></i></template> <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> </el-select>
</div> </div>
...@@ -79,11 +79,11 @@ ...@@ -79,11 +79,11 @@
Menu as IconMenu Menu as IconMenu
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
// const searchValue = ref(''); const searchValue = ref('');
// const proxy = getCurrentInstance(); // const proxy = getCurrentInstance();
// const props = defineProps(['meun', 'thisIndex']); // const props = defineProps(['meun', 'thisIndex']);
// const emit = defineEmits(['subEvent']); // const emit = defineEmits(['subEvent']);
// const options = ref([]); const options = ref([]);
// const loading = ref(false); // const loading = ref(false);
const store = useStore() const store = useStore()
...@@ -95,6 +95,23 @@ ...@@ -95,6 +95,23 @@
return store.state.menus 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(()=>{ onMounted(()=>{
const isdefaultActive = window.sessionStorage.getItem('activePath') const isdefaultActive = window.sessionStorage.getItem('activePath')
if(isdefaultActive){ if(isdefaultActive){
......
...@@ -605,7 +605,7 @@ export default defineComponent({ ...@@ -605,7 +605,7 @@ export default defineComponent({
function alarm(){ function alarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => { 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) console.log(result)
sta.value = 1; sta.value = 1;
title.value = result.data[0].title; title.value = result.data[0].title;
...@@ -616,7 +616,7 @@ export default defineComponent({ ...@@ -616,7 +616,7 @@ export default defineComponent({
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
message: msg.value.replace('\n','<br />'), message: msg.value.replace('\n','<br />'),
position: 'bottom-right', position: 'bottom-right',
type: 'error', type: 'warning',
duration: 0, duration: 0,
onClick() { onClick() {
activeTable.value = '/Video' activeTable.value = '/Video'
...@@ -638,7 +638,7 @@ export default defineComponent({ ...@@ -638,7 +638,7 @@ export default defineComponent({
} }
function countalarm(){ function countalarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => { 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) console.log(result)
consta.value = 1; consta.value = 1;
counttitle.value = result.data[1].title; counttitle.value = result.data[1].title;
...@@ -649,7 +649,7 @@ export default defineComponent({ ...@@ -649,7 +649,7 @@ export default defineComponent({
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
message: countmsg.value.replace('\n','<br />'), message: countmsg.value.replace('\n','<br />'),
position: 'bottom-right', position: 'bottom-right',
type: 'error', type: 'warning',
duration: 0, duration: 0,
onClick() { onClick() {
activeTable.value = '/Video' activeTable.value = '/Video'
...@@ -674,7 +674,7 @@ export default defineComponent({ ...@@ -674,7 +674,7 @@ export default defineComponent({
getinfo(); getinfo();
alarm(); alarm();
countalarm(); countalarm();
}, 10 * 1000); // 每分钟执行一次 }, 60 * 1000); // 每分钟执行一次
return { 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