diff --git a/src/views/calendar/components/addCalendar.vue b/src/views/calendar/components/addCalendar.vue index 9987434..485c060 100644 --- a/src/views/calendar/components/addCalendar.vue +++ b/src/views/calendar/components/addCalendar.vue @@ -83,6 +83,10 @@ :label="item.name" :value="item.id" > +
+ {{ item.name }} + {{ item.is_arrange?'需排课':'无需排课' }} +
diff --git a/src/views/calendar/index.vue b/src/views/calendar/index.vue index 44328af..103be8d 100644 --- a/src/views/calendar/index.vue +++ b/src/views/calendar/index.vue @@ -334,9 +334,9 @@ import addCalendar from './components/addCalendar.vue' : (adjStart.getDay() - FIRST_DOW + 7) % 7 const cellWidth = 100 / 7 - const cellHeight = 100 + const cellHeight = 120 // 调整格子高度,确保有足够空间 const headerHeight = 50 - const dateNumberHeight = 25 + const dateNumberHeight = 40 // 调整日期数字高度,确保有足够空间 const eventHeight = 16 const eventSpacing = 2 const verticalOffset = (event.laneIndex || 0) * (eventHeight + eventSpacing) @@ -344,7 +344,7 @@ import addCalendar from './components/addCalendar.vue' return { position: 'absolute', left: `calc(${startColAdjusted * cellWidth}% + 2px)`, - top: `${headerHeight + weekRow * cellHeight + dateNumberHeight + verticalOffset}px`, + top: `${headerHeight + weekRow * cellHeight + dateNumberHeight + 25 + verticalOffset}px`, // 增加偏移量到25px,确保课程标题完全在日期数字下方 width: `calc(${event.spanCols * cellWidth}% - 4px)`, height: `${eventHeight}px`, zIndex: 1000, @@ -417,7 +417,7 @@ import addCalendar from './components/addCalendar.vue' return { position: 'absolute', left: '0', - top: '1px', + top: '105px', // 使用固定值:headerHeight(50) + dateNumberHeight(40) + 15px = 105px,确保完全在日期数字下方 width: `calc(${spanDays * 100}% - 2px)`, zIndex: 10, background: `linear-gradient(90deg, ${bgColor} 0%, ${this.darkenColor(bgColor)} 100%)`, diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 2c2ce89..83f6e53 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -274,6 +274,7 @@ this.pieChartInstance = echarts.init(this.$refs.pieChart) const option = { + backgroundColor: 'rgba(14, 87, 180, 0.1)', tooltip: { trigger: 'item', formatter: '{b}: {c}人 ({d}%)', @@ -381,7 +382,7 @@ map: 'suzhou', roam: false, zlevel: 1, - zoom: 1.0, + zoom: 0.95, center: [120.65, 31.32], data: this.mapData.map(item => ({ name: item.name, @@ -393,10 +394,12 @@ } : undefined })), itemStyle: { - borderColor: 'transparent', - borderWidth: 5, - shadowBlur: 2, - shadowColor: 'rgba(0, 0, 0, 0.3)' + borderColor: '#ffffff', + borderWidth: 2, + shadowBlur: 4, + shadowColor: 'rgba(0, 0, 0, 0.4)', + shadowOffsetX: 1, + shadowOffsetY: 1 }, emphasis: { itemStyle: { diff --git a/src/views/email/index.vue b/src/views/email/index.vue index c26b4ac..9b45d6f 100644 --- a/src/views/email/index.vue +++ b/src/views/email/index.vue @@ -1538,8 +1538,8 @@ export default { } return [ - student.name, - student.email, + student.name, + student.email, courseInfo, student.company || '', student.company_position || '' @@ -1638,22 +1638,22 @@ export default { // 课程选择变化处理 handleCourseChange() { // 切换具体课程时,重置分页并刷新 - this.selectedSystemStudents = [] - this.currentPage = 1 - this.loadStudents() + this.selectedSystemStudents = [] + this.currentPage = 1 + this.loadStudents() }, // 加载学员数据 loadStudents() { this.studentsLoading = true // 构建与学员列表一致的查询参数 - const params = { - page: this.currentPage, - page_size: this.pageSize - } - if (this.systemStudentSearch && this.systemStudentSearch.trim()) { - params.keyword = this.systemStudentSearch.trim() - } + const params = { + page: this.currentPage, + page_size: this.pageSize + } + if (this.systemStudentSearch && this.systemStudentSearch.trim()) { + params.keyword = this.systemStudentSearch.trim() + } if (this.selectedCourse) { params.course_id = this.selectedCourse } @@ -1662,69 +1662,69 @@ export default { } indexStudy(params).then(res => { - // 保存当前的选择状态 - const currentSelection = [...this.selectedSystemStudents] - console.log('保存当前选择状态:', currentSelection.length) - console.log('当前总选择数组:', this.allSelectedStudents) - - // 将当前页选择添加到总选择数组,并去重 - if (currentSelection.length > 0) { - currentSelection.forEach(student => { - // 检查是否已存在相同ID的学员 - const isDuplicate = this.allSelectedStudents.some(existing => Number(existing.id) === Number(student.id)) - if (!isDuplicate) { - this.allSelectedStudents.push(student) - console.log(`✅ 新增学员到总选择: ${student.name} (ID: ${student.id})`) - } else { - console.log(`❌ 跳过重复学员: ${student.name} (ID: ${student.id})`) - } - }) - } - - console.log('去重后的总选择数组:', this.allSelectedStudents) + // 保存当前的选择状态 + const currentSelection = [...this.selectedSystemStudents] + console.log('保存当前选择状态:', currentSelection.length) + console.log('当前总选择数组:', this.allSelectedStudents) + + // 将当前页选择添加到总选择数组,并去重 + if (currentSelection.length > 0) { + currentSelection.forEach(student => { + // 检查是否已存在相同ID的学员 + const isDuplicate = this.allSelectedStudents.some(existing => Number(existing.id) === Number(student.id)) + if (!isDuplicate) { + this.allSelectedStudents.push(student) + console.log(`✅ 新增学员到总选择: ${student.name} (ID: ${student.id})`) + } else { + console.log(`❌ 跳过重复学员: ${student.name} (ID: ${student.id})`) + } + }) + } + + console.log('去重后的总选择数组:', this.allSelectedStudents) // 处理API返回的数据(与学员列表一致的结构) const listData = res.list && Array.isArray(res.list.data) ? res.list.data : [] if (Array.isArray(listData)) { - // 处理API返回的数据,确保包含必要的字段 + // 处理API返回的数据,确保包含必要的字段 console.log('开始处理学员数据,数量:', listData.length) this.students = listData.map(student => { - // 获取最新的课程信息 - let courseName = '' - let courseStartDate = '' - let courseEndDate = '' - - if (student.course_signs && student.course_signs.length > 0) { - // 按时间排序,获取最新的一条课程记录 - const sortedSigns = student.course_signs.sort((a, b) => { - const dateA = new Date(a.created_at || a.createdAt || a.sign_date || 0) - const dateB = new Date(b.created_at || b.createdAt || b.sign_date || 0) - return dateB - dateA // 降序排列,最新的在前 - }) - const latestSign = sortedSigns[0] - - // 从course对象中获取课程信息 - if (latestSign.course && latestSign.course.name) { - courseName = latestSign.course.name - courseStartDate = latestSign.course.start_date || '' - courseEndDate = latestSign.course.end_date || '' - } else { - // 备用方案:从sign记录本身获取 - courseName = latestSign.course_name || latestSign.course || latestSign.courseName || '' - } - } else { - // 如果没有course_signs,使用备用字段 - courseName = student.course_name || student.course || '' - } + // 获取最新的课程信息 + let courseName = '' + let courseStartDate = '' + let courseEndDate = '' + + if (student.course_signs && student.course_signs.length > 0) { + // 按时间排序,获取最新的一条课程记录 + const sortedSigns = student.course_signs.sort((a, b) => { + const dateA = new Date(a.created_at || a.createdAt || a.sign_date || 0) + const dateB = new Date(b.created_at || b.createdAt || b.sign_date || 0) + return dateB - dateA // 降序排列,最新的在前 + }) + const latestSign = sortedSigns[0] + + // 从course对象中获取课程信息 + if (latestSign.course && latestSign.course.name) { + courseName = latestSign.course.name + courseStartDate = latestSign.course.start_date || '' + courseEndDate = latestSign.course.end_date || '' + } else { + // 备用方案:从sign记录本身获取 + courseName = latestSign.course_name || latestSign.course || latestSign.courseName || '' + } + } else { + // 如果没有course_signs,使用备用字段 + courseName = student.course_name || student.course || '' + } - return { - id: student.id, - name: student.name || student.real_name || '', - email: student.email || '-', - company: student.company_name || student.work_unit || '', - phone: student.phone || student.mobile || '', - department: student.department || '', - courseName: courseName, - courseStartDate: courseStartDate, + return { + id: student.id, + name: student.name || student.real_name || '', + email: student.email || '-', + company: student.company_name || student.work_unit || '', + phone: student.phone || student.mobile || '', + department: student.department || '', + courseName: courseName, + courseStartDate: courseStartDate, courseEndDate: courseEndDate, course_signs: student.course_signs || [], company_position: student.company_position || '' @@ -1737,96 +1737,96 @@ export default { this.currentPage = res.list.current_page || 1 this.pageSize = res.list.per_page || this.pageSize } - console.log('数据处理完成,this.students长度:', this.students.length) - console.log('分页信息更新:', { - total: this.totalStudents, - currentPage: this.currentPage, - pageSize: this.pageSize - }) - - // 恢复选择状态 - this.$nextTick(() => { - this.selectedSystemStudents = currentSelection - console.log('已恢复选择状态,数量:', this.selectedSystemStudents.length) - - // 恢复表格的视觉勾选状态 - console.log('开始恢复表格勾选状态...') - console.log('当前页学员数据:', this.students.map(s => ({ id: s.id, name: s.name }))) - console.log('当前页选择:', currentSelection.map(s => ({ id: s.id, name: s.name }))) - console.log('总选择数组:', this.allSelectedStudents.map(s => ({ id: s.id, name: s.name }))) + console.log('数据处理完成,this.students长度:', this.students.length) + console.log('分页信息更新:', { + total: this.totalStudents, + currentPage: this.currentPage, + pageSize: this.pageSize + }) - // 恢复当前页的选择状态 - if (currentSelection.length > 0) { - currentSelection.forEach(selectedStudent => { - // 在当前页数据中查找对应的学员 - const studentInCurrentPage = this.students.find(student => Number(student.id) === Number(selectedStudent.id)) - if (studentInCurrentPage) { - // 使用 Element UI 的方法设置勾选状态 - this.$refs.systemStudentTable.toggleRowSelection(studentInCurrentPage, true) - console.log(`✅ 已勾选学员: ${studentInCurrentPage.name} (ID: ${studentInCurrentPage.id})`) - } else { - console.log(`❌ 未找到学员: ${selectedStudent.name} (ID: ${selectedStudent.id})`) + // 恢复选择状态 + this.$nextTick(() => { + this.selectedSystemStudents = currentSelection + console.log('已恢复选择状态,数量:', this.selectedSystemStudents.length) + + // 恢复表格的视觉勾选状态 + console.log('开始恢复表格勾选状态...') + console.log('当前页学员数据:', this.students.map(s => ({ id: s.id, name: s.name }))) + console.log('当前页选择:', currentSelection.map(s => ({ id: s.id, name: s.name }))) + console.log('总选择数组:', this.allSelectedStudents.map(s => ({ id: s.id, name: s.name }))) + + // 恢复当前页的选择状态 + if (currentSelection.length > 0) { + currentSelection.forEach(selectedStudent => { + // 在当前页数据中查找对应的学员 + const studentInCurrentPage = this.students.find(student => Number(student.id) === Number(selectedStudent.id)) + if (studentInCurrentPage) { + // 使用 Element UI 的方法设置勾选状态 + this.$refs.systemStudentTable.toggleRowSelection(studentInCurrentPage, true) + console.log(`✅ 已勾选学员: ${studentInCurrentPage.name} (ID: ${studentInCurrentPage.id})`) + } else { + console.log(`❌ 未找到学员: ${selectedStudent.name} (ID: ${selectedStudent.id})`) + } + }) + } + + // 恢复总选择数组中在当前页显示的选择状态 + this.students.forEach(student => { + const isInAllSelected = this.allSelectedStudents.some(selected => Number(selected.id) === Number(student.id)) + const isInCurrentSelection = currentSelection.some(selected => Number(selected.id) === Number(student.id)) + + if (isInAllSelected && !isInCurrentSelection) { + // 这个学员在总选择数组中,但不在当前页选择中,需要勾选 + this.$refs.systemStudentTable.toggleRowSelection(student, true) + console.log(`✅ 从总选择恢复勾选: ${student.name} (ID: ${student.id})`) } }) - } - - // 恢复总选择数组中在当前页显示的选择状态 - this.students.forEach(student => { - const isInAllSelected = this.allSelectedStudents.some(selected => Number(selected.id) === Number(student.id)) - const isInCurrentSelection = currentSelection.some(selected => Number(selected.id) === Number(student.id)) - if (isInAllSelected && !isInCurrentSelection) { - // 这个学员在总选择数组中,但不在当前页选择中,需要勾选 - this.$refs.systemStudentTable.toggleRowSelection(student, true) - console.log(`✅ 从总选择恢复勾选: ${student.name} (ID: ${student.id})`) - } + console.log('表格勾选状态恢复完成') }) - - console.log('表格勾选状态恢复完成') - }) - } else { - this.students = [] + } else { + this.students = [] if (res.list) { if (res.list.total !== undefined) this.totalStudents = res.list.total if (res.list.current_page !== undefined) this.currentPage = res.list.current_page if (res.list.per_page !== undefined) this.pageSize = res.list.per_page } if (Array.isArray(listData) && listData.length === 0) { - this.$message.warning('当前页暂无学员数据') + this.$message.warning('当前页暂无学员数据') + } } - } - }).catch(error => { - console.error('加载学员数据失败:', error) - this.$message.error('加载学员数据失败') - // 加载失败时使用空数组 - this.students = [] - }).finally(() => { - this.studentsLoading = false - - // 恢复之前的选择状态 - this.$nextTick(() => { - console.log('在finally中恢复选择状态...') - console.log('当前页学员:', this.students.map(s => ({ id: s.id, name: s.name }))) - console.log('当前页选择:', this.selectedSystemStudents.map(s => ({ id: s.id, name: s.name }))) - console.log('总选择数组:', this.allSelectedStudents.map(s => ({ id: s.id, name: s.name }))) + }).catch(error => { + console.error('加载学员数据失败:', error) + this.$message.error('加载学员数据失败') + // 加载失败时使用空数组 + this.students = [] + }).finally(() => { + this.studentsLoading = false - // 恢复所有应该勾选的学员(包括当前页选择和总选择数组中的) - this.students.forEach(student => { - const isInCurrentSelection = this.selectedSystemStudents.some(selected => Number(selected.id) === Number(student.id)) - const isInAllSelected = this.allSelectedStudents.some(selected => Number(selected.id) === Number(student.id)) + // 恢复之前的选择状态 + this.$nextTick(() => { + console.log('在finally中恢复选择状态...') + console.log('当前页学员:', this.students.map(s => ({ id: s.id, name: s.name }))) + console.log('当前页选择:', this.selectedSystemStudents.map(s => ({ id: s.id, name: s.name }))) + console.log('总选择数组:', this.allSelectedStudents.map(s => ({ id: s.id, name: s.name }))) - if (isInCurrentSelection || isInAllSelected) { - // 使用 Element UI 的表格方法设置选择状态 - this.$refs.systemStudentTable.toggleRowSelection(student, true) - if (isInCurrentSelection) { - console.log(`✅ 在finally中恢复当前页勾选: ${student.name} (ID: ${student.id})`) - } else { - console.log(`✅ 在finally中恢复总选择勾选: ${student.name} (ID: ${student.id})`) + // 恢复所有应该勾选的学员(包括当前页选择和总选择数组中的) + this.students.forEach(student => { + const isInCurrentSelection = this.selectedSystemStudents.some(selected => Number(selected.id) === Number(student.id)) + const isInAllSelected = this.allSelectedStudents.some(selected => Number(selected.id) === Number(student.id)) + + if (isInCurrentSelection || isInAllSelected) { + // 使用 Element UI 的表格方法设置选择状态 + this.$refs.systemStudentTable.toggleRowSelection(student, true) + if (isInCurrentSelection) { + console.log(`✅ 在finally中恢复当前页勾选: ${student.name} (ID: ${student.id})`) + } else { + console.log(`✅ 在finally中恢复总选择勾选: ${student.name} (ID: ${student.id})`) + } } - } + }) + console.log('finally中已恢复选择状态') }) - console.log('finally中已恢复选择状态') - }) }) }, diff --git a/src/views/survey/components/SurveyCreateWizard.vue b/src/views/survey/components/SurveyCreateWizard.vue index 3f45aba..09dd375 100644 --- a/src/views/survey/components/SurveyCreateWizard.vue +++ b/src/views/survey/components/SurveyCreateWizard.vue @@ -1,502 +1,502 @@ - - - - - + + + + + diff --git a/src/views/survey/components/SurveyFillDialog.vue b/src/views/survey/components/SurveyFillDialog.vue index ef09c47..9c65acd 100644 --- a/src/views/survey/components/SurveyFillDialog.vue +++ b/src/views/survey/components/SurveyFillDialog.vue @@ -14,7 +14,7 @@
{{ idx+1 }} - * + * {{ q.name }}
@@ -22,7 +22,7 @@