lion 2 months ago
parent ce76e0b0f2
commit c6139be9c0

@ -83,6 +83,10 @@
:label="item.name"
:value="item.id"
>
<div style="display: flex; justify-content: space-between;">
<span style="color: #999; font-size: 12px;">{{ item.name }}</span>
<span style="color: #999; font-size: 12px;">{{ item.is_arrange?'需排课':'无需排课' }}</span>
</div>
</el-option>
</el-select>
</div>

@ -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%)`,

@ -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: {

@ -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中已恢复选择状态')
})
})
},

File diff suppressed because it is too large Load Diff

@ -14,7 +14,7 @@
<div v-for="(q, idx) in questionList" :key="q.id" class="question-item">
<div class="question-header">
<span class="question-number">{{ idx+1 }}</span>
<span v-if="q.rule && q.rule.includes('required')" class="required-mark">*</span>
<span v-if="q.rule && q.rule.includes('required')" class="required-mark">*</span>
<span class="question-title">{{ q.name }}</span>
</div>
@ -22,7 +22,7 @@
<template v-if="q.edit_input==='radio'">
<el-radio-group v-model="answers[q.id]" :disabled="previewOnly" class="mobile-radio-group">
<el-radio v-for="(opt, oidx) in q.select_item" :key="oidx" :label="opt"
class="mobile-radio">{{ opt.value }}</el-radio>
class="mobile-radio">{{ opt }}</el-radio>
</el-radio-group>
<el-input v-if="q.allow_input" type="text" v-model="answers[q.id]" :disabled="previewOnly"
:placeholder="q.help||'请输入内容'" class="mobile-textarea" />
@ -30,7 +30,7 @@
<template v-else-if="q.edit_input==='checkbox'">
<el-checkbox-group v-model="answers[q.id]" :disabled="previewOnly" class="mobile-checkbox-group">
<el-checkbox v-for="(opt, oidx) in q.select_item" :key="oidx" :label="opt"
class="mobile-checkbox">{{ opt.value }}</el-checkbox>
class="mobile-checkbox">{{ opt }}</el-checkbox>
</el-checkbox-group>
<el-input v-if="q.allow_input" type="text" v-model="answers[q.id]" :disabled="previewOnly"
:placeholder="q.help||'请输入内容'" class="mobile-textarea" />
@ -46,10 +46,10 @@
<template v-else-if="q.edit_input==='date'">
<el-date-picker v-model="answers[q.id]" :disabled="previewOnly" type="date" :placeholder="q.help||'选择日期'">
</el-date-picker>
</template>
<template v-else-if="q.edit_input==='datetime'">
<el-date-picker v-model="answers[q.id]" :disabled="previewOnly" type="datetime" :placeholder="q.help||'选择日期时间'">
</el-date-picker>
</template>
<template v-else-if="q.edit_input==='datetime'">
<el-date-picker v-model="answers[q.id]" :disabled="previewOnly" type="datetime" :placeholder="q.help||'选择日期时间'">
</el-date-picker>
</template>
<!-- <template v-else-if="q.type==='rate'">
@ -305,4 +305,4 @@
border-radius: 0;
}
}
</style>
</style>

@ -71,7 +71,8 @@ export default {
}
</script>
<style scoped>
.survey-dialog >>> .el-dialog__body { padding:0; }
.survey-dialog >>> .el-dialog__body { padding:0; height: 70vh;
overflow: scroll;}
.results-header { background: #fff; padding: 30px; border-bottom: 1px solid #e9ecef; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.header-content { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.survey-title { font-size: 28px; font-weight: 700; color: #2c3e50; margin-bottom: 12px; }

Loading…
Cancel
Save