From 2af5f043b60c1f7ac38ecccc8f5bf44743134325 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:08:00 +0800
Subject: [PATCH] test
---
pages/task/infos/task-item.vue | 87 +++++++++++++++++++++++++++++++------------
1 files changed, 63 insertions(+), 24 deletions(-)
diff --git a/pages/task/infos/task-item.vue b/pages/task/infos/task-item.vue
index 72fd1ae..91e32aa 100644
--- a/pages/task/infos/task-item.vue
+++ b/pages/task/infos/task-item.vue
@@ -44,7 +44,7 @@
<view class="item-sub" v-if="showTaskRunning && taskIsRun">
<view class="sub-item" v-for="(item,index) in taskStatusList" :key="item.taskID">
<text class="text">{{getStatusText(item.status)}}</text>
- <text class="text">{{"鐩爣鐐�+(index+ 1)}}</text>
+ <text class="text">{{translate("target_point" ) + " "+(index+ 1)}}</text>
<text class="text">{{getDestText(item)}}</text>
<text class="text">{{getActionText(item)}}</text>
</view>
@@ -105,13 +105,37 @@
},
taskCycleTime() {
- if (this.taskIsRun)
- return `绗�{this.taskStatus?.curCycleNumber || 0}/${this.taskStatus?.cycleTotalNumber || 0}娆
-
- else
- return `閲嶅${this.taskData.cycleTime || 0}娆
-
-
+ if (this.taskIsRun) {
+ const time = this.taskStatus?.curCycleNumber || 0
+ let timeStr = `${time}${this.translate("the_th_suffix")}`
+ if (time % 10 == 1) {
+ timeStr = `${time}${this.translate("the_st_suffix")}`
+ } else if (time % 10 == 2) {
+ timeStr = `${time}${this.translate("the_nd_suffix")}`
+ } else if (time % 10 == 3) {
+ timeStr = `${time}${this.translate("the_rd_suffix")}`
+ }
+ return this.translate("time_number", [timeStr,
+ `${this.taskStatus?.cycleTotalNumber || 0}`
+ ])
+ } else {
+ const time = this.taskData.cycleTime || 0
+ let timeStr = ""
+ if(time == 1)
+ {
+ timeStr = this.translate("repeat_once")
+ }
+ else if(time == 2)
+ {
+ timeStr = this.translate("repeat_twice")
+ }
+ else
+ {
+ timeStr = this.translate("repeat_times", [`${time}`])
+ }
+
+ return timeStr
+ }
},
taskIsRun() {
if (this.taskStatus?.taskGroupID == this.taskData.taskGroupID) {
@@ -197,19 +221,19 @@
},
getStatusText(status) {
- var statusText = "鏈煡"
+ var statusText = this.translate("unknown")
if (!status) {
- statusText = "鏈紑濮�
+ statusText = this.translate("not_started")
} else if (status === 5) {
- statusText = "寮哄埗瀹屾垚"
+ statusText = this.translate("mandatory_completion")
} else if (status === 4) {
- statusText = "寮傚父缁撴潫"
+ statusText = this.translate("abnormal_termination")
} else if (status === 3) {
- statusText = "宸插彇娑�
+ statusText = this.translate("canceled")
} else if (status === 2) {
- statusText = "宸插畬鎴�
+ statusText = this.translate("completed")
} else if (status === 1) {
- statusText = "鎵ц涓�
+ statusText = this.translate("in_progress")
}
return statusText
},
@@ -224,21 +248,35 @@
const index = this.taskData.taskList.findIndex((a) => a.taskID == item.taskID)
if (index > -1) {
const task = this.taskData.taskList[index]
- var actionText = "鏈煡"
+ var actionText = this.translate("unknown")
if (task.actionType === 1) {
- actionText = "瀵艰埅"
- } else if (task.actionType === 2) {
- actionText = "鍙栬揣"
- } else if (task.actionType === 3) {
- actionText = `鍗歌揣 绛夊緟${task.wait || 0}绉抈
- } else if (task.actionType === 4) {
- actionText = "浜哄伐"
+ actionText = this.translate("navigation")
}
+ // else if (task.actionType === 2) {
+ // actionText = "鍙栬揣"
+ // }
+ else if (task.actionType === 3) {
+ actionText =
+ `${this.translate("auto_unload")}:${this.translate("wait")}:${task.wait || 0}${this.translate("second")}`
+ }
+ // else if (task.actionType === 4) {
+ // actionText = "浜哄伐"
+ // }
return actionText
}
return ""
},
-
+ translate(t, values) {
+ if (typeof this.$t == "function") {
+ const message = this.$t(`page.${t}`)
+ if (values) {
+ return message.replace(/{(\d+)}/g, (match, index) => {
+ const value = values[index]
+ return value !== undefined ? value : match
+ })
+ } else return message
+ } else return t;
+ },
}
}
</script>
@@ -268,6 +306,7 @@
border-bottom: 1px solid #ddd;
display: flex;
flex-direction: row;
+
.text {
color: gray;
padding: 10rpx;
--
Gitblit v1.9.1