ai-assistant-pro 0.0.7 → 0.0.8

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.
@@ -7446,7 +7446,7 @@ if (typeof window !== 'undefined') {
7446
7446
  // Indicate to webpack that this file can be concatenated
7447
7447
  /* harmony default export */ var setPublicPath = (null);
7448
7448
 
7449
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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=7a9bc48c&scoped=true
7449
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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=77093a83&scoped=true
7450
7450
  var render = function render() {
7451
7451
  var _vm = this,
7452
7452
  _c = _vm._self._c;
@@ -7482,6 +7482,9 @@ var render = function render() {
7482
7482
  })])]), _vm.courseFlag ? [_c('div', {
7483
7483
  staticClass: "ai-main-content"
7484
7484
  }, [!_vm.chatShow ? _c('hot-search', {
7485
+ attrs: {
7486
+ "resId": _vm.resId
7487
+ },
7485
7488
  on: {
7486
7489
  "select-module": _vm.selectModule
7487
7490
  }
@@ -7489,6 +7492,7 @@ var render = function render() {
7489
7492
  ref: "chatRef",
7490
7493
  attrs: {
7491
7494
  "resId": _vm.resId,
7495
+ "open-course-id": _vm.openCourseId,
7492
7496
  "chatId": _vm.chatId,
7493
7497
  "key-word": _vm.aiMessageKeyWord,
7494
7498
  "message-data": _vm.messageList,
@@ -7553,237 +7557,41 @@ var render = function render() {
7553
7557
  };
7554
7558
  var staticRenderFns = [];
7555
7559
 
7556
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=7a9bc48c&scoped=true
7560
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=77093a83&scoped=true
7557
7561
 
7558
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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/hot-search.vue?vue&type=template&id=73bfe44c&scoped=true
7559
- var hot_searchvue_type_template_id_73bfe44c_scoped_true_render = function render() {
7562
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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/hot-search.vue?vue&type=template&id=abf2ffc4&scoped=true
7563
+ var hot_searchvue_type_template_id_abf2ffc4_scoped_true_render = function render() {
7560
7564
  var _vm = this,
7561
7565
  _c = _vm._self._c;
7562
- return _vm._m(0);
7566
+ return _c('div', {
7567
+ staticClass: "hot-search-contain"
7568
+ }, [_vm._m(0), _c('div', {
7569
+ staticClass: "robot-message"
7570
+ }, [_vm.prologue ? [_vm._v(" " + _vm._s(_vm.prologue) + " ")] : [_c('p', [_vm._v("Hi,我是学习助手。")]), _c('p', [_vm._v("在这里你可以获得专业、准确的课程讲解,包括对公式的深入理解和细腻的解答。")])], _vm._l(_vm.aiMessage, function (list, index) {
7571
+ return _c('div', {
7572
+ key: index,
7573
+ staticClass: "hot-list",
7574
+ on: {
7575
+ "click": function ($event) {
7576
+ return _vm.selectModule(list);
7577
+ }
7578
+ }
7579
+ }, [_vm._v(" " + _vm._s(list) + " "), _c('i', {
7580
+ staticClass: "el-icon-arrow-right go-icon"
7581
+ })]);
7582
+ })], 2)]);
7563
7583
  };
7564
- var hot_searchvue_type_template_id_73bfe44c_scoped_true_staticRenderFns = [function () {
7584
+ var hot_searchvue_type_template_id_abf2ffc4_scoped_true_staticRenderFns = [function () {
7565
7585
  var _vm = this,
7566
7586
  _c = _vm._self._c;
7567
7587
  return _c('div', {
7568
- staticClass: "hot-search-contain"
7569
- }, [_c('div', {
7570
7588
  staticClass: "robot"
7571
7589
  }, [_c('div', {
7572
7590
  staticClass: "robot-image-div"
7573
- })]), _c('div', {
7574
- staticClass: "robot-message"
7575
- }, [_c('p', [_vm._v("Hi,我是学习助手。")]), _c('p', [_vm._v("在这里你可以获得专业、准确的课程讲解,包括对公式的深入理解和细腻的解答。")])])]);
7591
+ })]);
7576
7592
  }];
7577
7593
 
7578
- ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=template&id=73bfe44c&scoped=true
7579
-
7580
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/hot-search.vue?vue&type=script&lang=js
7581
- /* harmony default export */ var hot_searchvue_type_script_lang_js = ({
7582
- name: 'HotSearch',
7583
- data() {
7584
- return {
7585
- aiMessage: [{
7586
- value: '请解释一下牛顿第二定律的公式和物理意义。',
7587
- id: 1
7588
- }, {
7589
- value: '电磁感应定律是如何描述的?请给出相关公式并解释。',
7590
- id: 2
7591
- }, {
7592
- value: '在光学中,光的干涉现象是如何产生的?能否用公式来表示?',
7593
- id: 3
7594
- }]
7595
- };
7596
- },
7597
- methods: {
7598
- selectModule(list) {
7599
- this.$emit('select-module', list);
7600
- }
7601
- }
7602
- });
7603
- ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=script&lang=js
7604
- /* harmony default export */ var src_hot_searchvue_type_script_lang_js = (hot_searchvue_type_script_lang_js);
7605
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/hot-search.vue?vue&type=style&index=0&id=73bfe44c&prod&lang=scss&scoped=true
7606
- // extracted by mini-css-extract-plugin
7607
-
7608
- ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=style&index=0&id=73bfe44c&prod&lang=scss&scoped=true
7609
-
7610
- ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
7611
- /* globals __VUE_SSR_CONTEXT__ */
7612
-
7613
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
7614
- // This module is a runtime utility for cleaner component module output and will
7615
- // be included in the final webpack user bundle.
7616
-
7617
- function normalizeComponent(
7618
- scriptExports,
7619
- render,
7620
- staticRenderFns,
7621
- functionalTemplate,
7622
- injectStyles,
7623
- scopeId,
7624
- moduleIdentifier /* server only */,
7625
- shadowMode /* vue-cli only */
7626
- ) {
7627
- // Vue.extend constructor export interop
7628
- var options =
7629
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
7630
-
7631
- // render functions
7632
- if (render) {
7633
- options.render = render
7634
- options.staticRenderFns = staticRenderFns
7635
- options._compiled = true
7636
- }
7637
-
7638
- // functional template
7639
- if (functionalTemplate) {
7640
- options.functional = true
7641
- }
7642
-
7643
- // scopedId
7644
- if (scopeId) {
7645
- options._scopeId = 'data-v-' + scopeId
7646
- }
7647
-
7648
- var hook
7649
- if (moduleIdentifier) {
7650
- // server build
7651
- hook = function (context) {
7652
- // 2.3 injection
7653
- context =
7654
- context || // cached call
7655
- (this.$vnode && this.$vnode.ssrContext) || // stateful
7656
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
7657
- // 2.2 with runInNewContext: true
7658
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
7659
- context = __VUE_SSR_CONTEXT__
7660
- }
7661
- // inject component styles
7662
- if (injectStyles) {
7663
- injectStyles.call(this, context)
7664
- }
7665
- // register component module identifier for async chunk inferrence
7666
- if (context && context._registeredComponents) {
7667
- context._registeredComponents.add(moduleIdentifier)
7668
- }
7669
- }
7670
- // used by ssr in case component is cached and beforeCreate
7671
- // never gets called
7672
- options._ssrRegister = hook
7673
- } else if (injectStyles) {
7674
- hook = shadowMode
7675
- ? function () {
7676
- injectStyles.call(
7677
- this,
7678
- (options.functional ? this.parent : this).$root.$options.shadowRoot
7679
- )
7680
- }
7681
- : injectStyles
7682
- }
7683
-
7684
- if (hook) {
7685
- if (options.functional) {
7686
- // for template-only hot-reload because in that case the render fn doesn't
7687
- // go through the normalizer
7688
- options._injectStyles = hook
7689
- // register for functional component in vue file
7690
- var originalRender = options.render
7691
- options.render = function renderWithStyleInjection(h, context) {
7692
- hook.call(context)
7693
- return originalRender(h, context)
7694
- }
7695
- } else {
7696
- // inject component registration as beforeCreate hook
7697
- var existing = options.beforeCreate
7698
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
7699
- }
7700
- }
7701
-
7702
- return {
7703
- exports: scriptExports,
7704
- options: options
7705
- }
7706
- }
7707
-
7708
- ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue
7709
-
7710
-
7711
-
7712
- ;
7713
-
7714
-
7715
- /* normalize component */
7716
-
7717
- var component = normalizeComponent(
7718
- src_hot_searchvue_type_script_lang_js,
7719
- hot_searchvue_type_template_id_73bfe44c_scoped_true_render,
7720
- hot_searchvue_type_template_id_73bfe44c_scoped_true_staticRenderFns,
7721
- false,
7722
- null,
7723
- "73bfe44c",
7724
- null
7725
-
7726
- )
7727
-
7728
- /* harmony default export */ var hot_search = (component.exports);
7729
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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=1abfa6ce&scoped=true
7730
- var chatvue_type_template_id_1abfa6ce_scoped_true_render = function render() {
7731
- var _vm = this,
7732
- _c = _vm._self._c;
7733
- return _c('div', {
7734
- ref: "chatContainer",
7735
- staticClass: "chat-contain"
7736
- }, _vm._l(_vm.messageData, function (list, index) {
7737
- return _c('div', {
7738
- key: index,
7739
- staticClass: "message",
7740
- class: {
7741
- 'user-list': list.type === 'user'
7742
- }
7743
- }, [list.type === 'robot' ? _c('div', {
7744
- staticClass: "robot"
7745
- }, [_c('div', {
7746
- staticClass: "robot-image-div"
7747
- })]) : _c('div', {
7748
- staticClass: "robot user"
7749
- }, [_vm._v("user")]), _c('div', {
7750
- staticClass: "robot-message",
7751
- class: {
7752
- 'user-info': list.type === 'user'
7753
- }
7754
- }, [_c('div', {
7755
- domProps: {
7756
- "innerHTML": _vm._s(list.message)
7757
- }
7758
- }), list.type === 'robot' && list.links.length > 0 ? _c('div', {
7759
- staticClass: "link"
7760
- }, [_c('div', {
7761
- staticClass: "link-title"
7762
- }, [_vm._v("相关链接")]), _c('div', {
7763
- staticClass: "link-content"
7764
- }, [_vm._l(list.links, function (item) {
7765
- return [!item.title.startsWith(_vm.chatMajorId) ? _c('div', {
7766
- staticClass: "links"
7767
- }, [_c('a', {
7768
- attrs: {
7769
- "href": 'https://ai-yuliao.hep.com.cn' + item.documentUrl,
7770
- "target": "_blank"
7771
- }
7772
- }, [_c('span', [_vm._v(_vm._s(item.title))])])]) : _vm._e()];
7773
- })], 2)]) : _vm._e(), list.type === 'robot' ? _c('chat-tools', {
7774
- attrs: {
7775
- "chatId": _vm.chatId,
7776
- "detail-data": list,
7777
- "sending": list.sending
7778
- },
7779
- on: {
7780
- "on-reanswer": list => _vm.reanswer(list, index),
7781
- "on-stop-chat": _vm.onStopChat
7782
- }
7783
- }) : _vm._e()], 1)]);
7784
- }), 0);
7785
- };
7786
- var chatvue_type_template_id_1abfa6ce_scoped_true_staticRenderFns = [];
7594
+ ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=template&id=abf2ffc4&scoped=true
7787
7595
 
7788
7596
  ;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/bind.js
7789
7597
 
@@ -12178,17 +11986,17 @@ const iv = crypto_js_default().enc.Utf8.parse(n);
12178
11986
  // 解密方法
12179
11987
  function decrypt(word) {
12180
11988
  const stringToEncode = 'Hello, World!'; // 要进行 Base64 编码的字符串
12181
- const encodedString = gBase64.encode(stringToEncode); // 进行 Base64 编码
12182
- const decodedString = gBase64.decode(encodedString); // 进行 Base64 解码
11989
+ const encodedString = Base64.encode(stringToEncode); // 进行 Base64 编码
11990
+ const decodedString = Base64.decode(encodedString); // 进行 Base64 解码
12183
11991
 
12184
- let base64 = crypto_js_default().enc.Base64.parse(word);
12185
- let src = crypto_js_default().enc.Base64.stringify(base64);
12186
- let decrypt = crypto_js_default().AES.decrypt(src, key, {
11992
+ let base64 = CryptoJS.enc.Base64.parse(word);
11993
+ let src = CryptoJS.enc.Base64.stringify(base64);
11994
+ let decrypt = CryptoJS.AES.decrypt(src, key, {
12187
11995
  iv: iv,
12188
- mode: (crypto_js_default()).mode.CBC,
12189
- padding: (crypto_js_default()).pad.Pkcs7
11996
+ mode: CryptoJS.mode.CBC,
11997
+ padding: CryptoJS.pad.Pkcs7
12190
11998
  });
12191
- let decryptedStr = decrypt.toString((crypto_js_default()).enc.Utf8);
11999
+ let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
12192
12000
  return decryptedStr.toString();
12193
12001
  }
12194
12002
  ;// CONCATENATED MODULE: ./components/demo/utils/constants.js
@@ -12222,7 +12030,9 @@ const service = lib_axios.create({
12222
12030
  });
12223
12031
  service.interceptors.request.use(config => {
12224
12032
  if (cache.session.getJSON('SRKJ_TOKEN_CACHE')) {
12225
- config.headers["X-Id-Token"] = cache.session.getJSON('SRKJ_TOKEN_CACHE');
12033
+ // config.headers["X-Id-Token"] = cache.session.getJSON('SRKJ_TOKEN_CACHE');
12034
+ if (!config.params) config.params = {};
12035
+ config.params.token = cache.session.getJSON('SRKJ_TOKEN_CACHE');
12226
12036
  }
12227
12037
  // 是否需要防止数据重复提交
12228
12038
  const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
@@ -12255,12 +12065,12 @@ service.interceptors.response.use(res => {
12255
12065
  return res.data;
12256
12066
  }
12257
12067
  let srkjData = res.data;
12258
- if (srkjData) {
12259
- const respData = decrypt(srkjData);
12260
- try {
12261
- srkjData = JSON.parse(respData);
12262
- } catch (e) {}
12263
- }
12068
+ // if (srkjData) {
12069
+ // const respData = decrypt(srkjData);
12070
+ // try {
12071
+ // srkjData = JSON.parse(respData);
12072
+ // } catch (e) {}
12073
+ // }
12264
12074
  if (res.status === 401) {
12265
12075
  external_element_ui_.Message.warning(srkjData.message.description);
12266
12076
  return;
@@ -12270,7 +12080,7 @@ service.interceptors.response.use(res => {
12270
12080
  }
12271
12081
  return srkjData.queryData || srkjData.data || srkjData.token;
12272
12082
  });
12273
- /* harmony default export */ var request = (service);
12083
+ /* harmony default export */ var utils_request = (service);
12274
12084
  ;// CONCATENATED MODULE: ./node_modules/@microsoft/fetch-event-source/lib/esm/parse.js
12275
12085
  async function getBytes(stream, onChunk) {
12276
12086
  const reader = stream.getReader();
@@ -12477,10 +12287,12 @@ function defaultOnOpen(response) {
12477
12287
 
12478
12288
 
12479
12289
  const baseURL = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_BASE_URL') || constants.publicPath;
12480
- const prefix = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_PRE_FIX') || constants.publicPrefix;
12290
+ let prefix = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_PRE_FIX') || constants.publicPrefix;
12291
+ // 0.0.8 版本接口升级
12292
+ prefix += '/plugin/v2';
12481
12293
 
12482
12294
  const ssoAuth = token => {
12483
- return request({
12295
+ return utils_request({
12484
12296
  url: prefix + '/sso/assistant',
12485
12297
  method: 'get',
12486
12298
  params: {
@@ -12496,7 +12308,7 @@ const authUser = headers => {
12496
12308
  });
12497
12309
  };
12498
12310
  const newChat = resId => {
12499
- return request({
12311
+ return utils_request({
12500
12312
  url: prefix + '/assistant/addChat',
12501
12313
  method: 'post',
12502
12314
  params: {
@@ -12505,46 +12317,46 @@ const newChat = resId => {
12505
12317
  });
12506
12318
  };
12507
12319
  const chartClear = chatId => {
12508
- return request({
12320
+ return utils_request({
12509
12321
  url: prefix + `/assistant/chartClear/${chatId}`,
12510
12322
  method: 'post'
12511
12323
  });
12512
12324
  };
12513
12325
  const stopChat = chatId => {
12514
- return request({
12326
+ return utils_request({
12515
12327
  url: prefix + `/assistant/stop/${chatId}`,
12516
12328
  method: 'post'
12517
12329
  });
12518
12330
  };
12519
12331
  const chatEvaluateAdd = params => {
12520
- return request({
12332
+ return utils_request({
12521
12333
  url: prefix + `/assistant/chatEvaluateAdd`,
12522
12334
  method: 'post',
12523
12335
  data: params
12524
12336
  });
12525
12337
  };
12526
12338
  const chatEvaluateCancel = params => {
12527
- return request({
12339
+ return utils_request({
12528
12340
  url: prefix + `/assistant/chatEvaluateCancel`,
12529
12341
  method: 'post',
12530
12342
  data: params
12531
12343
  });
12532
12344
  };
12533
12345
  const pustReanswerToTeacher = params => {
12534
- return request({
12346
+ return utils_request({
12535
12347
  url: prefix + `/assistant/push`,
12536
12348
  method: 'post',
12537
12349
  data: params
12538
12350
  });
12539
12351
  };
12540
12352
  const getDetailList = resId => {
12541
- return request({
12353
+ return utils_request({
12542
12354
  url: prefix + `/assistant/detail/v2/${resId}`,
12543
12355
  method: 'get'
12544
12356
  });
12545
12357
  };
12546
12358
  const countAccess = resId => {
12547
- return request({
12359
+ return utils_request({
12548
12360
  url: prefix + `/assistant/access`,
12549
12361
  method: 'post',
12550
12362
  params: {
@@ -12553,27 +12365,315 @@ const countAccess = resId => {
12553
12365
  });
12554
12366
  };
12555
12367
  const checkCourseIdIsExist = resId => {
12556
- return request({
12368
+ return utils_request({
12557
12369
  url: prefix + `/ia/hasPermission?courseId=${resId}`,
12558
12370
  method: 'get'
12559
12371
  });
12560
12372
  };
12373
+ /**
12374
+ * 开场白及提示词查询
12375
+ * */
12376
+ const queryCallWord = resId => {
12377
+ return utils_request({
12378
+ url: prefix + `/ia/byCourseId?courseId=${resId}`,
12379
+ method: 'get'
12380
+ });
12381
+ };
12382
+
12383
+ /**
12384
+ * 自动追问
12385
+ * @param iaId 请求参数id
12386
+ * @param message 对话对
12387
+ * @returns 返回节点详情数据
12388
+ */
12389
+ async function getAutoQuestioning(iaId, message) {
12390
+ return utils_request.post(`${prefix}/ia/autoFollowUp`, {
12391
+ iaId,
12392
+ messages: message
12393
+ });
12394
+ }
12561
12395
  async function sendMessageEventSource(params, signal, onmessage) {
12562
- return fetchEventSource(`${baseURL}${prefix}/assistant/conversation`, {
12396
+ return fetchEventSource(`${baseURL}${prefix}/assistant/conversation?token=${cache.session.getJSON('SRKJ_TOKEN_CACHE')}`, {
12563
12397
  method: 'POST',
12564
12398
  signal: signal,
12565
12399
  openWhenHidden: true,
12566
12400
  headers: {
12567
- 'Content-Type': 'application/json',
12568
- 'X-Id-Token': cache.session.getJSON('SRKJ_TOKEN_CACHE')
12401
+ 'Content-Type': 'application/json'
12402
+ // 'X-Id-Token': cache.session.getJSON('SRKJ_TOKEN_CACHE'),
12569
12403
  },
12570
12404
  body: JSON.stringify(params),
12571
12405
  onmessage
12572
12406
  });
12573
12407
  }
12574
- ;// CONCATENATED MODULE: ./components/demo/utils/config.js
12408
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/hot-search.vue?vue&type=script&lang=js
12409
+
12410
+ /* harmony default export */ var hot_searchvue_type_script_lang_js = ({
12411
+ name: 'HotSearch',
12412
+ props: {
12413
+ resId: {
12414
+ type: String,
12415
+ default: ''
12416
+ }
12417
+ },
12418
+ data() {
12419
+ return {
12420
+ aiMessage: [
12421
+ // {
12422
+ // value: '请解释一下牛顿第二定律的公式和物理意义。',
12423
+ // id: 1,
12424
+ // },
12425
+ // {
12426
+ // value: '电磁感应定律是如何描述的?请给出相关公式并解释。',
12427
+ // id: 2,
12428
+ // },
12429
+ // {
12430
+ // value: '在光学中,光的干涉现象是如何产生的?能否用公式来表示?',
12431
+ // id: 3,
12432
+ // }
12433
+ ],
12434
+ prologue: ' '
12435
+ };
12436
+ },
12437
+ methods: {
12438
+ selectModule(list) {
12439
+ this.$emit('select-module', list);
12440
+ }
12441
+ },
12442
+ async mounted() {
12443
+ const wordRes = await queryCallWord(this.resId);
12444
+ if (!wordRes) return;
12445
+ const {
12446
+ guideExample,
12447
+ prologue
12448
+ } = wordRes;
12449
+ if (guideExample && guideExample.length > 0) {
12450
+ this.aiMessage = JSON.parse(guideExample);
12451
+ }
12452
+ this.prologue = prologue;
12453
+ }
12454
+ });
12455
+ ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=script&lang=js
12456
+ /* harmony default export */ var src_hot_searchvue_type_script_lang_js = (hot_searchvue_type_script_lang_js);
12457
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/hot-search.vue?vue&type=style&index=0&id=abf2ffc4&prod&lang=scss&scoped=true
12458
+ // extracted by mini-css-extract-plugin
12459
+
12460
+ ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=style&index=0&id=abf2ffc4&prod&lang=scss&scoped=true
12461
+
12462
+ ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
12463
+ /* globals __VUE_SSR_CONTEXT__ */
12464
+
12465
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
12466
+ // This module is a runtime utility for cleaner component module output and will
12467
+ // be included in the final webpack user bundle.
12468
+
12469
+ function normalizeComponent(
12470
+ scriptExports,
12471
+ render,
12472
+ staticRenderFns,
12473
+ functionalTemplate,
12474
+ injectStyles,
12475
+ scopeId,
12476
+ moduleIdentifier /* server only */,
12477
+ shadowMode /* vue-cli only */
12478
+ ) {
12479
+ // Vue.extend constructor export interop
12480
+ var options =
12481
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
12482
+
12483
+ // render functions
12484
+ if (render) {
12485
+ options.render = render
12486
+ options.staticRenderFns = staticRenderFns
12487
+ options._compiled = true
12488
+ }
12489
+
12490
+ // functional template
12491
+ if (functionalTemplate) {
12492
+ options.functional = true
12493
+ }
12494
+
12495
+ // scopedId
12496
+ if (scopeId) {
12497
+ options._scopeId = 'data-v-' + scopeId
12498
+ }
12499
+
12500
+ var hook
12501
+ if (moduleIdentifier) {
12502
+ // server build
12503
+ hook = function (context) {
12504
+ // 2.3 injection
12505
+ context =
12506
+ context || // cached call
12507
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
12508
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
12509
+ // 2.2 with runInNewContext: true
12510
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
12511
+ context = __VUE_SSR_CONTEXT__
12512
+ }
12513
+ // inject component styles
12514
+ if (injectStyles) {
12515
+ injectStyles.call(this, context)
12516
+ }
12517
+ // register component module identifier for async chunk inferrence
12518
+ if (context && context._registeredComponents) {
12519
+ context._registeredComponents.add(moduleIdentifier)
12520
+ }
12521
+ }
12522
+ // used by ssr in case component is cached and beforeCreate
12523
+ // never gets called
12524
+ options._ssrRegister = hook
12525
+ } else if (injectStyles) {
12526
+ hook = shadowMode
12527
+ ? function () {
12528
+ injectStyles.call(
12529
+ this,
12530
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
12531
+ )
12532
+ }
12533
+ : injectStyles
12534
+ }
12535
+
12536
+ if (hook) {
12537
+ if (options.functional) {
12538
+ // for template-only hot-reload because in that case the render fn doesn't
12539
+ // go through the normalizer
12540
+ options._injectStyles = hook
12541
+ // register for functional component in vue file
12542
+ var originalRender = options.render
12543
+ options.render = function renderWithStyleInjection(h, context) {
12544
+ hook.call(context)
12545
+ return originalRender(h, context)
12546
+ }
12547
+ } else {
12548
+ // inject component registration as beforeCreate hook
12549
+ var existing = options.beforeCreate
12550
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
12551
+ }
12552
+ }
12553
+
12554
+ return {
12555
+ exports: scriptExports,
12556
+ options: options
12557
+ }
12558
+ }
12559
+
12560
+ ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue
12561
+
12562
+
12575
12563
 
12564
+ ;
12565
+
12566
+
12567
+ /* normalize component */
12568
+
12569
+ var component = normalizeComponent(
12570
+ src_hot_searchvue_type_script_lang_js,
12571
+ hot_searchvue_type_template_id_abf2ffc4_scoped_true_render,
12572
+ hot_searchvue_type_template_id_abf2ffc4_scoped_true_staticRenderFns,
12573
+ false,
12574
+ null,
12575
+ "abf2ffc4",
12576
+ null
12577
+
12578
+ )
12579
+
12580
+ /* harmony default export */ var hot_search = (component.exports);
12581
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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=069a8301&scoped=true
12582
+ var chatvue_type_template_id_069a8301_scoped_true_render = function render() {
12583
+ var _vm = this,
12584
+ _c = _vm._self._c;
12585
+ return _c('div', {
12586
+ ref: "chatContainer",
12587
+ staticClass: "chat-contain"
12588
+ }, _vm._l(_vm.messageData, function (list, index) {
12589
+ return _c('div', {
12590
+ key: index,
12591
+ staticClass: "message",
12592
+ class: {
12593
+ 'user-list': list.type === 'user'
12594
+ }
12595
+ }, [list.type === 'robot' ? _c('div', {
12596
+ staticClass: "robot"
12597
+ }, [_c('div', {
12598
+ staticClass: "robot-image-div"
12599
+ })]) : _c('div', {
12600
+ staticClass: "robot user"
12601
+ }, [_vm._v("user")]), _c('div', {
12602
+ staticClass: "robot-message",
12603
+ class: {
12604
+ 'user-info': list.type === 'user'
12605
+ }
12606
+ }, [_c('div', {
12607
+ domProps: {
12608
+ "innerHTML": _vm._s(list.message)
12609
+ }
12610
+ }), list.type === 'robot' && list.links.length > 0 ? _c('div', {
12611
+ staticClass: "link"
12612
+ }, [!list.allIdWithStart ? _c('div', [_c('div', {
12613
+ staticClass: "link-title"
12614
+ }, [_vm._v("参考文件")]), _c('div', {
12615
+ staticClass: "link-content"
12616
+ }, [_vm._l(list.links, function (item) {
12617
+ return [!item.title.startsWith(_vm.chatMajorId) ? _c('div', {
12618
+ staticClass: "links"
12619
+ }, [_c('a', {
12620
+ attrs: {
12621
+ "href": 'https://ai-yuliao.hep.com.cn' + item.documentUrl,
12622
+ "target": "_blank"
12623
+ }
12624
+ }, [_c('span', [_vm._v(_vm._s(item.title))])])]) : _vm._e()];
12625
+ })], 2)]) : _vm._e()]) : _vm._e(), list.type === 'robot' && list.connectUrl.length > 0 ? _c('div', {
12626
+ staticClass: "link"
12627
+ }, [_c('div', {
12628
+ staticClass: "link-title"
12629
+ }, [_vm._v("相关链接")]), _c('div', {
12630
+ staticClass: "link-content"
12631
+ }, [_vm._l(list.connectUrl, function (item) {
12632
+ return [_c('div', {
12633
+ staticClass: "links"
12634
+ }, [_c('a', {
12635
+ attrs: {
12636
+ "href": item.iaUrl,
12637
+ "target": "_blank"
12638
+ }
12639
+ }, [_c('span', [_vm._v(_vm._s(item.iaUrlName))])])])];
12640
+ })], 2)]) : _vm._e(), list.type === 'robot' && _vm.finish && list.followUps && list.followUps.length > 0 ? _c('div', [_c('div', {
12641
+ staticClass: "link-title"
12642
+ }, [_vm._v("智能追问")]), _c('div', {
12643
+ staticClass: "link-content"
12644
+ }, _vm._l(list.followUps, function (list, index) {
12645
+ return _c('div', {
12646
+ key: index,
12647
+ staticClass: "hot-list",
12648
+ on: {
12649
+ "click": function ($event) {
12650
+ return _vm.selectModule(list);
12651
+ }
12652
+ }
12653
+ }, [_vm._v(" " + _vm._s(list) + " "), _c('i', {
12654
+ staticClass: "el-icon-arrow-right go-icon"
12655
+ })]);
12656
+ }), 0)]) : _vm._e(), list.type === 'robot' ? _c('chat-tools', {
12657
+ attrs: {
12658
+ "chatId": _vm.chatId,
12659
+ "detail-data": list,
12660
+ "sending": list.sending,
12661
+ "resId": _vm.resId,
12662
+ "open-course-id": _vm.openCourseId,
12663
+ "is-last": index === _vm.messageData.length - 1
12664
+ },
12665
+ on: {
12666
+ "on-reanswer": list => _vm.reanswer(list, index),
12667
+ "on-stop-chat": _vm.onStopChat
12668
+ }
12669
+ }) : _vm._e()], 1)]);
12670
+ }), 0);
12671
+ };
12672
+ var chatvue_type_template_id_069a8301_scoped_true_staticRenderFns = [];
12673
+
12674
+ ;// CONCATENATED MODULE: ./components/demo/utils/config.js
12576
12675
 
12676
+ // import constants from '../utils/constants';
12577
12677
 
12578
12678
  const errorList = [{
12579
12679
  name: "格式问题",
@@ -12601,25 +12701,31 @@ const cacheMessageList = [{
12601
12701
  type: 'robot',
12602
12702
  message: '电磁感应定律是描述磁场与电场之间关系的物理定律。具体来说,当导体回路中的磁通量发生变化时,会在回路中产生感应电动势。这个感应电动势的大小与磁通量变化的速率成正比,这就是法拉第电磁感应定律。\n' + ' 相关的公式是:ε = -dΦ/dt\n' + ' 其中,ε 表示感应电动势,Φ 表示磁通量,t 表示时间,dΦ/dt 则表示磁通量对时间的变化率。注意这里的负号,它表示感应电动势的方向与磁通量变化的方向相反,这是楞次定律的体现。\n' + ' 解释这个公式时,我们可以理解为:当穿过一个闭合导体回路的磁通量发生变化时,会在回路中产生感应电动势,其大小正比于磁通量变化的速率。这种感应电动势是由于磁场的变化而引发的,它是磁场变化对电场的直接影响,体现了磁场与电场之间的紧密联系。'
12603
12703
  }];
12704
+
12705
+ // export const getUserInfo = async (token) => {
12706
+ // const ssoRes = await ssoAuth(token);
12707
+ // const userRes = await authUser({
12708
+ // 'X-Auth-User': encodeURIComponent(ssoRes.name),
12709
+ // 'X-Auth-Token': ssoRes.password,
12710
+ // 'X-Enterprise-Id': `${constants['X-Enterprise-Id']}`,
12711
+ // 'X-App-Id': `${constants['X-App-Id']}`,
12712
+ // 'X-App-Secret': `${constants['X-App-Secret']}`,
12713
+ // 'X-Auth-User-Type': '1',
12714
+ // });
12715
+ // cache.session.setJSON('SRKJ_TOKEN_CACHE', userRes);
12716
+ // }
12717
+
12604
12718
  const getUserInfo = async token => {
12605
- const ssoRes = await ssoAuth(token);
12606
- const userRes = await authUser({
12607
- 'X-Auth-User': encodeURIComponent(ssoRes.name),
12608
- 'X-Auth-Token': ssoRes.password,
12609
- 'X-Enterprise-Id': `${constants['X-Enterprise-Id']}`,
12610
- 'X-App-Id': `${constants['X-App-Id']}`,
12611
- 'X-App-Secret': `${constants['X-App-Secret']}`,
12612
- 'X-Auth-User-Type': '1'
12613
- });
12614
- cache.session.setJSON('SRKJ_TOKEN_CACHE', userRes);
12719
+ await ssoAuth(token);
12720
+ cache.session.setJSON('SRKJ_TOKEN_CACHE', token);
12615
12721
  };
12616
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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-tools.vue?vue&type=template&id=4de6d38a&scoped=true
12617
- var chat_toolsvue_type_template_id_4de6d38a_scoped_true_render = function render() {
12722
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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-tools.vue?vue&type=template&id=78eed5c6&scoped=true
12723
+ var chat_toolsvue_type_template_id_78eed5c6_scoped_true_render = function render() {
12618
12724
  var _vm = this,
12619
12725
  _c = _vm._self._c;
12620
12726
  return _c('div', {
12621
12727
  staticClass: "robot-tools"
12622
- }, [_vm.listData.stop || _vm.listData.finish && !_vm.sending ? _c('div', {
12728
+ }, [(_vm.listData.stop || _vm.listData.finish && !_vm.sending) && _vm.isLast ? _c('div', {
12623
12729
  staticClass: "robot-reanswer",
12624
12730
  staticStyle: {
12625
12731
  "margin-bottom": "8px"
@@ -12775,9 +12881,9 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_render = function render
12775
12881
  }
12776
12882
  }, [_vm._v("提交")])], 1)], 1)])])], 1)]);
12777
12883
  };
12778
- var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12884
+ var chat_toolsvue_type_template_id_78eed5c6_scoped_true_staticRenderFns = [];
12779
12885
 
12780
- ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=template&id=4de6d38a&scoped=true
12886
+ ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=template&id=78eed5c6&scoped=true
12781
12887
 
12782
12888
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat-tools.vue?vue&type=script&lang=js
12783
12889
 
@@ -12796,6 +12902,18 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12796
12902
  sending: {
12797
12903
  type: Boolean,
12798
12904
  default: false
12905
+ },
12906
+ resId: {
12907
+ type: String,
12908
+ default: ''
12909
+ },
12910
+ openCourseId: {
12911
+ type: String,
12912
+ default: ''
12913
+ },
12914
+ isLast: {
12915
+ type: Boolean,
12916
+ default: false
12799
12917
  }
12800
12918
  },
12801
12919
  data() {
@@ -12840,7 +12958,9 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12840
12958
  await pustReanswerToTeacher({
12841
12959
  chatId: this.chatId,
12842
12960
  msgId: list.msgId,
12843
- parentMsgId: list.parentMsgId
12961
+ parentMsgId: list.parentMsgId,
12962
+ courseId: this.resId,
12963
+ openCourseId: this.openCourseId
12844
12964
  });
12845
12965
  this.$message.success('已发送给老师');
12846
12966
  }).catch(() => {});
@@ -12885,10 +13005,10 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12885
13005
  });
12886
13006
  ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=script&lang=js
12887
13007
  /* harmony default export */ var src_chat_toolsvue_type_script_lang_js = (chat_toolsvue_type_script_lang_js);
12888
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat-tools.vue?vue&type=style&index=0&id=4de6d38a&prod&lang=scss&scoped=true
13008
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat-tools.vue?vue&type=style&index=0&id=78eed5c6&prod&lang=scss&scoped=true
12889
13009
  // extracted by mini-css-extract-plugin
12890
13010
 
12891
- ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=style&index=0&id=4de6d38a&prod&lang=scss&scoped=true
13011
+ ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=style&index=0&id=78eed5c6&prod&lang=scss&scoped=true
12892
13012
 
12893
13013
  ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue
12894
13014
 
@@ -12901,11 +13021,11 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12901
13021
 
12902
13022
  var chat_tools_component = normalizeComponent(
12903
13023
  src_chat_toolsvue_type_script_lang_js,
12904
- chat_toolsvue_type_template_id_4de6d38a_scoped_true_render,
12905
- chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns,
13024
+ chat_toolsvue_type_template_id_78eed5c6_scoped_true_render,
13025
+ chat_toolsvue_type_template_id_78eed5c6_scoped_true_staticRenderFns,
12906
13026
  false,
12907
13027
  null,
12908
- "4de6d38a",
13028
+ "78eed5c6",
12909
13029
  null
12910
13030
 
12911
13031
  )
@@ -12931,6 +13051,10 @@ const signal = controller.signal;
12931
13051
  type: String,
12932
13052
  default: ''
12933
13053
  },
13054
+ openCourseId: {
13055
+ type: String,
13056
+ default: ''
13057
+ },
12934
13058
  chatId: {
12935
13059
  type: String,
12936
13060
  default: ''
@@ -12950,6 +13074,7 @@ const signal = controller.signal;
12950
13074
  input: "",
12951
13075
  errors: [],
12952
13076
  errorList: errorList,
13077
+ finish: false,
12953
13078
  cacheKeyWord: '' // 由于外部需要快速清掉 keyword 但是存在重新发送请求的情况,因此需要一个混存记录
12954
13079
  };
12955
13080
  },
@@ -12981,6 +13106,7 @@ const signal = controller.signal;
12981
13106
  },
12982
13107
  async postMessage(list, commonKey, parentMsgId) {
12983
13108
  let reanswerParams = {};
13109
+ this.finish = false;
12984
13110
  if (list) {
12985
13111
  list.sending = true;
12986
13112
  reanswerParams = {
@@ -12990,6 +13116,7 @@ const signal = controller.signal;
12990
13116
  content: this.messageData[list.index - 1].message
12991
13117
  };
12992
13118
  this.messageData[list.index].message = '';
13119
+ this.makeAutoMessage();
12993
13120
  }
12994
13121
  const params = {
12995
13122
  messageList: [{
@@ -13003,26 +13130,42 @@ const signal = controller.signal;
13003
13130
  };
13004
13131
  // list 存在说明是重新生成
13005
13132
  if (!list && !commonKey) {
13133
+ const userWord = this.keyWord || this.cacheKeyWord;
13006
13134
  this.messageData.push({
13007
13135
  type: 'user',
13008
- message: this.keyWord.replace(/\n/g, '<br>')
13136
+ message: userWord.replace(/\n/g, '<br>')
13137
+ });
13138
+ setTimeout(() => {
13139
+ this.messageData.push({
13140
+ type: 'robot',
13141
+ message: '',
13142
+ zan: false,
13143
+ cai: false,
13144
+ stop: false,
13145
+ finish: false,
13146
+ sending: true,
13147
+ links: [],
13148
+ connectUrl: [],
13149
+ reAnswerCount: 0
13150
+ });
13151
+ this.makeAutoMessage();
13009
13152
  });
13010
- setTimeout(() => this.messageData.push({
13011
- type: 'robot',
13012
- message: '',
13013
- zan: false,
13014
- cai: false,
13015
- stop: false,
13016
- finish: false,
13017
- sending: true,
13018
- links: [],
13019
- reAnswerCount: 0
13020
- }));
13021
13153
  }
13022
13154
  await sendMessageEventSource(params, signal, res => {
13023
13155
  this.makeMessageLine(res, list);
13024
13156
  });
13025
13157
  },
13158
+ makeAutoMessage() {
13159
+ const cacheMessage = [];
13160
+ for (let i = 0; i < this.messageData.length; i++) {
13161
+ const current = this.messageData[i];
13162
+ cacheMessage.push({
13163
+ role: current.type === 'robot' ? 'assistant' : 'user',
13164
+ content: current.message || '正在思考中。'
13165
+ });
13166
+ }
13167
+ this.makeAutoQuestioning(cacheMessage);
13168
+ },
13026
13169
  makeMessageLine(res, list) {
13027
13170
  const {
13028
13171
  content,
@@ -13031,10 +13174,12 @@ const signal = controller.signal;
13031
13174
  msgId,
13032
13175
  parentMsgId,
13033
13176
  reference,
13034
- commonKey
13177
+ commonKey,
13178
+ connectUrl
13035
13179
  } = JSON.parse(res.data);
13036
13180
  let index = list ? list.index : this.messageData.length - 1;
13037
13181
  const currentList = this.messageData[index];
13182
+ let allIdWithStart = true;
13038
13183
  // 结束标识
13039
13184
  if (status === 2 || status === 1) {
13040
13185
  if (commonKey) {
@@ -13045,8 +13190,18 @@ const signal = controller.signal;
13045
13190
  currentList.finish = true;
13046
13191
  if (reference) {
13047
13192
  currentList.links = JSON.parse(reference);
13193
+ currentList.links.map(item => {
13194
+ if (!item.title.startsWith(this.chatMajorId)) {
13195
+ allIdWithStart = false;
13196
+ }
13197
+ });
13048
13198
  }
13199
+ if (connectUrl) {
13200
+ currentList.connectUrl = JSON.parse(connectUrl);
13201
+ }
13202
+ currentList.allIdWithStart = allIdWithStart;
13049
13203
  this.cacheKeyWord = '';
13204
+ this.finish = true;
13050
13205
  this.$emit('on-message-finish', chatId);
13051
13206
  return;
13052
13207
  }
@@ -13060,14 +13215,32 @@ const signal = controller.signal;
13060
13215
  // 防止出现调用基础模型前导致停止回答id错误
13061
13216
  setTimeout(() => currentList.sending = false, 500);
13062
13217
  },
13218
+ async makeAutoQuestioning(messages) {
13219
+ // 首次不触发
13220
+ if (messages.length <= 2) return;
13221
+ const autoRes = await getAutoQuestioning(this.chatMajorId, messages);
13222
+ const {
13223
+ message: {
13224
+ content: {
13225
+ followUps
13226
+ }
13227
+ }
13228
+ } = autoRes;
13229
+ this.messageData[this.messageData.length - 1].followUps = followUps.length > 3 ? followUps.splice(0, 3) : followUps;
13230
+ },
13063
13231
  onStopChat(list) {
13064
13232
  this.$emit('on-message-finish', list.chatId);
13065
13233
  },
13234
+ selectModule(message) {
13235
+ this.cacheKeyWord = message;
13236
+ this.postMessage();
13237
+ },
13066
13238
  reanswer(list, index) {
13067
13239
  list.index = index;
13068
13240
  list.stop = false;
13069
13241
  list.finish = false;
13070
13242
  list.links = [];
13243
+ list.connectUrl = [];
13071
13244
  this.postMessage(list);
13072
13245
  this.$emit('on-reanser');
13073
13246
  }
@@ -13075,10 +13248,10 @@ const signal = controller.signal;
13075
13248
  });
13076
13249
  ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=script&lang=js
13077
13250
  /* harmony default export */ var src_chatvue_type_script_lang_js = (chatvue_type_script_lang_js);
13078
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.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=1abfa6ce&prod&lang=scss&scoped=true
13251
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.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=069a8301&prod&lang=scss&scoped=true
13079
13252
  // extracted by mini-css-extract-plugin
13080
13253
 
13081
- ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=style&index=0&id=1abfa6ce&prod&lang=scss&scoped=true
13254
+ ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=style&index=0&id=069a8301&prod&lang=scss&scoped=true
13082
13255
 
13083
13256
  ;// CONCATENATED MODULE: ./components/demo/src/chat.vue
13084
13257
 
@@ -13091,11 +13264,11 @@ const signal = controller.signal;
13091
13264
 
13092
13265
  var chat_component = normalizeComponent(
13093
13266
  src_chatvue_type_script_lang_js,
13094
- chatvue_type_template_id_1abfa6ce_scoped_true_render,
13095
- chatvue_type_template_id_1abfa6ce_scoped_true_staticRenderFns,
13267
+ chatvue_type_template_id_069a8301_scoped_true_render,
13268
+ chatvue_type_template_id_069a8301_scoped_true_staticRenderFns,
13096
13269
  false,
13097
13270
  null,
13098
- "1abfa6ce",
13271
+ "069a8301",
13099
13272
  null
13100
13273
 
13101
13274
  )
@@ -13254,6 +13427,10 @@ var api = init(defaultConverter, { path: '/' });
13254
13427
  resId: {
13255
13428
  type: String,
13256
13429
  default: ''
13430
+ },
13431
+ openCourseId: {
13432
+ type: String,
13433
+ default: ''
13257
13434
  }
13258
13435
  },
13259
13436
  watch: {
@@ -13301,8 +13478,10 @@ var api = init(defaultConverter, { path: '/' });
13301
13478
  }
13302
13479
  this.$emit('close');
13303
13480
  },
13304
- selectModule() {
13481
+ selectModule(hotKey) {
13305
13482
  this.chatShow = true;
13483
+ this.aiMessage = hotKey;
13484
+ this.goChat({});
13306
13485
  },
13307
13486
  showHot() {
13308
13487
  this.chatShow = false;
@@ -13315,9 +13494,17 @@ var api = init(defaultConverter, { path: '/' });
13315
13494
  const {
13316
13495
  chatMajorId
13317
13496
  } = listRes[0];
13318
- this.chatMajorId = chatMajorId.toString();
13497
+ this.chatMajorId = chatMajorId && chatMajorId.toString();
13319
13498
  const cacheArray = [];
13320
13499
  currentList.map(list => {
13500
+ let allIdWithStart = true;
13501
+ if (this.chatMajorId && list.references) {
13502
+ list.references.map(item => {
13503
+ if (!item.title.startsWith(this.chatMajorId)) {
13504
+ allIdWithStart = false;
13505
+ }
13506
+ });
13507
+ }
13321
13508
  const obj = {
13322
13509
  type: list.role === 'assistant' ? 'robot' : 'user',
13323
13510
  message: list.content.replace(/\n/g, '<br>'),
@@ -13326,9 +13513,11 @@ var api = init(defaultConverter, { path: '/' });
13326
13513
  stop: list.status === 1,
13327
13514
  finish: true,
13328
13515
  links: list.references || [],
13516
+ connectUrl: list.connectUrls || [],
13329
13517
  reAnswerCount: 0,
13330
13518
  msgId: list.contentId,
13331
- parentMsgId: list.parentMsgId
13519
+ parentMsgId: list.parentMsgId,
13520
+ allIdWithStart
13332
13521
  };
13333
13522
  cacheArray.push(obj);
13334
13523
  });
@@ -13407,10 +13596,10 @@ var api = init(defaultConverter, { path: '/' });
13407
13596
  });
13408
13597
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=script&lang=js
13409
13598
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
13410
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.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=7a9bc48c&prod&lang=scss&scoped=true
13599
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.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=77093a83&prod&lang=scss&scoped=true
13411
13600
  // extracted by mini-css-extract-plugin
13412
13601
 
13413
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=7a9bc48c&prod&lang=scss&scoped=true
13602
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=77093a83&prod&lang=scss&scoped=true
13414
13603
 
13415
13604
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue
13416
13605
 
@@ -13427,7 +13616,7 @@ var main_component = normalizeComponent(
13427
13616
  staticRenderFns,
13428
13617
  false,
13429
13618
  null,
13430
- "7a9bc48c",
13619
+ "77093a83",
13431
13620
  null
13432
13621
 
13433
13622
  )