Browse Source

日常开发

林旭祥 9 tháng trước cách đây
mục cha
commit
e5f680e8a9
2 tập tin đã thay đổi với 17 bổ sung3 xóa
  1. 16 2
      src/components/OptionWindow/index.vue
  2. 1 1
      src/views/test/index.vue

+ 16 - 2
src/components/OptionWindow/index.vue

@@ -109,6 +109,10 @@ const props = defineProps({
     type: Array as any,
     default: () => []
   },
+  parentData: {
+    type: Object,
+    default: {}
+  },
 });
 
 //评分标准,数据字典无需双向绑定
@@ -200,7 +204,6 @@ const getMusic = async () => {
       }
     });
   }
-
 };
 
 //获取班级列表
@@ -268,7 +271,11 @@ const getAllArea = (data: any) => {
 const confirm = () => {
   console.log("project.value", project.value)
   optionForm.value.project = project.value.key;
-  optionForm.value.classes = classList.value.map((item: any) => { return item.id; }).join();
+  if (props.parentData.id) {
+    optionForm.value.classes = props.parentData.class_ids.join();
+  } else {
+    optionForm.value.classes = classList.value.map((item: any) => { return item.id; }).join();
+  }
   optionForm.value.area = chooseArea.value.join();
   console.log("optionForm", optionForm.value);
   if (!optionForm.value.classes) {
@@ -287,6 +294,13 @@ const confirm = () => {
   //   ElMessage({ message: message, type: 'error', duration: 3 * 1000 });
   //   return false;
   // }
+
+  if (props.parentData.id) {
+    optionForm.value.taskId = props.parentData.id;
+    optionForm.value.testType = props.parentData.exam_type;
+    optionForm.value.taskCate = props.parentData.exam_type;
+  }
+
   loading.value = true;
   if (chooseArea.value.length > 1) {
     //多区域

+ 1 - 1
src/views/test/index.vue

@@ -31,7 +31,7 @@
       </div>
     </div>
 
-    <OptionWindow ref="optionWindowRef" :projectList="projectList" />
+    <OptionWindow ref="optionWindowRef" :projectList="projectList" :parentData="currentTask" />
   </div>
 </template>