|
@@ -7,17 +7,17 @@
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
-->
|
|
-->
|
|
<template>
|
|
<template>
|
|
- <div class="all-page">
|
|
|
|
|
|
+ <div class="all-page" style="scale: 98%;margin: 20px;position: relative;right: 1%;">
|
|
<div class="left">
|
|
<div class="left">
|
|
<!-- {{machineImgParamsRef}} -->
|
|
<!-- {{machineImgParamsRef}} -->
|
|
- <div class="left-top">
|
|
|
|
- <div class="mockDiv custom-time-select">
|
|
|
|
|
|
+ <div class="left-top" style="width: 96.8%;">
|
|
|
|
+ <div class="mockDiv custom-time-select" style="position: relative;bottom: 3%;margin-bottom: 8px;">
|
|
选择时间:
|
|
选择时间:
|
|
<el-date-picker
|
|
<el-date-picker
|
|
popper-class="data-style"
|
|
popper-class="data-style"
|
|
class="custom-time-input"
|
|
class="custom-time-input"
|
|
v-model="queryParamsMock.sDate"
|
|
v-model="queryParamsMock.sDate"
|
|
- style="width: 140px"
|
|
|
|
|
|
+ style="width: 150px"
|
|
type="datetime"
|
|
type="datetime"
|
|
placeholder=""
|
|
placeholder=""
|
|
:disabled-date="disabledDate"
|
|
:disabled-date="disabledDate"
|
|
@@ -26,7 +26,7 @@
|
|
<div class="line-select"></div>
|
|
<div class="line-select"></div>
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="queryParamsMock.eDate"
|
|
v-model="queryParamsMock.eDate"
|
|
- style="width: 140px"
|
|
|
|
|
|
+ style="width: 150px"
|
|
type="datetime"
|
|
type="datetime"
|
|
placeholder=""
|
|
placeholder=""
|
|
:disabled-date="disabledDate"
|
|
:disabled-date="disabledDate"
|
|
@@ -63,7 +63,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="machine-all">
|
|
|
|
|
|
+ <div class="machine-all" style="margin-top: 10px;">
|
|
<img
|
|
<img
|
|
class="machine"
|
|
class="machine"
|
|
src="@/assets/img/macgine.png"
|
|
src="@/assets/img/macgine.png"
|
|
@@ -71,34 +71,34 @@
|
|
srcset=""
|
|
srcset=""
|
|
/>
|
|
/>
|
|
<!-- 添加注释和标签 -->
|
|
<!-- 添加注释和标签 -->
|
|
- <div class="annotation" style="top: 23%; left: 11%">左DE活塞</div>
|
|
|
|
- <div class="annotation" style="top: 20%; left: 27%">左DE燃油齿条</div>
|
|
|
|
- <div class="annotation" style="top: 8%; left: 38%">
|
|
|
|
|
|
+ <div class="annotation" style="top: 16%; left: 10%">左DE活塞</div>
|
|
|
|
+ <div class="annotation" style="top: 15%; left: 25%">左DE燃油齿条</div>
|
|
|
|
+ <div class="annotation" style="top: 2.8%; left: 36%">
|
|
左DE冷却水
|
|
左DE冷却水
|
|
</div>
|
|
</div>
|
|
- <div class="annotation" style="top: 19%; left: 41%">左DE箱装体</div>
|
|
|
|
- <div class="annotation" style="top: 14%; left: 44%">左DE燃油齿条</div>
|
|
|
|
- <div class="annotation" style="top: 7%; left: 53%">右齿轮箱</div>
|
|
|
|
- <div class="annotation" style="top: 16%; left: 54.5%">
|
|
|
|
|
|
+ <div class="annotation" style="top: 15%; left: 40%">左DE箱装体</div>
|
|
|
|
+ <div class="annotation" style="top: 8%; left: 46%">左DE燃油齿条</div>
|
|
|
|
+ <div class="annotation" style="top: 0%; left: 55.8%">右齿轮箱</div>
|
|
|
|
+ <div class="annotation" style="top: 10%; left: 57%">
|
|
右GT高压压气机
|
|
右GT高压压气机
|
|
</div>
|
|
</div>
|
|
- <div class="annotation" style="top: 23%; left: 63%">
|
|
|
|
|
|
+ <div class="annotation" style="top: 20%; left: 68%">
|
|
右GT脉冲温度调节器保护
|
|
右GT脉冲温度调节器保护
|
|
</div>
|
|
</div>
|
|
- <div class="annotation" style="bottom: 11%; left: 18.5%">
|
|
|
|
|
|
+ <div class="annotation" style="bottom: 4%; left: 15.5%">
|
|
右DE增压空气
|
|
右DE增压空气
|
|
</div>
|
|
</div>
|
|
- <div class="annotation" style="bottom: 11%; left: 29%">
|
|
|
|
|
|
+ <div class="annotation" style="bottom: 10%; left: 24%">
|
|
右DE海水泵
|
|
右DE海水泵
|
|
</div>
|
|
</div>
|
|
- <div class="annotation" style="bottom: 4%; left: 28%">
|
|
|
|
|
|
+ <div class="annotation" style="bottom: -2%; left: 28%">
|
|
右DE箱装体冷却风机
|
|
右DE箱装体冷却风机
|
|
</div>
|
|
</div>
|
|
- <div class="annotation" style="bottom: 7%; left: 42.5%">
|
|
|
|
|
|
+ <div class="annotation" style="bottom: 0%; left: 43%">
|
|
右DE滑油
|
|
右DE滑油
|
|
</div>
|
|
</div>
|
|
<!-- 带有小边框的注释 -->
|
|
<!-- 带有小边框的注释 -->
|
|
- <div class="annotation bordered-box" style="top: 6%; left: 8%">
|
|
|
|
|
|
+ <div class="annotation bordered-box" style="top: -2%; left: 2.5%">
|
|
<div>
|
|
<div>
|
|
<div>压力A排</div>
|
|
<div>压力A排</div>
|
|
|
|
|
|
@@ -123,7 +123,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="annotation bordered-box" style="top: 4%; right: 15%">
|
|
|
|
|
|
+ <div class="annotation bordered-box" style="top: -4%; right: 11.5%">
|
|
<div>
|
|
<div>
|
|
<div>海水压力</div>
|
|
<div>海水压力</div>
|
|
<div class="value">
|
|
<div class="value">
|
|
@@ -149,7 +149,7 @@
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="annotation bordered-box"
|
|
class="annotation bordered-box"
|
|
- style="bottom: 6%; left: 3%"
|
|
|
|
|
|
+ style="bottom: -1%; left: -3%"
|
|
>
|
|
>
|
|
<div>
|
|
<div>
|
|
<div>后气压PP030</div>
|
|
<div>后气压PP030</div>
|
|
@@ -175,7 +175,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="annotation bordered-box" style="top: 32%; right: 12%">
|
|
|
|
|
|
+ <div class="annotation bordered-box" style="top: 29%; right: 6%">
|
|
<div>
|
|
<div>
|
|
<div>压力(1)</div>
|
|
<div>压力(1)</div>
|
|
<div class="value">
|
|
<div class="value">
|
|
@@ -195,7 +195,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="annotation bordered-box" style="top: 83%; right: 16%">
|
|
|
|
|
|
+ <div class="annotation bordered-box" style="top: 90%; right: 11.5%">
|
|
<div>
|
|
<div>
|
|
<div>压力A排</div>
|
|
<div>压力A排</div>
|
|
<div class="value">
|
|
<div class="value">
|
|
@@ -221,7 +221,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="left-bottom">
|
|
|
|
|
|
+ <div class="left-bottom" style="margin-top: 8px;">
|
|
<s-title titleText="参数运行曲线"></s-title>
|
|
<s-title titleText="参数运行曲线"></s-title>
|
|
<div class="paramsRunRcharts">
|
|
<div class="paramsRunRcharts">
|
|
<div class="paramsRunBtn" @click="showParamsModel">选择显示参数</div>
|
|
<div class="paramsRunBtn" @click="showParamsModel">选择显示参数</div>
|
|
@@ -239,7 +239,7 @@
|
|
<div class="right">
|
|
<div class="right">
|
|
<div class="right-top">
|
|
<div class="right-top">
|
|
<s-title :type="2" titleText="运行工况分析"></s-title>
|
|
<s-title :type="2" titleText="运行工况分析"></s-title>
|
|
- <div class="history-all">
|
|
|
|
|
|
+ <div class="history-all" style="width: 94%;">
|
|
<div class="his-text">历史工况记录</div>
|
|
<div class="his-text">历史工况记录</div>
|
|
<div class="his-fun">
|
|
<div class="his-fun">
|
|
<!-- {{ chartData }} -->
|
|
<!-- {{ chartData }} -->
|
|
@@ -286,13 +286,13 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="timeEcharts">
|
|
|
|
|
|
+ <div class="timeEcharts" style="width: 97%;">
|
|
<CalendarHeatmap :data="chartData" @showDetails="handleShowDetails" />
|
|
<CalendarHeatmap :data="chartData" @showDetails="handleShowDetails" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="right-bottom">
|
|
|
|
|
|
+ <div class="right-bottom" style="width: 100%;">
|
|
<s-title :type="2" titleText="健康状态评估结果"></s-title>
|
|
<s-title :type="2" titleText="健康状态评估结果"></s-title>
|
|
- <div class="status-line">
|
|
|
|
|
|
+ <div class="status-line" style="width: 93%;">
|
|
<div class="run-status">
|
|
<div class="run-status">
|
|
<div class="status-text">
|
|
<div class="status-text">
|
|
当前健康指数
|
|
当前健康指数
|
|
@@ -391,7 +391,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="healthEcharts">
|
|
|
|
|
|
+ <div class="healthEcharts" style="width: 96%;">
|
|
<LineChart
|
|
<LineChart
|
|
:xAxisData="xAxisData"
|
|
:xAxisData="xAxisData"
|
|
:seriesData="seriesData"
|
|
:seriesData="seriesData"
|
|
@@ -568,6 +568,8 @@ import {
|
|
mockTotal
|
|
mockTotal
|
|
} from "@/api/index";
|
|
} from "@/api/index";
|
|
|
|
|
|
|
|
+const cacheNoComplete = ref(true);
|
|
|
|
+
|
|
// 用户是否在操作参数运行曲线
|
|
// 用户是否在操作参数运行曲线
|
|
const isOperating = ref(false);
|
|
const isOperating = ref(false);
|
|
// 操作倒计时 30秒
|
|
// 操作倒计时 30秒
|
|
@@ -624,34 +626,38 @@ const getQueryDataRangeSpeed = async () => {
|
|
count: Number(valueObj.batch_size),
|
|
count: Number(valueObj.batch_size),
|
|
time: Number(valueObj.interval),
|
|
time: Number(valueObj.interval),
|
|
};
|
|
};
|
|
|
|
+ mockTotalText.value = {
|
|
|
|
+ start_time: valueObj.start_time,
|
|
|
|
+ end_time: valueObj.end_time
|
|
|
|
+ };
|
|
// handleConditionHistoryRecords(valueObj.start_time, valueObj.end_time);
|
|
// handleConditionHistoryRecords(valueObj.start_time, valueObj.end_time);
|
|
mockStart(true);
|
|
mockStart(true);
|
|
};
|
|
};
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
pageInit()
|
|
pageInit()
|
|
- getMockTotal()
|
|
|
|
|
|
+ // getMockTotal()
|
|
})
|
|
})
|
|
});
|
|
});
|
|
-const getMockTotal = () => {
|
|
|
|
- mockTotal({}).then((res) => {
|
|
|
|
- mockTotalText.value = {
|
|
|
|
- start_time: res.data.start_time,
|
|
|
|
- end_time: res.data.end_time
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
|
|
+// const getMockTotal = () => {
|
|
|
|
+// mockTotal({}).then((res) => {
|
|
|
|
+// mockTotalText.value = {
|
|
|
|
+// start_time: res.data.start_time,
|
|
|
|
+// end_time: res.data.end_time
|
|
|
|
+// };
|
|
|
|
+// });
|
|
|
|
+// };
|
|
const pageInit = async () => {
|
|
const pageInit = async () => {
|
|
getcateData();
|
|
getcateData();
|
|
getQueryDataRangeSpeed();
|
|
getQueryDataRangeSpeed();
|
|
await getPointData(btnBigIndex.value, "温度");
|
|
await getPointData(btnBigIndex.value, "温度");
|
|
getHStatus();
|
|
getHStatus();
|
|
- if (!!sessionStorage.getItem("runStatus")) {
|
|
|
|
- runstatusMessage(JSON.parse(sessionStorage.getItem("runStatus")));
|
|
|
|
- }
|
|
|
|
- if (!!sessionStorage.getItem("healthyStatusText")) {
|
|
|
|
- healthyMessage(JSON.parse(sessionStorage.getItem("healthyStatusText")));
|
|
|
|
- }
|
|
|
|
|
|
+ // if (!!sessionStorage.getItem("runStatus")) {
|
|
|
|
+ // runstatusMessage(JSON.parse(sessionStorage.getItem("runStatus")));
|
|
|
|
+ // }
|
|
|
|
+ // if (!!sessionStorage.getItem("healthyStatusText")) {
|
|
|
|
+ // healthyMessage(JSON.parse(sessionStorage.getItem("healthyStatusText")));
|
|
|
|
+ // }
|
|
|
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
let cachecheckedParams = localStorage.getItem("OE_checked_params");
|
|
let cachecheckedParams = localStorage.getItem("OE_checked_params");
|
|
@@ -662,50 +668,77 @@ const pageInit = async () => {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- mockCacheData({}).then((res: any) => {
|
|
|
|
- // 检测 res.data 是否不为空对象
|
|
|
|
- if (res.data && Object.keys(res.data).length !== 0) {
|
|
|
|
- lineParamsAllRef.value = res.data.realtime.map((its: any) => {
|
|
|
|
- return {
|
|
|
|
- data: its,
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
- res.data.healths.forEach((item: any) => {
|
|
|
|
- newHealthyMessage(item)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // mockCacheData({}).then((res: any) => {
|
|
|
|
+ // // 检测 res.data 是否不为空对象
|
|
|
|
+ // if (res.data && Object.keys(res.data).length !== 0) {
|
|
|
|
+ // lineParamsAllRef.value = res.data.realtime.map((its: any) => {
|
|
|
|
+ // return {
|
|
|
|
+ // data: its,
|
|
|
|
+ // };
|
|
|
|
+ // });
|
|
|
|
+ // res.data.healths.forEach((item: any) => {
|
|
|
|
+ // newHealthyMessage(item)
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
// 处理接收到的消息
|
|
// 处理接收到的消息
|
|
|
|
+ // wsMockClient.onMessage = (data: string) => {
|
|
|
|
+ // try {
|
|
|
|
+ // const newData: any = JSON.parse(data);
|
|
|
|
+ // switch (newData.TYPE) {
|
|
|
|
+ // // 参数运行曲线
|
|
|
|
+ // case "1":
|
|
|
|
+ // if (Object.keys(newData.data).length > 0) {
|
|
|
|
+ // dealMessage(data);
|
|
|
|
+ // }
|
|
|
|
+ // break;
|
|
|
|
+ // case "2":
|
|
|
|
+ // if (Object.keys(newData.data).length > 0) {
|
|
|
|
+ // runstatusMessage(newData.data);
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // break;
|
|
|
|
+ // case "3":
|
|
|
|
+ // if (Object.keys(newData.data).length > 0) {
|
|
|
|
+ // healthyMessage(newData.data);
|
|
|
|
+ // }
|
|
|
|
+ // break;
|
|
|
|
+ // case "4":
|
|
|
|
+ // workMessage(newData.data);
|
|
|
|
+ // console.log("workMessage ===>", newData.data);
|
|
|
|
+ // break;
|
|
|
|
+ // default:
|
|
|
|
+ // break;
|
|
|
|
+ // }
|
|
|
|
+ // } catch (error) {
|
|
|
|
+ // console.log("不合法的data数据2================");
|
|
|
|
+ // }
|
|
|
|
+ // };
|
|
|
|
+
|
|
wsMockClient.onMessage = (data: string) => {
|
|
wsMockClient.onMessage = (data: string) => {
|
|
try {
|
|
try {
|
|
const newData: any = JSON.parse(data);
|
|
const newData: any = JSON.parse(data);
|
|
switch (newData.TYPE) {
|
|
switch (newData.TYPE) {
|
|
// 参数运行曲线
|
|
// 参数运行曲线
|
|
- case "1":
|
|
|
|
- if (Object.keys(newData.data).length > 0) {
|
|
|
|
- dealMessage(data);
|
|
|
|
|
|
+ case "5":
|
|
|
|
+ if (newData.data[0]) {
|
|
|
|
+ dealMessage(JSON.parse(newData.data[0]));
|
|
}
|
|
}
|
|
- break;
|
|
|
|
- case "2":
|
|
|
|
- if (Object.keys(newData.data).length > 0) {
|
|
|
|
- runstatusMessage(newData.data);
|
|
|
|
|
|
+ if (newData.data[1]) {
|
|
|
|
+ runstatusMessage(JSON.parse(newData.data[1]).data);
|
|
}
|
|
}
|
|
-
|
|
|
|
- break;
|
|
|
|
- case "3":
|
|
|
|
- if (Object.keys(newData.data).length > 0) {
|
|
|
|
- healthyMessage(newData.data);
|
|
|
|
|
|
+ if (newData.data[2]) {
|
|
|
|
+ healthyMessage(JSON.parse(newData.data[2]).data);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "4":
|
|
case "4":
|
|
workMessage(newData.data);
|
|
workMessage(newData.data);
|
|
- console.log("workMessage ===>", newData.data);
|
|
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
- console.log("不合法的data数据2================");
|
|
|
|
|
|
+ console.log(error);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|
|
@@ -752,9 +785,7 @@ const handleConditionHistoryRecords = async (s: string, d: string) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- console.log("chartData 2");
|
|
|
|
chartData.value = transformData(dataList);
|
|
chartData.value = transformData(dataList);
|
|
- console.log("chartData 2", chartData.value);
|
|
|
|
};
|
|
};
|
|
// 上一周
|
|
// 上一周
|
|
const prevWeek = async () => {
|
|
const prevWeek = async () => {
|
|
@@ -897,9 +928,25 @@ const onClickStart = async () => {
|
|
message: '调整成功',
|
|
message: '调整成功',
|
|
type: 'success',
|
|
type: 'success',
|
|
})
|
|
})
|
|
- pageInit()
|
|
|
|
|
|
+ await pageInit()
|
|
|
|
+
|
|
|
|
+ let cacheParams = localStorage.getItem("OE_checked_params");
|
|
|
|
+ if (cacheParams) {
|
|
|
|
+ interface PointItem {
|
|
|
|
+ pointName: string;
|
|
|
|
+ pointCode: string;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const fields: string[] = []
|
|
|
|
+ const pointData = await measurementPoints({})
|
|
|
|
+ pointData.data.forEach((item: PointItem) => {
|
|
|
|
+ if (cacheParams.includes(item.pointName)) {
|
|
|
|
+ fields.push(item.pointCode)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ await editDisplayParams({ fields })
|
|
|
|
+ }
|
|
proxy.$loading.stop();
|
|
proxy.$loading.stop();
|
|
- console.log("res ===>", res);
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error("Error in fetching data: ", error);
|
|
console.error("Error in fetching data: ", error);
|
|
}
|
|
}
|
|
@@ -922,6 +969,15 @@ const mockStart = async (state: boolean = false) => {
|
|
// mounted进来使用缓存接口数据
|
|
// mounted进来使用缓存接口数据
|
|
if (state) {
|
|
if (state) {
|
|
let resultCatch = await mockCacheData({});
|
|
let resultCatch = await mockCacheData({});
|
|
|
|
+ lineParamsAllRef.value = [];
|
|
|
|
+ seriesData.value = [
|
|
|
|
+ {
|
|
|
|
+ name: "趋势",
|
|
|
|
+ data: [],
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ xAxisData.value = [];
|
|
|
|
+ healthyStatusText.value = {name: '',color: ''};
|
|
if (resultCatch.data && Object.keys(resultCatch.data).length !== 0) {
|
|
if (resultCatch.data && Object.keys(resultCatch.data).length !== 0) {
|
|
lineParamsAllRef.value = resultCatch.data.realtime.map((its: any) => {
|
|
lineParamsAllRef.value = resultCatch.data.realtime.map((its: any) => {
|
|
return {
|
|
return {
|
|
@@ -932,21 +988,15 @@ const mockStart = async (state: boolean = false) => {
|
|
newHealthyMessage(item)
|
|
newHealthyMessage(item)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ cacheNoComplete.value = false;
|
|
} else {
|
|
} else {
|
|
lineParamsAllRef.value = [];
|
|
lineParamsAllRef.value = [];
|
|
}
|
|
}
|
|
- seriesData.value = [
|
|
|
|
- {
|
|
|
|
- name: "趋势",
|
|
|
|
- data: [],
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- xAxisData.value = [];
|
|
|
|
|
|
|
|
if (wsMockClient.readyState === WebSocket.CLOSED) {
|
|
if (wsMockClient.readyState === WebSocket.CLOSED) {
|
|
wsMockClient.connect();
|
|
wsMockClient.connect();
|
|
// 向服务器发送消息
|
|
// 向服务器发送消息
|
|
- wsMockClient.send("你好!");
|
|
|
|
|
|
+ // wsMockClient.send("你好!");
|
|
}
|
|
}
|
|
|
|
|
|
handleDateRangeChange({
|
|
handleDateRangeChange({
|
|
@@ -1011,8 +1061,15 @@ watch(
|
|
setLineparames(newdata, result);
|
|
setLineparames(newdata, result);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- machineImgParamsRef.value =
|
|
|
|
|
|
+
|
|
|
|
+ if (Object.keys(lineParamsAllRef.value[0].data).length > 8) {
|
|
|
|
+ machineImgParamsRef.value =
|
|
lineParamsAllRef.value[lineParamsAllRef.value.length - 1].data;
|
|
lineParamsAllRef.value[lineParamsAllRef.value.length - 1].data;
|
|
|
|
+ localStorage.setItem('OE_ff_point', JSON.stringify(lineParamsAllRef.value[lineParamsAllRef.value.length - 1].data));
|
|
|
|
+ } else {
|
|
|
|
+ machineImgParamsRef.value = JSON.parse(localStorage.getItem('OE_ff_point') || '{}');
|
|
|
|
+ }
|
|
|
|
+
|
|
// console.log("machineImgParamsRef.value", machineImgParamsRef.value);
|
|
// console.log("machineImgParamsRef.value", machineImgParamsRef.value);
|
|
|
|
|
|
const result: Array<AnyObject> = convertToChartData(
|
|
const result: Array<AnyObject> = convertToChartData(
|
|
@@ -1058,7 +1115,7 @@ const changeAttr = (valArr: string[]) => {
|
|
message: `最多选择5个参数`,
|
|
message: `最多选择5个参数`,
|
|
type: "error",
|
|
type: "error",
|
|
});
|
|
});
|
|
- checkedParams.value = val.slice(0, 5);
|
|
|
|
|
|
+ checkedChange.value = val.slice(0, 5);
|
|
return
|
|
return
|
|
} else {
|
|
} else {
|
|
checkedChange.value = val;
|
|
checkedChange.value = val;
|
|
@@ -1067,8 +1124,8 @@ const changeAttr = (valArr: string[]) => {
|
|
// `OE_checked_params_${props.data.id}`,
|
|
// `OE_checked_params_${props.data.id}`,
|
|
// JSON.stringify(checkedParams.value)
|
|
// JSON.stringify(checkedParams.value)
|
|
// );
|
|
// );
|
|
- // localStorage.setItem("btnIndex", btnIndex.value);
|
|
|
|
- // localStorage.setItem("btnBigIndex", btnBigIndex.value);
|
|
|
|
|
|
+ localStorage.setItem("btnIndex", btnIndex.value);
|
|
|
|
+ localStorage.setItem("btnBigIndex", btnBigIndex.value);
|
|
};
|
|
};
|
|
const saveAttr = async () => {
|
|
const saveAttr = async () => {
|
|
checkedParams.value = checkedChange.value
|
|
checkedParams.value = checkedChange.value
|
|
@@ -1092,8 +1149,19 @@ const saveAttr = async () => {
|
|
}
|
|
}
|
|
console.log('data ===>', data)
|
|
console.log('data ===>', data)
|
|
await editDisplayParams(data)
|
|
await editDisplayParams(data)
|
|
- onClickStart();
|
|
|
|
- runLineParams();
|
|
|
|
|
|
+
|
|
|
|
+ // onClickStart();
|
|
|
|
+ // runLineParams();
|
|
|
|
+ lineParamsAllRef.value = [];
|
|
|
|
+
|
|
|
|
+ let resultCatch = await mockCacheData({});
|
|
|
|
+ if (resultCatch.data && Object.keys(resultCatch.data).length !== 0) {
|
|
|
|
+ lineParamsAllRef.value = resultCatch.data.realtime.map((its: any) => {
|
|
|
|
+ return {
|
|
|
|
+ data: its,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ }
|
|
showModal.value = false;
|
|
showModal.value = false;
|
|
}
|
|
}
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|
|
@@ -1129,7 +1197,7 @@ const getTip = () => {
|
|
const dealMessage = (data: string) => {
|
|
const dealMessage = (data: string) => {
|
|
// 消息整合 有值 就是这个设备参数
|
|
// 消息整合 有值 就是这个设备参数
|
|
if (!!data) {
|
|
if (!!data) {
|
|
- lineParamsAllRef.value.push(JSON.parse(data));
|
|
|
|
|
|
+ lineParamsAllRef.value.push(data);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -1155,6 +1223,11 @@ const showParamsModel = () => {
|
|
getPointData(btnBigIndex.value, cateSmallRef.value[btnIndex.value]);
|
|
getPointData(btnBigIndex.value, cateSmallRef.value[btnIndex.value]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ let cacheParams = localStorage.getItem("OE_checked_params");
|
|
|
|
+ if (cacheParams) {
|
|
|
|
+ checkedParams.value = JSON.parse(cacheParams);
|
|
|
|
+ }
|
|
|
|
+
|
|
showModal.value = true;
|
|
showModal.value = true;
|
|
};
|
|
};
|
|
const checkedParams = ref([]);
|
|
const checkedParams = ref([]);
|
|
@@ -1234,6 +1307,11 @@ const convertToChartData = (
|
|
// // console.log(selectedData);
|
|
// // console.log(selectedData);
|
|
|
|
|
|
// debugger
|
|
// debugger
|
|
|
|
+ let cacheParams = localStorage.getItem("OE_checked_params");
|
|
|
|
+ if (cacheParams) {
|
|
|
|
+ properties = JSON.parse(cacheParams);
|
|
|
|
+ }
|
|
|
|
+
|
|
return properties.map((propertyName) => ({
|
|
return properties.map((propertyName) => ({
|
|
name: propertyName,
|
|
name: propertyName,
|
|
// name: propertyName,
|
|
// name: propertyName,
|
|
@@ -1358,7 +1436,7 @@ const runstatusMessage = (data: { label: string; state: 0 | 1 | 2 }) => {
|
|
// 获取工况状态
|
|
// 获取工况状态
|
|
runStatusText.value = enumParasm[data.state].text + `(${data.label})`;
|
|
runStatusText.value = enumParasm[data.state].text + `(${data.label})`;
|
|
runStatusColor.value = enumParasm[data.state].color;
|
|
runStatusColor.value = enumParasm[data.state].color;
|
|
- sessionStorage.setItem("runStatus", JSON.stringify(data));
|
|
|
|
|
|
+ // sessionStorage.setItem("runStatus", JSON.stringify(data));
|
|
};
|
|
};
|
|
const workMessage = (data: any) => {
|
|
const workMessage = (data: any) => {
|
|
// 获取工况数据 一小时来一次
|
|
// 获取工况数据 一小时来一次
|
|
@@ -1527,22 +1605,21 @@ const healthyStatusText = ref({
|
|
let flag = false;
|
|
let flag = false;
|
|
|
|
|
|
const newHealthyMessage = (data: Object) => {
|
|
const newHealthyMessage = (data: Object) => {
|
|
- console.log('newHealthyMessage ===>', data)
|
|
|
|
- if (data.health == 99) {
|
|
|
|
- if (flag) {
|
|
|
|
- data.health = 92;
|
|
|
|
- flag = false;
|
|
|
|
- } else {
|
|
|
|
- data.health = 98;
|
|
|
|
- flag = true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // if (data.health == 99) {
|
|
|
|
+ // if (flag) {
|
|
|
|
+ // data.health = 92;
|
|
|
|
+ // flag = false;
|
|
|
|
+ // } else {
|
|
|
|
+ // data.health = 98;
|
|
|
|
+ // flag = true;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
|
|
// 获取健康数据
|
|
// 获取健康数据
|
|
// let obj=determineHealthStatus(data.avg_num)
|
|
// let obj=determineHealthStatus(data.avg_num)
|
|
let obj = determineHealthStatus(`${data.sha}(${data.health}%)`);
|
|
let obj = determineHealthStatus(`${data.sha}(${data.health}%)`);
|
|
healthyStatusText.value = obj;
|
|
healthyStatusText.value = obj;
|
|
- sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
|
|
|
|
|
|
+ // sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
|
|
xAxisData.value.push(moment(data._ts).format("HH:mm:ss"));
|
|
xAxisData.value.push(moment(data._ts).format("HH:mm:ss"));
|
|
seriesData.value[0].data.push(data.health);
|
|
seriesData.value[0].data.push(data.health);
|
|
let arr = seriesData.value[0].data;
|
|
let arr = seriesData.value[0].data;
|
|
@@ -1555,21 +1632,25 @@ const newHealthyMessage = (data: Object) => {
|
|
};
|
|
};
|
|
|
|
|
|
const healthyMessage = (data: Object) => {
|
|
const healthyMessage = (data: Object) => {
|
|
- if (data.avg_num == 99) {
|
|
|
|
- if (flag) {
|
|
|
|
- data.avg_num = 92;
|
|
|
|
- flag = false;
|
|
|
|
- } else {
|
|
|
|
- data.avg_num = 98;
|
|
|
|
- flag = true;
|
|
|
|
- }
|
|
|
|
|
|
+ if (cacheNoComplete.value) {
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // if (data.avg_num == 99) {
|
|
|
|
+ // if (flag) {
|
|
|
|
+ // data.avg_num = 92;
|
|
|
|
+ // flag = false;
|
|
|
|
+ // } else {
|
|
|
|
+ // data.avg_num = 98;
|
|
|
|
+ // flag = true;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+
|
|
// 获取健康数据
|
|
// 获取健康数据
|
|
// let obj=determineHealthStatus(data.avg_num)
|
|
// let obj=determineHealthStatus(data.avg_num)
|
|
let obj = determineHealthStatus(`${data.sha}(${data.avg_num}%)`);
|
|
let obj = determineHealthStatus(`${data.sha}(${data.avg_num}%)`);
|
|
healthyStatusText.value = obj;
|
|
healthyStatusText.value = obj;
|
|
- sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
|
|
|
|
|
|
+ // sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
|
|
xAxisData.value.push(moment(data.date).format("HH:mm:ss"));
|
|
xAxisData.value.push(moment(data.date).format("HH:mm:ss"));
|
|
seriesData.value[0].data.push(data.avg_num);
|
|
seriesData.value[0].data.push(data.avg_num);
|
|
let arr = seriesData.value[0].data;
|
|
let arr = seriesData.value[0].data;
|
|
@@ -1731,15 +1812,15 @@ const healthColor = (status: string) => {
|
|
position: absolute;
|
|
position: absolute;
|
|
color: rgba(255, 255, 255, 0.75);
|
|
color: rgba(255, 255, 255, 0.75);
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
- padding: 2px 5px;
|
|
|
|
|
|
+ padding: 0.5px 1px;
|
|
border-radius: 3px;
|
|
border-radius: 3px;
|
|
- font-size: 1rem;
|
|
|
|
|
|
+ font-size: 14px;
|
|
}
|
|
}
|
|
.bordered-box div {
|
|
.bordered-box div {
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between; /* 使文本和数值分布在两端 */
|
|
justify-content: space-between; /* 使文本和数值分布在两端 */
|
|
- line-height: 20px;
|
|
|
|
|
|
+ line-height: 18px;
|
|
}
|
|
}
|
|
.bordered-box .value {
|
|
.bordered-box .value {
|
|
margin-left: 15px; /* 在文本和数值之间添加5px的间距 */
|
|
margin-left: 15px; /* 在文本和数值之间添加5px的间距 */
|