@focus-teach/ui 1.0.61 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api/index.js CHANGED
@@ -3,9 +3,9 @@
3
3
  */
4
4
  import axios from "axios";
5
5
  import qs from "qs";
6
-
6
+ import { Message } from 'element-ui';
7
7
  const VUE_APP_SSO_LOGIN_URL = 'http://ssoedu.focusteach.com/sso/authentication/require?client_id=focusteachsmartclass&equipmentType=epxIumhmRz0'
8
-
8
+ let timer = null
9
9
  let token = "";
10
10
  axios.defaults.timeout = 30000;
11
11
  //axios请求时,如果不显示的设置Content-Type,那么默认是text/plain,这时服务器就不知道怎么解析数据
@@ -15,57 +15,76 @@ axios.defaults.crossDomain = true;
15
15
  axios.defaults.withCredentials = true; //设置cross跨域
16
16
  axios.defaults.baseURL = window.location.port && window.location.port != 8085 && window.location.port != 8086 ? '/backend' : ''
17
17
  axios.interceptors.request.use(
18
- (config) => {
19
- if (config.method === "post") {
20
- let data = qs.parse(config.data);
21
- config.data = qs.stringify({
22
- // token: token,
23
- ...data,
24
- }, {
25
- arrayFormat: "brackets"
26
- });
27
- } else if (config.method === "get") {
28
- config.params = {
29
- // token: token,
30
- ...config.params,
31
- };
32
- }
33
- return config;
34
- },
35
- (error) => { }
18
+ (config) => {
19
+ if (config.method === "post") {
20
+ let data = qs.parse(config.data);
21
+ config.data = qs.stringify({
22
+ // token: token,
23
+ ...data,
24
+ }, {
25
+ arrayFormat: "brackets"
26
+ });
27
+ } else if (config.method === "get") {
28
+ config.params = {
29
+ // token: token,
30
+ ...config.params,
31
+ };
32
+ }
33
+ //判断没网的情况下 只提示一次
34
+ if (!timer && !navigator.onLine) {
35
+ Message({ message: '网络异常,请检查网络', type: 'error' })
36
+ timer = setTimeout(() => {
37
+ timer = null
38
+ clearTimeout(timer)
39
+ }, 2000)
40
+ }
41
+ return config;
42
+ },
43
+ (error) => { }
36
44
  );
37
45
 
38
46
  axios.interceptors.response.use(
39
- (res) => {
40
- if ((res.data&&res.data.code=='1005') || res.code == "10005") {
41
- //跳转到登录页
42
- window.location.href = VUE_APP_SSO_LOGIN_URL;
43
- // return false
44
- }
45
- return res.data || res ;
46
- },
47
- (error) => { }
47
+ (res) => {
48
+ if ((res.data && res.data.code == '1005') || res.code == "10005") {
49
+ //跳转到登录页
50
+ window.location.href = VUE_APP_SSO_LOGIN_URL;
51
+ // return false
52
+ }
53
+ return res.data || res;
54
+ },
55
+ (error) => { }
48
56
  );
49
57
 
50
58
  //资源库-首页接口
