|
@@ -22,7 +22,7 @@
|
|
{{ items.label }}
|
|
{{ items.label }}
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
</div> -->
|
|
- <component :is="componentName[current]" />
|
|
|
|
|
|
+ <component :is="componentName[current]" :listData="listData" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -32,11 +32,13 @@
|
|
import { onMounted, ref, defineEmits, reactive, onUnmounted, watch, markRaw, defineAsyncComponent, defineProps } from 'vue';
|
|
import { onMounted, ref, defineEmits, reactive, onUnmounted, watch, markRaw, defineAsyncComponent, defineProps } from 'vue';
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
import { typeMenuList, componentName } from './fire.data';
|
|
import { typeMenuList, componentName } from './fire.data';
|
|
|
|
+ import { sysTypeWarnList, sysWarn } from './alarm.api';
|
|
|
|
|
|
let props = defineProps({
|
|
let props = defineProps({
|
|
moduleName: String,
|
|
moduleName: String,
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ let listData = ref({}); //详情数据
|
|
let isShowModule = ref(true); //是否显示内外因火灾切换按钮
|
|
let isShowModule = ref(true); //是否显示内外因火灾切换按钮
|
|
let titleName = ref('');
|
|
let titleName = ref('');
|
|
let menuList = reactive<any[]>([]); //左侧菜单列表
|
|
let menuList = reactive<any[]>([]); //左侧菜单列表
|
|
@@ -84,43 +86,75 @@
|
|
function cardClick(ind, item) {
|
|
function cardClick(ind, item) {
|
|
console.log(ind, 'index');
|
|
console.log(ind, 'index');
|
|
activeIndex1.value = ind;
|
|
activeIndex1.value = ind;
|
|
- switch (ind) {
|
|
|
|
- case 0:
|
|
|
|
- current.value = item.type == 'on' ? 'fireWork' : 'mainWell';
|
|
|
|
- break;
|
|
|
|
- case 1:
|
|
|
|
- current.value = item.type == 'on' ? 'closeWall' : 'subStation';
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- current.value = item.type == 'on' ? 'otherMonitor' : 'otherOut';
|
|
|
|
- break;
|
|
|
|
|
|
+ if (props.moduleName == 'fire') {
|
|
|
|
+ switch (ind) {
|
|
|
|
+ case 0:
|
|
|
|
+ current.value = item.type == 'on' ? 'fireWork' : 'mainWell';
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ current.value = item.type == 'on' ? 'closeWall' : 'subStation';
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ current.value = item.type == 'on' ? 'otherMonitor' : 'otherOut';
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ } else if (props.moduleName == 'tf') {
|
|
|
|
+ getSysWarnList(item.deviceID, 'vent');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //获取预警详情弹窗左侧数据
|
|
|
|
+ function getSysTypeWarnList(data) {
|
|
|
|
+ sysTypeWarnList({ type: data }).then((res) => {
|
|
|
|
+ menuList.length = 0;
|
|
|
|
+ if (props.moduleName == 'tf') {
|
|
|
|
+ res.forEach((el) => {
|
|
|
|
+ menuList.push({
|
|
|
|
+ name: el.deviceName,
|
|
|
|
+ warn: el.netStatus ? '高风险' : '低风险',
|
|
|
|
+ type: 'on',
|
|
|
|
+ deviceID: el.deviceID,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ getSysWarnList(menuList[0].deviceID, 'vent');
|
|
|
|
+ console.log(menuList, '通风预警详情');
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //获取预警详情弹窗右侧数据
|
|
|
|
+ function getSysWarnList(id, type) {
|
|
|
|
+ sysWarn({ sysid: id, type: type }).then((res) => {
|
|
|
|
+ console.log(res, '预警详情弹窗右侧数据');
|
|
|
|
+ listData.value = res;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
watch(
|
|
watch(
|
|
() => props.moduleName,
|
|
() => props.moduleName,
|
|
(val) => {
|
|
(val) => {
|
|
if (val == 'fire') {
|
|
if (val == 'fire') {
|
|
titleName.value = '火灾监测';
|
|
titleName.value = '火灾监测';
|
|
isShowModule.value = true;
|
|
isShowModule.value = true;
|
|
- menuList = [
|
|
|
|
- { name: '综采工作面1', warn: '低风险', type: 'on' },
|
|
|
|
- { name: '密闭工作面1', warn: '低风险', type: 'on' },
|
|
|
|
- { name: '其他工作面1', warn: '低风险', type: 'on' },
|
|
|
|
- ];
|
|
|
|
|
|
+ getSysTypeWarnList('fire');
|
|
|
|
+ current.value = 'fireWork';
|
|
} else if (val == 'dust') {
|
|
} else if (val == 'dust') {
|
|
titleName.value = '粉尘监测';
|
|
titleName.value = '粉尘监测';
|
|
isShowModule.value = false;
|
|
isShowModule.value = false;
|
|
- menuList = [{ name: '粉尘', warn: '低风险', type: 'on' }];
|
|
|
|
|
|
+ getSysTypeWarnList('dust');
|
|
current.value = 'dustPage';
|
|
current.value = 'dustPage';
|
|
|
|
+ } else if (val == 'tf') {
|
|
|
|
+ titleName.value = '通风监测';
|
|
|
|
+ isShowModule.value = false;
|
|
|
|
+ current.value = 'ventilate';
|
|
|
|
+ getSysTypeWarnList('vent');
|
|
} else {
|
|
} else {
|
|
titleName.value = '瓦斯监测';
|
|
titleName.value = '瓦斯监测';
|
|
isShowModule.value = false;
|
|
isShowModule.value = false;
|
|
- menuList = [{ name: '瓦斯', warn: '低风险', type: 'on' }];
|
|
|
|
|
|
+ getSysTypeWarnList('gas');
|
|
current.value = 'gasPage';
|
|
current.value = 'gasPage';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {immediate:true}
|
|
|
|
|
|
+ { immediate: true }
|
|
);
|
|
);
|
|
|
|
|
|
onMounted(async () => {});
|
|
onMounted(async () => {});
|