|
@@ -31,7 +31,7 @@ export default defineComponent({
|
|
|
const activeName = ref('one')
|
|
|
// const catchList = store
|
|
|
const forms = ref({} as any)
|
|
|
- const data = reactive({
|
|
|
+ const datas = reactive({
|
|
|
loading: true,
|
|
|
list: [] as any,
|
|
|
uniDetail: {} as any
|
|
@@ -63,29 +63,60 @@ export default defineComponent({
|
|
|
state.platformApi + `/classGroup/detail/${forms.value.classGroupId}`
|
|
|
)
|
|
|
forms.value.preStudentNum = data.preStudentNum || 0
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取详情
|
|
|
+ const getCourseLessonDetail = async () => {
|
|
|
+ try {
|
|
|
+ // const query = route.query
|
|
|
+ // // api-teacher/lessonCoursewareExaminationMapper/detailByCourseId
|
|
|
+ // // 判断是从课程结束后,还是正常创建
|
|
|
+ const { data } = await request.post(
|
|
|
+ state.platformApi + `/lessonCoursewareExaminationMapper/detailByCourseId`,
|
|
|
+ {
|
|
|
+ requestType: 'form',
|
|
|
+ data: {
|
|
|
+ courseScheduleId: route.query.courseScheduleId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ forms.value.classGroupId = route.query.courseScheduleId
|
|
|
+ forms.value.classGroupName = data.classGroupName
|
|
|
+ forms.value.testName = data.lessonCoursewareExaminationMapperName
|
|
|
forms.value.orchestraName = data.orchestraName
|
|
|
- forms.value.classGroupName = data.name
|
|
|
+ forms.value.coursewareName = data.LessonCoursewareName
|
|
|
+ forms.value.lessonCoursewareId = data.lessonCoursewareExaminationMapper.lessonCoursewareId
|
|
|
+ forms.value.preStudentNum = data.studentNum || 0
|
|
|
+
|
|
|
+ const details = data.lessonCoursewareExaminationMapper.details || []
|
|
|
+ details.forEach((item: any) => {
|
|
|
+ datas.uniDetail[item.level] = item
|
|
|
+ })
|
|
|
} catch (e) {
|
|
|
console.log(e)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
forms.value = { ...JSON.parse(sessionStorage.getItem('unit-create') || '{}') } as any
|
|
|
- const query = route.query
|
|
|
- if (query.classGroupId) {
|
|
|
- forms.value.classGroupId = query.classGroupId
|
|
|
- }
|
|
|
- if (query.testId) {
|
|
|
- forms.value.testId = query.testId
|
|
|
- }
|
|
|
console.log(forms.value)
|
|
|
- if (!forms.value.classGroupId) {
|
|
|
- showToast('请选择班级')
|
|
|
- return
|
|
|
+ const query = route.query
|
|
|
+ // api-teacher/lessonCoursewareExaminationMapper/detailByCourseId
|
|
|
+ // 判断是从课程结束后,还是正常创建
|
|
|
+ if (query.courseScheduleId) {
|
|
|
+ getCourseLessonDetail()
|
|
|
+ } else {
|
|
|
+ if (!forms.value.classGroupId) {
|
|
|
+ showToast('请选择班级')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ getClassDetail()
|
|
|
+ getStudentUni()
|
|
|
}
|
|
|
- getClassDetail()
|
|
|
- // getList()
|
|
|
- getStudentUni()
|
|
|
})
|
|
|
const getStudentUni = async () => {
|
|
|
try {
|
|
@@ -99,7 +130,7 @@ export default defineComponent({
|
|
|
}
|
|
|
)
|
|
|
res.data.details.forEach((item: any) => {
|
|
|
- data.uniDetail[item.level] = item
|
|
|
+ datas.uniDetail[item.level] = item
|
|
|
})
|
|
|
} catch (e) {
|
|
|
console.log(e)
|
|
@@ -182,13 +213,13 @@ export default defineComponent({
|
|
|
shrink
|
|
|
>
|
|
|
<Tab name="one" title="I类学生">
|
|
|
- <NewspaperItem item={data.uniDetail[1]}></NewspaperItem>
|
|
|
+ <NewspaperItem item={datas.uniDetail[1]}></NewspaperItem>
|
|
|
</Tab>
|
|
|
<Tab name="two" title="II类学生">
|
|
|
- <NewspaperItem item={data.uniDetail[2]}></NewspaperItem>
|
|
|
+ <NewspaperItem item={datas.uniDetail[2]}></NewspaperItem>
|
|
|
</Tab>
|
|
|
<Tab name="three" title="III类学生">
|
|
|
- <NewspaperItem item={data.uniDetail[3]}></NewspaperItem>
|
|
|
+ <NewspaperItem item={datas.uniDetail[3]}></NewspaperItem>
|
|
|
</Tab>
|
|
|
</Tabs>
|
|
|
</div>
|