|
@@ -31,37 +31,15 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="bottomTwo" @click="addNewAlarm">
|
|
|
- <text>新增守护计划 </text></view
|
|
|
- >
|
|
|
-
|
|
|
- <!-- 选择守护计划遮罩层 -->
|
|
|
- <view v-if="showPopup" class="mask" @click="showPopup = false"></view>
|
|
|
-
|
|
|
- <view v-if="showPopup" class="popup">
|
|
|
- <view class="popup-body">
|
|
|
- <picker
|
|
|
- mode="selector"
|
|
|
- :range="planListName"
|
|
|
- @change="bindPickerChange"
|
|
|
- :value="selectedIndex"
|
|
|
- >
|
|
|
- <view class="picker-text">
|
|
|
- {{
|
|
|
- planListName[selectedIndex] ||
|
|
|
- "点击此处选择守护计划"
|
|
|
- }}
|
|
|
- </view>
|
|
|
- </picker>
|
|
|
- </view>
|
|
|
- <view class="popup-footer">
|
|
|
- <view class="cancel-btn" @click="showPopup = false">
|
|
|
- 取消
|
|
|
- </view>
|
|
|
- <view type="primary" @click="confirmSelect" class="sure-btn">
|
|
|
- 确定
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view class="bottomTwo">
|
|
|
+ <picker
|
|
|
+ mode="selector"
|
|
|
+ :range="planListName"
|
|
|
+ @change="bindPickerChange"
|
|
|
+ :value="selectedIndex"
|
|
|
+ >
|
|
|
+ <text>新增守护计划 </text>
|
|
|
+ </picker>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -70,12 +48,12 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
devInfo: {},
|
|
|
- showPopup: false,
|
|
|
planList: [],
|
|
|
planListName: [],
|
|
|
selectedIndex: null,
|
|
|
// 已经新增的守护计划
|
|
|
selectedPlan: [],
|
|
|
+ changFlage: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -161,14 +139,12 @@ export default {
|
|
|
}
|
|
|
this.getSelectPlan();
|
|
|
});
|
|
|
- this.showPopup = false;
|
|
|
}
|
|
|
+ this.changFlage = true;
|
|
|
},
|
|
|
bindPickerChange(e) {
|
|
|
this.selectedIndex = e.detail.value;
|
|
|
- },
|
|
|
- addNewAlarm() {
|
|
|
- this.showPopup = true;
|
|
|
+ this.confirmSelect();
|
|
|
},
|
|
|
getSelectPlan() {
|
|
|
this.$http
|
|
@@ -187,6 +163,12 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.selectedPlan = res.data.data;
|
|
|
+ if (this.changFlage) {
|
|
|
+ this.changFlage = false;
|
|
|
+ this.editItem(
|
|
|
+ this.selectedPlan[this.selectedPlan.length - 1]
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -244,10 +226,10 @@ export default {
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.devInfo = JSON.parse(options.devInfo);
|
|
|
- this.getSelectPlan();
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getPlanList();
|
|
|
+ this.getSelectPlan();
|
|
|
},
|
|
|
};
|
|
|
</script>
|