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.
@@ -7428,7 +7428,7 @@ if (typeof window !== 'undefined') {
7428
7428
  // Indicate to webpack that this file can be concatenated
7429
7429
  /* harmony default export */ var setPublicPath = (null);
7430
7430
 
7431
- ;// 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=7a9bc48c&scoped=true
7431
+ ;// 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=77093a83&scoped=true
7432
7432
  var render = function render() {
7433
7433
  var _vm = this,
7434
7434
  _c = _vm._self._c;
@@ -7464,6 +7464,9 @@ var render = function render() {
7464
7464
  })])]), _vm.courseFlag ? [_c('div', {
7465
7465
  staticClass: "ai-main-content"
7466
7466
  }, [!_vm.chatShow ? _c('hot-search', {
7467
+ attrs: {
7468
+ "resId": _vm.resId
7469
+ },
7467
7470
  on: {
7468
7471
  "select-module": _vm.selectModule
7469
7472
  }
@@ -7471,6 +7474,7 @@ var render = function render() {
7471
7474
  ref: "chatRef",
7472
7475
  attrs: {
7473
7476
  "resId": _vm.resId,
7477
+ "open-course-id": _vm.openCourseId,
7474
7478
  "chatId": _vm.chatId,
7475
7479
  "key-word": _vm.aiMessageKeyWord,
7476
7480
  "message-data": _vm.messageList,
@@ -7535,237 +7539,41 @@ var render = function render() {
7535
7539
  };
7536
7540
  var staticRenderFns = [];
7537
7541
 
7538
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=7a9bc48c&scoped=true
7542
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=77093a83&scoped=true
7539
7543
 
7540
- ;// 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/hot-search.vue?vue&type=template&id=73bfe44c&scoped=true
7541
- var hot_searchvue_type_template_id_73bfe44c_scoped_true_render = function render() {
7544
+ ;// 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/hot-search.vue?vue&type=template&id=abf2ffc4&scoped=true
7545
+ var hot_searchvue_type_template_id_abf2ffc4_scoped_true_render = function render() {
7542
7546
  var _vm = this,
7543
7547
  _c = _vm._self._c;
7544
- return _vm._m(0);
7548
+ return _c('div', {
7549
+ staticClass: "hot-search-contain"
7550
+ }, [_vm._m(0), _c('div', {
7551
+ staticClass: "robot-message"
7552
+ }, [_vm.prologue ? [_vm._v(" " + _vm._s(_vm.prologue) + " ")] : [_c('p', [_vm._v("Hi,我是学习助手。")]), _c('p', [_vm._v("在这里你可以获得专业、准确的课程讲解,包括对公式的深入理解和细腻的解答。")])], _vm._l(_vm.aiMessage, function (list, index) {
7553
+ return _c('div', {
7554
+ key: index,
7555
+ staticClass: "hot-list",
7556
+ on: {
7557
+ "click": function ($event) {
7558
+ return _vm.selectModule(list);
7559
+ }
7560
+ }
7561
+ }, [_vm._v(" " + _vm._s(list) + " "), _c('i', {
7562
+ staticClass: "el-icon-arrow-right go-icon"
7563
+ })]);
7564
+ })], 2)]);
7545
7565
  };
7546
- var hot_searchvue_type_template_id_73bfe44c_scoped_true_staticRenderFns = [function () {
7566
+ var hot_searchvue_type_template_id_abf2ffc4_scoped_true_staticRenderFns = [function () {
7547
7567
  var _vm = this,
7548
7568
  _c = _vm._self._c;
7549
7569
  return _c('div', {
7550
- staticClass: "hot-search-contain"
7551
- }, [_c('div', {
7552
7570
  staticClass: "robot"
7553
7571
  }, [_c('div', {
7554
7572
  staticClass: "robot-image-div"
7555
- })]), _c('div', {
7556
- staticClass: "robot-message"
7557
- }, [_c('p', [_vm._v("Hi,我是学习助手。")]), _c('p', [_vm._v("在这里你可以获得专业、准确的课程讲解,包括对公式的深入理解和细腻的解答。")])])]);
7573
+ })]);
7558
7574
  }];
7559
7575
 
7560
- ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=template&id=73bfe44c&scoped=true
7561
-
7562
- ;// 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/hot-search.vue?vue&type=script&lang=js
7563
- /* harmony default export */ var hot_searchvue_type_script_lang_js = ({
7564
- name: 'HotSearch',
7565
- data() {
7566
- return {
7567
- aiMessage: [{
7568
- value: '请解释一下牛顿第二定律的公式和物理意义。',
7569
- id: 1
7570
- }, {
7571
- value: '电磁感应定律是如何描述的?请给出相关公式并解释。',
7572
- id: 2
7573
- }, {
7574
- value: '在光学中,光的干涉现象是如何产生的?能否用公式来表示?',
7575
- id: 3
7576
- }]
7577
- };
7578
- },
7579
- methods: {
7580
- selectModule(list) {
7581
- this.$emit('select-module', list);
7582
- }
7583
- }
7584
- });
7585
- ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=script&lang=js
7586
- /* harmony default export */ var src_hot_searchvue_type_script_lang_js = (hot_searchvue_type_script_lang_js);
7587
- ;// 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/hot-search.vue?vue&type=style&index=0&id=73bfe44c&prod&lang=scss&scoped=true
7588
- // extracted by mini-css-extract-plugin
7589
-
7590
- ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=style&index=0&id=73bfe44c&prod&lang=scss&scoped=true
7591
-
7592
- ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
7593
- /* globals __VUE_SSR_CONTEXT__ */
7594
-
7595
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
7596
- // This module is a runtime utility for cleaner component module output and will
7597
- // be included in the final webpack user bundle.
7598
-
7599
- function normalizeComponent(
7600
- scriptExports,
7601
- render,
7602
- staticRenderFns,
7603
- functionalTemplate,
7604
- injectStyles,
7605
- scopeId,
7606
- moduleIdentifier /* server only */,
7607
- shadowMode /* vue-cli only */
7608
- ) {
7609
- // Vue.extend constructor export interop
7610
- var options =
7611
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
7612
-
7613
- // render functions
7614
- if (render) {
7615
- options.render = render
7616
- options.staticRenderFns = staticRenderFns
7617
- options._compiled = true
7618
- }
7619
-
7620
- // functional template
7621
- if (functionalTemplate) {
7622
- options.functional = true
7623
- }
7624
-
7625
- // scopedId
7626
- if (scopeId) {
7627
- options._scopeId = 'data-v-' + scopeId
7628
- }
7629
-
7630
- var hook
7631
- if (moduleIdentifier) {
7632
- // server build
7633
- hook = function (context) {
7634
- // 2.3 injection
7635
- context =
7636
- context || // cached call
7637
- (this.$vnode && this.$vnode.ssrContext) || // stateful
7638
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
7639
- // 2.2 with runInNewContext: true
7640
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
7641
- context = __VUE_SSR_CONTEXT__
7642
- }
7643
- // inject component styles
7644
- if (injectStyles) {
7645
- injectStyles.call(this, context)
7646
- }
7647
- // register component module identifier for async chunk inferrence
7648
- if (context && context._registeredComponents) {
7649
- context._registeredComponents.add(moduleIdentifier)
7650
- }
7651
- }
7652
- // used by ssr in case component is cached and beforeCreate
7653
- // never gets called
7654
- options._ssrRegister = hook
7655
- } else if (injectStyles) {
7656
- hook = shadowMode
7657
- ? function () {
7658
- injectStyles.call(
7659
- this,
7660
- (options.functional ? this.parent : this).$root.$options.shadowRoot
7661
- )
7662
- }
7663
- : injectStyles
7664
- }
7665
-
7666
- if (hook) {
7667
- if (options.functional) {
7668
- // for template-only hot-reload because in that case the render fn doesn't
7669
- // go through the normalizer
7670
- options._injectStyles = hook
7671
- // register for functional component in vue file
7672
- var originalRender = options.render
7673
- options.render = function renderWithStyleInjection(h, context) {
7674
- hook.call(context)
7675
- return originalRender(h, context)
7676
- }
7677
- } else {
7678
- // inject component registration as beforeCreate hook
7679
- var existing = options.beforeCreate
7680
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
7681
- }
7682
- }
7683
-
7684
- return {
7685
- exports: scriptExports,
7686
- options: options
7687
- }
7688
- }
7689
-
7690
- ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue
7691
-
7692
-
7693
-
7694
- ;
7695
-
7696
-
7697
- /* normalize component */
7698
-
7699
- var component = normalizeComponent(
7700
- src_hot_searchvue_type_script_lang_js,
7701
- hot_searchvue_type_template_id_73bfe44c_scoped_true_render,
7702
- hot_searchvue_type_template_id_73bfe44c_scoped_true_staticRenderFns,
7703
- false,
7704
- null,
7705
- "73bfe44c",
7706
- null
7707
-
7708
- )
7709
-
7710
- /* harmony default export */ var hot_search = (component.exports);
7711
- ;// 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=1abfa6ce&scoped=true
7712
- var chatvue_type_template_id_1abfa6ce_scoped_true_render = function render() {
7713
- var _vm = this,
7714
- _c = _vm._self._c;
7715
- return _c('div', {
7716
- ref: "chatContainer",
7717
- staticClass: "chat-contain"
7718
- }, _vm._l(_vm.messageData, function (list, index) {
7719
- return _c('div', {
7720
- key: index,
7721
- staticClass: "message",
7722
- class: {
7723
- 'user-list': list.type === 'user'
7724
- }
7725
- }, [list.type === 'robot' ? _c('div', {
7726
- staticClass: "robot"
7727
- }, [_c('div', {
7728
- staticClass: "robot-image-div"
7729
- })]) : _c('div', {
7730
- staticClass: "robot user"
7731
- }, [_vm._v("user")]), _c('div', {
7732
- staticClass: "robot-message",
7733
- class: {
7734
- 'user-info': list.type === 'user'
7735
- }
7736
- }, [_c('div', {
7737
- domProps: {
7738
- "innerHTML": _vm._s(list.message)
7739
- }
7740
- }), list.type === 'robot' && list.links.length > 0 ? _c('div', {
7741
- staticClass: "link"
7742
- }, [_c('div', {
7743
- staticClass: "link-title"
7744
- }, [_vm._v("相关链接")]), _c('div', {
7745
- staticClass: "link-content"
7746
- }, [_vm._l(list.links, function (item) {
7747
- return [!item.title.startsWith(_vm.chatMajorId) ? _c('div', {
7748
- staticClass: "links"
7749
- }, [_c('a', {
7750
- attrs: {
7751
- "href": 'https://ai-yuliao.hep.com.cn' + item.documentUrl,
7752
- "target": "_blank"
7753
- }
7754
- }, [_c('span', [_vm._v(_vm._s(item.title))])])]) : _vm._e()];
7755
- })], 2)]) : _vm._e(), list.type === 'robot' ? _c('chat-tools', {
7756
- attrs: {
7757
- "chatId": _vm.chatId,
7758
- "detail-data": list,
7759
- "sending": list.sending
7760
- },
7761
- on: {
7762
- "on-reanswer": list => _vm.reanswer(list, index),
7763
- "on-stop-chat": _vm.onStopChat
7764
- }
7765
- }) : _vm._e()], 1)]);
7766
- }), 0);
7767
- };
7768
- var chatvue_type_template_id_1abfa6ce_scoped_true_staticRenderFns = [];
7576
+ ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=template&id=abf2ffc4&scoped=true
7769
7577
 
7770
7578
  ;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/bind.js
7771
7579
 
@@ -12160,17 +11968,17 @@ const iv = crypto_js_default().enc.Utf8.parse(n);
12160
11968
  // 解密方法
12161
11969
  function decrypt(word) {
12162
11970
  const stringToEncode = 'Hello, World!'; // 要进行 Base64 编码的字符串
12163
- const encodedString = gBase64.encode(stringToEncode); // 进行 Base64 编码
12164
- const decodedString = gBase64.decode(encodedString); // 进行 Base64 解码
11971
+ const encodedString = Base64.encode(stringToEncode); // 进行 Base64 编码
11972
+ const decodedString = Base64.decode(encodedString); // 进行 Base64 解码
12165
11973
 
12166
- let base64 = crypto_js_default().enc.Base64.parse(word);
12167
- let src = crypto_js_default().enc.Base64.stringify(base64);
12168
- let decrypt = crypto_js_default().AES.decrypt(src, key, {
11974
+ let base64 = CryptoJS.enc.Base64.parse(word);
11975
+ let src = CryptoJS.enc.Base64.stringify(base64);
11976
+ let decrypt = CryptoJS.AES.decrypt(src, key, {
12169
11977
  iv: iv,
12170
- mode: (crypto_js_default()).mode.CBC,
12171
- padding: (crypto_js_default()).pad.Pkcs7
11978
+ mode: CryptoJS.mode.CBC,
11979
+ padding: CryptoJS.pad.Pkcs7
12172
11980
  });
12173
- let decryptedStr = decrypt.toString((crypto_js_default()).enc.Utf8);
11981
+ let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
12174
11982
  return decryptedStr.toString();
12175
11983
  }
12176
11984
  ;// CONCATENATED MODULE: ./components/demo/utils/constants.js
@@ -12204,7 +12012,9 @@ const service = lib_axios.create({
12204
12012
  });
12205
12013
  service.interceptors.request.use(config => {
12206
12014
  if (cache.session.getJSON('SRKJ_TOKEN_CACHE')) {
12207
- config.headers["X-Id-Token"] = cache.session.getJSON('SRKJ_TOKEN_CACHE');
12015
+ // config.headers["X-Id-Token"] = cache.session.getJSON('SRKJ_TOKEN_CACHE');
12016
+ if (!config.params) config.params = {};
12017
+ config.params.token = cache.session.getJSON('SRKJ_TOKEN_CACHE');
12208
12018
  }
12209
12019
  // 是否需要防止数据重复提交
12210
12020
  const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
@@ -12237,12 +12047,12 @@ service.interceptors.response.use(res => {
12237
12047
  return res.data;
12238
12048
  }
12239
12049
  let srkjData = res.data;
12240
- if (srkjData) {
12241
- const respData = decrypt(srkjData);
12242
- try {
12243
- srkjData = JSON.parse(respData);
12244
- } catch (e) {}
12245
- }
12050
+ // if (srkjData) {
12051
+ // const respData = decrypt(srkjData);
12052
+ // try {
12053
+ // srkjData = JSON.parse(respData);
12054
+ // } catch (e) {}
12055
+ // }
12246
12056
  if (res.status === 401) {
12247
12057
  external_element_ui_namespaceObject.Message.warning(srkjData.message.description);
12248
12058
  return;
@@ -12252,7 +12062,7 @@ service.interceptors.response.use(res => {
12252
12062
  }
12253
12063
  return srkjData.queryData || srkjData.data || srkjData.token;
12254
12064
  });
12255
- /* harmony default export */ var request = (service);
12065
+ /* harmony default export */ var utils_request = (service);
12256
12066
  ;// CONCATENATED MODULE: ./node_modules/@microsoft/fetch-event-source/lib/esm/parse.js
12257
12067
  async function getBytes(stream, onChunk) {
12258
12068
  const reader = stream.getReader();
@@ -12459,10 +12269,12 @@ function defaultOnOpen(response) {
12459
12269
 
12460
12270
 
12461
12271
  const baseURL = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_BASE_URL') || constants.publicPath;
12462
- const prefix = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_PRE_FIX') || constants.publicPrefix;
12272
+ let prefix = sessionStorage.getItem('AI-INTELLIGENT-TOOLS_PRE_FIX') || constants.publicPrefix;
12273
+ // 0.0.8 版本接口升级
12274
+ prefix += '/plugin/v2';
12463
12275
 
12464
12276
  const ssoAuth = token => {
12465
- return request({
12277
+ return utils_request({
12466
12278
  url: prefix + '/sso/assistant',
12467
12279
  method: 'get',
12468
12280
  params: {
@@ -12478,7 +12290,7 @@ const authUser = headers => {
12478
12290
  });
12479
12291
  };
12480
12292
  const newChat = resId => {
12481
- return request({
12293
+ return utils_request({
12482
12294
  url: prefix + '/assistant/addChat',
12483
12295
  method: 'post',
12484
12296
  params: {
@@ -12487,46 +12299,46 @@ const newChat = resId => {
12487
12299
  });
12488
12300
  };
12489
12301
  const chartClear = chatId => {
12490
- return request({
12302
+ return utils_request({
12491
12303
  url: prefix + `/assistant/chartClear/${chatId}`,
12492
12304
  method: 'post'
12493
12305
  });
12494
12306
  };
12495
12307
  const stopChat = chatId => {
12496
- return request({
12308
+ return utils_request({
12497
12309
  url: prefix + `/assistant/stop/${chatId}`,
12498
12310
  method: 'post'
12499
12311
  });
12500
12312
  };
12501
12313
  const chatEvaluateAdd = params => {
12502
- return request({
12314
+ return utils_request({
12503
12315
  url: prefix + `/assistant/chatEvaluateAdd`,
12504
12316
  method: 'post',
12505
12317
  data: params
12506
12318
  });
12507
12319
  };
12508
12320
  const chatEvaluateCancel = params => {
12509
- return request({
12321
+ return utils_request({
12510
12322
  url: prefix + `/assistant/chatEvaluateCancel`,
12511
12323
  method: 'post',
12512
12324
  data: params
12513
12325
  });
12514
12326
  };
12515
12327
  const pustReanswerToTeacher = params => {
12516
- return request({
12328
+ return utils_request({
12517
12329
  url: prefix + `/assistant/push`,
12518
12330
  method: 'post',
12519
12331
  data: params
12520
12332
  });
12521
12333
  };
12522
12334
  const getDetailList = resId => {
12523
- return request({
12335
+ return utils_request({
12524
12336
  url: prefix + `/assistant/detail/v2/${resId}`,
12525
12337
  method: 'get'
12526
12338
  });
12527
12339
  };
12528
12340
  const countAccess = resId => {
12529
- return request({
12341
+ return utils_request({
12530
12342
  url: prefix + `/assistant/access`,
12531
12343
  method: 'post',
12532
12344
  params: {
@@ -12535,27 +12347,315 @@ const countAccess = resId => {
12535
12347
  });
12536
12348
  };
12537
12349
  const checkCourseIdIsExist = resId => {
12538
- return request({
12350
+ return utils_request({
12539
12351
  url: prefix + `/ia/hasPermission?courseId=${resId}`,
12540
12352
  method: 'get'
12541
12353
  });
12542
12354
  };
12355
+ /**
12356
+ * 开场白及提示词查询
12357
+ * */
12358
+ const queryCallWord = resId => {
12359
+ return utils_request({
12360
+ url: prefix + `/ia/byCourseId?courseId=${resId}`,
12361
+ method: 'get'
12362
+ });
12363
+ };
12364
+
12365
+ /**
12366
+ * 自动追问
12367
+ * @param iaId 请求参数id
12368
+ * @param message 对话对
12369
+ * @returns 返回节点详情数据
12370
+ */
12371
+ async function getAutoQuestioning(iaId, message) {
12372
+ return utils_request.post(`${prefix}/ia/autoFollowUp`, {
12373
+ iaId,
12374
+ messages: message
12375
+ });
12376
+ }
12543
12377
  async function sendMessageEventSource(params, signal, onmessage) {
12544
- return fetchEventSource(`${baseURL}${prefix}/assistant/conversation`, {
12378
+ return fetchEventSource(`${baseURL}${prefix}/assistant/conversation?token=${cache.session.getJSON('SRKJ_TOKEN_CACHE')}`, {
12545
12379
  method: 'POST',
12546
12380
  signal: signal,
12547
12381
  openWhenHidden: true,
12548
12382
  headers: {
12549
- 'Content-Type': 'application/json',
12550
- 'X-Id-Token': cache.session.getJSON('SRKJ_TOKEN_CACHE')
12383
+ 'Content-Type': 'application/json'
12384
+ // 'X-Id-Token': cache.session.getJSON('SRKJ_TOKEN_CACHE'),
12551
12385
  },
12552
12386
  body: JSON.stringify(params),
12553
12387
  onmessage
12554
12388
  });
12555
12389
  }
12556
- ;// CONCATENATED MODULE: ./components/demo/utils/config.js
12390
+ ;// 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/hot-search.vue?vue&type=script&lang=js
12391
+
12392
+ /* harmony default export */ var hot_searchvue_type_script_lang_js = ({
12393
+ name: 'HotSearch',
12394
+ props: {
12395
+ resId: {
12396
+ type: String,
12397
+ default: ''
12398
+ }
12399
+ },
12400
+ data() {
12401
+ return {
12402
+ aiMessage: [
12403
+ // {
12404
+ // value: '请解释一下牛顿第二定律的公式和物理意义。',
12405
+ // id: 1,
12406
+ // },
12407
+ // {
12408
+ // value: '电磁感应定律是如何描述的?请给出相关公式并解释。',
12409
+ // id: 2,
12410
+ // },
12411
+ // {
12412
+ // value: '在光学中,光的干涉现象是如何产生的?能否用公式来表示?',
12413
+ // id: 3,
12414
+ // }
12415
+ ],
12416
+ prologue: ' '
12417
+ };
12418
+ },
12419
+ methods: {
12420
+ selectModule(list) {
12421
+ this.$emit('select-module', list);
12422
+ }
12423
+ },
12424
+ async mounted() {
12425
+ const wordRes = await queryCallWord(this.resId);
12426
+ if (!wordRes) return;
12427
+ const {
12428
+ guideExample,
12429
+ prologue
12430
+ } = wordRes;
12431
+ if (guideExample && guideExample.length > 0) {
12432
+ this.aiMessage = JSON.parse(guideExample);
12433
+ }
12434
+ this.prologue = prologue;
12435
+ }
12436
+ });
12437
+ ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=script&lang=js
12438
+ /* harmony default export */ var src_hot_searchvue_type_script_lang_js = (hot_searchvue_type_script_lang_js);
12439
+ ;// 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/hot-search.vue?vue&type=style&index=0&id=abf2ffc4&prod&lang=scss&scoped=true
12440
+ // extracted by mini-css-extract-plugin
12441
+
12442
+ ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue?vue&type=style&index=0&id=abf2ffc4&prod&lang=scss&scoped=true
12443
+
12444
+ ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
12445
+ /* globals __VUE_SSR_CONTEXT__ */
12446
+
12447
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
12448
+ // This module is a runtime utility for cleaner component module output and will
12449
+ // be included in the final webpack user bundle.
12450
+
12451
+ function normalizeComponent(
12452
+ scriptExports,
12453
+ render,
12454
+ staticRenderFns,
12455
+ functionalTemplate,
12456
+ injectStyles,
12457
+ scopeId,
12458
+ moduleIdentifier /* server only */,
12459
+ shadowMode /* vue-cli only */
12460
+ ) {
12461
+ // Vue.extend constructor export interop
12462
+ var options =
12463
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
12464
+
12465
+ // render functions
12466
+ if (render) {
12467
+ options.render = render
12468
+ options.staticRenderFns = staticRenderFns
12469
+ options._compiled = true
12470
+ }
12471
+
12472
+ // functional template
12473
+ if (functionalTemplate) {
12474
+ options.functional = true
12475
+ }
12476
+
12477
+ // scopedId
12478
+ if (scopeId) {
12479
+ options._scopeId = 'data-v-' + scopeId
12480
+ }
12481
+
12482
+ var hook
12483
+ if (moduleIdentifier) {
12484
+ // server build
12485
+ hook = function (context) {
12486
+ // 2.3 injection
12487
+ context =
12488
+ context || // cached call
12489
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
12490
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
12491
+ // 2.2 with runInNewContext: true
12492
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
12493
+ context = __VUE_SSR_CONTEXT__
12494
+ }
12495
+ // inject component styles
12496
+ if (injectStyles) {
12497
+ injectStyles.call(this, context)
12498
+ }
12499
+ // register component module identifier for async chunk inferrence
12500
+ if (context && context._registeredComponents) {
12501
+ context._registeredComponents.add(moduleIdentifier)
12502
+ }
12503
+ }
12504
+ // used by ssr in case component is cached and beforeCreate
12505
+ // never gets called
12506
+ options._ssrRegister = hook
12507
+ } else if (injectStyles) {
12508
+ hook = shadowMode
12509
+ ? function () {
12510
+ injectStyles.call(
12511
+ this,
12512
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
12513
+ )
12514
+ }
12515
+ : injectStyles
12516
+ }
12517
+
12518
+ if (hook) {
12519
+ if (options.functional) {
12520
+ // for template-only hot-reload because in that case the render fn doesn't
12521
+ // go through the normalizer
12522
+ options._injectStyles = hook
12523
+ // register for functional component in vue file
12524
+ var originalRender = options.render
12525
+ options.render = function renderWithStyleInjection(h, context) {
12526
+ hook.call(context)
12527
+ return originalRender(h, context)
12528
+ }
12529
+ } else {
12530
+ // inject component registration as beforeCreate hook
12531
+ var existing = options.beforeCreate
12532
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
12533
+ }
12534
+ }
12535
+
12536
+ return {
12537
+ exports: scriptExports,
12538
+ options: options
12539
+ }
12540
+ }
12541
+
12542
+ ;// CONCATENATED MODULE: ./components/demo/src/hot-search.vue
12543
+
12544
+
12557
12545
 
12546
+ ;
12547
+
12548
+
12549
+ /* normalize component */
12550
+
12551
+ var component = normalizeComponent(
12552
+ src_hot_searchvue_type_script_lang_js,
12553
+ hot_searchvue_type_template_id_abf2ffc4_scoped_true_render,
12554
+ hot_searchvue_type_template_id_abf2ffc4_scoped_true_staticRenderFns,
12555
+ false,
12556
+ null,
12557
+ "abf2ffc4",
12558
+ null
12559
+
12560
+ )
12561
+
12562
+ /* harmony default export */ var hot_search = (component.exports);
12563
+ ;// 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=069a8301&scoped=true
12564
+ var chatvue_type_template_id_069a8301_scoped_true_render = function render() {
12565
+ var _vm = this,
12566
+ _c = _vm._self._c;
12567
+ return _c('div', {
12568
+ ref: "chatContainer",
12569
+ staticClass: "chat-contain"
12570
+ }, _vm._l(_vm.messageData, function (list, index) {
12571
+ return _c('div', {
12572
+ key: index,
12573
+ staticClass: "message",
12574
+ class: {
12575
+ 'user-list': list.type === 'user'
12576
+ }
12577
+ }, [list.type === 'robot' ? _c('div', {
12578
+ staticClass: "robot"
12579
+ }, [_c('div', {
12580
+ staticClass: "robot-image-div"
12581
+ })]) : _c('div', {
12582
+ staticClass: "robot user"
12583
+ }, [_vm._v("user")]), _c('div', {
12584
+ staticClass: "robot-message",
12585
+ class: {
12586
+ 'user-info': list.type === 'user'
12587
+ }
12588
+ }, [_c('div', {
12589
+ domProps: {
12590
+ "innerHTML": _vm._s(list.message)
12591
+ }
12592
+ }), list.type === 'robot' && list.links.length > 0 ? _c('div', {
12593
+ staticClass: "link"
12594
+ }, [!list.allIdWithStart ? _c('div', [_c('div', {
12595
+ staticClass: "link-title"
12596
+ }, [_vm._v("参考文件")]), _c('div', {
12597
+ staticClass: "link-content"
12598
+ }, [_vm._l(list.links, function (item) {
12599
+ return [!item.title.startsWith(_vm.chatMajorId) ? _c('div', {
12600
+ staticClass: "links"
12601
+ }, [_c('a', {
12602
+ attrs: {
12603
+ "href": 'https://ai-yuliao.hep.com.cn' + item.documentUrl,
12604
+ "target": "_blank"
12605
+ }
12606
+ }, [_c('span', [_vm._v(_vm._s(item.title))])])]) : _vm._e()];
12607
+ })], 2)]) : _vm._e()]) : _vm._e(), list.type === 'robot' && list.connectUrl.length > 0 ? _c('div', {
12608
+ staticClass: "link"
12609
+ }, [_c('div', {
12610
+ staticClass: "link-title"
12611
+ }, [_vm._v("相关链接")]), _c('div', {
12612
+ staticClass: "link-content"
12613
+ }, [_vm._l(list.connectUrl, function (item) {
12614
+ return [_c('div', {
12615
+ staticClass: "links"
12616
+ }, [_c('a', {
12617
+ attrs: {
12618
+ "href": item.iaUrl,
12619
+ "target": "_blank"
12620
+ }
12621
+ }, [_c('span', [_vm._v(_vm._s(item.iaUrlName))])])])];
12622
+ })], 2)]) : _vm._e(), list.type === 'robot' && _vm.finish && list.followUps && list.followUps.length > 0 ? _c('div', [_c('div', {
12623
+ staticClass: "link-title"
12624
+ }, [_vm._v("智能追问")]), _c('div', {
12625
+ staticClass: "link-content"
12626
+ }, _vm._l(list.followUps, function (list, index) {
12627
+ return _c('div', {
12628
+ key: index,
12629
+ staticClass: "hot-list",
12630
+ on: {
12631
+ "click": function ($event) {
12632
+ return _vm.selectModule(list);
12633
+ }
12634
+ }
12635
+ }, [_vm._v(" " + _vm._s(list) + " "), _c('i', {
12636
+ staticClass: "el-icon-arrow-right go-icon"
12637
+ })]);
12638
+ }), 0)]) : _vm._e(), list.type === 'robot' ? _c('chat-tools', {
12639
+ attrs: {
12640
+ "chatId": _vm.chatId,
12641
+ "detail-data": list,
12642
+ "sending": list.sending,
12643
+ "resId": _vm.resId,
12644
+ "open-course-id": _vm.openCourseId,
12645
+ "is-last": index === _vm.messageData.length - 1
12646
+ },
12647
+ on: {
12648
+ "on-reanswer": list => _vm.reanswer(list, index),
12649
+ "on-stop-chat": _vm.onStopChat
12650
+ }
12651
+ }) : _vm._e()], 1)]);
12652
+ }), 0);
12653
+ };
12654
+ var chatvue_type_template_id_069a8301_scoped_true_staticRenderFns = [];
12655
+
12656
+ ;// CONCATENATED MODULE: ./components/demo/utils/config.js
12558
12657
 
12658
+ // import constants from '../utils/constants';
12559
12659
 
12560
12660
  const errorList = [{
12561
12661
  name: "格式问题",
@@ -12583,25 +12683,31 @@ const cacheMessageList = [{
12583
12683
  type: 'robot',
12584
12684
  message: '电磁感应定律是描述磁场与电场之间关系的物理定律。具体来说,当导体回路中的磁通量发生变化时,会在回路中产生感应电动势。这个感应电动势的大小与磁通量变化的速率成正比,这就是法拉第电磁感应定律。\n' + ' 相关的公式是:ε = -dΦ/dt\n' + ' 其中,ε 表示感应电动势,Φ 表示磁通量,t 表示时间,dΦ/dt 则表示磁通量对时间的变化率。注意这里的负号,它表示感应电动势的方向与磁通量变化的方向相反,这是楞次定律的体现。\n' + ' 解释这个公式时,我们可以理解为:当穿过一个闭合导体回路的磁通量发生变化时,会在回路中产生感应电动势,其大小正比于磁通量变化的速率。这种感应电动势是由于磁场的变化而引发的,它是磁场变化对电场的直接影响,体现了磁场与电场之间的紧密联系。'
12585
12685
  }];
12686
+
12687
+ // export const getUserInfo = async (token) => {
12688
+ // const ssoRes = await ssoAuth(token);
12689
+ // const userRes = await authUser({
12690
+ // 'X-Auth-User': encodeURIComponent(ssoRes.name),
12691
+ // 'X-Auth-Token': ssoRes.password,
12692
+ // 'X-Enterprise-Id': `${constants['X-Enterprise-Id']}`,
12693
+ // 'X-App-Id': `${constants['X-App-Id']}`,
12694
+ // 'X-App-Secret': `${constants['X-App-Secret']}`,
12695
+ // 'X-Auth-User-Type': '1',
12696
+ // });
12697
+ // cache.session.setJSON('SRKJ_TOKEN_CACHE', userRes);
12698
+ // }
12699
+
12586
12700
  const getUserInfo = async token => {
12587
- const ssoRes = await ssoAuth(token);
12588
- const userRes = await authUser({
12589
- 'X-Auth-User': encodeURIComponent(ssoRes.name),
12590
- 'X-Auth-Token': ssoRes.password,
12591
- 'X-Enterprise-Id': `${constants['X-Enterprise-Id']}`,
12592
- 'X-App-Id': `${constants['X-App-Id']}`,
12593
- 'X-App-Secret': `${constants['X-App-Secret']}`,
12594
- 'X-Auth-User-Type': '1'
12595
- });
12596
- cache.session.setJSON('SRKJ_TOKEN_CACHE', userRes);
12701
+ await ssoAuth(token);
12702
+ cache.session.setJSON('SRKJ_TOKEN_CACHE', token);
12597
12703
  };
12598
- ;// 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-tools.vue?vue&type=template&id=4de6d38a&scoped=true
12599
- var chat_toolsvue_type_template_id_4de6d38a_scoped_true_render = function render() {
12704
+ ;// 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-tools.vue?vue&type=template&id=78eed5c6&scoped=true
12705
+ var chat_toolsvue_type_template_id_78eed5c6_scoped_true_render = function render() {
12600
12706
  var _vm = this,
12601
12707
  _c = _vm._self._c;
12602
12708
  return _c('div', {
12603
12709
  staticClass: "robot-tools"
12604
- }, [_vm.listData.stop || _vm.listData.finish && !_vm.sending ? _c('div', {
12710
+ }, [(_vm.listData.stop || _vm.listData.finish && !_vm.sending) && _vm.isLast ? _c('div', {
12605
12711
  staticClass: "robot-reanswer",
12606
12712
  staticStyle: {
12607
12713
  "margin-bottom": "8px"
@@ -12757,9 +12863,9 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_render = function render
12757
12863
  }
12758
12864
  }, [_vm._v("提交")])], 1)], 1)])])], 1)]);
12759
12865
  };
12760
- var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12866
+ var chat_toolsvue_type_template_id_78eed5c6_scoped_true_staticRenderFns = [];
12761
12867
 
12762
- ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=template&id=4de6d38a&scoped=true
12868
+ ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=template&id=78eed5c6&scoped=true
12763
12869
 
12764
12870
  ;// 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/chat-tools.vue?vue&type=script&lang=js
12765
12871
 
@@ -12778,6 +12884,18 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12778
12884
  sending: {
12779
12885
  type: Boolean,
12780
12886
  default: false
12887
+ },
12888
+ resId: {
12889
+ type: String,
12890
+ default: ''
12891
+ },
12892
+ openCourseId: {
12893
+ type: String,
12894
+ default: ''
12895
+ },
12896
+ isLast: {
12897
+ type: Boolean,
12898
+ default: false
12781
12899
  }
12782
12900
  },
12783
12901
  data() {
@@ -12822,7 +12940,9 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12822
12940
  await pustReanswerToTeacher({
12823
12941
  chatId: this.chatId,
12824
12942
  msgId: list.msgId,
12825
- parentMsgId: list.parentMsgId
12943
+ parentMsgId: list.parentMsgId,
12944
+ courseId: this.resId,
12945
+ openCourseId: this.openCourseId
12826
12946
  });
12827
12947
  this.$message.success('已发送给老师');
12828
12948
  }).catch(() => {});
@@ -12867,10 +12987,10 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12867
12987
  });
12868
12988
  ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=script&lang=js
12869
12989
  /* harmony default export */ var src_chat_toolsvue_type_script_lang_js = (chat_toolsvue_type_script_lang_js);
12870
- ;// 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-tools.vue?vue&type=style&index=0&id=4de6d38a&prod&lang=scss&scoped=true
12990
+ ;// 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-tools.vue?vue&type=style&index=0&id=78eed5c6&prod&lang=scss&scoped=true
12871
12991
  // extracted by mini-css-extract-plugin
12872
12992
 
12873
- ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=style&index=0&id=4de6d38a&prod&lang=scss&scoped=true
12993
+ ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue?vue&type=style&index=0&id=78eed5c6&prod&lang=scss&scoped=true
12874
12994
 
12875
12995
  ;// CONCATENATED MODULE: ./components/demo/src/chat-tools.vue
12876
12996
 
@@ -12883,11 +13003,11 @@ var chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns = [];
12883
13003
 
12884
13004
  var chat_tools_component = normalizeComponent(
12885
13005
  src_chat_toolsvue_type_script_lang_js,
12886
- chat_toolsvue_type_template_id_4de6d38a_scoped_true_render,
12887
- chat_toolsvue_type_template_id_4de6d38a_scoped_true_staticRenderFns,
13006
+ chat_toolsvue_type_template_id_78eed5c6_scoped_true_render,
13007
+ chat_toolsvue_type_template_id_78eed5c6_scoped_true_staticRenderFns,
12888
13008
  false,
12889
13009
  null,
12890
- "4de6d38a",
13010
+ "78eed5c6",
12891
13011
  null
12892
13012
 
12893
13013
  )
@@ -12913,6 +13033,10 @@ const signal = controller.signal;
12913
13033
  type: String,
12914
13034
  default: ''
12915
13035
  },
13036
+ openCourseId: {
13037
+ type: String,
13038
+ default: ''
13039
+ },
12916
13040
  chatId: {
12917
13041
  type: String,
12918
13042
  default: ''
@@ -12932,6 +13056,7 @@ const signal = controller.signal;
12932
13056
  input: "",
12933
13057
  errors: [],
12934
13058
  errorList: errorList,
13059
+ finish: false,
12935
13060
  cacheKeyWord: '' // 由于外部需要快速清掉 keyword 但是存在重新发送请求的情况,因此需要一个混存记录
12936
13061
  };
12937
13062
  },
@@ -12963,6 +13088,7 @@ const signal = controller.signal;
12963
13088
  },
12964
13089
  async postMessage(list, commonKey, parentMsgId) {
12965
13090
  let reanswerParams = {};
13091
+ this.finish = false;
12966
13092
  if (list) {
12967
13093
  list.sending = true;
12968
13094
  reanswerParams = {
@@ -12972,6 +13098,7 @@ const signal = controller.signal;
12972
13098
  content: this.messageData[list.index - 1].message
12973
13099
  };
12974
13100
  this.messageData[list.index].message = '';
13101
+ this.makeAutoMessage();
12975
13102
  }
12976
13103
  const params = {
12977
13104
  messageList: [{
@@ -12985,26 +13112,42 @@ const signal = controller.signal;
12985
13112
  };
12986
13113
  // list 存在说明是重新生成
12987
13114
  if (!list && !commonKey) {
13115
+ const userWord = this.keyWord || this.cacheKeyWord;
12988
13116
  this.messageData.push({
12989
13117
  type: 'user',
12990
- message: this.keyWord.replace(/\n/g, '<br>')
13118
+ message: userWord.replace(/\n/g, '<br>')
13119
+ });
13120
+ setTimeout(() => {
13121
+ this.messageData.push({
13122
+ type: 'robot',
13123
+ message: '',
13124
+ zan: false,
13125
+ cai: false,
13126
+ stop: false,
13127
+ finish: false,
13128
+ sending: true,
13129
+ links: [],
13130
+ connectUrl: [],
13131
+ reAnswerCount: 0
13132
+ });
13133
+ this.makeAutoMessage();
12991
13134
  });
12992
- setTimeout(() => this.messageData.push({
12993
- type: 'robot',
12994
- message: '',
12995
- zan: false,
12996
- cai: false,
12997
- stop: false,
12998
- finish: false,
12999
- sending: true,
13000
- links: [],
13001
- reAnswerCount: 0
13002
- }));
13003
13135
  }
13004
13136
  await sendMessageEventSource(params, signal, res => {
13005
13137
  this.makeMessageLine(res, list);
13006
13138
  });
13007
13139
  },
13140
+ makeAutoMessage() {
13141
+ const cacheMessage = [];
13142
+ for (let i = 0; i < this.messageData.length; i++) {
13143
+ const current = this.messageData[i];
13144
+ cacheMessage.push({
13145
+ role: current.type === 'robot' ? 'assistant' : 'user',
13146
+ content: current.message || '正在思考中。'
13147
+ });
13148
+ }
13149
+ this.makeAutoQuestioning(cacheMessage);
13150
+ },
13008
13151
  makeMessageLine(res, list) {
13009
13152
  const {
13010
13153
  content,
@@ -13013,10 +13156,12 @@ const signal = controller.signal;
13013
13156
  msgId,
13014
13157
  parentMsgId,
13015
13158
  reference,
13016
- commonKey
13159
+ commonKey,
13160
+ connectUrl
13017
13161
  } = JSON.parse(res.data);
13018
13162
  let index = list ? list.index : this.messageData.length - 1;
13019
13163
  const currentList = this.messageData[index];
13164
+ let allIdWithStart = true;
13020
13165
  // 结束标识
13021
13166
  if (status === 2 || status === 1) {
13022
13167
  if (commonKey) {
@@ -13027,8 +13172,18 @@ const signal = controller.signal;
13027
13172
  currentList.finish = true;
13028
13173
  if (reference) {
13029
13174
  currentList.links = JSON.parse(reference);
13175
+ currentList.links.map(item => {
13176
+ if (!item.title.startsWith(this.chatMajorId)) {
13177
+ allIdWithStart = false;
13178
+ }
13179
+ });
13030
13180
  }
13181
+ if (connectUrl) {
13182
+ currentList.connectUrl = JSON.parse(connectUrl);
13183
+ }
13184
+ currentList.allIdWithStart = allIdWithStart;
13031
13185
  this.cacheKeyWord = '';
13186
+ this.finish = true;
13032
13187
  this.$emit('on-message-finish', chatId);
13033
13188
  return;
13034
13189
  }
@@ -13042,14 +13197,32 @@ const signal = controller.signal;
13042
13197
  // 防止出现调用基础模型前导致停止回答id错误
13043
13198
  setTimeout(() => currentList.sending = false, 500);
13044
13199
  },
13200
+ async makeAutoQuestioning(messages) {
13201
+ // 首次不触发
13202
+ if (messages.length <= 2) return;
13203
+ const autoRes = await getAutoQuestioning(this.chatMajorId, messages);
13204
+ const {
13205
+ message: {
13206
+ content: {
13207
+ followUps
13208
+ }
13209
+ }
13210
+ } = autoRes;
13211
+ this.messageData[this.messageData.length - 1].followUps = followUps.length > 3 ? followUps.splice(0, 3) : followUps;
13212
+ },
13045
13213
  onStopChat(list) {
13046
13214
  this.$emit('on-message-finish', list.chatId);
13047
13215
  },
13216
+ selectModule(message) {
13217
+ this.cacheKeyWord = message;
13218
+ this.postMessage();
13219
+ },
13048
13220
  reanswer(list, index) {
13049
13221
  list.index = index;
13050
13222
  list.stop = false;
13051
13223
  list.finish = false;
13052
13224
  list.links = [];
13225
+ list.connectUrl = [];
13053
13226
  this.postMessage(list);
13054
13227
  this.$emit('on-reanser');
13055
13228
  }
@@ -13057,10 +13230,10 @@ const signal = controller.signal;
13057
13230
  });
13058
13231
  ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=script&lang=js
13059
13232
  /* harmony default export */ var src_chatvue_type_script_lang_js = (chatvue_type_script_lang_js);
13060
- ;// 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=1abfa6ce&prod&lang=scss&scoped=true
13233
+ ;// 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=069a8301&prod&lang=scss&scoped=true
13061
13234
  // extracted by mini-css-extract-plugin
13062
13235
 
13063
- ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=style&index=0&id=1abfa6ce&prod&lang=scss&scoped=true
13236
+ ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=style&index=0&id=069a8301&prod&lang=scss&scoped=true
13064
13237
 
13065
13238
  ;// CONCATENATED MODULE: ./components/demo/src/chat.vue
13066
13239
 
@@ -13073,11 +13246,11 @@ const signal = controller.signal;
13073
13246
 
13074
13247
  var chat_component = normalizeComponent(
13075
13248
  src_chatvue_type_script_lang_js,
13076
- chatvue_type_template_id_1abfa6ce_scoped_true_render,
13077
- chatvue_type_template_id_1abfa6ce_scoped_true_staticRenderFns,
13249
+ chatvue_type_template_id_069a8301_scoped_true_render,
13250
+ chatvue_type_template_id_069a8301_scoped_true_staticRenderFns,
13078
13251
  false,
13079
13252
  null,
13080
- "1abfa6ce",
13253
+ "069a8301",
13081
13254
  null
13082
13255
 
13083
13256
  )
@@ -13236,6 +13409,10 @@ var api = init(defaultConverter, { path: '/' });
13236
13409
  resId: {
13237
13410
  type: String,
13238
13411
  default: ''
13412
+ },
13413
+ openCourseId: {
13414
+ type: String,
13415
+ default: ''
13239
13416
  }
13240
13417
  },
13241
13418
  watch: {
@@ -13283,8 +13460,10 @@ var api = init(defaultConverter, { path: '/' });
13283
13460
  }
13284
13461
  this.$emit('close');
13285
13462
  },
13286
- selectModule() {
13463
+ selectModule(hotKey) {
13287
13464
  this.chatShow = true;
13465
+ this.aiMessage = hotKey;
13466
+ this.goChat({});
13288
13467
  },
13289
13468
  showHot() {
13290
13469
  this.chatShow = false;
@@ -13297,9 +13476,17 @@ var api = init(defaultConverter, { path: '/' });
13297
13476
  const {
13298
13477
  chatMajorId
13299
13478
  } = listRes[0];
13300
- this.chatMajorId = chatMajorId.toString();
13479
+ this.chatMajorId = chatMajorId && chatMajorId.toString();
13301
13480
  const cacheArray = [];
13302
13481
  currentList.map(list => {
13482
+ let allIdWithStart = true;
13483
+ if (this.chatMajorId && list.references) {
13484
+ list.references.map(item => {
13485
+ if (!item.title.startsWith(this.chatMajorId)) {
13486
+ allIdWithStart = false;
13487
+ }
13488
+ });
13489
+ }
13303
13490
  const obj = {
13304
13491
  type: list.role === 'assistant' ? 'robot' : 'user',
13305
13492
  message: list.content.replace(/\n/g, '<br>'),
@@ -13308,9 +13495,11 @@ var api = init(defaultConverter, { path: '/' });
13308
13495
  stop: list.status === 1,
13309
13496
  finish: true,
13310
13497
  links: list.references || [],
13498
+ connectUrl: list.connectUrls || [],
13311
13499
  reAnswerCount: 0,
13312
13500
  msgId: list.contentId,
13313
- parentMsgId: list.parentMsgId
13501
+ parentMsgId: list.parentMsgId,
13502
+ allIdWithStart
13314
13503
  };
13315
13504
  cacheArray.push(obj);
13316
13505
  });
@@ -13389,10 +13578,10 @@ var api = init(defaultConverter, { path: '/' });
13389
13578
  });
13390
13579
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=script&lang=js
13391
13580
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
13392
- ;// 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=7a9bc48c&prod&lang=scss&scoped=true
13581
+ ;// 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=77093a83&prod&lang=scss&scoped=true
13393
13582
  // extracted by mini-css-extract-plugin
13394
13583
 
13395
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=7a9bc48c&prod&lang=scss&scoped=true
13584
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=77093a83&prod&lang=scss&scoped=true
13396
13585
 
13397
13586
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue
13398
13587
 
@@ -13409,7 +13598,7 @@ var main_component = normalizeComponent(
13409
13598
  staticRenderFns,
13410
13599
  false,
13411
13600
  null,
13412
- "7a9bc48c",
13601
+ "77093a83",
13413
13602
  null
13414
13603
 
13415
13604
  )