diff --git a/ruoyi-ui/src/views/oa/attendance/index.vue b/ruoyi-ui/src/views/oa/attendance/index.vue index 69920cc..22b178d 100644 --- a/ruoyi-ui/src/views/oa/attendance/index.vue +++ b/ruoyi-ui/src/views/oa/attendance/index.vue @@ -2,51 +2,80 @@
- - -
- 签到表 - - - - + - - - - - - - - - - - - - -
- {{ index + 1 }} -
{{ item.nickName }} - {{ item.attendances.length > 0 && item.attendances.findIndex(i => i.attendanceDay === index2 + 1) > -1 && item.attendances[item.attendances.findIndex(i => i.attendanceDay === index2 + 1)].projectId === 0 ? '出差' : '' }} -
+ +
+ + + + + + + + + + + + + +
姓名 + {{ index + 1 }} +
+ {{ user.nickName }} + + {{ + user.attendances.length > 0 && + user.attendances.findIndex(i => i.attendanceDay === dayIndex + 1) > -1 && + user.attendances[user.attendances.findIndex(i => i.attendanceDay === dayIndex + 1)].projectId === 0 + ? '出差' + : '' + }} +
+
+
+
+
出差 +
+
+
当前选中 +
+
- 操作栏 + +
+ + 操作栏 +
+
取消操作 出差 @@ -335,7 +364,7 @@ export default { calcResultUser: {}, calcResultAttendances: [], calcResultProject: {}, - projects:[] + projects: [] } }, @@ -362,8 +391,36 @@ export default { methods: { + // 获取单元格的样式 + getCellStyle(user, dayIndex) { + const attendanceIndex = user.attendances.findIndex( + (i) => i.attendanceDay === dayIndex + ); + if (attendanceIndex > -1) { + const attendance = user.attendances[attendanceIndex]; + // 如果存在签到记录,使用对应项目的颜色 + return { + backgroundColor: attendance.color || '#fdf6e4', + color: '#000', // 确保文字可读性 + }; + } + // 如果是当前选中的用户或列,应用高亮样式 + if ( + this.selectIndex === dayIndex && + (user.userId === this.selectUser.userId || this.selectAll) + ) { + return { + backgroundColor: '#f3ff52', + }; + } + // 默认单元格样式 + return { + backgroundColor: '#fff', + }; + }, + // 获取条形图数据 - getProjectData(){ + getProjectData() { projectData().then(res => { this.projects = res.data; }) @@ -511,59 +568,124 @@ export default { }; diff --git a/ruoyi-ui/src/views/oa/oaFile/index.vue b/ruoyi-ui/src/views/oa/oaFile/index.vue index 1018f5d..518c602 100644 --- a/ruoyi-ui/src/views/oa/oaFile/index.vue +++ b/ruoyi-ui/src/views/oa/oaFile/index.vue @@ -1,7 +1,7 @@