|
@@ -3,7 +3,16 @@
|
|
<div v-if="pageState" style="margin-top: 1rem">
|
|
<div v-if="pageState" style="margin-top: 1rem">
|
|
<n-form :label-width="200" inline>
|
|
<n-form :label-width="200" inline>
|
|
<n-form-item class="min-w-34" label="请选择查询学员" path="user.name">
|
|
<n-form-item class="min-w-34" label="请选择查询学员" path="user.name">
|
|
- <n-input placeholder="请选择查询学员" />
|
|
|
|
|
|
+ <n-select
|
|
|
|
+ v-model:value="scheduleParamsOptions.studentId"
|
|
|
|
+ filterable
|
|
|
|
+ placeholder="请选择查询学员"
|
|
|
|
+ :options="studentOptions"
|
|
|
|
+ :loading="studentOptionsLoading"
|
|
|
|
+ clearable
|
|
|
|
+ remote
|
|
|
|
+ @search="studentOptionsSearch"
|
|
|
|
+ />
|
|
</n-form-item>
|
|
</n-form-item>
|
|
<n-form-item class="min-w-34" label="请选择要查询的班级" path="classId">
|
|
<n-form-item class="min-w-34" label="请选择要查询的班级" path="classId">
|
|
<n-select
|
|
<n-select
|
|
@@ -166,7 +175,8 @@ import {
|
|
queryClassAll,
|
|
queryClassAll,
|
|
addSchedule,
|
|
addSchedule,
|
|
queryClassRoomList,
|
|
queryClassRoomList,
|
|
- querySchedule
|
|
|
|
|
|
+ querySchedule,
|
|
|
|
+ getStudentByKeyword
|
|
} from './api';
|
|
} from './api';
|
|
import type { ScheduleParams, QueryScheduleParams } from './api';
|
|
import type { ScheduleParams, QueryScheduleParams } from './api';
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
@@ -186,6 +196,7 @@ const model = reactive<ScheduleParams>({
|
|
disabled: 'N'
|
|
disabled: 'N'
|
|
});
|
|
});
|
|
const classId = route.query.classId;
|
|
const classId = route.query.classId;
|
|
|
|
+const studentId = route.query.studentId;
|
|
const chineseNumbers: { [index: number]: string } = {
|
|
const chineseNumbers: { [index: number]: string } = {
|
|
0: '零',
|
|
0: '零',
|
|
1: '一',
|
|
1: '一',
|
|
@@ -201,6 +212,8 @@ const chineseNumbers: { [index: number]: string } = {
|
|
const dateValue = ref<number>(0);
|
|
const dateValue = ref<number>(0);
|
|
const startTime = ref<number>(0);
|
|
const startTime = ref<number>(0);
|
|
const endTime = ref<number>(0);
|
|
const endTime = ref<number>(0);
|
|
|
|
+const studentOptions = ref<any[]>([]);
|
|
|
|
+const studentOptionsLoading = ref<boolean>(false);
|
|
const isRepeatTime = ref<boolean>(true);
|
|
const isRepeatTime = ref<boolean>(true);
|
|
const repeatTime = ref<number>(1);
|
|
const repeatTime = ref<number>(1);
|
|
const pageState = ref<boolean>(true);
|
|
const pageState = ref<boolean>(true);
|
|
@@ -239,6 +252,7 @@ const scheduleList = ref<{ [index: string]: any }>({
|
|
'6': {},
|
|
'6': {},
|
|
'7': {}
|
|
'7': {}
|
|
});
|
|
});
|
|
|
|
+
|
|
const timeKey = ref<string[]>([
|
|
const timeKey = ref<string[]>([
|
|
'08:00',
|
|
'08:00',
|
|
'09:00',
|
|
'09:00',
|
|
@@ -330,6 +344,7 @@ function previousDateSchedule() {
|
|
dateRange.value = [sevenDays.getTime(), startDateTime.getTime()];
|
|
dateRange.value = [sevenDays.getTime(), startDateTime.getTime()];
|
|
loadScheduleQuery();
|
|
loadScheduleQuery();
|
|
}
|
|
}
|
|
|
|
+
|
|
function nextDateSchedule() {
|
|
function nextDateSchedule() {
|
|
const endDateTime = new Date(dateRange.value[1]);
|
|
const endDateTime = new Date(dateRange.value[1]);
|
|
endDateTime.setHours(24, 0, 0, 0);
|
|
endDateTime.setHours(24, 0, 0, 0);
|
|
@@ -394,12 +409,52 @@ function loadSchedule() {
|
|
loading.value = false;
|
|
loading.value = false;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+
|
|
function getDayOfTheWeekNow(theWeekStartTime: number, weekDate: number): number {
|
|
function getDayOfTheWeekNow(theWeekStartTime: number, weekDate: number): number {
|
|
const week = new Date(theWeekStartTime + weekDate * 86400000).getDay();
|
|
const week = new Date(theWeekStartTime + weekDate * 86400000).getDay();
|
|
return week === 0 ? 7 : week;
|
|
return week === 0 ? 7 : week;
|
|
}
|
|
}
|
|
-function loadData() {
|
|
|
|
- queryUserAll().then(response => {
|
|
|
|
|
|
+
|
|
|
|
+function studentOptionsSearch(keyword: string) {
|
|
|
|
+ if (!keyword.length) {
|
|
|
|
+ studentOptions.value = [];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ studentOptionsLoading.value = true;
|
|
|
|
+ studentOptions.value = [];
|
|
|
|
+ getStudentByKeyword(keyword).then(response => {
|
|
|
|
+ response.data?.forEach(r => {
|
|
|
|
+ studentOptions.value.push({
|
|
|
|
+ label: r.studentName,
|
|
|
|
+ value: r.id
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ studentOptionsLoading.value = false;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function findStudent(sId: number) {
|
|
|
|
+ if (sId) {
|
|
|
|
+ studentOptionsLoading.value = true;
|
|
|
|
+ studentOptions.value = [];
|
|
|
|
+ getStudentByKeyword(sId.toString()).then(response => {
|
|
|
|
+ response.data?.forEach(r => {
|
|
|
|
+ studentOptions.value.push({
|
|
|
|
+ label: r.studentName,
|
|
|
|
+ value: r.id
|
|
|
|
+ });
|
|
|
|
+ if (Number(sId) === r.id) {
|
|
|
|
+ scheduleParamsOptions.studentId = Number(sId);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ studentOptionsLoading.value = false;
|
|
|
|
+ loadScheduleQuery();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function loadData() {
|
|
|
|
+ await queryUserAll().then(response => {
|
|
teacherOptions.value = response.data?.map(r => {
|
|
teacherOptions.value = response.data?.map(r => {
|
|
return {
|
|
return {
|
|
label: r.relname,
|
|
label: r.relname,
|
|
@@ -407,7 +462,7 @@ function loadData() {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- queryCategoryParams(1, 100, {}).then(response => {
|
|
|
|
|
|
+ await queryCategoryParams(1, 100, {}).then(response => {
|
|
response.data?.map(r => {
|
|
response.data?.map(r => {
|
|
categoryAndSubjectOptions.value.push({
|
|
categoryAndSubjectOptions.value.push({
|
|
label: r.name,
|
|
label: r.name,
|
|
@@ -418,16 +473,19 @@ function loadData() {
|
|
return r;
|
|
return r;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- queryClassAll().then(response => {
|
|
|
|
|
|
+ await queryClassAll().then(response => {
|
|
response.data?.map(r => {
|
|
response.data?.map(r => {
|
|
groupList.value.push({
|
|
groupList.value.push({
|
|
label: r.name,
|
|
label: r.name,
|
|
value: r.id
|
|
value: r.id
|
|
});
|
|
});
|
|
|
|
+ if (Number(classId) === r.id) {
|
|
|
|
+ scheduleParamsOptions.classId = Number(classId);
|
|
|
|
+ }
|
|
return r;
|
|
return r;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- queryClassRoomList(1, 100, {}).then(response => {
|
|
|
|
|
|
+ await queryClassRoomList(1, 100, {}).then(response => {
|
|
response.data?.map(r => {
|
|
response.data?.map(r => {
|
|
classRoomList.value.push({
|
|
classRoomList.value.push({
|
|
label: r.name,
|
|
label: r.name,
|
|
@@ -435,11 +493,14 @@ function loadData() {
|
|
});
|
|
});
|
|
return r;
|
|
return r;
|
|
});
|
|
});
|
|
- if (classId) {
|
|
|
|
- model.classId = Number(classId);
|
|
|
|
- }
|
|
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ await findStudent(Number(studentId));
|
|
|
|
+
|
|
loadScheduleQuery();
|
|
loadScheduleQuery();
|
|
|
|
+ if (classId) {
|
|
|
|
+ model.classId = Number(classId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
loadData();
|
|
loadData();
|