blak-kong 2 years ago
parent 7823e143db
commit 5075b9285c

@ -367,6 +367,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}); });
}; };
// 获取模式列表
GetModeList = async (id) => { GetModeList = async (id) => {
let params = { let params = {
instrumentId: id, instrumentId: id,
@ -375,19 +376,18 @@ class IotCarePlanFR200 extends Component<any, any> {
if (res.data.code === 200) { if (res.data.code === 200) {
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
this.setState({ this.setState({
ActiveModeItem: res.data.data[0],
ModeList: res.data.data, ModeList: res.data.data,
}); });
if (this.state.activeModeID != "") { // if (this.state.activeModeID != "") {
this.state.ModeList.map((item) => { // this.state.ModeList.map((item) => {
if (item.id === this.state.activeModeID) { // if (item.id === this.state.activeModeID) {
this.setState({ // this.setState({
ActiveModeItem: item, // ActiveModeItem: item,
}); // });
} // }
}); // });
} // }
setTimeout(() => { setTimeout(() => {
this.modeCurrentFun(res.data.data[0]); this.modeCurrentFun(res.data.data[0]);

Loading…
Cancel
Save