@focus-teach/ui 1.0.60 → 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,21 +855,29 @@ 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
-
724
- //获取教辅目录列表
725
- export function getTeachaidCatalogue(options, success, error) {
877
+ //获取学年
878
+ export function getTeachaidYearGradeApi(options) {
726
879
  return new Promise((resolve) => {
727
- axios.get("/teach-aid/catalogue/list/data", { params: options }).then(
880
+ axios.get("/teach-aid/list/year-grade", { params: options }).then(
728
881
  (res) => {
729
882
  resolve([null, res])
730
883
  },
@@ -732,21 +885,44 @@ export function getTeachaidCatalogue(options, success, error) {
732
885
  resolve([err, null])
733
886
  }
734
887
  );
735
- })
888
+ })
889
+ }
890
+ //获取教辅目录列表
891
+ export function getTeachaidCatalogue(options, success, error) {
892
+ return new Promise((resolve) => {
893
+ axios.get("/teach-aid/catalogue/list/data", { params: options }).then(
894
+ (res) => {
895
+ let data = {
896
+ ...res,
897
+ value:res?.value || [],
898
+ }
899
+ res = data
900
+ resolve([null, res])
901
+ },
902
+ (err) => {
903
+ resolve([err, null])
904
+ }
905
+ );
906
+ })
736
907
  }
737
908
 
738
909
  //根据教辅id和目录获取试卷
739
910
  export function getTeachaidPaper(options, success, error) {
740
911
  return new Promise((resolve) => {
741
912
  axios.get("/teach-aid/resource/list/data", { params: options }).then(
742
- (res) => {
743
- resolve([null, res])
744
- },
745
- (err) => {
746
- resolve([err, null])
913
+ (res) => {
914
+ let data = {
915
+ ...res,
916
+ value:res?.value || [],
747
917
  }
918
+ res = data
919
+ resolve([null, res])
920
+ },
921
+ (err) => {
922
+ resolve([err, null])
923
+ }
748
924
  );
749
- })
925
+ })
750
926
  }
751
927
 
