refactor(多个页面): 优化页面布局与交互体验
This commit is contained in:
@@ -42,6 +42,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 排班统计 -->
|
||||
<div class="schedule-stats" v-if="scheduleData.length > 0">
|
||||
<span class="stat-item">排班人数:<strong>{{ scheduleStats.totalPeople }}</strong></span>
|
||||
<span class="stat-item">排班项数:<strong>{{ scheduleStats.totalItems }}</strong></span>
|
||||
<span v-for="(count, name) in scheduleStats.shiftCounts" :key="name" class="stat-item">
|
||||
{{ name }}:<strong>{{ count }}</strong>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- 排班表格 -->
|
||||
<div class="schedule-table-wrapper">
|
||||
<el-table v-loading="loading" :data="scheduleData" border stripe height="calc(100vh - 200px)">
|
||||
@@ -486,6 +495,26 @@ export default {
|
||||
dept: emp.dept || ''
|
||||
}))
|
||||
},
|
||||
scheduleStats() {
|
||||
const stats = {
|
||||
totalPeople: this.scheduleData.length,
|
||||
totalItems: 0,
|
||||
shiftCounts: {}
|
||||
}
|
||||
this.scheduleData.forEach(row => {
|
||||
this.dateList.forEach(date => {
|
||||
if (row[date]) {
|
||||
stats.totalItems++
|
||||
const shiftName = row[date].shiftName || '未知'
|
||||
if (!stats.shiftCounts[shiftName]) {
|
||||
stats.shiftCounts[shiftName] = 0
|
||||
}
|
||||
stats.shiftCounts[shiftName]++
|
||||
}
|
||||
})
|
||||
})
|
||||
return stats
|
||||
},
|
||||
batchSelectedCount() {
|
||||
return Object.keys(this.batchCellSelection).length
|
||||
},
|
||||
@@ -1368,6 +1397,29 @@ export default {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.schedule-stats {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
margin-bottom: 12px;
|
||||
padding: 8px 16px;
|
||||
background: #f0f9eb;
|
||||
border: 1px solid #c2e7b0;
|
||||
border-radius: 4px;
|
||||
flex-wrap: wrap;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.schedule-stats .stat-item {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.schedule-stats .stat-item strong {
|
||||
color: #67c23a;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.schedule-cell {
|
||||
padding: 4px;
|
||||
min-height: 60px;
|
||||
|
||||
Reference in New Issue
Block a user