feat: add total waste card to dashboard and import 22 real users
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6ac44d47fb
commit
8aa8b805a4
Binary file not shown.
@ -93,8 +93,12 @@ def get_dashboard(
|
|||||||
|
|
||||||
# 损耗排行
|
# 损耗排行
|
||||||
waste_ranking = []
|
waste_ranking = []
|
||||||
|
total_waste_seconds_all = 0.0
|
||||||
|
total_target_seconds_all = 0.0
|
||||||
for p in active + completed:
|
for p in active + completed:
|
||||||
w = calc_waste_for_project(p.id, db)
|
w = calc_waste_for_project(p.id, db)
|
||||||
|
total_waste_seconds_all += w.get("total_waste_seconds", 0)
|
||||||
|
total_target_seconds_all += p.target_total_seconds or 0
|
||||||
if w.get("total_waste_seconds", 0) > 0:
|
if w.get("total_waste_seconds", 0) > 0:
|
||||||
waste_ranking.append({
|
waste_ranking.append({
|
||||||
"project_id": p.id,
|
"project_id": p.id,
|
||||||
@ -103,6 +107,7 @@ def get_dashboard(
|
|||||||
"waste_rate": w["waste_rate"],
|
"waste_rate": w["waste_rate"],
|
||||||
})
|
})
|
||||||
waste_ranking.sort(key=lambda x: x["waste_rate"], reverse=True)
|
waste_ranking.sort(key=lambda x: x["waste_rate"], reverse=True)
|
||||||
|
total_waste_rate = round(total_waste_seconds_all / total_target_seconds_all * 100, 1) if total_target_seconds_all > 0 else 0
|
||||||
|
|
||||||
# 已结算项目
|
# 已结算项目
|
||||||
settled = []
|
settled = []
|
||||||
@ -206,6 +211,8 @@ def get_dashboard(
|
|||||||
"monthly_total_seconds": round(monthly_secs, 1),
|
"monthly_total_seconds": round(monthly_secs, 1),
|
||||||
"avg_daily_seconds_per_person": avg_daily,
|
"avg_daily_seconds_per_person": avg_daily,
|
||||||
"projects": project_summaries,
|
"projects": project_summaries,
|
||||||
|
"total_waste_seconds": round(total_waste_seconds_all, 0),
|
||||||
|
"total_waste_rate": total_waste_rate,
|
||||||
"waste_ranking": waste_ranking,
|
"waste_ranking": waste_ranking,
|
||||||
"settled_projects": settled,
|
"settled_projects": settled,
|
||||||
"profitability": profitability,
|
"profitability": profitability,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dashboard" v-loading="loading">
|
<div class="dashboard" v-loading="loading">
|
||||||
<!-- 顶部统计卡片 -->
|
<!-- 顶部统计卡片 -->
|
||||||
<div class="stat-grid six">
|
<div class="stat-grid">
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<div class="stat-icon blue"><el-icon :size="20"><FolderOpened /></el-icon></div>
|
<div class="stat-icon blue"><el-icon :size="20"><FolderOpened /></el-icon></div>
|
||||||
<div class="stat-body">
|
<div class="stat-body">
|
||||||
@ -52,6 +52,17 @@
|
|||||||
<div class="stat-label">利润率</div>
|
<div class="stat-label">利润率</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="stat-icon" :class="(data.total_waste_rate || 0) > 20 ? 'red' : 'orange'">
|
||||||
|
<el-icon :size="20"><WarnTriangleFilled /></el-icon>
|
||||||
|
</div>
|
||||||
|
<div class="stat-body">
|
||||||
|
<div class="stat-value" :style="{color: (data.total_waste_rate || 0) > 20 ? '#FF3B30' : '#FF9500'}">
|
||||||
|
{{ data.total_waste_rate || 0 }}%
|
||||||
|
</div>
|
||||||
|
<div class="stat-label">总损耗率({{ formatSecs(data.total_waste_seconds) }})</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 图表行:产出趋势 + 成本构成 -->
|
<!-- 图表行:产出趋势 + 成本构成 -->
|
||||||
@ -329,8 +340,7 @@ onUnmounted(() => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
/* 统计网格 */
|
/* 统计网格 */
|
||||||
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
|
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
|
||||||
.stat-grid.six { grid-template-columns: repeat(6, 1fr); }
|
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
|
||||||
@media (max-width: 1200px) { .stat-grid.six { grid-template-columns: repeat(3, 1fr); } }
|
|
||||||
.stat-card {
|
.stat-card {
|
||||||
background: var(--bg-card); border: 1px solid var(--border-color);
|
background: var(--bg-card); border: 1px solid var(--border-color);
|
||||||
border-radius: var(--radius-md); padding: 20px; display: flex; align-items: center; gap: 16px;
|
border-radius: var(--radius-md); padding: 20px; display: flex; align-items: center; gap: 16px;
|
||||||
|
|||||||
23
人员清单.md
Normal file
23
人员清单.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
序号 姓名 职级 职位 工资 社保
|
||||||
|
1 胡皓南 主管 总导演 15929.52 1904.11
|
||||||
|
2 邓庆瑞 主管 AI导演 12429.52 1904.11
|
||||||
|
3 邱绍辉 主管 制片 9429.52 1,904.11
|
||||||
|
4 陈保丹 组长 动画制作 6729.52 2,159.11
|
||||||
|
5 代晓倩 组员 动画制作 4000 1,904.11
|
||||||
|
6 谭如平 组员 动画制作 3000 1,904.11
|
||||||
|
7 马若情 组长 AI导演 4000 1,904.11
|
||||||
|
8 郑奕晴 组员 动画制作 3000 1,904.11
|
||||||
|
9 韦春利 组长 AI导演 4000 1,904.11
|
||||||
|
10 黄雪雯 组员 动画制作 3000
|
||||||
|
11 潘梓彦 组长 剪辑 5000 1,904.11
|
||||||
|
12 刘诗琪 组员 动画制作 3000 1,904.11
|
||||||
|
13 戴玮 组员 动画制作 3000 1,904.11
|
||||||
|
14 黄溶莹 组员 编剧 3000 11.02
|
||||||
|
15 贾浩正 组员 剪辑 3000 11.02
|
||||||
|
16 王炎森 组员 剪辑 3000 11.02
|
||||||
|
17 黄秋霞 组员 动画制作 3000 11.02
|
||||||
|
18 李晶 组员 动画制作 3000 11.02
|
||||||
|
19 叶美莲 组员 动画制作 3000 11.02
|
||||||
|
20 陈煊颖 组员 动画制作 3000 11.02
|
||||||
|
21 土豆 Owner CTO 10000 1,904.11
|
||||||
|
22 青椒 Owner CEO 10000 1,904.11
|
||||||
Loading…
x
Reference in New Issue
Block a user