ai-assistant-international 0.0.1

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.
Files changed (165) hide show
  1. package/README.md +33 -0
  2. package/components/demo/api/index.js +355 -0
  3. package/components/demo/index.js +7 -0
  4. package/components/demo/plugins/Formula-show.js +52 -0
  5. package/components/demo/plugins/cache.js +77 -0
  6. package/components/demo/src/chat-tools.vue +360 -0
  7. package/components/demo/src/chat-type.vue +300 -0
  8. package/components/demo/src/chat.vue +1564 -0
  9. package/components/demo/src/deep-thinking.vue +103 -0
  10. package/components/demo/src/digital-human.vue +1125 -0
  11. package/components/demo/src/hot-search.vue +261 -0
  12. package/components/demo/src/input-part.vue +1639 -0
  13. package/components/demo/src/learning-progress.vue +488 -0
  14. package/components/demo/src/main.vue +1137 -0
  15. package/components/demo/src/task-chat.vue +714 -0
  16. package/components/demo/src/task-content.vue +610 -0
  17. package/components/demo/static/401.png +0 -0
  18. package/components/demo/static/403.png +0 -0
  19. package/components/demo/static/K-Map.png +0 -0
  20. package/components/demo/static/agent-null.png +0 -0
  21. package/components/demo/static/append-task.png +0 -0
  22. package/components/demo/static/arrow-right.png +0 -0
  23. package/components/demo/static/audio-icon.png +0 -0
  24. package/components/demo/static/bg-image.svg +12 -0
  25. package/components/demo/static/cai-active.png +0 -0
  26. package/components/demo/static/cai.png +0 -0
  27. package/components/demo/static/close-img.png +0 -0
  28. package/components/demo/static/cn_1.png +0 -0
  29. package/components/demo/static/cn_2.png +0 -0
  30. package/components/demo/static/course-bot.png +0 -0
  31. package/components/demo/static/deepseek-bot.png +0 -0
  32. package/components/demo/static/deepseek-icon.png +0 -0
  33. package/components/demo/static/delete.png +0 -0
  34. package/components/demo/static/digital-human-icon-active.png +0 -0
  35. package/components/demo/static/digital-human-icon.png +0 -0
  36. package/components/demo/static/do-task-active.png +0 -0
  37. package/components/demo/static/do-task.png +0 -0
  38. package/components/demo/static/doc-read.png +0 -0
  39. package/components/demo/static/en_1.png +0 -0
  40. package/components/demo/static/en_2.png +0 -0
  41. package/components/demo/static/evaluation.png +0 -0
  42. package/components/demo/static/excel-icon.png +0 -0
  43. package/components/demo/static/feed-back.png +0 -0
  44. package/components/demo/static/file_icon.png +0 -0
  45. package/components/demo/static/fileupload-active.png +0 -0
  46. package/components/demo/static/fileupload.png +0 -0
  47. package/components/demo/static/formula-active.png +0 -0
  48. package/components/demo/static/formula.png +0 -0
  49. package/components/demo/static/iconfont/iconfont.css +45 -0
  50. package/components/demo/static/iconfont/iconfont.js +1 -0
  51. package/components/demo/static/iconfont/iconfont.json +65 -0
  52. package/components/demo/static/iconfont/iconfont.ttf +0 -0
  53. package/components/demo/static/image-icon.png +0 -0
  54. package/components/demo/static/image_icon.png +0 -0
  55. package/components/demo/static/img.png +0 -0
  56. package/components/demo/static/import-task.png +0 -0
  57. package/components/demo/static/link-icon.png +0 -0
  58. package/components/demo/static/lock-icon.svg +6 -0
  59. package/components/demo/static/logo-new.png +0 -0
  60. package/components/demo/static/logo.png +0 -0
  61. package/components/demo/static/look-image-active.png +0 -0
  62. package/components/demo/static/look-image.png +0 -0
  63. package/components/demo/static/message-active.png +0 -0
  64. package/components/demo/static/message.png +0 -0
  65. package/components/demo/static/multimodal-active.png +0 -0
  66. package/components/demo/static/multimodal.png +0 -0
  67. package/components/demo/static/no-image.png +0 -0
  68. package/components/demo/static/no-image1.png +0 -0
  69. package/components/demo/static/noFile-icon.png +0 -0
  70. package/components/demo/static/node-icon.png +0 -0
  71. package/components/demo/static/pdf-icon.png +0 -0
  72. package/components/demo/static/ppt-icon.png +0 -0
  73. package/components/demo/static/program-icon.png +0 -0
  74. package/components/demo/static/qa-file.png +0 -0
  75. package/components/demo/static/question-active.png +0 -0
  76. package/components/demo/static/question.png +0 -0
  77. package/components/demo/static/read-doc-active.png +0 -0
  78. package/components/demo/static/read-doc.png +0 -0
  79. package/components/demo/static/robot.png +0 -0
  80. package/components/demo/static/send-icon.png +0 -0
  81. package/components/demo/static/solution-question-active.png +0 -0
  82. package/components/demo/static/solution-question.png +0 -0
  83. package/components/demo/static/success-icon.svg +6 -0
  84. package/components/demo/static/teach-guide.png +0 -0
  85. package/components/demo/static/text-to-image-active.png +0 -0
  86. package/components/demo/static/text-to-image.png +0 -0
  87. package/components/demo/static/think.png +0 -0
  88. package/components/demo/static/translate-active.png +0 -0
  89. package/components/demo/static/translate.png +0 -0
  90. package/components/demo/static/txt-icon.png +0 -0
  91. package/components/demo/static/upload-icon.png +0 -0
  92. package/components/demo/static/upload-show-img.png +0 -0
  93. package/components/demo/static/video-icon.png +0 -0
  94. package/components/demo/static/video.png +0 -0
  95. package/components/demo/static/word-icon.png +0 -0
  96. package/components/demo/static/zan-active.png +0 -0
  97. package/components/demo/static/zan.png +0 -0
  98. package/components/demo/static/zip-icon.png +0 -0
  99. package/components/demo/utils/aes-utils.js +35 -0
  100. package/components/demo/utils/assistant-ui-i18n.js +343 -0
  101. package/components/demo/utils/config.js +112 -0
  102. package/components/demo/utils/constants.js +15 -0
  103. package/components/demo/utils/request.js +86 -0
  104. package/components/demo/utils/video-map.js +41 -0
  105. package/components/index.js +15 -0
  106. package/dist/ai-assistant-international.common.js +47890 -0
  107. package/dist/ai-assistant-international.common.js.map +1 -0
  108. package/dist/ai-assistant-international.css +11 -0
  109. package/dist/ai-assistant-international.umd.js +47909 -0
  110. package/dist/ai-assistant-international.umd.js.map +1 -0
  111. package/dist/ai-assistant-international.umd.min.js +176 -0
  112. package/dist/ai-assistant-international.umd.min.js.map +1 -0
  113. package/dist/demo.html +1 -0
  114. package/dist/fonts/KaTeX_AMS-Regular.1608a09b.woff +0 -0
  115. package/dist/fonts/KaTeX_AMS-Regular.4aafdb68.ttf +0 -0
  116. package/dist/fonts/KaTeX_AMS-Regular.a79f1c31.woff2 +0 -0
  117. package/dist/fonts/KaTeX_Caligraphic-Bold.cce5b8ec.ttf +0 -0
  118. package/dist/fonts/KaTeX_Caligraphic-Regular.07ef19e7.ttf +0 -0
  119. package/dist/fonts/KaTeX_Fraktur-Bold.9f256b85.woff +0 -0
  120. package/dist/fonts/KaTeX_Fraktur-Bold.b18f59e1.ttf +0 -0
  121. package/dist/fonts/KaTeX_Fraktur-Bold.d42a5579.woff2 +0 -0
  122. package/dist/fonts/KaTeX_Fraktur-Regular.7c187121.woff +0 -0
  123. package/dist/fonts/KaTeX_Fraktur-Regular.d3c882a6.woff2 +0 -0
  124. package/dist/fonts/KaTeX_Fraktur-Regular.ed38e79f.ttf +0 -0
  125. package/dist/fonts/KaTeX_Main-Bold.b74a1a8b.ttf +0 -0
  126. package/dist/fonts/KaTeX_Main-Bold.c3fb5ac2.woff2 +0 -0
  127. package/dist/fonts/KaTeX_Main-Bold.d181c465.woff +0 -0
  128. package/dist/fonts/KaTeX_Main-BoldItalic.6f2bb1df.woff2 +0 -0
  129. package/dist/fonts/KaTeX_Main-BoldItalic.70d8b0a5.ttf +0 -0
  130. package/dist/fonts/KaTeX_Main-BoldItalic.e3f82f9d.woff +0 -0
  131. package/dist/fonts/KaTeX_Main-Italic.47373d1e.ttf +0 -0
  132. package/dist/fonts/KaTeX_Main-Italic.8916142b.woff2 +0 -0
  133. package/dist/fonts/KaTeX_Main-Italic.9024d815.woff +0 -0
  134. package/dist/fonts/KaTeX_Main-Regular.0462f03b.woff2 +0 -0
  135. package/dist/fonts/KaTeX_Main-Regular.7f51fe03.woff +0 -0
  136. package/dist/fonts/KaTeX_Main-Regular.b7f8fe9b.ttf +0 -0
  137. package/dist/fonts/KaTeX_Math-BoldItalic.572d331f.woff2 +0 -0
  138. package/dist/fonts/KaTeX_Math-BoldItalic.a879cf83.ttf +0 -0
  139. package/dist/fonts/KaTeX_Math-BoldItalic.f1035d8d.woff +0 -0
  140. package/dist/fonts/KaTeX_Math-Italic.5295ba48.woff +0 -0
  141. package/dist/fonts/KaTeX_Math-Italic.939bc644.ttf +0 -0
  142. package/dist/fonts/KaTeX_Math-Italic.f28c23ac.woff2 +0 -0
  143. package/dist/fonts/KaTeX_SansSerif-Bold.8c5b5494.woff2 +0 -0
  144. package/dist/fonts/KaTeX_SansSerif-Bold.94e1e8dc.ttf +0 -0
  145. package/dist/fonts/KaTeX_SansSerif-Bold.bf59d231.woff +0 -0
  146. package/dist/fonts/KaTeX_SansSerif-Italic.3b1e59b3.woff2 +0 -0
  147. package/dist/fonts/KaTeX_SansSerif-Italic.7c9bc82b.woff +0 -0
  148. package/dist/fonts/KaTeX_SansSerif-Italic.b4c20c84.ttf +0 -0
  149. package/dist/fonts/KaTeX_SansSerif-Regular.74048478.woff +0 -0
  150. package/dist/fonts/KaTeX_SansSerif-Regular.ba21ed5f.woff2 +0 -0
  151. package/dist/fonts/KaTeX_SansSerif-Regular.d4d7ba48.ttf +0 -0
  152. package/dist/fonts/KaTeX_Script-Regular.03e9641d.woff2 +0 -0
  153. package/dist/fonts/KaTeX_Script-Regular.07505710.woff +0 -0
  154. package/dist/fonts/KaTeX_Script-Regular.fe9cbbe1.ttf +0 -0
  155. package/dist/fonts/KaTeX_Size1-Regular.fabc004a.ttf +0 -0
  156. package/dist/fonts/KaTeX_Size2-Regular.d6b476ec.ttf +0 -0
  157. package/dist/fonts/KaTeX_Size4-Regular.fbccdabe.ttf +0 -0
  158. package/dist/fonts/KaTeX_Typewriter-Regular.6258592b.woff +0 -0
  159. package/dist/fonts/KaTeX_Typewriter-Regular.a8709e36.woff2 +0 -0
  160. package/dist/fonts/KaTeX_Typewriter-Regular.d97aaf4a.ttf +0 -0
  161. package/dist/img/cn_1.df9fa9a1.png +0 -0
  162. package/dist/img/cn_2.f5f78173.png +0 -0
  163. package/dist/img/en_1.f22b5441.png +0 -0
  164. package/dist/img/en_2.f5f78173.png +0 -0
  165. package/package.json +54 -0
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # ai-questtion
2
+
3
+ ## Project setup
4
+ ```
5
+ npm install
6
+ ```
7
+
8
+ ### Compiles and minifies for production
9
+ ```
10
+ npm run build
11
+ ```
12
+
13
+ ### Customize configuration
14
+ See [Configuration Reference](https://cli.vuejs.org/config/).
15
+
16
+
17
+ ### test-project是测试组件项目
18
+
19
+ ### 公司自用组件 npm i ai-question
20
+
21
+ ### 调用方法
22
+ ...
23
+
24
+ this.$refs.name.showAddQuestion()
25
+ ...
26
+
27
+ ### top控制侧边弹框到顶部的距离
28
+
29
+ ### knowledgeList根据elment传参格式传入树形数据
30
+
31
+ ### propFormat知识点传参格式修改 {value : 'xxx',label : 'xxx','children' : 'xxx'}
32
+
33
+ ### join加入题库
@@ -0,0 +1,355 @@
1
+ import request from '../utils/request'
2
+ import { fetchEventSource } from '@microsoft/fetch-event-source';
3
+ import constants from '../utils/constants';
4
+ import cache from '../plugins/cache';
5
+
6
+ const UPLOAD_KEY = 'sk-6c6796addecf41098dcd3dd4aea6ee2b';
7
+ const baseURL = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_BASE_URL') || constants.publicPath;
8
+ let prefix = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_PRE_FIX') || constants.publicPrefix;
9
+ // 0.0.8 版本接口升级
10
+ prefix += '/plugin/v2';
11
+
12
+ // export const pdfUrlBase = 'https://testagent.icve.com.cn';
13
+ export const pdfUrlBase = 'https://agent.icve.com.cn';
14
+ export const pdfUrl = pdfUrlBase + '/ossurl';
15
+ export const ssoAuth = (token) => {
16
+ return request({
17
+ url: prefix + '/sso/assistant',
18
+ method: 'get',
19
+ params: {
20
+ token: token,
21
+ businessSource: 3
22
+ },
23
+ });
24
+ }
25
+
26
+ export const authUser = (headers) => {
27
+ return request({
28
+ url: '/uc/authuser',
29
+ method: 'get',
30
+ headers: headers,
31
+ });
32
+ }
33
+
34
+ /** @param {string} resId @param {string} [aiId] 如数字人传 _digitalHuman,与答疑会话区分 */
35
+ export const newChat = (resId, aiId) => {
36
+ const params = { resId };
37
+ if (aiId != null && aiId !== '') {
38
+ params.aiId = aiId;
39
+ }
40
+ return request({
41
+ url: prefix + '/assistant/addChat',
42
+ method: 'post',
43
+ params,
44
+ });
45
+ }
46
+
47
+ export const chartClear = (chatId) => {
48
+ return request({
49
+ url: prefix + `/assistant/chartClear/${chatId}`,
50
+ method: 'post',
51
+ });
52
+ }
53
+
54
+ export const stopChat = (chatId) => {
55
+ return request({
56
+ url: prefix + `/assistant/stop/${chatId}`,
57
+ method: 'post',
58
+ });
59
+ }
60
+
61
+ export const chatEvaluateAdd = (params) => {
62
+ return request({
63
+ url: prefix + `/assistant/chatEvaluateAdd`,
64
+ method: 'post',
65
+ data: params
66
+ });
67
+ }
68
+
69
+ export const chatEvaluateCancel = (params) => {
70
+ return request({
71
+ url: prefix + `/assistant/chatEvaluateCancel`,
72
+ method: 'post',
73
+ data: params
74
+ });
75
+ }
76
+
77
+ export const pustReanswerToTeacher = (params) => {
78
+ return request({
79
+ url: prefix + `/assistant/push`,
80
+ method: 'post',
81
+ data: params
82
+ });
83
+ }
84
+
85
+ export const getDetailList = (resId, aiId) => {
86
+ return request({
87
+ url: prefix + `/assistant/detail/v2/${resId}`,
88
+ params: { aiId },
89
+ method: 'get',
90
+ });
91
+ }
92
+
93
+ export const countAccess = (resId, iaId) => {
94
+ return request({
95
+ url: prefix + `/assistant/access`,
96
+ method: 'post',
97
+ params: { resId, iaId },
98
+ });
99
+ }
100
+
101
+ export const checkCourseIdIsExist = (resId) => {
102
+ return request({
103
+ url: prefix + `/ia/hasPermission?courseId=${resId}`,
104
+ method: 'get',
105
+ });
106
+ }
107
+ /**
108
+ * 开场白及提示词查询
109
+ * */
110
+ export const queryCallWord = (resId,courseId) => {
111
+ return request({
112
+ url: prefix + `/ia/byCourseId?courseId=${resId}&&internationalChannelCourseId=${courseId}`,
113
+ method: 'get',
114
+ });
115
+ }
116
+
117
+ /**
118
+ * 自动追问
119
+ * @param iaId 请求参数id
120
+ * @param message 对话对
121
+ * @returns 返回节点详情数据
122
+ */
123
+ export async function getAutoQuestioning(iaId, message) {
124
+ return request.post(`${prefix}/ia/autoFollowUp`, {
125
+ iaId,
126
+ messages: message,
127
+ });
128
+ }
129
+ /**
130
+ * 发起聊天接口(正常聊天)
131
+ * @param params 请求参数
132
+ * @param signal signal 对象
133
+ * @param onmessage 回调函数
134
+ * @returns 返回节点详情数据
135
+ * */
136
+ export async function sendMessageEventSource(params, signal, onmessage) {
137
+ const controller = new AbortController();
138
+ let retryCount = 0;
139
+ const maxRetries = 3;
140
+ return fetchEventSource(`${baseURL}${prefix}/assistant/conversation?token=${cache.session.getJSON('SRKJ_TOKEN_CACHE')}`, {
141
+ method: 'POST',
142
+ signal: signal,
143
+ openWhenHidden: true,
144
+ headers: {
145
+ 'Content-Type': 'application/json',
146
+ // 'X-Id-Token': cache.session.getJSON('SRKJ_TOKEN_CACHE'),
147
+ },
148
+ body: JSON.stringify(params),
149
+ onmessage,
150
+ onerror(err) {
151
+ retryCount++;
152
+ console.warn(`SSE错误,重试次数: ${retryCount}`);
153
+ if (retryCount >= maxRetries) {
154
+ console.error('超过最大重试次数,停止请求');
155
+ controller.abort();
156
+ throw err;
157
+ }
158
+ },
159
+ });
160
+ }
161
+
162
+ export async function tutoringMessage(data, signal, onmessage) {
163
+ const controller = new AbortController();
164
+ let retryCount = 0;
165
+ const maxRetries = 3;
166
+ return fetchEventSource(`${baseURL}${prefix}/assistant/tutoring/message?token=${cache.session.getJSON('SRKJ_TOKEN_CACHE')}`, {
167
+ method: 'POST',
168
+ signal: signal,
169
+ openWhenHidden: true,
170
+ headers: {
171
+ 'Content-Type': 'application/json',
172
+ // 'X-Id-Token': cache.session.getJSON('SRKJ_TOKEN_CACHE'),
173
+ },
174
+ body: JSON.stringify(data),
175
+ onmessage,
176
+ onerror(err) {
177
+ retryCount++;
178
+ console.warn(`SSE错误,重试次数: ${retryCount}`);
179
+ if (retryCount >= maxRetries) {
180
+ console.error('超过最大重试次数,停止请求');
181
+ controller.abort();
182
+ throw err;
183
+ }
184
+ },
185
+ });
186
+ }
187
+
188
+
189
+ /**
190
+ * 互联网搜索
191
+ * @param params 请求参数
192
+ * @param signal signal 对象
193
+ * @param onmessage 回调函数
194
+ * @returns 返回节点详情数据
195
+ * */
196
+ export async function aiSearch(params, signal, onmessage) {
197
+ const controller = new AbortController();
198
+ let retryCount = 0;
199
+ const maxRetries = 3;
200
+ return fetchEventSource(`${baseURL}${prefix}/text/aisearch?token=${cache.session.getJSON('SRKJ_TOKEN_CACHE')}`, {
201
+ method: 'POST',
202
+ signal: signal,
203
+ openWhenHidden: true,
204
+ headers: {
205
+ 'Content-Type': 'application/json',
206
+ // 'X-Id-Token': cache.session.getJSON('SRKJ_TOKEN_CACHE'),
207
+ },
208
+ body: JSON.stringify(params),
209
+ onmessage,
210
+ onerror(err) {
211
+ retryCount++;
212
+ console.warn(`SSE错误,重试次数: ${retryCount}`);
213
+ if (retryCount >= maxRetries) {
214
+ console.error('超过最大重试次数,停止请求');
215
+ controller.abort();
216
+ throw err;
217
+ }
218
+ },
219
+ });
220
+ }
221
+
222
+
223
+ /**
224
+ * 保存互联网ai搜索数据
225
+ * @param params 请求参数
226
+ * */
227
+ export async function saveAiSearch(params) {
228
+ return request.post(`${baseURL}${prefix}/aisearch/reference/save`, {
229
+ ...params
230
+ });
231
+ }
232
+
233
+
234
+ /**
235
+ * 保存视频ai搜索数据
236
+ * @param params 请求参数
237
+ * */
238
+ export async function saveMiaoSearch(params) {
239
+ return request.post(`${baseURL}${prefix}/miaosearch/reference/save`, {
240
+ ...params
241
+ });
242
+ }
243
+
244
+ /**
245
+ * 全妙视频搜索
246
+ * @param params 请求参数
247
+ * @param signal signal 对象
248
+ * @param onmessage 回调函数
249
+ * @returns 返回节点详情数据
250
+ * */
251
+ export async function aiVideoSearch(params, signal, onmessage) {
252
+ return fetchEventSource(`${baseURL}${prefix}/assistant/aiMediaAssetsSearch?token=${cache.session.getJSON('SRKJ_TOKEN_CACHE')}`, {
253
+ method: 'POST',
254
+ signal: signal,
255
+ openWhenHidden: true,
256
+ headers: {
257
+ 'Content-Type': 'application/json',
258
+ // 'X-Id-Token': cache.session.getJSON('SRKJ_TOKEN_CACHE'),
259
+ },
260
+ body: JSON.stringify(params),
261
+ onmessage,
262
+ });
263
+ }
264
+
265
+ /**
266
+ * 发起聊天接口(图文多模态翻译)
267
+ * @param params 请求参数
268
+ * @param signal signal 对象
269
+ * @param onmessage 回调函数
270
+ * @returns 返回节点详情数据
271
+ * */
272
+ export async function sendMessageMoreSource(params, signal, onmessage) {
273
+ return fetchEventSource(`${baseURL}${prefix}/assistant/qa/system-qa/stream?token=${cache.session.getJSON('SRKJ_TOKEN_CACHE')}`, {
274
+ method: 'POST',
275
+ signal: signal,
276
+ openWhenHidden: true,
277
+ headers: {
278
+ 'Content-Type': 'application/json',
279
+ },
280
+ body: JSON.stringify(params),
281
+ onmessage,
282
+ });
283
+ }
284
+ /**
285
+ * 自动追问
286
+ * @param params 请求参数
287
+ * @returns 返回节点详情数据
288
+ */
289
+ export async function loopChatDetail(params) {
290
+ return request.post(`${prefix}/assistant/qa/get-session-dialog`, {
291
+ ...params
292
+ });
293
+ }
294
+
295
+ /**
296
+ * 获取前端上传的oss签名
297
+ */
298
+ export async function getSignature(isPublic) {
299
+ return request.get(`${prefix}/getSignature`, { params: { isPublic: isPublic } });
300
+ }
301
+
302
+ /**
303
+ * 上传oss(直接上传,不通过Nginx代理)
304
+ * @param uploadUrl
305
+ * @param params
306
+ */
307
+ export async function uploadAction(uploadUrl, params) {
308
+ return request.post(uploadUrl, params, {
309
+ headers: { 'Content-Type': 'multipart/form-data' },
310
+ timeout: 30000000,
311
+ });
312
+ }
313
+
314
+ /**
315
+ * 上传阿里云文件(直接上传,不通过Nginx代理)
316
+ * @param params
317
+ */
318
+ export async function uploadFileAction(params) {
319
+ return request.post(`${prefix}/assistant/qa/docUploadFile`, params, {
320
+ headers: { 'Authorization': `Bearer ${UPLOAD_KEY}`, 'Content-Type': 'multipart/form-data' },
321
+ timeout: 30000000,
322
+ });
323
+ }
324
+
325
+ /**
326
+ * 智能追问点击log追加
327
+ */
328
+ export async function probeLogAdd(courseId) {
329
+ return request.post(`${prefix}/probeLog/add`, {
330
+ courseId,
331
+ businessSource: 3
332
+ });
333
+ }
334
+
335
+ export async function tutoringStart(userId, nodeId) {
336
+ return request.post(`${prefix}/assistant/tutoring/start`, {
337
+ userId,
338
+ nodeId
339
+ });
340
+ }
341
+
342
+ export async function learnerTasks(userId) {
343
+ return request.get(`${prefix}/assistant/learner/tasks`, {params: {userId: userId}});
344
+ }
345
+
346
+ export async function learnerProgress(userId,courseId,scoreType) {
347
+ return request.get(`${prefix}/assistant/learner/progress`, {params: {userId,courseId,scoreType}});
348
+ }
349
+
350
+ export async function tutoringEnd(userId, sessionId) {
351
+ return request.post(`${prefix}/assistant/tutoring/end`, {
352
+ userId,
353
+ sessionId
354
+ });
355
+ }
@@ -0,0 +1,7 @@
1
+ import AiAssistantInternational from './src/main.vue'
2
+
3
+ AiAssistantInternational.install = function (Vue) {
4
+ Vue.component(AiAssistantInternational.name,AiAssistantInternational)
5
+ }
6
+
7
+ export default AiAssistantInternational
@@ -0,0 +1,52 @@
1
+ export class FormulaShow { // JS 语法
2
+ constructor(parent) {
3
+ this.title = '编辑' // 自定义菜单标题
4
+ this.tag = 'button'
5
+ this.parent = parent;
6
+ }
7
+ // 菜单是否需要激活(如选中加粗文本,“加粗”菜单会激活),用不到则返回 false
8
+ isActive(editor) { // JS 语法
9
+ return false
10
+ }
11
+ // 获取菜单执行时的 value ,用不到则返回空 字符串或 false
12
+ getValue(editor) { // JS 语法
13
+ return ''
14
+ }
15
+ upDataParent(parent) {
16
+ this.parent = parent;
17
+ }
18
+ // 菜单是否需要禁用(如选中 H1 ,“引用”菜单被禁用),用不到则返回 false
19
+ isDisabled(editor) { // JS 语法
20
+ return false
21
+ }
22
+ // 点击菜单时触发的函数
23
+ exec(editor, value) {
24
+ // Modal menu ,这个函数不用写,空着即可
25
+ const [currentValue] = editor.getFragment();
26
+
27
+ if (currentValue) {
28
+ this.parent.editFormula(currentValue.children[0].value);
29
+ } else {
30
+ console.log('currentValue ger error');
31
+ }
32
+
33
+ }
34
+ // 弹出框 modal 的定位:1. 返回某一个 SlateNode; 2. 返回 null (根据当前选区自动定位)
35
+ getModalPositionNode(editor) { // JS 语法
36
+ return null // modal 依据选区定位
37
+ }
38
+ // 定义 modal 内部的 DOM Element
39
+ getModalContentElem(editor) { // JS 语法
40
+ const $content = $('<div></div>')
41
+ const $button = $('<button>do something</button>')
42
+ $content.append($button)
43
+
44
+ $button.on('click', () => {
45
+ editor.insertText(' hello ')
46
+ })
47
+
48
+ return $content[0] // 返回 DOM Element 类型
49
+
50
+ // PS:也可以把 $content 缓存下来,这样不用每次重复创建、重复绑定事件,优化性能
51
+ }
52
+ }
@@ -0,0 +1,77 @@
1
+ const sessionCache = {
2
+ set (key, value) {
3
+ if (!sessionStorage) {
4
+ return
5
+ }
6
+ if (key != null && value != null) {
7
+ sessionStorage.setItem(key, value)
8
+ }
9
+ },
10
+ get (key) {
11
+ if (!sessionStorage) {
12
+ return null
13
+ }
14
+ if (key == null) {
15
+ return null
16
+ }
17
+ return sessionStorage.getItem(key)
18
+ },
19
+ setJSON (key, jsonValue) {
20
+ if (jsonValue != null) {
21
+ this.set(key, JSON.stringify(jsonValue))
22
+ }
23
+ },
24
+ getJSON (key) {
25
+ const value = this.get(key)
26
+ if (value != null) {
27
+ return JSON.parse(value)
28
+ }
29
+ },
30
+ remove (key) {
31
+ sessionStorage.removeItem(key);
32
+ }
33
+ }
34
+ const localCache = {
35
+ set (key, value) {
36
+ if (!localStorage) {
37
+ return
38
+ }
39
+ if (key != null && value != null) {
40
+ localStorage.setItem(key, value)
41
+ }
42
+ },
43
+ get (key) {
44
+ if (!localStorage) {
45
+ return null
46
+ }
47
+ if (key == null) {
48
+ return null
49
+ }
50
+ return localStorage.getItem(key)
51
+ },
52
+ setJSON (key, jsonValue) {
53
+ if (jsonValue != null) {
54
+ this.set(key, JSON.stringify(jsonValue))
55
+ }
56
+ },
57
+ getJSON (key) {
58
+ const value = this.get(key)
59
+ if (value != null) {
60
+ return JSON.parse(value)
61
+ }
62
+ },
63
+ remove (key) {
64
+ localStorage.removeItem(key);
65
+ }
66
+ }
67
+
68
+ export default {
69
+ /**
70
+ * 会话级缓存
71
+ */
72
+ session: sessionCache,
73
+ /**
74
+ * 本地缓存
75
+ */
76
+ local: localCache
77
+ }