feat: 建立整改 Task 1 多端质量基线

This commit is contained in:
weijuesen
2026-08-13 22:18:35 +08:00
parent 1b8cab19df
commit ff94ff28fe
27 changed files with 3470 additions and 315 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react';
import { useEffect } from 'react';
import { useDidShow, useDidHide } from '@tarojs/taro';
import { useStore } from '@/store/useStore';
import './app.scss';
+1 -1
View File
@@ -188,7 +188,7 @@ const AlertsPage: React.FC = () => {
<View className={styles.alarmHeader}>
<View className={styles.alarmTitleRow}>
<Text className={styles.alarmIcon}>
{alarm.severity === 'critical' || alarm.severity === 1 ? '🔴' : '🟡'}
{alarm.severity === 'critical' || alarm.severity === '1' ? '🔴' : '🟡'}
</Text>
<Text className={styles.alarmTitle}>
{alarm.title || alarm.code || '环境告警'}
+2 -2
View File
@@ -285,7 +285,7 @@ const DashboardPage: React.FC = () => {
className={styles.sectionAction}
onClick={() => handleRoomDetail(selectedRoom.id)}
>
>
{'>'}
</Text>
)}
</View>
@@ -347,7 +347,7 @@ const DashboardPage: React.FC = () => {
<View className={styles.section}>
<View className={styles.sectionHeader}>
<Text className={styles.sectionTitle}></Text>
<Text className={styles.sectionAction} onClick={handleAlarmTap}> ></Text>
<Text className={styles.sectionAction} onClick={handleAlarmTap}> {'>'}</Text>
</View>
{recentAlarms.length > 0 ? (
<View className={styles.alarmPreview}>
+2 -2
View File
@@ -79,8 +79,8 @@ const ControlPage: React.FC = () => {
}
};
const handleToggle = (newVal: boolean) => {
handleSend('power', newVal ? 'on' : 'off');
const handleToggle = (event: { detail: { value: boolean } }) => {
handleSend('power', event.detail.value ? 'on' : 'off');
};
const getMetricColor = (status: string) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import React, { useCallback, useEffect, useState } from 'react';
import { Image, ScrollView, Text, View } from '@tarojs/components';
import Taro, { useRouter } from '@tarojs/taro';
import { useRouter } from '@tarojs/taro';
import styles from './index.module.scss';
import {
getArticle,
+4 -7
View File
@@ -37,7 +37,6 @@ const LampPage: React.FC = () => {
const [stepsMap, setStepsMap] = useState<Record<string, LampTestStep[]>>({});
const [expandedId, setExpandedId] = useState('');
const [result, setResult] = useState('');
const [imagePath, setImagePath] = useState('');
const [loading, setLoading] = useState(true);
const fetchData = useCallback(async () => {
@@ -71,7 +70,6 @@ const LampPage: React.FC = () => {
}
setExpandedId(t.id);
setResult(t.result || '');
setImagePath('');
};
const handleStepToggle = async (t: LampTest, s: LampTestStep, done: boolean) => {
@@ -88,7 +86,6 @@ const LampPage: React.FC = () => {
sizeType: ['compressed'],
success: async (res) => {
const path = res.tempFilePaths[0];
setImagePath(path);
try {
const up = await uploadLampResultImage(t.id, path);
setTests((prev) =>
@@ -155,11 +152,11 @@ const LampPage: React.FC = () => {
</View>
<Text className={styles.sectionLabel}>==</Text>
<RadioGroup value={result} onChange={(e) => setResult(e.detail.value)}>
<RadioGroup onChange={(e) => setResult(e.detail.value[0])}>
<View className={styles.radioRow}>
<Radio value="positive"></Radio>
<Radio value="negative"></Radio>
<Radio value="invalid"></Radio>
<Radio value="positive" checked={result === 'positive'}></Radio>
<Radio value="negative" checked={result === 'negative'}></Radio>
<Radio value="invalid" checked={result === 'invalid'}></Radio>
</View>
</RadioGroup>
{t.result ? <Text className={styles.resultHint}>{RESULT_LABELS[t.result]}</Text> : null}
+1
View File
@@ -56,6 +56,7 @@ const NotificationPage: React.FC = () => {
try {
const res = await Taro.requestSubscribeMessage({
tmplIds: configured.map((t) => t.id),
entityIds: configured.map((t) => t.id),
});
for (const t of configured) {
if (res[t.id] === 'accept') {
+3 -3
View File
@@ -1,10 +1,10 @@
import React, { useState, useEffect } from 'react';
import { View, Text, Video } from '@tarojs/components';
import Taro, { useRouter } from '@tarojs/taro';
import { useRouter } from '@tarojs/taro';
import styles from './index.module.scss';
import { getCameras, playCamera } from '@/api/video';
import { getCameras } from '@/api/video';
import { resolveUrl } from '@/api/config';
import type { Camera, VideoPlayResponse } from '@/types';
import type { Camera } from '@/types';
const VideoPlayerPage: React.FC = () => {
const router = useRouter();