优化首页卡片
This commit is contained in:
parent
2f8c7270cf
commit
3574aa5bab
|
|
@ -42,30 +42,35 @@
|
|||
<view class="overdue-section" v-if="overdueTasks.length > 0">
|
||||
<view class="overdue-card task-card-base task-card-overdue" v-for="task in overdueTasks.slice(0, 1)" :key="task.id" @click="goToTaskDetail(task)">
|
||||
<view class="task-header">
|
||||
<view class="task-badge-wrapper">
|
||||
<uv-tags
|
||||
:text="getStatusText('overdue')"
|
||||
:type="getTaskStatusType('overdue')"
|
||||
size="mini"
|
||||
:plain="false"
|
||||
:custom-style="getTagCustomStyle('overdue')"
|
||||
></uv-tags>
|
||||
<view style="display: flex;align-items: center">
|
||||
<view class="task-badge-wrapper">
|
||||
<uv-tags
|
||||
:text="getStatusText('overdue')"
|
||||
:type="getTaskStatusType('overdue')"
|
||||
size="mini"
|
||||
:plain="false"
|
||||
:custom-style="getTagCustomStyle('overdue')"
|
||||
></uv-tags>
|
||||
</view>
|
||||
|
||||
<view class="task-date-wrapper">
|
||||
<text class="task-date">{{ task.date }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="task-date-wrapper">
|
||||
<text class="task-date">{{ task.date }}</text>
|
||||
|
||||
<view class="task-action">
|
||||
<uv-button type="error" size="small" @click.stop="handleOverdueTask(task)">立即处理</uv-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="task-content">
|
||||
<text class="task-project">所属项目: {{ task.project }}</text>
|
||||
<text class="task-description">{{ task.description }}</text>
|
||||
<text class="task-description">{{truncateText(task.description)}}</text>
|
||||
<view class="task-meta">
|
||||
<text class="task-owner">负责人: {{ task.owner }}</text>
|
||||
<text class="task-time">发布时间: {{ task.releaseTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="task-action">
|
||||
<uv-button type="error" size="small" @click.stop="handleOverdueTask(task)">立即处理</uv-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -187,6 +192,16 @@ const customerStatus = ref([
|
|||
{ label: '即将跟进', count: 0 }
|
||||
]);
|
||||
|
||||
const truncateText = (text, maxLength = 30, suffix = '...')=> {
|
||||
if (!text || typeof text !== 'string') return ''
|
||||
|
||||
if (text.length <= maxLength) {
|
||||
return text
|
||||
}
|
||||
|
||||
return text.substring(0, maxLength) + suffix
|
||||
}
|
||||
|
||||
// 加载状态
|
||||
const loading = ref(false);
|
||||
|
||||
|
|
@ -586,6 +601,7 @@ const getTagCustomStyle = (status) => {
|
|||
.task-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user