3656 lines
108 KiB
Vue
3656 lines
108 KiB
Vue
<script setup lang="ts">
|
||
import { useI18n } from "vue-i18n";
|
||
const { t } = useI18n();
|
||
import { computed, onMounted, reactive, ref } from "vue";
|
||
import { Calendar, Check, Plus, Refresh, User } from "@element-plus/icons-vue";
|
||
import { ElMessage, ElMessageBox } from "element-plus";
|
||
import http, { apiErrorMessage } from "../api/http";
|
||
import { useAuthStore } from "../stores/auth";
|
||
import {
|
||
academicTermLabel,
|
||
academicTermOptionClass,
|
||
defaultAcademicTermId,
|
||
} from "../utils/academicTerms";
|
||
|
||
const auth = useAuthStore();
|
||
const isStudent = computed(() => auth.user?.roles.includes("Student") ?? false);
|
||
const loading = ref(false);
|
||
const terms = ref<any[]>([]);
|
||
const termId = ref("");
|
||
const projects = ref<any[]>([]);
|
||
const total = ref(0);
|
||
const page = ref(1);
|
||
const pageSize = ref(20);
|
||
const selectedProjectIds = ref<string[]>([]);
|
||
const options = reactive({
|
||
tasks: [] as any[],
|
||
colleges: [] as any[],
|
||
scheduleEntries: [] as any[],
|
||
classrooms: [] as any[],
|
||
teachers: [] as any[],
|
||
periods: [] as any[],
|
||
taskTotal: 0,
|
||
tasksTruncated: false,
|
||
scheduleEntryTotal: 0,
|
||
scheduleEntriesTruncated: false,
|
||
});
|
||
const modeFilter = ref("");
|
||
const statusFilter = ref("");
|
||
const offeringCollegeId = ref("");
|
||
const courseKeyword = ref("");
|
||
const classKeyword = ref("");
|
||
const teacherKeyword = ref("");
|
||
const taskKeyword = ref("");
|
||
|
||
const projectDialog = ref(false);
|
||
const editingProjectId = ref("");
|
||
const correctingPublishedProject = ref(false);
|
||
const projectForm = reactive({
|
||
teachingTaskIds: [] as string[],
|
||
scheduleEntryId: "",
|
||
code: "",
|
||
name: "",
|
||
projectNames: "",
|
||
nameMode: "Sequence",
|
||
projectCount: 1,
|
||
arrangementMode: "Centralized",
|
||
description: "",
|
||
requirements: "",
|
||
dates: [] as string[],
|
||
selectionTimes: [] as string[],
|
||
});
|
||
|
||
const batchRenameDialog = ref(false);
|
||
const batchRenameProjectIds = ref<string[]>([]);
|
||
const batchRenameNames = ref("");
|
||
|
||
const sessionDialog = ref(false);
|
||
const selectedProject = ref<any>(null);
|
||
const sessionForm = reactive({
|
||
classroomId: "",
|
||
sessionDate: "",
|
||
startPeriod: undefined as number | undefined,
|
||
periodCount: 2,
|
||
capacity: 30,
|
||
notes: "",
|
||
instructorTeacherIds: [] as string[],
|
||
});
|
||
|
||
const batchSessionDialog = ref(false);
|
||
const batchSessionProjectIds = ref<string[]>([]);
|
||
const batchSessionRows = ref<any[]>([]);
|
||
|
||
const participantsDialog = ref(false);
|
||
const participantSession = ref<any>(null);
|
||
const participants = ref<any[]>([]);
|
||
const participantsLoading = ref(false);
|
||
const proxyBookingDialog = ref(false);
|
||
const proxyBookingStudents = ref<any[]>([]);
|
||
const proxyBookingLoading = ref(false);
|
||
const proxyBookingKeyword = ref("");
|
||
const proxyBookingStudentIds = ref<string[]>([]);
|
||
const proxyBookingPage = ref(1);
|
||
const proxyBookingPageSize = 20;
|
||
const proxyBookingTotal = ref(0);
|
||
|
||
const selectedTask = computed(() =>
|
||
options.tasks.find((task) => task.id === projectForm.teachingTaskIds[0]),
|
||
);
|
||
const selectedScheduleEntry = computed(() =>
|
||
options.scheduleEntries.find(
|
||
(entry) => entry.id === projectForm.scheduleEntryId,
|
||
),
|
||
);
|
||
const batchProjectOptions = computed(() =>
|
||
projects.value.filter(
|
||
(project) =>
|
||
project.status !== "Closed" &&
|
||
project.arrangementMode === "SelfScheduled",
|
||
),
|
||
);
|
||
const taskGroups = computed(() => {
|
||
const groups = new Map<string, any>();
|
||
options.tasks.forEach((task) => {
|
||
const key = `${task.academicTermId}-${task.courseId}`;
|
||
const group = groups.get(key) ?? {
|
||
key,
|
||
termName: task.termName,
|
||
courseCode: task.courseCode,
|
||
courseName: task.courseName,
|
||
tasks: [],
|
||
};
|
||
group.tasks.push(task);
|
||
groups.set(key, group);
|
||
});
|
||
return [...groups.values()];
|
||
});
|
||
const projectGroups = computed(() => {
|
||
const groups = new Map<string, any>();
|
||
projects.value.forEach((project) => {
|
||
const classKey = [...(project.classNames ?? [])].sort().join("|");
|
||
const key = `${project.academicTermId}-${project.courseCode}-${classKey}`;
|
||
const group = groups.get(key) ?? {
|
||
key,
|
||
termName: project.termName,
|
||
courseCode: project.courseCode,
|
||
courseName: project.courseName,
|
||
classNames: project.classNames,
|
||
teacherNames: project.teacherNames,
|
||
taskNumbers: [],
|
||
projects: [],
|
||
};
|
||
if (!group.taskNumbers.includes(project.taskNumber))
|
||
group.taskNumbers.push(project.taskNumber);
|
||
group.projects.push(project);
|
||
groups.set(key, group);
|
||
});
|
||
return [...groups.values()];
|
||
});
|
||
const draftSelectedProjectIds = computed(() =>
|
||
selectedProjectIds.value.filter((id) =>
|
||
projects.value.some(
|
||
(project) => project.id === id && project.status === "Draft",
|
||
),
|
||
),
|
||
);
|
||
const batchRenameProjects = computed(() =>
|
||
projects.value.filter((project) =>
|
||
batchRenameProjectIds.value.includes(project.id),
|
||
),
|
||
);
|
||
const allPageDraftSelected = computed(() => {
|
||
const ids = projects.value
|
||
.filter((project) => project.status === "Draft")
|
||
.map((project) => project.id);
|
||
return (
|
||
ids.length > 0 && ids.every((id) => selectedProjectIds.value.includes(id))
|
||
);
|
||
});
|
||
const activePeriods = computed(() =>
|
||
options.periods.filter(
|
||
(period) =>
|
||
!selectedProject.value ||
|
||
period.academicTermId === selectedProject.value.academicTermId,
|
||
),
|
||
);
|
||
const experimentClassrooms = computed(() => options.classrooms);
|
||
|
||
const modeMeta = computed<Record<string, { label: string; note: string }>>(
|
||
() => ({
|
||
Centralized: {
|
||
label: t("experimentsScript.scheduled2"),
|
||
note: t("experimentsScript.attendAsScheduledNoStudentBookingRequired"),
|
||
},
|
||
SelfScheduled: {
|
||
label: t("experimentsScript.selfBooked"),
|
||
note: t(
|
||
"experimentsScript.studentsBookAnOpenSessionForTheRequiredProject",
|
||
),
|
||
},
|
||
}),
|
||
);
|
||
|
||
const statusLabels = computed<Record<string, string>>(() => ({
|
||
Draft: t("experimentsScript.draft"),
|
||
Published: t("experimentsScript.inProgress"),
|
||
Closed: t("experimentsScript.closed"),
|
||
}));
|
||
|
||
function resetProjectForm() {
|
||
editingProjectId.value = "";
|
||
correctingPublishedProject.value = false;
|
||
Object.assign(projectForm, {
|
||
teachingTaskIds: [],
|
||
scheduleEntryId: "",
|
||
code: "",
|
||
name: "",
|
||
projectNames: "",
|
||
nameMode: "Sequence",
|
||
projectCount: 1,
|
||
arrangementMode: "Centralized",
|
||
description: "",
|
||
requirements: "",
|
||
dates: [],
|
||
selectionTimes: [],
|
||
});
|
||
}
|
||
|
||
function onTaskChange() {
|
||
const task = selectedTask.value;
|
||
if (!task) return;
|
||
projectForm.dates = [task.termStartDate, task.termEndDate];
|
||
}
|
||
|
||
function onScheduleEntryChange() {
|
||
const entry = selectedScheduleEntry.value;
|
||
if (!entry) return;
|
||
projectForm.teachingTaskIds = [entry.teachingTaskId];
|
||
onTaskChange();
|
||
}
|
||
|
||
function formatScheduleEntry(entry: any) {
|
||
const classes =
|
||
entry.classNames?.join("、") || t("experimentsScript.enrolledStudents");
|
||
return t("experimentsScript.entry", {
|
||
code: entry.courseCode,
|
||
course: entry.courseName,
|
||
task: entry.taskNumber,
|
||
classes,
|
||
day: entry.dayOfWeek,
|
||
start: entry.startPeriod,
|
||
end: entry.startPeriod + entry.periodCount - 1,
|
||
campus: entry.campusName,
|
||
building: entry.buildingName,
|
||
room: entry.classroomName,
|
||
});
|
||
}
|
||
|
||
function openCreateProject() {
|
||
resetProjectForm();
|
||
projectDialog.value = true;
|
||
}
|
||
|
||
function openEditProject(project: any) {
|
||
editingProjectId.value = project.id;
|
||
correctingPublishedProject.value = false;
|
||
Object.assign(projectForm, {
|
||
teachingTaskIds: [project.teachingTaskId],
|
||
scheduleEntryId: project.scheduleEntryId ?? "",
|
||
code: project.code,
|
||
name: project.name,
|
||
projectNames: "",
|
||
nameMode: "Sequence",
|
||
arrangementMode: project.arrangementMode,
|
||
description: project.description ?? "",
|
||
requirements: project.requirements ?? "",
|
||
dates: [project.startDate, project.endDate],
|
||
selectionTimes:
|
||
project.selectionStartsAt && project.selectionEndsAt
|
||
? [project.selectionStartsAt, project.selectionEndsAt]
|
||
: [],
|
||
});
|
||
projectDialog.value = true;
|
||
}
|
||
|
||
function openCorrectPublishedProject(project: any) {
|
||
openEditProject(project);
|
||
correctingPublishedProject.value = true;
|
||
}
|
||
|
||
function projectNameLines(value: string) {
|
||
return value
|
||
.split(/\r?\n/)
|
||
.map((name) => name.trim())
|
||
.filter(Boolean);
|
||
}
|
||
|
||
async function saveProject() {
|
||
const names = projectNameLines(projectForm.projectNames);
|
||
const hasValidName =
|
||
correctingPublishedProject.value || editingProjectId.value
|
||
? !!projectForm.name.trim()
|
||
: projectForm.nameMode === "InputNames"
|
||
? names.length > 0
|
||
: !!projectForm.name.trim();
|
||
if (
|
||
(!correctingPublishedProject.value &&
|
||
!projectForm.teachingTaskIds.length) ||
|
||
(editingProjectId.value &&
|
||
projectForm.arrangementMode === "Centralized" &&
|
||
!projectForm.scheduleEntryId) ||
|
||
!projectForm.code.trim() ||
|
||
!hasValidName ||
|
||
projectForm.dates.length !== 2 ||
|
||
(projectForm.arrangementMode === "SelfScheduled" &&
|
||
projectForm.selectionTimes.length !== 2)
|
||
) {
|
||
ElMessage.warning(
|
||
projectForm.arrangementMode === "Centralized" && editingProjectId.value
|
||
? t(
|
||
"experimentsScript.selectAScheduledLabAndEnterTheProjectCodeNameAndOpenDates",
|
||
)
|
||
: t(
|
||
"experimentsScript.enterTheTeachingTaskProjectCodeNameOpenDatesAndBookingPeriod",
|
||
),
|
||
);
|
||
return;
|
||
}
|
||
const payload = {
|
||
teachingTaskId: projectForm.teachingTaskIds[0],
|
||
scheduleEntryId: projectForm.scheduleEntryId || null,
|
||
code: projectForm.code,
|
||
name:
|
||
projectForm.nameMode === "InputNames" && !editingProjectId.value
|
||
? names[0]
|
||
: projectForm.name,
|
||
projectCount:
|
||
projectForm.arrangementMode === "SelfScheduled"
|
||
? projectForm.nameMode === "InputNames"
|
||
? names.length
|
||
: projectForm.projectCount
|
||
: 1,
|
||
arrangementMode: projectForm.arrangementMode,
|
||
description: projectForm.description || null,
|
||
requirements: projectForm.requirements || null,
|
||
startDate: projectForm.dates[0],
|
||
endDate: projectForm.dates[1],
|
||
selectionStartsAt:
|
||
projectForm.arrangementMode === "SelfScheduled"
|
||
? projectForm.selectionTimes[0] || null
|
||
: null,
|
||
selectionEndsAt:
|
||
projectForm.arrangementMode === "SelfScheduled"
|
||
? projectForm.selectionTimes[1] || null
|
||
: null,
|
||
};
|
||
try {
|
||
if (correctingPublishedProject.value) {
|
||
await http.put(
|
||
`/experiments/${editingProjectId.value}/published-details`,
|
||
{
|
||
name: projectForm.name,
|
||
description: projectForm.description || null,
|
||
requirements: projectForm.requirements || null,
|
||
},
|
||
);
|
||
ElMessage.success(
|
||
t(
|
||
"experimentsScript.publishedProjectContentCorrectedAndStudentsNotified",
|
||
),
|
||
);
|
||
} else if (editingProjectId.value) {
|
||
await http.put(`/experiments/${editingProjectId.value}`, payload);
|
||
ElMessage.success(t("experimentsScript.labProjectUpdated"));
|
||
} else {
|
||
await http.post("/experiments/batch", {
|
||
...payload,
|
||
teachingTaskId: undefined,
|
||
teachingTaskIds: projectForm.teachingTaskIds,
|
||
names: projectForm.nameMode === "InputNames" ? names : undefined,
|
||
generateSequentialNames: projectForm.nameMode === "Sequence",
|
||
});
|
||
ElMessage.success(
|
||
projectForm.arrangementMode === "Centralized"
|
||
? t("experimentsScript.createdCentral", {
|
||
count: projectForm.teachingTaskIds.length,
|
||
})
|
||
: t("experimentsScript.createdOpen", {
|
||
tasks: projectForm.teachingTaskIds.length,
|
||
projects:
|
||
projectForm.teachingTaskIds.length * payload.projectCount,
|
||
}),
|
||
);
|
||
}
|
||
projectDialog.value = false;
|
||
await load();
|
||
} catch (error) {
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
function openBatchSession() {
|
||
batchSessionProjectIds.value = [];
|
||
batchSessionRows.value = [];
|
||
batchSessionDialog.value = true;
|
||
}
|
||
|
||
function syncBatchSessionRows() {
|
||
const existing = new Map<string, any[]>();
|
||
batchSessionRows.value.forEach((row) => {
|
||
const rows = existing.get(row.projectId) ?? [];
|
||
rows.push(row);
|
||
existing.set(row.projectId, rows);
|
||
});
|
||
batchSessionRows.value = batchSessionProjectIds.value.flatMap((projectId) => {
|
||
const current = existing.get(projectId);
|
||
if (current?.length) return current;
|
||
return [newBatchSessionRow(projectId)];
|
||
});
|
||
}
|
||
|
||
function newBatchSessionRow(projectId: string, source?: any) {
|
||
const project = projects.value.find((item) => item.id === projectId);
|
||
const firstPeriod = options.periods.find(
|
||
(item) => item.academicTermId === project?.academicTermId,
|
||
);
|
||
return {
|
||
rowKey: crypto.randomUUID(),
|
||
projectId,
|
||
classroomId: source?.classroomId ?? "",
|
||
sessionDate: source?.sessionDate ?? project?.startDate ?? "",
|
||
startPeriod: source?.startPeriod ?? firstPeriod?.periodNumber,
|
||
periodCount: source?.periodCount ?? 2,
|
||
capacity: source?.capacity ?? 30,
|
||
notes: "",
|
||
instructorTeacherIds: source?.instructorTeacherIds
|
||
? [...source.instructorTeacherIds]
|
||
: [],
|
||
};
|
||
}
|
||
|
||
function addBatchSessionRow(projectId: string, source: any) {
|
||
batchSessionRows.value.push(newBatchSessionRow(projectId, source));
|
||
}
|
||
|
||
function removeBatchSessionRow(row: any) {
|
||
const sameProjectRows = batchSessionRows.value.filter(
|
||
(item) => item.projectId === row.projectId,
|
||
);
|
||
if (sameProjectRows.length === 1) {
|
||
batchSessionProjectIds.value = batchSessionProjectIds.value.filter(
|
||
(id) => id !== row.projectId,
|
||
);
|
||
}
|
||
batchSessionRows.value = batchSessionRows.value.filter(
|
||
(item) => item.rowKey !== row.rowKey,
|
||
);
|
||
}
|
||
|
||
function applyFirstBatchTime() {
|
||
const first = batchSessionRows.value[0];
|
||
if (!first) return;
|
||
batchSessionRows.value.slice(1).forEach((row) => {
|
||
row.sessionDate = first.sessionDate;
|
||
row.startPeriod = first.startPeriod;
|
||
row.periodCount = first.periodCount;
|
||
});
|
||
ElMessage.success(
|
||
t(
|
||
"experimentsScript.firstRowDateAndPeriodsAppliedSelectAvailableLaboratoriesForEachRow",
|
||
),
|
||
);
|
||
}
|
||
|
||
function batchProject(projectId: string) {
|
||
return projects.value.find((project) => project.id === projectId);
|
||
}
|
||
|
||
function periodsForProject(projectId: string) {
|
||
const project = batchProject(projectId);
|
||
return options.periods.filter(
|
||
(period) => period.academicTermId === project?.academicTermId,
|
||
);
|
||
}
|
||
|
||
async function saveBatchSessions() {
|
||
if (!batchSessionRows.value.length) {
|
||
ElMessage.warning(t("experimentsScript.selectAtLeastOneLabProject"));
|
||
return;
|
||
}
|
||
if (
|
||
batchSessionRows.value.some(
|
||
(row) =>
|
||
!row.classroomId ||
|
||
!row.sessionDate ||
|
||
!row.startPeriod ||
|
||
!row.periodCount ||
|
||
!row.instructorTeacherIds?.length,
|
||
)
|
||
) {
|
||
ElMessage.warning(
|
||
t(
|
||
"experimentsScript.enterTheDatePeriodsLaboratoryInstructorAndCapacityForEveryProject",
|
||
),
|
||
);
|
||
return;
|
||
}
|
||
try {
|
||
await http.post("/experiments/sessions/batch", {
|
||
items: batchSessionRows.value,
|
||
});
|
||
batchSessionDialog.value = false;
|
||
ElMessage.success(
|
||
t("experimentsScript.scheduled", {
|
||
count: batchSessionRows.value.length,
|
||
}),
|
||
);
|
||
await load();
|
||
} catch (error) {
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
function openSession(project: any) {
|
||
selectedProject.value = project;
|
||
const firstPeriod = options.periods.find(
|
||
(item) => item.academicTermId === project.academicTermId,
|
||
);
|
||
Object.assign(sessionForm, {
|
||
classroomId: "",
|
||
sessionDate: project.startDate,
|
||
startPeriod: firstPeriod?.periodNumber,
|
||
periodCount: 2,
|
||
capacity: 30,
|
||
notes: "",
|
||
instructorTeacherIds: [],
|
||
});
|
||
sessionDialog.value = true;
|
||
}
|
||
|
||
async function saveSession() {
|
||
if (
|
||
!selectedProject.value ||
|
||
!sessionForm.classroomId ||
|
||
!sessionForm.sessionDate ||
|
||
!sessionForm.startPeriod ||
|
||
!sessionForm.instructorTeacherIds.length
|
||
) {
|
||
ElMessage.warning(
|
||
t("experimentsScript.selectTheLabDatePeriodsLaboratoryAndInstructor"),
|
||
);
|
||
return;
|
||
}
|
||
try {
|
||
await http.post(
|
||
`/experiments/${selectedProject.value.id}/sessions`,
|
||
sessionForm,
|
||
);
|
||
sessionDialog.value = false;
|
||
ElMessage.success(t("experimentsScript.labSessionScheduled"));
|
||
await load();
|
||
} catch (error) {
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function publishProject(project: any) {
|
||
try {
|
||
await ElMessageBox.confirm(
|
||
project.arrangementMode === "Centralized"
|
||
? t(
|
||
"experimentsScript.afterPublicationEnrolledStudentsCanSeeAllScheduledLabSessions",
|
||
)
|
||
: t(
|
||
"experimentsScript.afterPublicationEnrolledStudentsCanBookOpenSessionsImmediately",
|
||
),
|
||
t("experimentsScript.publishTitle", { name: project.name }),
|
||
{
|
||
confirmButtonText: t("experimentsScript.confirmPublication"),
|
||
cancelButtonText: t("experimentsScript.notNow"),
|
||
type: "warning",
|
||
},
|
||
);
|
||
await http.post(`/experiments/${project.id}/publish`);
|
||
ElMessage.success(t("experimentsScript.labProjectPublished"));
|
||
await load();
|
||
} catch (error: any) {
|
||
if (error === "cancel" || error === "close") return;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function closeProject(project: any) {
|
||
try {
|
||
await ElMessageBox.confirm(
|
||
t(
|
||
"experimentsScript.existingArrangementsAndBookingsRemainButStudentsCannotMakeNewBookings",
|
||
),
|
||
t("experimentsScript.closeTitle", { name: project.name }),
|
||
{
|
||
confirmButtonText: t("experimentsScript.confirmClosing"),
|
||
cancelButtonText: t("experimentsScript.cancel"),
|
||
type: "warning",
|
||
},
|
||
);
|
||
await http.post(`/experiments/${project.id}/close`);
|
||
ElMessage.success(t("experimentsScript.labProjectClosed"));
|
||
await load();
|
||
} catch (error: any) {
|
||
if (error === "cancel" || error === "close") return;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function deleteProject(project: any) {
|
||
try {
|
||
await ElMessageBox.confirm(
|
||
t(
|
||
"experimentsScript.draftProjectsAndTheirUnpublishedSessionsWillBeDeleted",
|
||
),
|
||
t("experimentsScript.deleteTitle", { name: project.name }),
|
||
{
|
||
confirmButtonText: t("experimentsScript.delete"),
|
||
cancelButtonText: t("experimentsScript.cancel"),
|
||
type: "error",
|
||
},
|
||
);
|
||
await http.delete(`/experiments/${project.id}`);
|
||
ElMessage.success(t("experimentsScript.labProjectDeleted"));
|
||
await load();
|
||
} catch (error: any) {
|
||
if (error === "cancel" || error === "close") return;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
function instructorsForProject(projectId: string) {
|
||
return options.teachers.filter(
|
||
(teacher) =>
|
||
teacher.teachingTaskId === projectId ||
|
||
teacher.teachingTaskId === batchProject(projectId)?.teachingTaskId,
|
||
);
|
||
}
|
||
|
||
function instructorsForSelectedProject() {
|
||
return selectedProject.value
|
||
? instructorsForProject(selectedProject.value.id)
|
||
: [];
|
||
}
|
||
|
||
function openBatchRename() {
|
||
batchRenameProjectIds.value = projects.value
|
||
.filter((project) => draftSelectedProjectIds.value.includes(project.id))
|
||
.map((project) => project.id);
|
||
batchRenameNames.value = batchRenameProjects.value
|
||
.map((project) => project.name)
|
||
.join("\n");
|
||
batchRenameDialog.value = true;
|
||
}
|
||
|
||
async function saveBatchRename() {
|
||
const names = projectNameLines(batchRenameNames.value);
|
||
if (names.length !== batchRenameProjectIds.value.length) {
|
||
ElMessage.warning(
|
||
t("experimentsScript.renameHelp", {
|
||
count: batchRenameProjectIds.value.length,
|
||
}),
|
||
);
|
||
return;
|
||
}
|
||
try {
|
||
await http.put("/experiments/batch/names", {
|
||
projectIds: batchRenameProjectIds.value,
|
||
names,
|
||
});
|
||
ElMessage.success(t("experimentsScript.labProjectNamesUpdated"));
|
||
batchRenameDialog.value = false;
|
||
await load();
|
||
} catch (error) {
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
function togglePageDraftSelection(value: unknown) {
|
||
const ids = projects.value
|
||
.filter((project) => project.status === "Draft")
|
||
.map((project) => project.id);
|
||
selectedProjectIds.value = Boolean(value)
|
||
? [...new Set([...selectedProjectIds.value, ...ids])]
|
||
: selectedProjectIds.value.filter((id) => !ids.includes(id));
|
||
}
|
||
|
||
function toggleProjectSelection(projectId: string, value: unknown) {
|
||
selectedProjectIds.value = Boolean(value)
|
||
? [...new Set([...selectedProjectIds.value, projectId])]
|
||
: selectedProjectIds.value.filter((id) => id !== projectId);
|
||
}
|
||
|
||
async function publishSelectedProjects() {
|
||
const ids = draftSelectedProjectIds.value;
|
||
if (!ids.length) return;
|
||
try {
|
||
await ElMessageBox.confirm(
|
||
t("experimentsScript.publishBatch", { count: ids.length }),
|
||
t("experimentsScript.publishLabProjectsInBulk"),
|
||
{
|
||
confirmButtonText: t("experimentsScript.confirmPublication"),
|
||
cancelButtonText: t("experimentsScript.cancel"),
|
||
type: "warning",
|
||
},
|
||
);
|
||
const { data } = await http.post("/experiments/batch/publish", {
|
||
projectIds: ids,
|
||
});
|
||
ElMessage.success(
|
||
t("experimentsScript.publishJobs", { count: ids.length }),
|
||
);
|
||
selectedProjectIds.value = [];
|
||
void pollPublishJob(data.jobId);
|
||
} catch (error: any) {
|
||
if (error === "cancel" || error === "close") return;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function pollPublishJob(jobId: string) {
|
||
try {
|
||
const { data } = await http.get(`/experiments/batch/publish-jobs/${jobId}`);
|
||
if (data.status === "Succeeded") {
|
||
ElMessage.success(t("experimentsScript.labProjectsPublished"));
|
||
await load();
|
||
return;
|
||
}
|
||
if (data.status === "Failed") {
|
||
ElMessage.error(
|
||
data.errorMessage || t("experimentsScript.labProjectPublicationFailed"),
|
||
);
|
||
await load();
|
||
return;
|
||
}
|
||
window.setTimeout(() => {
|
||
void pollPublishJob(jobId);
|
||
}, 1200);
|
||
} catch (error) {
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function deleteSelectedProjects() {
|
||
const ids = draftSelectedProjectIds.value;
|
||
if (!ids.length) return;
|
||
try {
|
||
await ElMessageBox.confirm(
|
||
t("experimentsScript.deleteBatch", { count: ids.length }),
|
||
t("experimentsScript.deleteLabProjectsInBulk"),
|
||
{
|
||
confirmButtonText: t("experimentsScript.delete"),
|
||
cancelButtonText: t("experimentsScript.cancel"),
|
||
type: "error",
|
||
},
|
||
);
|
||
await http.delete("/experiments/batch", { data: { projectIds: ids } });
|
||
ElMessage.success(t("experimentsScript.deleted", { count: ids.length }));
|
||
selectedProjectIds.value = [];
|
||
await load();
|
||
} catch (error: any) {
|
||
if (error === "cancel" || error === "close") return;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function cancelSession(project: any, session: any) {
|
||
try {
|
||
await ElMessageBox.confirm(
|
||
project.status === "Draft"
|
||
? t("experimentsScript.thisUnpublishedSessionWillBeDeleted")
|
||
: t(
|
||
"experimentsScript.thisSessionAndExistingBookingsWillBeCancelledAndStudentsNotified",
|
||
),
|
||
t("experimentsScript.sessionTitle", {
|
||
action:
|
||
project.status === "Draft"
|
||
? t("experimentsScript.delete")
|
||
: t("experimentsScript.cancel"),
|
||
time: formatSessionTime(session),
|
||
}),
|
||
{
|
||
confirmButtonText: t("experimentsScript.confirm"),
|
||
cancelButtonText: t("experimentsScript.back"),
|
||
type: "warning",
|
||
},
|
||
);
|
||
await http.delete(`/experiments/sessions/${session.id}`);
|
||
ElMessage.success(
|
||
project.status === "Draft"
|
||
? t("experimentsScript.sessionDeleted")
|
||
: t("experimentsScript.sessionCancelled"),
|
||
);
|
||
await load();
|
||
} catch (error: any) {
|
||
if (error === "cancel" || error === "close") return;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function showParticipants(project: any, session: any) {
|
||
participantSession.value = { ...session, project };
|
||
participantsDialog.value = true;
|
||
participantsLoading.value = true;
|
||
try {
|
||
participants.value = (
|
||
await http.get(`/experiments/sessions/${session.id}/participants`)
|
||
).data;
|
||
} catch (error) {
|
||
participants.value = [];
|
||
ElMessage.error(apiErrorMessage(error));
|
||
} finally {
|
||
participantsLoading.value = false;
|
||
}
|
||
}
|
||
|
||
async function loadProxyBookingStudents(page = proxyBookingPage.value) {
|
||
if (!participantSession.value) return;
|
||
proxyBookingPage.value = page;
|
||
proxyBookingStudentIds.value = [];
|
||
proxyBookingLoading.value = true;
|
||
try {
|
||
const { data } = await http.get(
|
||
`/experiments/sessions/${participantSession.value.id}/eligible-students`,
|
||
{
|
||
params: {
|
||
keyword: proxyBookingKeyword.value || undefined,
|
||
page,
|
||
pageSize: proxyBookingPageSize,
|
||
},
|
||
},
|
||
);
|
||
proxyBookingStudents.value = data.items;
|
||
proxyBookingTotal.value = data.total;
|
||
} catch (error) {
|
||
proxyBookingStudents.value = [];
|
||
ElMessage.error(apiErrorMessage(error));
|
||
} finally {
|
||
proxyBookingLoading.value = false;
|
||
}
|
||
}
|
||
|
||
async function openProxyBooking() {
|
||
proxyBookingStudentIds.value = [];
|
||
proxyBookingKeyword.value = "";
|
||
proxyBookingPage.value = 1;
|
||
proxyBookingDialog.value = true;
|
||
await loadProxyBookingStudents();
|
||
}
|
||
|
||
async function saveProxyBooking() {
|
||
if (!participantSession.value || !proxyBookingStudentIds.value.length) {
|
||
ElMessage.warning(t("experimentsScript.selectStudentsToBookSessionsFor"));
|
||
return;
|
||
}
|
||
try {
|
||
const { data } = await http.post(
|
||
`/experiments/sessions/${participantSession.value.id}/proxy-bookings/batch`,
|
||
{
|
||
studentIds: proxyBookingStudentIds.value,
|
||
},
|
||
);
|
||
ElMessage.success(
|
||
t("experimentsScript.proxy", { count: data.bookedCount }),
|
||
);
|
||
proxyBookingDialog.value = false;
|
||
await showParticipants(
|
||
participantSession.value.project,
|
||
participantSession.value,
|
||
);
|
||
} catch (error) {
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function book(project: any, session: any) {
|
||
try {
|
||
await ElMessageBox.confirm(
|
||
`${formatSessionTime(session)} · ${session.campusName} ${session.buildingName} ${session.classroomName}`,
|
||
t("experimentsScript.bookTitle", { name: project.name }),
|
||
{
|
||
confirmButtonText: t("experimentsScript.confirmBooking"),
|
||
cancelButtonText: t("experimentsScript.notNow2"),
|
||
type: "info",
|
||
},
|
||
);
|
||
await http.post(`/experiments/sessions/${session.id}/book`);
|
||
ElMessage.success(t("experimentsScript.labSessionBooked"));
|
||
await load();
|
||
} catch (error: any) {
|
||
if (error === "cancel" || error === "close") return;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function cancelBooking(project: any) {
|
||
if (!project.myBooking) return;
|
||
try {
|
||
await ElMessageBox.confirm(
|
||
t(
|
||
"experimentsScript.theSeatWillBeReleasedImmediatelyYouCanChooseAnotherSessionForThisProject",
|
||
),
|
||
t("experimentsScript.cancelTitle", { name: project.name }),
|
||
{
|
||
confirmButtonText: t("experimentsScript.cancelBooking"),
|
||
cancelButtonText: t("experimentsScript.keepBooking"),
|
||
type: "warning",
|
||
},
|
||
);
|
||
await http.delete(`/experiments/bookings/${project.myBooking.id}`);
|
||
ElMessage.success(t("experimentsScript.bookingCancelled"));
|
||
await load();
|
||
} catch (error: any) {
|
||
if (error === "cancel" || error === "close") return;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
function formatSessionTime(session: any) {
|
||
return t("experimentsScript.sessionTime", {
|
||
date: session.sessionDate,
|
||
start: session.startPeriod,
|
||
end: session.startPeriod + session.periodCount - 1,
|
||
});
|
||
}
|
||
|
||
function selectedSession(project: any) {
|
||
return project.sessions.find(
|
||
(session: any) => session.id === project.myBooking?.experimentSessionId,
|
||
);
|
||
}
|
||
|
||
function sessionTagType(session: any) {
|
||
const remaining = session.capacity - session.reservedCount;
|
||
if (remaining <= 0) return "danger";
|
||
if (remaining <= Math.max(2, Math.floor(session.capacity * 0.2)))
|
||
return "warning";
|
||
return "success";
|
||
}
|
||
|
||
async function loadOptions() {
|
||
if (isStudent.value) return;
|
||
try {
|
||
const { data } = await http.get("/experiments/options", {
|
||
params: {
|
||
academicTermId: termId.value || undefined,
|
||
offeringCollegeId: offeringCollegeId.value || undefined,
|
||
courseKeyword: courseKeyword.value.trim() || undefined,
|
||
},
|
||
});
|
||
options.tasks = data.tasks;
|
||
options.taskTotal = data.taskTotal;
|
||
options.tasksTruncated = data.tasksTruncated;
|
||
options.colleges = data.colleges;
|
||
options.scheduleEntries = data.scheduleEntries;
|
||
options.scheduleEntryTotal = data.scheduleEntryTotal;
|
||
options.scheduleEntriesTruncated = data.scheduleEntriesTruncated;
|
||
options.classrooms = data.classrooms;
|
||
options.teachers = data.teachers;
|
||
options.periods = data.periods;
|
||
} catch (error) {
|
||
options.tasks = [];
|
||
options.colleges = [];
|
||
options.classrooms = [];
|
||
options.teachers = [];
|
||
options.periods = [];
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
}
|
||
|
||
async function load() {
|
||
loading.value = true;
|
||
try {
|
||
if (isStudent.value) {
|
||
projects.value = (
|
||
await http.get("/experiments/student", {
|
||
params: { academicTermId: termId.value || undefined },
|
||
})
|
||
).data;
|
||
total.value = projects.value.length;
|
||
} else {
|
||
const { data } = await http.get("/experiments/management", {
|
||
params: {
|
||
academicTermId: termId.value || undefined,
|
||
arrangementMode: modeFilter.value || undefined,
|
||
status: statusFilter.value || undefined,
|
||
offeringCollegeId: offeringCollegeId.value || undefined,
|
||
courseKeyword: courseKeyword.value.trim() || undefined,
|
||
classKeyword: classKeyword.value.trim() || undefined,
|
||
teacherKeyword: teacherKeyword.value.trim() || undefined,
|
||
taskKeyword: taskKeyword.value.trim() || undefined,
|
||
page: page.value,
|
||
pageSize: pageSize.value,
|
||
},
|
||
});
|
||
projects.value = data.items;
|
||
total.value = data.total;
|
||
}
|
||
} catch (error) {
|
||
projects.value = [];
|
||
total.value = 0;
|
||
ElMessage.error(apiErrorMessage(error));
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
|
||
async function changeTerm() {
|
||
page.value = 1;
|
||
selectedProjectIds.value = [];
|
||
await loadOptions();
|
||
await load();
|
||
}
|
||
|
||
async function searchTaskOptions() {
|
||
page.value = 1;
|
||
selectedProjectIds.value = [];
|
||
await loadOptions();
|
||
await load();
|
||
}
|
||
|
||
async function changePage(nextPage: number) {
|
||
page.value = nextPage;
|
||
selectedProjectIds.value = [];
|
||
await load();
|
||
}
|
||
|
||
async function changePageSize(size: number) {
|
||
pageSize.value = size;
|
||
await changePage(1);
|
||
}
|
||
|
||
onMounted(async () => {
|
||
try {
|
||
terms.value = (await http.get("/base-data/terms")).data;
|
||
termId.value = defaultAcademicTermId(terms.value) ?? "";
|
||
} catch (error) {
|
||
ElMessage.error(apiErrorMessage(error));
|
||
}
|
||
await loadOptions();
|
||
await load();
|
||
});
|
||
</script>
|
||
|
||
<template>
|
||
<div class="page-stack experiment-page">
|
||
<section class="page-intro experiment-intro">
|
||
<div>
|
||
<span class="section-kicker">LABORATORY OPERATIONS</span>
|
||
<h2>
|
||
{{
|
||
isStudent
|
||
? t("experimentsDynamic.myLabs")
|
||
: t("experimentsDynamic.manage")
|
||
}}
|
||
</h2>
|
||
<p v-if="isStudent">
|
||
{{
|
||
t(
|
||
"experimentsTemplate.viewScheduledLabClassesOrSelectAnAvailableTimeForYourAssignedLabProject",
|
||
)
|
||
}}
|
||
</p>
|
||
<p v-else>
|
||
{{
|
||
t(
|
||
"experimentsTemplate.scheduledLabsUseThePublishedTimetableOnlySelfBookedLabsRequireSessionsHere",
|
||
)
|
||
}}
|
||
</p>
|
||
</div>
|
||
<div class="intro-actions">
|
||
<el-button v-if="!isStudent" :icon="Calendar" @click="openBatchSession">
|
||
{{ t("experimentsTemplate.openSessionsInBulk") }}
|
||
</el-button>
|
||
<el-button
|
||
v-if="!isStudent"
|
||
type="primary"
|
||
:icon="Plus"
|
||
@click="openCreateProject"
|
||
>
|
||
{{ t("experimentsTemplate.setUpLabTasksInBulk") }}
|
||
</el-button>
|
||
<el-button :icon="Refresh" @click="load">{{
|
||
t("businessLabels.refresh")
|
||
}}</el-button>
|
||
</div>
|
||
</section>
|
||
|
||
<section
|
||
v-if="!isStudent"
|
||
class="lab-rail"
|
||
aria-:label="t('experimentsTemplate.labArrangementModes')"
|
||
>
|
||
<article class="rail-lane centralized">
|
||
<span class="rail-code">{{
|
||
t("experimentsTemplate.fixedScheduled")
|
||
}}</span>
|
||
<b>{{ t("experimentsTemplate.scheduledClass") }}</b>
|
||
<p>
|
||
{{
|
||
t(
|
||
"experimentsTemplate.theEntireClassAttendsAtTheScheduledTimeAndLaboratory",
|
||
)
|
||
}}
|
||
</p>
|
||
</article>
|
||
<div class="rail-switch" aria-hidden="true"><i /><i /></div>
|
||
<article class="rail-lane flexible">
|
||
<span class="rail-code">{{
|
||
t("experimentsTemplate.openSelfBooked")
|
||
}}</span>
|
||
<b>{{ t("experimentsTemplate.openBooking") }}</b>
|
||
<p>
|
||
{{
|
||
t(
|
||
"experimentsTemplate.studentsChooseAnAvailableSessionForTheSameLabContentWithOneBookingPerProject",
|
||
)
|
||
}}
|
||
</p>
|
||
</article>
|
||
</section>
|
||
|
||
<section class="experiment-toolbar">
|
||
<el-select
|
||
v-model="termId"
|
||
clearable
|
||
:placeholder="t('businessLabels.allTerms')"
|
||
@change="changeTerm"
|
||
>
|
||
<el-option
|
||
v-for="term in terms"
|
||
:key="term.id"
|
||
:label="academicTermLabel(term)"
|
||
:value="term.id"
|
||
:class="academicTermOptionClass(term)"
|
||
/>
|
||
</el-select>
|
||
<template v-if="!isStudent">
|
||
<el-select
|
||
v-model="offeringCollegeId"
|
||
clearable
|
||
filterable
|
||
:placeholder="t('courses.college')"
|
||
@change="searchTaskOptions"
|
||
>
|
||
<el-option
|
||
v-for="college in options.colleges"
|
||
:key="college.collegeId"
|
||
:label="college.collegeName"
|
||
:value="college.collegeId"
|
||
/>
|
||
</el-select>
|
||
<el-input
|
||
v-model="courseKeyword"
|
||
clearable
|
||
:placeholder="t('experimentsTemplate.courseNameOrCode')"
|
||
@keyup.enter="searchTaskOptions"
|
||
@clear="searchTaskOptions"
|
||
/>
|
||
<el-input
|
||
v-model="classKeyword"
|
||
clearable
|
||
:placeholder="t('batchBusiness.teachingClass')"
|
||
@keyup.enter="searchTaskOptions"
|
||
@clear="searchTaskOptions"
|
||
/>
|
||
<el-input
|
||
v-model="teacherKeyword"
|
||
clearable
|
||
:placeholder="t('batchBusiness.instructor')"
|
||
@keyup.enter="searchTaskOptions"
|
||
@clear="searchTaskOptions"
|
||
/>
|
||
<el-input
|
||
v-model="taskKeyword"
|
||
clearable
|
||
:placeholder="t('experimentsTemplate.teachingTaskNumber')"
|
||
@keyup.enter="searchTaskOptions"
|
||
@clear="searchTaskOptions"
|
||
/>
|
||
<el-select
|
||
v-model="modeFilter"
|
||
clearable
|
||
:placeholder="t('experimentsTemplate.allArrangementModes')"
|
||
@change="load"
|
||
>
|
||
<el-option
|
||
:label="t('experimentsTemplate.scheduled')"
|
||
value="Centralized"
|
||
/>
|
||
<el-option
|
||
:label="t('experimentsTemplate.selfBooked')"
|
||
value="SelfScheduled"
|
||
/>
|
||
</el-select>
|
||
<el-select
|
||
v-model="statusFilter"
|
||
clearable
|
||
:placeholder="t('businessLabels.allStatus')"
|
||
@change="load"
|
||
>
|
||
<el-option :label="t('businessLabels.draft')" value="Draft" />
|
||
<el-option
|
||
:label="t('evaluationBatch.inProgress')"
|
||
value="Published"
|
||
/>
|
||
<el-option :label="t('graduationClearance.closed')" value="Closed" />
|
||
</el-select>
|
||
</template>
|
||
<span class="result-note">{{
|
||
isStudent
|
||
? t("experimentsDynamic.studentCount", {
|
||
courses: projectGroups.length,
|
||
projects: total,
|
||
})
|
||
: t("experimentsDynamic.classCount", { count: total })
|
||
}}</span>
|
||
</section>
|
||
|
||
<section v-if="!isStudent" class="experiment-batch-bar">
|
||
<el-checkbox
|
||
:model-value="allPageDraftSelected"
|
||
:indeterminate="
|
||
!!draftSelectedProjectIds.length && !allPageDraftSelected
|
||
"
|
||
@change="togglePageDraftSelection"
|
||
>
|
||
{{ t("experimentsTemplate.selectAllDraftsOnThisPage") }}
|
||
</el-checkbox>
|
||
<span>{{
|
||
t("experimentsDynamic.selectedDrafts", {
|
||
count: draftSelectedProjectIds.length,
|
||
})
|
||
}}</span>
|
||
<el-button
|
||
size="small"
|
||
:disabled="!draftSelectedProjectIds.length"
|
||
@click="openBatchRename"
|
||
>{{ t("experimentsTemplate.renameInBulk") }}</el-button
|
||
>
|
||
<el-button
|
||
size="small"
|
||
type="primary"
|
||
:disabled="!draftSelectedProjectIds.length"
|
||
@click="publishSelectedProjects"
|
||
>{{ t("experimentsTemplate.publishInBulk") }}</el-button
|
||
>
|
||
<el-button
|
||
size="small"
|
||
type="danger"
|
||
plain
|
||
:disabled="!draftSelectedProjectIds.length"
|
||
@click="deleteSelectedProjects"
|
||
>{{ t("experimentsTemplate.deleteInBulk") }}</el-button
|
||
>
|
||
</section>
|
||
|
||
<section v-loading="loading" class="project-list">
|
||
<section
|
||
v-for="group in projectGroups"
|
||
:key="group.key"
|
||
class="project-group"
|
||
>
|
||
<header class="project-group-head">
|
||
<div>
|
||
<span>{{ group.termName }}</span>
|
||
<h3>{{ group.courseCode }} · {{ group.courseName }}</h3>
|
||
</div>
|
||
<div class="project-group-task">
|
||
<b>{{ group.taskNumbers.join("、") }}</b>
|
||
<span>{{
|
||
group.classNames?.join("、") || t("experimentsDynamic.students")
|
||
}}</span>
|
||
</div>
|
||
</header>
|
||
<div class="project-group-projects">
|
||
<el-table
|
||
v-if="!isStudent"
|
||
:data="group.projects"
|
||
class="project-table"
|
||
size="small"
|
||
>
|
||
<el-table-column width="46" align="center">
|
||
<template #default="{ row }">
|
||
<el-checkbox
|
||
v-if="row.status === 'Draft'"
|
||
:model-value="selectedProjectIds.includes(row.id)"
|
||
@change="toggleProjectSelection(row.id, $event)"
|
||
aria-:label="t('experimentsTemplate.selectLabProjects')"
|
||
/>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('batchBusiness.labProject')"
|
||
min-width="220"
|
||
>
|
||
<template #default="{ row }">
|
||
<div class="table-project-name">
|
||
<b>{{ row.code }} · {{ row.name }}</b>
|
||
<small v-if="row.description">{{ row.description }}</small>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('experimentsTemplate.labClassesSessions')"
|
||
min-width="280"
|
||
>
|
||
<template #default="{ row }">
|
||
<div
|
||
v-if="
|
||
row.arrangementMode === 'Centralized' && row.scheduleEntry
|
||
"
|
||
class="table-schedule"
|
||
>
|
||
<b>{{
|
||
t("experimentsDynamic.schedule", {
|
||
week:
|
||
row.scheduleEntry.projectWeek ??
|
||
`${row.scheduleEntry.startWeek}–${row.scheduleEntry.endWeek}`,
|
||
day: row.scheduleEntry.dayOfWeek,
|
||
start: row.scheduleEntry.startPeriod,
|
||
end:
|
||
row.scheduleEntry.startPeriod +
|
||
row.scheduleEntry.periodCount -
|
||
1,
|
||
})
|
||
}}</b>
|
||
<small
|
||
>{{ row.scheduleEntry.campusName }} ·
|
||
{{ row.scheduleEntry.buildingName }}
|
||
{{ row.scheduleEntry.classroomName }}</small
|
||
>
|
||
</div>
|
||
<div v-else-if="row.sessions.length" class="table-schedule">
|
||
<b>{{
|
||
t("experimentsDynamic.openSessions", {
|
||
count: row.sessions.length,
|
||
})
|
||
}}</b>
|
||
<small>{{
|
||
row.sessions
|
||
.map((session: any) => formatSessionTime(session))
|
||
.join(";")
|
||
}}</small>
|
||
<el-popover placement="bottom" :width="520" trigger="click">
|
||
<template #reference
|
||
><el-button size="small" text :icon="User">{{
|
||
t("experimentsTemplate.viewSessionsAndParticipants")
|
||
}}</el-button></template
|
||
>
|
||
<div class="student-session-menu">
|
||
<div
|
||
v-for="session in row.sessions"
|
||
:key="session.id"
|
||
class="student-session-option"
|
||
>
|
||
<div>
|
||
<b>{{ formatSessionTime(session) }}</b
|
||
><span>{{
|
||
t("experimentsDynamic.instructor", {
|
||
campus: session.campusName,
|
||
building: session.buildingName,
|
||
room: session.classroomName,
|
||
teachers:
|
||
session.instructorNames?.join("、") ||
|
||
t("experimentsDynamic.unassigned"),
|
||
})
|
||
}}</span>
|
||
</div>
|
||
<el-button
|
||
v-if="session.canManage"
|
||
size="small"
|
||
text
|
||
@click="showParticipants(row, session)"
|
||
>{{ t("experimentsTemplate.bookingList") }}</el-button
|
||
>
|
||
<el-button
|
||
v-if="
|
||
session.canManage && session.status !== 'Cancelled'
|
||
"
|
||
size="small"
|
||
text
|
||
type="danger"
|
||
:disabled="row.teachingTaskStatus !== 'Published'"
|
||
@click="cancelSession(row, session)"
|
||
>{{
|
||
row.status === "Draft"
|
||
? t("baseData.delete")
|
||
: t("classroomReservation.cancel")
|
||
}}</el-button
|
||
>
|
||
</div>
|
||
</div>
|
||
</el-popover>
|
||
</div>
|
||
<span v-else class="table-muted">{{
|
||
t("experimentsTemplate.notScheduled")
|
||
}}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('experimentsTemplate.mode')"
|
||
width="100"
|
||
align="center"
|
||
>
|
||
<template #default="{ row }"
|
||
><el-tag
|
||
:type="
|
||
row.arrangementMode === 'Centralized'
|
||
? 'primary'
|
||
: 'success'
|
||
"
|
||
effect="plain"
|
||
>{{ modeMeta[row.arrangementMode].label }}</el-tag
|
||
></template
|
||
>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('businessLabels.status')"
|
||
width="88"
|
||
align="center"
|
||
>
|
||
<template #default="{ row }"
|
||
><el-tag
|
||
:type="
|
||
row.status === 'Published'
|
||
? 'success'
|
||
: row.status === 'Closed'
|
||
? 'info'
|
||
: 'warning'
|
||
"
|
||
>{{ statusLabels[row.status] }}</el-tag
|
||
></template
|
||
>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('businessLabels.actions')"
|
||
width="244"
|
||
fixed="right"
|
||
align="right"
|
||
>
|
||
<template #default="{ row }">
|
||
<template v-if="row.status === 'Draft'">
|
||
<el-button
|
||
size="small"
|
||
text
|
||
:disabled="row.teachingTaskStatus !== 'Published'"
|
||
@click="openEditProject(row)"
|
||
>{{ t("businessLabels.edit") }}</el-button
|
||
>
|
||
<el-button
|
||
size="small"
|
||
text
|
||
type="danger"
|
||
:disabled="row.teachingTaskStatus !== 'Published'"
|
||
@click="deleteProject(row)"
|
||
>{{ t("businessLabels.delete") }}</el-button
|
||
>
|
||
<el-button
|
||
size="small"
|
||
type="primary"
|
||
:disabled="
|
||
row.teachingTaskStatus !== 'Published' ||
|
||
(row.arrangementMode === 'Centralized'
|
||
? !row.scheduleEntry
|
||
: !row.sessions.some(
|
||
(item: any) => item.status !== 'Cancelled',
|
||
))
|
||
"
|
||
@click="publishProject(row)"
|
||
>{{ t("businessLabels.publish") }}</el-button
|
||
>
|
||
</template>
|
||
<template v-else-if="row.status === 'Published'">
|
||
<el-button
|
||
size="small"
|
||
text
|
||
:disabled="row.teachingTaskStatus !== 'Published'"
|
||
@click="openCorrectPublishedProject(row)"
|
||
>{{ t("experimentsTemplate.correctContent") }}</el-button
|
||
>
|
||
<el-button
|
||
size="small"
|
||
text
|
||
:disabled="row.teachingTaskStatus !== 'Published'"
|
||
@click="closeProject(row)"
|
||
>{{ t("experimentsTemplate.closeProject") }}</el-button
|
||
>
|
||
</template>
|
||
<el-button
|
||
v-if="
|
||
row.status !== 'Closed' &&
|
||
row.arrangementMode === 'SelfScheduled'
|
||
"
|
||
size="small"
|
||
text
|
||
type="primary"
|
||
@click="openSession(row)"
|
||
>{{ t("experimentsTemplate.scheduleSessions") }}</el-button
|
||
>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<el-table
|
||
v-else
|
||
:data="group.projects"
|
||
class="project-table student-project-table desktop-project-table"
|
||
size="small"
|
||
>
|
||
<el-table-column type="expand" width="44">
|
||
<template #default="{ row }">
|
||
<div class="student-project-detail">
|
||
<p v-if="row.description">
|
||
<b>{{ t("campusRegistration.projectDescription") }}</b
|
||
>{{ row.description }}
|
||
</p>
|
||
<p v-if="row.requirements">
|
||
<b>{{ t("experimentsTemplate.labRequirements") }}</b
|
||
>{{ row.requirements }}
|
||
</p>
|
||
<p>
|
||
<b>{{ t("experimentsTemplate.openDates") }}</b
|
||
>{{ row.startDate }} — {{ row.endDate }}
|
||
</p>
|
||
<p>
|
||
<b>{{ t("batchBusiness.instructor") }}</b
|
||
>{{
|
||
row.teacherNames.join("、") ||
|
||
t("experimentsDynamic.pending")
|
||
}}
|
||
</p>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('batchBusiness.labProject')"
|
||
min-width="210"
|
||
>
|
||
<template #default="{ row }">
|
||
<div class="table-project-name">
|
||
<b>{{ row.code }} · {{ row.name }}</b>
|
||
<small>{{
|
||
row.description || modeMeta[row.arrangementMode].note
|
||
}}</small>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('attendanceBatch.labSchedule')"
|
||
min-width="300"
|
||
>
|
||
<template #default="{ row }">
|
||
<div
|
||
v-if="
|
||
row.arrangementMode === 'Centralized' && row.scheduleEntry
|
||
"
|
||
class="table-schedule"
|
||
>
|
||
<b>{{
|
||
t("experimentsDynamic.schedule", {
|
||
week:
|
||
row.scheduleEntry.projectWeek ??
|
||
`${row.scheduleEntry.startWeek}–${row.scheduleEntry.endWeek}`,
|
||
day: row.scheduleEntry.dayOfWeek,
|
||
start: row.scheduleEntry.startPeriod,
|
||
end:
|
||
row.scheduleEntry.startPeriod +
|
||
row.scheduleEntry.periodCount -
|
||
1,
|
||
})
|
||
}}</b>
|
||
<small
|
||
>{{ row.scheduleEntry.campusName }} ·
|
||
{{ row.scheduleEntry.buildingName }}
|
||
{{ row.scheduleEntry.classroomName }}</small
|
||
>
|
||
</div>
|
||
<div
|
||
v-else-if="row.myBooking && selectedSession(row)"
|
||
class="table-schedule is-booked"
|
||
>
|
||
<b>{{ formatSessionTime(selectedSession(row)) }}</b>
|
||
<small
|
||
>{{ selectedSession(row).campusName }} ·
|
||
{{ selectedSession(row).buildingName }}
|
||
{{ selectedSession(row).classroomName }}</small
|
||
>
|
||
</div>
|
||
<div v-else-if="row.sessions.length" class="table-schedule">
|
||
<b>{{
|
||
t("experimentsDynamic.availableSessions", {
|
||
count: row.sessions.length,
|
||
})
|
||
}}</b>
|
||
<small>{{
|
||
t("experimentsTemplate.notBookedSelectALabTimeOnTheRight")
|
||
}}</small>
|
||
</div>
|
||
<span v-else class="table-muted">{{
|
||
t("experimentsTemplate.noActiveLabArrangements")
|
||
}}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('experimentsTemplate.mode')"
|
||
width="100"
|
||
align="center"
|
||
>
|
||
<template #default="{ row }"
|
||
><el-tag
|
||
:type="
|
||
row.arrangementMode === 'Centralized'
|
||
? 'primary'
|
||
: 'success'
|
||
"
|
||
effect="plain"
|
||
size="small"
|
||
>{{ modeMeta[row.arrangementMode].label }}</el-tag
|
||
></template
|
||
>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('businessLabels.status')"
|
||
width="88"
|
||
align="center"
|
||
>
|
||
<template #default="{ row }"
|
||
><el-tag
|
||
:type="row.status === 'Published' ? 'success' : 'info'"
|
||
size="small"
|
||
>{{ statusLabels[row.status] }}</el-tag
|
||
></template
|
||
>
|
||
</el-table-column>
|
||
<el-table-column
|
||
:label="t('experimentsTemplate.booking')"
|
||
width="190"
|
||
fixed="right"
|
||
align="right"
|
||
>
|
||
<template #default="{ row }">
|
||
<template v-if="row.arrangementMode === 'SelfScheduled'">
|
||
<el-popover
|
||
placement="bottom-end"
|
||
:width="540"
|
||
trigger="click"
|
||
>
|
||
<template #reference>
|
||
<el-button
|
||
size="small"
|
||
:type="row.myBooking ? 'success' : 'primary'"
|
||
plain
|
||
>
|
||
{{
|
||
row.myBooking
|
||
? t("experimentsDynamic.viewSession")
|
||
: t("experimentsDynamic.selectSession")
|
||
}}
|
||
</el-button>
|
||
</template>
|
||
<div class="student-session-menu">
|
||
<header>
|
||
<b>{{ row.code }} · {{ row.name }}</b
|
||
><span>{{
|
||
t("experimentsTemplate.oneBookingPerLabProject")
|
||
}}</span>
|
||
</header>
|
||
<div
|
||
v-for="session in row.sessions"
|
||
:key="session.id"
|
||
class="student-session-option"
|
||
:class="{
|
||
'is-selected':
|
||
row.myBooking?.experimentSessionId === session.id,
|
||
}"
|
||
>
|
||
<div>
|
||
<b>{{ formatSessionTime(session) }}</b>
|
||
<span>{{
|
||
t("experimentsDynamic.instructor", {
|
||
campus: session.campusName,
|
||
building: session.buildingName,
|
||
room: session.classroomName,
|
||
teachers:
|
||
session.instructorNames?.join("、") ||
|
||
t("experimentsDynamic.unassigned"),
|
||
})
|
||
}}</span>
|
||
</div>
|
||
<el-tag
|
||
:type="sessionTagType(session)"
|
||
size="small"
|
||
effect="plain"
|
||
>{{
|
||
t("experimentsDynamic.remaining", {
|
||
remaining: session.remainingCount,
|
||
capacity: session.capacity,
|
||
})
|
||
}}</el-tag
|
||
>
|
||
<el-button
|
||
v-if="
|
||
row.myBooking?.experimentSessionId === session.id
|
||
"
|
||
size="small"
|
||
type="success"
|
||
:icon="Check"
|
||
disabled
|
||
>{{ t("venueDisplay.reserved") }}</el-button
|
||
>
|
||
<el-button
|
||
v-else
|
||
size="small"
|
||
type="primary"
|
||
plain
|
||
:disabled="
|
||
row.status !== 'Published' ||
|
||
row.teachingTaskStatus !== 'Published' ||
|
||
!!row.myBooking ||
|
||
session.remainingCount <= 0
|
||
"
|
||
@click="book(row, session)"
|
||
>{{ t("experimentsTemplate.book") }}</el-button
|
||
>
|
||
</div>
|
||
<el-empty
|
||
v-if="!row.sessions.length"
|
||
:image-size="42"
|
||
:description="
|
||
t('experimentsTemplate.noActiveLabSessions')
|
||
"
|
||
/>
|
||
</div>
|
||
</el-popover>
|
||
<el-button
|
||
v-if="
|
||
row.myBooking &&
|
||
row.status === 'Published' &&
|
||
row.teachingTaskStatus === 'Published'
|
||
"
|
||
size="small"
|
||
text
|
||
type="danger"
|
||
@click="cancelBooking(row)"
|
||
>{{ t("businessLabels.cancel") }}</el-button
|
||
>
|
||
</template>
|
||
<span v-else class="table-muted">{{
|
||
t("experimentsTemplate.noBookingRequired")
|
||
}}</span>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<div v-if="isStudent" class="mobile-project-cards">
|
||
<article
|
||
v-for="row in group.projects"
|
||
:key="row.id"
|
||
class="mobile-project-card"
|
||
>
|
||
<header>
|
||
<div>
|
||
<span>{{ row.code }}</span>
|
||
<h4>{{ row.name }}</h4>
|
||
</div>
|
||
<el-tag
|
||
:type="
|
||
row.arrangementMode === 'Centralized'
|
||
? 'primary'
|
||
: 'success'
|
||
"
|
||
size="small"
|
||
effect="plain"
|
||
>
|
||
{{ modeMeta[row.arrangementMode].label }}
|
||
</el-tag>
|
||
</header>
|
||
<p>{{ row.description || modeMeta[row.arrangementMode].note }}</p>
|
||
<div class="mobile-project-arrangement">
|
||
<template
|
||
v-if="
|
||
row.arrangementMode === 'Centralized' && row.scheduleEntry
|
||
"
|
||
>
|
||
<b>{{ t("experimentsTemplate.scheduled2") }}</b>
|
||
<span>{{
|
||
t("experimentsDynamic.schedule", {
|
||
week:
|
||
row.scheduleEntry.projectWeek ??
|
||
`${row.scheduleEntry.startWeek}–${row.scheduleEntry.endWeek}`,
|
||
day: row.scheduleEntry.dayOfWeek,
|
||
start: row.scheduleEntry.startPeriod,
|
||
end:
|
||
row.scheduleEntry.startPeriod +
|
||
row.scheduleEntry.periodCount -
|
||
1,
|
||
})
|
||
}}</span>
|
||
<small
|
||
>{{ row.scheduleEntry.campusName }} ·
|
||
{{ row.scheduleEntry.buildingName }}
|
||
{{ row.scheduleEntry.classroomName }}</small
|
||
>
|
||
</template>
|
||
<template v-else-if="row.arrangementMode === 'SelfScheduled'">
|
||
<b>{{
|
||
row.myBooking
|
||
? t("experimentsDynamic.bookedSession")
|
||
: t("experimentsDynamic.selectLabSession")
|
||
}}</b>
|
||
<div v-if="row.sessions.length" class="mobile-session-list">
|
||
<article
|
||
v-for="session in row.sessions"
|
||
:key="session.id"
|
||
:class="{
|
||
'is-selected':
|
||
row.myBooking?.experimentSessionId === session.id,
|
||
}"
|
||
>
|
||
<div>
|
||
<strong>{{ formatSessionTime(session) }}</strong>
|
||
<small
|
||
>{{ session.campusName }} · {{ session.buildingName }}
|
||
{{ session.classroomName }}</small
|
||
>
|
||
</div>
|
||
<el-tag
|
||
:type="sessionTagType(session)"
|
||
size="small"
|
||
effect="plain"
|
||
>{{
|
||
t("experimentsDynamic.remaining", {
|
||
remaining: session.remainingCount,
|
||
capacity: session.capacity,
|
||
})
|
||
}}</el-tag
|
||
>
|
||
<el-button
|
||
v-if="row.myBooking?.experimentSessionId === session.id"
|
||
size="small"
|
||
type="success"
|
||
disabled
|
||
>{{ t("venueDisplay.reserved") }}</el-button
|
||
>
|
||
<el-button
|
||
v-else
|
||
size="small"
|
||
type="primary"
|
||
plain
|
||
:disabled="
|
||
row.status !== 'Published' ||
|
||
row.teachingTaskStatus !== 'Published' ||
|
||
!!row.myBooking ||
|
||
session.remainingCount <= 0
|
||
"
|
||
@click="book(row, session)"
|
||
>{{ t("experimentsTemplate.book") }}</el-button
|
||
>
|
||
</article>
|
||
</div>
|
||
<span v-else class="table-muted">{{
|
||
t("experimentsTemplate.noActiveLabSessions")
|
||
}}</span>
|
||
<el-button
|
||
v-if="
|
||
row.myBooking &&
|
||
row.status === 'Published' &&
|
||
row.teachingTaskStatus === 'Published'
|
||
"
|
||
class="mobile-cancel-booking"
|
||
size="small"
|
||
text
|
||
type="danger"
|
||
@click="cancelBooking(row)"
|
||
>{{
|
||
t("classroomReservation.cancelReservation")
|
||
}}</el-button
|
||
>
|
||
</template>
|
||
</div>
|
||
</article>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<el-empty
|
||
v-if="!loading && !projects.length"
|
||
:description="
|
||
isStudent
|
||
? t('experimentsDynamic.noPublished')
|
||
: t('experimentsDynamic.noMatches')
|
||
"
|
||
>
|
||
<el-button v-if="!isStudent" type="primary" @click="openCreateProject">
|
||
{{ t("experimentsTemplate.createYourFirstLabProject") }}
|
||
</el-button>
|
||
</el-empty>
|
||
</section>
|
||
|
||
<el-pagination
|
||
v-if="!isStudent && total > pageSize"
|
||
class="experiment-pagination"
|
||
background
|
||
layout="total, sizes, prev, pager, next"
|
||
:current-page="page"
|
||
:page-size="pageSize"
|
||
:page-sizes="[10, 20, 50, 100]"
|
||
:total="total"
|
||
@current-change="changePage"
|
||
@size-change="changePageSize"
|
||
/>
|
||
|
||
<el-dialog
|
||
v-model="projectDialog"
|
||
:title="
|
||
correctingPublishedProject
|
||
? t('experimentsDynamic.correctProject')
|
||
: editingProjectId
|
||
? t('experimentsDynamic.editProject')
|
||
: t('experimentsDynamic.bulkTasks')
|
||
"
|
||
width="720px"
|
||
top="5vh"
|
||
>
|
||
<el-form label-position="top" class="experiment-form">
|
||
<el-alert
|
||
v-if="correctingPublishedProject"
|
||
:title="
|
||
t(
|
||
'experimentsTemplate.forPublishedProjectsOnlyTheNameLabContentAndAttendanceRequirementsCanBeCorrectedTheCodeArrangementModeTimetableAndOpenDatesStayUnchangedStudentsWillBeNotifiedAfterSaving',
|
||
)
|
||
"
|
||
type="info"
|
||
:closable="false"
|
||
/>
|
||
<div class="form-section">
|
||
<header>
|
||
<span>PROJECT</span
|
||
><b>{{ t("experimentsTemplate.requiredLabProject") }}</b>
|
||
</header>
|
||
<el-alert
|
||
v-if="options.tasksTruncated || options.scheduleEntriesTruncated"
|
||
type="warning"
|
||
:closable="false"
|
||
show-icon
|
||
:title="
|
||
t(
|
||
'experimentsTemplate.tooManyMatchesNarrowTheResultsBySchoolAndCourseNameOrCodeBeforeSelectingTruncatedResultsAreNotTreatedAsComplete',
|
||
)
|
||
"
|
||
/>
|
||
<el-form-item
|
||
v-if="
|
||
editingProjectId && projectForm.arrangementMode === 'Centralized'
|
||
"
|
||
:label="t('experimentsTemplate.labClassInPublishedTimetable')"
|
||
required
|
||
>
|
||
<el-select
|
||
v-model="projectForm.scheduleEntryId"
|
||
filterable
|
||
:disabled="!!editingProjectId"
|
||
:placeholder="
|
||
t('experimentsTemplate.selectALabClassWithAnAssignedLaboratory')
|
||
"
|
||
@change="onScheduleEntryChange"
|
||
>
|
||
<el-option
|
||
v-for="entry in options.scheduleEntries"
|
||
:key="entry.id"
|
||
:label="formatScheduleEntry(entry)"
|
||
:value="entry.id"
|
||
/>
|
||
</el-select>
|
||
<small class="form-help">{{
|
||
t(
|
||
"experimentsTemplate.showsPublishedLabClassesWithAssignedLaboratoriesInYourManagementScopeScheduledLabsReuseTheirTimeAndLaboratoryWithoutCreatingSeparateSessions",
|
||
)
|
||
}}</small>
|
||
</el-form-item>
|
||
<el-form-item
|
||
v-else
|
||
:label="
|
||
editingProjectId
|
||
? t('experimentsDynamic.task')
|
||
: t('experimentsDynamic.classes')
|
||
"
|
||
required
|
||
>
|
||
<el-select
|
||
v-if="editingProjectId"
|
||
v-model="projectForm.teachingTaskIds"
|
||
filterable
|
||
disabled
|
||
:placeholder="t('experimentsTemplate.teachingTask')"
|
||
@change="onTaskChange"
|
||
>
|
||
<el-option
|
||
v-for="task in options.tasks"
|
||
:key="task.id"
|
||
:label="`${task.courseCode} · ${task.courseName} · ${task.taskNumber}`"
|
||
:value="task.id"
|
||
/>
|
||
</el-select>
|
||
<el-checkbox-group
|
||
v-else
|
||
v-model="projectForm.teachingTaskIds"
|
||
class="grouped-task-picker"
|
||
@change="onTaskChange"
|
||
>
|
||
<div class="task-option-filters">
|
||
<el-select
|
||
v-model="offeringCollegeId"
|
||
clearable
|
||
filterable
|
||
:placeholder="t('courses.college')"
|
||
@change="searchTaskOptions"
|
||
>
|
||
<el-option
|
||
v-for="college in options.colleges"
|
||
:key="college.collegeId"
|
||
:label="college.collegeName"
|
||
:value="college.collegeId"
|
||
/>
|
||
</el-select>
|
||
<el-input
|
||
v-model="courseKeyword"
|
||
clearable
|
||
:placeholder="t('experimentsTemplate.courseNameOrCode2')"
|
||
@keyup.enter="searchTaskOptions"
|
||
/>
|
||
<el-button @click="searchTaskOptions">{{
|
||
t("businessLabels.search")
|
||
}}</el-button>
|
||
</div>
|
||
<section
|
||
v-for="group in taskGroups"
|
||
:key="group.key"
|
||
class="task-picker-course"
|
||
>
|
||
<header>
|
||
<span>{{ group.termName }}</span>
|
||
<b>{{ group.courseCode }} · {{ group.courseName }}</b>
|
||
</header>
|
||
<div>
|
||
<el-checkbox
|
||
v-for="task in group.tasks"
|
||
:key="task.id"
|
||
:value="task.id"
|
||
:disabled="
|
||
projectForm.arrangementMode === 'SelfScheduled' &&
|
||
!!selectedTask &&
|
||
(task.academicTermId !== selectedTask.academicTermId ||
|
||
task.courseId !== selectedTask.courseId)
|
||
"
|
||
>
|
||
<b>{{ task.taskNumber }}</b>
|
||
<span>{{ task.classNames.join("、") || task.name }}</span>
|
||
</el-checkbox>
|
||
</div>
|
||
</section>
|
||
<el-empty
|
||
v-if="!taskGroups.length"
|
||
:image-size="46"
|
||
:description="
|
||
t(
|
||
'experimentsTemplate.noMatchingPublishedClassesAdjustTheFilters',
|
||
)
|
||
"
|
||
/>
|
||
</el-checkbox-group>
|
||
<small v-if="!editingProjectId" class="form-help">
|
||
<template v-if="projectForm.arrangementMode === 'Centralized'">{{
|
||
t("experimentsDynamic.selectedClasses", {
|
||
count: projectForm.teachingTaskIds.length,
|
||
})
|
||
}}</template>
|
||
<template v-else>{{
|
||
t(
|
||
"experimentsTemplate.selfBookedLabsAreNotAddedToTheTimetableSelectClassesFromTheSameTermAndCourseOnlyEachProjectMayHaveMultipleBookableSessions",
|
||
)
|
||
}}</template>
|
||
</small>
|
||
</el-form-item>
|
||
<div class="form-grid two">
|
||
<el-form-item :label="t('campusRegistration.projectCode')" required>
|
||
<el-input
|
||
v-model="projectForm.code"
|
||
:disabled="correctingPublishedProject"
|
||
maxlength="40"
|
||
:placeholder="t('experimentsTemplate.eGLAB01')"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item
|
||
v-if="editingProjectId"
|
||
:label="t('batchBusiness.itemName')"
|
||
required
|
||
>
|
||
<el-input
|
||
v-model="projectForm.name"
|
||
maxlength="120"
|
||
:placeholder="
|
||
t(
|
||
'experimentsTemplate.eGDatabaseTransactionsAndConcurrencyLab',
|
||
)
|
||
"
|
||
/>
|
||
</el-form-item>
|
||
</div>
|
||
<template v-if="!editingProjectId">
|
||
<el-form-item
|
||
:label="t('experimentsTemplate.projectNamingMethod')"
|
||
required
|
||
>
|
||
<el-radio-group v-model="projectForm.nameMode">
|
||
<el-radio-button value="Sequence">{{
|
||
t("experimentsTemplate.generateSequenceNumbers")
|
||
}}</el-radio-button>
|
||
<el-radio-button value="InputNames">{{
|
||
t("experimentsTemplate.pasteNamesOnePerLine")
|
||
}}</el-radio-button>
|
||
</el-radio-group>
|
||
</el-form-item>
|
||
<el-form-item
|
||
v-if="projectForm.nameMode === 'Sequence'"
|
||
:label="t('experimentsTemplate.projectNamePrefix')"
|
||
required
|
||
>
|
||
<el-input
|
||
v-model="projectForm.name"
|
||
maxlength="116"
|
||
:placeholder="
|
||
t(
|
||
'experimentsTemplate.eGDatabaseLabGeneratesDatabaseLab01DatabaseLab02',
|
||
)
|
||
"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item
|
||
v-if="
|
||
projectForm.arrangementMode === 'SelfScheduled' &&
|
||
projectForm.nameMode === 'Sequence'
|
||
"
|
||
:label="t('experimentsTemplate.numberOfProjects')"
|
||
required
|
||
>
|
||
<el-input-number
|
||
v-model="projectForm.projectCount"
|
||
:min="1"
|
||
:max="100"
|
||
/>
|
||
<small class="form-help">{{
|
||
t("experimentsDynamic.projectCount", {
|
||
count: projectForm.projectCount,
|
||
})
|
||
}}</small>
|
||
</el-form-item>
|
||
<el-form-item
|
||
v-else
|
||
:label="t('experimentsTemplate.labProjectNames')"
|
||
required
|
||
>
|
||
<el-input
|
||
v-model="projectForm.projectNames"
|
||
type="textarea"
|
||
:rows="6"
|
||
maxlength="120000"
|
||
:placeholder="
|
||
t(
|
||
'experimentsTemplate.oneNamePerLinePasteDirectlyFromExcelNamesCorrespondToTheGeneratedOrder',
|
||
)
|
||
"
|
||
/>
|
||
<small class="form-help">{{
|
||
t("experimentsDynamic.nameCount", {
|
||
count: projectNameLines(projectForm.projectNames).length,
|
||
})
|
||
}}</small>
|
||
</el-form-item>
|
||
</template>
|
||
</div>
|
||
|
||
<div class="form-section">
|
||
<header>
|
||
<span>ROUTE</span
|
||
><b>{{ t("experimentsTemplate.chooseArrangementMode") }}</b>
|
||
</header>
|
||
<el-radio-group
|
||
v-model="projectForm.arrangementMode"
|
||
class="mode-choice"
|
||
:disabled="!!editingProjectId || correctingPublishedProject"
|
||
>
|
||
<el-radio-button value="Centralized">
|
||
<b>{{ t("experimentsTemplate.scheduled") }}</b><small>{{
|
||
t("experimentsTemplate.useThePublishedTimetableLabClass")
|
||
}}</small>
|
||
</el-radio-button>
|
||
<el-radio-button value="SelfScheduled">
|
||
<b>{{ t("experimentsTemplate.selfBooked") }}</b><small>{{
|
||
t("experimentsTemplate.openMultipleSessionsForStudentsToBook")
|
||
}}</small>
|
||
</el-radio-button>
|
||
</el-radio-group>
|
||
<el-form-item
|
||
:label="t('experimentsTemplate.projectOpenDates')"
|
||
required
|
||
>
|
||
<el-date-picker
|
||
v-model="projectForm.dates"
|
||
:disabled="correctingPublishedProject"
|
||
type="daterange"
|
||
value-format="YYYY-MM-DD"
|
||
:range-separator="t('experimentsTemplate.to')"
|
||
:start-placeholder="t('businessLabels.startDate')"
|
||
:end-placeholder="t('businessLabels.endDate')"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item
|
||
v-if="projectForm.arrangementMode === 'SelfScheduled'"
|
||
:label="t('experimentsTemplate.studentBookingPeriod')"
|
||
required
|
||
>
|
||
<el-date-picker
|
||
v-model="projectForm.selectionTimes"
|
||
type="datetimerange"
|
||
value-format="YYYY-MM-DDTHH:mm:ss"
|
||
:range-separator="t('experimentsTemplate.to')"
|
||
start-:placeholder="t('experimentsTemplate.bookingStarts')"
|
||
end-:placeholder="t('experimentsTemplate.bookingEnds')"
|
||
/>
|
||
<small class="form-help">{{
|
||
t(
|
||
"experimentsTemplate.studentsCanBookOneActiveSessionDuringThisPeriodAndMayBookAgainIfTheyWithdrawOrTheSessionIsCancelled",
|
||
)
|
||
}}</small>
|
||
</el-form-item>
|
||
</div>
|
||
|
||
<div class="form-section">
|
||
<header>
|
||
<span>BRIEF</span
|
||
><b>{{
|
||
t("experimentsTemplate.describeWhatStudentsShouldComplete")
|
||
}}</b>
|
||
</header>
|
||
<el-form-item :label="t('experimentsTemplate.labContent')">
|
||
<el-input
|
||
v-model="projectForm.description"
|
||
type="textarea"
|
||
:rows="3"
|
||
maxlength="1000"
|
||
show-word-limit
|
||
:placeholder="
|
||
t(
|
||
'experimentsTemplate.describeLabObjectivesTasksAndDeliverables',
|
||
)
|
||
"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item
|
||
:label="
|
||
t('experimentsTemplate.attendanceAndPreparationRequirements')
|
||
"
|
||
>
|
||
<el-input
|
||
v-model="projectForm.requirements"
|
||
type="textarea"
|
||
:rows="2"
|
||
maxlength="1000"
|
||
show-word-limit
|
||
:placeholder="
|
||
t(
|
||
'experimentsTemplate.eGMaterialsSoftwareInstallationOrGroupingRequirements',
|
||
)
|
||
"
|
||
/>
|
||
</el-form-item>
|
||
</div>
|
||
</el-form>
|
||
<template #footer>
|
||
<el-button @click="projectDialog = false">{{
|
||
t("businessLabels.cancel")
|
||
}}</el-button>
|
||
<el-button type="primary" @click="saveProject">
|
||
{{
|
||
correctingPublishedProject
|
||
? t("experimentsDynamic.saveCorrection")
|
||
: editingProjectId
|
||
? t("experimentsDynamic.saveProject")
|
||
: projectForm.teachingTaskIds.length
|
||
? t("experimentsDynamic.createProjects", {
|
||
count: projectForm.teachingTaskIds.length,
|
||
})
|
||
: t("experimentsDynamic.createProject")
|
||
}}
|
||
</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
|
||
<el-dialog
|
||
v-model="batchRenameDialog"
|
||
:title="t('experimentsTemplate.renameLabProjectsInBulk')"
|
||
width="680px"
|
||
>
|
||
<el-alert
|
||
:title="
|
||
t('experimentsDynamic.renameHelp', {
|
||
count: batchRenameProjects.length,
|
||
})
|
||
"
|
||
type="info"
|
||
:closable="false"
|
||
show-icon
|
||
/>
|
||
<ol class="batch-rename-preview">
|
||
<li v-for="project in batchRenameProjects" :key="project.id">
|
||
{{ project.code }} · {{ project.name }}
|
||
</li>
|
||
</ol>
|
||
<el-input
|
||
v-model="batchRenameNames"
|
||
type="textarea"
|
||
:rows="Math.min(12, Math.max(5, batchRenameProjects.length))"
|
||
maxlength="12000"
|
||
:placeholder="t('experimentsTemplate.oneLabProjectNamePerLine')"
|
||
/>
|
||
<template #footer>
|
||
<el-button @click="batchRenameDialog = false">{{
|
||
t("businessLabels.cancel")
|
||
}}</el-button>
|
||
<el-button type="primary" @click="saveBatchRename">{{
|
||
t("experimentsTemplate.saveNames")
|
||
}}</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
|
||
<el-dialog
|
||
v-model="sessionDialog"
|
||
:title="
|
||
t('experimentsDynamic.sessionTitle', {
|
||
name: selectedProject?.name ?? '',
|
||
})
|
||
"
|
||
width="650px"
|
||
>
|
||
<el-form label-position="top" class="experiment-form">
|
||
<el-alert
|
||
:title="
|
||
selectedProject?.arrangementMode === 'Centralized'
|
||
? t('experimentsDynamic.centralConflict')
|
||
: t('experimentsDynamic.openConflict')
|
||
"
|
||
type="info"
|
||
:closable="false"
|
||
show-icon
|
||
/>
|
||
<div class="form-grid two">
|
||
<el-form-item :label="t('experimentsTemplate.labDate')" required>
|
||
<el-date-picker
|
||
v-model="sessionForm.sessionDate"
|
||
type="date"
|
||
value-format="YYYY-MM-DD"
|
||
:placeholder="t('batchBusiness.selectDate')"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item :label="t('batchBusiness.startingPeriod')" required>
|
||
<el-select
|
||
v-model="sessionForm.startPeriod"
|
||
:placeholder="t('adjustmentBatch.selectAPeriod2')"
|
||
>
|
||
<el-option
|
||
v-for="period in activePeriods"
|
||
:key="period.periodNumber"
|
||
:label="
|
||
period.startsAt
|
||
? `${period.name} · ${period.startsAt}–${period.endsAt}`
|
||
: period.name
|
||
"
|
||
:value="period.periodNumber"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item :label="t('freeClassrooms.periodCount')" required>
|
||
<el-input-number
|
||
v-model="sessionForm.periodCount"
|
||
:min="1"
|
||
:max="12"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item
|
||
:label="t('experimentsTemplate.sessionCapacity')"
|
||
required
|
||
>
|
||
<el-input-number
|
||
v-model="sessionForm.capacity"
|
||
:min="1"
|
||
:max="10000"
|
||
/>
|
||
</el-form-item>
|
||
</div>
|
||
<el-form-item :label="t('experimentsTemplate.labVenue')" required>
|
||
<el-select
|
||
v-model="sessionForm.classroomId"
|
||
filterable
|
||
:placeholder="t('experimentsTemplate.selectATeachingVenue')"
|
||
>
|
||
<el-option
|
||
v-for="room in experimentClassrooms"
|
||
:key="room.id"
|
||
:label="
|
||
t('experimentsDynamic.room', {
|
||
campus: room.campusName,
|
||
building: room.buildingName,
|
||
name: room.name,
|
||
capacity: room.capacity,
|
||
})
|
||
"
|
||
:value="room.id"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item
|
||
:label="t('experimentsTemplate.instructorsMultipleSelection')"
|
||
required
|
||
>
|
||
<el-select
|
||
v-model="sessionForm.instructorTeacherIds"
|
||
multiple
|
||
filterable
|
||
:placeholder="
|
||
t('experimentsTemplate.selectInstructorsForThisTeachingTask')
|
||
"
|
||
>
|
||
<el-option
|
||
v-for="teacher in instructorsForSelectedProject()"
|
||
:key="teacher.teacherId"
|
||
:label="`${teacher.teacherNumber} · ${teacher.teacherName}`"
|
||
:value="teacher.teacherId"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item :label="t('experimentsTemplate.sessionNotes')">
|
||
<el-input
|
||
v-model="sessionForm.notes"
|
||
maxlength="500"
|
||
:placeholder="
|
||
t('experimentsTemplate.eGGroupingEquipmentOrMaterials')
|
||
"
|
||
/>
|
||
</el-form-item>
|
||
</el-form>
|
||
<template #footer>
|
||
<el-button @click="sessionDialog = false">{{
|
||
t("businessLabels.cancel")
|
||
}}</el-button>
|
||
<el-button type="primary" @click="saveSession">{{
|
||
t("experimentsTemplate.saveSession")
|
||
}}</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
|
||
<el-dialog
|
||
v-model="batchSessionDialog"
|
||
:title="t('experimentsTemplate.scheduleLabSessionsInBulk')"
|
||
width="min(1180px, 94vw)"
|
||
top="4vh"
|
||
>
|
||
<el-alert
|
||
:title="
|
||
t(
|
||
'experimentsTemplate.submitTheEntireBatchAtOnceEachEntryIsCheckedForManagementScopeOpenDatesLaboratoryTimetableInstructorAndClassConflictsIfAnyEntryFailsNoneAreSaved',
|
||
)
|
||
"
|
||
type="info"
|
||
:closable="false"
|
||
show-icon
|
||
/>
|
||
<el-form label-position="top" class="batch-session-form">
|
||
<el-form-item
|
||
:label="t('experimentsTemplate.selectLabProjects')"
|
||
required
|
||
>
|
||
<el-select
|
||
v-model="batchSessionProjectIds"
|
||
multiple
|
||
filterable
|
||
collapse-tags
|
||
collapse-tags-tooltip
|
||
:placeholder="
|
||
t('experimentsTemplate.selectLabProjectsToScheduleTogether')
|
||
"
|
||
@change="syncBatchSessionRows"
|
||
>
|
||
<el-option
|
||
v-for="project in batchProjectOptions"
|
||
:key="project.id"
|
||
:label="`${project.courseCode} · ${project.name} · ${project.taskNumber}`"
|
||
:value="project.id"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<div v-if="batchSessionRows.length" class="batch-session-tools">
|
||
<span>{{
|
||
t("experimentsDynamic.candidate", {
|
||
count: batchSessionRows.length,
|
||
})
|
||
}}</span>
|
||
<el-button size="small" @click="applyFirstBatchTime">{{
|
||
t("experimentsTemplate.applyFirstRowDateAndPeriods")
|
||
}}</el-button>
|
||
</div>
|
||
<div class="batch-session-table">
|
||
<article
|
||
v-for="(row, index) in batchSessionRows"
|
||
:key="row.rowKey"
|
||
class="batch-session-row"
|
||
>
|
||
<div class="batch-project-cell">
|
||
<span>{{ index + 1 }}</span>
|
||
<div>
|
||
<b>{{ batchProject(row.projectId)?.name }}</b>
|
||
<small
|
||
>{{ batchProject(row.projectId)?.taskNumber }} ·
|
||
{{
|
||
batchProject(row.projectId)?.classNames.join("、") ||
|
||
t("experimentsDynamic.students")
|
||
}}</small
|
||
>
|
||
</div>
|
||
</div>
|
||
<el-date-picker
|
||
v-model="row.sessionDate"
|
||
type="date"
|
||
value-format="YYYY-MM-DD"
|
||
:placeholder="t('experimentsTemplate.labDate')"
|
||
/>
|
||
<el-select
|
||
v-model="row.startPeriod"
|
||
:placeholder="t('batchBusiness.startingPeriod')"
|
||
>
|
||
<el-option
|
||
v-for="period in periodsForProject(row.projectId)"
|
||
:key="period.periodNumber"
|
||
:label="period.name"
|
||
:value="period.periodNumber"
|
||
/>
|
||
</el-select>
|
||
<el-input-number
|
||
v-model="row.periodCount"
|
||
:min="1"
|
||
:max="12"
|
||
controls-position="right"
|
||
/>
|
||
<el-select
|
||
v-model="row.classroomId"
|
||
filterable
|
||
:placeholder="t('experimentsTemplate.labVenue')"
|
||
>
|
||
<el-option
|
||
v-for="room in experimentClassrooms"
|
||
:key="room.id"
|
||
:label="
|
||
t('experimentsDynamic.room', {
|
||
campus: room.campusName,
|
||
building: room.buildingName,
|
||
name: room.name,
|
||
capacity: room.capacity,
|
||
})
|
||
"
|
||
:value="room.id"
|
||
/>
|
||
</el-select>
|
||
<el-select
|
||
v-model="row.instructorTeacherIds"
|
||
multiple
|
||
filterable
|
||
collapse-tags
|
||
:placeholder="t('experimentsTemplate.instructor')"
|
||
>
|
||
<el-option
|
||
v-for="teacher in instructorsForProject(row.projectId)"
|
||
:key="teacher.teacherId"
|
||
:label="teacher.teacherName"
|
||
:value="teacher.teacherId"
|
||
/>
|
||
</el-select>
|
||
<el-input-number
|
||
v-model="row.capacity"
|
||
:min="1"
|
||
:max="10000"
|
||
controls-position="right"
|
||
/>
|
||
<span class="batch-session-actions">
|
||
<el-button
|
||
size="small"
|
||
text
|
||
type="primary"
|
||
@click="addBatchSessionRow(row.projectId, row)"
|
||
>{{ t("experimentsTemplate.addTimeSlot") }}</el-button
|
||
>
|
||
<el-button
|
||
size="small"
|
||
text
|
||
type="danger"
|
||
@click="removeBatchSessionRow(row)"
|
||
>{{ t("businessLabels.remove") }}</el-button
|
||
>
|
||
</span>
|
||
</article>
|
||
</div>
|
||
<el-empty
|
||
v-if="!batchSessionRows.length"
|
||
:image-size="60"
|
||
:description="
|
||
t('experimentsTemplate.selectLabProjectsThenScheduleThemInOneTable')
|
||
"
|
||
/>
|
||
</el-form>
|
||
<template #footer>
|
||
<el-button @click="batchSessionDialog = false">{{
|
||
t("businessLabels.cancel")
|
||
}}</el-button>
|
||
<el-button
|
||
type="primary"
|
||
:disabled="!batchSessionRows.length"
|
||
@click="saveBatchSessions"
|
||
>
|
||
{{ t("experimentsTemplate.submitBatchSchedule") }}
|
||
</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
|
||
<el-dialog
|
||
v-model="participantsDialog"
|
||
:title="
|
||
t('experimentsDynamic.participants', {
|
||
label:
|
||
participantSession?.project?.arrangementMode === 'Centralized'
|
||
? t('experimentsDynamic.expected')
|
||
: t('experimentsDynamic.bookings'),
|
||
time: participantSession ? formatSessionTime(participantSession) : '',
|
||
})
|
||
"
|
||
width="680px"
|
||
>
|
||
<el-table
|
||
v-loading="participantsLoading"
|
||
:data="participants"
|
||
max-height="480"
|
||
>
|
||
<el-table-column
|
||
prop="studentNumber"
|
||
:label="t('businessLabels.studentNumber')"
|
||
min-width="130"
|
||
/>
|
||
<el-table-column
|
||
prop="name"
|
||
:label="t('businessLabels.name')"
|
||
min-width="100"
|
||
/>
|
||
<el-table-column
|
||
prop="className"
|
||
:label="t('businessLabels.administrativeClass')"
|
||
min-width="160"
|
||
/>
|
||
<el-table-column
|
||
:label="t('experimentsTemplate.participationMode')"
|
||
width="110"
|
||
>
|
||
<template #default="{ row }">
|
||
<el-tag
|
||
:type="
|
||
row.participationType === 'Centralized' ? 'primary' : 'success'
|
||
"
|
||
size="small"
|
||
effect="plain"
|
||
>
|
||
{{
|
||
row.participationType === "Centralized"
|
||
? t("experimentsDynamic.scheduled")
|
||
: t("experimentsDynamic.studentBooking")
|
||
}}
|
||
</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<el-empty
|
||
v-if="!participantsLoading && !participants.length"
|
||
:description="t('experimentsTemplate.noStudentsListed')"
|
||
/>
|
||
<template #footer>
|
||
<el-button
|
||
v-if="
|
||
participantSession?.project?.arrangementMode === 'SelfScheduled'
|
||
"
|
||
type="primary"
|
||
@click="openProxyBooking"
|
||
>{{ t("experimentsTemplate.bookOnBehalfOfStudents") }}</el-button
|
||
>
|
||
<el-button @click="participantsDialog = false">{{
|
||
t("businessLabels.close")
|
||
}}</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
|
||
<el-dialog
|
||
v-model="proxyBookingDialog"
|
||
:title="t('experimentsTemplate.bookLabSessionsForStudents')"
|
||
width="620px"
|
||
>
|
||
<el-alert
|
||
:title="
|
||
t(
|
||
'experimentsTemplate.teacherBookingsAreNotLimitedByTheStudentBookingWindowButClassMembershipCapacityAndStudentTimetableAndLabConflictsAreStillChecked',
|
||
)
|
||
"
|
||
type="info"
|
||
:closable="false"
|
||
show-icon
|
||
/>
|
||
<div class="proxy-booking-search">
|
||
<el-input
|
||
v-model="proxyBookingKeyword"
|
||
clearable
|
||
:placeholder="
|
||
t('batchBusiness.enterStudentNumberNameOrAdministrativeClass')
|
||
"
|
||
@keyup.enter="loadProxyBookingStudents(1)"
|
||
/>
|
||
<el-button @click="loadProxyBookingStudents(1)">{{
|
||
t("businessLabels.search")
|
||
}}</el-button>
|
||
</div>
|
||
<el-table
|
||
v-loading="proxyBookingLoading"
|
||
:data="proxyBookingStudents"
|
||
max-height="400"
|
||
@selection-change="
|
||
(rows) => (proxyBookingStudentIds = rows.map((row) => row.studentId))
|
||
"
|
||
>
|
||
<el-table-column type="selection" width="54" />
|
||
<el-table-column
|
||
prop="studentNumber"
|
||
:label="t('businessLabels.studentNumber')"
|
||
min-width="130"
|
||
/>
|
||
<el-table-column
|
||
prop="name"
|
||
:label="t('businessLabels.name')"
|
||
min-width="100"
|
||
/>
|
||
<el-table-column
|
||
prop="className"
|
||
:label="t('businessLabels.administrativeClass')"
|
||
min-width="180"
|
||
/>
|
||
</el-table>
|
||
<el-pagination
|
||
v-if="proxyBookingTotal > proxyBookingPageSize"
|
||
background
|
||
:current-page="proxyBookingPage"
|
||
:page-size="proxyBookingPageSize"
|
||
:total="proxyBookingTotal"
|
||
layout="total, prev, pager, next"
|
||
@current-change="loadProxyBookingStudents"
|
||
/>
|
||
<el-empty
|
||
v-if="!proxyBookingLoading && !proxyBookingStudents.length"
|
||
:description="t('experimentsTemplate.noStudentsAvailableForBooking')"
|
||
/>
|
||
<template #footer>
|
||
<el-button @click="proxyBookingDialog = false">{{
|
||
t("businessLabels.cancel")
|
||
}}</el-button>
|
||
<el-button
|
||
type="primary"
|
||
:disabled="!proxyBookingStudentIds.length"
|
||
@click="saveProxyBooking"
|
||
>
|
||
{{
|
||
t("experimentsDynamic.confirmProxy", {
|
||
count: proxyBookingStudentIds.length,
|
||
})
|
||
}}
|
||
</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
</div>
|
||
</template>
|
||
|
||
<style scoped>
|
||
.experiment-page {
|
||
--lab-blue: #245d82;
|
||
--lab-teal: #168276;
|
||
--lab-ink: #173041;
|
||
}
|
||
.experiment-intro {
|
||
align-items: flex-start;
|
||
}
|
||
.intro-actions {
|
||
display: flex;
|
||
gap: 8px;
|
||
align-items: center;
|
||
}
|
||
.lab-rail {
|
||
display: grid;
|
||
grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr);
|
||
gap: 0;
|
||
margin-bottom: 16px;
|
||
border: 1px solid #ccdce5;
|
||
background: var(--surface-muted);
|
||
}
|
||
.rail-lane {
|
||
position: relative;
|
||
padding: 17px 20px 18px 24px;
|
||
overflow: hidden;
|
||
}
|
||
.rail-lane::before {
|
||
content: "";
|
||
position: absolute;
|
||
inset: 0 auto 0 0;
|
||
width: 5px;
|
||
background: var(--lab-blue);
|
||
}
|
||
.rail-lane.flexible::before {
|
||
background: var(--lab-teal);
|
||
}
|
||
.rail-lane b {
|
||
display: block;
|
||
margin: 4px 0;
|
||
color: var(--lab-ink);
|
||
font-size: 15px;
|
||
}
|
||
.rail-lane p {
|
||
margin: 0;
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
line-height: 1.65;
|
||
}
|
||
.rail-code {
|
||
color: #607987;
|
||
font:
|
||
700 10px/1.2 Consolas,
|
||
monospace;
|
||
letter-spacing: 0.08em;
|
||
}
|
||
.rail-switch {
|
||
position: relative;
|
||
display: grid;
|
||
place-content: center;
|
||
gap: 8px;
|
||
background: linear-gradient(
|
||
90deg,
|
||
transparent 49%,
|
||
#b9cbd5 49%,
|
||
#b9cbd5 51%,
|
||
transparent 51%
|
||
);
|
||
}
|
||
.rail-switch i {
|
||
width: 30px;
|
||
height: 7px;
|
||
border: 2px solid #7794a5;
|
||
border-radius: 999px;
|
||
background: var(--surface);
|
||
}
|
||
.experiment-toolbar {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
align-items: center;
|
||
gap: 10px;
|
||
margin-bottom: 16px;
|
||
}
|
||
.experiment-toolbar .el-select {
|
||
width: 210px;
|
||
}
|
||
.experiment-toolbar .el-input {
|
||
width: 172px;
|
||
}
|
||
.result-note {
|
||
margin-left: auto;
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
}
|
||
.experiment-batch-bar {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
align-items: center;
|
||
gap: 10px;
|
||
min-height: 46px;
|
||
margin: -6px 0 16px;
|
||
padding: 8px 12px;
|
||
border: 1px solid #cddce3;
|
||
background: var(--surface-muted);
|
||
}
|
||
.experiment-batch-bar > span {
|
||
margin-right: auto;
|
||
color: #5c7481;
|
||
font-size: 12px;
|
||
}
|
||
.batch-rename-preview {
|
||
max-height: 180px;
|
||
margin: 14px 0;
|
||
overflow: auto;
|
||
padding: 10px 12px 10px 32px;
|
||
border: 1px solid var(--line);
|
||
background: #f8fbfc;
|
||
color: #526b78;
|
||
font-size: 12px;
|
||
line-height: 1.8;
|
||
}
|
||
.experiment-pagination {
|
||
justify-content: flex-end;
|
||
margin-top: 4px;
|
||
}
|
||
.project-list {
|
||
display: grid;
|
||
gap: 14px;
|
||
min-height: 160px;
|
||
}
|
||
.project-group {
|
||
overflow: hidden;
|
||
border: 1px solid #cddce3;
|
||
background: #f6fafb;
|
||
}
|
||
.project-group-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 16px;
|
||
padding: 13px 17px;
|
||
border-left: 5px solid var(--lab-blue);
|
||
background: #edf4f6;
|
||
}
|
||
.project-group-head > div:first-child {
|
||
display: grid;
|
||
gap: 3px;
|
||
}
|
||
.project-group-head h3 {
|
||
margin: 0;
|
||
color: var(--lab-ink);
|
||
font-size: 15px;
|
||
}
|
||
.project-group-head > div:first-child span {
|
||
color: #68808d;
|
||
font:
|
||
700 10px/1 Consolas,
|
||
monospace;
|
||
letter-spacing: 0.06em;
|
||
}
|
||
.project-group-task {
|
||
display: grid;
|
||
justify-items: end;
|
||
gap: 3px;
|
||
color: #5c7481;
|
||
font-size: 11px;
|
||
text-align: right;
|
||
}
|
||
.project-group-task b {
|
||
color:var(--ink);
|
||
font-size: 12px;
|
||
}
|
||
.project-group-projects {
|
||
display: grid;
|
||
gap: 0;
|
||
padding: 0;
|
||
}
|
||
.project-table {
|
||
--el-table-border-color: var(--table-border);
|
||
--el-table-header-bg-color: var(--table-header-surface);
|
||
--el-table-row-hover-bg-color: var(--table-row-hover);
|
||
width: 100%;
|
||
}
|
||
.project-table :deep(th.el-table__cell) {
|
||
padding: 8px 0;
|
||
color: var(--table-header-text);
|
||
background: var(--table-header-surface);
|
||
font-size: 12px;
|
||
font-weight: 650;
|
||
}
|
||
.project-table :deep(td.el-table__cell) {
|
||
padding: 9px 0;
|
||
vertical-align: top;
|
||
}
|
||
.student-project-table :deep(td.el-table__cell) {
|
||
vertical-align: middle;
|
||
}
|
||
.table-project-name,
|
||
.table-schedule {
|
||
display: grid;
|
||
gap: 4px;
|
||
min-width: 0;
|
||
}
|
||
.table-project-name b {
|
||
color: var(--lab-ink);
|
||
font-size: 13px;
|
||
}
|
||
.table-project-name small,
|
||
.table-schedule small {
|
||
overflow: hidden;
|
||
color:var(--muted);
|
||
font-size: 11px;
|
||
line-height: 1.45;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.table-schedule b {
|
||
color:var(--ink);
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
}
|
||
.table-schedule.is-booked b {
|
||
color: var(--lab-teal);
|
||
}
|
||
.table-muted {
|
||
color: #8b9aa4;
|
||
font-size: 12px;
|
||
}
|
||
.student-project-detail {
|
||
display: grid;
|
||
grid-template-columns: repeat(2, minmax(220px, 1fr));
|
||
gap: 7px 20px;
|
||
padding: 11px 18px 13px;
|
||
background: var(--surface-muted);
|
||
}
|
||
.student-project-detail p {
|
||
margin: 0;
|
||
display: grid;
|
||
grid-template-columns: 70px 1fr;
|
||
gap: 8px;
|
||
color: #5f7682;
|
||
font-size: 11px;
|
||
line-height: 1.55;
|
||
}
|
||
.student-project-detail b {
|
||
color:var(--ink);
|
||
}
|
||
.student-session-menu {
|
||
display: grid;
|
||
gap: 7px;
|
||
}
|
||
.student-session-menu > header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
padding-bottom: 8px;
|
||
border-bottom: 1px solid #dfe7ea;
|
||
}
|
||
.student-session-menu > header b {
|
||
color: var(--lab-ink);
|
||
font-size: 12px;
|
||
}
|
||
.student-session-menu > header span {
|
||
color: #71858e;
|
||
font-size: 10px;
|
||
}
|
||
.student-session-option {
|
||
display: grid;
|
||
grid-template-columns: minmax(0, 1fr) auto auto;
|
||
align-items: center;
|
||
gap: 9px;
|
||
padding: 8px 9px;
|
||
border: 1px solid #e0e7ea;
|
||
background: var(--surface);
|
||
}
|
||
.student-session-option.is-selected {
|
||
border-color: #79afa5;
|
||
box-shadow: inset 3px 0 0 var(--lab-teal);
|
||
background: #f3faf8;
|
||
}
|
||
.student-session-option > div {
|
||
display: grid;
|
||
gap: 2px;
|
||
min-width: 0;
|
||
}
|
||
.student-session-option > div b {
|
||
color:var(--ink);
|
||
font-size: 11px;
|
||
}
|
||
.student-session-option > div span {
|
||
overflow: hidden;
|
||
color:var(--muted);
|
||
font-size: 10px;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.project-card {
|
||
overflow: hidden;
|
||
border: 0;
|
||
border-top: 1px solid #dce5ea;
|
||
border-left: 4px solid var(--lab-blue);
|
||
border-radius: var(--radius-card);
|
||
background: var(--surface);
|
||
box-shadow: var(--shadow-card);
|
||
}
|
||
.project-card.is-flexible {
|
||
border-top-color: var(--lab-teal);
|
||
}
|
||
.project-card.is-closed {
|
||
opacity: 0.82;
|
||
}
|
||
.project-head {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
gap: 16px;
|
||
padding: 18px 20px 10px;
|
||
}
|
||
.project-code {
|
||
color:var(--muted);
|
||
font:
|
||
700 10px/1.2 Consolas,
|
||
monospace;
|
||
letter-spacing: 0.06em;
|
||
text-transform: uppercase;
|
||
}
|
||
.project-identity h3 {
|
||
margin: 5px 0 4px;
|
||
color: var(--lab-ink);
|
||
font-size: 18px;
|
||
}
|
||
.project-identity p {
|
||
margin: 0;
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
}
|
||
.project-tags {
|
||
display: flex;
|
||
gap: 6px;
|
||
align-items: flex-start;
|
||
flex-shrink: 0;
|
||
}
|
||
.project-context {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 7px 22px;
|
||
padding: 0 20px 12px;
|
||
color: #5c7481;
|
||
font-size: 12px;
|
||
}
|
||
.project-context span {
|
||
display: inline-flex;
|
||
gap: 7px;
|
||
}
|
||
.project-context b {
|
||
color: #304b5a;
|
||
font-weight: 600;
|
||
}
|
||
.project-description {
|
||
margin: 0;
|
||
padding: 10px 20px;
|
||
border-top: 1px solid #edf1f3;
|
||
color: #415b69;
|
||
font-size: 13px;
|
||
line-height: 1.7;
|
||
}
|
||
.requirement-strip {
|
||
display: grid;
|
||
grid-template-columns: 74px 1fr;
|
||
gap: 10px;
|
||
margin: 0 20px 14px;
|
||
padding: 10px 12px;
|
||
border-left: 3px solid #e3a13c;
|
||
background: #fff9ef;
|
||
color: #6d5b3e;
|
||
font-size: 12px;
|
||
line-height: 1.6;
|
||
}
|
||
.session-board {
|
||
margin: 0 20px 16px;
|
||
border: 1px solid var(--line);
|
||
background: var(--surface-muted);
|
||
}
|
||
.session-board-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
padding: 11px 13px;
|
||
border-bottom: 1px solid var(--line);
|
||
}
|
||
.session-board-head div {
|
||
display: grid;
|
||
gap: 2px;
|
||
}
|
||
.session-board-head span {
|
||
color: #617986;
|
||
font:
|
||
700 10px/1.2 Consolas,
|
||
monospace;
|
||
letter-spacing: 0.06em;
|
||
text-transform: uppercase;
|
||
}
|
||
.session-board-head b {
|
||
color:var(--ink);
|
||
font-size: 11px;
|
||
font-weight: 500;
|
||
}
|
||
.session-grid {
|
||
display: grid;
|
||
gap: 8px;
|
||
padding: 10px;
|
||
}
|
||
.session-ticket {
|
||
display: grid;
|
||
grid-template-columns: 58px minmax(0, 1fr) auto;
|
||
gap: 12px;
|
||
align-items: center;
|
||
min-height: 74px;
|
||
border: 1px solid var(--line);
|
||
background: var(--surface);
|
||
transition:
|
||
border-color 0.18s ease,
|
||
box-shadow 0.18s ease;
|
||
}
|
||
.session-ticket:hover {
|
||
border-color: #9fb7c4;
|
||
box-shadow: 0 5px 14px rgb(40 76 96 / 7%);
|
||
}
|
||
.session-ticket.is-selected {
|
||
border-color: var(--lab-teal);
|
||
box-shadow: inset 4px 0 0 var(--lab-teal);
|
||
}
|
||
.session-ticket.is-cancelled {
|
||
opacity: 0.58;
|
||
}
|
||
.ticket-date {
|
||
display: grid;
|
||
place-content: center;
|
||
align-self: stretch;
|
||
border-right: 1px dashed #cddbe2;
|
||
background: #f0f5f7;
|
||
text-align: center;
|
||
}
|
||
.ticket-date strong {
|
||
color: var(--lab-ink);
|
||
font:
|
||
700 22px/1 Consolas,
|
||
monospace;
|
||
}
|
||
.ticket-date span {
|
||
margin-top: 4px;
|
||
color: #657d89;
|
||
font-size: 10px;
|
||
}
|
||
.ticket-body {
|
||
display: grid;
|
||
gap: 3px;
|
||
min-width: 0;
|
||
}
|
||
.ticket-body b {
|
||
color: #243f4f;
|
||
font-size: 13px;
|
||
}
|
||
.ticket-body span {
|
||
color: #5c7481;
|
||
font-size: 12px;
|
||
}
|
||
.ticket-body small {
|
||
overflow: hidden;
|
||
color: #81929b;
|
||
font-size: 10px;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.ticket-action {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: flex-end;
|
||
gap: 5px;
|
||
padding-right: 10px;
|
||
}
|
||
.project-actions {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 8px;
|
||
padding: 12px 20px;
|
||
border-top: 1px solid #e5ecef;
|
||
background: var(--surface-muted);
|
||
}
|
||
.student-booking-summary {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
padding: 12px 20px;
|
||
border-top: 1px solid #cce3de;
|
||
background: #f0faf7;
|
||
}
|
||
.student-booking-summary > div {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
color: var(--lab-teal);
|
||
}
|
||
.student-booking-summary svg {
|
||
width: 22px;
|
||
}
|
||
.student-booking-summary span {
|
||
display: grid;
|
||
gap: 2px;
|
||
color: #365f5b;
|
||
font-size: 12px;
|
||
}
|
||
.student-booking-summary b {
|
||
font-size: 10px;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.06em;
|
||
}
|
||
.experiment-form {
|
||
display: grid;
|
||
gap: 13px;
|
||
}
|
||
.grouped-task-picker {
|
||
display: grid;
|
||
gap: 10px;
|
||
max-height: 310px;
|
||
overflow: auto;
|
||
padding: 10px;
|
||
border: 1px solid #d8e3e8;
|
||
background: var(--surface);
|
||
}
|
||
.task-option-filters {
|
||
display: grid;
|
||
grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) auto;
|
||
gap: 8px;
|
||
}
|
||
.task-picker-course {
|
||
overflow: hidden;
|
||
border: 1px solid #e0e8eb;
|
||
}
|
||
.task-picker-course header {
|
||
display: flex;
|
||
align-items: baseline;
|
||
gap: 8px;
|
||
padding: 8px 10px;
|
||
background: #f3f7f8;
|
||
}
|
||
.task-picker-course header span {
|
||
color: #738994;
|
||
font:
|
||
700 10px/1 Consolas,
|
||
monospace;
|
||
}
|
||
.task-picker-course header b {
|
||
color: #314f60;
|
||
font-size: 12px;
|
||
}
|
||
.task-picker-course > div {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
|
||
gap: 2px 12px;
|
||
padding: 8px 10px;
|
||
}
|
||
.task-picker-course :deep(.el-checkbox) {
|
||
height: auto;
|
||
margin-right: 0;
|
||
white-space: normal;
|
||
}
|
||
.task-picker-course :deep(.el-checkbox__label) {
|
||
display: inline-flex;
|
||
gap: 6px;
|
||
min-width: 0;
|
||
color: #536b78;
|
||
font-size: 12px;
|
||
}
|
||
.task-picker-course :deep(.el-checkbox__label b) {
|
||
flex: 0 0 auto;
|
||
color: #284757;
|
||
}
|
||
.form-help {
|
||
display: block;
|
||
margin-top: 7px;
|
||
color: var(--muted);
|
||
line-height: 1.5;
|
||
}
|
||
.form-section {
|
||
padding: 14px 15px 1px;
|
||
border: 1px solid var(--line);
|
||
background: var(--surface-muted);
|
||
}
|
||
.form-section > header {
|
||
display: flex;
|
||
align-items: baseline;
|
||
gap: 9px;
|
||
margin-bottom: 13px;
|
||
}
|
||
.form-section > header span {
|
||
color: var(--lab-teal);
|
||
font:
|
||
700 10px/1 Consolas,
|
||
monospace;
|
||
letter-spacing: 0.08em;
|
||
}
|
||
.form-section > header b {
|
||
color: var(--lab-ink);
|
||
font-size: 14px;
|
||
}
|
||
.mode-choice {
|
||
display: grid;
|
||
grid-template-columns: 1fr 1fr;
|
||
margin-bottom: 16px;
|
||
}
|
||
.mode-choice :deep(.el-radio-button__inner) {
|
||
display: grid;
|
||
gap: 5px;
|
||
width: 100%;
|
||
padding: 13px;
|
||
}
|
||
.mode-choice b {
|
||
font-size: 13px;
|
||
}
|
||
.mode-choice small {
|
||
font-size: 10px;
|
||
font-weight: 400;
|
||
}
|
||
.batch-session-form {
|
||
display: grid;
|
||
gap: 12px;
|
||
margin-top: 16px;
|
||
}
|
||
.batch-session-tools {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
}
|
||
.batch-session-table {
|
||
display: grid;
|
||
gap: 8px;
|
||
overflow-x: auto;
|
||
padding-bottom: 4px;
|
||
}
|
||
.batch-session-row {
|
||
display: grid;
|
||
grid-template-columns: minmax(210px, 1.2fr) 145px 110px 100px minmax(
|
||
200px,
|
||
1.1fr
|
||
) minmax(150px, 0.8fr) 100px auto;
|
||
gap: 8px;
|
||
align-items: center;
|
||
min-width: 1000px;
|
||
padding: 10px;
|
||
border: 1px solid var(--line);
|
||
background: #f9fbfc;
|
||
}
|
||
.batch-session-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 2px;
|
||
white-space: nowrap;
|
||
}
|
||
.batch-project-cell {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
min-width: 0;
|
||
}
|
||
.batch-project-cell > span {
|
||
display: grid;
|
||
width: 25px;
|
||
height: 25px;
|
||
place-items: center;
|
||
border-radius: 50%;
|
||
background: #e5f0f5;
|
||
color: var(--lab-blue);
|
||
font:
|
||
700 11px/1 Consolas,
|
||
monospace;
|
||
}
|
||
.batch-project-cell > div {
|
||
display: grid;
|
||
gap: 3px;
|
||
min-width: 0;
|
||
}
|
||
.batch-project-cell b,
|
||
.batch-project-cell small {
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.batch-project-cell b {
|
||
color: var(--lab-ink);
|
||
font-size: 12px;
|
||
}
|
||
.batch-project-cell small {
|
||
color: var(--muted);
|
||
font-size: 10px;
|
||
}
|
||
.mobile-project-cards {
|
||
display: none;
|
||
}
|
||
@media (prefers-reduced-motion: reduce) {
|
||
.session-ticket {
|
||
transition: none;
|
||
}
|
||
}
|
||
@media (max-width: 760px) {
|
||
.lab-rail {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
.rail-switch {
|
||
display: none;
|
||
}
|
||
.rail-lane {
|
||
border-bottom: 1px solid #d5e1e7;
|
||
}
|
||
.experiment-toolbar .el-select {
|
||
width: 100%;
|
||
}
|
||
.result-note {
|
||
width: 100%;
|
||
margin-left: 0;
|
||
}
|
||
.project-head {
|
||
align-items: flex-start;
|
||
padding: 15px 14px 9px;
|
||
}
|
||
.project-context,
|
||
.project-description {
|
||
padding-inline: 14px;
|
||
}
|
||
.requirement-strip,
|
||
.session-board {
|
||
margin-inline: 14px;
|
||
}
|
||
.session-ticket {
|
||
grid-template-columns: 54px minmax(0, 1fr);
|
||
}
|
||
.ticket-action {
|
||
grid-column: 1 / -1;
|
||
justify-content: flex-start;
|
||
padding: 0 10px 10px;
|
||
}
|
||
.project-actions,
|
||
.student-booking-summary {
|
||
padding-inline: 14px;
|
||
}
|
||
.student-project-detail {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
.mode-choice {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
.intro-actions {
|
||
flex-wrap: wrap;
|
||
justify-content: flex-end;
|
||
}
|
||
.desktop-project-table {
|
||
display: none;
|
||
}
|
||
.mobile-project-cards {
|
||
display: grid;
|
||
gap: 1px;
|
||
background: #dce5ea;
|
||
}
|
||
.mobile-project-card {
|
||
padding: 15px 14px;
|
||
background: var(--surface);
|
||
}
|
||
.mobile-project-card > header {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
}
|
||
.mobile-project-card > header > div {
|
||
min-width: 0;
|
||
}
|
||
.mobile-project-card > header span {
|
||
color: #68808d;
|
||
font:
|
||
700 10px/1.2 Consolas,
|
||
monospace;
|
||
letter-spacing: 0.06em;
|
||
}
|
||
.mobile-project-card h4 {
|
||
margin: 4px 0 0;
|
||
color: var(--lab-ink);
|
||
font-size: 15px;
|
||
line-height: 1.45;
|
||
}
|
||
.mobile-project-card > p {
|
||
margin: 9px 0 0;
|
||
color:var(--muted);
|
||
font-size: 12px;
|
||
line-height: 1.6;
|
||
}
|
||
.mobile-project-arrangement {
|
||
display: grid;
|
||
gap: 5px;
|
||
margin-top: 13px;
|
||
padding: 11px 12px;
|
||
border-left: 3px solid #a6bbc6;
|
||
background: #f6fafb;
|
||
}
|
||
.mobile-project-arrangement > b {
|
||
color:var(--ink);
|
||
font-size: 12px;
|
||
}
|
||
.mobile-project-arrangement > span {
|
||
color: #405d6c;
|
||
font-size: 12px;
|
||
line-height: 1.5;
|
||
}
|
||
.mobile-project-arrangement > small {
|
||
color: #718792;
|
||
font-size: 11px;
|
||
line-height: 1.45;
|
||
}
|
||
.mobile-session-list {
|
||
display: grid;
|
||
gap: 7px;
|
||
margin-top: 3px;
|
||
}
|
||
.mobile-session-list > article {
|
||
display: grid;
|
||
grid-template-columns: minmax(0, 1fr) auto;
|
||
gap: 8px;
|
||
padding: 9px;
|
||
border: 1px solid #dce6e9;
|
||
background: var(--surface);
|
||
}
|
||
.mobile-session-list > article.is-selected {
|
||
border-color: #69a99d;
|
||
box-shadow: inset 3px 0 0 var(--lab-teal);
|
||
}
|
||
.mobile-session-list > article > div {
|
||
display: grid;
|
||
gap: 3px;
|
||
min-width: 0;
|
||
}
|
||
.mobile-session-list strong {
|
||
color:var(--ink);
|
||
font-size: 12px;
|
||
}
|
||
.mobile-session-list small {
|
||
overflow: hidden;
|
||
color: #718792;
|
||
font-size: 10px;
|
||
line-height: 1.4;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.mobile-session-list .el-button {
|
||
grid-column: 2;
|
||
grid-row: 1 / span 2;
|
||
align-self: center;
|
||
min-height: 34px;
|
||
}
|
||
.mobile-session-list .el-tag {
|
||
grid-column: 1;
|
||
width: fit-content;
|
||
}
|
||
.mobile-cancel-booking {
|
||
justify-self: start;
|
||
margin-top: 2px;
|
||
}
|
||
}
|
||
</style>
|