websocket_reset
This commit is contained in:
		@@ -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,
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
	);
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -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',
 | 
			
		||||
	};
 | 
			
		||||
 
 | 
			
		||||
@@ -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 () {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user