fix(工作台-工时、周报、日志管理): 详细如下。
- 移除历史工作日分隔符兼容逻辑,仅使用显式分隔标记切分 - 扩展工时数据显示范围从5个工作日到7天完整周,并添加周末展示控制 - 在团队工时统计中新增加班工时字段并调整图表展示方式 - 移除团队工时分布中的分类矩阵,简化数据结构 - 为API访问日志和错误日志搜索组件添加用户选择功能 - 调整日志搜索界面布局,将用户编号输入改为用户选择下拉框 - 移除用户类型筛选条件以简化搜索界面 - 更新工时图表配置以支持周末数据显示和新的数据结构
This commit is contained in:
@@ -206,7 +206,7 @@ function buildMyBarOption(): ECOption {
|
||||
grid: { left: 28, right: 8, top: 16, bottom: 24, containLabel: false },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['一', '二', '三', '四', '五'],
|
||||
data: v?.visibleDayLabels ?? ['一', '二', '三', '四', '五'],
|
||||
axisTick: { show: false },
|
||||
axisLine: { lineStyle: { color: '#e5e7eb' } },
|
||||
axisLabel: { color: '#6b7280', fontSize: 11 }
|
||||
@@ -221,7 +221,7 @@ function buildMyBarOption(): ECOption {
|
||||
name: '每日工时',
|
||||
type: 'bar',
|
||||
barWidth: 18,
|
||||
data: v?.dailyHours ?? [],
|
||||
data: v?.visibleDailyHours ?? [],
|
||||
itemStyle: { color: DAY_BAR_COLOR, borderRadius: [2, 2, 0, 0] }
|
||||
}
|
||||
]
|
||||
@@ -243,14 +243,9 @@ const { domRef: myBarRef, updateOptions: updateMyBar } = useEcharts(buildMyBarOp
|
||||
|
||||
const teamView = computed(() => (teamWeekData.value ? buildWorkbenchTeamWorklogView(teamWeekData.value) : null));
|
||||
|
||||
const teamSeriesWithColor = computed(() =>
|
||||
(teamView.value?.seriesMatrix ?? []).map(s => ({ ...s, color: getWorkbenchItemColor(s.key, s.kind) }))
|
||||
);
|
||||
|
||||
function buildTeamBarOption(): ECOption {
|
||||
const v = teamView.value;
|
||||
if (!v) return {};
|
||||
const colored = teamSeriesWithColor.value;
|
||||
return {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@@ -259,15 +254,15 @@ function buildTeamBarOption(): ECOption {
|
||||
const params = Array.isArray(rawParams) ? rawParams : [rawParams];
|
||||
if (!params.length) return '';
|
||||
const name = params[0].axisValue as string;
|
||||
const total = params.reduce((s: number, p: any) => s + (Number(p.value) || 0), 0);
|
||||
const lines = params
|
||||
.filter((p: any) => Number(p.value) > 0)
|
||||
.map((p: any) => `${p.marker}${p.seriesName} <b style="margin-left:6px">${p.value}h</b>`)
|
||||
.join('<br/>');
|
||||
return `<div style="font-weight:600;margin-bottom:4px">${name} · ${total}h</div>${lines}`;
|
||||
const totalHours = Number(params.find((p: any) => p.seriesName === '总工时')?.value ?? 0);
|
||||
const overtimeHours = Number(params.find((p: any) => p.seriesName === '加班工时')?.value ?? 0);
|
||||
return [
|
||||
`<div style="font-weight:600;margin-bottom:4px">${name}</div>`,
|
||||
`总工时:${totalHours}h`,
|
||||
`加班工时:${overtimeHours}h`
|
||||
].join('<br/>');
|
||||
}
|
||||
},
|
||||
// 不显示项目图例:团队参与项目繁杂,图例会很长很乱;项目明细由 tooltip 悬浮呈现
|
||||
grid: { left: 32, right: 12, top: 16, bottom: 24, containLabel: false },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
@@ -281,17 +276,28 @@ function buildTeamBarOption(): ECOption {
|
||||
splitLine: { lineStyle: { color: '#f3f4f6' } },
|
||||
axisLabel: { color: '#9ca3af', fontSize: 10, formatter: '{value}h' }
|
||||
},
|
||||
series: colored.map((s, i) => ({
|
||||
name: s.label,
|
||||
type: 'bar',
|
||||
stack: 'member',
|
||||
barWidth: 22,
|
||||
data: s.data,
|
||||
itemStyle: {
|
||||
color: s.color,
|
||||
borderRadius: i === colored.length - 1 ? [3, 3, 0, 0] : 0
|
||||
series: [
|
||||
{
|
||||
name: '总工时',
|
||||
type: 'bar',
|
||||
barWidth: 16,
|
||||
data: v.members.map(member => member.totalHours),
|
||||
itemStyle: {
|
||||
color: '#409EFF',
|
||||
borderRadius: [3, 3, 0, 0]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '加班工时',
|
||||
type: 'bar',
|
||||
barWidth: 16,
|
||||
data: v.members.map(member => member.overtimeHours),
|
||||
itemStyle: {
|
||||
color: '#F59E0B',
|
||||
borderRadius: [3, 3, 0, 0]
|
||||
}
|
||||
}
|
||||
}))
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -357,7 +363,10 @@ watch(activeTab, async tab => {
|
||||
<div class="ww-section-title">
|
||||
<SvgIcon icon="mdi:calendar-week" class="ww-section-icon" />
|
||||
<span>每日工时</span>
|
||||
<ElTooltip content="系统按填报日期段均摊到工作日的推算值(周末份额计入周五),非逐日实填" placement="top">
|
||||
<ElTooltip
|
||||
content="接口返回周一~周日逐日工时;按周填报时仅均摊到工作日,周末单天工时保留在周末当天展示"
|
||||
placement="top"
|
||||
>
|
||||
<span class="ww-section-info-wrap">
|
||||
<SvgIcon icon="mdi:information-outline" class="ww-section-info" />
|
||||
</span>
|
||||
@@ -417,14 +426,6 @@ watch(activeTab, async tab => {
|
||||
</span>
|
||||
<span class="tw-kpi__sub">低于均值 80%</span>
|
||||
</div>
|
||||
<div class="tw-kpi">
|
||||
<span class="tw-kpi__label">加班</span>
|
||||
<span class="tw-kpi__value" :class="{ 'is-warn': teamView.highCount > 0 }">
|
||||
{{ teamView.highCount }}
|
||||
<span class="tw-kpi__unit">人</span>
|
||||
</span>
|
||||
<span class="tw-kpi__sub">超 {{ teamView.overtimeThreshold }}h</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ref="teamBarRef" class="tw-bar" />
|
||||
@@ -594,7 +595,7 @@ watch(activeTab, async tab => {
|
||||
/* ============ 团队工时 ============ */
|
||||
.tw-kpis {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
margin-bottom: 12px;
|
||||
flex-shrink: 0;
|
||||
@@ -621,9 +622,6 @@ watch(activeTab, async tab => {
|
||||
.tw-kpi__value.is-danger {
|
||||
color: var(--el-color-danger);
|
||||
}
|
||||
.tw-kpi__value.is-warn {
|
||||
color: var(--el-color-warning);
|
||||
}
|
||||
.tw-kpi__unit {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
|
||||
Reference in New Issue
Block a user