jiajunchen hace 1 día
padre
commit
125c2bc980
Se han modificado 2 ficheros con 26 adiciones y 20 borrados
  1. 25
    19
      src/view/dati/examCheck/fcbkdatistart.vue
  2. 1
    1
      src/view/dati/examCheck/index.vue

+ 25
- 19
src/view/dati/examCheck/fcbkdatistart.vue Ver fichero

209
 
209
 
210
 const router = useRouter();
210
 const router = useRouter();
211
 const route = useRoute();
211
 const route = useRoute();
212
-
212
+const query = route.query;
213
 
213
 
214
 // 1. 从本地存储获取当前用户的 userCode(字符串)
214
 // 1. 从本地存储获取当前用户的 userCode(字符串)
215
 const currentUserCode = localStorage.getItem('userCode');
215
 const currentUserCode = localStorage.getItem('userCode');
219
 
219
 
220
 // 3. 按原来的方式生成 userDesc 字符串
220
 // 3. 按原来的方式生成 userDesc 字符串
221
 const userDesc = userCodeArray.join(',');
221
 const userDesc = userCodeArray.join(',');
222
-const examContext = {
223
-  id: query.examId || '',
224
-  testRole: query.testRole || '',
225
-  checkTime: query.checkTime || '',
226
-  checkName: query.checkName || '',
227
-  testType: query.testType || '',
228
-  addId: query.addId || '',
222
+const getExamContext = () => ({
223
+  id: route.query.examId || '',
224
+  testRole: route.query.testRole || '',
225
+  checkTime: route.query.checkTime || '',
226
+  checkName: route.query.checkName || '',
227
+  testType: route.query.testType || '',
228
+  addId: route.query.addId || '',
229
   userDesc: userDesc,
229
   userDesc: userDesc,
230
-  courseId: query.courseId || '',
231
-  todayStr: query.todayStr || ''
232
-};
230
+
231
+});
232
+
233
 const   userId = localStorage.getItem('userId');
233
 const   userId = localStorage.getItem('userId');
234
 const questions = ref([]);
234
 const questions = ref([]);
235
 
235
 
250
   await getForm();
250
   await getForm();
251
   overlayloading.value = false;
251
   overlayloading.value = false;
252
 });
252
 });
253
-const handData={}
253
+const handData = ref({});
254
 
254
 
255
 const saveChecUser = async () => {
255
 const saveChecUser = async () => {
256
+  const examContext = getExamContext();
256
   console.log("接到的参数:",examContext);
257
   console.log("接到的参数:",examContext);
257
   var url = '/sgsafe/ExamHead/saveChecUser';
258
   var url = '/sgsafe/ExamHead/saveChecUser';
258
   var param = {
259
   var param = {
260
   };
261
   };
261
   const res = await proxy.$axios.post(url, param);
262
   const res = await proxy.$axios.post(url, param);
262
     if (res.data.code == '0') {
263
     if (res.data.code == '0') {
263
-    await  handData=res.data.data
264
+    await  handData.value = res.data.data;
264
     } else {
265
     } else {
265
-      showFailToast('操作失败!' + response.data.msg)
266
+      showFailToast('操作失败!' + res.data.msg)
266
     }
267
     }
267
 
268
 
268
 
269
 
269
 }
270
 }
270
 //获取试卷
271
 //获取试卷
271
 const getForm = async () => {
272
 const getForm = async () => {
272
-  console.log("headId为",handData.id);
273
+  console.log("headId为",handData.value.id);
273
   var url = '/sgsafe/ExamLine/query'
274
   var url = '/sgsafe/ExamLine/query'
274
-  const query = ref({
275
-    headId:   handData.id
275
+  const query1 = ref({
276
+    headId:   handData.value.id
276
   })
277
   })
277
   var param = {
278
   var param = {
278
-    params: JSON.stringify(query.value)
279
+    params: JSON.stringify(query1.value)
279
   }
280
   }
280
   try {
281
   try {
281
     const res = await proxy.$axios.post(url, param);
282
     const res = await proxy.$axios.post(url, param);
376
     } catch (error) {
377
     } catch (error) {
377
       console.log('请求出错:', questions);
378
       console.log('请求出错:', questions);
378
     }
379
     }
379
-
380
+    const courseId = handData.value.id;
381
+    const today = new Date();
382
+    const year = today.getFullYear();
383
+    const month = String(today.getMonth() + 1).padStart(2, '0');
384
+    const day = String(today.getDate()).padStart(2, '0');
385
+    const todayStr = `${year}-${month}-${day}`;// ✅ 来自 saveChecUser 返回
380
     //开始判卷
386
     //开始判卷
381
     var url2 = '/sgsafe/Package/doProc'
387
     var url2 = '/sgsafe/Package/doProc'
382
     var param2 = {
388
     var param2 = {

+ 1
- 1
src/view/dati/examCheck/index.vue Ver fichero

155
   const url = new URL(baseUrl);
155
   const url = new URL(baseUrl);
156
   url.searchParams.set('examId', item.id);           // 考试ID
156
   url.searchParams.set('examId', item.id);           // 考试ID
157
   url.searchParams.set('testRole', item.testRole); //规则id
157
   url.searchParams.set('testRole', item.testRole); //规则id
158
-  url.searchParams.set('testRole', item.checkTime); //考试时间
158
+  url.searchParams.set('checkTime', item.checkTime); //考试时间
159
   url.searchParams.set('checkName', item.checkName || '');
159
   url.searchParams.set('checkName', item.checkName || '');
160
   url.searchParams.set('testType', item.testType || '');//考试类型
160
   url.searchParams.set('testType', item.testType || '');//考试类型
161
   // 如果还需要 userId,也可以加:
161
   // 如果还需要 userId,也可以加:

Loading…
Cancelar
Guardar