From fb026e6052b4d843d327312db398cf791ac57ab9 Mon Sep 17 00:00:00 2001
From: cyy <cuiqian2004@163.com>
Date: 星期日, 28 九月 2025 22:43:29 +0800
Subject: [PATCH] test
---
pages/task/add.vue | 50 ++++++++++++++++++++++++++++++--------------------
1 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/pages/task/add.vue b/pages/task/add.vue
index e0dacb4..88067f0 100644
--- a/pages/task/add.vue
+++ b/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, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
@@ -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 {
--
Gitblit v1.9.1