| | |
| | | <a @click.stop="(e)=>{ clickPathwayPoint(e,index,'actionType')}"> |
| | | {{actionTypeText(item.actionType)}} |
| | | </a> |
| | | <view v-if="item.actionType === 3"> |
| | | <template class="time" v-if="item.actionType === 3"> |
| | | <a @click.stop="()=>{item.wait = 0}" v-if="item.wait===undefined"> |
| | | 等待时间 |
| | | </a> |
| | | <view v-else class="time"> <input class="input" type="number" v-model="item.wait" |
| | | :maxlength="4" />秒</view> |
| | | </view> |
| | | <input v-else class="input" type="number" v-model="item.wait" :maxlength="4" /> |
| | | </template> |
| | | <span v-if="item.actionType === 3 && item.wait!==undefined"> |
| | | 秒 |
| | | </span> |
| | | </view> |
| | | <template v-slot:right> |
| | | <view class="btn-del" @click="clickDelPathWay(index)">删除</view> |
| | |
| | | taskGroupName: "", |
| | | cycleTime: 1, |
| | | taskButton: 0, |
| | | tasktype:1 |
| | | tasktype: 1 |
| | | }, |
| | | pathwayList: [{}], |
| | | pickerView: { |
| | |
| | | showToast("未选择任务属性!") |
| | | return |
| | | } |
| | | if (!this.info.taskButton) { |
| | | showToast("未选择按钮号!") |
| | | return |
| | | } |
| | | uni.showLoading({ |
| | | title:"任务新增中" |
| | | title: "任务新增中" |
| | | }) |
| | | const taskList = [] |
| | | const task = { |
| | |
| | | } |
| | | const taskStartTimeStamp = `${new Date().getTime()}` |
| | | |
| | | this.pathwayList.forEach((item) => { |
| | | for (let i in this.pathwayList) { |
| | | const item = this.pathwayList[i] |
| | | if (item.stationID) { |
| | | if (!item.actionType) { |
| | | showToast("目标点未选择操作类型!") |
| | | return |
| | | } |
| | | task.taskList.push({ |
| | | stationID: item.stationID, |
| | | actionType: item.actionType || 0, |
| | |
| | | |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | if (taskList.length == 0) { |
| | | showToast("目标点未选择站台!") |
| | | showToast("必须添加至少一个目标点!") |
| | | return |
| | | } |
| | | await addTask(this.ip, task) |
| | | |
| | | |
| | | task.taskList = taskList |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('add_task', task); |
| | |
| | | }) |
| | | } catch (ex) { |
| | | showError(ex) |
| | | } |
| | | finally { |
| | | } finally { |
| | | uni.hideLoading() |
| | | } |
| | | }, |
| | |
| | | } |
| | | if (flag) { |
| | | |
| | | showModal(`当前编辑的内容将不会被保存`, "确定要退出编辑吗?",true,"确定","取消").then((res) => { |
| | | showModal(`当前编辑的内容将不会被保存`, "确定要退出编辑吗?", true, "确定", "取消").then((res) => { |
| | | if (res) { |
| | | uni.navigateBack({ |
| | | delta: 1, //返回层数,2则上上页 |
| | |
| | | padding: 20rpx 10rpx; |
| | | display: flex; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | |
| | | .right { |
| | | flex: 1; |
| | |
| | | margin-left: 20rpx; |
| | | } |
| | | |
| | | .time { |
| | | display: flex; |
| | | flex-direction: row; |
| | | .input { |
| | | margin-left: 20rpx; |
| | | |
| | | .input { |
| | | width: 75rpx; |
| | | } |
| | | margin-right: 10rpx; |
| | | width: 75rpx; |
| | | } |
| | | |
| | | } |
| | | |
| | | .btn-del { |