const stats = { template: /*language=HTML*/ `
待办
{{ stats.todoCount }}
已办
{{ stats.doneCount }}
消息
{{ stats.notifications }}
发起
{{ stats.startedCount }}
`, data() { return { stats: { todoCount: 0, doneCount: 0, notifications: 0, startedCount: 0 } } }, methods: { handleStatClick(type) { if (['todo', 'done', 'started'].includes(type)) { window.open('/flow/todoCenter?status=' + type) } else if (type === 'notification') { window.open('/platform/v4/msg') } }, onMouseEnter(event) { event.target.style.transform = 'translateY(-2px)'; event.target.style.boxShadow = '0 4px 12px rgba(0,0,0,0.15)'; }, onMouseLeave(event) { event.target.style.transform = 'none'; event.target.style.boxShadow = '0 2px 6px rgba(0,0,0,0.08)'; }, loadStats() { this.$axios.post("/flow/todoCenter/statistics").then(res => { if (res.code === 0) { this.stats = res.data; } }) } }, mounted() { this.loadStats(); }, style: /*language=CSS*/ ` /* 右侧统计区域 */ .stats-section { /*background: white;*/ color: #333; padding: 20px; border-radius: 12px; z-index: 10; width: 80%; display: flex; justify-content: space-between; align-items: center; margin: -130px auto 0; /*border: 1px solid #e8e8e8;*/ } .stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; width: 32%; margin-left: 20px; } .stat-item { background: #f8f9fa; color: #495057; padding: 14px; border-radius: 8px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.08); width: 100%; height: 90px; } .stat-icon { font-size: 30px; width: 50px; height: 50px; background: #e6f7ff; color: #1890ff; border-radius: 50%; display: flex; align-items: center; justify-content: center; } .stat-item.pending .stat-icon, .stat-item.completed .stat-icon, .stat-item.messages .stat-icon, .stat-item.reminders .stat-icon { background: #e6f7ff; color: #1890ff; } .stat-item.completed .stat-icon { color: #52c41a; } .stat-item.messages .stat-icon { color: #faad14; } .stat-item.reminders .stat-icon { color: #13c2c2; } .stat-content { display: flex; flex-direction: column; margin-left: 10px; } .stat-label { font-size: 15px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; } .stat-number { font-size: 18px; font-weight: bold; margin-top: 2px; } .stats-family { width: 68%; } .stats-family img { height: 190px !important; border-radius: 30px; } ` };