@focus-teach/ui 1.2.2 → 1.2.5

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.
@@ -0,0 +1,20 @@
1
+ import * as pkg from '../packages/zw-ai-report/index.js';
2
+ import { FtDragDialog } from '../packages/directives/drag-dialog.js';
3
+ import Alert from '../packages/assets/js/alert.js';
4
+ const components = Object.keys(pkg)
5
+ .map((key) => pkg[key])
6
+ .filter((item) => item && item.name);
7
+
8
+ const install = function (Vue) {
9
+ Vue.use(Alert);
10
+ if (install.installed) return;
11
+ components.forEach((component) => Vue.component(component.name, component));
12
+ Vue.directive('FtDragDialog', FtDragDialog);
13
+ };
14
+ if (typeof window !== 'undefined' && window.Vue) {
15
+ install(window.Vue);
16
+ }
17
+ export default {
18
+ install,
19
+ ...pkg,
20
+ };
package/api/index.js CHANGED
@@ -7,7 +7,7 @@ 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
- axios.defaults.timeout = 30000;
10
+ axios.defaults.timeout = 60000;
11
11
  //axios请求时,如果不显示的设置Content-Type,那么默认是text/plain,这时服务器就不知道怎么解析数据
12
12
  axios.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8";
13
13
  // axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; //默认异步请求
@@ -475,6 +475,37 @@ export function getQuestionApi(options) {
475
475
  );
476
476
  });
477
477
  }
478
+ //神笔数据有问题,后端不愿意处理,前端特殊过滤
479
+ export function getCompositionApi(options) {
480
+ const apiAxios = axios.create({
481
+ baseURL: axios.defaults.baseURL,
482
+ timeout: 30000,
483
+ crossDomain: true,
484
+ withCredentials: true
485
+ });
486
+ return new Promise((resolve) => {
487
+ apiAxios.get(`/files/${options.itemId}?type=2`, {
488
+ header: {
489
+ "Content-Type": "text/html;charset=UTF-8"
490
+ }
491
+ }).then(
492
+ (res) => {
493
+ res = res.data || res
494
+ let data = res?.data || res
495
+ let result = {
496
+ ...res,
497
+ ...data
498
+ }
499
+ delete result?.data
500
+ resolve([null, result]);
501
+ },
502
+ (err) => {
503
+ resolve([err, null]);
504
+ }
505
+ );
506
+ });
507
+ }
508
+
478
509
  export function getTitleHtml(options, params) {
479
510
  return new Promise((resolve) => {
480
511
  axios.get(`/files/${options.itemId}?type=2`, params, {
@@ -1863,7 +1894,7 @@ export function getShenBiImgInfoApi(options) {
1863
1894
  }
1864
1895
  );
1865
1896
  })
1866
- }
1897
+ }
1867
1898
 
