feat: 建立整改 Task 1 多端质量基线
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
"framework": "React"
|
||||
},
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build:weapp": "taro build --type weapp",
|
||||
"build:swan": "taro build --type swan",
|
||||
"build:alipay": "taro build --type alipay",
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
@@ -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 || '环境告警'}
|
||||
|
||||
@@ -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}>
|
||||
|
||||
@@ -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,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,
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"strictNullChecks": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": "",
|
||||
"rootDir": "",
|
||||
|
||||
Reference in New Issue
Block a user