调整样式
This commit is contained in:
@@ -290,7 +290,7 @@
|
|||||||
"path" : "pages/workbench/task/reportTaskDetail",
|
"path" : "pages/workbench/task/reportTaskDetail",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : "报工任务详情",
|
"navigationBarTitleText" : "任务详情",
|
||||||
"navigationStyle": "default"
|
"navigationStyle": "default"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<!-- 任务内容 -->
|
<!-- 任务内容 -->
|
||||||
<view class="task-content">
|
<view class="task-content">
|
||||||
<view class="task-title">{{ task.taskTitle || '未命名任务' }}</view>
|
<view class="task-title" :class="{ 'single-line': isSingleLine(task.taskTitle) }">{{ task.taskTitle || '未命名任务' }}</view>
|
||||||
<view class="task-status" :class="getStatusClass(task.state)">
|
<view class="task-status" :class="getStatusClass(task.state)">
|
||||||
{{ getStatusText(task.state) }}
|
{{ getStatusText(task.state) }}
|
||||||
</view>
|
</view>
|
||||||
@@ -111,11 +111,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 获取左划操作选项
|
// 获取左划操作选项
|
||||||
getSwipeOptions(task) {
|
getSwipeOptions(task) {
|
||||||
const options = []
|
const options = []
|
||||||
|
|
||||||
// 置顶功能
|
// 置顶功能
|
||||||
if (this.config.canTop) {
|
if (this.config.canTop) {
|
||||||
if (task.ownRank === 1) {
|
if (task.ownRank === 1) {
|
||||||
@@ -242,6 +240,15 @@ export default {
|
|||||||
2: 'status-completed'
|
2: 'status-completed'
|
||||||
}
|
}
|
||||||
return classMap[state] || 'status-unknown'
|
return classMap[state] || 'status-unknown'
|
||||||
|
},
|
||||||
|
|
||||||
|
// 判断是否为单行文字
|
||||||
|
isSingleLine(text) {
|
||||||
|
if (!text) return true
|
||||||
|
// 估算文字长度,假设每个中文字符约等于2个英文字符
|
||||||
|
const estimatedLength = text.replace(/[\u4e00-\u9fa5]/g, 'aa').length
|
||||||
|
// 如果估算长度小于等于20个字符,认为是单行
|
||||||
|
return estimatedLength <= 20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,12 +324,20 @@ export default {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
height: 88rpx;
|
height: 88rpx; /* 固定高度 */
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
/* 单行文字时垂直居中 */
|
||||||
|
&.single-line {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
-webkit-line-clamp: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.task-status {
|
.task-status {
|
||||||
|
|||||||
Reference in New Issue
Block a user