diff --git a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgDormAreaServiceImpl.java b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgDormAreaServiceImpl.java index 39732318..5ddd8881 100644 --- a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgDormAreaServiceImpl.java +++ b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgDormAreaServiceImpl.java @@ -60,7 +60,8 @@ public class XgDormAreaServiceImpl implements IXgDormAreaService { */ @Override public TableDataInfo queryPageList(XgDormAreaBo bo, PageQuery pageQuery) { - Page result = baseMapper.selectPageWithCampusName(pageQuery.build(), bo); + // 禁用默认的全局排序列(create_time),避免在 join 查询中出现未加表别名的列导致歧义 + Page result = baseMapper.selectPageWithCampusName(pageQuery.disableDefaultOrder().build(), bo); return TableDataInfo.build(result); } diff --git a/web/src/views/xg/xgss/sslxx/dormBuilding/index.vue b/web/src/views/xg/xgss/sslxx/dormBuilding/index.vue index 5afce722..106618a7 100644 --- a/web/src/views/xg/xgss/sslxx/dormBuilding/index.vue +++ b/web/src/views/xg/xgss/sslxx/dormBuilding/index.vue @@ -149,7 +149,7 @@ import { } from '@/api/xg/xgss/sslxx/dormBuilding'; import { DormBuildingVO, DormBuildingQuery, DormBuildingForm } from '@/api/xg/xgss/sslxx/dormBuilding/types'; import { DormCampusVO } from '@/api/xg/xgss/xqxx/dormCampus/types'; -import { getCurrentInstance, ComponentInternalInstance, ref, reactive, toRefs, onMounted } from 'vue'; +import { getCurrentInstance, ComponentInternalInstance, ref, reactive, toRefs, onMounted, watch } from 'vue'; import { ElForm, ElMessageBox, ElMessage } from 'element-plus'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -178,8 +178,10 @@ const initFormData: DormBuildingForm = { buildingCode: undefined, buildingName: undefined, campusId: undefined, + areaId: '2015638219126755329', buildingType: undefined, buildingDescription: undefined, + remark: undefined, sortOrder: undefined, floors: 6 // 添加默认值为6 }; @@ -220,6 +222,30 @@ const loadCampusOptions = async () => { campusList.value = res.rows || []; }; +// 默认宿舍区映射(按校区名称判断) +const AREA_DEFAULTS: Record = { + '临安校区': '2015638219126755329', + '西溪校区': '2015639946668298241' +}; + +const deriveAreaIdFromCampusId = (campusId?: string | number) => { + const defaultArea = AREA_DEFAULTS['临安校区']; + if (!campusId) return defaultArea; + const campus = campusList.value.find((c: any) => String(c.id) === String(campusId)); + if (!campus || !campus.campusName) return defaultArea; + if (campus.campusName.includes('临安')) return AREA_DEFAULTS['临安校区']; + if (campus.campusName.includes('西溪')) return AREA_DEFAULTS['西溪校区']; + return defaultArea; +}; + +// 当选择校区变化时,自动设置 areaId +watch( + () => form.value.campusId, + (newCampusId) => { + (form.value as any).areaId = deriveAreaIdFromCampusId(newCampusId); + } +); + /** 搜索按钮操作 */ const handleQuery = () => { queryParams.value.pageNum = 1; @@ -252,6 +278,10 @@ const handleUpdate = async (row?: DormBuildingVO) => { const _id = row?.id || ids.value[0]; const res = await getDormBuilding(_id); Object.assign(form.value, res.data); + // If areaId is missing from returned data, default it based on campus + if (!(form.value as any).areaId) { + (form.value as any).areaId = deriveAreaIdFromCampusId(form.value.campusId); + } dialog.visible = true; dialog.title = '修改宿舍楼信息'; }; @@ -261,6 +291,10 @@ const submitForm = () => { dormBuildingFormRef.value?.validate(async (valid: boolean) => { if (valid) { buttonLoading.value = true; + // Ensure areaId defaults based on selected campus before submitting + if (!(form.value as any).areaId) { + (form.value as any).areaId = deriveAreaIdFromCampusId(form.value.campusId); + } if (form.value.id) { await updateDormBuilding(form.value) .then(() => { @@ -303,6 +337,8 @@ const handleDelete = async (row?: DormBuildingVO) => { /** 重置操作表单 */ const reset = () => { form.value = { ...initFormData }; + // default areaId for new forms/reset based on current campus selection (or 临安) + (form.value as any).areaId = deriveAreaIdFromCampusId(form.value.campusId); dormBuildingFormRef.value?.resetFields(); }; diff --git a/web/src/views/xg/xgss/xsssfjgl/index.vue b/web/src/views/xg/xgss/xsssfjgl/index.vue index 0c070997..277576f5 100644 --- a/web/src/views/xg/xgss/xsssfjgl/index.vue +++ b/web/src/views/xg/xgss/xsssfjgl/index.vue @@ -110,61 +110,62 @@ - -
-
- - {{ floor }}层 - 自动添加房间 - 添加房间 - + +
+
+ +
-
- -
- - -
-
- 类型:{{ room.roomType === '1' ? '标准间' : room.roomType === '2' ? '单人间' : '套间' }} -
-
床位:{{ room.currentBeds || 0 }}/{{ room.actualBeds }}
-
排序:{{ room.sort || 0 }}
-
-
- 床位管理 -
-
- - -
-
-
-
+ +
- - -
- -
diff --git a/副本统一身份认证接入指南.docx b/副本统一身份认证接入指南.docx new file mode 100644 index 00000000..73cfb5f6 Binary files /dev/null and b/副本统一身份认证接入指南.docx differ