cyy
2025-09-28 fb026e6052b4d843d327312db398cf791ac57ab9
pages/task/add.vue
@@ -65,13 +65,15 @@
                     <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>
@@ -133,7 +135,7 @@
               taskGroupName: "",
               cycleTime: 1,
               taskButton: 0,
               tasktype:1
               tasktype: 1
            },
            pathwayList: [{}],
            pickerView: {
@@ -220,8 +222,12 @@
                  showToast("未选择任务属性!")
                  return
               }
               if (!this.info.taskButton) {
                  showToast("未选择按钮号!")
                  return
               }
               uni.showLoading({
                  title:"任务新增中"
                  title: "任务新增中"
               })
               const taskList = []
               const task = {
@@ -234,8 +240,13 @@
               }
               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,
@@ -251,13 +262,15 @@
                     })
                  }
               })
               }
               if (taskList.length == 0) {
                  showToast("目标点未选择站台!")
                  showToast("必须添加至少一个目标点!")
                  return
               }
               await addTask(this.ip, task)
               task.taskList = taskList
               const eventChannel = this.getOpenerEventChannel();
               eventChannel.emit('add_task', task);
@@ -266,8 +279,7 @@
               })
            } catch (ex) {
               showError(ex)
            }
            finally {
            } finally {
               uni.hideLoading()
            }
         },
@@ -290,7 +302,7 @@
            }
            if (flag) {
               showModal(`当前编辑的内容将不会被保存`, "确定要退出编辑吗?",true,"确定","取消").then((res) => {
               showModal(`当前编辑的内容将不会被保存`, "确定要退出编辑吗?", true, "确定", "取消").then((res) => {
                  if (res) {
                     uni.navigateBack({
                        delta: 1, //返回层数,2则上上页
@@ -519,6 +531,7 @@
            padding: 20rpx 10rpx;
            display: flex;
            flex-direction: row;
            align-items: center;
            .right {
               flex: 1;
@@ -549,15 +562,12 @@
               margin-left: 20rpx;
            }
            .time {
               display: flex;
               flex-direction: row;
            .input {
               margin-left: 20rpx;
               .input {
                  width: 75rpx;
               }
               margin-right: 10rpx;
               width: 75rpx;
            }
         }
         .btn-del {