This commit is contained in:
zlwu committed 2025-08-13 17:21:05 +08:00
commit df38590dbf
7 files changed
+267 -46

No files matched your search

+40 -4
View File
@@ -1,12 +1,13 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InternshipInfoVO, InternshipInfoQuery, ClassInfoVO, InternshipStatisticsVO } from '@/api/zsjy/types';
import { TableDataInfo, R } from '@/api/types';
/**
* 查询实习信息列表
* @param query 查询参数
*/
export const listInternshipInfo = (query?: InternshipInfoQuery): AxiosPromise<InternshipInfoVO[]> => {
export const listInternshipInfo = (query?: InternshipInfoQuery): AxiosPromise<TableDataInfo<InternshipInfoVO>> => {
return request({
url: '/zsjy/internship/list',
method: 'get',
@@ -18,7 +19,7 @@ export const listInternshipInfo = (query?: InternshipInfoQuery): AxiosPromise<In
* 查询学生实习详细信息
* @param studentId 学生ID
*/
export const getInternshipInfo = (studentId: string | number): AxiosPromise<InternshipInfoVO> => {
export const getInternshipInfo = (studentId: string | number): AxiosPromise<R<InternshipInfoVO>> => {
return request({
url: `/zsjy/internship/${studentId}`,
method: 'get'
@@ -41,7 +42,7 @@ export const exportInternshipInfo = (query: InternshipInfoQuery) => {
/**
* 获取班级信息列表(用于下拉选择)
*/
export const getClassOptions = (): AxiosPromise<ClassInfoVO[]> => {
export const getClassOptions = (): AxiosPromise<R<ClassInfoVO[]>> => {
return request({
url: '/zsjy/internship/classes',
method: 'get'
@@ -52,10 +53,45 @@ export const getClassOptions = (): AxiosPromise<ClassInfoVO[]> => {
* 获取实习统计数据
* @param query 查询参数
*/
export const getInternshipStatistics = (query?: InternshipInfoQuery): AxiosPromise<InternshipStatisticsVO> => {
export const getInternshipStatistics = (query?: InternshipInfoQuery): AxiosPromise<R<InternshipStatisticsVO>> => {
return request({
url: '/zsjy/internship/statistics',
method: 'get',
params: query
});
};
/**
* 新增实习信息
* @param data 实习信息数据
*/
export const addInternshipInfo = (data: any): AxiosPromise<R<void>> => {
return request({
url: '/zsjy/internship',
method: 'post',
data: data
});
};
/**
* 修改实习信息
* @param data 实习信息数据
*/
export const updateInternshipInfo = (data: any): AxiosPromise<R<void>> => {
return request({
url: '/zsjy/internship',
method: 'put',
data: data
});
};
/**
* 删除实习信息
* @param internshipId 实习信息ID
*/
export const delInternshipInfo = (internshipId: string | number): AxiosPromise<R<void>> => {
return request({
url: `/zsjy/internship/${internshipId}`,
method: 'delete'
});
};
+11 -11
View File
@@ -769,7 +769,7 @@ export interface InternshipInfoVO {
/**
* 手机号
*/
mobile?: string;
phone?: string;
/**
* 学院ID
@@ -804,7 +804,7 @@ export interface InternshipInfoVO {
/**
* 班主任姓名
*/
classMasterName?: string;
classTeacherName?: string;
/**
* 实习状态 (0=未实习, 1=实习中, 2=实习完成)
@@ -819,7 +819,7 @@ export interface InternshipInfoVO {
/**
* 实习公司
*/
internshipCompany?: string;
companyName?: string;
/**
* 实习岗位
@@ -829,17 +829,17 @@ export interface InternshipInfoVO {
/**
* 实习开始时间
*/
internshipStartTime?: string;
internshipStartDate?: string;
/**
* 实习结束时间
*/
internshipEndTime?: string;
internshipEndDate?: string;
/**
* 实习地点
*/
internshipLocation?: string;
companyAddress?: string;
/**
* 创建时间
@@ -909,17 +909,17 @@ export interface InternshipInfoQuery {
/**
* 实习公司
*/
internshipCompany?: string;
companyName?: string;
/**
* 开始时间范围
* 实习开始日期-开始
*/
startTimeBegin?: string;
internshipStartDateBegin?: string;
/**
* 开始时间范围
* 实习开始日期-结束
*/
startTimeEnd?: string;
internshipStartDateEnd?: string;
}
/**
@@ -32,8 +32,8 @@
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="实习公司" prop="internshipCompany">
<el-input v-model="queryParams.internshipCompany" placeholder="请输入实习公司名称" clearable @keyup.enter="handleQuery" />
<el-form-item label="实习公司" prop="companyName">
<el-input v-model="queryParams.companyName" placeholder="请输入实习公司名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -128,24 +128,28 @@
<el-table v-loading="loading" border :data="internshipList" @row-dblclick="handleView">
<el-table-column label="学号" align="center" prop="studentNo" width="120" />
<el-table-column label="姓名" align="center" prop="studentName" width="100" />
<el-table-column label="性别" align="center" prop="gender" width="80" />
<el-table-column label="性别" align="center" prop="gender" width="80">
<template #default="scope">
<dict-tag :options="sys_user_sex" :value="scope.row.gender" />
</template>
</el-table-column>
<el-table-column label="班级" align="center" prop="className" width="180" />
<el-table-column label="班主任" align="center" prop="classMasterName" width="100" />
<el-table-column label="班主任" align="center" prop="classTeacherName" width="100" />
<el-table-column label="实习状态" align="center" prop="internshipStatus" width="100">
<template #default="scope">
<dict-tag :options="internship_status" :value="scope.row.internshipStatus" />
</template>
</el-table-column>
<el-table-column label="实习公司" align="center" prop="internshipCompany" min-width="150" show-overflow-tooltip />
<el-table-column label="实习公司" align="center" prop="companyName" min-width="150" show-overflow-tooltip />
<el-table-column label="实习岗位" align="center" prop="internshipPosition" width="120" show-overflow-tooltip />
<el-table-column label="实习开始时间" align="center" prop="internshipStartTime" width="120">
<el-table-column label="实习开始时间" align="center" prop="internshipStartDate" width="120">
<template #default="scope">
<span v-if="scope.row.internshipStartTime">{{ parseTime(scope.row.internshipStartTime, '{y}-{m}-{d}') }}</span>
<span v-if="scope.row.internshipStartDate">{{ parseTime(scope.row.internshipStartDate, '{y}-{m}-{d}') }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="实习地点" align="center" prop="internshipLocation" width="120" show-overflow-tooltip />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
<el-table-column label="实习地点" align="center" prop="companyAddress" width="120" show-overflow-tooltip />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template #default="scope">
<el-tooltip content="查看详情" placement="top">
<el-button
@@ -153,11 +157,30 @@
type="primary"
icon="View"
size="default"
style="font-size: 16px; color: blue"
@click="handleView(scope.row)"
v-hasPermi="['zsjy:internship:query']"
></el-button>
</el-tooltip>
<el-tooltip content="新增实习信息" placement="top" v-if="!scope.row.internshipId">
<el-button
link
type="success"
icon="Plus"
size="default"
@click="handleAdd(scope.row)"
v-hasPermi="['zsjy:internship:add']"
></el-button>
</el-tooltip>
<el-tooltip content="编辑实习信息" placement="top" v-if="scope.row.internshipId">
<el-button
link
type="warning"
icon="Edit"
size="default"
@click="handleEdit(scope.row)"
v-hasPermi="['zsjy:internship:edit']"
></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
@@ -215,7 +238,7 @@ import { parseTime } from '@/utils/ruoyi';
import { download } from '@/utils/request';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { internship_status } = toRefs<any>(proxy?.useDict('internship_status'));
const { internship_status, sys_user_sex } = toRefs<any>(proxy?.useDict('internship_status', 'sys_user_sex'));
const internshipList = ref<InternshipInfoVO[]>([]);
const classOptions = ref<ClassInfoVO[]>([]);
@@ -239,9 +262,9 @@ const data = reactive({
studentNo: '',
classId: '',
internshipStatus: '',
internshipCompany: '',
startTimeBegin: '',
startTimeEnd: ''
companyName: '',
internshipStartDateBegin: '',
internshipStartDateEnd: ''
} as InternshipInfoQuery,
dialog: {
visible: false,
@@ -256,19 +279,33 @@ const getList = async () => {
loading.value = true;
// 处理日期范围
if (dateRange.value && dateRange.value.length === 2) {
queryParams.value.startTimeBegin = dateRange.value[0];
queryParams.value.startTimeEnd = dateRange.value[1];
queryParams.value.internshipStartDateBegin = dateRange.value[0];
queryParams.value.internshipStartDateEnd = dateRange.value[1];
} else {
queryParams.value.startTimeBegin = '';
queryParams.value.startTimeEnd = '';
queryParams.value.internshipStartDateBegin = '';
queryParams.value.internshipStartDateEnd = '';
}
console.log('=== 前端调试日志 ===');
console.log('1. 查询参数:', JSON.stringify(queryParams.value, null, 2));
try {
const res = await listInternshipInfo(queryParams.value);
console.log('2. API响应完整数据:', JSON.stringify(res, null, 2));
console.log('3. res.rows类型:', typeof res.rows, '长度:', res.rows ? res.rows.length : 'undefined');
console.log('4. res.total:', res.total);
console.log('5. res.code:', res.code);
console.log('6. res.msg:', res.msg);
internshipList.value = res.rows;
total.value = res.total;
console.log('7. 赋值后 internshipList.value:', internshipList.value);
console.log('8. 赋值后 total.value:', total.value);
loading.value = false;
} catch (error) {
console.error('API调用失败:', error);
loading.value = false;
}
};
@@ -349,6 +386,18 @@ const handleExport = () => {
});
};
/** 新增实习信息按钮操作 */
const handleAdd = (row: InternshipInfoVO) => {
// TODO: 实现新增实习信息功能
proxy?.$modal.msgInfo('新增实习信息功能开发中...');
};
/** 编辑实习信息按钮操作 */
const handleEdit = (row: InternshipInfoVO) => {
// TODO: 实现编辑实习信息功能
proxy?.$modal.msgInfo('编辑实习信息功能开发中...');
};
/** 取消按钮 */
const cancel = () => {
dialog.value.visible = false;
@@ -381,9 +430,13 @@ const cancel = () => {
color: white;
position: relative;
overflow: hidden;
height: 100px; /* 设置固定高度,确保所有卡片高度一致 */
.statistics-content {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center; /* 内容垂直居中 */
.statistics-number {
font-size: 28px;