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-log-item.vue | 71 +++++++++++++++++++++--------------
1 files changed, 42 insertions(+), 29 deletions(-)
diff --git a/pages/task/infos/task-log-item.vue b/pages/task/infos/task-log-item.vue
index 5dba57c..df3b586 100644
--- a/pages/task/infos/task-log-item.vue
+++ b/pages/task/infos/task-log-item.vue
@@ -1,20 +1,20 @@
<template>
<view class="pages-task-log-item vert-line">
- <view class="btn-no "> {{taskData.taskButton}}
+ <view class="btn-no "> {{taskData.task_button}}
</view>
<view class="content">
<view class="line">
- <view class="title"> {{taskData.taskGroupName}}</view>
- <view class="status" :style="{'background-color':taskStatusColor+ '20','color':taskStatusColor}">
+ <view class="title"> {{taskData.task_group_name}}</view>
+ <view class="status" :style="{'background-color':taskStatusColor+ '10','color':taskStatusColor}">
{{taskStatusText}}
</view>
</view>
- <view class="line"><text class="text">{{taskData.startTime}}-{{taskData.endTime}} </text>
- <text class="text">{{taskData.duration}}min</text>
- <text class="text">{{taskData.cycleNumber}}娆�/text>
+ <view class="line"><text class="text">{{ startTime}} - {{endTime}} </text>
+ <text class="text">{{Math.ceil((taskData.end_time- taskData.start_time) / (60* 1000)) }}{{translate("minute")}}</text>
</view>
</view>
</view>
+
</template>
@@ -39,36 +39,43 @@
}
},
computed: {
+ startTime() {
+ const date = new Date(Number(this.taskData.start_time))
+ return `${date.getHours()}:${date.getMinutes()}`;
+ },
+ endTime() {
+ const date = new Date(Number(this.taskData.end_time))
+ return `${date.getHours()}:${date.getMinutes()}`;
+ },
taskStatusText() {
let statusText = ""
- if (this.taskData.status == 1) {
- statusText = "浠诲姟鎵ц涓�
- } else if (this.taskData.status == 2) {
- statusText = "浠诲姟瀹屾垚"
- } else if (this.taskData.status == 3) {
- statusText = "浠诲姟鍙栨秷"
- } else if (this.taskData.status == 4) {
- statusText = "浠诲姟寮傚父"
- } else if (this.taskData.status == 5) {
- statusText = "浠诲姟寮哄埗瀹屾垚"
+ if (this.taskData.task_status == "finish") {
+ statusText = this.translate("task_completed")
+ } else if (this.taskData.task_status == "cancel") {
+ statusText = this.translate("task_exception")
} else {
- statusText = ""
+ statusText = this.taskData.task_status
+ }
+ return statusText
+ },
+ taskStatusText() {
+ let statusText = ""
+ if (this.taskData.task_status == "finish") {
+ statusText = this.translate("task_completed")
+ } else if (this.taskData.task_status == "cancel") {
+ statusText =this.translate("task_exception")
+ } else {
+ statusText = this.taskData.task_status
}
return statusText
},
taskStatusColor() {
let statusColor = ""
- if (this.taskData.status == 1) {
- statusColor = "#0055ff"
- } else if (this.taskData.status == 2) {
- statusColor = "#237804"
- } else if (this.taskData.status == 3) {
- statusColor = "#787277"
- } else if (this.taskData.status == 4) {
- statusColor = "#D4380D"
- } else if (this.taskData.status == 5) {
- statusColor = "#55aa00"
- } else if (this.taskData.status == 5) {
+ if (this.taskData.task_status == "finish") {
+ statusColor = "#38861a"
+ } else if (this.taskData.task_status == "cancel") {
+ statusColor = "#d64017"
+ } else if (this.taskData.task_status == 5) {
statusColor = "#000000"
}
return statusColor
@@ -99,7 +106,11 @@
},
clickTask() {
this.$emit('click-item', this.taskData)
- }
+ },
+ translate(t) {
+ if (typeof this.$t == "function") return this.$t(`page.${t}`)
+ else return t;
+ },
}
}
@@ -111,6 +122,7 @@
display: flex;
flex-direction: row;
align-items: center;
+
.btn-no {
margin: 0 10rpx 0 20rpx;
@@ -128,6 +140,7 @@
.content {
flex: 1;
+ padding: 5px;
.line {
padding: 10rpx 0;
--
Gitblit v1.9.1