752
928
  /**
@@ -777,59 +953,81 @@ export function removeResource(options, success, error) {
777
953
  export function addPaper(options) {
778
954
  return new Promise((resolve) => {
779
955
  axios.post("/ybk/editor/exam", options).then(
780
- (res) => {
781
- resolve([null, res])
782
- },
783
- (err) => {
784
- 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
+ }
785
966
  }
967
+ res = data
968
+ resolve([null, res])
969
+ },
970
+ (err) => {
971
+ resolve([err, null])
972
+ }
786
973
  );
787
- });
974
+ });
788
975
  }
789
976
 
790
977
  // 获取试卷题目信息
791
978
  export function getExamQuestion(options) {
792
979
  return new Promise((resolve) => {
793
- axios.get("/ybk/editor/exam/list-score", { params: options }).then(
794
- (res) => {
795
- resolve([null, res])
796
- },
797
- (err) => {
798
- 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,
799
990
  }
800
- );
991
+ }
992
+ res = data
993
+ resolve([null, res])
994
+ },
995
+ (err) => {
996
+ resolve([err, null])
997
+ }
998
+ );
801
999
  })
802
1000
  }
803
1001
 
804
1002
  //获取题目自增试卷配置
805
- export function getResourceCfg (options) {
1003
+ export function getResourceCfg(options) {
806
1004
  return new Promise((resolve) => {
807
1005
  axios.get("/ybk/item/getResourceCfg", { params: options }).then(
808
- (res) => {
809
- resolve([null, res])
810
- },
811
- (err) => {
812
- resolve([err, null])
813
- }
1006
+ (res) => {
1007
+ resolve([null, res])
1008
+ },
1009
+ (err) => {
1010
+ resolve([err, null])
1011
+ }
814
1012
  );
815
- })
1013
+ })
816
1014
  }
817
1015
  export function getExamCard(params) {
818
1016
  return new Promise((resolve) => {
819
- axios.get('/ybk/exam-card/edit.json', {params}).then(res => {
820
- resolve([null, res])
821
- }).catch(err => {
822
- resolve([err, null])
823
- })
1017
+ axios.get('/ybk/exam-card/edit.json', { params }).then(res => {
1018
+ resolve([null, res])
1019
+ }).catch(err => {
1020
+ resolve([err, null])
1021
+ })
824
1022
  });
825
1023
  }
826
1024
  export function getPreviewJSON(params) {
827
1025
  return new Promise((resolve) => {
828
- axios.get('/ybk/editor/exam/preview.json', {params}).then(res => {
829
- resolve([null, res])
830
- }).catch(err => {
831
- resolve([err, null])
832
- })
1026
+ axios.get('/ybk/editor/exam/preview.json', { params }).then(res => {
1027
+ resolve([null, res])
1028
+ }).catch(err => {
1029
+ resolve([err, null])
1030
+ })
833
1031
  });
834
1032
  }
835
1033
  //引用试卷内题目【异步】
@@ -847,22 +1045,27 @@ export function quotePaperQuestion(options, success, error) {
847
1045
  //获取模板列表
848
1046
  export function getExamTemplateList(params) {
849
1047
  return new Promise((resolve) => {
850
- axios.get('/exam-paper/template/list/data', {params}).then(res => {
851
- resolve([null, res])
1048
+ axios.get('/exam-paper/template/list/data', { params }).then(res => {
1049
+ resolve([null, res])
852
1050
  }).catch(err => {
853
- resolve([err, null])
1051
+ resolve([err, null])
854
1052
  })
855
- });
1053
+ });
856
1054
  }
857
1055
  //获取题型列表
858
1056
  export function getCategoryList(params) {
859
1057
  return new Promise((resolve) => {
860
- axios.get('/item/common/category/list', {params}).then(res => {
861
- 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])
862
1065
  }).catch(err => {
863
- resolve([err, null])
1066
+ resolve([err, null])
864
1067
  })
865
- });
1068
+ });
866
1069
  }
867
1070
 
868
1071
  //获取智能打标知识点集合
@@ -876,72 +1079,73 @@ export function getAIKlList(options) {
876
1079
  resolve([err, null])
877
1080
  }
878
1081
  );
879
- });
1082
+ });
880
1083
  }
881
1084
 
882
1085
  // 获取当前试卷题目列表
883
1086
  export function getItemList(options) {
884
1087
  return new Promise((resolve) => {
885
- axios.get("/ybk/editor/exam", { params: options }).then(
886
- (res) => {
887
- resolve([null, res])
888
- },
889
- (err) => {
890
- resolve([err, null])
891
- }
892
- );
1088
+ axios.get("/ybk/editor/exam", { params: options }).then(
1089
+ (res) => {
1090
+ resolve([null, res])
1091
+ },
1092
+ (err) => {
1093
+ resolve([err, null])
1094
+ }
1095
+ );
893
1096
  })
894
1097
  }
895
1098
  //获取当前目录下面的试卷列表(异步)
896
1099
  export function getExamListAsync(options, success, error) {
897
1100
  axios.get('/teach-aid/resource/list/data', { params: options }).then(
898
- (res) => {
899
- success && success(res);
900
- },
901
- (res) => {
902
- error && error(res);
903
- }
1101
+ (res) => {
1102
+ success && success(res);
1103
+ },
1104
+ (res) => {
1105
+ error && error(res);
1106
+ }
904
1107
  );
905
1108
  }
906
1109
  //答题是否下载过
907
1110
  export function getAnswerDownload(options, success, error) {
908
1111
  return new Promise((resolve) => {
909
1112
  axios.get("/ybk/exam-card/edit.json", { params: options }).then(
910
- (res) => {
911
- resolve([null, res])
912
- },
913
- (err) => {
914
- resolve([err, null])
915
- }
1113
+ (res) => {
1114
+ resolve([null, res])
1115
+ },
1116
+ (err) => {
1117
+ resolve([err, null])
1118
+ }
916
1119
  );
917
1120
  })
918
1121
  }
919
1122
 
920
1123
  //下载试卷>是否下载听力
921
- export function getPaperAudio (options) {
1124
+ export function getPaperAudio(options) {
922
1125
  return new Promise((resolve) => {
923
1126
  axios.get("/ybk/editor/exam/check-audio", { params: options }).then(
924
- (res) => {
925
- resolve([null, res])
926
- },
927
- (err) => {
928
- resolve([err, null])
929
- }
1127
+ (res) => {
1128
+ resolve([null, res])
1129
+ },
1130
+ (err) => {
1131
+ resolve([err, null])
1132
+ }
930
1133
  );
931
- })}
1134
+ })
1135
+ }
932
1136
 
933
1137
 
934
1138
  // 获取题目难度列表
935
1139
  export function getItemDiffList(options) {
936
1140
  return new Promise((resolve) => {
937
- axios.get("/ybk/item/difficult", { params: options }).then(
938
- (res) => {
939
- resolve([null, res])
940
- },
941
- (err) => {
942
- resolve([err, null])
943
- }
944
- );
1141
+ axios.get("/ybk/item/difficult", { params: options }).then(
1142
+ (res) => {
1143
+ resolve([null, res])
1144
+ },
1145
+ (err) => {
1146
+ resolve([err, null])
1147
+ }
1148
+ );
945
1149
  })
946
1150
  }
947
1151
 
@@ -956,7 +1160,7 @@ export function getJYWVariantList(options) {
956
1160
  resolve([err, null])
957
1161
  }
958
1162
  );
959
- });
1163
+ });
960
1164
  }
961
1165
 
962
1166
  //保存或者移除变式题目
@@ -970,7 +1174,7 @@ export function saveOrRemoveVariantItem(options,) {
970
1174
  resolve([err, null])
971
1175
  }
972
1176
  );
973
- });
1177
+ });
974
1178
  }
975
1179
 
976
1180
  //查询菁优网答案与解析
@@ -984,7 +1188,7 @@ export function getJYWVariantDetailList(options,) {
984
1188
  resolve([err, null])
985
1189
  }
986
1190
  );
987
- });
1191
+ });
988
1192
  }
989
1193
 
990
1194
  //引用菁优网变式题到教育系统
@@ -998,19 +1202,24 @@ export function getItemToVariant(options) {
998
1202
  resolve([err, null])
999
1203
  }
1000
1204
  );
1001
- });
1205
+ });
1002
1206
  }
1003
1207
 
1004
1208
  //根据试卷id,题目id获取变式题列表
1005
- export function getVariantList(options){
1209
+ export function getVariantList(options) {
1006
1210
  return new Promise((resolve) => {
1007
1211
  axios.get("/ybk/variant/list", { params: options }).then(
1008
- (res) => {
1009
- resolve([null, res])
1010
- },
1011
- (err) => {
1012
- resolve([err, null])
1212
+ (res) => {
1213
+ let data = {
1214
+ ...res,
1215
+ value:res?.value || [],
1013
1216
  }
1217
+ res = data
1218
+ resolve([null, res])
1219
+ },
1220
+ (err) => {
1221
+ resolve([err, null])
1222
+ }
1014
1223
  );
1015
1224
  })
1016
1225
  }
@@ -1031,7 +1240,7 @@ export function getItem(itemFileId) {
1031
1240
  //上下移动变式题
1032
1241
  export function moveVariantItem(options) {
1033
1242
  return new Promise((resolve) => {
1034
- axios.post('/ybk/variant/reorder',options).then(
1243
+ axios.post('/ybk/variant/reorder', options).then(
1035
1244
  (res) => {
1036
1245
  resolve([null, res])
1037
1246
  },
@@ -1056,44 +1265,44 @@ export function getStudyfunEnv(options) {
1056
1265
  }
1057
1266
 
1058
1267
  // 获取自制卡题目信息(分值、答案)
1059
- export function getCustomCardInfo(options){
1268
+ export function getCustomCardInfo(options) {
1060
1269
  return new Promise((resolve) => {
1061
- axios.get("/ybk/exam/blank/item/list/score", { params:options }).then(res => {
1062
- resolve([null, res])
1063
- }).catch(err => {
1064
- resolve([err, null])
1065
- })
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
+ })
1066
1275
  });
1067
1276
  }
1068
1277
 
1069
1278
  //获取资源分享信息
1070
1279
  export function getResourceShareInfo(options) {
1071
- return new Promise(resolve=>{
1072
- axios.get("/ybk/resource/share", {
1073
- params: options
1074
- }).then(
1075
- (res) => {
1076
- resolve([null, res])
1077
- },
1078
- (err) => {
1079
- resolve([err, null])
1080
- }
1081
- );
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
+ );
1082
1291
  })
1083
1292
  }
1084
1293
  //获取自制卡信息
1085
1294
  export function getCustomCardRecord(options) {
1086
- return new Promise(resolve=>{
1087
- axios.get("/ybk/exam/blank/item/get/record", {
1088
- params: options
1089
- }).then(
1090
- (res) => {
1091
- resolve([null, res])
1092
- },
1093
- (err) => {
1094
- resolve([err, null])
1095
- }
1096
- );
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
+ );
1097
1306
  })
1098
1307
  }
1099
1308
  //获取用户搜索内容
@@ -1101,9 +1310,9 @@ export function getSearchList(options, success, error) {
1101
1310
  axios.get("/paper-exam/user/like-name", {params: options})
1102
1311
  .then((res) => {
1103
1312
  success && success(res)
1104
- }, (res) => {
1313
+ }, (res) => {
1105
1314
  error && error(res)
1106
- })
1315
+ })
1107
1316
  }
1108
1317
  //搜索学生列表
1109
1318
  export const getSearchStudentList = (params) => {
@@ -1191,7 +1400,7 @@ export function getPermissionList(options) {
1191
1400
  resolve([err, null])
1192
1401
  }
1193
1402
  );
1194
- })
1403
+ });
1195
1404
  }
1196
1405
  /* 获取学科网变式题 */
