Skip to content

Commit

Permalink
Merge pull request #173 from xixiIBN5100/master
Browse files Browse the repository at this point in the history
fix(freeRoom): unexpected undefined buildName
  • Loading branch information
xixiIBN5100 authored Jan 4, 2025
2 parents 83879ed + a63fdbb commit 0f6cbf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/constants/freeroomMap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const freeroomMap = {
: "机械楼",
: "子良楼",
: "新教楼",
: "文荟楼",
Expand Down
7 changes: 4 additions & 3 deletions src/pages/freeroom/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ const building = computed(() => {
const tmp: Record<string, Room[]> = {};
serviceStore.zf.roomInfo.data?.forEach((item: Room) => {
if (!tmp[freeroomMap[item.buildName[0]]])
tmp[freeroomMap[item.buildName[0]]] = [];
tmp[freeroomMap[item.buildName[0]]].push(item);
// TODO: 上报无教学楼匹配

Check warning on line 64 in src/pages/freeroom/index.vue

View workflow job for this annotation

GitHub Actions / cache-and-install

Unexpected 'todo' comment: 'TODO: 上报无教学楼匹配'
const fullBuildName = freeroomMap[item.buildName[0]] || "未知教室";
if (!tmp[fullBuildName]) tmp[fullBuildName] = [];
tmp[fullBuildName].push(item);
});
Object.keys(tmp).forEach((key) => {
buildingList.push({
Expand Down

0 comments on commit 0f6cbf9

Please sign in to comment.