ai-error-assistant-pro 0.0.1 → 0.0.3

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.
@@ -1,7 +1,8 @@
1
1
  import request from '../utils/request'
2
2
  import { fetchEventSource } from '@microsoft/fetch-event-source';
3
- const baseURL = sessionStorage.getItem('AI_BASE_URL_FOR_TEST') || 'https://zjyw.icve.com.cn/ai-api';
4
- const prefix = sessionStorage.getItem('AI_PRE_FIX_FOR_TEST') || '/heatp';
3
+ import constants from '../utils/constants';
4
+ const baseURL = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_BASE_URL') || constants.publicPath;
5
+ const prefix = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_PRE_FIX') || constants.publicPrefix;
5
6
  import cache from '../plugins/cache';
6
7
  export const ssoAuth = (token) => {
7
8
  return request({
@@ -96,7 +96,7 @@ export default {
96
96
  scrollToBottom() {
97
97
  this.$refs.chatContainer.scrollTop = this.$refs.chatContainer.scrollHeight;
98
98
  },
99
- async postMessage(list, commonKey) {
99
+ async postMessage(list, commonKey, parentMsgId) {
100
100
  let reanswerParams = {};
101
101
  if (list) {
102
102
  reanswerParams = {
@@ -114,13 +114,14 @@ export default {
114
114
  resId: this.resId,
115
115
  chatId: this.chatId || undefined,
116
116
  commonKey: commonKey || false,
117
+ parentMsgId: parentMsgId || undefined,
117
118
  ...reanswerParams,
118
119
  }
119
120
  ]
120
121
  };
121
122
  // list 存在说明是重新生成
122
123
  if (!list && !commonKey) {
123
- this.messageData.push({ type: 'user', message: this.keyWord });
124
+ this.messageData.push({ type: 'user', message: this.keyWord.replace(/\n/g, '<br>') });
124
125
  setTimeout(() => this.messageData.push(
125
126
  {
126
127
  type: 'robot',
@@ -145,7 +146,7 @@ export default {
145
146
  // 结束标识
146
147
  if (status === 2 || status === 1) {
147
148
  if (commonKey) {
148
- this.postMessage(list, commonKey);
149
+ this.postMessage(list, commonKey, parentMsgId);
149
150
  return;
150
151
  }
151
152
  currentList.finish = true;
@@ -190,7 +191,7 @@ export default {
190
191
  list[0].contents.reverse().map((list) => {
191
192
  const obj = {
192
193
  type: list.role === 'assistant' ? 'robot' : 'user',
193
- message: list.content,
194
+ message: list.content.replace(/\n/g, '<br>'),
194
195
  zan: list.type === 1,
195
196
  cai: list.type === 2,
196
197
  stop: list.status === 1,
@@ -2,9 +2,7 @@
2
2
  <div class="error-chat-contain">
3
3
  <div class="exercises-answer">
4
4
  <div class="exercises-answer-bg"></div>
5
- <p class="question-stem">
6
- {{ questionStem.title }}
7
- </p>
5
+ <p class="question-stem" v-html="questionStem.title"></p>
8
6
  <div class="answer-part" v-if="questionStem.type === 'single' || questionStem.type === 'multiple'">
9
7
  <div class="answer-list" v-for="(item, index) in questionStem.options" :key="index">
10
8
  <div class="check-content" style="width: 24px">
@@ -21,20 +19,21 @@
21
19
  v-if="questionStem.type === 'judge'">
22
20
  正确答案: <span style="margin-left: 8px">{{ questionStem.answer.join(',') }}</span>
23
21
  </div>
22
+ <!-- <div class="answer-part"-->
23
+ <!-- style="padding-bottom: 24px"-->
24
+ <!-- v-if="questionStem.type === 'gapfilling'">-->
25
+ <!-- 正确答案:-->
26
+ <!-- <span style="margin-left: 8px"-->
27
+ <!-- v-for="(item, index) in questionStem.answer"-->
28
+ <!-- :key="index">-->
29
+ <!-- {{ item }}<span v-if="index !== questionStem.answer.length - 1">,</span>-->
30
+ <!-- </span>-->
31
+ <!-- </div>-->
24
32
  <div class="answer-part"
25
33
  style="padding-bottom: 24px"
26
- v-if="questionStem.type === 'gapfilling'">
27
- 正确答案:
28
- <span style="margin-left: 8px"
29
- v-for="(item, index) in questionStem.answer"
30
- :key="index">
31
- {{ item }}<span v-if="index !== questionStem.answer.length - 1">,</span>
32
- </span>
33
- </div>
34
- <div class="answer-part"
35
- style="padding-bottom: 24px"
36
- v-if="questionStem.type === 'shortanswer'">
37
- 正确答案: <span style="margin-left: 8px">{{ questionStem.answer.join(',') }}</span>
34
+ v-if="questionStem.type === 'shortanswer' || questionStem.type === 'gapfilling'">
35
+ <span style="vertical-align: inherit; display: inline-block">正确答案:</span>
36
+ <span style="margin-left: 8px; display: inline-block; width: calc(100% - 82px); vertical-align: top;" v-html="questionStem.answer.join(',')"></span>
38
37
  </div>
39
38
  <div class="student-answer-part">
40
39
  <div class="check-content" style="width: 24px; margin-right: 16px">
@@ -50,14 +49,14 @@
50
49
  <div v-if="questionStem.type === 'judge'">
51
50
  <span style="margin-left: 8px">{{ questionStem.studentAnswer.join(',') }}</span>
52
51
  </div>
53
- <span style="margin-left: 8px"
54
- v-if="questionStem.type === 'gapfilling'"
55
- v-for="(item, index) in questionStem.studentAnswer"
56
- :key="index">
57
- {{ item }}<span v-if="index !== questionStem.studentAnswer.length - 1">,</span>
58
- </span>
59
- <div v-if="questionStem.type === 'shortanswer'">
60
- <span style="margin-left: 8px">{{ questionStem.studentAnswer.join(',') }}</span>
52
+ <!-- <span style="margin-left: 8px"-->
53
+ <!-- v-if="questionStem.type === 'gapfilling'"-->
54
+ <!-- v-for="(item, index) in questionStem.studentAnswer"-->
55
+ <!-- :key="index">-->
56
+ <!-- {{ item }}<span v-if="index !== questionStem.studentAnswer.length - 1">,</span>-->
57
+ <!-- </span>-->
58
+ <div v-if="questionStem.type === 'shortanswer' || questionStem.type === 'gapfilling'">
59
+ <span style="margin-left: 8px" v-html="questionStem.studentAnswer.join(',')"></span>
61
60
  </div>
62
61
  </div>
63
62
  </div>
@@ -23,7 +23,10 @@
23
23
  <span @click="clearChat">清空对话</span>
24
24
  </div>
25
25
  <div class="ai-message-send" @keyup.enter="goChat">
26
- <el-input v-model="aiMessage" placeholder="可以提出问题..." ></el-input>
26
+ <el-input v-model="aiMessage"
27
+ placeholder="可以提出问题..."
28
+ type="textarea"
29
+ :rows="2"></el-input>
27
30
  <div class="ai-send-icon" @click="goChat">
28
31
  <img src="../static/send-icon.png" alt="" style="width: 24px; height: 24px">
29
32
  </div>
@@ -81,7 +84,10 @@ export default {
81
84
  }
82
85
  this.$refs.chatRef.clearChat();
83
86
  },
84
- goChat() {
87
+ goChat(event) {
88
+ if (event.shiftKey) {
89
+ return;
90
+ }
85
91
  if (!this.stopMessage()) {
86
92
  return;
87
93
  }
@@ -204,17 +210,21 @@ export default {
204
210
  }
205
211
  :deep {
206
212
  .ai-message-send {
207
- .el-input__inner {
213
+ .el-textarea__inner {
208
214
  height: 60px;
209
215
  font-size: 16px;
216
+ resize: none;
210
217
  color: rgba(51,51,51,.75);
211
218
  border: 0;
212
219
  border-radius: 40px;
213
220
  background: linear-gradient(to bottom, #fff, #d8f0fb);
214
- padding: 0 24px;
221
+ padding: 8px 24px 0 24px;
215
222
  &::placeholder {
216
223
  color: rgba(51,51,51,.75);
217
224
  }
225
+ &::-webkit-scrollbar {
226
+ width: 0 !important; /* 针对 WebKit 浏览器 */
227
+ }
218
228
  }
219
229
  }
220
230
  }
@@ -10,4 +10,6 @@ export default {
10
10
  'X-App-Secret': 'bc11ce7c44824fcaa23ff301a54b7094',
11
11
  appId,
12
12
  whiteList,
13
+ publicPath: 'https://agent.icve.com.cn/heatp-portal/do/',
14
+ publicPrefix: '/heatp'
13
15
  };
@@ -1,14 +1,15 @@
1
1
  import axios from 'axios'
2
2
  import cache from '../plugins/cache'
3
3
  import { Message } from 'element-ui'
4
- const door = sessionStorage.getItem('AI_BASE_URL_FOR_TEST');
4
+ const door = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_BASE_URL');
5
5
  import { decrypt } from './aes-utils';
6
+ import constants from '../utils/constants';
6
7
 
7
8
  axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
8
9
 
9
10
  const service = axios.create({
10
11
  // axios中请求配置有baseURL选项,表示请求URL公共部分
11
- baseURL: door || 'https://zjyw.icve.com.cn/ai-api',
12
+ baseURL: door || constants.publicPath,
12
13
  // 超时
13
14
  timeout: 80000
14
15
  })
@@ -6546,7 +6546,7 @@ if (typeof window !== 'undefined') {
6546
6546
  // Indicate to webpack that this file can be concatenated
6547
6547
  /* harmony default export */ var setPublicPath = (null);
6548
6548
 
6549
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=template&id=019f6616&scoped=true
6549
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=template&id=98bac9ca&scoped=true
6550
6550
  var render = function render() {
6551
6551
  var _vm = this,
6552
6552
  _c = _vm._self._c;
@@ -6593,7 +6593,9 @@ var render = function render() {
6593
6593
  }
6594
6594
  }, [_c('el-input', {
6595
6595
  attrs: {
6596
- "placeholder": "可以提出问题..."
6596
+ "placeholder": "可以提出问题...",
6597
+ "type": "textarea",
6598
+ "rows": 2
6597
6599
  },
6598
6600
  model: {
6599
6601
  value: _vm.aiMessage,
@@ -6639,10 +6641,10 @@ var staticRenderFns = [function () {
6639
6641
  }, [_vm._v("智能解析")])]);
6640
6642
  }];
6641
6643
 
6642
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=019f6616&scoped=true
6644
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=98bac9ca&scoped=true
6643
6645
 
6644
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat.vue?vue&type=template&id=3ed5ec0e&scoped=true
6645
- var chatvue_type_template_id_3ed5ec0e_scoped_true_render = function render() {
6646
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat.vue?vue&type=template&id=311af3d2&scoped=true
6647
+ var chatvue_type_template_id_311af3d2_scoped_true_render = function render() {
6646
6648
  var _vm = this,
6647
6649
  _c = _vm._self._c;
6648
6650
  return _c('div', {
@@ -6704,7 +6706,7 @@ var chatvue_type_template_id_3ed5ec0e_scoped_true_render = function render() {
6704
6706
  }) : _vm._e()], 1)]);
6705
6707
  })], 2);
6706
6708
  };
6707
- var chatvue_type_template_id_3ed5ec0e_scoped_true_staticRenderFns = [];
6709
+ var chatvue_type_template_id_311af3d2_scoped_true_staticRenderFns = [];
6708
6710
 
6709
6711
  ;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/bind.js
6710
6712
 
@@ -10492,16 +10494,32 @@ function decrypt(word) {
10492
10494
  let decryptedStr = decrypt.toString((crypto_js_default()).enc.Utf8);
10493
10495
  return decryptedStr.toString();
10494
10496
  }
10497
+ ;// CONCATENATED MODULE: ./components/demo/utils/constants.js
10498
+ let appId = '601a39a2a4a7cd88d5ddcef5';
10499
+ const whiteList = ['/home', '/overview'];
10500
+ if (({"NODE_ENV":"production","BASE_URL":""}).VITE_APP_BUILD_TYPE === 'aliyun') {
10501
+ appId = '6572ba195ec962924cc39951';
10502
+ }
10503
+ /* harmony default export */ var constants = ({
10504
+ 'X-Enterprise-Id': 'www.hep-zj.com.cn',
10505
+ 'X-App-Id': '90403a27c0704259ab7a3c8aab4489b3',
10506
+ 'X-App-Secret': 'bc11ce7c44824fcaa23ff301a54b7094',
10507
+ appId,
10508
+ whiteList,
10509
+ publicPath: 'https://agent.icve.com.cn/heatp-portal/do/',
10510
+ publicPrefix: '/heatp'
10511
+ });
10495
10512
  ;// CONCATENATED MODULE: ./components/demo/utils/request.js
10496
10513
 
10497
10514
 
10498
10515
 
10499
- const door = sessionStorage.getItem('AI_BASE_URL_FOR_TEST');
10516
+ const door = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_BASE_URL');
10517
+
10500
10518
 
10501
10519
  lib_axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
10502
10520
  const service = lib_axios.create({
10503
10521
  // axios中请求配置有baseURL选项,表示请求URL公共部分
10504
- baseURL: door || 'https://zjyw.icve.com.cn/ai-api',
10522
+ baseURL: door || constants.publicPath,
10505
10523
  // 超时
10506
10524
  timeout: 80000
10507
10525
  });
@@ -10760,8 +10778,9 @@ function defaultOnOpen(response) {
10760
10778
  ;// CONCATENATED MODULE: ./components/demo/api/index.js
10761
10779
 
10762
10780
 
10763
- const baseURL = sessionStorage.getItem('AI_BASE_URL_FOR_TEST') || 'https://zjyw.icve.com.cn/ai-api';
10764
- const prefix = sessionStorage.getItem('AI_PRE_FIX_FOR_TEST') || '/heatp';
10781
+
10782
+ const baseURL = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_BASE_URL') || constants.publicPath;
10783
+ const prefix = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_PRE_FIX') || constants.publicPrefix;
10765
10784
 
10766
10785
  const ssoAuth = token => {
10767
10786
  return request({
@@ -10834,19 +10853,6 @@ async function sendMessageEventSource(params, signal, onmessage) {
10834
10853
  onmessage
10835
10854
  });
10836
10855
  }
10837
- ;// CONCATENATED MODULE: ./components/demo/utils/constants.js
10838
- let appId = '601a39a2a4a7cd88d5ddcef5';
10839
- const whiteList = ['/home', '/overview'];
10840
- if (({"NODE_ENV":"production","BASE_URL":""}).VITE_APP_BUILD_TYPE === 'aliyun') {
10841
- appId = '6572ba195ec962924cc39951';
10842
- }
10843
- /* harmony default export */ var constants = ({
10844
- 'X-Enterprise-Id': 'www.hep-zj.com.cn',
10845
- 'X-App-Id': '90403a27c0704259ab7a3c8aab4489b3',
10846
- 'X-App-Secret': 'bc11ce7c44824fcaa23ff301a54b7094',
10847
- appId,
10848
- whiteList
10849
- });
10850
10856
  ;// CONCATENATED MODULE: ./components/demo/utils/config.js
10851
10857
 
10852
10858
 
@@ -11302,8 +11308,8 @@ var component = normalizeComponent(
11302
11308
  )
11303
11309
 
11304
11310
  /* harmony default export */ var chat_tools = (component.exports);
11305
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/error-chat.vue?vue&type=template&id=2fd7df27&scoped=true
11306
- var error_chatvue_type_template_id_2fd7df27_scoped_true_render = function render() {
11311
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/error-chat.vue?vue&type=template&id=1eee0b32&scoped=true
11312
+ var error_chatvue_type_template_id_1eee0b32_scoped_true_render = function render() {
11307
11313
  var _vm = this,
11308
11314
  _c = _vm._self._c;
11309
11315
  return _c('div', {
@@ -11313,8 +11319,11 @@ var error_chatvue_type_template_id_2fd7df27_scoped_true_render = function render
11313
11319
  }, [_c('div', {
11314
11320
  staticClass: "exercises-answer-bg"
11315
11321
  }), _c('p', {
11316
- staticClass: "question-stem"
11317
- }, [_vm._v(" " + _vm._s(_vm.questionStem.title) + " ")]), _vm.questionStem.type === 'single' || _vm.questionStem.type === 'multiple' ? _c('div', {
11322
+ staticClass: "question-stem",
11323
+ domProps: {
11324
+ "innerHTML": _vm._s(_vm.questionStem.title)
11325
+ }
11326
+ }), _vm.questionStem.type === 'single' || _vm.questionStem.type === 'multiple' ? _c('div', {
11318
11327
  staticClass: "answer-part"
11319
11328
  }, _vm._l(_vm.questionStem.options, function (item, index) {
11320
11329
  return _c('div', {
@@ -11345,28 +11354,27 @@ var error_chatvue_type_template_id_2fd7df27_scoped_true_render = function render
11345
11354
  staticStyle: {
11346
11355
  "margin-left": "8px"
11347
11356
  }
11348
- }, [_vm._v(_vm._s(_vm.questionStem.answer.join(',')))])]) : _vm._e(), _vm.questionStem.type === 'gapfilling' ? _c('div', {
11357
+ }, [_vm._v(_vm._s(_vm.questionStem.answer.join(',')))])]) : _vm._e(), _vm.questionStem.type === 'shortanswer' || _vm.questionStem.type === 'gapfilling' ? _c('div', {
11349
11358
  staticClass: "answer-part",
11350
11359
  staticStyle: {
11351
11360
  "padding-bottom": "24px"
11352
11361
  }
11353
- }, [_vm._v(" 正确答案: "), _vm._l(_vm.questionStem.answer, function (item, index) {
11354
- return _c('span', {
11355
- key: index,
11356
- staticStyle: {
11357
- "margin-left": "8px"
11358
- }
11359
- }, [_vm._v(" " + _vm._s(item)), index !== _vm.questionStem.answer.length - 1 ? _c('span', [_vm._v(",")]) : _vm._e()]);
11360
- })], 2) : _vm._e(), _vm.questionStem.type === 'shortanswer' ? _c('div', {
11361
- staticClass: "answer-part",
11362
+ }, [_c('span', {
11362
11363
  staticStyle: {
11363
- "padding-bottom": "24px"
11364
+ "vertical-align": "inherit",
11365
+ "display": "inline-block"
11364
11366
  }
11365
- }, [_vm._v(" 正确答案: "), _c('span', {
11367
+ }, [_vm._v("正确答案:")]), _c('span', {
11366
11368
  staticStyle: {
11367
- "margin-left": "8px"
11369
+ "margin-left": "8px",
11370
+ "display": "inline-block",
11371
+ "width": "calc(100% - 82px)",
11372
+ "vertical-align": "top"
11373
+ },
11374
+ domProps: {
11375
+ "innerHTML": _vm._s(_vm.questionStem.answer.join(','))
11368
11376
  }
11369
- }, [_vm._v(_vm._s(_vm.questionStem.answer.join(',')))])]) : _vm._e(), _c('div', {
11377
+ })]) : _vm._e(), _c('div', {
11370
11378
  staticClass: "student-answer-part"
11371
11379
  }, [_vm._m(0), _vm.questionStem.type === 'single' || _vm.questionStem.type === 'multiple' ? _c('div', _vm._l(_vm.questionStem.studentAnswer, function (item, index) {
11372
11380
  return _c('span', {
@@ -11379,18 +11387,14 @@ var error_chatvue_type_template_id_2fd7df27_scoped_true_render = function render
11379
11387
  staticStyle: {
11380
11388
  "margin-left": "8px"
11381
11389
  }
11382
- }, [_vm._v(_vm._s(_vm.questionStem.studentAnswer.join(',')))])]) : _vm._e(), _vm._l(_vm.questionStem.studentAnswer, function (item, index) {
11383
- return _vm.questionStem.type === 'gapfilling' ? _c('span', {
11384
- key: index,
11385
- staticStyle: {
11386
- "margin-left": "8px"
11387
- }
11388
- }, [_vm._v(" " + _vm._s(item)), index !== _vm.questionStem.studentAnswer.length - 1 ? _c('span', [_vm._v(",")]) : _vm._e()]) : _vm._e();
11389
- }), _vm.questionStem.type === 'shortanswer' ? _c('div', [_c('span', {
11390
+ }, [_vm._v(_vm._s(_vm.questionStem.studentAnswer.join(',')))])]) : _vm._e(), _vm.questionStem.type === 'shortanswer' || _vm.questionStem.type === 'gapfilling' ? _c('div', [_c('span', {
11390
11391
  staticStyle: {
11391
11392
  "margin-left": "8px"
11393
+ },
11394
+ domProps: {
11395
+ "innerHTML": _vm._s(_vm.questionStem.studentAnswer.join(','))
11392
11396
  }
11393
- }, [_vm._v(_vm._s(_vm.questionStem.studentAnswer.join(',')))])]) : _vm._e()], 2)]), _c('div', {
11397
+ })]) : _vm._e()])]), _c('div', {
11394
11398
  directives: [{
11395
11399
  name: "loading",
11396
11400
  rawName: "v-loading",
@@ -11442,7 +11446,7 @@ var error_chatvue_type_template_id_2fd7df27_scoped_true_render = function render
11442
11446
  }
11443
11447
  })], 1)]);
11444
11448
  };
11445
- var error_chatvue_type_template_id_2fd7df27_scoped_true_staticRenderFns = [function () {
11449
+ var error_chatvue_type_template_id_1eee0b32_scoped_true_staticRenderFns = [function () {
11446
11450
  var _vm = this,
11447
11451
  _c = _vm._self._c;
11448
11452
  return _c('div', {
@@ -11461,7 +11465,7 @@ var error_chatvue_type_template_id_2fd7df27_scoped_true_staticRenderFns = [funct
11461
11465
  })]);
11462
11466
  }];
11463
11467
 
11464
- ;// CONCATENATED MODULE: ./components/demo/src/error-chat.vue?vue&type=template&id=2fd7df27&scoped=true
11468
+ ;// CONCATENATED MODULE: ./components/demo/src/error-chat.vue?vue&type=template&id=1eee0b32&scoped=true
11465
11469
 
11466
11470
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/error-chat.vue?vue&type=script&lang=js
11467
11471
 
@@ -11576,10 +11580,10 @@ var error_chatvue_type_template_id_2fd7df27_scoped_true_staticRenderFns = [funct
11576
11580
  });
11577
11581
  ;// CONCATENATED MODULE: ./components/demo/src/error-chat.vue?vue&type=script&lang=js
11578
11582
  /* harmony default export */ var src_error_chatvue_type_script_lang_js = (error_chatvue_type_script_lang_js);
11579
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/error-chat.vue?vue&type=style&index=0&id=2fd7df27&prod&lang=scss&scoped=true
11583
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/error-chat.vue?vue&type=style&index=0&id=1eee0b32&prod&lang=scss&scoped=true
11580
11584
  // extracted by mini-css-extract-plugin
11581
11585
 
11582
- ;// CONCATENATED MODULE: ./components/demo/src/error-chat.vue?vue&type=style&index=0&id=2fd7df27&prod&lang=scss&scoped=true
11586
+ ;// CONCATENATED MODULE: ./components/demo/src/error-chat.vue?vue&type=style&index=0&id=1eee0b32&prod&lang=scss&scoped=true
11583
11587
 
11584
11588
  ;// CONCATENATED MODULE: ./components/demo/src/error-chat.vue
11585
11589
 
@@ -11592,11 +11596,11 @@ var error_chatvue_type_template_id_2fd7df27_scoped_true_staticRenderFns = [funct
11592
11596
 
11593
11597
  var error_chat_component = normalizeComponent(
11594
11598
  src_error_chatvue_type_script_lang_js,
11595
- error_chatvue_type_template_id_2fd7df27_scoped_true_render,
11596
- error_chatvue_type_template_id_2fd7df27_scoped_true_staticRenderFns,
11599
+ error_chatvue_type_template_id_1eee0b32_scoped_true_render,
11600
+ error_chatvue_type_template_id_1eee0b32_scoped_true_staticRenderFns,
11597
11601
  false,
11598
11602
  null,
11599
- "2fd7df27",
11603
+ "1eee0b32",
11600
11604
  null
11601
11605
 
11602
11606
  )
@@ -11668,7 +11672,7 @@ const signal = controller.signal;
11668
11672
  scrollToBottom() {
11669
11673
  this.$refs.chatContainer.scrollTop = this.$refs.chatContainer.scrollHeight;
11670
11674
  },
11671
- async postMessage(list, commonKey) {
11675
+ async postMessage(list, commonKey, parentMsgId) {
11672
11676
  let reanswerParams = {};
11673
11677
  if (list) {
11674
11678
  reanswerParams = {
@@ -11685,6 +11689,7 @@ const signal = controller.signal;
11685
11689
  resId: this.resId,
11686
11690
  chatId: this.chatId || undefined,
11687
11691
  commonKey: commonKey || false,
11692
+ parentMsgId: parentMsgId || undefined,
11688
11693
  ...reanswerParams
11689
11694
  }]
11690
11695
  };
@@ -11692,7 +11697,7 @@ const signal = controller.signal;
11692
11697
  if (!list && !commonKey) {
11693
11698
  this.messageData.push({
11694
11699
  type: 'user',
11695
- message: this.keyWord
11700
+ message: this.keyWord.replace(/\n/g, '<br>')
11696
11701
  });
11697
11702
  setTimeout(() => this.messageData.push({
11698
11703
  type: 'robot',
@@ -11724,7 +11729,7 @@ const signal = controller.signal;
11724
11729
  // 结束标识
11725
11730
  if (status === 2 || status === 1) {
11726
11731
  if (commonKey) {
11727
- this.postMessage(list, commonKey);
11732
+ this.postMessage(list, commonKey, parentMsgId);
11728
11733
  return;
11729
11734
  }
11730
11735
  currentList.finish = true;
@@ -11769,7 +11774,7 @@ const signal = controller.signal;
11769
11774
  list[0].contents.reverse().map(list => {
11770
11775
  const obj = {
11771
11776
  type: list.role === 'assistant' ? 'robot' : 'user',
11772
- message: list.content,
11777
+ message: list.content.replace(/\n/g, '<br>'),
11773
11778
  zan: list.type === 1,
11774
11779
  cai: list.type === 2,
11775
11780
  stop: list.status === 1,
@@ -11791,10 +11796,10 @@ const signal = controller.signal;
11791
11796
  });
11792
11797
  ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=script&lang=js
11793
11798
  /* harmony default export */ var src_chatvue_type_script_lang_js = (chatvue_type_script_lang_js);
11794
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat.vue?vue&type=style&index=0&id=3ed5ec0e&prod&lang=scss&scoped=true
11799
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat.vue?vue&type=style&index=0&id=311af3d2&prod&lang=scss&scoped=true
11795
11800
  // extracted by mini-css-extract-plugin
11796
11801
 
11797
- ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=style&index=0&id=3ed5ec0e&prod&lang=scss&scoped=true
11802
+ ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=style&index=0&id=311af3d2&prod&lang=scss&scoped=true
11798
11803
 
11799
11804
  ;// CONCATENATED MODULE: ./components/demo/src/chat.vue
11800
11805
 
@@ -11807,11 +11812,11 @@ const signal = controller.signal;
11807
11812
 
11808
11813
  var chat_component = normalizeComponent(
11809
11814
  src_chatvue_type_script_lang_js,
11810
- chatvue_type_template_id_3ed5ec0e_scoped_true_render,
11811
- chatvue_type_template_id_3ed5ec0e_scoped_true_staticRenderFns,
11815
+ chatvue_type_template_id_311af3d2_scoped_true_render,
11816
+ chatvue_type_template_id_311af3d2_scoped_true_staticRenderFns,
11812
11817
  false,
11813
11818
  null,
11814
- "3ed5ec0e",
11819
+ "311af3d2",
11815
11820
  null
11816
11821
 
11817
11822
  )
@@ -11982,7 +11987,10 @@ var api = init(defaultConverter, {
11982
11987
  }
11983
11988
  this.$refs.chatRef.clearChat();
11984
11989
  },
11985
- goChat() {
11990
+ goChat(event) {
11991
+ if (event.shiftKey) {
11992
+ return;
11993
+ }
11986
11994
  if (!this.stopMessage()) {
11987
11995
  return;
11988
11996
  }
@@ -12006,10 +12014,10 @@ var api = init(defaultConverter, {
12006
12014
  });
12007
12015
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=script&lang=js
12008
12016
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
12009
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=style&index=0&id=019f6616&prod&lang=scss&scoped=true
12017
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=style&index=0&id=98bac9ca&prod&lang=scss&scoped=true
12010
12018
  // extracted by mini-css-extract-plugin
12011
12019
 
12012
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=019f6616&prod&lang=scss&scoped=true
12020
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=98bac9ca&prod&lang=scss&scoped=true
12013
12021
 
12014
12022
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue
12015
12023
 
@@ -12026,7 +12034,7 @@ var main_component = normalizeComponent(
12026
12034
  staticRenderFns,
12027
12035
  false,
12028
12036
  null,
12029
- "019f6616",
12037
+ "98bac9ca",
12030
12038
  null
12031
12039
 
12032
12040
  )