51
59
  export function getResourcePoolIndex(options, success, error) {
52
- axios.get("/resource/pool/index", { params: options }).then(
53
- (res) => {
54
- success && success(res);
55
- },
56
- (res) => {
57
- error && error(res);
60
+ axios.get("/resource/pool/index", { params: options }).then(
61
+ (res) => {
62
+ let data = {
63
+ ...res,
64
+ value: {
65
+ ...res?.value,
66
+ ResourceSourceTypeList: res?.value?.ResourceSourceTypeList || [],
67
+ examTopicDto:res?.value?.examTopicDto,
68
+ examTopicDtos:res?.value?.examTopicDtos || [],
69
+ resourceShareCategoryTypeList:res?.value?.resourceShareCategoryTypeList || [],
58
70
  }
59
- );
71
+ }
72
+ res = data
73
+ success && success(res);
74
+ },
75
+ (res) => {
76
+ error && error(res);
77
+ }
78
+ );
60
79
  }
61
80
  export function getEditorData(options, success, error) {
62
81
  axios.get('/ybk/editor/data', { params: options }).then(
63
- (res) => {
64
- success && success(res);
65
- },
66
- (res) => {
67
- error && error(res);
68
- }
82
+ (res) => {
83
+ success && success(res);
84
+ },
85
+ (res) => {
86
+ error && error(res);
87
+ }
69
88
  );
70
89
  }
71
90
 
@@ -82,28 +101,43 @@ export function aWaitGetGradeList(options, success, error) {
82
101
  }
83
102
  //资源库-分页接口
84
103
  export function getResourcePoolList(options, success, error) {
85
- axios.get("/resource/pool/list", { params: options }).then(
86
- (res) => {
87
- success && success(res);
88
- },
89
- (res) => {
90
- error && error(res);
104
+ axios.get("/resource/pool/list", { params: options }).then(
105
+ (res) => {
106
+ let data = {
107
+ ...res,
108
+ value:{
109
+ ...res?.value,
110
+ result:res?.value?.result || [],
91
111
  }
92
- );
112
+ }
113
+ res = data
114
+ success && success(res);
115
+ },
116
+ (res) => {
117
+ error && error(res);
118
+ }
119
+ );
93
120
  }
94
121
 
95
122
  //同步练习>试卷编辑>教材版本(张磊)
96
123
  export function getMaterialsGrades(options, success, error) {
97
- axios.get("/ybk/item/materialsGrades", {
98
- params: options
99
- }).then(
100
- (res) => {
101
- success && success(res);
102
- },
103
- (res) => {
104
- error && error(res);
105
- }
106
- );
124
+ axios.get("/ybk/item/materialsGrades", {
125
+ params: options
126
+ }).then(
127
+ (res) => {
128
+ let data = {
129
+ ...res,
130
+ value: res?.value,
131
+ checkTeachMaterialId: res?.value?.checkTeachMaterialId,
132
+ list: res?.value?.list || [],
133
+ }
134
+ res = data
135
+ success && success(res);
136
+ },
137
+ (res) => {
138
+ error && error(res);
139
+ }
140
+ );
107
141
  }
108
142
  //同步练习>试卷编辑>教材版本(张磊)
109
143
  export function getMaterialsGradesApi(options) {
@@ -112,6 +146,13 @@ export function getMaterialsGradesApi(options) {
112
146
  params: options
113
147
  }).then(
114
148
  (res) => {
149
+ let data = {
150
+ ...res,
151
+ value: res?.value,
152
+ checkTeachMaterialId: res?.value?.checkTeachMaterialId,
153
+ list: res?.value?.list || [],
154
+ }
155
+ res = data
115
156
  resolve([null, res])
116
157
  },
117
158
  (err) => {
@@ -123,16 +164,23 @@ export function getMaterialsGradesApi(options) {
123
164
 
124
165
  //同步练习>试卷编辑>课程集合(张磊)
125
166
  export function getEditorCourse(options, success, error) {
126
- axios.get("/ybk/item/course", {
127
- params: options
128
- }).then(
129
- (res) => {
130
- success && success(res);
131
- },
132
- (res) => {
133
- error && error(res);
134
- }
135
- );
167
+ axios.get("/ybk/item/course", {
168
+ params: options
169
+ }).then(
170
+ (res) => {
171
+ let data = {
172
+ ...res,
173
+ value: res?.value,
174
+ checkTeachMaterialId: res?.value?.checkTeachMaterialId,
175
+ list: res?.value?.list || [],
176
+ }
177
+ res = data
178
+ success && success(res);
179
+ },
180
+ (res) => {
181
+ error && error(res);
182
+ }
183
+ );
136
184
  }
137
185
  //同步练习>试卷编辑>课程集合(张磊)
138
186
  export function getEditorCourseApi(options) {
@@ -141,6 +189,13 @@ export function getEditorCourseApi(options) {
141
189
  params: options
142
190
  }).then(
143
191
  (res) => {
192
+ let data = {
193
+ ...res,
194
+ value: res?.value,
195
+ checkTeachMaterialId: res?.value?.checkTeachMaterialId,
196
+ list: res?.value?.list || [],
197
+ }
198
+ res = data
144
199
  resolve([null, res])
145
200
  },
146
201
  (err) => {
@@ -152,93 +207,111 @@ export function getEditorCourseApi(options) {
152
207
 
153
208
  //通用-获取国家省市
154
209
  export function getProvince(options, success, error) {
155
- axios.get("/region/common/index", { params: options })
156
- .then((res) => {
157
- success && success(res)
158
- }, (res) => {
159
- error && error(res)
160
- })
210
+ axios.get("/region/common/index", { params: options })
211
+ .then((res) => {
212
+ let data = {
213
+ ...res,
214
+ value:{
215
+ ...res?.value,
216
+ countryList:res?.value?.countryList || [],
217
+ },
218
+ }
219
+ res = data
220
+ success && success(res)
221
+ }, (res) => {
222
+ error && error(res)
223
+ })
161
224
  }
162
225
 
163
226
  //【同步】hq_studyfun 获取历史记录 2云备课,3智慧教学
164
227
  export function getUserOperate(options, success, error) {
165
- return axios.get("/user/operate/get", {
166
- params: options
167
- });
228
+ return axios.get("/user/operate/get", {
229
+ params: options
230
+ });
168
231
  }
169
232
 
170
233
  //hq_studyfun 保存记录 2云备课,3智慧教学
171
234
  export function setUserOperate(options, success, error) {
172
- axios.post("/user/operate/save", options).then(
173
- (res) => {
174
- success && success(res);
175
- },
176
- (res) => {
177
- error && error(res);
178
- }
179
- );
235
+ axios.post("/user/operate/save", options).then(
236
+ (res) => {
237
+ success && success(res);
238
+ },
239
+ (res) => {
240
+ error && error(res);
241
+ }
242
+ );
180
243
  }
181
244
 
182
245
  //获取册别
183
246
  export function getClassifications(options, success, error) {
184
- axios.get("/ybk/editor/classifications", { params: options }).then(
185
- (res) => {
186
- success && success(res);
187
- },
188
- (res) => {
189
- error && error(res);
190
- }
191
- );
247
+ axios.get("/ybk/editor/classifications", { params: options }).then(
248
+ (res) => {
249
+ let data = {
250
+ ...res,
251
+ value:res?.value || [],
252
+ }
253
+ res= data
254
+ success && success(res);
255
+ },
256
+ (res) => {
257
+ error && error(res);
258
+ }
259
+ );
192
260
  }
193
261
 
194
262
  //云备课左侧全部课程专区接口:
195
263
  export function getZoneList(options, success, error) {
196
- axios.get("/ybk/editor/zone", { params: options }).then(
197
- (res) => {
198
- success && success(res);
199
- },
200
- (res) => {
201
- error && error(res);
202
- }
203
- );
264
+ axios.get("/ybk/editor/zone", { params: options }).then(
265
+ (res) => {
266
+ let data = {
267
+ ...res,
268
+ value: res?.value || [],
269
+ }
270
+ res= data
271
+ success && success(res);
272
+ },
273
+ (res) => {
274
+ error && error(res);
275
+ }
276
+ );
204
277
  }
205
278
 
206
279
  //通用-根据省份获取城市信息【USP】(张磊>chenxianyong)
207
280
  export function getAreas(options, success, error) {
208
- axios.get("/region/common/areas", {
209
- params: options
210
- }).then(
211
- (res) => {
212
- success && success(res);
213
- },
214
- (res) => {
215
- error && error(res);
216
- }
217
- );
281
+ axios.get("/region/common/areas", {
282
+ params: options
283
+ }).then(
284
+ (res) => {
285
+ success && success(res);
286
+ },
287
+ (res) => {
288
+ error && error(res);
289
+ }
290
+ );
218
291
  }
219
292
  // 获取全品题目科目ID
220
293
  export function getQptkSubjectID(options, success, error) {
221
- axios.get("/qptk/subject", { params: options }).then(
222
- (res) => {
223
- success && success(res);
224
- },
225
- (res) => {
226
- error && error(res);
227
- }
228
- );
294
+ axios.get("/qptk/subject", { params: options }).then(
295
+ (res) => {
296
+ success && success(res);
297
+ },
298
+ (res) => {
299
+ error && error(res);
300
+ }
301
+ );
229
302
  }
230
303
  //题库列表查询【USP】(chenxianyong)
231
304
  export function getBankIndex(options, success, error) {
232
- axios.get("/ybk/item/index", {
233
- params: options
234
- }).then((res) => {
235
- success && success(res);
236
- },
237
- (err) => {
238
- error && error(err);
239
- }
240
- );
241
- }
305
+ axios.get("/ybk/item/index", {
306
+ params: options
307
+ }).then((res) => {
308
+ success && success(res);
309
+ },
310
+ (err) => {
311
+ error && error(err);
312
+ }
313
+ );
314
+ }
242
315
  //题库列表查询【USP】(chenxianyong)
243
316
  export function getBankIndexApi(options) {
244
317
  return new Promise(resolve => {
@@ -254,65 +327,84 @@ export function getBankIndexApi(options) {
254
327
  );
255
328
  })
256
329
  }
257
- //题库分页查询【USP】(chenxianyong)
330
+ //题库分页查询【USP】(chenxianyong)
258
331
  export function getBankData(options, success, error) {
259
- axios.get("/ybk/item/bank", {
260
- params: options
261
- }).then(
262
- (res) => {
263
- success && success(res);
264
- },
265
- (res) => {
266
- error && error(res);
332
+ axios.get("/ybk/item/bank", {
333
+ params: options
334
+ }).then(
335
+ (res) => {
336
+ let data = {
337
+ ...res,
338
+ value: {
339
+ ...res?.value,
340
+ ItemBankQuery:res?.value?.ItemBankQuery,
341
+ itemInfoList:res?.value?.itemInfoList || [],
342
+ }
267
343
  }
268
- );
269
- }
270
- //题库分页查询【USP】(chenxianyong)
344
+ res = data
345
+ success && success(res);
346
+ },
347
+ (res) => {
348
+ error && error(res);
349
+ }
350
+ );
351
+ }
352
+ //题库分页查询【USP】(chenxianyong)
271
353
  export function getBankDataApi(options) {
272
- return new Promise(resolve=> {
354
+ return new Promise(resolve => {
273
355
  axios.get("/ybk/item/bank", {
274
356
  params: options
275
357
  }).then(
276
358
  (res) => {
277
- resolve([null,res])
359
+ resolve([null, res])
278
360
  },
279
361
  (err) => {
280
- resolve([err,null])
362
+ resolve([err, null])
281
363
  }
282
364
  );
283
365
  })
284
366
  }
285
- //通用-获取知识点【后台管理】(chenxianyong)
367
+ //通用-获取知识点【后台管理】(chenxianyong)
286
368
  export function getKnowledge(options, success, error) {
287
- axios.get("/item/common/kl", {
288
- params: options
289
- }).then(
290
- (res) => {
291
- success && success(res);
292
- },
293
- (res) => {
294
- error && error(res);
295
- }
296
- );
297
- }
298
- //通用-获取专题【USP】(张磊>chenxianyong)
369
+ axios.get("/item/common/kl", {
370
+ params: options
371
+ }).then(
372
+ (res) => {
373
+ success && success(res);
374
+ },
375
+ (res) => {
376
+ error && error(res);
377
+ }
378
+ );
379
+ }
380
+ //通用-获取专题【USP】(张磊>chenxianyong)
299
381
  export function getTopic(options, success, error) {
300
- axios.get("/ybk/item/topic", {
301
- params: options
302
- })
303
- .then((res) => {
304
- success && success(res)
305
- }, (res) => {
306
- error && error(res)
307
- })
308
- }
309
- //通用-获取专题【USP】(张磊>chenxianyong)
382
+ axios.get("/ybk/item/topic", {
383
+ params: options
384
+ })
385
+ .then((res) => {
386
+ let data = {
387
+ ...res,
388
+ value: res?.value || [],
389
+ }
390
+ res = data
391
+ success && success(res)
392
+ }, (res) => {
393
+ error && error(res)
394
+ })
395
+ }
396
+ //通用-获取专题【USP】(张磊>chenxianyong)
310
397
  export function getTopicApi(options) {
311
398
  return new Promise(resolve => {
312
399
  axios.get("/ybk/item/topic", {
313
400
  params: options
314
401
  }).then(
315
402
  (res) => {
403
+ let data = {
404
+ ...res,
405
+ value: res?.value || [],
406
+ }
407
+ res = data
316
408
  resolve([null, res])
317
409
  },
318
410
  (err) => {
@@ -323,15 +415,15 @@ export function getTopicApi(options) {
323
415
  }
324
416
  //难度知识点是否必填【hq_studyfun】(sunqb)
325
417
  export function getKldftNecessary(options, success, error) {
326
- axios.get("/kldft/necessary", {
327
- params: options
328
- })
329
- .then((res) => {
330
- success && success(res)
331
- }, (res) => {
332
- error && error(res)
333
- })
334
- }
418
+ axios.get("/kldft/necessary", {
419
+ params: options
420
+ })
421
+ .then((res) => {
422
+ success && success(res)
423
+ }, (res) => {
424
+ error && error(res)
425
+ })
426
+ }
335
427
  //难度知识点是否必填【hq_studyfun】(sunqb)
336
428
  export function getKldftNecessaryApi(options) {
337
429
  return new Promise(resolve => {
@@ -350,72 +442,72 @@ export function getKldftNecessaryApi(options) {
350
442
 
351
443
  //获取题目
352
444
  export function getQuestion(options, success, error) {
353
- return new Promise((resolve) => {
354
- // const instance = axios.create();
355
- // instance.defaults.headers.post["Content-Type"] = "text/html;charset=UTF-8";
356
- // instance.defaults.responseType = 'json'
357
- axios.get(`/files/${options.itemId}?type=2`).then(
358
- (res) => {
359
- // console.log('全品题目',res);
360
- success && success(res);
361
- resolve(res);
362
- },
363
- (res) => {
364
- error && error(res);
365
- }
366
- );
367
- });
368
- }
369
- //获取题目
370
- export function getQuestionApi(options) {
371
- return new Promise((resolve) => {
372
- axios.get(`/files/${options.itemId}?type=2`).then(
373
- (res) => {
374
- resolve([null, res]);
375
- },
376
- (err) => {
377
- resolve([err, null]);
378
- }
379
- );
380
- });
381
- }
382
- export function getTitleHtml(options, params) {
383
- return new Promise((resolve) => {
384
- axios.get(`/files/${options.itemId}?type=2`, params, {
385
- header: {
386
- "Content-Type": "text/html;charset=UTF-8"
387
- }
388
- }).then(res => {
389
- resolve([null, res])
390
- }).catch(err => {
391
- resolve([err, null])
392
- })
393
- });
394
- }
395
- //通用-获取单题的答案与解析【后台管理】(chenxianyong)
396
- export function getAnswer(options, success, error) {
397
- axios.get("/ybk/item/detail", {
398
- params: options
399
- }).then(
445
+ return new Promise((resolve) => {
446
+ // const instance = axios.create();
447
+ // instance.defaults.headers.post["Content-Type"] = "text/html;charset=UTF-8";
448
+ // instance.defaults.responseType = 'json'
449
+ axios.get(`/files/${options.itemId}?type=2`).then(
400
450
  (res) => {
451
+ // console.log('全品题目',res);
401
452
  success && success(res);
453
+ resolve(res);
402
454
  },
403
455
  (res) => {
404
456
  error && error(res);
405
457
  }
406
458
  );
407
- }
408
- //试卷编辑>引用题目(张磊)
409
- export function quoteQuestion(options, success, error) {
410
- axios.post("/ybk/item/quote", options).then(
459
+ });
460
+ }
461
+ //获取题目
462
+ export function getQuestionApi(options) {
463
+ return new Promise((resolve) => {
464
+ axios.get(`/files/${options.itemId}?type=2`).then(
411
465
  (res) => {
412
- success && success(res);
466
+ resolve([null, res]);
413
467
  },
414
- (res) => {
415
- error && error(res);
468
+ (err) => {
469
+ resolve([err, null]);
416
470
  }
417
471
  );
418
- }
472
+ });
473
+ }
474
+ export function getTitleHtml(options, params) {
475
+ return new Promise((resolve) => {
476
+ axios.get(`/files/${options.itemId}?type=2`, params, {
477
+ header: {
478
+ "Content-Type": "text/html;charset=UTF-8"
479
+ }
480
+ }).then(res => {
481
+ resolve([null, res])
482
+ }).catch(err => {
483
+ resolve([err, null])
484
+ })
485
+ });
486
+ }
487
+ //通用-获取单题的答案与解析【后台管理】(chenxianyong)
488
+ export function getAnswer(options, success, error) {
489
+ axios.get("/ybk/item/detail", {
490
+ params: options
491
+ }).then(
492
+ (res) => {
493
+ success && success(res);
494
+ },
495
+ (res) => {
496
+ error && error(res);
497
+ }
498
+ );
499
+ }
500
+ //试卷编辑>引用题目(张磊)
501
+ export function quoteQuestion(options, success, error) {
502
+ axios.post("/ybk/item/quote", options).then(
503
+ (res) => {
504
+ success && success(res);
505
+ },
506
+ (res) => {
507
+ error && error(res);
508
+ }
509
+ );
510
+ }
419
511
  //获取题目类别
420
512
  export function getItemType(options, success, error) {
421
513
  //参数subjectId
@@ -423,6 +515,11 @@ export function getItemType(options, success, error) {
423
515
  params: options
424
516
  }).then(
425
517
  (res) => {
518
+ let data = {
519
+ ...res,
520
+ value:res?.value || [],
521
+ }
522
+ res = data
426
523
  success && success(res);
427
524
  return Promise.resolve(res);
428
525
  },
@@ -454,6 +551,19 @@ export function getMistakeIndex(options, success, error) {
454
551
  params: options
455
552
  }).then(
456
553
  (res) => {
554
+ let data = {
555
+ ...res,
556
+ value: {
557
+ ...res?.value,
558
+ clazzGradeList:res?.value?.clazzGradeList || [],
559
+ difficultyList:res?.value?.difficultyList || [],
560
+ errorRateList:res?.value?.errorRateList || [],
561
+ examSourceList:res?.value?.examSourceList || [],
562
+ itemCategoryList:res?.value?.itemCategoryList || [],
563
+ termList:res?.value?.termList || [],
564
+ }
565
+ }
566
+ res = data
457
567
  success && success(res);
458
568
  },
459
569
  (res) => {
@@ -468,6 +578,19 @@ export function getMistakeData(options, success, error) {
468
578
  params: options
469
579
  }).then(
470
580
  (res) => {
581
+ let data = {
582
+ ...res,
583
+ value:{
584
+ ...res?.value,
585
+ chapterList:res?.value?.chapterList || [],
586
+ classId:res?.value?.classId,
587
+ errorRateId:res?.value?.errorRateId,
588
+ gradeId:res?.value?.gradeId,
589
+ knowledgeSource:res?.value?.knowledgeSource,
590
+ subjectId:res?.value?.subjectId,
591
+ },
592
+ }
593
+ res = data
471
594
  success && success(res);
472
595
  },
473
596
  (res) => {
@@ -496,6 +619,18 @@ export function getMistakeNewItems(options, success, error) {
496
619
  params: options
497
620
  }).then(
498
621
  (res) => {
622
+ let data = {
623
+ ...res,
624
+ value:{
625
+ ...res?.value,
626
+ itemIds:res?.value?.itemIds || [],
627
+ commonPageDto:{
628
+ ...res?.value?.commonPageDto,
629
+ lists:res?.value?.commonPageDto?.lists || [],
630
+ }
631
+ }
632
+ }
633
+ res = data
499
634
  success && success(res);
500
635
  },
501
636
  (res) => {
@@ -536,13 +671,13 @@ export function quoteWrongQuestion(options, success, error) {
536
671
  }
537
672
 
538
673
  //根据试卷id,题目id获取变式题
539
- export function getVariantListbyqdui(options,success,error){
674
+ export function getVariantListbyqdui(options, success, error) {
540
675
  return axios.get("/ybk/variant/list", { params: options }).then(
541
676
  (res) => {
542
- success && success(res);
677
+ success && success(res);
543
678
  },
544
679
  (res) => {
545
- error(res);
680
+ error(res);
546
681
  }
547
682
  );
548
683
  }
@@ -550,15 +685,15 @@ export function getVariantListbyqdui(options,success,error){
550
685
  //获取资源分享 的类型list
551
686
  export function reqShareCategoryTypeList(options, success, error) {
552
687
  axios.get("/ybk/resource/share", {
553
- params: options
554
- }).then(
555
- (res) => {
556
- success && success(res);
557
- },
558
- (res) => {
559
- error && error(res);
560
- }
561
- )
688
+ params: options
689
+ }).then(
690
+ (res) => {
691
+ success && success(res);
692
+ },
693
+ (res) => {
694
+ error && error(res);
695
+ }
696
+ )
562
697
  .catch(() => {
563
698
  error();
564
699
  });
@@ -576,27 +711,32 @@ export function doShareExam(options, success, error) {
576
711
  );
577
712
  }
578
713
  //获取试卷概述统计
579
- export function getExamStatistics (options, success, error) {
714
+ export function getExamStatistics(options, success, error) {
580
715
  axios.get("/ybk/editor/exam/title", {
581
716
  params: options
582
717
  }).then(
583
718
  (res) => {
719
+ let data = {
720
+ ...res,
721
+ value:res?.value || [],
722
+ }
723
+ res = data
584
724
  success && success(res);
585
725
  },
586
726
  (res) => {
587
727
  error && error(res);
588
728
  }
589
729
  )
590
- .catch(() => {
591
- error();
592
- });
730
+ .catch(() => {
731
+ error();
732
+ });
593
733
  }
594
734
 
595
735
  /**
596
736
  * 新增/编辑模板
597
737
  */
598
738
  //获取学段
599
- export function eduLevelList_temp (options, success, error) {
739
+ export function eduLevelList_temp(options, success, error) {
600
740
  axios.get("/exam-paper/template/index.json", {}).then(
601
741
  (res) => {
602
742
  success && success(res);
@@ -605,12 +745,12 @@ export function eduLevelList_temp (options, success, error) {
605
745
  error && error(res);
606
746
  }
607
747
  )
608
- .catch(() => {
609
- error();
610
- });
748
+ .catch(() => {
749
+ error();
750
+ });
611
751
  }
612
752
  //获取科目
613
- export function subjectList_temp (options, success, error) {
753
+ export function subjectList_temp(options, success, error) {
614
754
  axios.get("/exam-paper/template/list/subject", {
615
755
  params: options
616
756
  }).then(
@@ -621,12 +761,12 @@ export function subjectList_temp (options, success, error) {
621
761
  error && error(res);
622
762
  }
623
763
  )
624
- .catch(() => {
625
- error();
626
- });
764
+ .catch(() => {
765
+ error();
766
+ });
627
767
  }
628
768
  //新增和修改试卷模板
629
- export function aouExam_temp (options, success, error) {
769
+ export function aouExam_temp(options, success, error) {
630
770
  axios.post("/exam-paper/template/aou", options).then(
631
771
  (res) => {
632
772
  success && success(res);
@@ -637,7 +777,7 @@ export function aouExam_temp (options, success, error) {
637
777
  );
638
778
  }
639
779
  //获取试卷模板详情
640
- export function examTemplateInfo (options, success, error) {
780
+ export function examTemplateInfo(options, success, error) {
641
781
  axios.get("/exam-paper/template/get", {
642
782
  params: options
643
783
  }).then(
@@ -648,13 +788,13 @@ export function examTemplateInfo (options, success, error) {
648
788
  error && error(res);
649
789
  }
650
790
  )
651
- .catch(() => {
652
- error();
653
- });
791
+ .catch(() => {
792
+ error();
793
+ });
654
794
  }
655
795
 
656
796
  //获取模板年级
657
- export function examTemplateGradeList (options, success, error) {
797
+ export function examTemplateGradeList(options, success, error) {
658
798
  axios.get("/exam-paper/template/list-grade", {
659
799
  params: options
660
800
  }).then(
@@ -665,13 +805,13 @@ export function examTemplateGradeList (options, success, error) {
665
805
  error && error(res);
666
806
  }
667
807
  )
668
- .catch(() => {
669
- error();
670
- });
808
+ .catch(() => {
809
+ error();
810
+ });
671
811
  }
672
812
 
673
813
  //检测作业模板上限
674
- export function checkTemplateLimit (options, success, error) {
814
+ export function checkTemplateLimit(options, success, error) {
675
815
  axios.get("/exam-paper/template/check", {
676
816
  params: options
677
817
  }).then(
@@ -682,26 +822,31 @@ export function checkTemplateLimit (options, success, error) {
682
822
  error && error(res);
683
823
  }
684
824
  )
685
- .catch(() => {
686
- error();
687
- });
825
+ .catch(() => {
826
+ error();
827
+ });
688
828
  }
689
829
 
690
830
  /**
691
831
  * 教辅相关
692
832
  */
693
833
  //获取教辅列表
694
- export function getTeachaidList(options, success, error) {
834
+ export function getTeachaidListApi(options, success, error) {
695
835
  return new Promise((resolve) => {
696
836
  axios.get(`/teach-aid/list/data`, { params: options }).then(res => {
697
- resolve([null, res])
837
+ let data = {
838
+ ...res,
839
+ value:res?.value || [],
840
+ }
841
+ res = data
842
+ resolve([null, res])
698
843
  }).catch(err => {
699
- resolve([err, null])
844
+ resolve([err, null])
700
845
  })
701
- });
702
- return axios.get("/teach-aid/list/data", {
703
- params: options
704
- })
846
+ });
847
+ // return axios.get("/teach-aid/list/data", {
848
+ // params: options
849
+ // })
705
850
  }
706
851
 
707
852
  //获取学年
@@ -710,15 +855,24 @@ export function getTeachaidYearGrade(options, success, error) {
710
855
  params: options
711
856
  }).then(
712
857
  (res) => {
858
+ let data = {
859
+ ...res,
860
+ value:{
861
+ ...res?.value,
862
+ clazzGradeDtos:res?.value?.clazzGradeDtos || [],
863
+ schoolYears:res?.value?.schoolYears || [],
864
+ }
865
+ }
866
+ res = data
713
867
  success && success(res);
714
868
  },
715
869
  (res) => {
716
870
  error && error(res);
717
871
  }
718
872
  )
719
- .catch(() => {
720
- error();
721
- });
873
+ .catch(() => {
874
+ error();
875
+ });
722
876
  }
723
877
  //获取学年
724
878
  export function getTeachaidYearGradeApi(options) {
@@ -737,12 +891,17 @@ export function getTeachaidYearGradeApi(options) {
737
891
  export function getTeachaidCatalogue(options, success, error) {
738
892
  return new Promise((resolve) => {
739
893
  axios.get("/teach-aid/catalogue/list/data", { params: options }).then(
740
- (res) => {
741
- resolve([null, res])
742
- },
743
- (err) => {
744
- resolve([err, null])
894
+ (res) => {
895
+ let data = {
896
+ ...res,
897
+ value:res?.value || [],
745
898
  }
899
+ res = data
900
+ resolve([null, res])
901
+ },
902
+ (err) => {
903
+ resolve([err, null])
904
+ }
746
905
  );
747
906
  })
748
907
  }
@@ -751,14 +910,19 @@ export function getTeachaidCatalogue(options, success, error) {
751
910
  export function getTeachaidPaper(options, success, error) {
752
911
  return new Promise((resolve) => {
753
912
  axios.get("/teach-aid/resource/list/data", { params: options }).then(
754
- (res) => {
755
- resolve([null, res])
756
- },
757
- (err) => {
758
- resolve([err, null])
913
+ (res) => {
914
+ let data = {
915
+ ...res,
916
+ value:res?.value || [],
759
917
  }
918
+ res = data
919
+ resolve([null, res])
920
+ },
921
+ (err) => {
922
+ resolve([err, null])
923
+ }
760
924
  );
761
- })
925
+ })
762
926
  }
763
927
 
764
928
  /**
@@ -789,59 +953,81 @@ export function removeResource(options, success, error) {
789
953
  export function addPaper(options) {
790
954
  return new Promise((resolve) => {
791
955
  axios.post("/ybk/editor/exam", options).then(
792
- (res) => {
793
- resolve([null, res])
794
- },
795
- (err) => {
796
- resolve([err, null])
956
+ (res) => {
957
+ let data = {
958
+ ...res,
959
+ value: {
960
+ ...res?.value,
961
+ coreResourceCfgDto: res?.value?.coreResourceCfgDto,
962
+ exam:res?.value?.exam,
963
+ itemList:res?.value?.itemList || [],
964
+ layoutJson:res?.value?.layoutJson
965
+ }
797
966
  }
967
+ res = data
968
+ resolve([null, res])
969
+ },
970
+ (err) => {
971
+ resolve([err, null])
972
+ }
798
973
  );
799
- });
974
+ });
800
975
  }
801
976
 
802
977
  // 获取试卷题目信息
803
978
  export function getExamQuestion(options) {
804
979
  return new Promise((resolve) => {
805
- axios.get("/ybk/editor/exam/list-score", { params: options }).then(
806
- (res) => {
807
- resolve([null, res])
808
- },
809
- (err) => {
810
- resolve([err, null])
980
+ axios.get("/ybk/editor/exam/list-score", { params: options }).then(
981
+ (res) => {
982
+ let data = {
983
+ ...res,
984
+ value:{
985
+ ...res?.value,
986
+ examCardInfoDto:res?.value?.examCardInfoDto,
987
+ examCardItemResultDtoList:res?.value?.examCardItemResultDtoList || [],
988
+ layout:res?.value?.layout,
989
+ layoutJson:res?.value?.layoutJson,
811
990
  }
812
- );
991
+ }
992
+ res = data
993
+ resolve([null, res])
994
+ },
995
+ (err) => {
996
+ resolve([err, null])
997
+ }
998
+ );
813
999
  })
814
1000
  }
815
1001
 
816
1002
  //获取题目自增试卷配置
817
- export function getResourceCfg (options) {
1003
+ export function getResourceCfg(options) {
818
1004
  return new Promise((resolve) => {
819
1005
  axios.get("/ybk/item/getResourceCfg", { params: options }).then(
820
- (res) => {
821
- resolve([null, res])
822
- },
823
- (err) => {
824
- resolve([err, null])
825
- }
1006
+ (res) => {
1007
+ resolve([null, res])
1008
+ },
1009
+ (err) => {
1010
+ resolve([err, null])
1011
+ }
826
1012
  );
827
- })
1013
+ })
828
1014
  }
829
1015
  export function getExamCard(params) {
830
1016
  return new Promise((resolve) => {
831
- axios.get('/ybk/exam-card/edit.json', {params}).then(res => {
832
- resolve([null, res])
833
- }).catch(err => {
834
- resolve([err, null])
835
- })
1017
+ axios.get('/ybk/exam-card/edit.json', { params }).then(res => {
1018
+ resolve([null, res])
1019
+ }).catch(err => {
1020
+ resolve([err, null])
1021
+ })
836
1022
  });
837
1023
  }
838
1024
  export function getPreviewJSON(params) {
839
1025
  return new Promise((resolve) => {
840
- axios.get('/ybk/editor/exam/preview.json', {params}).then(res => {
841
- resolve([null, res])
842
- }).catch(err => {
843
- resolve([err, null])
844
- })
1026
+ axios.get('/ybk/editor/exam/preview.json', { params }).then(res => {
1027
+ resolve([null, res])
1028
+ }).catch(err => {
1029
+ resolve([err, null])
1030
+ })
845
1031
  });
846
1032
  }
847
1033
  //引用试卷内题目【异步】
@@ -859,22 +1045,27 @@ export function quotePaperQuestion(options, success, error) {
859
1045
  //获取模板列表
860
1046
  export function getExamTemplateList(params) {
861
1047
  return new Promise((resolve) => {
862
- axios.get('/exam-paper/template/list/data', {params}).then(res => {
863
- resolve([null, res])
1048
+ axios.get('/exam-paper/template/list/data', { params }).then(res => {
1049
+ resolve([null, res])
864
1050
  }).catch(err => {
865
- resolve([err, null])
1051
+ resolve([err, null])
866
1052
  })
867
- });
1053
+ });
868
1054
  }
869
1055
  //获取题型列表
870
1056
  export function getCategoryList(params) {
871
1057
  return new Promise((resolve) => {
872
- axios.get('/item/common/category/list', {params}).then(res => {
873
- resolve([null, res])
1058
+ axios.get('/item/common/category/list', { params }).then(res => {
1059
+ let data = {
1060
+ ...res,
1061
+ value:res?.value || [],
1062
+ }
1063
+ res = data
1064
+ resolve([null, res])
874
1065
  }).catch(err => {
875
- resolve([err, null])
1066
+ resolve([err, null])
876
1067
  })
877
- });
1068
+ });
878
1069
  }
879
1070
 
880
1071
  //获取智能打标知识点集合
@@ -888,72 +1079,73 @@ export function getAIKlList(options) {
888
1079
  resolve([err, null])
889
1080
  }
890
1081
  );
891
- });
1082
+ });
892
1083
  }
893
1084
 
894
1085
  // 获取当前试卷题目列表
895
1086
  export function getItemList(options) {
896
1087
  return new Promise((resolve) => {
897
- axios.get("/ybk/editor/exam", { params: options }).then(
898
- (res) => {
899
- resolve([null, res])
900
- },
901
- (err) => {
902
- resolve([err, null])
903
- }
904
- );
1088
+ axios.get("/ybk/editor/exam", { params: options }).then(
1089
+ (res) => {
1090
+ resolve([null, res])
1091
+ },
1092
+ (err) => {
1093
+ resolve([err, null])
1094
+ }
1095
+ );
905
1096
  })
906
1097
  }
907
1098
  //获取当前目录下面的试卷列表(异步)
908
1099
  export function getExamListAsync(options, success, error) {
909
1100
  axios.get('/teach-aid/resource/list/data', { params: options }).then(
910
- (res) => {
911
- success && success(res);
912
- },
913
- (res) => {
914
- error && error(res);
915
- }
1101
+ (res) => {
1102
+ success && success(res);
1103
+ },
1104
+ (res) => {
1105
+ error && error(res);
1106
+ }
916
1107
  );
917
1108
  }
918
1109
  //答题是否下载过
919
1110
  export function getAnswerDownload(options, success, error) {
920
1111
  return new Promise((resolve) => {
921
1112
  axios.get("/ybk/exam-card/edit.json", { params: options }).then(
922
- (res) => {
923
- resolve([null, res])
924
- },
925
- (err) => {
926
- resolve([err, null])
927
- }
1113
+ (res) => {
1114
+ resolve([null, res])
1115
+ },
1116
+ (err) => {
1117
+ resolve([err, null])
1118
+ }
928
1119
  );
929
1120
  })
930
1121
  }
931
1122
 
932
1123
  //下载试卷>是否下载听力
933
- export function getPaperAudio (options) {
1124
+ export function getPaperAudio(options) {
934
1125
  return new Promise((resolve) => {
935
1126
  axios.get("/ybk/editor/exam/check-audio", { params: options }).then(
936
- (res) => {
937
- resolve([null, res])
938
- },
939
- (err) => {
940
- resolve([err, null])
941
- }
1127
+ (res) => {
1128
+ resolve([null, res])
1129
+ },
1130
+ (err) => {
1131
+ resolve([err, null])
1132
+ }
942
1133
  );
943
- })}
1134
+ })
1135
+ }
944
1136
 
945
1137
 
946
1138
  // 获取题目难度列表
947
1139
  export function getItemDiffList(options) {
948
1140
  return new Promise((resolve) => {
949
- axios.get("/ybk/item/difficult", { params: options }).then(
950
- (res) => {
951
- resolve([null, res])
952
- },
953
- (err) => {
954
- resolve([err, null])
955
- }
956
- );
1141
+ axios.get("/ybk/item/difficult", { params: options }).then(
1142
+ (res) => {
1143
+ resolve([null, res])
1144
+ },
1145
+ (err) => {
1146
+ resolve([err, null])
1147
+ }
1148
+ );
957
1149
  })
958
1150
  }
959
1151
 
@@ -968,7 +1160,7 @@ export function getJYWVariantList(options) {
968
1160
  resolve([err, null])
969
1161
  }
970
1162
  );
971
- });
1163
+ });
972
1164
  }
973
1165
 
974
1166
  //保存或者移除变式题目
@@ -982,7 +1174,7 @@ export function saveOrRemoveVariantItem(options,) {
982
1174
  resolve([err, null])
983
1175
  }
984
1176
  );
985
- });
1177
+ });
986
1178
  }
987
1179
 
988
1180
  //查询菁优网答案与解析
@@ -996,7 +1188,7 @@ export function getJYWVariantDetailList(options,) {
996
1188
  resolve([err, null])
997
1189
  }
998
1190
  );
999
- });
1191
+ });
1000
1192
  }
1001
1193
 
1002
1194
  //引用菁优网变式题到教育系统
@@ -1010,19 +1202,24 @@ export function getItemToVariant(options) {
1010
1202
  resolve([err, null])
1011
1203
  }
1012
1204
  );
1013
- });
1205
+ });
1014
1206
  }
1015
1207
 
1016
1208
  //根据试卷id,题目id获取变式题列表
1017
- export function getVariantList(options){
1209
+ export function getVariantList(options) {
1018
1210
  return new Promise((resolve) => {
1019
1211
  axios.get("/ybk/variant/list", { params: options }).then(
1020
- (res) => {
1021
- resolve([null, res])
1022
- },
1023
- (err) => {
1024
- resolve([err, null])
1212
+ (res) => {
1213
+ let data = {
1214
+ ...res,
1215
+ value:res?.value || [],
1025
1216
  }
1217
+ res = data
1218
+ resolve([null, res])
1219
+ },
1220
+ (err) => {
1221
+ resolve([err, null])
1222
+ }
1026
1223
  );
1027
1224
  })
1028
1225
  }
@@ -1043,7 +1240,7 @@ export function getItem(itemFileId) {
1043
1240
  //上下移动变式题
1044
1241
  export function moveVariantItem(options) {
1045
1242
  return new Promise((resolve) => {
1046
- axios.post('/ybk/variant/reorder',options).then(
1243
+ axios.post('/ybk/variant/reorder', options).then(
1047
1244
  (res) => {
1048
1245
  resolve([null, res])
1049
1246
  },
@@ -1068,44 +1265,44 @@ export function getStudyfunEnv(options) {
1068
1265
  }
1069
1266
 
1070
1267
  // 获取自制卡题目信息(分值、答案)
1071
- export function getCustomCardInfo(options){
1268
+ export function getCustomCardInfo(options) {
1072
1269
  return new Promise((resolve) => {
1073
- axios.get("/ybk/exam/blank/item/list/score", { params:options }).then(res => {
1074
- resolve([null, res])
1075
- }).catch(err => {
1076
- resolve([err, null])
1077
- })
1270
+ axios.get("/ybk/exam/blank/item/list/score", { params: options }).then(res => {
1271
+ resolve([null, res])
1272
+ }).catch(err => {
1273
+ resolve([err, null])
1274
+ })
1078
1275
  });
1079
1276
  }
1080
1277
 
1081
1278
  //获取资源分享信息
1082
1279
  export function getResourceShareInfo(options) {
1083
- return new Promise(resolve=>{
1084
- axios.get("/ybk/resource/share", {
1085
- params: options
1086
- }).then(
1087
- (res) => {
1088
- resolve([null, res])
1089
- },
1090
- (err) => {
1091
- resolve([err, null])
1092
- }
1093
- );
1280
+ return new Promise(resolve => {
1281
+ axios.get("/ybk/resource/share", {
1282
+ params: options
1283
+ }).then(
1284
+ (res) => {
1285
+ resolve([null, res])
1286
+ },
1287
+ (err) => {
1288
+ resolve([err, null])
1289
+ }
1290
+ );
1094
1291
  })
1095
1292
  }
1096
1293
  //获取自制卡信息
1097
1294
  export function getCustomCardRecord(options) {
1098
- return new Promise(resolve=>{
1099
- axios.get("/ybk/exam/blank/item/get/record", {
1100
- params: options
1101
- }).then(
1102
- (res) => {
1103
- resolve([null, res])
1104
- },
1105
- (err) => {
1106
- resolve([err, null])
1107
- }
1108
- );
1295
+ return new Promise(resolve => {
1296
+ axios.get("/ybk/exam/blank/item/get/record", {
1297
+ params: options
1298
+ }).then(
1299
+ (res) => {
1300
+ resolve([null, res])
1301
+ },
1302
+ (err) => {
1303
+ resolve([err, null])
1304
+ }
1305
+ );
1109
1306
  })
1110
1307
  }
1111
1308
  //获取用户搜索内容
@@ -1113,9 +1310,9 @@ export function getSearchList(options, success, error) {
1113
1310
  axios.get("/paper-exam/user/like-name", {params: options})
1114
1311
  .then((res) => {
1115
1312
  success && success(res)
1116
- }, (res) => {
1313
+ }, (res) => {
1117
1314
  error && error(res)
1118
- })
1315
+ })
1119
1316
  }
1120
1317
  //搜索学生列表
1121
1318
  export const getSearchStudentList = (params) => {
@@ -1203,7 +1400,7 @@ export function getPermissionList(options) {
1203
1400
  resolve([err, null])
1204
1401
  }
1205
1402
  );
1206
- })
1403
+ });
1207
1404
  }
1208
1405
  /* 获取学科网变式题 */
1209
1406
  export function getXkwRecVariantList(options) {
@@ -1229,10 +1426,10 @@ export function uploadUrlApi(options) {
1229
1426
  return new Promise((resolve) => {
1230
1427
  axios.post("/item/common/upload/url", options).then(
1231
1428
  (res) => {
1232
- resolve([null,res]);
1429
+ resolve([null, res]);
1233
1430
  },
1234
1431
  (err) => {
1235
- resolve([err,null]);
1432
+ resolve([err, null]);
1236
1433
  }
1237
1434
  );
1238
1435
  });
@@ -1240,15 +1437,34 @@ export function uploadUrlApi(options) {
1240
1437
 
1241
1438
 
1242
1439
  //根据试卷id,题目id获取变式题个数
1243
- export function getVariantCountApi(options){
1440
+ export function getVariantCountApi(options) {
1244
1441
  return new Promise((resolve) => {
1245
1442
  axios.get("/ybk/variant/count", { params: options }).then(
1246
- (res) => {
1247
- resolve([null, res])
1248
- },
1249
- (err) => {
1250
- resolve([err, null])
1443
+ (res) => {
1444
+ resolve([null, res])
1445
+ },
1446
+ (err) => {
1447
+ resolve([err, null])
1448
+ }
1449
+ );
1450
+ })
1451
+ }
1452
+
1453
+ //获取知识点
1454
+ export function getKnowledgeListApi(options) {
1455
+ return new Promise((resolve) => {
1456
+ axios.get("/ybk/item/get-knowledge-list", { params: options }).then(
1457
+ (res) => {
1458
+ let data = {
1459
+ ...res,
1460
+ value: res?.value || [],
1251
1461
  }
1462
+ res = data
1463
+ resolve([null, res])
1464
+ },
1465
+ (err) => {
1466
+ resolve([err, null])
1467
+ }
1252
1468
  );
1253
1469
  })
1254
1470
  }