|
|
@@ -65,11 +65,26 @@
|
|
|
<el-card shadow="never">
|
|
|
<template #header>
|
|
|
<div class="card-header">
|
|
|
- <span>指标模块</span>
|
|
|
+ <span>指标模块 </span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<el-table :data="form.selfScoreList" border style="width: 100%">
|
|
|
- <el-table-column label="指标名称" prop="indicatorName" min-width="120" />
|
|
|
+ <el-table-column label="指标名称" prop="indicatorName" min-width="120">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="indicator-name-cell">
|
|
|
+ <span>{{ scope.row.indicatorName }}</span>
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ size="small"
|
|
|
+ :icon="View"
|
|
|
+ circle
|
|
|
+ @click="handleViewIndicatorData(scope.row)"
|
|
|
+ title="查看学生数据"
|
|
|
+ class="indicator-data-btn"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="指标编码" prop="indicatorCode" min-width="100" />
|
|
|
<el-table-column label="指标说明" prop="indicatorDescription" min-width="150" show-overflow-tooltip />
|
|
|
<el-table-column label="最高分值" prop="planMaxScore" min-width="80" />
|
|
|
@@ -351,17 +366,29 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 指标数据详情弹窗 -->
|
|
|
+ <IndicatorDataDialog
|
|
|
+ ref="indicatorDataDialogRef"
|
|
|
+ :indicator-id="currentIndicatorData.indicatorId"
|
|
|
+ :indicator-name="currentIndicatorData.indicatorName"
|
|
|
+ :student-id="form.studentId"
|
|
|
+ :schedule-id="form.scheduleId"
|
|
|
+ :data-start-time="form.dataStartTime"
|
|
|
+ :data-end-time="form.dataEndTime"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
<script setup name="AssessmentApplicationForm" lang="ts">
|
|
|
-import { ref, reactive, toRefs, getCurrentInstance, ComponentInternalInstance, computed } from 'vue';
|
|
|
+import { ref, reactive, toRefs, getCurrentInstance, ComponentInternalInstance, computed, nextTick } from 'vue';
|
|
|
import ElMessage from 'element-plus/es/components/message/index';
|
|
|
import ElMessageBox from 'element-plus/es/components/message-box/index';
|
|
|
import ElLoading from 'element-plus/es/components/loading/index';
|
|
|
-import { UploadFilled, Document, Loading, Download, Delete, QuestionFilled } from '@element-plus/icons-vue';
|
|
|
+import { UploadFilled, Document, Loading, Download, Delete, QuestionFilled, View } from '@element-plus/icons-vue';
|
|
|
import { getToken } from '@/utils/auth';
|
|
|
import ImagePreview from '@/components/ImagePreview/index.vue';
|
|
|
import request from '@/utils/request';
|
|
|
+import IndicatorDataDialog from './IndicatorDataDialog.vue';
|
|
|
import {
|
|
|
addAssessmentApplication,
|
|
|
updateAssessmentApplication,
|
|
|
@@ -397,6 +424,8 @@ interface XskhAssessmentApplicationApprovalForm {
|
|
|
selfScoreList?: XskhAssessmentSelfScoreForm[];
|
|
|
bonusApprovalList?: XskhAssessmentBonusApprovalForm[];
|
|
|
teacherApprovalRemark?: string; // 新增:班主任审核备注
|
|
|
+ dataStartTime?: string;
|
|
|
+ dataEndTime?: string;
|
|
|
}
|
|
|
|
|
|
interface XskhAssessmentSelfScoreForm {
|
|
|
@@ -438,6 +467,8 @@ interface AssessmentScheduleOption {
|
|
|
scheduleDescription: string;
|
|
|
startTime: string;
|
|
|
endTime: string;
|
|
|
+ dataStartTime: string;
|
|
|
+ dataEndTime: string;
|
|
|
status: string;
|
|
|
statusName: string;
|
|
|
}
|
|
|
@@ -455,10 +486,17 @@ declare global {
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
const assessmentApplicationFormRef = ref();
|
|
|
+const indicatorDataDialogRef = ref();
|
|
|
|
|
|
// 添加页面加载状态
|
|
|
const pageLoading = ref(false);
|
|
|
|
|
|
+// 当前指标数据
|
|
|
+const currentIndicatorData = reactive({
|
|
|
+ indicatorId: undefined as string | number | undefined,
|
|
|
+ indicatorName: ''
|
|
|
+});
|
|
|
+
|
|
|
const dialog = reactive({
|
|
|
visible: false,
|
|
|
title: ''
|
|
|
@@ -506,7 +544,9 @@ const initFormData: XskhAssessmentApplicationApprovalForm = {
|
|
|
selfRemark: undefined,
|
|
|
selfScoreList: [],
|
|
|
bonusApprovalList: [],
|
|
|
- teacherApprovalRemark: undefined // 初始化班主任审核备注
|
|
|
+ teacherApprovalRemark: undefined, // 初始化班主任审核备注
|
|
|
+ dataStartTime: undefined,
|
|
|
+ dataEndTime: undefined
|
|
|
};
|
|
|
|
|
|
const data = reactive({
|
|
|
@@ -999,6 +1039,7 @@ const openDialog = async (id?: string | number, title?: string, schedule?: Asses
|
|
|
dialog.visible = true;
|
|
|
dialog.title = title || '提交考核申请';
|
|
|
|
|
|
+ console.log('schedule:', schedule.dataStartTime, schedule.dataEndTime);
|
|
|
// 重置表单
|
|
|
resetFormData();
|
|
|
|
|
|
@@ -1008,6 +1049,12 @@ const openDialog = async (id?: string | number, title?: string, schedule?: Asses
|
|
|
form.value.scheduleName = schedule.scheduleName;
|
|
|
form.value.startTime = schedule.startTime;
|
|
|
form.value.endTime = schedule.endTime;
|
|
|
+ // 设置数据统计时间范围(用于指标数据查询)
|
|
|
+ form.value.dataStartTime = schedule.dataStartTime;
|
|
|
+ form.value.dataEndTime = schedule.dataEndTime;
|
|
|
+
|
|
|
+ console.log('form.value.dataStartTime:', form.value.dataStartTime);
|
|
|
+ console.log('form.value.dataEndTime:', form.value.dataEndTime);
|
|
|
|
|
|
// 获取当前登录用户的学生信息
|
|
|
await getCurrentUserStudentInfo();
|
|
|
@@ -1025,6 +1072,14 @@ const openDialog = async (id?: string | number, title?: string, schedule?: Asses
|
|
|
// 完整回显申请数据
|
|
|
Object.assign(form.value, res.data);
|
|
|
|
|
|
+ // 重新设置时间字段,确保指标数据查询的时间范围正确
|
|
|
+ if (schedule) {
|
|
|
+ form.value.dataStartTime = schedule.dataStartTime;
|
|
|
+ form.value.dataEndTime = schedule.dataEndTime;
|
|
|
+ console.log('重新设置时间字段 - dataStartTime:', form.value.dataStartTime);
|
|
|
+ console.log('重新设置时间字段 - dataEndTime:', form.value.dataEndTime);
|
|
|
+ }
|
|
|
+
|
|
|
// 确保自评得分列表正确回显
|
|
|
if (res.data.selfScoreList && res.data.selfScoreList.length > 0) {
|
|
|
form.value.selfScoreList = res.data.selfScoreList.map((item: any) => ({
|
|
|
@@ -1082,6 +1137,14 @@ const openDialog = async (id?: string | number, title?: string, schedule?: Asses
|
|
|
// 完整回显申请数据
|
|
|
Object.assign(form.value, existingApplication.data);
|
|
|
|
|
|
+ // 重新设置时间字段,确保指标数据查询的时间范围正确
|
|
|
+ if (schedule) {
|
|
|
+ form.value.dataStartTime = schedule.dataStartTime;
|
|
|
+ form.value.dataEndTime = schedule.dataEndTime;
|
|
|
+ console.log('重新设置时间字段 - dataStartTime:', form.value.dataStartTime);
|
|
|
+ console.log('重新设置时间字段 - dataEndTime:', form.value.dataEndTime);
|
|
|
+ }
|
|
|
+
|
|
|
// 确保自评得分列表正确回显
|
|
|
if (existingApplication.data.selfScoreList && existingApplication.data.selfScoreList.length > 0) {
|
|
|
form.value.selfScoreList = existingApplication.data.selfScoreList.map((item: any) => ({
|
|
|
@@ -1135,6 +1198,9 @@ const openDialog = async (id?: string | number, title?: string, schedule?: Asses
|
|
|
form.value.scheduleName = schedule.scheduleName;
|
|
|
form.value.startTime = schedule.startTime;
|
|
|
form.value.endTime = schedule.endTime;
|
|
|
+ // 重新设置数据统计时间范围(用于指标数据查询)
|
|
|
+ form.value.dataStartTime = schedule.dataStartTime;
|
|
|
+ form.value.dataEndTime = schedule.dataEndTime;
|
|
|
// 重新获取学生信息
|
|
|
await getCurrentUserStudentInfo();
|
|
|
}
|
|
|
@@ -1344,6 +1410,40 @@ const getStatusText = (status: string) => {
|
|
|
return '未知状态';
|
|
|
};
|
|
|
|
|
|
+/** 查看指标数据 */
|
|
|
+const handleViewIndicatorData = (row: XskhAssessmentSelfScoreForm) => {
|
|
|
+ console.log('点击查看指标数据:', {
|
|
|
+ indicatorId: row.indicatorId,
|
|
|
+ indicatorName: row.indicatorName,
|
|
|
+ currentIndicatorId: currentIndicatorData.indicatorId,
|
|
|
+ dataStartTime: form.value.dataStartTime,
|
|
|
+ dataEndTime: form.value.dataEndTime
|
|
|
+ });
|
|
|
+
|
|
|
+ // 直接设置新的指标数据
|
|
|
+ currentIndicatorData.indicatorId = row.indicatorId;
|
|
|
+ currentIndicatorData.indicatorName = row.indicatorName || '';
|
|
|
+
|
|
|
+ console.log('设置新的指标数据:', {
|
|
|
+ indicatorId: currentIndicatorData.indicatorId,
|
|
|
+ indicatorName: currentIndicatorData.indicatorName,
|
|
|
+ dataStartTime: form.value.dataStartTime,
|
|
|
+ dataEndTime: form.value.dataEndTime
|
|
|
+ });
|
|
|
+
|
|
|
+ // 使用nextTick确保DOM更新后再打开弹窗
|
|
|
+ nextTick(() => {
|
|
|
+ // 再次确认数据已更新
|
|
|
+ console.log('准备打开弹窗,当前指标数据:', {
|
|
|
+ indicatorId: currentIndicatorData.indicatorId,
|
|
|
+ indicatorName: currentIndicatorData.indicatorName,
|
|
|
+ dataStartTime: form.value.dataStartTime,
|
|
|
+ dataEndTime: form.value.dataEndTime
|
|
|
+ });
|
|
|
+ indicatorDataDialogRef.value?.openDialog();
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
defineExpose({
|
|
|
openDialog
|
|
|
});
|
|
|
@@ -1731,7 +1831,7 @@ defineExpose({
|
|
|
color: #adb5bd !important;
|
|
|
}
|
|
|
|
|
|
-/* 查看模式下禁用表单内的按钮,但保留下载按钮和取消按钮 */
|
|
|
+/* 查看模式下禁用表单内的按钮,但保留下载按钮、取消按钮和指标数据查看按钮 */
|
|
|
.view-mode .el-form .el-button {
|
|
|
pointer-events: none;
|
|
|
opacity: 0.6;
|
|
|
@@ -1743,6 +1843,15 @@ defineExpose({
|
|
|
opacity: 1;
|
|
|
}
|
|
|
|
|
|
+/* 查看模式下保留指标数据查看按钮的点击功能 */
|
|
|
+.view-mode .el-form .el-button.indicator-data-btn {
|
|
|
+ pointer-events: auto !important;
|
|
|
+ opacity: 1 !important;
|
|
|
+ cursor: pointer !important;
|
|
|
+ z-index: 10 !important;
|
|
|
+ position: relative !important;
|
|
|
+}
|
|
|
+
|
|
|
/* 查看模式下禁用表格中的操作 */
|
|
|
.view-mode .el-table .el-input,
|
|
|
.view-mode .el-table .el-textarea {
|
|
|
@@ -1932,4 +2041,29 @@ defineExpose({
|
|
|
.header-icon:hover {
|
|
|
color: #409eff;
|
|
|
}
|
|
|
+
|
|
|
+/* 指标名称单元格样式 */
|
|
|
+.indicator-name-cell {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 6px;
|
|
|
+}
|
|
|
+
|
|
|
+.indicator-name-cell span {
|
|
|
+ flex: 1;
|
|
|
+ font-size: inherit;
|
|
|
+}
|
|
|
+
|
|
|
+.indicator-data-btn {
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 4px;
|
|
|
+ transform: scale(0.7);
|
|
|
+ opacity: 0.7;
|
|
|
+}
|
|
|
+
|
|
|
+.indicator-data-btn:hover {
|
|
|
+ transform: scale(0.8);
|
|
|
+ opacity: 1;
|
|
|
+ transition: all 0.2s ease;
|
|
|
+}
|
|
|
</style>
|