1197
1406
  export function getXkwRecVariantList(options) {
@@ -1217,10 +1426,10 @@ export function uploadUrlApi(options) {
1217
1426
  return new Promise((resolve) => {
1218
1427
  axios.post("/item/common/upload/url", options).then(
1219
1428
  (res) => {
1220
- resolve([null,res]);
1429
+ resolve([null, res]);
1221
1430
  },
1222
1431
  (err) => {
1223
- resolve([err,null]);
1432
+ resolve([err, null]);
1224
1433
  }
1225
1434
  );
1226
1435
  });
@@ -1228,9 +1437,43 @@ export function uploadUrlApi(options) {
1228
1437
 
1229
1438
 
1230
1439
  //根据试卷id,题目id获取变式题个数
1231
- export function getVariantCountApi(options){
1440
+ export function getVariantCountApi(options) {
1232
1441
  return new Promise((resolve) => {
1233
1442
  axios.get("/ybk/variant/count", { params: options }).then(
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 || [],
1461
+ }
1462
+ res = data
1463
+ resolve([null, res])
1464
+ },
1465
+ (err) => {
1466
+ resolve([err, null])
1467
+ }
1468
+ );
1469
+ })
1470
+ }
1471
+
1472
+
1473
+ //【同步】hq_studyfun 获取历史记录
1474
+ export function getUserOperateApi(options){
1475
+ return new Promise((resolve) => {
1476
+ axios.get("/user/operate/get", { params: options }).then(
1234
1477
  (res) => {
1235
1478
  resolve([null, res])
1236
1479
  },
@@ -1239,4 +1482,18 @@ export function getVariantCountApi(options){
1239
1482
  }
1240
1483
  );
1241
1484
  })
1242
- }
1485
+ }
1486
+
1487
+ //hq_studyfun 保存记录 2云备课,3智慧教学
1488
+ export function setUserOperateApi(options) {
1489
+ return new Promise((resolve) => {
1490
+ axios.post("/user/operate/save", options).then(
1491
+ (res) => {
1492
+ resolve([null,res]);
1493
+ },
1494
+ (err) => {
1495
+ resolve([err,null]);
1496
+ }
1497
+ );
1498
+ });
1499
+ }