소스 검색

websocket_reset

yx-dark
gtz 1 년 전
부모
커밋
b5602d4981
4개의 변경된 파일8개의 추가작업 그리고 7개의 파일을 삭제
  1. +3
    -3
      src/components/CenterTopData/LeftBoxes/index.jsx
  2. +2
    -2
      src/components/LeftBar/substitutionCharts/GoodRateChart/index.jsx
  3. +1
    -1
      src/pages/index.jsx
  4. +2
    -1
      websocket/server.ts

+ 3
- 3
src/components/CenterTopData/LeftBoxes/index.jsx 파일 보기

@@ -9,10 +9,10 @@ import cls from './leftbox.module.less';

const Chart2 = () => {
const ctx = useContext(SocketContext);
let [time, setTime] = useState([19, 28]);
let [time, setTime] = useState([0, 0]);

useEffect(() => {
const restTime = ctx.runState?.lastFireChangeTime || '19分28秒';
const restTime = ctx.runState?.lastFireChangeTime;
if (restTime == null) return;
console.log('restTime is:', restTime);
let timer = null;
@@ -77,7 +77,7 @@ const Chart2 = () => {
{
icon: icon1,
label: '换火时间',
value: ctx.runState?.fireChangeTime || '19:56',
value: ctx.runState?.fireChangeTime || '00:00',
},
{
icon: icon3,


+ 2
- 2
src/components/LeftBar/substitutionCharts/GoodRateChart/index.jsx 파일 보기

@@ -8,7 +8,7 @@ import { randomInt } from '../../../../utils';
const GoodRateChart = (props) => {
const options = {
color: ['#FFD160', '#12FFF5', '#2760FF'],
grid: { top: 28, right: 12, bottom: 64, left: 48 },
grid: { top: 28, right: 12, bottom: 48, left: 48 },
xAxis: {
type: 'category',
data: Array(7)
@@ -147,7 +147,7 @@ const GoodRateChart = (props) => {
</Radio.Button>
</Radio.Group>
</div>
<ReactECharts option={options} />
<ReactECharts option={options} style={{ height: '100%' }} />
</div>
);
};


+ 1
- 1
src/pages/index.jsx 파일 보기

@@ -15,7 +15,7 @@ export default function index() {

const v = (value / 100).toFixed(2);
const styles = {
transform: `scale(${v})`,
transform: `scale(${(v * 3840) / 4320}, ${v})`,
// transform: `scale(${v * 24 / 33}, ${v})`,
transformOrigin: 'top left',
};


+ 2
- 1
websocket/server.ts 파일 보기

@@ -28,6 +28,7 @@ wss.on('connection', function (ws, req) {
const timer = setInterval(() => {
sendMsg(ws, 'kiln-info'); // 窑炉信息
sendMsg(ws, 'energy-cost'); // 运行状态
sendMsg(ws, 'run-state'); // 运行状态
sendMsg(ws, 'realtime');
sendMsg(ws, 'his-trend');
// sendMsg(ws, 'gas');
@@ -36,7 +37,7 @@ wss.on('connection', function (ws, req) {
}, frequency * 1000);

const timer1 = setInterval(() => {
sendMsg(ws, 'run-state'); // 运行状态
// sendMsg(ws, 'run-state'); // 运行状态
}, frequency1 * 1000);

ws.on('close', function () {


불러오는 중...
취소
저장