|
@@ -1,25 +1,33 @@
|
|
-import { defineComponent, onMounted, reactive } from "vue";
|
|
|
|
|
|
+import { defineComponent, onMounted, reactive, ref } from "vue";
|
|
import WorkHome from "../work-home";
|
|
import WorkHome from "../work-home";
|
|
import WorkEaluating from "../work-ealuating";
|
|
import WorkEaluating from "../work-ealuating";
|
|
import { getQuery } from "/src/utils/queryString";
|
|
import { getQuery } from "/src/utils/queryString";
|
|
import { api_lessonTrainingTrainingStudentDetail } from "../../api";
|
|
import { api_lessonTrainingTrainingStudentDetail } from "../../api";
|
|
import { headTopData } from "../../header-top";
|
|
import { headTopData } from "../../header-top";
|
|
|
|
|
|
|
|
+const workHomeRef = ref();
|
|
|
|
+const workEaluatRef = ref();
|
|
|
|
+
|
|
|
|
+const data = reactive({
|
|
|
|
+ /** 作业类型:练习PRACTICE, 评测EVALUATION */
|
|
|
|
+ trainingType: "" as "PRACTICE" | "EVALUATION",
|
|
|
|
+ worke: {},
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+export const HANDLE_WORK_ADD = () => {
|
|
|
|
+ if (data.trainingType === "PRACTICE"){
|
|
|
|
+ workHomeRef.value?.handleAdd();
|
|
|
|
+ }
|
|
|
|
+ if (data.trainingType === "EVALUATION"){
|
|
|
|
+ workEaluatRef.value?.handleAdd();
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: "workIndex",
|
|
name: "workIndex",
|
|
- props: {
|
|
|
|
- pageShow: {
|
|
|
|
- type: Boolean,
|
|
|
|
- default: true,
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
setup(props) {
|
|
setup(props) {
|
|
const query = getQuery();
|
|
const query = getQuery();
|
|
- const data = reactive({
|
|
|
|
- /** 作业类型:练习PRACTICE, 评测EVALUATION */
|
|
|
|
- trainingType: "" as "PRACTICE" | "EVALUATION",
|
|
|
|
- worke: {},
|
|
|
|
- });
|
|
|
|
|
|
+
|
|
const setModelType = () => {
|
|
const setModelType = () => {
|
|
if (!data.trainingType) return;
|
|
if (!data.trainingType) return;
|
|
const type = data.trainingType === "PRACTICE" ? "practise" : "evaluating";
|
|
const type = data.trainingType === "PRACTICE" ? "practise" : "evaluating";
|
|
@@ -39,9 +47,11 @@ export default defineComponent({
|
|
return () => (
|
|
return () => (
|
|
<>
|
|
<>
|
|
{/* 课后训练作业 */}
|
|
{/* 课后训练作业 */}
|
|
- {data.trainingType === "PRACTICE" && <WorkHome workeData={data.worke} pageShow={props.pageShow} />}
|
|
|
|
|
|
+ {data.trainingType === "PRACTICE" && <WorkHome ref={workHomeRef} workeData={data.worke} />}
|
|
{/* 评测作业 */}
|
|
{/* 评测作业 */}
|
|
- {data.trainingType === "EVALUATION" && <WorkEaluating workeData={data.worke} pageShow={props.pageShow} />}
|
|
|
|
|
|
+ {data.trainingType === "EVALUATION" && (
|
|
|
|
+ <WorkEaluating ref={workEaluatRef} workeData={data.worke} />
|
|
|
|
+ )}
|
|
</>
|
|
</>
|
|
);
|
|
);
|
|
},
|
|
},
|