临时提交:模式分配任务

master
blak-kong 2 years ago
parent e846393f5d
commit 7823e143db

@ -67,489 +67,7 @@ import {
import commandMap from "@/utils/commandMap";
import { Popup } from "@antmjs/vantui";
import { fr200BleCommand } from "@/components/bluetoot/connection/fr200";
let datajson = {
ActiveModeItem: {
beganVideo: null,
combineData: [],
id: 154,
instrumentModel: "FR200",
instrumentType: 2,
isCabinMode: null,
isNew: 0,
lock: false,
lockCompanyTag: null,
lockCompanyTagArray: [],
lockWechatTag: null,
lockWechatTagArray: [],
modeBanner:
"https://flossom.yq-h5.cn/image//statics/2024/03/14/v2-3b7111f4ac41cf4a139fba4f0cc54f21_720w_20240314175626A632.jpg",
modeClass: 1,
modeDesc: "基础班脸部",
modeName: "基础班脸部",
modeTime: "00:02:00",
modeTimeStr: "02:00",
modeType: "face",
modeVideo:
"https://flossom.yq-h5.cn/image//statics/2024/03/14/497728332_nb2-1-16_20240314175725A633.mp4",
openSourceData: [],
pauseVideo: null,
preparationVideo: null,
serviceData: null,
status: 0,
},
currentServiceData: {
createBy: null,
createTime: "2024-03-15 14:15:14",
id: 169,
modeId: 154,
remark: null,
serviceEndTime: "00:02:00",
serviceEndTimeStr: "02:00",
serviceStartTime: "00:00:00",
serviceStartTimeStr: "00:00",
startSource:
"https://flossom.yq-h5.cn/image//statics/2024/03/14/v2-5363f74dedf1bb14baf92e09744e49c9_720w_20240314180057A635.gif",
startTimeArray: null,
stopSource:
"https://flossom.yq-h5.cn/image//statics/2024/03/14/v2-0584e53b800e6ed28b4a228fedb8cb8d_720w_20240314180040A634.gif",
updateBy: null,
updateTime: null,
currentTime: "00:00",
},
dataArray: [
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 5,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "standby",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 211,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "standby",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 21,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 21,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "standby",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 251,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 321,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 271,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 219,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 271,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 421,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 251,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 231,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 211,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 261,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 261,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 721,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 121,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 321,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 221,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 216,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 212,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 211,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 721,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
{
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 121,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "working",
},
],
id: "2024-03-18 15:50:39",
instrumentId: 92,
instrumentName: "lzw的FR200测试",
jsonStatus: {
battery: 4,
commandType: "DeviceStatusSync",
deviceSyncStatusType: "onlySyncStatusToDevice",
gear: 1,
impedance: 21,
isCharging: false,
joulePerSecond: 1,
matrixBattery: 0,
nasolabialOrMandibularOutput: false,
partition: 0,
pointOutChangeSide: false,
totalWorkingMinutes: 2,
totalWorkingSeconds: 1,
workMode: "face",
workStatus: "standby",
},
modeId: 154,
modeName: "基础班脸部",
workMode: "face",
};
const deviceToolKitInstanceFR200 = new DeviceToolKitWM("FR200");
let deviceToolKitInstance = deviceToolKitInstanceFR200;
@ -625,6 +143,8 @@ class IotCarePlanFR200 extends Component<any, any> {
/** 护理过程 END*/
// 模式列表
TestModeStepIndex: 0,
currentWorkModeType: 1,
isModeLock: false, // 模式是否锁定
isSwitchActiveMode: false, // 是否显示弹窗切换模式
ModeList: [],
@ -940,6 +460,7 @@ class IotCarePlanFR200 extends Component<any, any> {
let currentTime = data.modeTimeStr;
// 根据模式,动态设置底部按钮样式
let currentWorkModeType = 1;
if (data.modeType === "moistureTest") {
currentWorkModeType = 3;
@ -956,8 +477,9 @@ class IotCarePlanFR200 extends Component<any, any> {
ModeID: "mode_" + data.id,
currentServiceData,
ModeStepIndex: 0,
currentTime,
ModeType: this.ModeTypeArray[data.modeClass],
currentTime,
currentWorkModeType,
});
setTimeout(() => {
@ -1216,6 +738,18 @@ class IotCarePlanFR200 extends Component<any, any> {
case "working":
//设备的运行中状态
console.log("设备状态同步 运行中状态", jsonStatus);
if (jsonStatus.workMode === "moistureTest") {
// 水分测试
// teststatus:success
}
// 脸部模式
if (jsonStatus.workMode === "face") {
// impedance
// totalWorkingMinutes: 0
// totalWorkingSeconds: 24
}
// this.judgementWorkStatus(
// MODE_WORKING_ENUM.WORKING,
// jsonStatus.workMode
@ -1692,9 +1226,11 @@ class IotCarePlanFR200 extends Component<any, any> {
};
// 水分测试需要特殊处理
// 水分测试准备 水分测试工作 水分测试启动
if (ActiveModeItem.modeType === "moistureTest") {
sendParams.testStatus = "standby"; // 切换为准备
if (isBtnClick) {
// 水分测试启动
sendParams.testStatus = "start"; // 点击开始再开始
}
}
@ -2045,6 +1581,11 @@ class IotCarePlanFR200 extends Component<any, any> {
}
Taro.setStorageSync("FR200NursingHistory", params);
console.log("更新updateFR200NursingHistory");
// 基础模式可在这里调用函数更新图标Echarts
// 最新一条数据jsonStatus
// 注意事项只拿working状态
// todo
} else {
this.setFR200NursingHistory(jsonStatus);
}
@ -2534,6 +2075,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isRuningTest,
isShowHistoryMsg,
isModeLock,
TestModeStepIndex,
} = this.state;
return (
@ -2777,7 +2319,10 @@ class IotCarePlanFR200 extends Component<any, any> {
)}
{ActiveModeItem.modeType === "moistureTest" && (
<WaterTest isRuningTest={isRuningTest}></WaterTest>
<WaterTest
isRuningTest={isRuningTest}
TestModeStepIndex={TestModeStepIndex}
></WaterTest>
)}
</View>

@ -79,6 +79,19 @@ function Index({
</View>
</View>
)}
{currentWorkModeType === 1 && (
<View className="switch-btn-box">
<View className="btn-item" onClick={onEndPlan}>
<Image
className="btn-icon"
src={require("@/img/iot/over_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</View>
</View>
)}
</View>
</Block>
);

@ -7,9 +7,10 @@ import "./index.less";
interface Props {
isRuningTest: boolean; // 是否已开始水分测试
TestModeStepIndex: number; // 当前测试步骤
}
function Index(isRuningTest) {
function Index(isRuningTest, TestModeStepIndex) {
const stepIndex = 0;
const testIndex = 1;

Loading…
Cancel
Save