update
This commit is contained in:
parent
049a0804ac
commit
2722ca6122
@ -73,8 +73,6 @@ const EnergyCostChart = (props) => {
|
|||||||
export default EnergyCostChart;
|
export default EnergyCostChart;
|
||||||
|
|
||||||
function getOptions(period, source, trend) {
|
function getOptions(period, source, trend) {
|
||||||
console.log("trend ==> ", trend);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
color: ["#FFD160", "#12FFF5", "#2760FF"],
|
color: ["#FFD160", "#12FFF5", "#2760FF"],
|
||||||
grid: { top: 32, right: 12, bottom: 56, left: 48 },
|
grid: { top: 32, right: 12, bottom: 56, left: 48 },
|
||||||
|
@ -19,20 +19,28 @@ function EnergyCost(props) {
|
|||||||
</div>
|
</div>
|
||||||
<div className={cls.info__item_groups}>
|
<div className={cls.info__item_groups}>
|
||||||
<div className={cls.info__item}>
|
<div className={cls.info__item}>
|
||||||
<i style={{ fontSize: "18px", fontStyle: "normal" }}>水耗量</i> :{" "}
|
<i style={{ fontSize: "18px", fontStyle: "normal" }}>水耗量</i>:
|
||||||
|
<span style={{ fontSize: "12px" }}>
|
||||||
{energyInfo?.waterQty || 0}Km³
|
{energyInfo?.waterQty || 0}Km³
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={cls.info__item}>
|
<div className={cls.info__item}>
|
||||||
<i style={{ fontSize: "18px", fontStyle: "normal" }}>天然气I</i> :{" "}
|
<i style={{ fontSize: "18px", fontStyle: "normal" }}>天然气I</i>:
|
||||||
{energyInfo?.ngQty1 || 0}m³
|
<span style={{ fontSize: "12px" }}>
|
||||||
|
{energyInfo?.ngQty1 || 0}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={cls.info__item}>
|
<div className={cls.info__item}>
|
||||||
<i style={{ fontSize: "18px", fontStyle: "normal" }}>电耗量</i> :{" "}
|
<i style={{ fontSize: "18px", fontStyle: "normal" }}>电耗量</i>:
|
||||||
|
<span style={{ fontSize: "12px" }}>
|
||||||
{energyInfo?.elecQty2 || 0}kWh
|
{energyInfo?.elecQty2 || 0}kWh
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={cls.info__item}>
|
<div className={cls.info__item}>
|
||||||
<i style={{ fontSize: "18px", fontStyle: "normal" }}>天然气II</i>{" "}
|
<i style={{ fontSize: "18px", fontStyle: "normal" }}>天然气II</i>:
|
||||||
: {energyInfo?.ngQty2 || 0}m³
|
<span style={{ fontSize: "12px" }}>
|
||||||
|
{energyInfo?.ngQty2 || 0}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
box-shadow: inset 0 0 17px 0px hsla(0, 0%, 100%, 0.15);
|
box-shadow: inset 0 0 17px 0px hsla(0, 0%, 100%, 0.15);
|
||||||
// width: 288px;
|
// width: 288px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
font-size: 20px;
|
font-size: 16px;
|
||||||
letter-spacing: 1.43px;
|
letter-spacing: 1.43px;
|
||||||
line-height: 56px;
|
line-height: 56px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -73,7 +73,6 @@ function preHandleStatisticData(data, legend) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("obj", obj)
|
|
||||||
const series = Array(legend.length)
|
const series = Array(legend.length)
|
||||||
.fill(1)
|
.fill(1)
|
||||||
.map((_) => ({
|
.map((_) => ({
|
||||||
|
@ -15,8 +15,6 @@ const GoodRateChart = (props) => {
|
|||||||
const [dateType, setDateType] = useState("day");
|
const [dateType, setDateType] = useState("day");
|
||||||
const cutting = useSelector((state) => state.cutting);
|
const cutting = useSelector((state) => state.cutting);
|
||||||
|
|
||||||
console.log("cutting chart", dateType, cutting.chart[dateType]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setUpdateKey(Date.now());
|
setUpdateKey(Date.now());
|
||||||
}, [showMore]);
|
}, [showMore]);
|
||||||
@ -80,7 +78,6 @@ const GoodRateChart = (props) => {
|
|||||||
export default GoodRateChart;
|
export default GoodRateChart;
|
||||||
|
|
||||||
function getOptions(dataList, showMore, dateType) {
|
function getOptions(dataList, showMore, dateType) {
|
||||||
console.log("showmore", showMore);
|
|
||||||
const list = [...dataList].sort((a, b) => a.dataTime - b.dataTime);
|
const list = [...dataList].sort((a, b) => a.dataTime - b.dataTime);
|
||||||
// data: Array(7)
|
// data: Array(7)
|
||||||
// .fill(1)
|
// .fill(1)
|
||||||
|
@ -5,7 +5,6 @@ function useTimeCounter(time) {
|
|||||||
const [timeTuple, setTimeTuple] = useState([0, 0]);
|
const [timeTuple, setTimeTuple] = useState([0, 0]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("time counter executed...");
|
|
||||||
if (time == null) return;
|
if (time == null) return;
|
||||||
let timer = null;
|
let timer = null;
|
||||||
if (/分/.test(time) && /秒/.test(time)) {
|
if (/分/.test(time) && /秒/.test(time)) {
|
||||||
|
@ -20,7 +20,7 @@ export const initialState = {
|
|||||||
month: [],
|
month: [],
|
||||||
year: [],
|
year: [],
|
||||||
},
|
},
|
||||||
natGasII: {
|
natGas2: {
|
||||||
week: [],
|
week: [],
|
||||||
month: [],
|
month: [],
|
||||||
year: [],
|
year: [],
|
||||||
|
@ -11,12 +11,13 @@ export default function handler(msg: MessageEvent) {
|
|||||||
|
|
||||||
console.log("[ISRA DATA] ---> ", serializedData);
|
console.log("[ISRA DATA] ---> ", serializedData);
|
||||||
|
|
||||||
if (serializedData == null) return;
|
if (serializedData == null || serializedData.detData == null) return;
|
||||||
|
|
||||||
|
const { detData } = serializedData;
|
||||||
// 处理 checkTypeList
|
// 处理 checkTypeList
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
type: "isra/setCheckType",
|
type: "isra/setCheckType",
|
||||||
payload: serializedData.checkType,
|
payload: detData.checkType,
|
||||||
});
|
});
|
||||||
// for (const checkType of serializedData.checkTypeList) {
|
// for (const checkType of serializedData.checkTypeList) {
|
||||||
// store.dispatch({
|
// store.dispatch({
|
||||||
@ -26,25 +27,25 @@ export default function handler(msg: MessageEvent) {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// 处理 dayStatistic 等数据
|
// 处理 dayStatistic 等数据
|
||||||
if ("dayStatistic" in serializedData) {
|
if ("dayStatistic" in detData) {
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
type: "isra/setDayStatistic",
|
type: "isra/setDayStatistic",
|
||||||
payload: serializedData.dayStatistic,
|
payload: detData.dayStatistic,
|
||||||
});
|
});
|
||||||
} else if ("weekStatistic" in serializedData) {
|
} else if ("weekStatistic" in detData) {
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
type: "isra/setWeekStatistic",
|
type: "isra/setWeekStatistic",
|
||||||
payload: serializedData.weekStatistic,
|
payload: serializedData.detData,
|
||||||
});
|
});
|
||||||
} else if ("monthStatistic" in serializedData) {
|
} else if ("monthStatistic" in detData) {
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
type: "isra/setMonthStatistic",
|
type: "isra/setMonthStatistic",
|
||||||
payload: serializedData.monthStatistic,
|
payload: detData.monthStatistic,
|
||||||
});
|
});
|
||||||
} else if ("yearStatistic" in serializedData) {
|
} else if ("yearStatistic" in detData) {
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
type: "isra/setYearStatistic",
|
type: "isra/setYearStatistic",
|
||||||
payload: serializedData.yearStatistic,
|
payload: detData.yearStatistic,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,13 @@ type ProductLineItem = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type MessageItem = {
|
export type MessageItem = {
|
||||||
|
type: string;
|
||||||
|
name: string;
|
||||||
|
detData: {
|
||||||
checkType: string[];
|
checkType: string[];
|
||||||
dayStatistic?: ProductLineItem[];
|
dayStatistic?: ProductLineItem[];
|
||||||
weekStatistic?: ProductLineItem[];
|
weekStatistic?: ProductLineItem[];
|
||||||
monthStatistic?: ProductLineItem[];
|
monthStatistic?: ProductLineItem[];
|
||||||
yearStatistic?: ProductLineItem[];
|
yearStatistic?: ProductLineItem[];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -21,7 +21,7 @@ export default function handler(msg: MessageEvent) {
|
|||||||
console.log("[*] websocket: [unable to serialize] ---> ", msg);
|
console.log("[*] websocket: [unable to serialize] ---> ", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("[CUTTING DATA] ---> ", serializedData);
|
// console.log("[CUTTING DATA] ---> ", serializedData);
|
||||||
|
|
||||||
if (serializedData == null) return;
|
if (serializedData == null) return;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class XClient {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
this.ws = new WebSocket(url);
|
this.ws = new WebSocket(url);
|
||||||
this.ws.onopen = () => {
|
this.ws.onopen = () => {
|
||||||
console.log(`[*] ${this.name} ws connected`);
|
// console.log(`[*] ${this.name} ws connected`);
|
||||||
};
|
};
|
||||||
this.ws.onmessage = onmessage;
|
this.ws.onmessage = onmessage;
|
||||||
this.ws.onerror = (err) => {
|
this.ws.onerror = (err) => {
|
||||||
@ -44,8 +44,8 @@ new XClient(
|
|||||||
|
|
||||||
const newUser = uuidv4();
|
const newUser = uuidv4();
|
||||||
new XClient(
|
new XClient(
|
||||||
"ws://192.168.1.74:48080/websocket/message?userId=ENERGY" + newUser,
|
// "ws://192.168.1.74:48080/websocket/message?userId=ENERGY" + newUser,
|
||||||
// "ws://10.70.2.2:8080/websocket/message?userId=ENERGY" + newUser,
|
"ws://10.70.2.2:8080/websocket/message?userId=ENERGY" + newUser,
|
||||||
// "ws://192.168.1.74:48080/websocket/message?userId=ENERGY111",
|
// "ws://192.168.1.74:48080/websocket/message?userId=ENERGY111",
|
||||||
"MES_DATA",
|
"MES_DATA",
|
||||||
energeHandler
|
energeHandler
|
||||||
@ -70,7 +70,7 @@ new XClient(
|
|||||||
// 烟气处理相关数据
|
// 烟气处理相关数据
|
||||||
new XClient(
|
new XClient(
|
||||||
// "ws://10.70.27.122:8080/websocket/message?userId=CUTTING",
|
// "ws://10.70.27.122:8080/websocket/message?userId=CUTTING",
|
||||||
"ws://192.168.1.62:48082/websocket/message?userId=" + newUser,
|
"ws://10.70.2.2:8080/websocket/message?userId=GAS" + newUser,
|
||||||
"SMOKE_DATA",
|
"SMOKE_DATA",
|
||||||
smokeHandler
|
smokeHandler
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user