1868
1899
  export function getTemplate(options) {
1869
1900
  return new Promise((resolve) => {
@@ -1878,12 +1909,12 @@ export function getTemplate(options) {
1878
1909
  })
1879
1910
  }
1880
1911
  export function checkStudentImg(options, success, error) {
1881
- return new Promise((resolve) => {
1882
- axios.get("/scanner/task/check-student-img", { params:options}).then(res => {
1883
- resolve([null, res])
1884
- }).catch(err => {
1885
- resolve([err, null])
1886
- })
1912
+ return new Promise((resolve) => {
1913
+ axios.get("/scanner/task/check-student-img", { params: options }).then(res => {
1914
+ resolve([null, res])
1915
+ }).catch(err => {
1916
+ resolve([err, null])
1917
+ })
1887
1918
  });
1888
1919
  }
1889
1920
  export function excImg(options, success, error) {
@@ -1963,7 +1994,7 @@ export function reMarkQuestionApi(options) {
1963
1994
  //修改成绩
1964
1995
  export function changeStudentScoreApi(options) {
1965
1996
  return new Promise((resolve) => {
1966
- axios.post("/ai/scanner/update-question-score", options).then(
1997
+ axios.post("/ai/scanner/update-errExcAns", options).then(
1967
1998
  (res) => {
1968
1999
  resolve([null, res])
1969
2000
  },
@@ -2026,4 +2057,108 @@ export function setBatchReviewStatusApi(options) {
2026
2057
  }
2027
2058
  );
2028
2059
  });
2029
- }
2060
+ }
2061
+ //ocr识别图片get
2062
+ export function ocrImageApi(options) {
2063
+ return new Promise((resolve) => {
2064
+ axios.get("/ai/common/ocr-answer", { params: options }).then(
2065
+ (res) => {
2066
+ resolve([null, res])
2067
+ },
2068
+ (err) => {
2069
+ resolve([err, null])
2070
+ }
2071
+ );
2072
+ })
2073
+ }
2074
+ //ocr识别图片base64上传
2075
+ export function ocrImageBase64Api(options) {
2076
+ return new Promise((resolve) => {
2077
+ axios.post("/ai/common/base64-ocr-answer", options).then(
2078
+ (res) => {
2079
+ resolve([null, res])
2080
+ },
2081
+ (err) => {
2082
+ resolve([err, null])
2083
+ }
2084
+ );
2085
+ })
2086
+ }
2087
+ //主观题答案修改
2088
+ export function updateSubjectiveAnswerApi(options) {
2089
+ return new Promise((resolve) => {
2090
+ axios.post("/ybk/item/subjective-question-answers", options).then(
2091
+ (res) => {
2092
+ resolve([null, res]);
2093
+ },
2094
+ (err) => {
2095
+ resolve([err, null]);
2096
+ }
2097
+ );
2098
+ });
2099
+ }
2100
+ //按题目重新智批
2101
+ export function reJudgeByItemApi(options) {
2102
+ return new Promise((resolve) => {
2103
+ axios.post("/ai/scanner/item/re-judge-add", options).then(
2104
+ (res) => {
2105
+ resolve([null, res]);
2106
+ },
2107
+ (err) => {
2108
+ resolve([err, null]);
2109
+ }
2110
+ );
2111
+ });
2112
+ }
2113
+ //是否可以修改答案
2114
+ export function canModifyAnswerApi(options) {
2115
+ return new Promise((resolve) => {
2116
+ axios.get("/scanner/task/score/rule/check-question-save", { params: options }).then(
2117
+ (res) => {
2118
+ resolve([null, res])
2119
+ },
2120
+ (err) => {
2121
+ resolve([err, null])
2122
+ }
2123
+ );
2124
+ })
2125
+ }
2126
+ //获取填空题的坐标批注
2127
+ export function getBlainkAnawerPoint (options) {
2128
+ return new Promise((resolve) => {
2129
+ axios.get("/ai/scanner/get-ocr-answer", { params: options }).then(
2130
+ (res) => {
2131
+ resolve([null, res])
2132
+ },
2133
+ (err) => {
2134
+ resolve([err, null])
2135
+ }
2136
+ );
2137
+ })
2138
+ }
2139
+ //检测智批进度
2140
+ export function checkSmartMarkingProgressApi(options) {
2141
+ return new Promise((resolve) => {
2142
+ axios.get("/scanner/task/check/composition", { params: options }).then(
2143
+ (res) => {
2144
+ resolve([null, res])
2145
+ },
2146
+ (err) => {
2147
+ resolve([err, null])
2148
+ }
2149
+ );
2150
+ })
2151
+ }
2152
+ //检测当前题目的智批进度
2153
+ export function checkItemSmartMarkingProgressApi(options) {
2154
+ return new Promise((resolve) => {
2155
+ axios.get("/ai/scanner/get-item-status", { params: options }).then(
2156
+ (res) => {
2157
+ resolve([null, res])
2158
+ },
2159
+ (err) => {
2160
+ resolve([err, null])
2161
+ }
2162
+ );
2163
+ })
2164
+ }