|
@@ -7,9 +7,9 @@
|
|
</a-button>
|
|
</a-button>
|
|
<div class="alarm-menu">
|
|
<div class="alarm-menu">
|
|
<div class="type-btn">
|
|
<div class="type-btn">
|
|
- <div :class="activeIndex == index ? 'btn1' : 'btn'"
|
|
|
|
- :style="{ width: sysOrgCode == 'sdmtjtdltmk' ? '50%' : '33.33%' }" v-for="(item, index) in typeMenuListGas"
|
|
|
|
- :key="index" @click="btnClick(index)">
|
|
|
|
|
|
+
|
|
|
|
+ <div :class="activeIndex == index ? 'btn1' : 'btn'" v-for="(item, index) in typeMenuListGas" :key="index"
|
|
|
|
+ @click="btnClick(index)">
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -41,22 +41,22 @@
|
|
'box-value4': items.val == 104 && items.name == '报警状态',
|
|
'box-value4': items.val == 104 && items.name == '报警状态',
|
|
'box-value5': (items.val == 201 || item.val == 1001) && items.name == '报警状态',
|
|
'box-value5': (items.val == 201 || item.val == 1001) && items.name == '报警状态',
|
|
}">{{
|
|
}">{{
|
|
- items.val == 0 && items.name == '报警状态'
|
|
|
|
- ? '正常'
|
|
|
|
- : items.val == 101 && items.name == '报警状态'
|
|
|
|
- ? '较低风险'
|
|
|
|
- : items.val == 102 && items.name == '报警状态'
|
|
|
|
- ? '低风险'
|
|
|
|
- : items.val == 103 && items.name == '报警状态'
|
|
|
|
- ? '中风险'
|
|
|
|
- : items.val == 104 && items.name == '报警状态'
|
|
|
|
- ? '高风险'
|
|
|
|
- : items.val == 201 && items.name == '报警状态'
|
|
|
|
- ? '报警'
|
|
|
|
- : items.val == 1001 && items.name == '报警状态'
|
|
|
|
- ? '网络断开'
|
|
|
|
- : items.val
|
|
|
|
- }}</span>
|
|
|
|
|
|
+ items.val == 0 && items.name == '报警状态'
|
|
|
|
+ ? '正常'
|
|
|
|
+ : items.val == 101 && items.name == '报警状态'
|
|
|
|
+ ? '较低风险'
|
|
|
|
+ : items.val == 102 && items.name == '报警状态'
|
|
|
|
+ ? '低风险'
|
|
|
|
+ : items.val == 103 && items.name == '报警状态'
|
|
|
|
+ ? '中风险'
|
|
|
|
+ : items.val == 104 && items.name == '报警状态'
|
|
|
|
+ ? '高风险'
|
|
|
|
+ : items.val == 201 && items.name == '报警状态'
|
|
|
|
+ ? '报警'
|
|
|
|
+ : items.val == 1001 && items.name == '报警状态'
|
|
|
|
+ ? '网络断开'
|
|
|
|
+ : items.val
|
|
|
|
+ }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -73,25 +73,29 @@
|
|
<div style="width: 100%; height: 100%" v-else-if="isShow == 'wscs'">
|
|
<div style="width: 100%; height: 100%" v-else-if="isShow == 'wscs'">
|
|
<gasParamter />
|
|
<gasParamter />
|
|
</div>
|
|
</div>
|
|
|
|
+ <div style="width: 100%; height: 100%" v-else-if="isShow == 'gzzd'">
|
|
|
|
+ <faultDiagnose :timeData="gzTime" :topData="topData" @getSearchHis="getlistdaysData1"></faultDiagnose>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { ref, reactive, onMounted, onUnmounted } from 'vue';
|
|
import { ref, reactive, onMounted, onUnmounted } from 'vue';
|
|
-import { sysTypeWarnList, sysWarn } from '../common.api';
|
|
|
|
|
|
+import { sysTypeWarnList, sysWarn,getDevice,listdays,bjlist } from '../common.api';
|
|
import { useSystemSelect } from '/@/hooks/vent/useSystemSelect';
|
|
import { useSystemSelect } from '/@/hooks/vent/useSystemSelect';
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
import CustomHeader from '/@/components/vent/customHeader.vue';
|
|
import CustomHeader from '/@/components/vent/customHeader.vue';
|
|
import warnTargetGas from '../common/warnTargetGas.vue';
|
|
import warnTargetGas from '../common/warnTargetGas.vue';
|
|
import gasParamter from '../common/gasParamter.vue';
|
|
import gasParamter from '../common/gasParamter.vue';
|
|
|
|
+import faultDiagnose from '../common/faultDiagnose.vue'
|
|
import { getMonitorComponent } from '../common.data';
|
|
import { getMonitorComponent } from '../common.data';
|
|
import { usePermission } from '/@/hooks/web/usePermission';
|
|
import { usePermission } from '/@/hooks/web/usePermission';
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
import MeasurePoint from '../common/measurePoint.vue';
|
|
import MeasurePoint from '../common/measurePoint.vue';
|
|
|
|
+import dayjs from 'dayjs';
|
|
|
|
|
|
let typeMenuListGas = getMonitorComponent();
|
|
let typeMenuListGas = getMonitorComponent();
|
|
-const { sysOrgCode } = useGlobSetting();
|
|
|
|
const { hasPermission } = usePermission();
|
|
const { hasPermission } = usePermission();
|
|
const { options, optionValue, getSelectRow, getSysDataSource } = useSystemSelect('sys_surface_caimei'); // 参数为场景类型(设备类型管理中可以查询到)
|
|
const { options, optionValue, getSelectRow, getSysDataSource } = useSystemSelect('sys_surface_caimei'); // 参数为场景类型(设备类型管理中可以查询到)
|
|
//当前左侧激活菜单的索引
|
|
//当前左侧激活菜单的索引
|
|
@@ -107,13 +111,28 @@ let router = useRouter();
|
|
//监测/指标激活索引
|
|
//监测/指标激活索引
|
|
let activeIndex = ref(0);
|
|
let activeIndex = ref(0);
|
|
let isShow = ref('yjjc');
|
|
let isShow = ref('yjjc');
|
|
-
|
|
|
|
|
|
+let historySearch = reactive({
|
|
|
|
+ ttime_begin: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
+ ttime_end: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
+})
|
|
|
|
+//故障诊断开始时间
|
|
|
|
+let gzTime=ref('')
|
|
|
|
+//故障诊断顶部区域数据
|
|
|
|
+let topData=ref<any[]>([])
|
|
// https获取监测数据
|
|
// https获取监测数据
|
|
let timer: null | NodeJS.Timeout = null;
|
|
let timer: null | NodeJS.Timeout = null;
|
|
function getMonitor(flag?) {
|
|
function getMonitor(flag?) {
|
|
timer = setTimeout(
|
|
timer = setTimeout(
|
|
async () => {
|
|
async () => {
|
|
- await getMenuList()
|
|
|
|
|
|
+ const { sysOrgCode } = useGlobSetting();
|
|
|
|
+ if (sysOrgCode == 'sdmtjtbetmk') {
|
|
|
|
+ await getMenuList()
|
|
|
|
+ } else if(sysOrgCode != 'sdmtjtbetmk' && activeIndex.value==1) {
|
|
|
|
+ await getBjlist()
|
|
|
|
+ }else {
|
|
|
|
+ await getMenuList()
|
|
|
|
+ }
|
|
|
|
+
|
|
if (timer) {
|
|
if (timer) {
|
|
timer = null;
|
|
timer = null;
|
|
}
|
|
}
|
|
@@ -203,6 +222,93 @@ async function getMenuList() {
|
|
getDetailList(menuList[activeIndex1.value].detail);
|
|
getDetailList(menuList[activeIndex1.value].detail);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+//寸草塔二矿左侧菜单
|
|
|
|
+async function getBjlist(){
|
|
|
|
+ let res=await bjlist({devicetype: 'gasmonitor*',pageNo:1,pageSize:100,isok:'0',})
|
|
|
|
+ console.log(res,'寸草塔二矿左侧菜单')
|
|
|
|
+ if (res && res.records.length!=0) {
|
|
|
|
+ menuList.length = 0;
|
|
|
|
+ res.records.forEach((el) => {
|
|
|
|
+ menuList.push({
|
|
|
|
+ name: el.devicename,
|
|
|
|
+ warn: '故障',
|
|
|
|
+ deviceID: el.deviceid,
|
|
|
|
+ time:el.starttime
|
|
|
|
+ // strtype: el.strtype,
|
|
|
|
+ // detail: el.detail
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ gzTime.value=menuList[activeIndex1.value].time
|
|
|
|
+ //获取实时数据-报警历史
|
|
|
|
+ getDeviceList(menuList[activeIndex1.value].deviceID)
|
|
|
|
+ //获取历史数据
|
|
|
|
+ getlistdaysData(menuList[activeIndex1.value].deviceID,historySearch)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//获取实时数据-寸草塔二矿-报警历史
|
|
|
|
+async function getDeviceList(param){
|
|
|
|
+ let res=await getDevice({ids:param,devicetype: "gasmonitor"})
|
|
|
|
+ if(res && res.msgTxt.length!=0){
|
|
|
|
+ let data=res.msgTxt[0].datalist[0]
|
|
|
|
+ topData.value=[
|
|
|
|
+ {
|
|
|
|
+ id: 0,
|
|
|
|
+ label: '瓦斯浓度(%)',
|
|
|
|
+ imgSrc: true,
|
|
|
|
+ icon:'link',
|
|
|
|
+ value: data.readData.gasC || '--',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 1,
|
|
|
|
+ label: '二氧化碳浓度(%)',
|
|
|
|
+ imgSrc: true,
|
|
|
|
+ icon:'co2val',
|
|
|
|
+ value: data.readData.co2val || '--',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 2,
|
|
|
|
+ label: '瓦斯抽采混量',
|
|
|
|
+ imgSrc: true,
|
|
|
|
+ icon:'link',
|
|
|
|
+ value: data.readData.gasMixMass || '--',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 3,
|
|
|
|
+ label: '报警状态',
|
|
|
|
+ imgSrc: true,
|
|
|
|
+ icon:'alarm-warning',
|
|
|
|
+ value: data.warnLevel=='101' ? '低风险' : data.warnLevel=='102' ? '一般风险' : data.warnLevel=='103' ? '较大风险' : data.warnLevel=='104' ? '重大风险' : data.warnLevel=='201' ? '报警' : data.warnLevel=='10000' ? '数据超限' : data.warnLevel=='1001'? '网络中断' : '正常',
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 4,
|
|
|
|
+ label: '通信状态',
|
|
|
|
+ imgSrc: true,
|
|
|
|
+ icon:'link',
|
|
|
|
+ value: data.netStatus=='0' ? '断开' : '连接',
|
|
|
|
+ },
|
|
|
|
+]
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ console.log(res,'寸草塔二矿实时数据-报警历史')
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+//获取历史数据-寸草塔二矿
|
|
|
|
+async function getlistdaysData(Ids,param){
|
|
|
|
+ let res=await listdays({strtype: 'gasmonitor_normal',gdeviceid:Ids,...param})
|
|
|
|
+ console.log(res,'获取历史数据-寸草塔二矿')
|
|
|
|
+}
|
|
|
|
+async function getlistdaysData1(param){
|
|
|
|
+ console.log(param,'param---')
|
|
|
|
+ historySearch.ttime_begin=param.ttime_begin
|
|
|
|
+ historySearch.ttime_end=param.ttime_end
|
|
|
|
+ let res=await listdays({strtype: 'gasmonitor_normal',gdeviceid:menuList[activeIndex1.value].deviceID,...historySearch})
|
|
|
|
+ console.log(res,'获取历史数据-寸草塔二矿')
|
|
|
|
+}
|
|
|
|
|
|
//监测/预警指标选项切换
|
|
//监测/预警指标选项切换
|
|
function btnClick(ind) {
|
|
function btnClick(ind) {
|
|
@@ -213,12 +319,19 @@ function btnClick(ind) {
|
|
activeIndex1.value = 0;
|
|
activeIndex1.value = 0;
|
|
isShow.value = 'yjjc';
|
|
isShow.value = 'yjjc';
|
|
break;
|
|
break;
|
|
|
|
+ // case 1:
|
|
|
|
+ // const { sysOrgCode } = useGlobSetting();
|
|
|
|
+ // if (sysOrgCode == 'sdmtjtbetmk') {
|
|
|
|
+ // activeIndex1.value = 0;
|
|
|
|
+ // isShow.value = 'yjzb';
|
|
|
|
+ // } else {
|
|
|
|
+ // activeIndex1.value = 0;
|
|
|
|
+ // isShow.value = 'gzzd';
|
|
|
|
+ // getMonitor(true);
|
|
|
|
+ // }
|
|
|
|
+ // break;
|
|
case 1:
|
|
case 1:
|
|
activeIndex1.value = 0;
|
|
activeIndex1.value = 0;
|
|
- isShow.value = 'yjzb';
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- activeIndex1.value = 0;
|
|
|
|
isShow.value = 'wscs';
|
|
isShow.value = 'wscs';
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -228,6 +341,7 @@ function btnClick(ind) {
|
|
function cardClick(ind, item) {
|
|
function cardClick(ind, item) {
|
|
clearTimeout(timer);
|
|
clearTimeout(timer);
|
|
activeIndex1.value = ind;
|
|
activeIndex1.value = ind;
|
|
|
|
+ gzTime.value=item.time
|
|
chartListWs.length = 0;
|
|
chartListWs.length = 0;
|
|
getMonitor(true);
|
|
getMonitor(true);
|
|
}
|
|
}
|