|
|
|
|
@ -380,9 +380,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
let { isStandStatus, isShowNurse } = this.state;
|
|
|
|
|
// 舱体模式无法对应的时候,置灰开始按钮
|
|
|
|
|
let isCabinMode = isStandStatus
|
|
|
|
|
? data.isCabinMode === 1
|
|
|
|
|
: data.isCabinMode === 0;
|
|
|
|
|
let isCabinMode = data.isCabinMode === 1;
|
|
|
|
|
if (isStandStatus === isCabinMode) {
|
|
|
|
|
this.setState({ isCanClick: true }); // 是否舱体一致时,可以点击
|
|
|
|
|
} else {
|
|
|
|
|
@ -425,7 +423,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
this.onStartNurse();
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.onNursingTap();
|
|
|
|
|
}, 500);
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
/** 设备运行中切换模式 */
|
|
|
|
|
@ -544,10 +542,8 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
let { isStandStatus, ActiveModeItem } = this.state;
|
|
|
|
|
let isCabinMode = isStandStatus
|
|
|
|
|
? ActiveModeItem.isCabinMode === 1
|
|
|
|
|
: ActiveModeItem.isCabinMode === 0;
|
|
|
|
|
if (isStandStatus && isCabinMode) {
|
|
|
|
|
let isCabinMode = ActiveModeItem.isCabinMode === 1;
|
|
|
|
|
if (isStandStatus === isCabinMode) {
|
|
|
|
|
this.stepNext();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -613,12 +609,13 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
if (jsonStatus.connectMessage?.connectType == "CONNECTED") {
|
|
|
|
|
this.setState({
|
|
|
|
|
isStandStatus: true,
|
|
|
|
|
isCanClick: this.state.isCabinMode === 1,
|
|
|
|
|
isCanClick: this.state.ActiveModeItem?.isCabinMode === 1,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
console.log("舱体支架断开连接");
|
|
|
|
|
this.setState({
|
|
|
|
|
isStandStatus: false,
|
|
|
|
|
isCanClick: this.state.isCabinMode !== 1,
|
|
|
|
|
isCanClick: this.state.ActiveModeItem?.isCabinMode !== 1,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
@ -637,8 +634,8 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
this.setState({
|
|
|
|
|
isStandStatus: isStandDevice,
|
|
|
|
|
isCanClick: isStandDevice
|
|
|
|
|
? this.state.isCabinMode === 1
|
|
|
|
|
: this.state.isCabinMode !== 1,
|
|
|
|
|
? this.state.ActiveModeItem?.isCabinMode === 1
|
|
|
|
|
: this.state.ActiveModeItem?.isCabinMode !== 1,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 连上面罩后, 获取仪器记录, 与缓存信息对比
|
|
|
|
|
@ -1048,8 +1045,6 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
let totalSeconds = minSecToS(ActiveModeItem.modeTimeStr);
|
|
|
|
|
let currentSeconds = minSecToS(currentTime);
|
|
|
|
|
let checkTime = totalSeconds - currentSeconds;
|
|
|
|
|
console.log("设备已运行多少秒", checkTime);
|
|
|
|
|
console.log("ModeStepTimeArray", ModeStepTimeArray);
|
|
|
|
|
this.elapsedTime = checkTime;
|
|
|
|
|
if (currentSeconds >= 1) {
|
|
|
|
|
// 小程序显示倒计时
|
|
|
|
|
@ -1062,8 +1057,8 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
// 模式多个步骤节点切换
|
|
|
|
|
// 已运行时间达到下一节点时,切换
|
|
|
|
|
if (checkTime > ModeStepTimeArray[ModeStepIndex]) {
|
|
|
|
|
// 已运行时间达到下一节点,步骤切换时更新
|
|
|
|
|
if (ModeStepIndex < length) {
|
|
|
|
|
// 已运行时间达到下一节点,且存在下一节点,步骤切换时更新
|
|
|
|
|
if (ModeStepIndex < length - 1) {
|
|
|
|
|
let index = ModeStepIndex + 1; // 提前步骤+1
|
|
|
|
|
let currentServiceData = {
|
|
|
|
|
startSource: "",
|
|
|
|
|
@ -1123,20 +1118,12 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// // 工作状态,开始组合模式
|
|
|
|
|
// if (
|
|
|
|
|
// this.state.ActiveModeItem.combineData.length &&
|
|
|
|
|
// this.workStatus == MODE_WORKING_ENUM.WORKING
|
|
|
|
|
// ) {
|
|
|
|
|
// this.startCombinationMode();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const sendParams = {
|
|
|
|
|
...deviceCommandSamples.pause,
|
|
|
|
|
workMode: ActiveModeItem.modeType, // 使用模式
|
|
|
|
|
workStatus: newWorkStatus,
|
|
|
|
|
};
|
|
|
|
|
console.log("准备发送自定义指令", ActiveModeItem, sendParams);
|
|
|
|
|
console.log("准备发送自定义或工作指令", ActiveModeItem, sendParams);
|
|
|
|
|
const pauseArrayBuffer = deviceToolKitInstance.toBleCommand(
|
|
|
|
|
sendParams as any
|
|
|
|
|
);
|
|
|
|
|
@ -1188,11 +1175,6 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
);
|
|
|
|
|
console.log(ActiveModeItem);
|
|
|
|
|
console.log("isStandStatus:" + isStandStatus);
|
|
|
|
|
console.log(
|
|
|
|
|
this.workStatus !== MODE_WORKING_ENUM.WORKING &&
|
|
|
|
|
this.workStatus !== MODE_WORKING_ENUM.STANDBY &&
|
|
|
|
|
this.workStatus !== MODE_WORKING_ENUM.PAUSE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (facialMaskConnectStatus != 1) {
|
|
|
|
|
console.log("facialMaskConnectStatus 开始处", facialMaskConnectStatus);
|
|
|
|
|
@ -1222,7 +1204,11 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
this.showCountdownFun(downNum, () => {}); // 倒计时弹窗
|
|
|
|
|
|
|
|
|
|
// 开始执行护理
|
|
|
|
|
this.workStatus = MODE_WORKING_ENUM.WORKING; // 不管当前什么状态,直接设为工作状态
|
|
|
|
|
this.handleWorkStatus(true, MODE_WORKING_ENUM.WORKING);
|
|
|
|
|
this.setState({
|
|
|
|
|
isStopNurse: false,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 结束护理
|
|
|
|
|
@ -1472,16 +1458,16 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
console.log("PostNursingLogClock", res);
|
|
|
|
|
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
if (!isJump) {
|
|
|
|
|
if (isJump) {
|
|
|
|
|
this.setState({
|
|
|
|
|
isShowNursingSuccess: true,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isJump) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.setState({
|
|
|
|
|
isShowNursingSuccess: false,
|
|
|
|
|
});
|
|
|
|
|
this.goFaceReport();
|
|
|
|
|
}, 1000);
|
|
|
|
|
}, 2000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
@ -1674,6 +1660,8 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
/** 完成护理提交:跳转护理报告页 */
|
|
|
|
|
goFaceReport = () => {
|
|
|
|
|
// 跳转前置空定时器,防止重复提交
|
|
|
|
|
if (currentTimeTimer) clearInterval(currentTimeTimer);
|
|
|
|
|
go("/pages/face_report/face_report?id=" + this.state.currentDevice.id);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -1960,3 +1948,5 @@ const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
// },
|
|
|
|
|
});
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(IotCarePlan);
|
|
|
|
|
|
|
|
|
|
// isCharging
|
|
|
|
|
|