wuzhen update
This commit is contained in:
commit
9ea52837de
34 files changed
+6949
-1393
No files matched your search
@@ -8,7 +8,10 @@ export function listHallReservation(query: HallReservationQuery) {
|
||||
return request<TableDataInfo<HallReservationVO>>({
|
||||
url: '/hq/hallReservation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,7 +19,10 @@ export function listHallReservation(query: HallReservationQuery) {
|
||||
export function getHallReservation(id: string | number) {
|
||||
return request<R<HallReservationVO>>({
|
||||
url: '/hq/hallReservation/' + id,
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,7 +31,10 @@ export function auditHallReservation(data: HallReservationAuditForm) {
|
||||
return request<R<any>>({
|
||||
url: '/hq/hallReservation/audit',
|
||||
method: 'put',
|
||||
data: data
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -34,6 +43,9 @@ export function checkTimeConflict(data: TimeCheckParams) {
|
||||
return request<R<TimeCheckResult>>({
|
||||
url: '/hq/hallReservation/checkTimeConflict',
|
||||
method: 'post',
|
||||
data: data
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -12,7 +12,10 @@ export const listHallInfo = (query?: HallInfoQuery): AxiosPromise<HallInfoVO[]>
|
||||
return request({
|
||||
url: '/hq/hallInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -23,7 +26,10 @@ export const listHallInfo = (query?: HallInfoQuery): AxiosPromise<HallInfoVO[]>
|
||||
export const getHallInfo = (id: string | number): AxiosPromise<HallInfoVO> => {
|
||||
return request({
|
||||
url: '/hq/hallInfo/' + id,
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -35,7 +41,10 @@ export const addHallInfo = (data: HallInfoForm) => {
|
||||
return request({
|
||||
url: '/hq/hallInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -47,7 +56,10 @@ export const updateHallInfo = (data: HallInfoForm) => {
|
||||
return request({
|
||||
url: '/hq/hallInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -58,6 +70,9 @@ export const updateHallInfo = (data: HallInfoForm) => {
|
||||
export const delHallInfo = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/hq/hallInfo/' + id,
|
||||
method: 'delete'
|
||||
method: 'delete',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -12,7 +12,10 @@ export const listHallReservation = (query?: HallReservationQuery): AxiosPromise<
|
||||
return request({
|
||||
url: '/hq/hallReservation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -23,7 +26,10 @@ export const listHallReservation = (query?: HallReservationQuery): AxiosPromise<
|
||||
export const getHallReservation = (id: string | number): AxiosPromise<HallReservationVO> => {
|
||||
return request({
|
||||
url: '/hq/hallReservation/' + id,
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -35,7 +41,10 @@ export const addHallReservation = (data: HallReservationForm) => {
|
||||
return request({
|
||||
url: '/hq/hallReservation',
|
||||
method: 'post',
|
||||
data: data
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -47,7 +56,10 @@ export const updateHallReservation = (data: HallReservationForm) => {
|
||||
return request({
|
||||
url: '/hq/hallReservation',
|
||||
method: 'put',
|
||||
data: data
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -58,6 +70,9 @@ export const updateHallReservation = (data: HallReservationForm) => {
|
||||
export const delHallReservation = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/hq/hallReservation/' + id,
|
||||
method: 'delete'
|
||||
method: 'delete',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -59,6 +59,11 @@ export interface SysRegionVO {
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
/**
|
||||
* 子节点列表(用于树形结构)
|
||||
*/
|
||||
children?: SysRegionVO[];
|
||||
|
||||
}
|
||||
|
||||
export interface SysRegionForm extends BaseEntity {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import type { XgDeptTreeVO, R, TableDataInfo, XgStudentMsgAdvancedSearchQuery } from '@/api/xg/xsjcxx/stuRoster/types';
|
||||
|
||||
/**
|
||||
* 查询部门下拉树结构
|
||||
* @param deptId 部门ID
|
||||
*/
|
||||
export const XgDeptTreeSelect = (belongDeptId?: number): AxiosPromise<XgDeptTreeVO[]> => {
|
||||
return request({
|
||||
url: '/xgStudentManagerSource/studentManagerSource/currentUserAuthTree',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 查询院系树结构
|
||||
export function deptTreeSelect(): AxiosPromise<R<any>> {
|
||||
return request({
|
||||
url: '/system/dept/treeselect',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 查询学生花名册列表 - 使用高级搜索接口
|
||||
export function listStudentRoster(query?: XgStudentMsgAdvancedSearchQuery): AxiosPromise<R<TableDataInfo<any[]>>> {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg/advancedSearch',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
// 导出学生花名册
|
||||
export function exportStudentRoster(query?: any): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg/export',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生个人信息
|
||||
* @param userId 用户ID,可为空,为空时使用当前登录用户ID
|
||||
*/
|
||||
export function getStudentPersonalInfo(userId?: number): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg/personalInfo',
|
||||
method: 'get',
|
||||
params: { userId }
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
XgDeptTreeSelect,
|
||||
deptTreeSelect,
|
||||
listStudentRoster,
|
||||
exportStudentRoster,
|
||||
getStudentPersonalInfo
|
||||
};
|
||||
@@ -0,0 +1,187 @@
|
||||
// 部门树节点类型
|
||||
export interface XgDeptTreeVO {
|
||||
id: number;
|
||||
label: string;
|
||||
children?: XgDeptTreeVO[];
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
// 通用响应类型
|
||||
export interface R<T = any> {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
// 分页数据信息
|
||||
export interface TableDataInfo<T = any> {
|
||||
total: number;
|
||||
rows: T;
|
||||
}
|
||||
|
||||
// 学生花名册查询参数
|
||||
export interface StudentRosterQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
studentNo?: string;
|
||||
name?: string;
|
||||
phone?: string;
|
||||
studentStatus?: string;
|
||||
deptIds?: number[];
|
||||
}
|
||||
|
||||
// 学生花名册数据
|
||||
export interface StudentRosterVO {
|
||||
studentId: number;
|
||||
studentNo: string;
|
||||
studentName: string;
|
||||
nickName?: string;
|
||||
sex: string;
|
||||
age?: number;
|
||||
phonenumber: string;
|
||||
email?: string;
|
||||
idCard: string;
|
||||
deptId: number;
|
||||
deptName: string;
|
||||
majorId?: number;
|
||||
majorName?: string;
|
||||
classId?: number;
|
||||
className?: string;
|
||||
address?: string;
|
||||
studentStatus: string;
|
||||
createTime: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
// 学生信息高级搜索查询参数
|
||||
export interface XgStudentMsgAdvancedSearchQuery {
|
||||
// 基础信息检索
|
||||
studentNo?: string;
|
||||
name?: string;
|
||||
idCard?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
gender?: string[];
|
||||
nationality?: string[];
|
||||
politicalStatus?: string[];
|
||||
birthDateStart?: string;
|
||||
birthDateEnd?: string;
|
||||
nameEnglish?: string;
|
||||
formerName?: string;
|
||||
nativePlace?: string[];
|
||||
hukouLocation?: string;
|
||||
homeAddress?: string;
|
||||
currentAddress?: string;
|
||||
qq?: string;
|
||||
wechat?: string;
|
||||
maritalStatus?: string[];
|
||||
religion?: string;
|
||||
householdRegisterType?: string[];
|
||||
educationLevel?: string[];
|
||||
|
||||
// 学籍信息检索
|
||||
studentStatus?: string[];
|
||||
enrollmentYearStart?: number;
|
||||
enrollmentYearEnd?: number;
|
||||
enrollmentDateStart?: string;
|
||||
enrollmentDateEnd?: string;
|
||||
admissionCategory?: string[];
|
||||
|
||||
// 学院专业班级检索
|
||||
collegeName?: string;
|
||||
majorName?: string;
|
||||
className?: string;
|
||||
grade?: string[];
|
||||
gradeMin?: string;
|
||||
gradeMax?: string;
|
||||
counselorName?: string;
|
||||
classTeacherName?: string;
|
||||
|
||||
// 家庭信息检索
|
||||
fatherName?: string;
|
||||
motherName?: string;
|
||||
guardianName?: string;
|
||||
familyIncomeMin?: number;
|
||||
familyIncomeMax?: number;
|
||||
perCapitaIncomeMin?: number;
|
||||
perCapitaIncomeMax?: number;
|
||||
familyEconomicStatus?: string[];
|
||||
familyMembersMin?: number;
|
||||
familyMembersMax?: number;
|
||||
|
||||
// 特殊身份检索
|
||||
isPoorStudent?: string[];
|
||||
isMinority?: string[];
|
||||
isDisabled?: string[];
|
||||
isOrphan?: string[];
|
||||
isLeftBehindChild?: string[];
|
||||
isSingleChild?: string[];
|
||||
isLowIncome?: string[];
|
||||
hasLoan?: string[];
|
||||
loanAmountMin?: number;
|
||||
loanAmountMax?: number;
|
||||
|
||||
// 身体状况检索
|
||||
heightMin?: number;
|
||||
heightMax?: number;
|
||||
weightMin?: number;
|
||||
weightMax?: number;
|
||||
bloodType?: string[];
|
||||
healthStatus?: string;
|
||||
disabilityType?: string[];
|
||||
disabilityLevel?: string;
|
||||
|
||||
// 住宿信息检索
|
||||
isBoarder?: string[];
|
||||
dormitoryBuilding?: string[];
|
||||
dormitoryRoom?: string;
|
||||
|
||||
// 家庭详细信息检索
|
||||
fatherPhone?: string;
|
||||
fatherWorkUnit?: string;
|
||||
motherPhone?: string;
|
||||
motherWorkUnit?: string;
|
||||
guardianPhone?: string;
|
||||
guardianRelation?: string;
|
||||
incomeSource?: string;
|
||||
emergencyContactName?: string;
|
||||
emergencyContactPhone?: string;
|
||||
emergencyContactRelation?: string;
|
||||
|
||||
// 扩展信息检索
|
||||
specialties?: string;
|
||||
awards?: string;
|
||||
violations?: string;
|
||||
socialActivities?: string;
|
||||
|
||||
// 健康详细信息检索
|
||||
specialCondition?: string;
|
||||
medicalHistory?: string;
|
||||
allergies?: string;
|
||||
|
||||
// 其他信息检索
|
||||
sourceRegion?: string[];
|
||||
graduateSchool?: string;
|
||||
trainingType?: string[];
|
||||
academicLevel?: string[];
|
||||
schoolSystemMin?: number;
|
||||
schoolSystemMax?: number;
|
||||
infoStatus?: string;
|
||||
dataSource?: string;
|
||||
isComplete?: number;
|
||||
completionRateMin?: number;
|
||||
completionRateMax?: number;
|
||||
|
||||
// 时间范围检索
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
updateTimeStart?: string;
|
||||
updateTimeEnd?: string;
|
||||
|
||||
// 部门树节点
|
||||
deptIds?: number[];
|
||||
|
||||
// 分页参数
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
@@ -100,6 +100,7 @@ watch(
|
||||
if (Array.isArray(val)) {
|
||||
list = val as OssVO[];
|
||||
} else if (typeof val === 'string') {
|
||||
console.log('val', val);
|
||||
// 检查是否包含逗号分隔的URL
|
||||
if (val.includes(',')) {
|
||||
// 多个URL用逗号分隔
|
||||
@@ -136,6 +137,7 @@ watch(
|
||||
}
|
||||
return itemData;
|
||||
});
|
||||
console.log('fileList', fileList.value);
|
||||
} else {
|
||||
fileList.value = [];
|
||||
return [];
|
||||
@@ -238,6 +240,7 @@ const handleUploadError = () => {
|
||||
|
||||
// 预览
|
||||
const handlePictureCardPreview = (file: any) => {
|
||||
console.log('file', file);
|
||||
dialogImageUrl.value = file.url;
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
@@ -247,9 +250,9 @@ const listToString = (list: any[], separator?: string) => {
|
||||
let strs = '';
|
||||
separator = separator || ',';
|
||||
for (const i in list) {
|
||||
if (undefined !== list[i].url && list[i].url.indexOf('blob:') !== 0) {
|
||||
if (undefined !== list[i].ossId && list[i].ossId.indexOf('blob:') !== 0) {
|
||||
// 始终返回URL而不是ossId
|
||||
strs += list[i].url + separator;
|
||||
strs += list[i].ossId + separator;
|
||||
}
|
||||
}
|
||||
return strs != '' ? strs.substring(0, strs.length - 1) : '';
|
||||
|
||||
+40
-14
@@ -4,27 +4,27 @@ import errorCode from '@/utils/errorCode';
|
||||
import { blobValidate } from '@/utils/ruoyi';
|
||||
import { LoadingInstance } from 'element-plus/es/components/loading/src/loading.mjs';
|
||||
import { globalHeaders } from '@/utils/request';
|
||||
import { getFileDownloadUrl } from '@/api/system/file';
|
||||
|
||||
const baseURL = import.meta.env.VITE_APP_BASE_API;
|
||||
let downloadLoadingInstance: LoadingInstance;
|
||||
export default {
|
||||
async oss(ossId: string | number) {
|
||||
const url = baseURL + '/resource/oss/download/' + ossId;
|
||||
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
|
||||
downloadLoadingInstance = ElLoading.service({ text: '正在获取文件访问链接,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
|
||||
try {
|
||||
const res = await axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
headers: globalHeaders()
|
||||
});
|
||||
const isBlob = blobValidate(res.data);
|
||||
if (isBlob) {
|
||||
const blob = new Blob([res.data], { type: 'application/octet-stream' });
|
||||
FileSaver.saveAs(blob, decodeURIComponent(res.headers['download-filename'] as string));
|
||||
} else {
|
||||
this.printErrMsg(res.data);
|
||||
// 使用新的安全下载方法
|
||||
const { data: downloadUrl } = await getFileDownloadUrl(Number(ossId));
|
||||
|
||||
// 使用fetch下载文件
|
||||
const response = await fetch(downloadUrl);
|
||||
if (!response.ok) {
|
||||
throw new Error('下载失败');
|
||||
}
|
||||
|
||||
const blob = await response.blob();
|
||||
const filename = response.headers.get('content-disposition')?.split('filename=')[1]?.replace(/"/g, '') || `file_${ossId}`;
|
||||
|
||||
FileSaver.saveAs(blob, decodeURIComponent(filename));
|
||||
downloadLoadingInstance.close();
|
||||
} catch (r) {
|
||||
console.error(r);
|
||||
@@ -32,6 +32,32 @@ export default {
|
||||
downloadLoadingInstance.close();
|
||||
}
|
||||
},
|
||||
|
||||
// 新增:安全下载文件方法
|
||||
async secureOss(ossId: string | number, fileName?: string) {
|
||||
downloadLoadingInstance = ElLoading.service({ text: '正在获取文件访问链接,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
|
||||
try {
|
||||
// 获取临时下载URL
|
||||
const { data: downloadUrl } = await getFileDownloadUrl(Number(ossId));
|
||||
|
||||
// 使用fetch下载文件
|
||||
const response = await fetch(downloadUrl);
|
||||
if (!response.ok) {
|
||||
throw new Error('下载失败');
|
||||
}
|
||||
|
||||
const blob = await response.blob();
|
||||
const finalFileName = fileName || response.headers.get('content-disposition')?.split('filename=')[1]?.replace(/"/g, '') || `file_${ossId}`;
|
||||
|
||||
FileSaver.saveAs(blob, decodeURIComponent(finalFileName));
|
||||
downloadLoadingInstance.close();
|
||||
} catch (r) {
|
||||
console.error(r);
|
||||
ElMessage.error('下载文件出现错误,请联系管理员!');
|
||||
downloadLoadingInstance.close();
|
||||
}
|
||||
},
|
||||
|
||||
async zip(url: string, name: string) {
|
||||
url = baseURL + url;
|
||||
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
|
||||
|
||||
@@ -6,7 +6,7 @@ import auth from './auth';
|
||||
// 预设动画
|
||||
import animate from '@/animate';
|
||||
|
||||
import { download as dl } from '@/utils/request';
|
||||
import { download as dl, downloadJson as dlJson } from '@/utils/request';
|
||||
import { useDict } from '@/utils/dict';
|
||||
import { getConfigKey, updateConfigByKey } from '@/api/system/config';
|
||||
import { parseTime, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi';
|
||||
@@ -34,6 +34,7 @@ export default function installPlugin(app: App) {
|
||||
app.config.globalProperties.getConfigKey = getConfigKey;
|
||||
app.config.globalProperties.updateConfigByKey = updateConfigByKey;
|
||||
app.config.globalProperties.download = dl;
|
||||
app.config.globalProperties.downloadJson = dlJson;
|
||||
app.config.globalProperties.parseTime = parseTime;
|
||||
app.config.globalProperties.handleTree = handleTree;
|
||||
app.config.globalProperties.addDateRange = addDateRange;
|
||||
|
||||
@@ -215,5 +215,33 @@ export function download(url: string, params: any, fileName: string) {
|
||||
downloadLoadingInstance.close();
|
||||
});
|
||||
}
|
||||
|
||||
// 通用下载方法(JSON格式入参)
|
||||
export function downloadJson(url: string, params: any, fileName: string) {
|
||||
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
|
||||
// prettier-ignore
|
||||
return service.post(url, params, {
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
responseType: 'blob',
|
||||
timeout: 1200000 // 导出接口单独设置20分钟超时
|
||||
}).then(async (resp: any) => {
|
||||
const isLogin = blobValidate(resp);
|
||||
if (isLogin) {
|
||||
const blob = new Blob([resp]);
|
||||
FileSaver.saveAs(blob, fileName);
|
||||
} else {
|
||||
const blob = new Blob([resp]);
|
||||
const resText = await blob.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'];
|
||||
ElMessage.error(errMsg);
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
}).catch((r: any) => {
|
||||
console.error(r);
|
||||
ElMessage.error('下载文件出现错误,请联系管理员!');
|
||||
downloadLoadingInstance.close();
|
||||
});
|
||||
}
|
||||
// 导出 axios 实例
|
||||
export default service;
|
||||
@@ -254,6 +254,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listHallInfo(queryParams.value);
|
||||
console.log('res', res);
|
||||
hallInfoList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
@@ -311,6 +312,7 @@ const handleUpdate = async (row?: HallInfoVO) => {
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
console.log('form.value', form.value);
|
||||
hallInfoFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
|
||||
@@ -310,12 +310,21 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
/** 判断是否为系统角色(权限字符以XT-BJZW-开头) */
|
||||
const isSystemRole = computed(() => {
|
||||
return form.value.roleKey && form.value.roleKey.startsWith('XT-BJZW-');
|
||||
if (form.value.roleKey && form.value.roleKey.trim() !== '') {
|
||||
return form.value.roleKey.startsWith('XT-BJZW-');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/** 判断表格中的角色是否为系统角色 */
|
||||
const isSystemRoleInTable = (row: RoleVO) => {
|
||||
return row.roleKey && row.roleKey.startsWith('XT-BJZW-');
|
||||
if (row.roleKey && row.roleKey.trim() !== '') {
|
||||
return row.roleKey.startsWith('XT-BJZW-');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
// return row.roleKey && row.roleKey.trim() !== '' && row.roleKey.startsWith('XT-BJZW-');
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -431,12 +440,17 @@ const reset = () => {
|
||||
deptExpand.value = true;
|
||||
deptNodeAll.value = false;
|
||||
form.value = { ...initForm };
|
||||
// 确保roleKey被明确重置为空字符串
|
||||
form.value.roleKey = '';
|
||||
roleFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 添加角色 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
// 确保roleKey被正确重置为空字符串
|
||||
form.value.roleKey = '';
|
||||
console.log('新增角色 - roleKey:', `"${form.value.roleKey}"`, 'isSystemRole:', isSystemRole.value);
|
||||
getMenuTreeselect();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加角色';
|
||||
@@ -448,6 +462,7 @@ const handleUpdate = async (row?: RoleVO) => {
|
||||
const { data } = await getRole(roleId);
|
||||
Object.assign(form.value, data);
|
||||
form.value.roleSort = Number(form.value.roleSort);
|
||||
console.log('修改角色 - roleKey:', `"${form.value.roleKey}"`, 'isSystemRole:', isSystemRole.value);
|
||||
const res = await getRoleMenuTreeselect(roleId);
|
||||
dialog.title = '修改角色';
|
||||
dialog.visible = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="高级检索" width="1200px" append-to-body @close="handleClose">
|
||||
<el-dialog v-model="dialogVisible" title="高级检索" width="1200px" append-to-body @close="handleClose" class="advanced-search-dialog">
|
||||
<el-form ref="advancedFormRef" :model="formData" label-width="120px">
|
||||
<!-- 基础信息 -->
|
||||
<el-divider content-position="left">基础信息</el-divider>
|
||||
@@ -39,7 +39,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="formData.gender" placeholder="请选择性别" clearable>
|
||||
<el-select v-model="formData.gender" placeholder="请选择性别" clearable multiple collapse-tags collapse-tags-tooltip>
|
||||
<el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -65,11 +65,30 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="籍贯" prop="nativePlace">
|
||||
<el-input v-model="formData.nativePlace" placeholder="请输入籍贯" clearable />
|
||||
<el-tree-select
|
||||
v-model="formData.nativePlace"
|
||||
placeholder="请选择籍贯"
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
default-expand-all
|
||||
:data="regionOptions"
|
||||
:props="{
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
disabled: 'disabled',
|
||||
value: 'id'
|
||||
}"
|
||||
check-strictly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="政治面貌" prop="politicalStatus">
|
||||
<el-select v-model="formData.politicalStatus" placeholder="请选择政治面貌" clearable multiple collapse-tags collapse-tags-tooltip>
|
||||
@@ -77,8 +96,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="户口类型" prop="householdRegisterType">
|
||||
<el-select v-model="formData.householdRegisterType" placeholder="请选择户口类型" clearable multiple collapse-tags collapse-tags-tooltip>
|
||||
@@ -86,11 +103,30 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生源地区" prop="sourceRegion">
|
||||
<el-input v-model="formData.sourceRegion" placeholder="请输入生源地区" clearable />
|
||||
<el-tree-select
|
||||
v-model="formData.sourceRegion"
|
||||
placeholder="请选择生源地区"
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
default-expand-all
|
||||
:data="regionOptions"
|
||||
:props="{
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
disabled: 'disabled',
|
||||
value: 'id'
|
||||
}"
|
||||
check-strictly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="宗教信仰" prop="religion">
|
||||
<el-input v-model="formData.religion" placeholder="请输入宗教信仰" clearable />
|
||||
@@ -103,6 +139,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="婚姻状况" prop="maritalStatus">
|
||||
<el-select v-model="formData.maritalStatus" placeholder="请选择婚姻状况" clearable multiple collapse-tags collapse-tags-tooltip>
|
||||
<el-option v-for="dict in marital_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
@@ -120,13 +163,6 @@
|
||||
<el-input v-model="formData.wechat" placeholder="请输入微信号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="婚姻状况" prop="maritalStatus">
|
||||
<el-select v-model="formData.maritalStatus" placeholder="请选择婚姻状况" clearable multiple collapse-tags collapse-tags-tooltip>
|
||||
<el-option v-for="dict in marital_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 移动到最后:户籍所在地、家庭地址、现住址,每个占一行 -->
|
||||
<el-row :gutter="20">
|
||||
@@ -155,11 +191,13 @@
|
||||
<el-divider content-position="left">学籍信息</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="入学年份" prop="enrollmentYear">
|
||||
<el-input v-model="formData.enrollmentYear" placeholder="请输入入学年份" clearable />
|
||||
<el-form-item label="入学年份" prop="enrollmentYearRange">
|
||||
<el-input v-model="formData.enrollmentYearRange[0]" placeholder="最小值" style="width: 45%" />
|
||||
<span style="margin: 0 3px">-</span>
|
||||
<el-input v-model="formData.enrollmentYearRange[1]" placeholder="最大值" style="width: 45%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入学日期" prop="enrollmentDateRange">
|
||||
<el-date-picker
|
||||
v-model="formData.enrollmentDateRange"
|
||||
@@ -178,13 +216,15 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学制(年)" prop="schoolSystem">
|
||||
<el-input v-model="formData.schoolSystem" placeholder="请输入学制" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学制(年)" prop="schoolSystemRange">
|
||||
<el-input v-model="formData.schoolSystemRange[0]" placeholder="最小值" style="width: 45%" />
|
||||
<span style="margin: 0 3px">-</span>
|
||||
<el-input v-model="formData.schoolSystemRange[1]" placeholder="最大值" style="width: 45%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学历层次" prop="academicLevel">
|
||||
<el-select v-model="formData.academicLevel" placeholder="请选择学历层次" clearable multiple collapse-tags collapse-tags-tooltip>
|
||||
@@ -201,16 +241,18 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年级" prop="grade">
|
||||
<el-input v-model="formData.grade" placeholder="请输入年级" clearable />
|
||||
<el-input v-model="formData.grade[0]" placeholder="最小值" style="width: 45%" />
|
||||
<span style="margin: 0 3px">-</span>
|
||||
<el-input v-model="formData.grade[1]" placeholder="最大值" style="width: 45%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="毕业院校" prop="graduateSchool">
|
||||
<el-input v-model="formData.graduateSchool" placeholder="请输入毕业院校" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学籍状态" prop="studentStatus">
|
||||
<el-select v-model="formData.studentStatus" placeholder="请选择学籍状态" clearable multiple collapse-tags collapse-tags-tooltip>
|
||||
@@ -227,7 +269,24 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="宿舍楼栋" prop="dormitoryBuilding">
|
||||
<el-input v-model="formData.dormitoryBuilding" placeholder="请输入宿舍楼栋" clearable />
|
||||
<el-tree-select
|
||||
v-model="formData.dormitoryBuilding"
|
||||
placeholder="请选择宿舍楼栋"
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
default-expand-all
|
||||
:data="dormBuildingOptions"
|
||||
:props="{
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
disabled: 'disabled',
|
||||
value: 'id'
|
||||
}"
|
||||
check-strictly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -320,8 +379,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="家庭成员数量" prop="familyMembers">
|
||||
<el-input-number v-model="formData.familyMembers" placeholder="请输入家庭成员数量" :min="1" :max="20" />
|
||||
<el-form-item label="家庭成员数量" prop="familyMembersRange">
|
||||
<el-input v-model="formData.familyMembersRange[0]" placeholder="最小值" style="width: 45%" />
|
||||
<span style="margin: 0 3px">-</span>
|
||||
<el-input v-model="formData.familyMembersRange[1]" placeholder="最大值" style="width: 45%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@@ -543,7 +604,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch, computed, getCurrentInstance, toRefs } from 'vue';
|
||||
import { ref, reactive, watch, computed, getCurrentInstance, toRefs, onMounted } from 'vue';
|
||||
import ElMessage from 'element-plus/es/components/message/index';
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 获取当前组件实例
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
@@ -563,7 +626,8 @@ const {
|
||||
sys_yesno,
|
||||
xg_blood_type,
|
||||
disability_type,
|
||||
wenhuachengdu
|
||||
wenhuachengdu,
|
||||
xg_native_place
|
||||
} = toRefs<any>(
|
||||
proxy?.useDict(
|
||||
'sys_user_sex',
|
||||
@@ -579,10 +643,17 @@ const {
|
||||
'sys_yesno',
|
||||
'xg_blood_type',
|
||||
'disability_type',
|
||||
'wenhuachengdu'
|
||||
'wenhuachengdu',
|
||||
'xg_native_place'
|
||||
)
|
||||
);
|
||||
|
||||
// 行政区划选项
|
||||
const regionOptions = ref<any[]>([]);
|
||||
|
||||
// 宿舍楼栋选项
|
||||
const dormBuildingOptions = ref<any[]>([]);
|
||||
|
||||
// Props
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
@@ -612,10 +683,10 @@ const formData = reactive({
|
||||
idCard: '',
|
||||
nameEnglish: '',
|
||||
formerName: '',
|
||||
gender: '',
|
||||
gender: [] as string[],
|
||||
birthDateRange: [] as string[],
|
||||
nationality: [] as string[],
|
||||
nativePlace: '',
|
||||
nativePlace: [] as string[],
|
||||
politicalStatus: [] as string[],
|
||||
hukouLocation: '',
|
||||
homeAddress: '',
|
||||
@@ -630,17 +701,17 @@ const formData = reactive({
|
||||
educationLevel: [] as string[],
|
||||
|
||||
// 学籍信息
|
||||
enrollmentYear: '',
|
||||
enrollmentYearRange: [] as string[],
|
||||
enrollmentDateRange: [] as string[],
|
||||
admissionCategory: [] as string[],
|
||||
schoolSystem: '',
|
||||
schoolSystemRange: [] as string[],
|
||||
academicLevel: [] as string[],
|
||||
trainingType: [] as string[],
|
||||
grade: '',
|
||||
grade: [] as string[],
|
||||
householdRegisterType: [] as string[],
|
||||
studentStatus: [] as string[],
|
||||
isBoarder: [] as string[],
|
||||
dormitoryBuilding: '',
|
||||
dormitoryBuilding: [] as string[],
|
||||
|
||||
// 家庭信息
|
||||
fatherName: '',
|
||||
@@ -656,7 +727,7 @@ const formData = reactive({
|
||||
perCapitaIncomeRange: [] as string[],
|
||||
incomeSource: '',
|
||||
familyEconomicStatus: [] as string[],
|
||||
familyMembers: null as number | null,
|
||||
familyMembersRange: [] as string[],
|
||||
emergencyContactName: '',
|
||||
emergencyContactPhone: '',
|
||||
emergencyContactRelation: '',
|
||||
@@ -670,13 +741,13 @@ const formData = reactive({
|
||||
isSingleChild: [] as string[],
|
||||
isLowIncome: [] as string[],
|
||||
hasLoan: [] as string[],
|
||||
loanAmountRange: [] as number[],
|
||||
loanAmountRange: [] as string[],
|
||||
religion: '',
|
||||
sourceRegion: '',
|
||||
sourceRegion: [] as string[],
|
||||
|
||||
// 健康信息
|
||||
heightRange: [] as number[],
|
||||
weightRange: [] as number[],
|
||||
heightRange: [] as string[],
|
||||
weightRange: [] as string[],
|
||||
bloodType: [] as string[],
|
||||
healthStatus: '',
|
||||
specialCondition: '',
|
||||
@@ -695,8 +766,6 @@ const formData = reactive({
|
||||
updateTimeRange: [] as string[]
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 方法
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false;
|
||||
@@ -717,10 +786,26 @@ const handleReset = () => {
|
||||
};
|
||||
|
||||
const handleSearch = () => {
|
||||
// 构建查询参数
|
||||
const searchParams: any = { ...formData };
|
||||
// 先清空查询参数,只添加有效值
|
||||
const searchParams: any = {};
|
||||
|
||||
// 处理数组类型的参数
|
||||
// 只添加有值的基础字段
|
||||
Object.keys(formData).forEach((key) => {
|
||||
const value = formData[key];
|
||||
if (value !== null && value !== undefined && value !== '') {
|
||||
// 对于数组,检查是否有有效元素
|
||||
if (Array.isArray(value)) {
|
||||
const filteredArray = value.filter((item) => item !== null && item !== undefined && item !== '');
|
||||
if (filteredArray.length > 0) {
|
||||
searchParams[key] = filteredArray;
|
||||
}
|
||||
} else {
|
||||
searchParams[key] = value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 处理日期范围参数
|
||||
if (searchParams.birthDateRange && searchParams.birthDateRange.length === 2) {
|
||||
searchParams.birthDateStart = searchParams.birthDateRange[0];
|
||||
searchParams.birthDateEnd = searchParams.birthDateRange[1];
|
||||
@@ -745,10 +830,219 @@ const handleSearch = () => {
|
||||
}
|
||||
delete searchParams.updateTimeRange;
|
||||
|
||||
// 处理数值范围参数
|
||||
if (searchParams.enrollmentYearRange && searchParams.enrollmentYearRange.length === 2) {
|
||||
searchParams.enrollmentYearStart = searchParams.enrollmentYearRange[0];
|
||||
searchParams.enrollmentYearEnd = searchParams.enrollmentYearRange[1];
|
||||
} else if (searchParams.enrollmentYearRange && searchParams.enrollmentYearRange.length === 1) {
|
||||
if (searchParams.enrollmentYearRange[0]) {
|
||||
searchParams.enrollmentYearStart = searchParams.enrollmentYearRange[0];
|
||||
}
|
||||
if (searchParams.enrollmentYearRange[1]) {
|
||||
searchParams.enrollmentYearEnd = searchParams.enrollmentYearRange[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.enrollmentYearRange;
|
||||
|
||||
if (searchParams.schoolSystemRange && searchParams.schoolSystemRange.length === 2) {
|
||||
searchParams.schoolSystemMin = searchParams.schoolSystemRange[0];
|
||||
searchParams.schoolSystemMax = searchParams.schoolSystemRange[1];
|
||||
} else if (searchParams.schoolSystemRange && searchParams.schoolSystemRange.length === 1) {
|
||||
if (searchParams.schoolSystemRange[0]) {
|
||||
searchParams.schoolSystemMin = searchParams.schoolSystemRange[0];
|
||||
}
|
||||
if (searchParams.schoolSystemRange[1]) {
|
||||
searchParams.schoolSystemMax = searchParams.schoolSystemRange[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.schoolSystemRange;
|
||||
|
||||
if (searchParams.grade && searchParams.grade.length === 2) {
|
||||
searchParams.gradeMin = searchParams.grade[0];
|
||||
searchParams.gradeMax = searchParams.grade[1];
|
||||
} else if (searchParams.grade && searchParams.grade.length === 1) {
|
||||
if (searchParams.grade[0]) {
|
||||
searchParams.gradeMin = searchParams.grade[0];
|
||||
}
|
||||
if (searchParams.grade[1]) {
|
||||
searchParams.gradeMax = searchParams.grade[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.grade;
|
||||
|
||||
if (searchParams.familyIncomeRange && searchParams.familyIncomeRange.length === 2) {
|
||||
searchParams.familyIncomeMin = searchParams.familyIncomeRange[0];
|
||||
searchParams.familyIncomeMax = searchParams.familyIncomeRange[1];
|
||||
} else if (searchParams.familyIncomeRange && searchParams.familyIncomeRange.length === 1) {
|
||||
if (searchParams.familyIncomeRange[0]) {
|
||||
searchParams.familyIncomeMin = searchParams.familyIncomeRange[0];
|
||||
}
|
||||
if (searchParams.familyIncomeRange[1]) {
|
||||
searchParams.familyIncomeMax = searchParams.familyIncomeRange[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.familyIncomeRange;
|
||||
|
||||
if (searchParams.perCapitaIncomeRange && searchParams.perCapitaIncomeRange.length === 2) {
|
||||
searchParams.perCapitaIncomeMin = searchParams.perCapitaIncomeRange[0];
|
||||
searchParams.perCapitaIncomeMax = searchParams.perCapitaIncomeRange[1];
|
||||
} else if (searchParams.perCapitaIncomeRange && searchParams.perCapitaIncomeRange.length === 1) {
|
||||
if (searchParams.perCapitaIncomeRange[0]) {
|
||||
searchParams.perCapitaIncomeMin = searchParams.perCapitaIncomeRange[0];
|
||||
}
|
||||
if (searchParams.perCapitaIncomeRange[1]) {
|
||||
searchParams.perCapitaIncomeMax = searchParams.perCapitaIncomeRange[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.perCapitaIncomeRange;
|
||||
|
||||
if (searchParams.familyMembersRange && searchParams.familyMembersRange.length === 2) {
|
||||
searchParams.familyMembersMin = searchParams.familyMembersRange[0];
|
||||
searchParams.familyMembersMax = searchParams.familyMembersRange[1];
|
||||
} else if (searchParams.familyMembersRange && searchParams.familyMembersRange.length === 1) {
|
||||
if (searchParams.familyMembersRange[0]) {
|
||||
searchParams.familyMembersMin = searchParams.familyMembersRange[0];
|
||||
}
|
||||
if (searchParams.familyMembersRange[1]) {
|
||||
searchParams.familyMembersMax = searchParams.familyMembersRange[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.familyMembersRange;
|
||||
|
||||
if (searchParams.loanAmountRange && searchParams.loanAmountRange.length === 2) {
|
||||
searchParams.loanAmountMin = searchParams.loanAmountRange[0];
|
||||
searchParams.loanAmountMax = searchParams.loanAmountRange[1];
|
||||
} else if (searchParams.loanAmountRange && searchParams.loanAmountRange.length === 1) {
|
||||
if (searchParams.loanAmountRange[0]) {
|
||||
searchParams.loanAmountMin = searchParams.loanAmountRange[0];
|
||||
}
|
||||
if (searchParams.loanAmountRange[1]) {
|
||||
searchParams.loanAmountMax = searchParams.loanAmountRange[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.loanAmountRange;
|
||||
|
||||
if (searchParams.heightRange && searchParams.heightRange.length === 2) {
|
||||
searchParams.heightMin = searchParams.heightRange[0];
|
||||
searchParams.heightMax = searchParams.heightRange[1];
|
||||
} else if (searchParams.heightRange && searchParams.heightRange.length === 1) {
|
||||
if (searchParams.heightRange[0]) {
|
||||
searchParams.heightMin = searchParams.heightRange[0];
|
||||
}
|
||||
if (searchParams.heightRange[1]) {
|
||||
searchParams.heightMax = searchParams.heightRange[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.heightRange;
|
||||
|
||||
if (searchParams.weightRange && searchParams.weightRange.length === 2) {
|
||||
searchParams.weightMin = searchParams.weightRange[0];
|
||||
searchParams.weightMax = searchParams.weightRange[1];
|
||||
} else if (searchParams.weightRange && searchParams.weightRange.length === 1) {
|
||||
if (searchParams.weightRange[0]) {
|
||||
searchParams.weightMin = searchParams.weightRange[0];
|
||||
}
|
||||
if (searchParams.weightRange[1]) {
|
||||
searchParams.weightMax = searchParams.weightRange[1];
|
||||
}
|
||||
}
|
||||
delete searchParams.weightRange;
|
||||
|
||||
// 处理多选下拉框参数 - 确保传递数组格式而不是索引格式
|
||||
// 基础信息多选字段
|
||||
const multiSelectFields = [
|
||||
'gender',
|
||||
'nationality',
|
||||
'nativePlace',
|
||||
'politicalStatus',
|
||||
'maritalStatus',
|
||||
'educationLevel',
|
||||
'admissionCategory',
|
||||
'academicLevel',
|
||||
'trainingType',
|
||||
'householdRegisterType',
|
||||
'studentStatus',
|
||||
'grade',
|
||||
'isBoarder',
|
||||
'dormitoryBuilding',
|
||||
'familyEconomicStatus',
|
||||
'isPoorStudent',
|
||||
'isMinority',
|
||||
'isDisabled',
|
||||
'isOrphan',
|
||||
'isLeftBehindChild',
|
||||
'isSingleChild',
|
||||
'isLowIncome',
|
||||
'hasLoan',
|
||||
'sourceRegion',
|
||||
'bloodType',
|
||||
'disabilityType'
|
||||
];
|
||||
|
||||
multiSelectFields.forEach((field) => {
|
||||
if (searchParams[field] && Array.isArray(searchParams[field])) {
|
||||
// 过滤掉空值,确保只传递有效的数组
|
||||
const filteredArray = searchParams[field].filter((item) => item !== null && item !== undefined && item !== '');
|
||||
if (filteredArray.length > 0) {
|
||||
searchParams[field] = filteredArray;
|
||||
} else {
|
||||
delete searchParams[field];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
console.log(searchParams);
|
||||
emit('search', searchParams);
|
||||
handleClose();
|
||||
};
|
||||
|
||||
// 获取行政区划树形数据
|
||||
const getRegionTree = async () => {
|
||||
try {
|
||||
const res = await request.get('/system/SysRegion/tree');
|
||||
if (res && res.data) {
|
||||
regionOptions.value = res.data;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取行政区划数据失败:', error);
|
||||
ElMessage.error('获取行政区划数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
// 获取宿舍楼栋树形数据
|
||||
const getDormBuildingTree = async () => {
|
||||
try {
|
||||
const res = await request.get('/xgss/dormBuildingTree/list');
|
||||
if (res && res.data) {
|
||||
// 处理数据,为楼栋名称添加性别标识
|
||||
const processTreeData = (nodes: any[]): any[] => {
|
||||
return nodes.map((node) => {
|
||||
const processedNode = { ...node };
|
||||
|
||||
// 如果是楼栋类型,添加性别标识
|
||||
if (node.type === 'building' && node.buildingType) {
|
||||
const genderPrefix = node.buildingType === '1' ? '(男)' : node.buildingType === '2' ? '(女)' : '';
|
||||
processedNode.label = genderPrefix + node.label;
|
||||
processedNode.name = genderPrefix + node.label; // 使用label作为name
|
||||
}
|
||||
|
||||
// 递归处理子节点
|
||||
if (node.children && node.children.length > 0) {
|
||||
processedNode.children = processTreeData(node.children);
|
||||
}
|
||||
|
||||
return processedNode;
|
||||
});
|
||||
};
|
||||
|
||||
dormBuildingOptions.value = processTreeData(res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取宿舍楼栋数据失败:', error);
|
||||
ElMessage.error('获取宿舍楼栋数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
// 监听props变化,同步表单数据
|
||||
watch(
|
||||
() => props.queryParams,
|
||||
@@ -768,6 +1062,17 @@ watch(
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
// 组件挂载时获取数据
|
||||
onMounted(() => {
|
||||
getRegionTree();
|
||||
getDormBuildingTree();
|
||||
});
|
||||
|
||||
// 添加默认导出
|
||||
defineOptions({
|
||||
name: 'AdvancedSearchDialog'
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -783,4 +1088,85 @@ watch(
|
||||
font-weight: bold;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
/* 使用:deep()确保样式穿透到子组件 */
|
||||
:deep(.advanced-search-dialog .el-select .el-select__tags .el-tag) {
|
||||
margin-right: 6px !important;
|
||||
margin-bottom: 4px !important;
|
||||
min-width: 20px !important;
|
||||
max-width: 60px !important;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
/* 确保标签内容可见 - 使用更高优先级 */
|
||||
:deep(.advanced-search-dialog .el-select--multiple .el-select__tags .el-tag .el-tag__content) {
|
||||
overflow: visible !important;
|
||||
text-overflow: unset !important;
|
||||
white-space: nowrap !important;
|
||||
display: inline-block !important;
|
||||
width: auto !important;
|
||||
max-width: 60px !important;
|
||||
}
|
||||
|
||||
/* 确保下拉框容器有足够空间 */
|
||||
:deep(.advanced-search-dialog .el-select--multiple .el-select__tags) {
|
||||
display: flex !important;
|
||||
flex-wrap: wrap !important;
|
||||
align-items: center !important;
|
||||
min-height: 32px !important;
|
||||
}
|
||||
|
||||
/* 针对树形选择器的标签样式 */
|
||||
:deep(.advanced-search-dialog .el-tree-select .el-select__tags .el-tag) {
|
||||
min-width: 20px !important;
|
||||
max-width: 60px !important;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
/* 移除所有强制性的宽度限制 - 使用更高优先级 */
|
||||
:deep(.advanced-search-dialog .el-select--multiple .el-select__tags .el-tag:first-child) {
|
||||
min-width: 20px !important;
|
||||
max-width: 60px !important;
|
||||
width: auto !important;
|
||||
flex-shrink: 0 !important;
|
||||
}
|
||||
|
||||
/* 确保标签文字完整显示 - 使用更高优先级 */
|
||||
:deep(.advanced-search-dialog .el-select--multiple .el-select__tags .el-tag .el-select__tags-text) {
|
||||
overflow: visible !important;
|
||||
text-overflow: unset !important;
|
||||
white-space: nowrap !important;
|
||||
width: auto !important;
|
||||
max-width: 60px !important;
|
||||
}
|
||||
|
||||
/* 直接针对Element Plus的标签样式进行覆盖 */
|
||||
:deep(.el-tag.el-tag--info.el-tag--default.el-tag--light) {
|
||||
min-width: 20px !important;
|
||||
max-width: 60px !important;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
:deep(.el-tag.el-tag--info.el-tag--default.el-tag--light .el-tag__content) {
|
||||
overflow: visible !important;
|
||||
text-overflow: unset !important;
|
||||
white-space: nowrap !important;
|
||||
width: auto !important;
|
||||
max-width: 60px !important;
|
||||
}
|
||||
|
||||
/* 针对所有el-tag的强制覆盖 */
|
||||
:deep(.el-tag) {
|
||||
min-width: 20px !important;
|
||||
max-width: 60px !important;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
:deep(.el-tag .el-tag__content) {
|
||||
overflow: visible !important;
|
||||
text-overflow: unset !important;
|
||||
white-space: nowrap !important;
|
||||
width: auto !important;
|
||||
max-width: 60px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,891 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="1100px" append-to-body @close="handleClose">
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
type="border-card"
|
||||
v-loading="dialogLoading"
|
||||
element-loading-text="正在加载数据,请稍候..."
|
||||
element-loading-background="rgba(0, 0, 0, 0.3)"
|
||||
>
|
||||
<!-- 基础信息Tab -->
|
||||
<el-tab-pane label="基础信息" name="basic">
|
||||
<el-form ref="studentFormRef" :model="form" label-width="100px">
|
||||
<!-- 学生照片和基本信息布局 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="16">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="form.studentNo" placeholder="请输入学号" maxlength="32" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="form.idCard" placeholder="请输入身份证号" maxlength="18" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" maxlength="50" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="英文姓名" prop="nameEnglish">
|
||||
<el-input v-model="form.nameEnglish" placeholder="请输入英文姓名" maxlength="100" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="曾用名" prop="formerName">
|
||||
<el-input v-model="form.formerName" placeholder="请输入曾用名" maxlength="50" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="form.gender" placeholder="请选择性别" disabled>
|
||||
<el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出生日期" prop="birthDate">
|
||||
<el-date-picker
|
||||
v-model="form.birthDate"
|
||||
type="date"
|
||||
placeholder="请选择出生日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="民族" prop="nationality">
|
||||
<el-input v-model="form.nationality" placeholder="请输入民族" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="籍贯" prop="nativePlace">
|
||||
<el-input v-model="form.nativePlace" placeholder="请输入籍贯" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="政治面貌" prop="politicalStatus">
|
||||
<el-input v-model="form.politicalStatus" placeholder="请输入政治面貌" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入手机号码" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电子邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入电子邮箱" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="QQ号码" prop="qq">
|
||||
<el-input v-model="form.qq" placeholder="请输入QQ号码" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="微信号" prop="wechat">
|
||||
<el-input v-model="form.wechat" placeholder="请输入微信号" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="婚姻状况" prop="maritalStatus">
|
||||
<el-select v-model="form.maritalStatus" placeholder="请选择婚姻状况" disabled>
|
||||
<el-option v-for="dict in marital_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="宗教信仰" prop="religion">
|
||||
<el-input v-model="form.religion" placeholder="请输入宗教信仰" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="photoUrl">
|
||||
<template #label>
|
||||
<div class="photo-label-container">
|
||||
<span>学生照片</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="photo-container">
|
||||
<el-avatar :size="120" :src="form.photoUrl || '/src/assets/images/profile.jpg'" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 地址信息 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="户籍所在地" prop="hukouLocation">
|
||||
<el-input v-model="form.hukouLocation" type="textarea" :rows="2" placeholder="请输入户籍所在地" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="家庭地址" prop="homeAddress">
|
||||
<el-input v-model="form.homeAddress" type="textarea" :rows="2" placeholder="请输入家庭地址" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="现住址" prop="currentAddress">
|
||||
<el-input v-model="form.currentAddress" type="textarea" :rows="2" placeholder="请输入现住址" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="邮政编码" prop="postalCode">
|
||||
<el-input v-model="form.postalCode" placeholder="请输入邮政编码" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="生源地区" prop="sourceRegion">
|
||||
<el-input v-model="form.sourceRegion" placeholder="请输入生源地区" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="毕业院校" prop="graduateSchool">
|
||||
<el-input v-model="form.graduateSchool" placeholder="请输入毕业院校" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="户口类型" prop="householdRegisterType">
|
||||
<el-input v-model="form.householdRegisterType" placeholder="请输入户口类型" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 学籍信息Tab -->
|
||||
<el-tab-pane label="学籍信息" name="academic">
|
||||
<el-form ref="academicFormRef" :model="form" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学籍状态" prop="studentStatus">
|
||||
<el-tag :type="getStatusType(form.studentStatus)">
|
||||
{{ getStudentStatusLabel(form.studentStatus) }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入学年份" prop="enrollmentYear">
|
||||
<el-input v-model="form.enrollmentYear" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入学日期" prop="enrollmentDate">
|
||||
<el-date-picker
|
||||
v-model="form.enrollmentDate"
|
||||
type="date"
|
||||
placeholder="请选择入学日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="录取类别" prop="admissionCategory">
|
||||
<el-input v-model="form.admissionCategory" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学制" prop="schoolSystem">
|
||||
<el-input v-model="form.schoolSystem" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学历层次" prop="academicLevel">
|
||||
<el-input v-model="form.academicLevel" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="培养方式" prop="trainingType">
|
||||
<el-input v-model="form.trainingType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="年级" prop="grade">
|
||||
<el-input v-model="form.grade" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否住校" prop="isBoarder">
|
||||
<el-tag :type="form.isBoarder === '1' ? 'success' : 'info'">
|
||||
{{ form.isBoarder === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学院" prop="collegeName">
|
||||
<el-input v-model="form.collegeName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="专业" prop="majorName">
|
||||
<el-input v-model="form.majorName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="form.className" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="辅导员" prop="counselorName">
|
||||
<el-input v-model="form.counselorName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班主任" prop="classTeacherName">
|
||||
<el-input v-model="form.classTeacherName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="宿舍楼栋" prop="dormitoryBuilding">
|
||||
<el-input v-model="form.dormitoryBuilding" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="宿舍房间号" prop="dormitoryRoom">
|
||||
<el-input v-model="form.dormitoryRoom" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行卡号" prop="bankCardNo">
|
||||
<el-input v-model="form.bankCardNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行" prop="bankName">
|
||||
<el-input v-model="form.bankName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 家庭信息Tab -->
|
||||
<el-tab-pane label="家庭信息" name="family">
|
||||
<el-form ref="familyFormRef" :model="form" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="父亲姓名" prop="fatherName">
|
||||
<el-input v-model="form.fatherName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="父亲电话" prop="fatherPhone">
|
||||
<el-input v-model="form.fatherPhone" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="父亲工作单位" prop="fatherWorkUnit">
|
||||
<el-input v-model="form.fatherWorkUnit" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="母亲姓名" prop="motherName">
|
||||
<el-input v-model="form.motherName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="母亲电话" prop="motherPhone">
|
||||
<el-input v-model="form.motherPhone" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="母亲工作单位" prop="motherWorkUnit">
|
||||
<el-input v-model="form.motherWorkUnit" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="监护人姓名" prop="guardianName">
|
||||
<el-input v-model="form.guardianName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="监护人电话" prop="guardianPhone">
|
||||
<el-input v-model="form.guardianPhone" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="监护人关系" prop="guardianRelation">
|
||||
<el-input v-model="form.guardianRelation" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="家庭年收入" prop="familyIncome">
|
||||
<el-input v-model="form.familyIncome" disabled>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="人均收入" prop="perCapitaIncome">
|
||||
<el-input v-model="form.perCapitaIncome" disabled>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收入来源" prop="incomeSource">
|
||||
<el-input v-model="form.incomeSource" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="家庭经济状况" prop="familyEconomicStatus">
|
||||
<el-input v-model="form.familyEconomicStatus" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="家庭成员数量" prop="familyMembers">
|
||||
<el-input v-model="form.familyMembers" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="紧急联系人" prop="emergencyContactName">
|
||||
<el-input v-model="form.emergencyContactName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="紧急联系人电话" prop="emergencyContactPhone">
|
||||
<el-input v-model="form.emergencyContactPhone" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="紧急联系人关系" prop="emergencyContactRelation">
|
||||
<el-input v-model="form.emergencyContactRelation" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 特殊标识Tab -->
|
||||
<el-tab-pane label="特殊标识" name="special">
|
||||
<el-form ref="specialFormRef" :model="form" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否贫困生" prop="isPoorStudent">
|
||||
<el-tag :type="form.isPoorStudent === '1' ? 'warning' : 'info'">
|
||||
{{ form.isPoorStudent === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否少数民族" prop="isMinority">
|
||||
<el-tag :type="form.isMinority === '1' ? 'success' : 'info'">
|
||||
{{ form.isMinority === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否残疾" prop="isDisabled">
|
||||
<el-tag :type="form.isDisabled === '1' ? 'danger' : 'info'">
|
||||
{{ form.isDisabled === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否孤儿" prop="isOrphan">
|
||||
<el-tag :type="form.isOrphan === '1' ? 'danger' : 'info'">
|
||||
{{ form.isOrphan === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否留守儿童" prop="isLeftBehindChild">
|
||||
<el-tag :type="form.isLeftBehindChild === '1' ? 'warning' : 'info'">
|
||||
{{ form.isLeftBehindChild === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否独生子女" prop="isSingleChild">
|
||||
<el-tag :type="form.isSingleChild === '1' ? 'success' : 'info'">
|
||||
{{ form.isSingleChild === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否低保" prop="isLowIncome">
|
||||
<el-tag :type="form.isLowIncome === '1' ? 'warning' : 'info'">
|
||||
{{ form.isLowIncome === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否有助学贷款" prop="hasLoan">
|
||||
<el-tag :type="form.hasLoan === '1' ? 'warning' : 'info'">
|
||||
{{ form.hasLoan === '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="助学贷款金额" prop="loanAmount">
|
||||
<el-input v-model="form.loanAmount" disabled>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="残疾类型" prop="disabilityType">
|
||||
<el-input v-model="form.disabilityType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="残疾等级" prop="disabilityLevel">
|
||||
<el-input v-model="form.disabilityLevel" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 健康信息Tab -->
|
||||
<el-tab-pane label="健康信息" name="health">
|
||||
<el-form ref="healthFormRef" :model="form" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="身高" prop="height">
|
||||
<el-input v-model="form.height" disabled>
|
||||
<template #append>cm</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="体重" prop="weight">
|
||||
<el-input v-model="form.weight" disabled>
|
||||
<template #append>kg</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="血型" prop="bloodType">
|
||||
<el-input v-model="form.bloodType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="健康状况" prop="healthStatus">
|
||||
<el-input v-model="form.healthStatus" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="特殊体质或疾病" prop="specialCondition">
|
||||
<el-input v-model="form.specialCondition" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="病史" prop="medicalHistory">
|
||||
<el-input v-model="form.medicalHistory" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="过敏史" prop="allergies">
|
||||
<el-input v-model="form.allergies" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="特长爱好" prop="specialties">
|
||||
<el-input v-model="form.specialties" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="获奖情况" prop="awards">
|
||||
<el-input v-model="form.awards" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="违纪记录" prop="violations">
|
||||
<el-input v-model="form.violations" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="社会活动" prop="socialActivities">
|
||||
<el-input v-model="form.socialActivities" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, watch, onMounted } from 'vue';
|
||||
|
||||
// Props
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
studentId: number | null;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
visible: false,
|
||||
studentId: null
|
||||
});
|
||||
|
||||
// Emits
|
||||
const emit = defineEmits<{
|
||||
'update:visible': [value: boolean];
|
||||
}>();
|
||||
|
||||
// 响应式数据
|
||||
const dialogVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (value) => emit('update:visible', value)
|
||||
});
|
||||
|
||||
const dialogTitle = ref('学生详情');
|
||||
const activeTab = ref('basic');
|
||||
const dialogLoading = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const form = reactive({
|
||||
// 基础信息
|
||||
id: null as number | null,
|
||||
studentNo: '',
|
||||
idCard: '',
|
||||
name: '',
|
||||
nameEnglish: '',
|
||||
formerName: '',
|
||||
gender: '',
|
||||
birthDate: '',
|
||||
nationality: '',
|
||||
nativePlace: '',
|
||||
politicalStatus: '',
|
||||
hukouLocation: '',
|
||||
homeAddress: '',
|
||||
currentAddress: '',
|
||||
postalCode: '',
|
||||
photoUrl: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
qq: '',
|
||||
wechat: '',
|
||||
maritalStatus: '',
|
||||
religion: '',
|
||||
sourceRegion: '',
|
||||
graduateSchool: '',
|
||||
householdRegisterType: '',
|
||||
|
||||
// 学籍信息
|
||||
studentStatus: '',
|
||||
enrollmentYear: '',
|
||||
enrollmentDate: '',
|
||||
admissionCategory: '',
|
||||
schoolSystem: '',
|
||||
academicLevel: '',
|
||||
trainingType: '',
|
||||
grade: '',
|
||||
isBoarder: '',
|
||||
collegeName: '',
|
||||
majorName: '',
|
||||
className: '',
|
||||
counselorName: '',
|
||||
classTeacherName: '',
|
||||
dormitoryBuilding: '',
|
||||
dormitoryRoom: '',
|
||||
bankCardNo: '',
|
||||
bankName: '',
|
||||
|
||||
// 家庭信息
|
||||
fatherName: '',
|
||||
fatherPhone: '',
|
||||
fatherWorkUnit: '',
|
||||
motherName: '',
|
||||
motherPhone: '',
|
||||
motherWorkUnit: '',
|
||||
guardianName: '',
|
||||
guardianPhone: '',
|
||||
guardianRelation: '',
|
||||
familyIncome: '',
|
||||
perCapitaIncome: '',
|
||||
incomeSource: '',
|
||||
familyEconomicStatus: '',
|
||||
familyMembers: '',
|
||||
emergencyContactName: '',
|
||||
emergencyContactPhone: '',
|
||||
emergencyContactRelation: '',
|
||||
|
||||
// 特殊标识
|
||||
isPoorStudent: '',
|
||||
isMinority: '',
|
||||
isDisabled: '',
|
||||
isOrphan: '',
|
||||
isLeftBehindChild: '',
|
||||
isSingleChild: '',
|
||||
isLowIncome: '',
|
||||
hasLoan: '',
|
||||
loanAmount: '',
|
||||
disabilityType: '',
|
||||
disabilityLevel: '',
|
||||
|
||||
// 健康信息
|
||||
height: '',
|
||||
weight: '',
|
||||
bloodType: '',
|
||||
healthStatus: '',
|
||||
specialCondition: '',
|
||||
medicalHistory: '',
|
||||
allergies: '',
|
||||
specialties: '',
|
||||
awards: '',
|
||||
violations: '',
|
||||
socialActivities: ''
|
||||
});
|
||||
|
||||
// 字典数据
|
||||
const sys_user_sex = ref([
|
||||
{ value: '0', label: '男' },
|
||||
{ value: '1', label: '女' }
|
||||
]);
|
||||
|
||||
const marital_status = ref([
|
||||
{ value: '1', label: '未婚' },
|
||||
{ value: '2', label: '已婚' },
|
||||
{ value: '3', label: '离异' },
|
||||
{ value: '4', label: '丧偶' }
|
||||
]);
|
||||
|
||||
// 模拟数据
|
||||
const mockStudentData = {
|
||||
id: 1,
|
||||
studentNo: '2021001',
|
||||
idCard: '110101200001011234',
|
||||
name: '张三',
|
||||
nameEnglish: 'Zhang San',
|
||||
formerName: '',
|
||||
gender: '0',
|
||||
birthDate: '2000-01-01',
|
||||
nationality: '汉族',
|
||||
nativePlace: '北京市',
|
||||
politicalStatus: '共青团员',
|
||||
hukouLocation: '北京市朝阳区',
|
||||
homeAddress: '北京市朝阳区某某街道某某小区',
|
||||
currentAddress: '北京市海淀区某某大学宿舍',
|
||||
postalCode: '100000',
|
||||
photoUrl: '',
|
||||
phone: '13800138001',
|
||||
email: 'zhangsan@example.com',
|
||||
qq: '123456789',
|
||||
wechat: 'zhangsan123',
|
||||
maritalStatus: '1',
|
||||
religion: '',
|
||||
sourceRegion: '北京市',
|
||||
graduateSchool: '北京市第一中学',
|
||||
householdRegisterType: '非农业',
|
||||
|
||||
// 学籍信息
|
||||
studentStatus: '1',
|
||||
enrollmentYear: '2021',
|
||||
enrollmentDate: '2021-09-01',
|
||||
admissionCategory: '统招',
|
||||
schoolSystem: '4',
|
||||
academicLevel: '本科',
|
||||
trainingType: '全日制',
|
||||
grade: '2021',
|
||||
isBoarder: '1',
|
||||
collegeName: '计算机学院',
|
||||
majorName: '软件工程',
|
||||
className: '软件2101班',
|
||||
counselorName: '李老师',
|
||||
classTeacherName: '王老师',
|
||||
dormitoryBuilding: '1号楼',
|
||||
dormitoryRoom: '101',
|
||||
bankCardNo: '6222021234567890123',
|
||||
bankName: '中国工商银行',
|
||||
|
||||
// 家庭信息
|
||||
fatherName: '张父',
|
||||
fatherPhone: '13900139001',
|
||||
fatherWorkUnit: '某某公司',
|
||||
motherName: '张母',
|
||||
motherPhone: '13900139002',
|
||||
motherWorkUnit: '某某单位',
|
||||
guardianName: '张父',
|
||||
guardianPhone: '13900139001',
|
||||
guardianRelation: '父亲',
|
||||
familyIncome: '120000',
|
||||
perCapitaIncome: '40000',
|
||||
incomeSource: '工资收入',
|
||||
familyEconomicStatus: '一般',
|
||||
familyMembers: '3',
|
||||
emergencyContactName: '张父',
|
||||
emergencyContactPhone: '13900139001',
|
||||
emergencyContactRelation: '父亲',
|
||||
|
||||
// 特殊标识
|
||||
isPoorStudent: '0',
|
||||
isMinority: '0',
|
||||
isDisabled: '0',
|
||||
isOrphan: '0',
|
||||
isLeftBehindChild: '0',
|
||||
isSingleChild: '1',
|
||||
isLowIncome: '0',
|
||||
hasLoan: '0',
|
||||
loanAmount: '0',
|
||||
disabilityType: '',
|
||||
disabilityLevel: '',
|
||||
|
||||
// 健康信息
|
||||
height: '175',
|
||||
weight: '65',
|
||||
bloodType: 'A型',
|
||||
healthStatus: '良好',
|
||||
specialCondition: '',
|
||||
medicalHistory: '',
|
||||
allergies: '',
|
||||
specialties: '篮球、编程',
|
||||
awards: '校级优秀学生',
|
||||
violations: '',
|
||||
socialActivities: '学生会成员、志愿者'
|
||||
};
|
||||
|
||||
// 方法
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
const getStatusType = (status: string) => {
|
||||
const statusMap: Record<string, string> = {
|
||||
'1': 'success',
|
||||
'2': 'warning',
|
||||
'3': 'info',
|
||||
'4': 'danger',
|
||||
'5': 'info'
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
};
|
||||
|
||||
const getStudentStatusLabel = (status: string) => {
|
||||
const statusMap: Record<string, string> = {
|
||||
'1': '在籍',
|
||||
'2': '休学',
|
||||
'3': '复学',
|
||||
'4': '退学',
|
||||
'5': '毕业'
|
||||
};
|
||||
return statusMap[status] || '未知';
|
||||
};
|
||||
|
||||
const loadStudentData = async (studentId: number) => {
|
||||
dialogLoading.value = true;
|
||||
try {
|
||||
// 模拟API调用
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
|
||||
// 使用模拟数据
|
||||
Object.assign(form, mockStudentData);
|
||||
|
||||
} catch (error) {
|
||||
console.error('加载学生数据失败:', error);
|
||||
} finally {
|
||||
dialogLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 监听studentId变化
|
||||
watch(() => props.studentId, (newId) => {
|
||||
if (newId && dialogVisible.value) {
|
||||
loadStudentData(newId);
|
||||
}
|
||||
});
|
||||
|
||||
// 监听弹窗显示状态
|
||||
watch(() => props.visible, (visible) => {
|
||||
if (visible && props.studentId) {
|
||||
loadStudentData(props.studentId);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.photo-label-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.photo-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.el-tag {
|
||||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user