diff --git a/src/components/SelectUser.vue b/src/components/SelectUser.vue index 19a24a7..de03b23 100644 --- a/src/components/SelectUser.vue +++ b/src/components/SelectUser.vue @@ -67,7 +67,7 @@ export default { total: 0, selectedUsers: [], currentDepartment: '', - tableHeight: 350, // 设置一个合适的高度 + tableHeight: '350', // 设置一个合适的高度 treeData: [], defaultProps: { children: 'children', diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 2719568..8166da7 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -63,8 +63,8 @@ export default { } ::-webkit-scrollbar { - width: 15px; - height: 15px; + width: 10px; + height: 10px; } ::-webkit-scrollbar-track { @@ -72,7 +72,7 @@ export default { } ::-webkit-scrollbar-thumb { - background-color: #c0c0c0; + background-color: #d2d1d1; border-radius: 5px; } diff --git a/src/views/project/list.vue b/src/views/project/list.vue index 12b7268..c86b872 100644 --- a/src/views/project/list.vue +++ b/src/views/project/list.vue @@ -51,7 +51,7 @@ :show-index="true" @size-change="handleSizeChange" @current-change="handleCurrentChange" - tableHeight="600" + tableHeight="80%" > @@ -220,7 +223,11 @@ export default { res.data.startDate.split(" ")[0] + " 00:00:00"; this.projectInfo.endDate = res.data.endDate.split(" ")[0] + " 23:59:59"; - this.selectedDate = new Date(this.projectInfo.startDate); // 设置为项目开始时间 + if (this.projectInfo.userId == this.$store.state.user.id) { + this.selectedDate = new Date(); + } else { + this.selectedDate = new Date(this.projectInfo.startDate); // 设置为项目开始时间 + } const res2 = await workLogApi.getLogData({ projectId: this.projectInfo.projectId, @@ -254,7 +261,6 @@ export default { this.$modal.msgWarning("请先选择一个项目"); return; } - this.handleProjectClick(this.projectInfo); const clickedDate = new Date(data.day); const currentDate = new Date(); @@ -289,9 +295,15 @@ export default { projectId: this.projectInfo.projectId, loggerDate: this.logForm.loggerDate, }); - this.logForm.workTime = res.data.workTime; - this.logForm.workContent = res.data.workContent; - this.logForm.loggerId = res.data.loggerId; + if (res.data) { + this.logForm.workTime = res.data.workTime; + this.logForm.workContent = res.data.workContent; + this.logForm.loggerId = res.data.loggerId; + } else { + this.logForm.workTime = ""; + this.logForm.workContent = ""; + this.logForm.loggerId = ""; + } } else { this.logForm.workTime = ""; this.logForm.workContent = ""; @@ -300,9 +312,32 @@ export default { const res = await workLogApi.getDayTime({ loggerDate: this.logForm.loggerDate, }); + this.logForm.max = Number(res.data) + (Number(this.logForm.workTime) || 0); this.logDialogVisible = true; + this.$nextTick(() => { + this.changeMonth(); + }); + }, + changeMonth() { + let that = this; + this.$nextTick(async () => { + const res2 = await workLogApi.getLogData({ + projectId: that.projectInfo.projectId, + startDate: + that + .moment(that.selectedDate) + .startOf("month") + .format("YYYY-MM-DD") + " 00:00:00", + endDate: + that.moment(that.selectedDate).endOf("month").format("YYYY-MM-DD") + + " 23:59:59", + userId: that.projectInfo.userId, + }); + that.logData = res2.data; + that.initDateColor(1); + }); }, isInProjectRange(data) { if (!this.projectInfo) return false; @@ -511,22 +546,30 @@ export default { color: white; /* 白色文字 */ padding: 5px 0; /* 增加一些内边距 */ } - +.project-info-calendar ::v-deep .el-calendar__body th{ + height: 60px !important; + font-weight: bold !important; + font-size: 20px; +} .project-info-calendar .calendar-view ::v-deep .el-calendar-day { - height: 65px; /* 增加日期单元格高度(原高度 + 5px) */ + height: 85px; /* 增加日期单元格高度(原高度 + 5px) */ // padding-top: 5px; - padding: 3px; + padding: 10px; + border-radius: 10px; } .project-info-calendar .calendar-view ::v-deep .el-calendar-day.disabled { cursor: not-allowed; } - +.project-info-calendar .calendar-view ::v-deep table *{ +border: none; +} .project-info-calendar .calendar-view ::v-deep .date-cell { cursor: pointer; height: 100%; text-align: center; - line-height: 55px; + line-height: 65px; + border-radius: 10px; } .project-info-calendar .calendar-view ::v-deep .in-range { @@ -534,7 +577,7 @@ export default { } .project-info-calendar .calendar-view ::v-deep .out-range { - background-color: rgba(0, 0, 0, 0.05) !important; + background-color: rgba(0, 0, 0, 0.1) !important; } .project-info-calendar .calendar-view ::v-deep .disabled {