Bladeren bron

'update'

master
gtz 9 maanden geleden
bovenliggende
commit
9814c2b6e9
4 gewijzigde bestanden met toevoegingen van 5920 en 6859 verwijderingen
  1. +5905
    -6851
      package-lock.json
  2. +11
    -5
      src/components/Common/FanInfo/index.jsx
  3. +2
    -2
      src/components/Common/Feeder/index.jsx
  4. +2
    -1
      src/utils/index.js

+ 5905
- 6851
package-lock.json
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 11
- 5
src/components/Common/FanInfo/index.jsx Bestand weergeven

@@ -20,11 +20,11 @@ function attachStyle(data) {
if (index == arr.length - 1) {
return `<div style="display: flex; align-items: center">
<span style="box-shadow: 0 0 4px 4px ${
item == 1 ? "#2760ff55" : "#a81b2655"
item == 1 ? "#2760ff55" : item == 0 ? "#a81b2655" : "#E6A23C55"
}; margin-right: 8px; width: 8px; height: 8px; border-radius: 8px; background: ${
item == 1 ? "#2760ff" : "#a81b26"
}"></span><span style="color: ${item == 1 ? "#2760ff" : "#a81b26"}">${
item == 1 ? "正常" : "故障"
item == 1 ? "#2760ff" : item == 0 ? "#a81b26" : "#E6A23C"
}"></span><span style="color: ${item == 1 ? "#2760ff" : item == 0 ? "#a81b26" : "#E6A23C"}">${
item == 1 ? "运行" : item == 0 ? "故障" : "未运行"
}</span></div>`;
}
return `<span style='color: #fffa'>${item}</span>`;
@@ -36,10 +36,16 @@ function FanInfo(props) {
const rowNum = props.rows || 8;
// let data = getRandomRows(100);
const fanInfo = useSelector((state) => state.fanInfo.fanInfo);

console.log(fanInfo)
console.log('-------------------------------')

const data = Object.keys(fanInfo).map((key, index) => {
return [index+1, key, fanInfo[key] == "正常" ? 1 : 0];
return [index+1, key, fanInfo[key] == "运行" ? 1 : fanInfo[key] == "故障" ? 0 : 2];
});

console.log(data)

let config = {
headerBGC: "rgba(4, 44, 76, 0.3)",
header: [


+ 2
- 2
src/components/Common/Feeder/index.jsx Bestand weergeven

@@ -29,7 +29,7 @@ function FeederStatus(props) {
color: "#fff",
border: "1px solid #fff",
padding: "12px",
background: leftFeeder == "运行" ? "#0f03" : "#f003",
background: leftFeeder == "运行" ? "#0f03" : leftFeeder == "故障" ? "#f003" : "#da33",
}}
>
投料机1 : {leftFeeder}
@@ -39,7 +39,7 @@ function FeederStatus(props) {
color: "#fff",
border: "1px solid #fff",
padding: "12px",
background: rightFeeder == "运行" ? "#0f03" : "#f003",
background: rightFeeder == "运行" ? "#0f03" : rightFeeder == "故障" ? "#f003" : "#da33",
}}
>
投料机2 : {rightFeeder}


+ 2
- 1
src/utils/index.js Bestand weergeven

@@ -10,7 +10,8 @@ export function randomInt(min, max, includeMax = false) {
}

export class WsClient {
static wsServer = "ws://192.168.1.12:8081/xc-screen/websocket/xc001";
// static wsServer = "ws://172.16.1.55:8081/xc-screen/websocket/1";
static wsServer = "ws://10.70.180.10:8081/xc-screen/websocket/1";
static socket = null;
static tryCount = 0;



Laden…
Annuleren
Opslaan