diff --git a/src/main/resources/views/layouts/v4/home/stats.js b/src/main/resources/views/layouts/v4/home/stats.js new file mode 100644 index 00000000..d4efb43d --- /dev/null +++ b/src/main/resources/views/layouts/v4/home/stats.js @@ -0,0 +1,196 @@ +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 { + position: absolute; + bottom: 24px; + right: 24px; + /*background: white;*/ + color: #333; + padding: 20px; + border-radius: 12px; + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); + z-index: 10; + width: 680px; + /*border: 1px solid #e8e8e8;*/ + } + + .stats-grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 16px; + } + + .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); + } + + + .stat-icon { + font-size: 20px; + width: 36px; + height: 36px; + 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; + } + + .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; + } + ` +};