提交
This commit is contained in:
1 parent
6e58022625
commit
3c629d2d58
7 files changed
+144
-21
No files matched your search
@@ -31,39 +31,57 @@
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="学年" prop="academicYear">
|
||||
<el-select v-model="queryParams.academicYear" placeholder="选择学年" clearable @change="handleQuery">
|
||||
<el-option v-for="year in yearOptions" :key="year.value" :label="year.label" :value="year.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="学期" prop="semester">
|
||||
<el-select v-model="queryParams.semester" placeholder="选择学期" clearable @change="handleQuery">
|
||||
<el-option v-for="semester in semesterOptions" :key="semester.value" :label="semester.label" :value="semester.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="月份" prop="month">
|
||||
<el-select v-model="queryParams.month" placeholder="选择月份" clearable @change="handleQuery">
|
||||
<el-option v-for="month in monthOptions" :key="month.value" :label="month.label" :value="month.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="学生状态" prop="studentStatus">
|
||||
<el-select
|
||||
v-model="queryParams.studentStatus"
|
||||
placeholder="选择学生状态"
|
||||
multiple
|
||||
clearable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="status in student_status"
|
||||
:key="status.value"
|
||||
:label="status.label"
|
||||
:value="status.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
@@ -161,6 +179,14 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns[8].visible" key="studentStatus" label="学生状态" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="getStudentStatusText(scope.row.studentStatus)" :type="getStudentStatusType(scope.row.studentStatus)" size="small">
|
||||
{{ getStudentStatusText(scope.row.studentStatus) }}
|
||||
</el-tag>
|
||||
<span v-else class="text-gray-400">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns[3].visible" key="score" label="分数" align="center" width="150">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model="scope.row.score" :min="0" :max="100" :precision="2" :step="0.5" size="small" placeholder="输入分数" />
|
||||
@@ -168,9 +194,19 @@
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns[4].visible" key="evaluation" label="评判结果" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="getEvaluationResult(scope.row.score)" :type="getEvaluationResult(scope.row.score) === '优秀' ? 'success' :
|
||||
getEvaluationResult(scope.row.score) === '良好' ? 'primary' :
|
||||
getEvaluationResult(scope.row.score) === '合格' ? 'warning' : 'danger'" size="small">
|
||||
<el-tag
|
||||
v-if="getEvaluationResult(scope.row.score)"
|
||||
:type="
|
||||
getEvaluationResult(scope.row.score) === '优秀'
|
||||
? 'success'
|
||||
: getEvaluationResult(scope.row.score) === '良好'
|
||||
? 'primary'
|
||||
: getEvaluationResult(scope.row.score) === '合格'
|
||||
? 'warning'
|
||||
: 'danger'
|
||||
"
|
||||
size="small"
|
||||
>
|
||||
{{ getEvaluationResult(scope.row.score) }}
|
||||
</el-tag>
|
||||
<span v-else class="text-gray-400">-</span>
|
||||
@@ -214,19 +250,27 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ConductScoreInput">
|
||||
import { ref, reactive, onMounted, computed } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ref, reactive, onMounted, computed, getCurrentInstance, toRefs } from 'vue';
|
||||
import ElMessage from 'element-plus/es/components/message/index';
|
||||
import ElMessageBox from 'element-plus/es/components/message-box/index';
|
||||
|
||||
// API接口
|
||||
import { conductScoreClassStudents, conductScoreBatchAdd } from '@/api/xg/conductScore';
|
||||
|
||||
// 获取当前实例
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
|
||||
// 字典数据
|
||||
const { student_status } = toRefs<any>(proxy?.useDict('student_status'));
|
||||
|
||||
// 响应式数据
|
||||
const queryParams = reactive({
|
||||
academicYear: new Date().getFullYear(),
|
||||
semester: 1,
|
||||
month: new Date().getMonth() + 1,
|
||||
studentNo: '',
|
||||
studentName: ''
|
||||
studentName: '',
|
||||
studentStatus: ['1', '3'] // 默认选中1-在读,3-复学
|
||||
});
|
||||
|
||||
// 班级Tab页数据
|
||||
@@ -294,6 +338,7 @@ const columns = ref([
|
||||
{ key: 0, label: `学号`, visible: true },
|
||||
{ key: 1, label: `姓名`, visible: true },
|
||||
{ key: 2, label: `性别`, visible: true },
|
||||
{ key: 8, label: `学生状态`, visible: true },
|
||||
{ key: 3, label: `分数`, visible: true },
|
||||
{ key: 4, label: `评判结果`, visible: true },
|
||||
{ key: 5, label: `备注`, visible: true },
|
||||
@@ -342,6 +387,33 @@ const getEvaluationResult = (score) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 获取学生状态文本
|
||||
const getStudentStatusText = (status) => {
|
||||
if (!status || !student_status.value || !Array.isArray(student_status.value)) {
|
||||
return status || '';
|
||||
}
|
||||
const dictItem = student_status.value.find((item) => item.value === status);
|
||||
return dictItem ? dictItem.label : status;
|
||||
};
|
||||
|
||||
// 获取学生状态类型(用于标签颜色)
|
||||
const getStudentStatusType = (status) => {
|
||||
if (!status) return 'info';
|
||||
// 根据状态值返回不同的标签类型
|
||||
switch (status) {
|
||||
case '1':
|
||||
return 'success'; // 在读
|
||||
case '2':
|
||||
return 'warning'; // 休学
|
||||
case '3':
|
||||
return 'danger'; // 退学
|
||||
case '4':
|
||||
return 'info'; // 毕业
|
||||
default:
|
||||
return 'info';
|
||||
}
|
||||
};
|
||||
|
||||
// 方法
|
||||
const handleQuery = () => {
|
||||
getList();
|
||||
@@ -349,6 +421,8 @@ const handleQuery = () => {
|
||||
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
// 重置为默认值
|
||||
queryParams.studentStatus = ['1', '3'];
|
||||
getList();
|
||||
};
|
||||
|
||||
@@ -375,7 +449,6 @@ const getList = async () => {
|
||||
ElMessage.warning('暂无班级数据,请检查是否已分配班主任权限或联系管理员');
|
||||
classTabs.value = [];
|
||||
classStudentData.value.clear();
|
||||
summary.value = null;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -416,6 +489,7 @@ const getList = async () => {
|
||||
studentNo: student.studentNo || '',
|
||||
studentName: student.studentName || '',
|
||||
gender: student.gender || '0',
|
||||
studentStatus: student.studentStatus || '',
|
||||
lastScore: student.lastScore || null,
|
||||
existingScore: hasExistingScore ? student.existingScore : null,
|
||||
score: hasExistingScore ? student.existingScore.score : null,
|
||||
|
||||
Reference in new issue
Block a user