|
@@ -79,15 +79,15 @@
|
|
|
<gasParamter />
|
|
|
</div>
|
|
|
<div style="width: 100%; height: 100%" v-else-if="isShow == 'gzzd'">
|
|
|
- <faultDiagnose :timeData="gzTime" :topData="topData" @getSearchHis="getlistdaysData1"></faultDiagnose>
|
|
|
+ <faultDiagnose :timeData="gzTime" :topData="topData" :xAxisPropType="xAxisPropType" :hisEchartData="hisEchartData" :echartData="echartData" :pointHisWarnDatas="pointHisWarnDatas" @getSearchHis="getlistdaysData1"></faultDiagnose>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive, onMounted, onUnmounted } from 'vue';
|
|
|
-import { sysTypeWarnList, sysWarn,getDevice,listdays,bjlist } from '../common.api';
|
|
|
+import { ref, reactive, onMounted, onUnmounted,computed } from 'vue';
|
|
|
+import { sysTypeWarnList, sysWarn,getDevice,listdays,bjlist,getHistoryData } from '../common.api';
|
|
|
import { useSystemSelect } from '/@/hooks/vent/useSystemSelect';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import CustomHeader from '/@/components/vent/customHeader.vue';
|
|
@@ -117,25 +117,45 @@ let router = useRouter();
|
|
|
//监测/指标激活索引
|
|
|
let activeIndex = ref(0);
|
|
|
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[]>([])
|
|
|
+//根据诊断类型判断调用哪个历史数据接口
|
|
|
+let zdType=ref('')
|
|
|
+let historySearch = reactive({
|
|
|
+ ttime_begin:'',
|
|
|
+ ttime_end: '',
|
|
|
+})
|
|
|
+//实时历史图表
|
|
|
+let xAxisPropType=ref('')
|
|
|
+let hisEchartData=ref<any[]>([])
|
|
|
+//报警历史图表
|
|
|
+let echartData = reactive<any>({
|
|
|
+ maxData: {
|
|
|
+ lengedData: '',
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ minData: {
|
|
|
+ lengedData: '',
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ xData: [],
|
|
|
+ });
|
|
|
+ //报警历史交点坐标
|
|
|
+let pointHisWarnDatas=reactive({
|
|
|
+ x:0,
|
|
|
+ y:0
|
|
|
+})
|
|
|
// https获取监测数据
|
|
|
let timer: null | NodeJS.Timeout = null;
|
|
|
function getMonitor(flag?) {
|
|
|
timer = setTimeout(
|
|
|
async () => {
|
|
|
const { sysOrgCode } = useGlobSetting();
|
|
|
- if (sysOrgCode == 'sdmtjtbetmk') {
|
|
|
- await getMenuList()
|
|
|
- } else if(sysOrgCode != 'sdmtjtbetmk' && activeIndex.value==1) {
|
|
|
- await getBjlist()
|
|
|
- }else {
|
|
|
+ if (sysOrgCode == 'sdmtjtbdmk') {
|
|
|
+ await getBjlist()
|
|
|
+ } else {
|
|
|
await getMenuList()
|
|
|
}
|
|
|
|
|
@@ -238,12 +258,18 @@ async function getBjlist(){
|
|
|
name: el.devicename,
|
|
|
warn: '故障',
|
|
|
deviceID: el.deviceid,
|
|
|
- time:el.starttime
|
|
|
+ time:el.createTime
|
|
|
// strtype: el.strtype,
|
|
|
// detail: el.detail
|
|
|
});
|
|
|
});
|
|
|
gzTime.value=menuList[activeIndex1.value].time
|
|
|
+ let index = gzTime.value.indexOf(' ')
|
|
|
+ let specificTime = dayjs(`${ gzTime.value.substring(0, index)}T${ gzTime.value.substring(index + 1)}`)
|
|
|
+ if(!historySearch.ttime_begin && !historySearch.ttime_end){
|
|
|
+ historySearch.ttime_begin = specificTime.subtract(30, 'minute').format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ historySearch.ttime_end = specificTime.add(30, 'minute').format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ }
|
|
|
//获取实时数据-报警历史
|
|
|
getDeviceList(menuList[activeIndex1.value].deviceID)
|
|
|
//获取历史数据
|
|
@@ -255,6 +281,9 @@ async function getBjlist(){
|
|
|
async function getDeviceList(param){
|
|
|
let res=await getDevice({ids:param,devicetype: "gasmonitor"})
|
|
|
if(res && res.msgTxt.length!=0){
|
|
|
+ echartData.maxData.data.length=0
|
|
|
+ echartData.minData.data.length=0
|
|
|
+ echartData.xData.length=0
|
|
|
let data=res.msgTxt[0].datalist[0]
|
|
|
topData.value=[
|
|
|
{
|
|
@@ -297,22 +326,61 @@ async function getDeviceList(param){
|
|
|
value: data.netStatus=='0' ? '断开' : '连接',
|
|
|
},
|
|
|
]
|
|
|
-
|
|
|
+zdType.value=data.stationtype || ''
|
|
|
+let list=JSON.parse(data.readData.gasGlFaultDia)
|
|
|
+echartData.maxData.data=[list.y1 || 0,list.ld_y,list.y2 || 0]
|
|
|
+echartData.minData.data=[list.y3 || 0,list.ld_y,list.y4 || 0]
|
|
|
+echartData.xData=[...new Set([list.x1,list.ld_x,list.x2,list.x3,list.x4])].sort((a,b)=>a-b)
|
|
|
+pointHisWarnDatas.x =list.ld_x
|
|
|
+pointHisWarnDatas.y=list.ld_y
|
|
|
}
|
|
|
- console.log(res,'寸草塔二矿实时数据-报警历史')
|
|
|
|
|
|
}
|
|
|
//获取历史数据-寸草塔二矿
|
|
|
async function getlistdaysData(Ids,param){
|
|
|
- let res=await listdays({strtype: 'gasmonitor_normal',gdeviceid:Ids,...param})
|
|
|
- console.log(res,'获取历史数据-寸草塔二矿')
|
|
|
+ if(zdType.value!='redis'){
|
|
|
+ let res=await listdays({strtype: 'gasmonitor_normal',gdeviceid:Ids,...param})
|
|
|
+ console.log(res,'获取历史数据-寸草塔二矿')
|
|
|
+ xAxisPropType.value='ttime'
|
|
|
+ let data = res.datalist.records;
|
|
|
+ if (data.length != 0) {
|
|
|
+ data.forEach((el) => {
|
|
|
+ Object.assign(el, el.readData);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ hisEchartData.value = data;
|
|
|
+ console.log( hisEchartData.value,' hisEchartData.value')
|
|
|
+ }else {
|
|
|
+let res=await getHistoryData({ pageNum: 1,pageSize: 100,deviceId:Ids,isEmployee: true,...param})
|
|
|
+console.log(res,'获取历史数据-寸草塔二矿')
|
|
|
+xAxisPropType.value='time'
|
|
|
+ hisEchartData.value = res['records'];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
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,'获取历史数据-寸草塔二矿')
|
|
|
+
|
|
|
+ if(zdType.value!='redis'){
|
|
|
+ let res=await listdays({strtype: 'gasmonitor_normal',gdeviceid:menuList[activeIndex1.value].deviceID,...historySearch})
|
|
|
+ console.log(res,'获取历史数据-寸草塔二矿')
|
|
|
+ xAxisPropType.value='ttime'
|
|
|
+ let data = res.datalist.records;
|
|
|
+ if (data.length != 0) {
|
|
|
+ data.forEach((el) => {
|
|
|
+ Object.assign(el, el.readData);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ hisEchartData.value = data;
|
|
|
+ }else {
|
|
|
+let res=await getHistoryData({ pageNum: 1,pageSize: 100,deviceId:menuList[activeIndex1.value].deviceID,isEmployee: true,...param})
|
|
|
+console.log(res,'获取历史数据-寸草塔二矿')
|
|
|
+xAxisPropType.value='time'
|
|
|
+ hisEchartData.value = res['records'];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//监测/预警指标选项切换
|
|
@@ -324,18 +392,21 @@ function btnClick(ind) {
|
|
|
activeIndex1.value = 0;
|
|
|
isShow.value = 'yjjc';
|
|
|
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:
|
|
|
+ const { sysOrgCode } = useGlobSetting();
|
|
|
+ if (sysOrgCode == 'sdmtjtbetmk') {
|
|
|
+ activeIndex1.value = 0;
|
|
|
+ isShow.value = 'yjzb';
|
|
|
+ } else if(sysOrgCode == 'sdmtjtbdmk') {
|
|
|
+ activeIndex1.value = 0;
|
|
|
+ isShow.value = 'gzzd';
|
|
|
+ getMonitor(true);
|
|
|
+ }else {
|
|
|
+ activeIndex1.value = 0;
|
|
|
+ isShow.value = '';
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
activeIndex1.value = 0;
|
|
|
isShow.value = 'wscs';
|
|
|
break;
|