ai-component-bwx 0.0.14 → 0.0.16

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.
@@ -365,17 +365,6 @@ module.exports.f = function getOwnPropertyNames(it) {
365
365
  };
366
366
 
367
367
 
368
- /***/ }),
369
-
370
- /***/ "062f":
371
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
372
-
373
- "use strict";
374
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_0_id_7d856dfe_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8004");
375
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_0_id_7d856dfe_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_0_id_7d856dfe_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
376
- /* unused harmony reexport * */
377
-
378
-
379
368
  /***/ }),
380
369
 
381
370
  /***/ "07e3":
@@ -1420,17 +1409,6 @@ module.exports = function (it) {
1420
1409
 
1421
1410
  // extracted by mini-css-extract-plugin
1422
1411
 
1423
- /***/ }),
1424
-
1425
- /***/ "276c":
1426
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1427
-
1428
- "use strict";
1429
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_1_id_7d856dfe_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4ed3");
1430
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_1_id_7d856dfe_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_1_id_7d856dfe_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
1431
- /* unused harmony reexport * */
1432
-
1433
-
1434
1412
  /***/ }),
1435
1413
 
1436
1414
  /***/ "294c":
@@ -2798,6 +2776,13 @@ module.exports = function (object, opts) {
2798
2776
  };
2799
2777
 
2800
2778
 
2779
+ /***/ }),
2780
+
2781
+ /***/ "4145":
2782
+ /***/ (function(module, exports, __webpack_require__) {
2783
+
2784
+ // extracted by mini-css-extract-plugin
2785
+
2801
2786
  /***/ }),
2802
2787
 
2803
2788
  /***/ "417f":
@@ -7220,13 +7205,6 @@ src_select.install = function (Vue) {
7220
7205
 
7221
7206
  /***/ }),
7222
7207
 
7223
- /***/ "4ed3":
7224
- /***/ (function(module, exports, __webpack_require__) {
7225
-
7226
- // extracted by mini-css-extract-plugin
7227
-
7228
- /***/ }),
7229
-
7230
7208
  /***/ "4f15":
7231
7209
  /***/ (function(module, exports, __webpack_require__) {
7232
7210
 
@@ -20956,17 +20934,6 @@ module.exports = function (key) {
20956
20934
  };
20957
20935
 
20958
20936
 
20959
- /***/ }),
20960
-
20961
- /***/ "569a":
20962
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
20963
-
20964
- "use strict";
20965
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_0_id_0902c76a_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("99df");
20966
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_0_id_0902c76a_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_0_id_0902c76a_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
20967
- /* unused harmony reexport * */
20968
-
20969
-
20970
20937
  /***/ }),
20971
20938
 
20972
20939
  /***/ "5701":
@@ -66267,6 +66234,13 @@ module.exports = function (name) {
66267
66234
  };
66268
66235
 
66269
66236
 
66237
+ /***/ }),
66238
+
66239
+ /***/ "6856":
66240
+ /***/ (function(module, exports, __webpack_require__) {
66241
+
66242
+ // extracted by mini-css-extract-plugin
66243
+
66270
66244
  /***/ }),
66271
66245
 
66272
66246
  /***/ "69d3":
@@ -67911,6 +67885,17 @@ var index = (function () {
67911
67885
 
67912
67886
  /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
67913
67887
 
67888
+ /***/ }),
67889
+
67890
+ /***/ "6eb7":
67891
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
67892
+
67893
+ "use strict";
67894
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_1_id_1ac384ce_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4145");
67895
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_1_id_1ac384ce_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_1_id_1ac384ce_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
67896
+ /* unused harmony reexport * */
67897
+
67898
+
67914
67899
  /***/ }),
67915
67900
 
67916
67901
  /***/ "71c1":
@@ -68613,13 +68598,6 @@ checkbox_group.install = function (Vue) {
68613
68598
 
68614
68599
  /***/ }),
68615
68600
 
68616
- /***/ "8004":
68617
- /***/ (function(module, exports, __webpack_require__) {
68618
-
68619
- // extracted by mini-css-extract-plugin
68620
-
68621
- /***/ }),
68622
-
68623
68601
  /***/ "8122":
68624
68602
  /***/ (function(module, exports, __webpack_require__) {
68625
68603
 
@@ -69286,6 +69264,13 @@ module.exports = {
69286
69264
  };
69287
69265
 
69288
69266
 
69267
+ /***/ }),
69268
+
69269
+ /***/ "84fc":
69270
+ /***/ (function(module, exports, __webpack_require__) {
69271
+
69272
+ // extracted by mini-css-extract-plugin
69273
+
69289
69274
  /***/ }),
69290
69275
 
69291
69276
  /***/ "852e":
@@ -70343,13 +70328,6 @@ module.exports = {
70343
70328
  };
70344
70329
 
70345
70330
 
70346
- /***/ }),
70347
-
70348
- /***/ "99df":
70349
- /***/ (function(module, exports, __webpack_require__) {
70350
-
70351
- // extracted by mini-css-extract-plugin
70352
-
70353
70331
  /***/ }),
70354
70332
 
70355
70333
  /***/ "9aa9":
@@ -70421,6 +70399,17 @@ var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
70421
70399
  * https://github.com/Matt-Esch/string-template/index.js
70422
70400
  */
70423
70401
 
70402
+ /***/ }),
70403
+
70404
+ /***/ "9dd2":
70405
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
70406
+
70407
+ "use strict";
70408
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_0_id_1ac384ce_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("6856");
70409
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_0_id_1ac384ce_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_0_id_1ac384ce_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
70410
+ /* unused harmony reexport * */
70411
+
70412
+
70424
70413
  /***/ }),
70425
70414
 
70426
70415
  /***/ "9e6a":
@@ -71938,14 +71927,10 @@ module.exports = ExecutionEnvironment;
71938
71927
 
71939
71928
  /***/ }),
71940
71929
 
71941
- /***/ "a60f":
71942
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
71943
-
71944
- "use strict";
71945
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_1_id_0902c76a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("acbc");
71946
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_1_id_0902c76a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_banwoxueAgentComponent_vue_vue_type_style_index_1_id_0902c76a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
71947
- /* unused harmony reexport * */
71930
+ /***/ "a4f7":
71931
+ /***/ (function(module, exports, __webpack_require__) {
71948
71932
 
71933
+ // extracted by mini-css-extract-plugin
71949
71934
 
71950
71935
  /***/ }),
71951
71936
 
@@ -72008,10 +71993,14 @@ var isDefined = exports.isDefined = function isDefined(val) {
72008
71993
 
72009
71994
  /***/ }),
72010
71995
 
72011
- /***/ "acbc":
72012
- /***/ (function(module, exports, __webpack_require__) {
71996
+ /***/ "aa19":
71997
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
71998
+
71999
+ "use strict";
72000
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_1_id_21adfc82_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a4f7");
72001
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_1_id_21adfc82_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_1_id_21adfc82_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
72002
+ /* unused harmony reexport * */
72013
72003
 
72014
- // extracted by mini-css-extract-plugin
72015
72004
 
72016
72005
  /***/ }),
72017
72006
 
@@ -73478,6 +73467,17 @@ exports.default = function (instance, callback) {
73478
73467
  * @param {Boolean} once weather bind after-leave once. default value is false.
73479
73468
  */
73480
73469
 
73470
+ /***/ }),
73471
+
73472
+ /***/ "c67e":
73473
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
73474
+
73475
+ "use strict";
73476
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_0_id_21adfc82_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("84fc");
73477
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_0_id_21adfc82_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_chat_vue_vue_type_style_index_0_id_21adfc82_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
73478
+ /* unused harmony reexport * */
73479
+
73480
+
73481
73481
  /***/ }),
73482
73482
 
73483
73483
  /***/ "c8af":
@@ -79689,23 +79689,23 @@ if (typeof window !== 'undefined') {
79689
79689
  // Indicate to webpack that this file can be concatenated
79690
79690
  /* harmony default export */ var setPublicPath = (null);
79691
79691
 
79692
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"404717ef-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/banwoxueAgentComponent.vue?vue&type=template&id=0902c76a&scoped=true
79692
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"404717ef-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/banwoxueAgentComponent.vue?vue&type=template&id=1ac384ce&scoped=true
79693
79693
  var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticStyle:{"height":"400vh"}},[(_vm.AiShow)?_c('div',{ref:"banwoxueAgentComponent",staticClass:"banwoxueAgentComponent"},[_c('div',{staticClass:"close",on:{"click":function($event){_vm.AiShow = !_vm.AiShow}}},[_vm._v("✕")]),_c('div',{staticClass:"left_dialogueList",class:{ collapsed: _vm.isSidebarCollapsed }},[_c('div',{staticClass:"sidebar-toggle",on:{"click":_vm.toggleSidebar}},[_c('i',{class:_vm.isSidebarCollapsed ? 'el-icon-arrow-right' : 'el-icon-arrow-left'})]),_c('transition',{attrs:{"name":"slide-fade","mode":"out-in"}},[_c('dialogueList',{directives:[{name:"show",rawName:"v-show",value:(!_vm.isSidebarCollapsed),expression:"!isSidebarCollapsed"}],attrs:{"modelList":_vm.modelList}})],1)],1),_c('div',{staticClass:"draw-content"},[(!_vm.chatShow)?_c('div',{staticClass:"moxing"},[_c('popularAndCommand')],1):_vm._e(),_c('transition',{attrs:{"name":"el-zoom-in-top"}},[(_vm.chatShow)?_c('div',{staticClass:"chat"},[_c('chat',{ref:"chat",attrs:{"sideCurrentId":_vm.sideCurrentId,"sideCurrentName":_vm.sideCurrentName,"messageListData":_vm.messageListData,"chatType":1},on:{"openLessonSidebar":_vm.handleOpenLessonSidebar,"openPptSidebar":_vm.handleOpenPptSidebar}})],1):_vm._e()]),_c('div',{staticClass:"foot"},[_c('div',{staticClass:"inputField"},[_c('div',{staticClass:"function-buttons"},_vm._l((_vm.planList),function(i){return _c('div',{key:i.id,staticClass:"ai-btnja",class:{ active: _vm.selectedButton === i.id },on:{"click":function($event){return _vm.handleChange(i)}}},[_vm._v(" "+_vm._s(i.title)+" ")])}),0),(_vm.selectedButton == 1)?_c('div',{staticClass:"lesson-plan-template",on:{"keydown":function($event){return _vm.handleKeydown($event, 1)}}},[_c('span',{staticStyle:{"color":"#5b58e3"}},[_vm._v("AI教案   ")]),_c('span',[_vm._v("帮我写一份关于")]),_c('span',{ref:"subject",staticClass:"editable-part",attrs:{"contenteditable":"true","data-placeholder":"[课程名称]"}}),_c('span',[_vm._v("的教案,教材名称为")]),_c('span',{ref:"grade",staticClass:"editable-part",attrs:{"contenteditable":"true","data-placeholder":"[如:新闻采访与写作]"}}),_c('span',[_vm._v(",专业学科为")]),_c('span',{ref:"course",staticClass:"editable-part",attrs:{"contenteditable":"true","data-placeholder":"[如:数学]"}}),_c('span',[_vm._v("。")]),_c('button',{staticClass:"generate-btn",on:{"click":_vm.generateLessonPlan}},[_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/66223df144904d83a5aa97edfcbbb256/send.png","alt":"生成"}})])]):(_vm.selectedButton == 2)?_c('div',{staticClass:"lesson-plan-template",on:{"keydown":function($event){return _vm.handleKeydown($event, 2)}}},[_c('span',{staticStyle:{"color":"#5b58e3"}},[_vm._v("AI PPT   ")]),_c('span',[_vm._v("帮我生成PPT,主题为")]),_c('span',{ref:"PPTTitle",staticClass:"editable-part",attrs:{"contenteditable":"true","data-placeholder":"[PPT主题]"}}),_c('span',[_vm._v("。")]),_c('button',{staticClass:"generate-btn",on:{"click":_vm.generateLessonPlanPPT}},[_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/66223df144904d83a5aa97edfcbbb256/send.png","alt":"生成"}})])]):_c('div',{staticClass:"input-container",staticStyle:{"position":"relative","display":"inline-block"}},[_c('el-input',{ref:"input",style:({ resize: 'none' }),attrs:{"type":"textarea","rows":2,"placeholder":_vm.placeholder,"disabled":_vm.voice},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter"))return null;return _vm.handleEnterKey.apply(null, arguments)}},model:{value:(_vm.userInput),callback:function ($$v) {_vm.userInput=$$v},expression:"userInput"}}),_c('div',{staticClass:"send",staticStyle:{"position":"absolute","right":"10px","bottom":"10px"},on:{"click":_vm.handleEnterKey}},[_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/66223df144904d83a5aa97edfcbbb256/send.png","alt":"发送"}})])],1)]),_c('foot')],1)],1),(_vm.aiJaDrawer)?_c('div',{staticClass:"right-sidebar",attrs:{"id":"rightSidebar"}},[_c('JiaoAnContent',{attrs:{"tableHtml":_vm.tableHtml,"content":_vm.content}})],1):_vm._e(),(_vm.aiPptDrawer)?_c('div',{staticClass:"right-sidebar",attrs:{"id":"pptSidebar"}},[_c('PptContent',{attrs:{"pptSections":_vm.pptSections,"images_url":_vm.images_url},on:{"regenerate":_vm.handleRegeneratePpt}})],1):_vm._e(),_c('LessonPlanTemplateDialog',{attrs:{"visible":_vm.showTemplateDialog},on:{"update:visible":function($event){_vm.showTemplateDialog=$event},"template-selected":_vm.handleTemplateSelected}}),(_vm.showPptTemplateDialog)?_c('PptTemplateDialog',{on:{"template-selected":_vm.handlePptTemplateSelected}}):_vm._e()],1):_c('div',{staticClass:"logoShow",on:{"click":_vm.showAenget}},[_c('img',{attrs:{"src":_vm.agentArr,"alt":""}})])])
79694
79694
  }
79695
79695
  var staticRenderFns = []
79696
79696
 
79697
79697
 
79698
- // CONCATENATED MODULE: ./src/components/banwoxueAgentComponent.vue?vue&type=template&id=0902c76a&scoped=true
79698
+ // CONCATENATED MODULE: ./src/components/banwoxueAgentComponent.vue?vue&type=template&id=1ac384ce&scoped=true
79699
79699
 
79700
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"404717ef-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/agentComponent/chat.vue?vue&type=template&id=7d856dfe&scoped=true
79701
- var chatvue_type_template_id_7d856dfe_scoped_true_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"contents"},[_c('div',{staticClass:"addDia"},[_c('div',{staticClass:"chat_window"},[_c('div',{staticClass:"conWindow"},[_c('div',{ref:"recordListRef",staticClass:"messageBox"},[_c('ul',{staticClass:"messages"},[_c('el-checkbox-group',{staticClass:"label-none",model:{value:(_vm.shareList),callback:function ($$v) {_vm.shareList=$$v},expression:"shareList"}},_vm._l((_vm.messageListData),function(item,index){return _c('div',{key:index},[_c('li',{staticClass:"list",class:item.role == 'user' ? 'user_message' : 'replay_message'},[(_vm.shareStatus && item.contentId && item.role != 'user')?_c('el-checkbox',{key:index,attrs:{"label":item.contentId + ',' + item.parentMsgId}}):_vm._e(),_c('div',{staticClass:"chatFrame"},[_c('div',{staticClass:"img"},[(item.role == 'user')?_c('img',{attrs:{"id":"user","src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/user.png","alt":""}}):_c('img',{attrs:{"id":"gif","src":_vm.gifPath,"alt":""}})]),_c('div',{staticClass:"text-content"},[(item.typeId == 1 || _vm.getJaShow(item))?_c('div',{staticClass:"ai-content-card"},[_c('div',{staticClass:"card-prompt"},[_vm._v(_vm._s(_vm.getPromptText(item)))]),_c('div',{staticClass:"main-card"},[_c('div',{staticClass:"card-left"},[_c('div',{staticClass:"card-icon"},[_c('span',{staticClass:"icon-text"},[_vm._v("T")])]),_c('div',{staticClass:"card-info"},[_c('div',{staticClass:"card-title"},[_vm._v(_vm._s(_vm.getCardTitle(item)))]),_c('div',{staticClass:"card-status"},[_vm._v(_vm._s(item.status == 1 ? '无法预览中途停止的文档' : _vm.getItemLoadingStatus(item) ? '生成中...' : '已完成'))])])]),(!_vm.getItemLoadingStatus(item))?_c('div',{staticClass:"card-actions"},[_c('button',{staticClass:"action-btn view-btn",attrs:{"title":"预览"},on:{"click":function($event){return _vm.previewContent(item)}}},[_c('i',{staticClass:"el-icon-view"})]),_c('button',{staticClass:"action-btn download-btn",attrs:{"title":"下载"},on:{"click":function($event){return _vm.openLessonSidebar(item)}}},[_c('i',{staticClass:"el-icon-download"})])]):_vm._e()]),_c('div',{staticClass:"card-prompt"},[_vm._v(_vm._s(_vm.getPromptLastText(item)))])]):(item.typeId == 2 || _vm.getPptShow(item))?_c('div',{staticClass:"ai-content-card"},[(_vm.tempAnswerStatus == 0)?_c('div',{staticClass:"card-prompt"},[_vm._v("为你生成PPT中,生成过程大约需要1分钟,请耐心等待~")]):_c('div',{staticClass:"card-prompt"},[_vm._v("PPT 已生成完成!点击下方按钮即可查看、下载或编辑。")]),_c('div',{staticClass:"main-card"},[_c('div',{staticClass:"card-left"},[_c('div',{staticClass:"card-icon"},[_c('span',{staticClass:"icon-text"},[_vm._v("P")])]),_c('div',{staticClass:"card-info"},[_c('div',{staticClass:"card-status"},[_vm._v(_vm._s(item.status == 1 ? '无法预览中途停止的文档' : item.status == 2 ? '已完成' : '生成中...'))])])]),(item.status == 2)?_c('div',{staticClass:"card-actions"},[_c('button',{staticClass:"action-btn view-btn",attrs:{"title":"预览"},on:{"click":function($event){return _vm.pptPreviewContent(item)}}},[_c('i',{staticClass:"el-icon-view"})]),_c('button',{staticClass:"action-btn download-btn",attrs:{"title":"下载"},on:{"click":function($event){return _vm.pptDownload(item)}}},[_c('i',{staticClass:"el-icon-download"})])]):_vm._e()]),_c('div',{staticClass:"card-prompt"},[_vm._v(_vm._s(_vm.getPromptLastText(item)))])]):_c('div',[_c('div',{staticClass:"text",domProps:{"innerHTML":_vm._s(item.content || '暂无内容')}}),( false)?undefined:_vm._e()]),(item.role == 'assistant' && item.status == 1)?_c('div',{staticClass:"stopped"},[_vm._v("已停止生成")]):_vm._e()]),_c('div',{staticClass:"reloadAnswer"},[(_vm.tempAnswerStatus != 0 && !item.panelId && item.role == 'assistant')?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/fuzhi1.png","title":"复制","alt":"复制"},on:{"click":function($event){return _vm.clickCopy(item.content)}}}):_vm._e(),(item.role == 'assistant' && item.contentId)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/zhongxintijiao1.png","title":"重新生成"},on:{"click":function($event){return _vm.ReloadAnswer(index, true, item)}}}):_vm._e(),((index != _vm.messageListData.length - 1 || _vm.tempAnswerStatus != 0) && item.role == 'assistant' && item.feedbackType != 1)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/dianzan1.png","title":"好评"},on:{"click":function($event){return _vm.showLikeOptions(index, $event)}}}):_vm._e(),((index != _vm.messageListData.length - 1 || _vm.tempAnswerStatus != 0) && item.role == 'assistant' && item.feedbackType == 1)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/dianzan2.png","title":"好评"},on:{"click":function($event){return _vm.showLikeOptions(index)}}}):_vm._e(),((index != _vm.messageListData.length - 1 || _vm.tempAnswerStatus != 0) && item.role == 'assistant' && item.feedbackType != 2)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/chaping1.png","title":"差评"},on:{"click":function($event){return _vm.showDislikeModal(index)}}}):_vm._e(),((index != _vm.messageListData.length - 1 || _vm.tempAnswerStatus != 0) && item.role == 'assistant' && item.feedbackType == 2)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/chaping2.png","title":"差评"},on:{"click":function($event){return _vm.showDislikeModal(index)}}}):_vm._e(),(index == _vm.messageListData.length - 1 && _vm.tempAnswerStatus == 0)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/zanting1.png","title":"停止输出"},on:{"click":function($event){return _vm.stopMessage(item)}}}):_vm._e()])])],1)])}),0),(_vm.chatSending)?_c('div',{staticClass:"loading-message"},[_c('div',{staticClass:"list replay_message"},[_c('div',{staticClass:"chatFrame"},[_c('div',{staticClass:"img"},[_c('img',{attrs:{"id":"gif","src":_vm.gifPath,"alt":""}})]),_vm._m(0)])])]):_vm._e()],1)]),(_vm.shareStatus)?_c('div',{staticClass:"button-option"},[_c('el-button',{on:{"click":_vm.cancleShare}},[_vm._v("取消")]),_c('el-button',{attrs:{"disabled":!_vm.shareList.length || _vm.apiLoading,"loading":_vm.apiLoading},on:{"click":_vm.showDialog}},[_vm._v("确定")])],1):_vm._e(),(_vm.likeOptionsVisible)?_c('div',{staticClass:"like-options-popup",style:(_vm.likePopupStyle)},[_c('div',{staticClass:"like-options-header"},[_c('span',{staticClass:"like-title"},[_vm._v("请选择好评类别")]),_c('i',{staticClass:"el-icon-close",on:{"click":_vm.confirmLikeOptions}})]),_c('div',{staticClass:"like-options-content"},[_c('div',{staticClass:"like-options-row"},_vm._l((_vm.LikeOption),function(i,j){return _c('div',{key:i.id,staticClass:"like-option",class:{ selected: _vm.selectedLikeOptions.includes(i.id) },on:{"click":function($event){return _vm.toggleLikeOption(i.id)}}},[_vm._v(" "+_vm._s(i.name)+" ")])}),0)])]):_vm._e(),(_vm.dislikeModalVisible)?_c('div',{staticClass:"dislike-modal-overlay",on:{"click":_vm.closeDislikeModal}},[_c('div',{staticClass:"dislike-modal",on:{"click":function($event){$event.stopPropagation();}}},[_vm._m(1),_c('div',{staticClass:"dislike-content"},[_c('div',{staticClass:"dislike-options"},_vm._l((_vm.dislikeOption),function(i){return _c('div',{key:i.id,staticClass:"dislike-option",class:{ selected: _vm.selectedDislikeOptions.includes(i.id) },on:{"click":function($event){return _vm.toggleDislikeOption(i.id)}}},[_vm._v(" "+_vm._s(i.name)+" ")])}),0),_c('div',{staticClass:"dislike-textarea"},[_c('textarea',{directives:[{name:"model",rawName:"v-model",value:(_vm.dislikeFeedback),expression:"dislikeFeedback"}],attrs:{"placeholder":"我们想知道您对此回答不满意的原因,您认为更好的回答是什么?","rows":"4"},domProps:{"value":(_vm.dislikeFeedback)},on:{"input":function($event){if($event.target.composing)return;_vm.dislikeFeedback=$event.target.value}}})]),_c('div',{staticClass:"dislike-actions"},[_c('button',{staticClass:"cancel-btn",on:{"click":_vm.closeDislikeModal}},[_vm._v("取消")]),_c('button',{staticClass:"submit-btn",on:{"click":_vm.submitDislikeFeedback}},[_vm._v("提交")])])])])]):_vm._e()])])])])
79700
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"404717ef-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/agentComponent/chat.vue?vue&type=template&id=21adfc82&scoped=true
79701
+ var chatvue_type_template_id_21adfc82_scoped_true_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"contents"},[_c('div',{staticClass:"addDia"},[_c('div',{staticClass:"chat_window"},[_c('div',{staticClass:"conWindow"},[_c('div',{ref:"recordListRef",staticClass:"messageBox"},[_c('ul',{staticClass:"messages"},[_c('el-checkbox-group',{staticClass:"label-none",model:{value:(_vm.shareList),callback:function ($$v) {_vm.shareList=$$v},expression:"shareList"}},_vm._l((_vm.messageListData),function(item,index){return _c('div',{key:index},[_c('li',{staticClass:"list",class:item.role == 'user' ? 'user_message' : 'replay_message'},[(_vm.shareStatus && item.contentId && item.role != 'user')?_c('el-checkbox',{key:index,attrs:{"label":item.contentId + ',' + item.parentMsgId}}):_vm._e(),_c('div',{staticClass:"chatFrame"},[_c('div',{staticClass:"img"},[(item.role == 'user')?_c('img',{attrs:{"id":"user","src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/user.png","alt":""}}):_c('img',{attrs:{"id":"gif","src":_vm.gifPath,"alt":""}})]),_c('div',{staticClass:"text-content"},[(item.typeId == 1 || _vm.getJaShow(item))?_c('div',{staticClass:"ai-content-card"},[_c('div',{staticClass:"card-prompt"},[_vm._v(_vm._s(_vm.getPromptText(item)))]),_c('div',{staticClass:"main-card"},[_c('div',{staticClass:"card-left"},[_c('div',{staticClass:"card-icon"},[_c('span',{staticClass:"icon-text"},[_vm._v("T")])]),_c('div',{staticClass:"card-info"},[_c('div',{staticClass:"card-title"},[_vm._v(_vm._s(_vm.getCardTitle(item)))]),_c('div',{staticClass:"card-status"},[_vm._v(_vm._s(item.status == 1 ? '无法预览中途停止的文档' : _vm.getItemLoadingStatus(item) ? '生成中...' : '已完成'))])])]),(!_vm.getItemLoadingStatus(item))?_c('div',{staticClass:"card-actions"},[_c('button',{staticClass:"action-btn view-btn",attrs:{"title":"预览"},on:{"click":function($event){return _vm.previewContent(item)}}},[_c('i',{staticClass:"el-icon-view"})]),_c('button',{staticClass:"action-btn download-btn",attrs:{"title":"下载"},on:{"click":function($event){return _vm.openLessonSidebar(item)}}},[_c('i',{staticClass:"el-icon-download"})])]):_vm._e()]),_c('div',{staticClass:"card-prompt"},[_vm._v(_vm._s(_vm.getPromptLastText(item)))])]):(item.typeId == 2 || _vm.getPptShow(item))?_c('div',{staticClass:"ai-content-card"},[(_vm.tempAnswerStatus == 0)?_c('div',{staticClass:"card-prompt"},[_vm._v("为你生成PPT中,生成过程大约需要1分钟,请耐心等待~")]):_c('div',{staticClass:"card-prompt"},[_vm._v("PPT 已生成完成!点击下方按钮即可查看、下载或编辑。")]),_c('div',{staticClass:"main-card"},[_c('div',{staticClass:"card-left"},[_c('div',{staticClass:"card-icon"},[_c('span',{staticClass:"icon-text"},[_vm._v("P")])]),_c('div',{staticClass:"card-info"},[_c('div',{staticClass:"card-status"},[_vm._v(_vm._s(item.status == 1 ? '无法预览中途停止的文档' : item.status == 2 ? '已完成' : '生成中...'))])])]),(item.status == 2)?_c('div',{staticClass:"card-actions"},[_c('button',{staticClass:"action-btn view-btn",attrs:{"title":"预览"},on:{"click":function($event){return _vm.pptPreviewContent(item)}}},[_c('i',{staticClass:"el-icon-view"})]),_c('button',{staticClass:"action-btn download-btn",attrs:{"title":"下载"},on:{"click":function($event){return _vm.pptDownload(item)}}},[_c('i',{staticClass:"el-icon-download"})])]):_vm._e()]),_c('div',{staticClass:"card-prompt"},[_vm._v(_vm._s(_vm.getPromptLastText(item)))])]):_c('div',[_c('div',{staticClass:"text",domProps:{"innerHTML":_vm._s(item.content || '暂无内容')}}),( false)?undefined:_vm._e()]),(item.role == 'assistant' && item.status == 1)?_c('div',{staticClass:"stopped"},[_vm._v("已停止生成")]):_vm._e()]),_c('div',{staticClass:"reloadAnswer"},[(_vm.tempAnswerStatus != 0 && !item.panelId && item.role == 'assistant')?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/fuzhi1.png","title":"复制","alt":"复制"},on:{"click":function($event){return _vm.clickCopy(item.content)}}}):_vm._e(),(item.role == 'assistant' && item.contentId)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/zhongxintijiao1.png","title":"重新生成"},on:{"click":function($event){return _vm.ReloadAnswer(index, true, item)}}}):_vm._e(),((index != _vm.messageListData.length - 1 || _vm.tempAnswerStatus != 0) && item.role == 'assistant' && item.feedbackType != 1)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/dianzan1.png","title":"好评"},on:{"click":function($event){return _vm.showLikeOptions(index, $event)}}}):_vm._e(),((index != _vm.messageListData.length - 1 || _vm.tempAnswerStatus != 0) && item.role == 'assistant' && item.feedbackType == 1)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/dianzan2.png","title":"好评"},on:{"click":function($event){return _vm.showLikeOptions(index)}}}):_vm._e(),((index != _vm.messageListData.length - 1 || _vm.tempAnswerStatus != 0) && item.role == 'assistant' && item.feedbackType != 2)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/chaping1.png","title":"差评"},on:{"click":function($event){return _vm.showDislikeModal(index)}}}):_vm._e(),((index != _vm.messageListData.length - 1 || _vm.tempAnswerStatus != 0) && item.role == 'assistant' && item.feedbackType == 2)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/chaping2.png","title":"差评"},on:{"click":function($event){return _vm.showDislikeModal(index)}}}):_vm._e(),(index == _vm.messageListData.length - 1 && _vm.tempAnswerStatus == 0)?_c('img',{attrs:{"src":"https://file.banwoxue.com/aiAgent/d8295edcd4494319951597ff954e3a63/zanting1.png","title":"停止输出"},on:{"click":function($event){return _vm.stopMessage(item)}}}):_vm._e()])])],1)])}),0),(_vm.chatSending)?_c('div',{staticClass:"loading-message"},[_c('div',{staticClass:"list replay_message"},[_c('div',{staticClass:"chatFrame"},[_c('div',{staticClass:"img"},[_c('img',{attrs:{"id":"gif","src":_vm.gifPath,"alt":""}})]),_vm._m(0)])])]):_vm._e()],1)]),(_vm.shareStatus)?_c('div',{staticClass:"button-option"},[_c('el-button',{on:{"click":_vm.cancleShare}},[_vm._v("取消")]),_c('el-button',{attrs:{"disabled":!_vm.shareList.length || _vm.apiLoading,"loading":_vm.apiLoading},on:{"click":_vm.showDialog}},[_vm._v("确定")])],1):_vm._e(),(_vm.likeOptionsVisible)?_c('div',{staticClass:"like-options-popup",style:(_vm.likePopupStyle)},[_c('div',{staticClass:"like-options-header"},[_c('span',{staticClass:"like-title"},[_vm._v("请选择好评类别")]),_c('i',{staticClass:"el-icon-close",on:{"click":_vm.confirmLikeOptions}})]),_c('div',{staticClass:"like-options-content"},[_c('div',{staticClass:"like-options-row"},_vm._l((_vm.LikeOption),function(i,j){return _c('div',{key:i.id,staticClass:"like-option",class:{ selected: _vm.selectedLikeOptions.includes(i.id) },on:{"click":function($event){return _vm.toggleLikeOption(i.id)}}},[_vm._v(" "+_vm._s(i.name)+" ")])}),0)])]):_vm._e(),(_vm.dislikeModalVisible)?_c('div',{staticClass:"dislike-modal-overlay",on:{"click":_vm.closeDislikeModal}},[_c('div',{staticClass:"dislike-modal",on:{"click":function($event){$event.stopPropagation();}}},[_vm._m(1),_c('div',{staticClass:"dislike-content"},[_c('div',{staticClass:"dislike-options"},_vm._l((_vm.dislikeOption),function(i){return _c('div',{key:i.id,staticClass:"dislike-option",class:{ selected: _vm.selectedDislikeOptions.includes(i.id) },on:{"click":function($event){return _vm.toggleDislikeOption(i.id)}}},[_vm._v(" "+_vm._s(i.name)+" ")])}),0),_c('div',{staticClass:"dislike-textarea"},[_c('textarea',{directives:[{name:"model",rawName:"v-model",value:(_vm.dislikeFeedback),expression:"dislikeFeedback"}],attrs:{"placeholder":"我们想知道您对此回答不满意的原因,您认为更好的回答是什么?","rows":"4"},domProps:{"value":(_vm.dislikeFeedback)},on:{"input":function($event){if($event.target.composing)return;_vm.dislikeFeedback=$event.target.value}}})]),_c('div',{staticClass:"dislike-actions"},[_c('button',{staticClass:"cancel-btn",on:{"click":_vm.closeDislikeModal}},[_vm._v("取消")]),_c('button',{staticClass:"submit-btn",on:{"click":_vm.submitDislikeFeedback}},[_vm._v("提交")])])])])]):_vm._e()])])])])
79702
79702
  }
79703
- var chatvue_type_template_id_7d856dfe_scoped_true_staticRenderFns = [function (){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"text-content"},[_c('div',{staticClass:"loading-container"},[_c('div',{staticClass:"typing-indicator"},[_c('div',{staticClass:"typing-dot"}),_c('div',{staticClass:"typing-dot"}),_c('div',{staticClass:"typing-dot"})]),_c('span',{staticClass:"loading-text"},[_vm._v("AI正在思考中...")])])])
79703
+ var chatvue_type_template_id_21adfc82_scoped_true_staticRenderFns = [function (){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"text-content"},[_c('div',{staticClass:"loading-container"},[_c('div',{staticClass:"typing-indicator"},[_c('div',{staticClass:"typing-dot"}),_c('div',{staticClass:"typing-dot"}),_c('div',{staticClass:"typing-dot"})]),_c('span',{staticClass:"loading-text"},[_vm._v("AI正在思考中...")])])])
79704
79704
  },function (){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"dislike-header"},[_c('h3',{staticClass:"dislike-title"},[_vm._v("反馈")])])
79705
79705
  }]
79706
79706
 
79707
79707
 
79708
- // CONCATENATED MODULE: ./src/components/agentComponent/chat.vue?vue&type=template&id=7d856dfe&scoped=true
79708
+ // CONCATENATED MODULE: ./src/components/agentComponent/chat.vue?vue&type=template&id=21adfc82&scoped=true
79709
79709
 
79710
79710
  // CONCATENATED MODULE: ./src/utils/errorCode.js
79711
79711
  /* harmony default export */ var errorCode = ({
@@ -80330,1149 +80330,1145 @@ var html_docx = __webpack_require__("4f15");
80330
80330
  var FileSaver_min = __webpack_require__("21a6");
80331
80331
 
80332
80332
  // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/agentComponent/chat.vue?vue&type=script&lang=js
80333
-
80334
-
80335
-
80336
-
80337
- const chatvue_type_script_lang_js_controller = new AbortController();
80338
- const chatvue_type_script_lang_js_signal = chatvue_type_script_lang_js_controller.signal;
80339
-
80340
-
80341
- /* harmony default export */ var chatvue_type_script_lang_js = ({
80342
- name: 'APP',
80343
- props: {
80344
- firstChatShow: {
80345
- type: Boolean,
80346
- },
80347
- messageListData: {
80348
- type: Array,
80349
- },
80350
- activeName: {
80351
- type: String,
80352
- },
80353
-
80354
- sideCurrentName: {
80355
- type: String,
80356
- },
80357
- sideCurrentId: {
80358
- type: String,
80359
- },
80360
-
80361
- userId: {
80362
- type: Number,
80363
- },
80364
- chatType: {
80365
- type: Number,
80366
- },
80367
- },
80368
- data() {
80369
- return {
80370
- gifPath: 'https://file.banwoxue.com/aiAgent/c3578c424c674dedaf01f3db9592aafb/zhayan.gif',
80371
- shareText: '',
80372
- userInput: '',
80373
- popoverStatus: false,
80374
- contents: [], //分享内容
80375
- // canSubmit:false,
80376
- input: '',
80377
- errors: [],
80378
- VoiceShow: true,
80379
- waitAnswer: false,
80380
- shareMsgId: '',
80381
- // API请求等待状态
80382
- apiLoading: false,
80383
- // 聊天发送状态
80384
- chatSending: false,
80385
- // 滚动定时器
80386
- scrollTimer: null,
80387
- // 程序滚动标志
80388
- programmaticScrolling: false,
80389
- // 自动滚动开关
80390
- autoScroll: true,
80391
- // 用户滚动检测定时器
80392
- userScrollTimer: null,
80393
- checked1: false,
80394
- checked2: false,
80395
- checked3: false,
80396
- checked4: false,
80397
- checked5: false,
80398
- checked6: false,
80399
- errorList: [
80400
- {
80401
- error: '格式问题',
80402
- },
80403
- {
80404
- error: '逻辑问题',
80405
- },
80406
- {
80407
- error: '有害信息',
80408
- },
80409
- {
80410
- error: '事实错误',
80411
- },
80412
- {
80413
- error: '没有帮助',
80414
- },
80415
- {
80416
- error: '答非所问',
80417
- },
80418
- ],
80419
- // 点赞标识
80420
- zanShow: false,
80421
- checkList: [],
80422
- dialogue: this.$parent.dialogue || [],
80423
- shareDialog: false,
80424
- shareStatus: false, // 点击分享
80425
- // 拉踩标识
80426
- caiShow: false,
80427
- shareList: [],
80428
- // 分享标识
80429
- shareShow: false,
80430
- chatId: '',
80431
- // 复制标识
80432
- copyShow: false,
80433
- returnText: '', // 服务器返回数据
80434
- tempAnswerStatus: null,
80435
- modelName: 'chatglm3-6b',
80436
- currentIndex: 0,
80437
- templateId: '',
80438
- panelId: '',
80439
- // 好评选项弹窗相关
80440
- likeOptionsVisible: false,
80441
- likePopupStyle: {},
80442
- currentLikeItem: null,
80443
- selectedLikeOptions: [], // 多选的好评选项
80444
- LikeOption: [
80445
- {
80446
- id: 1,
80447
- name: '问题定位准确',
80448
- },
80449
- {
80450
- id: 2,
80451
- name: '回答对您有用',
80452
- },
80453
- {
80454
- id: 3,
80455
- name: '交互性好',
80456
- },
80457
- {
80458
- id: 4,
80459
- name: '界面好看',
80460
- },
80461
- {
80462
- id: 5,
80463
- name: '其他',
80464
- },
80465
- ],
80466
- // 差评反馈弹窗相关
80467
- dislikeModalVisible: false,
80468
- dislikeOption: [
80469
- {
80470
- id: 1,
80471
- name: '问题定位不准确',
80472
- },
80473
- {
80474
- id: 2,
80475
- name: '没有帮助',
80476
- },
80477
- {
80478
- id: 3,
80479
- name: '交互体验差',
80480
- },
80481
- {
80482
- id: 4,
80483
- name: '智能性差',
80484
- },
80485
- {
80486
- id: 5,
80487
- name: '功能不够强大',
80488
- },
80489
- {
80490
- id: 6,
80491
- name: '其他',
80492
- },
80493
- ],
80494
- currentDislikeItem: null,
80495
- selectedDislikeOptions: [], // 多选的差评选项
80496
- dislikeFeedback: '', // 差评文本反馈
80497
- };
80498
- },
80499
- computed: {
80500
- stop() {
80501
- return this.$parent.stop;
80502
- },
80503
- canSubmit() {
80504
- return this.errors.length == 0 && this.input == '';
80505
- },
80506
- getType() {
80507
- return sessionStorage.getItem('type') || 1;
80508
- },
80509
- // 计算每个消息项的加载状态
80510
- getItemLoadingStatus() {
80511
- return (item) => {
80512
- if (!item.content) return false;
80513
- const hasStartTag = item.content.includes('<!--AI_HTML-->');
80514
- const hasEndTag = item.content.includes('<!--/AI_HTML-->');
80515
- // 如果有开始标签但没有结束标签,说明正在生成中
80516
- return hasStartTag && !hasEndTag;
80517
- };
80518
- },
80519
- },
80520
- methods: {
80521
- // 获取卡片标题
80522
- getCardTitle(item) {
80523
- // const content = item.content.toLowerCase();
80524
- return 'AI教学设计方案';
80525
- },
80526
- //判断是否为教案
80527
- getJaShow(item) {
80528
- const str = item.content;
80529
- const target = '<!--AI_HTML-->';
80530
- // 找到目标字符串的位置
80531
- const index = str.indexOf(target);
80532
- // 截取目标字符串之前的内容(若目标不存在则返回原字符串)
80533
- const result = index !== -1 ? true : false;
80534
- return result;
80535
- },
80536
- // 获取提示文本
80537
- getPromptText(item) {
80538
- const str = item.content;
80539
- const target = '<!--AI_HTML-->';
80540
- // 找到目标字符串的位置
80541
- const index = str.indexOf(target);
80542
- // 截取目标字符串之前的内容(若目标不存在则返回原字符串)
80543
- const result = index !== -1 ? str.slice(0, index) : str;
80544
- // 移除在渲染函数中修改数据的逻辑,避免无限更新循环
80545
- // if (index !== -1) {
80546
- // this.loadingStatus = true;
80547
- // }
80548
- return result;
80549
- },
80550
- getPromptLastText(item) {
80551
- const str = item.content;
80552
- const target = '<!--/AI_HTML-->';
80553
- // 找到目标字符串的位置
80554
- const index = str.indexOf(target);
80555
- // 截取目标字符串之后的内容(若目标不存在则返回原字符串)
80556
- const result = index !== -1 ? str.slice(index + target.length) : '';
80557
- // 移除在渲染函数中修改数据的逻辑,避免无限更新循环
80558
- // if (index !== -1) {
80559
- // this.loadingStatus = false;
80560
- // }
80561
- return result;
80562
- },
80563
-
80564
- // 获取图标文本
80565
- getIconText(item) {
80566
- const content = item.content ? item.content.toLowerCase() : '';
80567
- if (content.includes('ppt') || content.includes('powerpoint') || content.includes('幻灯片') || (this.$parent && this.$parent.selectedButton === 'aippt')) {
80568
- return 'P';
80569
- }
80570
- return 'T';
80571
- },
80572
- // 预览内容
80573
- previewContent(item) {
80574
- if (!this.$parent.stop) {
80575
- return this.$message({
80576
- message: '对话结束才能预览哦~',
80577
- type: 'warning',
80578
- });
80579
- }
80580
- // 这里可以实现预览功能,比如显示一个预览弹窗
80581
- const target = '<!--AI_HTML-->';
80582
- const index = item.content.indexOf(target);
80583
- // 截取目标字符串之后的内容(若目标不存在则返回原字符串)
80584
- let str = index !== -1 ? item.content.slice(index + target.length) : item.content;
80585
- // 以'<!--/AI_HTML-->'为分隔符分割,最多分割1次
80586
- const parts = str.split('<!--/AI_HTML-->', 2);
80587
- // 返回分割后的第一部分(若不存在分隔符则返回原字符串)
80588
- this.$parent.tableHtml = parts[0] || str;
80589
- this.$parent.content = item;
80590
- this.$parent.isSidebarCollapsed = true;
80591
- this.$emit('openLessonSidebar', item);
80592
- // 如果父组件有aiJaDrawer属性,直接设置
80593
- if (this.$parent && this.$parent.aiJaDrawer !== undefined) {
80594
- this.$parent.aiJaDrawer = true;
80595
- this.$parent.aiPptDrawer = false;
80596
- }
80597
- },
80598
- //判断是否为ppt
80599
- getPptShow(item) {
80600
- const str = item.content;
80601
- const target = 'structure';
80602
- // 找到目标字符串的位置
80603
- const index = str.indexOf(target);
80604
- // 截取目标字符串之前的内容(若目标不存在则返回原字符串)
80605
- const result = index !== -1 ? true : false;
80606
- return result;
80607
- },
80608
- // ppt预览逻辑处理
80609
- pptPreviewContent(item) {
80610
- if (!this.$parent.stop) {
80611
- return this.$message({
80612
- message: '对话结束才能预览哦~',
80613
- type: 'warning',
80614
- });
80615
- }
80616
- const obj = JSON.parse(item.content);
80617
- this.$parent.pptContentId = item.contentId;
80618
-
80619
- this.$parent.PPTTitle = obj.structure.title;
80620
- this.$parent.isSidebarCollapsed = true;
80621
- this.$parent.aiPptDrawer = true;
80622
- this.$parent.aiJaDrawer = false;
80623
- this.$parent.pptSections = obj.structure.catalogs;
80624
- this.$parent.images_url = obj.latestResult.images_url;
80625
- },
80626
- //ppt下载
80627
- pptDownload(item) {
80628
- this.$parent.pptContentId = item.contentId;
80629
- downloadChatPpt(this.$parent.pptContentId).then((res) => {
80630
- const url = res.data.data;
80631
- // window.open(url);
80632
- this.$parent.handleDownload(url);
80633
- });
80634
- },
80635
-
80636
- // 获取内容预览
80637
- getContentPreview(content) {
80638
- if (!content) return '暂无内容';
80639
- // 移除HTML标签并截取前200个字符作为预览
80640
- const textContent = content.replace(/<[^>]*>/g, '');
80641
- return textContent.length > 200 ? textContent.substring(0, 200) + '...' : textContent;
80642
- },
80643
-
80644
- // 打开教案侧边栏
80645
- openLessonSidebar(item) {
80646
- exportWord({
80647
- contentId: item.contentId
80648
- }).then(response => {
80649
- // 调用导出接口
80650
- // 创建下载链接
80651
- const blob = new Blob([response.data], {
80652
- type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
80653
- });
80654
- const url = window.URL.createObjectURL(blob);
80655
- const link = document.createElement('a');
80656
- link.href = url;
80657
- link.download = '教学设计方案.docx'; // 设置下载的文件名
80658
- link.click();
80659
- window.URL.revokeObjectURL(url); // 释放内存
80660
- })
80661
- // try {
80662
- // const target = '<!--AI_HTML-->';
80663
- // const index = item.content.indexOf(target);
80664
- // // 截取目标字符串之后的内容(若目标不存在则返回原字符串)
80665
- // let str = index !== -1 ? item.content.slice(index + target.length) : item.content;
80666
- // // 以'<!--/AI_HTML-->'为分隔符分割,最多分割1次
80667
- // const parts = str.split('<!--/AI_HTML-->', 2);
80668
- // // 返回分割后的第一部分(若不存在分隔符则返回原字符串)
80669
- // const htmlContent = parts[0] || str;
80670
- // if (!htmlContent) {
80671
- // throw new Error('找不到教案内容');
80672
- // }
80673
-
80674
- // // 创建临时DOM元素来处理HTML内容
80675
- // const tempDiv = document.createElement('div');
80676
- // tempDiv.innerHTML = htmlContent;
80677
-
80678
- // // 先同步所有多选框的状态到HTML属性
80679
- // this.syncCheckboxStates(tempDiv);
80680
-
80681
- // // 获取处理后的HTML内容
80682
- // const currentHtml = tempDiv.innerHTML;
80683
-
80684
- // // 处理多选框,将其转换为可视化符号
80685
- // const processedHtml = this.processCheckboxes(currentHtml);
80686
-
80687
- // // 生成包含样式的完整HTML文档
80688
- // const completeHtml = this.generateCompleteHtml(processedHtml);
80689
-
80690
- // // 使用html-docx-js转换为Word文档
80691
- // const converted = htmlDocx.asBlob(completeHtml);
80692
-
80693
- // // 保存文件
80694
- // saveAs(converted, '教案内容.docx');
80695
- // } catch (error) {
80696
- // console.error('Word文档生成失败:', error);
80697
- // if (this.$message) {
80698
- // this.$message.error('文档下载失败,请重试');
80699
- // } else {
80700
- // alert('文档下载失败,请重试');
80701
- // }
80702
- // }
80703
- },
80704
- syncCheckboxStates(parentElement) {
80705
- // 同步所有多选框的实际状态到HTML属性
80706
- const checkboxes = parentElement.querySelectorAll('input[type="checkbox"]');
80707
-
80708
- checkboxes.forEach((checkbox) => {
80709
- if (checkbox.checked) {
80710
- // 如果多选框被选中,确保HTML中有checked属性
80711
- checkbox.setAttribute('checked', '');
80712
- } else {
80713
- // 如果多选框未选中,移除checked属性
80714
- checkbox.removeAttribute('checked');
80715
- }
80716
- });
80717
- },
80718
- processCheckboxes(html) {
80719
- // 将多选框转换为Word文档中可交互的表单控件
80720
- let processedHtml = html;
80721
-
80722
- // 先处理选中的多选框 - 使用Word表单控件格式
80723
- processedHtml = processedHtml.replace(/<input[^>]*type=["']checkbox["'][^>]*checked[^>]*>/gi, '<span style="font-family:Wingdings;"></span>');
80724
-
80725
- // 再处理剩余的未选中多选框
80726
- processedHtml = processedHtml.replace(/<input[^>]*type=["']checkbox["'][^>]*>/gi, '<span style="font-family:Wingdings;"></span>');
80727
-
80728
- return processedHtml;
80729
- },
80730
- generateCompleteHtml(contentHtml) {
80731
- // 清理HTML内容,移除可能的编辑元素
80732
- let cleanedHtml = contentHtml;
80733
-
80734
- // 移除可能残留的textarea编辑框
80735
- cleanedHtml = cleanedHtml.replace(/<textarea[^>]*>.*?<\/textarea>/gi, '');
80736
-
80737
- // 确保换行符正确转换
80738
- cleanedHtml = cleanedHtml.replace(/\n/g, '<br>');
80739
-
80740
- // 生成包含样式的完整HTML文档
80741
- return `
80742
- <!DOCTYPE html>
80743
- <html>
80744
- <head>
80745
- <meta charset="UTF-8">
80746
- <title>教案内容</title>
80747
- <style>
80748
- body {
80749
- font-family: "宋体", SimSun, serif;
80750
- font-size: 10.5pt;
80751
- line-height: 1.5;
80752
- margin: 20px;
80753
- }
80754
- table {
80755
- width: 100%;
80756
- border-collapse: collapse;
80757
- margin: 0 auto;
80758
- }
80759
- td, th {
80760
- border: 1px solid #000;
80761
- padding: 4pt 6pt;
80762
- vertical-align: middle;
80763
- text-align: center;
80764
- font-size: 10.5pt;
80765
- line-height: 1.4;
80766
- }
80767
- .header-cell {
80768
- background-color: #a8d08d;
80769
- font-weight: bold;
80770
- }
80771
- .left-header {
80772
- background-color: #f0f0f0;
80773
- font-weight: bold;
80774
- text-align: center;
80775
- }
80776
- .content-cell {
80777
- text-align: left;
80778
- padding: 6pt 8pt;
80779
- }
80780
- .center-text {
80781
- text-align: center;
80782
- }
80783
- .bold-text {
80784
- font-weight: bold;
80785
- }
80786
- .red-text {
80787
- color: #ff0000;
80788
- }
80789
- p {
80790
- margin: 2pt 0;
80791
- text-align: justify;
80792
- }
80793
- .indent {
80794
- text-indent: 21pt;
80795
- }
80796
- /* 多选框符号样式 */
80797
- .checkbox-symbol {
80798
- font-family: Arial, sans-serif;
80799
- font-size: 12pt;
80800
- font-weight: bold;
80801
- color: #000;
80802
- display: inline-block;
80803
- margin-right: 4pt;
80804
- }
80805
- </style>
80806
- </head>
80807
- <body>
80808
- ${cleanedHtml}
80809
- </body>
80810
- </html>
80811
- `;
80812
- },
80813
- isDownloadable(url) {
80814
- // 根据文件扩展名来判断是否是可下载的文件
80815
- const downloadableExtensions = ['.pdf', '.txt', '.doc', '.docx'];
80816
- const urlLower = url.toLowerCase();
80817
- return downloadableExtensions.some((ext) => urlLower.endsWith(ext));
80818
- },
80819
-
80820
- // 停止对话
80821
- stopMessage(item) {
80822
- if (this.apiLoading) {
80823
- return this.$message({
80824
- message: '请等待当前操作完成',
80825
- type: 'warning',
80826
- });
80827
- }
80828
- this.apiLoading = true;
80829
- this.$parent.stop = true;
80830
- stopChat({
80831
- msgId: item.contentId,
80832
- })
80833
- .then((res) => {
80834
- if (res.code == 200) {
80835
- item.status = 1;
80836
- this.tempAnswerStatus = null;
80837
- }
80838
- })
80839
- .catch((error) => {
80840
- console.error('停止对话失败:', error);
80841
- this.$message({
80842
- message: '停止对话失败,请重试',
80843
- type: 'error',
80844
- });
80845
- })
80846
- .finally(() => {
80847
- this.apiLoading = false;
80848
- });
80849
- },
80850
- cycleNumbers(currentIndex, arr) {
80851
- // 确保currentIndex在有效范围内
80852
- currentIndex = (currentIndex + 1) % arr.length; // 使用模运算符来循环索引
80853
- return arr[currentIndex];
80854
- },
80855
- ReloadAnswer(index, flag, item) {
80856
- if (!this.stop) {
80857
- return this.$message({
80858
- message: '请等机器人回复后再重新生成哦~',
80859
- type: 'warning',
80860
- });
80861
- }
80862
- const arr = ['chatglm3-6b', 'Qwen1.5-14B-Chat', 'Qwen-7B-Chat'];
80863
- const result = this.cycleNumbers(this.currentIndex, arr);
80864
- this.currentIndex++;
80865
- this.templateId = item.templateId;
80866
- this.panelId = item.panelId;
80867
- this.$parent.images_url = [];
80868
- // this.sendMessage(this.messageListData[index - 1].content, result)
80869
- this.sendMessage(this.messageListData[index - 1].content, flag);
80870
- },
80871
- // 获取聊天消息标签列表
80872
- getlistChatMsgTag() {
80873
- this.apiLoading = true;
80874
- getlistChatMsgTag()
80875
- .then((res) => {
80876
- if (res.success == true) {
80877
- this.errorList = res.data;
80878
- }
80879
- })
80880
- .catch((error) => {
80881
- console.error('获取消息标签列表失败:', error);
80882
- this.$message({
80883
- message: '获取消息标签列表失败',
80884
- type: 'error',
80885
- });
80886
- })
80887
- .finally(() => {
80888
- this.apiLoading = false;
80889
- });
80890
- },
80891
- // 消息评价
80892
- async chatEvaluate(item, val) {
80893
- this.apiLoading = true;
80894
- try {
80895
- await chatEvaluate({
80896
- chatId: item.chatId,
80897
- msgId: item.contentId,
80898
- type: val,
80899
- tags: this.errors,
80900
- desc: this.input,
80901
- }).then((res) => {
80902
- if (res.success == true) {
80903
- if (val == 1) {
80904
- this.$message({
80905
- message: '感谢您的支持',
80906
- type: 'success',
80907
- });
80908
- } else {
80909
- this.$message({
80910
- message: '感谢您的反馈',
80911
- type: 'success',
80912
- });
80913
- }
80914
- }
80915
- });
80916
- } catch (error) {
80917
- console.error('消息评价失败:', error);
80918
- this.$message({
80919
- message: '评价提交失败,请重试',
80920
- type: 'error',
80921
- });
80922
- } finally {
80923
- this.apiLoading = false;
80924
- }
80925
- },
80926
- chooseLike(index) {
80927
- const { contentId } = this.messageListData[index];
80928
- feedbackSubmit({
80929
- additionalComment: '',
80930
- feedbackType: this.messageListData[index].feedbackType == 1 ? null : 1,
80931
- contentId,
80932
- options: this.selectedLikeOptions,
80933
- }).then((res) => {
80934
- if (res.data.code == 200) {
80935
- this.messageListData[index].feedbackType = this.messageListData[index].feedbackType == 1 ? null : 1;
80936
- }
80937
- });
80938
- },
80939
- // 点击拉踩按钮
80940
- chooseCai(index) {
80941
- const { contentId } = this.messageListData[index];
80942
- feedbackSubmit({
80943
- additionalComment: this.dislikeFeedback,
80944
- feedbackType: this.messageListData[index].feedbackType == 2 ? null : 2,
80945
- contentId,
80946
- options: this.selectedDislikeOptions,
80947
- }).then((res) => {
80948
- if (res.data.code == 200) {
80949
- this.messageListData[index].feedbackType = this.messageListData[index].feedbackType == 2 ? null : 2;
80950
- }
80951
- });
80952
- },
80953
- submitSuggest(item) {
80954
- this.chatEvaluate(item, 2);
80955
- item.popoverStatus = false;
80956
- item.type = 2;
80957
- this.caiReset();
80958
- },
80959
- canclePopoverr(item) {
80960
- item.popoverStatus = false;
80961
- this.caiReset();
80962
- },
80963
- caiReset() {
80964
- this.errors = [];
80965
- this.input = '';
80966
- },
80967
- share(item) {
80968
- if (!this.stop) {
80969
- return this.$message({
80970
- message: '请等机器人回复后再分享哦~',
80971
- type: 'warning',
80972
- });
80973
- }
80974
- // this.shareDialog = true
80975
- this.shareStatus = true;
80976
- this.shareList = [];
80977
- this.shareList.push(item.contentId + ',' + item.parentMsgId);
80978
- this.chatId = item.chatId;
80979
- this.$parent.inputShow = false;
80980
- this.$parent.inputConversionShow = false;
80981
- },
80982
- cancleShare() {
80983
- this.shareStatus = false;
80984
- this.reset();
80985
- },
80986
- showDialog() {
80987
- const flattenedShareList = this.shareList.map((str) => str.split(',')).flat();
80988
- this.apiLoading = true;
80989
- shareChatMsg({
80990
- chatId: this.chatId,
80991
- msgIds: flattenedShareList,
80992
- })
80993
- .then((res) => {
80994
- this.shareMsgId = res.data.shareId;
80995
- this.contents = res.data.contents;
80996
- this.shareText = location.origin + '/#/share/' + res.data.shareId;
80997
- this.shareDialog = true;
80998
- })
80999
- .catch((error) => {
81000
- console.error('分享失败:', error);
81001
- this.$message({
81002
- message: '分享失败,请重试',
81003
- type: 'error',
81004
- });
81005
- })
81006
- .finally(() => {
81007
- this.apiLoading = false;
81008
- });
81009
- },
81010
- shareCopy() {
81011
- this.$message({
81012
- message: '复制成功!',
81013
- type: 'success',
81014
- });
81015
- var cleanText = location.origin + '/#/share/' + this.shareMsgId;
81016
- // 使用正则表达式去除文本中的空格
81017
- var tag = document.createElement('textarea');
81018
- tag.value = cleanText;
81019
- document.body.appendChild(tag);
81020
- tag.select();
81021
- document.execCommand('copy');
81022
- tag.remove();
81023
- return cleanText;
81024
- },
81025
- handleClose() {
81026
- this.shareMsgId = '';
81027
- this.contents = [];
81028
- this.shareDialog = false;
81029
- // this.cancleShare()
81030
- },
81031
- // 初始化
81032
- reset() {
81033
- this.shareList = [];
81034
- this.$parent.inputShow = true;
81035
- this.$parent.inputConversionShow = true;
81036
- },
81037
- // 点击复制
81038
- async clickCopy(text) {
81039
- if (!text) return;
81040
- this.$message({
81041
- message: '复制成功!',
81042
- type: 'success',
81043
- });
81044
- // 使用正则表达式去除文本中的HTML标签
81045
- var cleanText = text.replace(/<[^>]*>?/gm, '');
81046
- // 使用正则表达式去除文本中的空格
81047
- cleanText = cleanText.replace(/\s+/g, '');
81048
- var tag = document.createElement('textarea');
81049
- tag.value = cleanText;
81050
- document.body.appendChild(tag);
81051
- tag.select();
81052
- document.execCommand('copy');
81053
- tag.remove();
81054
- return cleanText;
81055
- },
81056
-
81057
- changeVoice() {
81058
- this.VoiceShow = !this.VoiceShow;
81059
- },
81060
- uploadFile() {
81061
- this.$emit('uploadFile');
81062
- },
81063
- sendMessage(content, flag) {
81064
- if (!this.$parent.stop) {
81065
- return this.$message({
81066
- message: '请等机器人回复后再发送哦~',
81067
- type: 'warning',
81068
- });
81069
- }
81070
- // if (getType()) {
81071
-
81072
- if (this.userInput.trim() !== '' || content) {
81073
- this.$parent.messageListData.push({
81074
- content: content || this.userInput,
81075
- role: 'user',
81076
- });
81077
- } else {
81078
- return;
81079
- }
81080
- if (this.getType) {
81081
- if (this.sideCurrentName == '新的对话') {
81082
- this.$emit('editHuiHuaName', this.sideCurrentId, this.userInput);
81083
- }
81084
- } else {
81085
- if (this.sideCurrentName == '新的对话') {
81086
- this.dialogue.push({
81087
- chatName: this.userInput,
81088
- chatType: '1',
81089
- chatId: this.$parent.sideCurrentId,
81090
- });
81091
- this.$parent.dialogue = this.dialogue;
81092
- }
81093
- }
81094
- // }
81095
-
81096
- const self = this;
81097
- self.waitAnswer = true;
81098
- self.chatSending = true; // 开始聊天发送,设置等待状态
81099
- const controller = new AbortController();
81100
- const signal = controller.signal;
81101
- this.$parent.stop = false;
81102
- if (this.userInput.includes('如:')) {
81103
- this.userInput = this.userInput.substring(this.userInput.indexOf('如') + 2, this.userInput.length);
81104
- } else {
81105
- this.userInput = this.userInput;
81106
- }
81107
- const baseUrl = sessionStorage.getItem('environment') === 'test' ? 'https://ai-test.banwoxue.com/prod-api' : 'https://ai.banwoxue.com/prod-api';
81108
- fetchEventSource(baseUrl + '/intelligentBody/chatAI', {
81109
- method: 'POST',
81110
- signal: signal,
81111
- openWhenHidden: true,
81112
- headers: {
81113
- 'Content-Type': 'application/json',
81114
- Authorization: 'Bearer ' + js_cookie_default.a.get('agentToken'),
81115
- },
81116
- body: JSON.stringify({
81117
- messageList: [
81118
- {
81119
- chatId: this.messageListData.length > 1 ? this.messageListData[1].chatId : '',
81120
- content: content || this.userInput,
81121
- role: 'user',
81122
- chatType: this.chatType,
81123
- // bodyId: this.$route.query.bodyId || localStorage.getItem('bodyId'),
81124
- bodyId: this.$parent.agentId || this.$route.query.bodyId,
81125
- // fileId: this.$parent.fileid,
81126
- model_name: 'chatglm3-6b',
81127
- templateId: this.templateId || '',
81128
- panelId: this.panelId || '',
81129
- structure:
81130
- this.$parent.pptSections.length > 0
81131
- ? {
81132
- title: this.$parent.PPTTitle || '',
81133
- catalogs: this.$parent.pptSections,
81134
- }
81135
- : null,
81136
- coverId: this.$parent.coverId,
81137
- // model_name: modelName || 'chatglm3-6b'
81138
- },
81139
- ],
81140
- }),
81141
-
81142
- onmessage(msg) {
81143
- // 初始化一个空字符串用于拼接消息
81144
- self.apiLoading = false; // 收到第一条回复时隐藏loading
81145
- if (msg.event === '') {
81146
- var result = JSON.parse(msg.data);
81147
- self.tempAnswerStatus = result.status;
81148
- if (self.waitAnswer) {
81149
- if (self.tempAnswerStatus == null) {
81150
- self.$parent.stop = true;
81151
- return self.$message({
81152
- message: '您今日的次数已经用完',
81153
- type: 'warning',
81154
- });
81155
- }
81156
- if (result.content) {
81157
- self.$parent.userInput = '';
81158
- self.userInput = '';
81159
- // 第一次收到回答,创建一个消息记录
81160
- self.waitAnswer = false;
81161
- self.chatSending = false; // 收到第一条回复时隐藏loading
81162
- const newMessage = {
81163
- content: self.returnText,
81164
- role: 'assistant',
81165
- typeId: 0,
81166
- contentId: result.msgId,
81167
- parentMsgId: result.parentMsgId,
81168
- chatId: result.chatId,
81169
- type: null,
81170
- templateId: self.templateId,
81171
- panelId: self.panelId,
81172
- };
81173
- if (self.panelId != 2) {
81174
- // 临时保存回答内容
81175
- self.returnText = result.content || '';
81176
- } else {
81177
- newMessage.typeId = 2;
81178
- }
81179
- self.messageListData.push(newMessage);
81180
- }
81181
- } else if (self.tempAnswerStatus != 2) {
81182
- let lastMessage = self.$parent.messageListData[self.$parent.messageListData.length - 1];
81183
-
81184
- // 临时保存回答内容
81185
- self.returnText += result.content;
81186
- // 如果之前不是卡片类型,但现在是了,就更新
81187
- if (lastMessage.typeId !== 1 && self.returnText.includes('<!--AI_HTML-->')) {
81188
- lastMessage.typeId = 1;
81189
- self.$parent.tableHtml = '';
81190
- self.$parent.isSidebarCollapsed = true;
81191
- self.$parent.aiJaDrawer = true;
81192
- self.$parent.aiPptDrawer = false;
81193
- } else if (self.returnText.includes('<!--AI_HTML-->')) {
81194
- const target = '<!--AI_HTML-->';
81195
- const index = self.returnText.indexOf(target);
81196
- // 截取目标字符串之后的内容(若目标不存在则返回原字符串)
81197
- let str = index !== -1 ? self.returnText.slice(index + target.length) : self.returnText;
81198
- // 以'<!--/AI_HTML-->'为分隔符分割,最多分割1次
81199
- const parts = str.split('<!--/AI_HTML-->', 2);
81200
- // 返回分割后的第一部分(若不存在分隔符则返回原字符串)
81201
- self.$parent.tableHtml = parts[0] || str;
81202
- } else if (self.panelId == 2) {
81203
- // ppt内容加载处理逻辑
81204
- self.$parent.messageListData[self.$parent.messageListData.length - 1].content = result.content;
81205
- const obj = JSON.parse(result.content);
81206
- self.$parent.isSidebarCollapsed = true;
81207
- self.$parent.aiPptDrawer = true;
81208
- self.$parent.aiJaDrawer = false;
81209
- self.$parent.pptSections = obj.structure.catalogs;
81210
- if (obj.latestResult && obj.latestResult.images_url.length > 0) {
81211
- self.$parent.images_url = obj.latestResult.images_url;
81212
- }
81213
- }
81214
- if (self.panelId != 2) {
81215
- lastMessage.content = self.returnText;
81216
- }
81217
- if (self.messageListData.length > 1) {
81218
- self.messageListData[self.messageListData.length - 2].contentId = result.parentMsgId;
81219
- }
81220
- lastMessage.status = result.status;
81221
- self.$parent.content = lastMessage;
81222
- if (!self.getType) {
81223
- lastMessage.chatId = result.chatId;
81224
- self.dialogue[self.dialogue.length - 1].chatId = result.chatId;
81225
- }
81226
- self.tempAnswerStatus = result.status;
81227
- }
81228
- if (self.tempAnswerStatus === 2) {
81229
- if (self.panelId == 2) {
81230
- self.$parent.messageListData[self.$parent.messageListData.length - 1].status = self.tempAnswerStatus;
81231
- self.$parent.messageListData[self.$parent.messageListData.length - 1].contentId = result.msgId;
81232
- }
81233
- self.$parent.pptContentId = result.msgId;
81234
- if (result.content) {
81235
- try {
81236
- self.$parent.messageListData[self.$parent.messageListData.length - 1].reference = JSON.parse(result.content);
81237
- } catch (e) {
81238
- console.error('Error parsing reference content:', e);
81239
- }
81240
- }
81241
- self.$parent.stop = true;
81242
- self.apiLoading = false; // 请求完成,清除等待状态
81243
- }
81244
- } else if (msg.data === 'close') {
81245
- controller.abort();
81246
- }
81247
- },
81248
-
81249
- onerror(err) {
81250
- self.$message({
81251
- message: '访问的人过多,请稍后重试',
81252
- type: 'warning',
81253
- });
81254
- self.$parent.stop = true;
81255
- self.chatSending = false; // 请求出错,清除等待状态
81256
- console.log(err, '失败');
81257
- throw err; //必须throw才能停止
81258
- },
81259
- });
81260
- },
81261
-
81262
- // 线程等待
81263
- simulateThreadWait(milliseconds) {
81264
- return new Promise((resolve) => setTimeout(resolve, milliseconds));
81265
- },
81266
- // 检测是否在底部
81267
- isAtBottom() {
81268
- if (!this.$refs.recordListRef) return true;
81269
- const element = this.$refs.recordListRef;
81270
- const threshold = 50; // 距离底部50px以内认为是在底部
81271
- return element.scrollHeight - element.scrollTop - element.clientHeight < threshold;
81272
- },
81273
-
81274
- // 处理用户滚动事件
81275
- handleUserScroll() {
81276
- // 如果是程序触发的滚动,忽略
81277
- if (this.programmaticScrolling) return;
81278
-
81279
- // 清除之前的定时器
81280
- if (this.userScrollTimer) {
81281
- clearTimeout(this.userScrollTimer);
81282
- }
81283
-
81284
- // 检查是否在底部
81285
- if (this.isAtBottom()) {
81286
- // 在底部,启用自动滚动
81287
- this.autoScroll = true;
81288
- } else {
81289
- // 不在底部,禁用自动滚动
81290
- this.autoScroll = false;
81291
- }
81292
- },
81293
-
81294
- scrollToBottom() {
81295
- // 只有在自动滚动开启时才执行
81296
- if (!this.autoScroll) return;
81297
-
81298
- this.$nextTick(() => {
81299
- this.programmaticScroll();
81300
- });
81301
- },
81302
-
81303
- // 程序触发的滚动(不会被用户滚动检测影响)
81304
- programmaticScroll() {
81305
- if (!this.$refs.recordListRef) return;
81306
-
81307
- // 标记程序滚动开始
81308
- this.programmaticScrolling = true;
81309
-
81310
- // 执行滚动
81311
- this.$refs.recordListRef.scrollTo({
81312
- top: this.$refs.recordListRef.scrollHeight,
81313
- behavior: 'smooth',
81314
- });
81315
-
81316
- // 延迟重置程序滚动标志(等待滚动动画完成)
81317
- setTimeout(() => {
81318
- this.programmaticScrolling = false;
81319
- }, 600); // 等待滚动动画完成
81320
- },
81321
-
81322
- // 显示好评选项
81323
- showLikeOptions(index, event) {
81324
- this.selectedLikeOptions = []; // 重置选择
81325
- this.currentLikeItem = index;
81326
- if (this.messageListData[index].feedbackType == 1) {
81327
- this.chooseLike(index);
81328
- return;
81329
- }
81330
- // 计算弹窗位置 - 在好评按钮正下方居中显示
81331
- const rect = event.target.getBoundingClientRect();
81332
- const popupWidth = 400; // 弹窗宽度
81333
- this.likePopupStyle = {
81334
- position: 'fixed',
81335
- left: rect.left + rect.width / 2 - popupWidth / 2 + 'px', // 居中对齐
81336
- top: rect.bottom + 10 + 'px', // 在按钮下方10px处显示
81337
- zIndex: 9999,
81338
- };
81339
- this.likeOptionsVisible = true;
81340
- },
81341
-
81342
- // 切换好评选项(支持多选)
81343
- toggleLikeOption(option) {
81344
- const index = this.selectedLikeOptions.indexOf(option);
81345
- if (index > -1) {
81346
- // 如果已选中,则取消选择
81347
- this.selectedLikeOptions.splice(index, 1);
81348
- } else {
81349
- // 如果未选中,则添加选择
81350
- this.selectedLikeOptions.push(option);
81351
- }
81352
- },
81353
-
81354
- // 确认好评选项
81355
- confirmLikeOptions() {
81356
- console.log('选择的评价选项:', this.selectedLikeOptions);
81357
- // 这里可以调用评价API
81358
- if (this.currentLikeItem && this.selectedLikeOptions.length > 0) {
81359
- this.chooseLike(this.currentLikeItem);
81360
- }
81361
- this.closeLikeOptions();
81362
- },
81363
-
81364
- // 关闭好评选项弹窗
81365
- closeLikeOptions() {
81366
- this.likeOptionsVisible = false;
81367
- this.currentLikeItem = null;
81368
- this.selectedLikeOptions = [];
81369
- this.likePopupStyle = {};
81370
- },
81371
-
81372
- // 显示差评反馈弹窗
81373
- showDislikeModal(index) {
81374
- this.currentDislikeItem = index;
81375
- this.selectedDislikeOptions = [];
81376
- this.dislikeFeedback = '';
81377
- if (this.messageListData[index].feedbackType == 2) {
81378
- this.chooseCai(index);
81379
- return;
81380
- }
81381
- this.dislikeModalVisible = true;
81382
- },
81383
-
81384
- // 切换差评选项(支持多选)
81385
- toggleDislikeOption(option) {
81386
- const index = this.selectedDislikeOptions.indexOf(option);
81387
- if (index > -1) {
81388
- // 如果已选中,则取消选择
81389
- this.selectedDislikeOptions.splice(index, 1);
81390
- } else {
81391
- // 如果未选中,则添加选择
81392
- this.selectedDislikeOptions.push(option);
81393
- }
81394
- },
81395
-
81396
- // 提交差评反馈
81397
- submitDislikeFeedback() {
81398
- if (this.selectedDislikeOptions.length == 0) {
81399
- return this.$message.warning('请选择差评原因');
81400
- }
81401
- // 这里可以调用差评API
81402
- if (this.currentDislikeItem) {
81403
- this.chooseCai(this.currentDislikeItem);
81404
- }
81405
- this.closeDislikeModal();
81406
- },
81407
-
81408
- // 关闭差评反馈弹窗
81409
- closeDislikeModal() {
81410
- this.dislikeModalVisible = false;
81411
- this.currentDislikeItem = null;
81412
- this.selectedDislikeOptions = [];
81413
- this.dislikeFeedback = '';
81414
- },
81415
- },
81416
- created() { },
81417
- mounted() {
81418
- // 添加滚动事件监听
81419
- if (this.$refs.recordListRef) {
81420
- this.$refs.recordListRef.addEventListener('scroll', this.handleUserScroll);
81421
- }
81422
-
81423
- setInterval(() => {
81424
- if (document.getElementById('gif')) {
81425
- document.getElementById('gif').src = document.getElementById('gif').src;
81426
- }
81427
- }, 2300);
81428
- },
81429
-
81430
- beforeDestroy() {
81431
- // 清理定时器
81432
- if (this.scrollTimer) {
81433
- clearTimeout(this.scrollTimer);
81434
- }
81435
- if (this.userScrollTimer) {
81436
- clearTimeout(this.userScrollTimer);
81437
- }
81438
- // 移除滚动事件监听
81439
- if (this.$refs.recordListRef) {
81440
- this.$refs.recordListRef.removeEventListener('scroll', this.handleUserScroll);
81441
- }
81442
- },
81443
- watch: {
81444
- // 监听聊天发送状态
81445
- chatSending(newVal) {
81446
- if (newVal) {
81447
- // 开始发送消息时启用自动滚动并滚动到底部
81448
- this.autoScroll = true;
81449
- this.$nextTick(() => {
81450
- this.scrollToBottom();
81451
- });
81452
- }
81453
- },
81454
- // 监听消息列表变化
81455
- messageListData: {
81456
- handler() {
81457
- // 消息更新时,如果自动滚动开启,则滚动到底部
81458
- if (this.autoScroll) {
81459
- this.$nextTick(() => {
81460
- this.scrollToBottom();
81461
- });
81462
- }
81463
- },
81464
- deep: true,
81465
- },
81466
- },
81467
- });
80333
+
80334
+
80335
+
80336
+
80337
+ const chatvue_type_script_lang_js_controller = new AbortController();
80338
+ const chatvue_type_script_lang_js_signal = chatvue_type_script_lang_js_controller.signal;
80339
+
80340
+
80341
+ /* harmony default export */ var chatvue_type_script_lang_js = ({
80342
+ name: 'APP',
80343
+ props: {
80344
+ firstChatShow: {
80345
+ type: Boolean,
80346
+ },
80347
+ messageListData: {
80348
+ type: Array,
80349
+ },
80350
+ activeName: {
80351
+ type: String,
80352
+ },
80353
+
80354
+ sideCurrentName: {
80355
+ type: String,
80356
+ },
80357
+ sideCurrentId: {
80358
+ type: String,
80359
+ },
80360
+
80361
+ userId: {
80362
+ type: Number,
80363
+ },
80364
+ chatType: {
80365
+ type: Number,
80366
+ },
80367
+ },
80368
+ data() {
80369
+ return {
80370
+ gifPath: 'https://file.banwoxue.com/aiAgent/c3578c424c674dedaf01f3db9592aafb/zhayan.gif',
80371
+ shareText: '',
80372
+ userInput: '',
80373
+ popoverStatus: false,
80374
+ contents: [], //分享内容
80375
+ // canSubmit:false,
80376
+ input: '',
80377
+ errors: [],
80378
+ VoiceShow: true,
80379
+ waitAnswer: false,
80380
+ shareMsgId: '',
80381
+ // API请求等待状态
80382
+ apiLoading: false,
80383
+ // 聊天发送状态
80384
+ chatSending: false,
80385
+ // 滚动定时器
80386
+ scrollTimer: null,
80387
+ // 程序滚动标志
80388
+ programmaticScrolling: false,
80389
+ // 自动滚动开关
80390
+ autoScroll: true,
80391
+ // 用户滚动检测定时器
80392
+ userScrollTimer: null,
80393
+ checked1: false,
80394
+ checked2: false,
80395
+ checked3: false,
80396
+ checked4: false,
80397
+ checked5: false,
80398
+ checked6: false,
80399
+ errorList: [
80400
+ {
80401
+ error: '格式问题',
80402
+ },
80403
+ {
80404
+ error: '逻辑问题',
80405
+ },
80406
+ {
80407
+ error: '有害信息',
80408
+ },
80409
+ {
80410
+ error: '事实错误',
80411
+ },
80412
+ {
80413
+ error: '没有帮助',
80414
+ },
80415
+ {
80416
+ error: '答非所问',
80417
+ },
80418
+ ],
80419
+ // 点赞标识
80420
+ zanShow: false,
80421
+ checkList: [],
80422
+ dialogue: this.$parent.dialogue || [],
80423
+ shareDialog: false,
80424
+ shareStatus: false, // 点击分享
80425
+ // 拉踩标识
80426
+ caiShow: false,
80427
+ shareList: [],
80428
+ // 分享标识
80429
+ shareShow: false,
80430
+ chatId: '',
80431
+ // 复制标识
80432
+ copyShow: false,
80433
+ returnText: '', // 服务器返回数据
80434
+ tempAnswerStatus: null,
80435
+ modelName: 'chatglm3-6b',
80436
+ currentIndex: 0,
80437
+ templateId: '',
80438
+ panelId: '',
80439
+ // 好评选项弹窗相关
80440
+ likeOptionsVisible: false,
80441
+ likePopupStyle: {},
80442
+ currentLikeItem: null,
80443
+ selectedLikeOptions: [], // 多选的好评选项
80444
+ LikeOption: [
80445
+ {
80446
+ id: 1,
80447
+ name: '问题定位准确',
80448
+ },
80449
+ {
80450
+ id: 2,
80451
+ name: '回答对您有用',
80452
+ },
80453
+ {
80454
+ id: 3,
80455
+ name: '交互性好',
80456
+ },
80457
+ {
80458
+ id: 4,
80459
+ name: '界面好看',
80460
+ },
80461
+ {
80462
+ id: 5,
80463
+ name: '其他',
80464
+ },
80465
+ ],
80466
+ // 差评反馈弹窗相关
80467
+ dislikeModalVisible: false,
80468
+ dislikeOption: [
80469
+ {
80470
+ id: 1,
80471
+ name: '问题定位不准确',
80472
+ },
80473
+ {
80474
+ id: 2,
80475
+ name: '没有帮助',
80476
+ },
80477
+ {
80478
+ id: 3,
80479
+ name: '交互体验差',
80480
+ },
80481
+ {
80482
+ id: 4,
80483
+ name: '智能性差',
80484
+ },
80485
+ {
80486
+ id: 5,
80487
+ name: '功能不够强大',
80488
+ },
80489
+ {
80490
+ id: 6,
80491
+ name: '其他',
80492
+ },
80493
+ ],
80494
+ currentDislikeItem: null,
80495
+ selectedDislikeOptions: [], // 多选的差评选项
80496
+ dislikeFeedback: '', // 差评文本反馈
80497
+ };
80498
+ },
80499
+ computed: {
80500
+ stop() {
80501
+ return this.$parent.stop;
80502
+ },
80503
+ canSubmit() {
80504
+ return this.errors.length == 0 && this.input == '';
80505
+ },
80506
+ getType() {
80507
+ return sessionStorage.getItem('type') || 1;
80508
+ },
80509
+ // 计算每个消息项的加载状态
80510
+ getItemLoadingStatus() {
80511
+ return (item) => {
80512
+ if (!item.content) return false;
80513
+ const hasStartTag = item.content.includes('<!--AI_HTML-->');
80514
+ const hasEndTag = item.content.includes('<!--/AI_HTML-->');
80515
+ // 如果有开始标签但没有结束标签,说明正在生成中
80516
+ return hasStartTag && !hasEndTag;
80517
+ };
80518
+ },
80519
+ },
80520
+ methods: {
80521
+ // 获取卡片标题
80522
+ getCardTitle(item) {
80523
+ // const content = item.content.toLowerCase();
80524
+ return 'AI教学设计方案';
80525
+ },
80526
+ //判断是否为教案
80527
+ getJaShow(item) {
80528
+ const str = item.content;
80529
+ const target = '<!--AI_HTML-->';
80530
+ // 找到目标字符串的位置
80531
+ const index = str.indexOf(target);
80532
+ // 截取目标字符串之前的内容(若目标不存在则返回原字符串)
80533
+ const result = index !== -1 ? true : false;
80534
+ return result;
80535
+ },
80536
+ // 获取提示文本
80537
+ getPromptText(item) {
80538
+ const str = item.content;
80539
+ const target = '<!--AI_HTML-->';
80540
+ // 找到目标字符串的位置
80541
+ const index = str.indexOf(target);
80542
+ // 截取目标字符串之前的内容(若目标不存在则返回原字符串)
80543
+ const result = index !== -1 ? str.slice(0, index) : str;
80544
+ // 移除在渲染函数中修改数据的逻辑,避免无限更新循环
80545
+ // if (index !== -1) {
80546
+ // this.loadingStatus = true;
80547
+ // }
80548
+ return result;
80549
+ },
80550
+ getPromptLastText(item) {
80551
+ const str = item.content;
80552
+ const target = '<!--/AI_HTML-->';
80553
+ // 找到目标字符串的位置
80554
+ const index = str.indexOf(target);
80555
+ // 截取目标字符串之后的内容(若目标不存在则返回原字符串)
80556
+ const result = index !== -1 ? str.slice(index + target.length) : '';
80557
+ // 移除在渲染函数中修改数据的逻辑,避免无限更新循环
80558
+ // if (index !== -1) {
80559
+ // this.loadingStatus = false;
80560
+ // }
80561
+ return result;
80562
+ },
80563
+
80564
+ // 获取图标文本
80565
+ getIconText(item) {
80566
+ const content = item.content ? item.content.toLowerCase() : '';
80567
+ if (content.includes('ppt') || content.includes('powerpoint') || content.includes('幻灯片') || (this.$parent && this.$parent.selectedButton === 'aippt')) {
80568
+ return 'P';
80569
+ }
80570
+ return 'T';
80571
+ },
80572
+ // 预览内容
80573
+ previewContent(item) {
80574
+ if (!this.$parent.stop) {
80575
+ return this.$message({
80576
+ message: '对话结束才能预览哦~',
80577
+ type: 'warning',
80578
+ });
80579
+ }
80580
+ // 这里可以实现预览功能,比如显示一个预览弹窗
80581
+ const target = '<!--AI_HTML-->';
80582
+ const index = item.content.indexOf(target);
80583
+ // 截取目标字符串之后的内容(若目标不存在则返回原字符串)
80584
+ let str = index !== -1 ? item.content.slice(index + target.length) : item.content;
80585
+ // 以'<!--/AI_HTML-->'为分隔符分割,最多分割1次
80586
+ const parts = str.split('<!--/AI_HTML-->', 2);
80587
+ // 返回分割后的第一部分(若不存在分隔符则返回原字符串)
80588
+ this.$parent.tableHtml = parts[0] || str;
80589
+ this.$parent.content = item;
80590
+ this.$parent.isSidebarCollapsed = true;
80591
+ this.$emit('openLessonSidebar', item);
80592
+ // 如果父组件有aiJaDrawer属性,直接设置
80593
+ if (this.$parent && this.$parent.aiJaDrawer !== undefined) {
80594
+ this.$parent.aiJaDrawer = true;
80595
+ this.$parent.aiPptDrawer = false;
80596
+ }
80597
+ },
80598
+ //判断是否为ppt
80599
+ getPptShow(item) {
80600
+ const str = item.content;
80601
+ const target = 'structure';
80602
+ // 找到目标字符串的位置
80603
+ const index = str.indexOf(target);
80604
+ // 截取目标字符串之前的内容(若目标不存在则返回原字符串)
80605
+ const result = index !== -1 ? true : false;
80606
+ return result;
80607
+ },
80608
+ // ppt预览逻辑处理
80609
+ pptPreviewContent(item) {
80610
+ if (!this.$parent.stop) {
80611
+ return this.$message({
80612
+ message: '对话结束才能预览哦~',
80613
+ type: 'warning',
80614
+ });
80615
+ }
80616
+ const obj = JSON.parse(item.content);
80617
+ this.$parent.pptContentId = item.contentId;
80618
+
80619
+ this.$parent.PPTTitle = obj.structure.title;
80620
+ this.$parent.isSidebarCollapsed = true;
80621
+ this.$parent.aiPptDrawer = true;
80622
+ this.$parent.aiJaDrawer = false;
80623
+ this.$parent.pptSections = obj.structure.catalogs;
80624
+ this.$parent.images_url = obj.latestResult.images_url;
80625
+ },
80626
+ //ppt下载
80627
+ pptDownload(item) {
80628
+ this.$parent.pptContentId = item.contentId;
80629
+ downloadChatPpt(this.$parent.pptContentId).then((res) => {
80630
+ const url = res.data.data;
80631
+ // window.open(url);
80632
+ this.$parent.handleDownload(url);
80633
+ });
80634
+ },
80635
+
80636
+ // 获取内容预览
80637
+ getContentPreview(content) {
80638
+ if (!content) return '暂无内容';
80639
+ // 移除HTML标签并截取前200个字符作为预览
80640
+ const textContent = content.replace(/<[^>]*>/g, '');
80641
+ return textContent.length > 200 ? textContent.substring(0, 200) + '...' : textContent;
80642
+ },
80643
+
80644
+ // 打开教案侧边栏
80645
+ openLessonSidebar(item) {
80646
+ exportWord({
80647
+ contentId: item.contentId
80648
+ }).then(response => {
80649
+ // 调用导出接口
80650
+ // 创建下载链接
80651
+ const blob = new Blob([response.data], {
80652
+ type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
80653
+ });
80654
+ const url = window.URL.createObjectURL(blob);
80655
+ const link = document.createElement('a');
80656
+ link.href = url;
80657
+ link.download = '教学设计方案.docx'; // 设置下载的文件名
80658
+ link.click();
80659
+ window.URL.revokeObjectURL(url); // 释放内存
80660
+ })
80661
+ // try {
80662
+ // const target = '<!--AI_HTML-->';
80663
+ // const index = item.content.indexOf(target);
80664
+ // // 截取目标字符串之后的内容(若目标不存在则返回原字符串)
80665
+ // let str = index !== -1 ? item.content.slice(index + target.length) : item.content;
80666
+ // // 以'<!--/AI_HTML-->'为分隔符分割,最多分割1次
80667
+ // const parts = str.split('<!--/AI_HTML-->', 2);
80668
+ // // 返回分割后的第一部分(若不存在分隔符则返回原字符串)
80669
+ // const htmlContent = parts[0] || str;
80670
+ // if (!htmlContent) {
80671
+ // throw new Error('找不到教案内容');
80672
+ // }
80673
+
80674
+ // // 创建临时DOM元素来处理HTML内容
80675
+ // const tempDiv = document.createElement('div');
80676
+ // tempDiv.innerHTML = htmlContent;
80677
+
80678
+ // // 先同步所有多选框的状态到HTML属性
80679
+ // this.syncCheckboxStates(tempDiv);
80680
+
80681
+ // // 获取处理后的HTML内容
80682
+ // const currentHtml = tempDiv.innerHTML;
80683
+
80684
+ // // 处理多选框,将其转换为可视化符号
80685
+ // const processedHtml = this.processCheckboxes(currentHtml);
80686
+
80687
+ // // 生成包含样式的完整HTML文档
80688
+ // const completeHtml = this.generateCompleteHtml(processedHtml);
80689
+
80690
+ // // 使用html-docx-js转换为Word文档
80691
+ // const converted = htmlDocx.asBlob(completeHtml);
80692
+
80693
+ // // 保存文件
80694
+ // saveAs(converted, '教案内容.docx');
80695
+ // } catch (error) {
80696
+ // console.error('Word文档生成失败:', error);
80697
+ // if (this.$message) {
80698
+ // this.$message.error('文档下载失败,请重试');
80699
+ // } else {
80700
+ // alert('文档下载失败,请重试');
80701
+ // }
80702
+ // }
80703
+ },
80704
+ syncCheckboxStates(parentElement) {
80705
+ // 同步所有多选框的实际状态到HTML属性
80706
+ const checkboxes = parentElement.querySelectorAll('input[type="checkbox"]');
80707
+
80708
+ checkboxes.forEach((checkbox) => {
80709
+ if (checkbox.checked) {
80710
+ // 如果多选框被选中,确保HTML中有checked属性
80711
+ checkbox.setAttribute('checked', '');
80712
+ } else {
80713
+ // 如果多选框未选中,移除checked属性
80714
+ checkbox.removeAttribute('checked');
80715
+ }
80716
+ });
80717
+ },
80718
+ processCheckboxes(html) {
80719
+ // 将多选框转换为Word文档中可交互的表单控件
80720
+ let processedHtml = html;
80721
+
80722
+ // 先处理选中的多选框 - 使用Word表单控件格式
80723
+ processedHtml = processedHtml.replace(/<input[^>]*type=["']checkbox["'][^>]*checked[^>]*>/gi, '<span style="font-family:Wingdings;"></span>');
80724
+
80725
+ // 再处理剩余的未选中多选框
80726
+ processedHtml = processedHtml.replace(/<input[^>]*type=["']checkbox["'][^>]*>/gi, '<span style="font-family:Wingdings;"></span>');
80727
+
80728
+ return processedHtml;
80729
+ },
80730
+ generateCompleteHtml(contentHtml) {
80731
+ // 清理HTML内容,移除可能的编辑元素
80732
+ let cleanedHtml = contentHtml;
80733
+
80734
+ // 移除可能残留的textarea编辑框
80735
+ cleanedHtml = cleanedHtml.replace(/<textarea[^>]*>.*?<\/textarea>/gi, '');
80736
+
80737
+ // 确保换行符正确转换
80738
+ cleanedHtml = cleanedHtml.replace(/\n/g, '<br>');
80739
+
80740
+ // 生成包含样式的完整HTML文档
80741
+ return `
80742
+ <!DOCTYPE html>
80743
+ <html>
80744
+ <head>
80745
+ <meta charset="UTF-8">
80746
+ <title>教案内容</title>
80747
+ <style>
80748
+ body {
80749
+ font-family: "宋体", SimSun, serif;
80750
+ font-size: 10.5pt;
80751
+ line-height: 1.5;
80752
+ margin: 20px;
80753
+ }
80754
+ table {
80755
+ width: 100%;
80756
+ border-collapse: collapse;
80757
+ margin: 0 auto;
80758
+ }
80759
+ td, th {
80760
+ border: 1px solid #000;
80761
+ padding: 4pt 6pt;
80762
+ vertical-align: middle;
80763
+ text-align: center;
80764
+ font-size: 10.5pt;
80765
+ line-height: 1.4;
80766
+ }
80767
+ .header-cell {
80768
+ background-color: #a8d08d;
80769
+ font-weight: bold;
80770
+ }
80771
+ .left-header {
80772
+ background-color: #f0f0f0;
80773
+ font-weight: bold;
80774
+ text-align: center;
80775
+ }
80776
+ .content-cell {
80777
+ text-align: left;
80778
+ padding: 6pt 8pt;
80779
+ }
80780
+ .center-text {
80781
+ text-align: center;
80782
+ }
80783
+ .bold-text {
80784
+ font-weight: bold;
80785
+ }
80786
+ .red-text {
80787
+ color: #ff0000;
80788
+ }
80789
+ p {
80790
+ margin: 2pt 0;
80791
+ text-align: justify;
80792
+ }
80793
+ .indent {
80794
+ text-indent: 21pt;
80795
+ }
80796
+ /* 多选框符号样式 */
80797
+ .checkbox-symbol {
80798
+ font-family: Arial, sans-serif;
80799
+ font-size: 12pt;
80800
+ font-weight: bold;
80801
+ color: #000;
80802
+ display: inline-block;
80803
+ margin-right: 4pt;
80804
+ }
80805
+ </style>
80806
+ </head>
80807
+ <body>
80808
+ ${cleanedHtml}
80809
+ </body>
80810
+ </html>
80811
+ `;
80812
+ },
80813
+ isDownloadable(url) {
80814
+ // 根据文件扩展名来判断是否是可下载的文件
80815
+ const downloadableExtensions = ['.pdf', '.txt', '.doc', '.docx'];
80816
+ const urlLower = url.toLowerCase();
80817
+ return downloadableExtensions.some((ext) => urlLower.endsWith(ext));
80818
+ },
80819
+
80820
+ // 停止对话
80821
+ stopMessage(item) {
80822
+ if (this.apiLoading) {
80823
+ return this.$message({
80824
+ message: '请等待当前操作完成',
80825
+ type: 'warning',
80826
+ });
80827
+ }
80828
+ this.apiLoading = true;
80829
+ this.$parent.stop = true;
80830
+ stopChat({
80831
+ msgId: item.contentId,
80832
+ })
80833
+ .then((res) => {
80834
+ if (res.code == 200) {
80835
+ item.status = 1;
80836
+ this.tempAnswerStatus = null;
80837
+ }
80838
+ })
80839
+ .catch((error) => {
80840
+ console.error('停止对话失败:', error);
80841
+ this.$message({
80842
+ message: '停止对话失败,请重试',
80843
+ type: 'error',
80844
+ });
80845
+ })
80846
+ .finally(() => {
80847
+ this.apiLoading = false;
80848
+ });
80849
+ },
80850
+ cycleNumbers(currentIndex, arr) {
80851
+ // 确保currentIndex在有效范围内
80852
+ currentIndex = (currentIndex + 1) % arr.length; // 使用模运算符来循环索引
80853
+ return arr[currentIndex];
80854
+ },
80855
+ ReloadAnswer(index, flag, item) {
80856
+ if (!this.stop) {
80857
+ return this.$message({
80858
+ message: '请等机器人回复后再重新生成哦~',
80859
+ type: 'warning',
80860
+ });
80861
+ }
80862
+ const arr = ['chatglm3-6b', 'Qwen1.5-14B-Chat', 'Qwen-7B-Chat'];
80863
+ const result = this.cycleNumbers(this.currentIndex, arr);
80864
+ this.currentIndex++;
80865
+ this.templateId = item.templateId;
80866
+ this.panelId = item.panelId;
80867
+ this.$parent.images_url = [];
80868
+ // this.sendMessage(this.messageListData[index - 1].content, result)
80869
+ this.sendMessage(this.messageListData[index - 1].content, flag);
80870
+ },
80871
+ // 获取聊天消息标签列表
80872
+ getlistChatMsgTag() {
80873
+ this.apiLoading = true;
80874
+ getlistChatMsgTag()
80875
+ .then((res) => {
80876
+ if (res.success == true) {
80877
+ this.errorList = res.data;
80878
+ }
80879
+ })
80880
+ .catch((error) => {
80881
+ console.error('获取消息标签列表失败:', error);
80882
+ this.$message({
80883
+ message: '获取消息标签列表失败',
80884
+ type: 'error',
80885
+ });
80886
+ })
80887
+ .finally(() => {
80888
+ this.apiLoading = false;
80889
+ });
80890
+ },
80891
+ // 消息评价
80892
+ async chatEvaluate(item, val) {
80893
+ this.apiLoading = true;
80894
+ try {
80895
+ await chatEvaluate({
80896
+ chatId: item.chatId,
80897
+ msgId: item.contentId,
80898
+ type: val,
80899
+ tags: this.errors,
80900
+ desc: this.input,
80901
+ }).then((res) => {
80902
+ if (res.success == true) {
80903
+ if (val == 1) {
80904
+ this.$message({
80905
+ message: '感谢您的支持',
80906
+ type: 'success',
80907
+ });
80908
+ } else {
80909
+ this.$message({
80910
+ message: '感谢您的反馈',
80911
+ type: 'success',
80912
+ });
80913
+ }
80914
+ }
80915
+ });
80916
+ } catch (error) {
80917
+ console.error('消息评价失败:', error);
80918
+ this.$message({
80919
+ message: '评价提交失败,请重试',
80920
+ type: 'error',
80921
+ });
80922
+ } finally {
80923
+ this.apiLoading = false;
80924
+ }
80925
+ },
80926
+ chooseLike(index) {
80927
+ const { contentId } = this.messageListData[index];
80928
+ feedbackSubmit({
80929
+ additionalComment: '',
80930
+ feedbackType: this.messageListData[index].feedbackType == 1 ? null : 1,
80931
+ contentId,
80932
+ options: this.selectedLikeOptions,
80933
+ }).then((res) => {
80934
+ if (res.data.code == 200) {
80935
+ this.messageListData[index].feedbackType = this.messageListData[index].feedbackType == 1 ? null : 1;
80936
+ }
80937
+ });
80938
+ },
80939
+ // 点击拉踩按钮
80940
+ chooseCai(index) {
80941
+ const { contentId } = this.messageListData[index];
80942
+ feedbackSubmit({
80943
+ additionalComment: this.dislikeFeedback,
80944
+ feedbackType: this.messageListData[index].feedbackType == 2 ? null : 2,
80945
+ contentId,
80946
+ options: this.selectedDislikeOptions,
80947
+ }).then((res) => {
80948
+ if (res.data.code == 200) {
80949
+ this.messageListData[index].feedbackType = this.messageListData[index].feedbackType == 2 ? null : 2;
80950
+ }
80951
+ });
80952
+ },
80953
+ submitSuggest(item) {
80954
+ this.chatEvaluate(item, 2);
80955
+ item.popoverStatus = false;
80956
+ item.type = 2;
80957
+ this.caiReset();
80958
+ },
80959
+ canclePopoverr(item) {
80960
+ item.popoverStatus = false;
80961
+ this.caiReset();
80962
+ },
80963
+ caiReset() {
80964
+ this.errors = [];
80965
+ this.input = '';
80966
+ },
80967
+ share(item) {
80968
+ if (!this.stop) {
80969
+ return this.$message({
80970
+ message: '请等机器人回复后再分享哦~',
80971
+ type: 'warning',
80972
+ });
80973
+ }
80974
+ // this.shareDialog = true
80975
+ this.shareStatus = true;
80976
+ this.shareList = [];
80977
+ this.shareList.push(item.contentId + ',' + item.parentMsgId);
80978
+ this.chatId = item.chatId;
80979
+ this.$parent.inputShow = false;
80980
+ this.$parent.inputConversionShow = false;
80981
+ },
80982
+ cancleShare() {
80983
+ this.shareStatus = false;
80984
+ this.reset();
80985
+ },
80986
+ showDialog() {
80987
+ const flattenedShareList = this.shareList.map((str) => str.split(',')).flat();
80988
+ this.apiLoading = true;
80989
+ shareChatMsg({
80990
+ chatId: this.chatId,
80991
+ msgIds: flattenedShareList,
80992
+ })
80993
+ .then((res) => {
80994
+ this.shareMsgId = res.data.shareId;
80995
+ this.contents = res.data.contents;
80996
+ this.shareText = location.origin + '/#/share/' + res.data.shareId;
80997
+ this.shareDialog = true;
80998
+ })
80999
+ .catch((error) => {
81000
+ console.error('分享失败:', error);
81001
+ this.$message({
81002
+ message: '分享失败,请重试',
81003
+ type: 'error',
81004
+ });
81005
+ })
81006
+ .finally(() => {
81007
+ this.apiLoading = false;
81008
+ });
81009
+ },
81010
+ shareCopy() {
81011
+ this.$message({
81012
+ message: '复制成功!',
81013
+ type: 'success',
81014
+ });
81015
+ var cleanText = location.origin + '/#/share/' + this.shareMsgId;
81016
+ // 使用正则表达式去除文本中的空格
81017
+ var tag = document.createElement('textarea');
81018
+ tag.value = cleanText;
81019
+ document.body.appendChild(tag);
81020
+ tag.select();
81021
+ document.execCommand('copy');
81022
+ tag.remove();
81023
+ return cleanText;
81024
+ },
81025
+ handleClose() {
81026
+ this.shareMsgId = '';
81027
+ this.contents = [];
81028
+ this.shareDialog = false;
81029
+ // this.cancleShare()
81030
+ },
81031
+ // 初始化
81032
+ reset() {
81033
+ this.shareList = [];
81034
+ this.$parent.inputShow = true;
81035
+ this.$parent.inputConversionShow = true;
81036
+ },
81037
+ // 点击复制
81038
+ async clickCopy(text) {
81039
+ if (!text) return;
81040
+ this.$message({
81041
+ message: '复制成功!',
81042
+ type: 'success',
81043
+ });
81044
+ // 使用正则表达式去除文本中的HTML标签
81045
+ var cleanText = text.replace(/<[^>]*>?/gm, '');
81046
+ // 使用正则表达式去除文本中的空格
81047
+ cleanText = cleanText.replace(/\s+/g, '');
81048
+ var tag = document.createElement('textarea');
81049
+ tag.value = cleanText;
81050
+ document.body.appendChild(tag);
81051
+ tag.select();
81052
+ document.execCommand('copy');
81053
+ tag.remove();
81054
+ return cleanText;
81055
+ },
81056
+
81057
+ changeVoice() {
81058
+ this.VoiceShow = !this.VoiceShow;
81059
+ },
81060
+ uploadFile() {
81061
+ this.$emit('uploadFile');
81062
+ },
81063
+ sendMessage(content, flag) {
81064
+ if (!this.$parent.stop) {
81065
+ return this.$message({
81066
+ message: '请等机器人回复后再发送哦~',
81067
+ type: 'warning',
81068
+ });
81069
+ }
81070
+ // if (getType()) {
81071
+
81072
+ if (this.userInput.trim() !== '' || content) {
81073
+ this.$parent.messageListData.push({
81074
+ content: content || this.userInput,
81075
+ role: 'user',
81076
+ });
81077
+ } else {
81078
+ return;
81079
+ }
81080
+ if (this.getType) {
81081
+ if (this.sideCurrentName == '新的对话') {
81082
+ this.$emit('editHuiHuaName', this.sideCurrentId, this.userInput);
81083
+ }
81084
+ } else {
81085
+ if (this.sideCurrentName == '新的对话') {
81086
+ this.dialogue.push({
81087
+ chatName: this.userInput,
81088
+ chatType: '1',
81089
+ chatId: this.$parent.sideCurrentId,
81090
+ });
81091
+ this.$parent.dialogue = this.dialogue;
81092
+ }
81093
+ }
81094
+ // }
81095
+
81096
+ const self = this;
81097
+ self.waitAnswer = true;
81098
+ self.chatSending = true; // 开始聊天发送,设置等待状态
81099
+ const controller = new AbortController();
81100
+ const signal = controller.signal;
81101
+ this.$parent.stop = false;
81102
+ if (this.userInput.includes('如:')) {
81103
+ this.userInput = this.userInput.substring(this.userInput.indexOf('如') + 2, this.userInput.length);
81104
+ } else {
81105
+ this.userInput = this.userInput;
81106
+ }
81107
+ const baseUrl = sessionStorage.getItem('environment') === 'test' ? 'https://ai-test.banwoxue.com/prod-api' : 'https://ai.banwoxue.com/prod-api';
81108
+ fetchEventSource(baseUrl + '/intelligentBody/chatAI', {
81109
+ method: 'POST',
81110
+ signal: signal,
81111
+ openWhenHidden: true,
81112
+ headers: {
81113
+ 'Content-Type': 'application/json',
81114
+ Authorization: 'Bearer ' + js_cookie_default.a.get('agentToken'),
81115
+ },
81116
+ body: JSON.stringify({
81117
+ messageList: [
81118
+ {
81119
+ chatId: this.messageListData.length > 1 ? this.messageListData[1].chatId : '',
81120
+ content: content || this.userInput,
81121
+ role: 'user',
81122
+ chatType: this.chatType,
81123
+ // bodyId: this.$route.query.bodyId || localStorage.getItem('bodyId'),
81124
+ bodyId: this.$parent.agentId || this.$route.query.bodyId,
81125
+ // fileId: this.$parent.fileid,
81126
+ model_name: 'chatglm3-6b',
81127
+ templateId: this.templateId || '',
81128
+ panelId: this.panelId || '',
81129
+ structure:
81130
+ this.$parent.pptSections.length > 0
81131
+ ? {
81132
+ title: this.$parent.PPTTitle || '',
81133
+ catalogs: this.$parent.pptSections,
81134
+ }
81135
+ : null,
81136
+ coverId: this.$parent.coverId,
81137
+ // model_name: modelName || 'chatglm3-6b'
81138
+ },
81139
+ ],
81140
+ }),
81141
+
81142
+ onmessage(msg) {
81143
+ // 初始化一个空字符串用于拼接消息
81144
+ self.apiLoading = false; // 收到第一条回复时隐藏loading
81145
+ if (msg.event === '') {
81146
+ var result = JSON.parse(msg.data);
81147
+ self.tempAnswerStatus = result.status;
81148
+ if (self.waitAnswer) {
81149
+ if (self.tempAnswerStatus == null) {
81150
+ self.$parent.stop = true;
81151
+ return self.$message({
81152
+ message: '您今日的次数已经用完',
81153
+ type: 'warning',
81154
+ });
81155
+ }
81156
+ if (result.content) {
81157
+ self.$parent.userInput = '';
81158
+ self.userInput = '';
81159
+ // 第一次收到回答,创建一个消息记录
81160
+ self.waitAnswer = false;
81161
+ self.chatSending = false; // 收到第一条回复时隐藏loading
81162
+ const newMessage = {
81163
+ content: '',
81164
+ role: 'assistant',
81165
+ typeId: self.panelId === 2 ? 2: 0,
81166
+ contentId: result.msgId,
81167
+ parentMsgId: result.parentMsgId,
81168
+ chatId: result.chatId,
81169
+ type: null,
81170
+ templateId: self.templateId,
81171
+ panelId: self.panelId,
81172
+ };
81173
+ self.returnText = result.content || '';
81174
+ self.messageListData.push(newMessage);
81175
+ }
81176
+ } else if (self.tempAnswerStatus != 2) {
81177
+ let lastMessage = self.$parent.messageListData[self.$parent.messageListData.length - 1];
81178
+
81179
+ // 临时保存回答内容
81180
+ self.returnText += result.content;
81181
+ // 如果之前不是卡片类型,但现在是了,就更新
81182
+ if (lastMessage.typeId !== 1 && self.returnText.includes('<!--AI_HTML-->')) {
81183
+ lastMessage.typeId = 1;
81184
+ self.$parent.tableHtml = '';
81185
+ self.$parent.isSidebarCollapsed = true;
81186
+ self.$parent.aiJaDrawer = true;
81187
+ self.$parent.aiPptDrawer = false;
81188
+ } else if (self.returnText.includes('<!--AI_HTML-->')) {
81189
+ const target = '<!--AI_HTML-->';
81190
+ const index = self.returnText.indexOf(target);
81191
+ // 截取目标字符串之后的内容(若目标不存在则返回原字符串)
81192
+ let str = index !== -1 ? self.returnText.slice(index + target.length) : self.returnText;
81193
+ // '<!--/AI_HTML-->'为分隔符分割,最多分割1次
81194
+ const parts = str.split('<!--/AI_HTML-->', 2);
81195
+ // 返回分割后的第一部分(若不存在分隔符则返回原字符串)
81196
+ self.$parent.tableHtml = parts[0] || str;
81197
+ } else if (self.panelId == 2) {
81198
+ // ppt内容加载处理逻辑
81199
+ self.$parent.messageListData[self.$parent.messageListData.length - 1].content = result.content;
81200
+ const obj = JSON.parse(result.content);
81201
+ self.$parent.isSidebarCollapsed = true;
81202
+ self.$parent.aiPptDrawer = true;
81203
+ self.$parent.aiJaDrawer = false;
81204
+ self.$parent.pptSections = obj.structure.catalogs;
81205
+ self.$parent.PPTTitle = obj.structure.title;
81206
+ if (obj.latestResult && obj.latestResult.images_url.length > 0) {
81207
+ self.$parent.images_url = obj.latestResult.images_url;
81208
+ }
81209
+ }
81210
+ if (self.panelId != 2) {
81211
+ lastMessage.content = self.returnText;
81212
+ }
81213
+ if (self.messageListData.length > 1) {
81214
+ self.messageListData[self.messageListData.length - 2].contentId = result.parentMsgId;
81215
+ }
81216
+ lastMessage.status = result.status;
81217
+ self.$parent.content = lastMessage;
81218
+ if (!self.getType) {
81219
+ lastMessage.chatId = result.chatId;
81220
+ self.dialogue[self.dialogue.length - 1].chatId = result.chatId;
81221
+ }
81222
+ self.tempAnswerStatus = result.status;
81223
+ }
81224
+ if (self.tempAnswerStatus === 2) {
81225
+ if (self.panelId == 2) {
81226
+ self.$parent.messageListData[self.$parent.messageListData.length - 1].status = self.tempAnswerStatus;
81227
+ self.$parent.messageListData[self.$parent.messageListData.length - 1].contentId = result.msgId;
81228
+ }
81229
+ self.$parent.pptContentId = result.msgId;
81230
+ if (result.content) {
81231
+ try {
81232
+ self.$parent.messageListData[self.$parent.messageListData.length - 1].reference = JSON.parse(result.content);
81233
+ } catch (e) {
81234
+ console.error('Error parsing reference content:', e);
81235
+ }
81236
+ }
81237
+ self.$parent.stop = true;
81238
+ self.apiLoading = false; // 请求完成,清除等待状态
81239
+ }
81240
+ } else if (msg.data === 'close') {
81241
+ controller.abort();
81242
+ }
81243
+ },
81244
+
81245
+ onerror(err) {
81246
+ self.$message({
81247
+ message: '访问的人过多,请稍后重试',
81248
+ type: 'warning',
81249
+ });
81250
+ self.$parent.stop = true;
81251
+ self.chatSending = false; // 请求出错,清除等待状态
81252
+ console.log(err, '失败');
81253
+ throw err; //必须throw才能停止
81254
+ },
81255
+ });
81256
+ },
81257
+
81258
+ // 线程等待
81259
+ simulateThreadWait(milliseconds) {
81260
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
81261
+ },
81262
+ // 检测是否在底部
81263
+ isAtBottom() {
81264
+ if (!this.$refs.recordListRef) return true;
81265
+ const element = this.$refs.recordListRef;
81266
+ const threshold = 50; // 距离底部50px以内认为是在底部
81267
+ return element.scrollHeight - element.scrollTop - element.clientHeight < threshold;
81268
+ },
81269
+
81270
+ // 处理用户滚动事件
81271
+ handleUserScroll() {
81272
+ // 如果是程序触发的滚动,忽略
81273
+ if (this.programmaticScrolling) return;
81274
+
81275
+ // 清除之前的定时器
81276
+ if (this.userScrollTimer) {
81277
+ clearTimeout(this.userScrollTimer);
81278
+ }
81279
+
81280
+ // 检查是否在底部
81281
+ if (this.isAtBottom()) {
81282
+ // 在底部,启用自动滚动
81283
+ this.autoScroll = true;
81284
+ } else {
81285
+ // 不在底部,禁用自动滚动
81286
+ this.autoScroll = false;
81287
+ }
81288
+ },
81289
+
81290
+ scrollToBottom() {
81291
+ // 只有在自动滚动开启时才执行
81292
+ if (!this.autoScroll) return;
81293
+
81294
+ this.$nextTick(() => {
81295
+ this.programmaticScroll();
81296
+ });
81297
+ },
81298
+
81299
+ // 程序触发的滚动(不会被用户滚动检测影响)
81300
+ programmaticScroll() {
81301
+ if (!this.$refs.recordListRef) return;
81302
+
81303
+ // 标记程序滚动开始
81304
+ this.programmaticScrolling = true;
81305
+
81306
+ // 执行滚动
81307
+ this.$refs.recordListRef.scrollTo({
81308
+ top: this.$refs.recordListRef.scrollHeight,
81309
+ behavior: 'smooth',
81310
+ });
81311
+
81312
+ // 延迟重置程序滚动标志(等待滚动动画完成)
81313
+ setTimeout(() => {
81314
+ this.programmaticScrolling = false;
81315
+ }, 600); // 等待滚动动画完成
81316
+ },
81317
+
81318
+ // 显示好评选项
81319
+ showLikeOptions(index, event) {
81320
+ this.selectedLikeOptions = []; // 重置选择
81321
+ this.currentLikeItem = index;
81322
+ if (this.messageListData[index].feedbackType == 1) {
81323
+ this.chooseLike(index);
81324
+ return;
81325
+ }
81326
+ // 计算弹窗位置 - 在好评按钮正下方居中显示
81327
+ const rect = event.target.getBoundingClientRect();
81328
+ const popupWidth = 400; // 弹窗宽度
81329
+ this.likePopupStyle = {
81330
+ position: 'fixed',
81331
+ left: rect.left + rect.width / 2 - popupWidth / 2 + 'px', // 居中对齐
81332
+ top: rect.bottom + 10 + 'px', // 在按钮下方10px处显示
81333
+ zIndex: 9999,
81334
+ };
81335
+ this.likeOptionsVisible = true;
81336
+ },
81337
+
81338
+ // 切换好评选项(支持多选)
81339
+ toggleLikeOption(option) {
81340
+ const index = this.selectedLikeOptions.indexOf(option);
81341
+ if (index > -1) {
81342
+ // 如果已选中,则取消选择
81343
+ this.selectedLikeOptions.splice(index, 1);
81344
+ } else {
81345
+ // 如果未选中,则添加选择
81346
+ this.selectedLikeOptions.push(option);
81347
+ }
81348
+ },
81349
+
81350
+ // 确认好评选项
81351
+ confirmLikeOptions() {
81352
+ console.log('选择的评价选项:', this.selectedLikeOptions);
81353
+ // 这里可以调用评价API
81354
+ if (this.currentLikeItem && this.selectedLikeOptions.length > 0) {
81355
+ this.chooseLike(this.currentLikeItem);
81356
+ }
81357
+ this.closeLikeOptions();
81358
+ },
81359
+
81360
+ // 关闭好评选项弹窗
81361
+ closeLikeOptions() {
81362
+ this.likeOptionsVisible = false;
81363
+ this.currentLikeItem = null;
81364
+ this.selectedLikeOptions = [];
81365
+ this.likePopupStyle = {};
81366
+ },
81367
+
81368
+ // 显示差评反馈弹窗
81369
+ showDislikeModal(index) {
81370
+ this.currentDislikeItem = index;
81371
+ this.selectedDislikeOptions = [];
81372
+ this.dislikeFeedback = '';
81373
+ if (this.messageListData[index].feedbackType == 2) {
81374
+ this.chooseCai(index);
81375
+ return;
81376
+ }
81377
+ this.dislikeModalVisible = true;
81378
+ },
81379
+
81380
+ // 切换差评选项(支持多选)
81381
+ toggleDislikeOption(option) {
81382
+ const index = this.selectedDislikeOptions.indexOf(option);
81383
+ if (index > -1) {
81384
+ // 如果已选中,则取消选择
81385
+ this.selectedDislikeOptions.splice(index, 1);
81386
+ } else {
81387
+ // 如果未选中,则添加选择
81388
+ this.selectedDislikeOptions.push(option);
81389
+ }
81390
+ },
81391
+
81392
+ // 提交差评反馈
81393
+ submitDislikeFeedback() {
81394
+ if (this.selectedDislikeOptions.length == 0) {
81395
+ return this.$message.warning('请选择差评原因');
81396
+ }
81397
+ // 这里可以调用差评API
81398
+ if (this.currentDislikeItem) {
81399
+ this.chooseCai(this.currentDislikeItem);
81400
+ }
81401
+ this.closeDislikeModal();
81402
+ },
81403
+
81404
+ // 关闭差评反馈弹窗
81405
+ closeDislikeModal() {
81406
+ this.dislikeModalVisible = false;
81407
+ this.currentDislikeItem = null;
81408
+ this.selectedDislikeOptions = [];
81409
+ this.dislikeFeedback = '';
81410
+ },
81411
+ },
81412
+ created() { },
81413
+ mounted() {
81414
+ // 添加滚动事件监听
81415
+ if (this.$refs.recordListRef) {
81416
+ this.$refs.recordListRef.addEventListener('scroll', this.handleUserScroll);
81417
+ }
81418
+
81419
+ setInterval(() => {
81420
+ if (document.getElementById('gif')) {
81421
+ document.getElementById('gif').src = document.getElementById('gif').src;
81422
+ }
81423
+ }, 2300);
81424
+ },
81425
+
81426
+ beforeDestroy() {
81427
+ // 清理定时器
81428
+ if (this.scrollTimer) {
81429
+ clearTimeout(this.scrollTimer);
81430
+ }
81431
+ if (this.userScrollTimer) {
81432
+ clearTimeout(this.userScrollTimer);
81433
+ }
81434
+ // 移除滚动事件监听
81435
+ if (this.$refs.recordListRef) {
81436
+ this.$refs.recordListRef.removeEventListener('scroll', this.handleUserScroll);
81437
+ }
81438
+ },
81439
+ watch: {
81440
+ // 监听聊天发送状态
81441
+ chatSending(newVal) {
81442
+ if (newVal) {
81443
+ // 开始发送消息时启用自动滚动并滚动到底部
81444
+ this.autoScroll = true;
81445
+ this.$nextTick(() => {
81446
+ this.scrollToBottom();
81447
+ });
81448
+ }
81449
+ },
81450
+ // 监听消息列表变化
81451
+ messageListData: {
81452
+ handler() {
81453
+ // 消息更新时,如果自动滚动开启,则滚动到底部
81454
+ if (this.autoScroll) {
81455
+ this.$nextTick(() => {
81456
+ this.scrollToBottom();
81457
+ });
81458
+ }
81459
+ },
81460
+ deep: true,
81461
+ },
81462
+ },
81463
+ });
81468
81464
 
81469
81465
  // CONCATENATED MODULE: ./src/components/agentComponent/chat.vue?vue&type=script&lang=js
81470
81466
  /* harmony default export */ var agentComponent_chatvue_type_script_lang_js = (chatvue_type_script_lang_js);
81471
- // EXTERNAL MODULE: ./src/components/agentComponent/chat.vue?vue&type=style&index=0&id=7d856dfe&prod&lang=scss&scoped=true
81472
- var chatvue_type_style_index_0_id_7d856dfe_prod_lang_scss_scoped_true = __webpack_require__("062f");
81467
+ // EXTERNAL MODULE: ./src/components/agentComponent/chat.vue?vue&type=style&index=0&id=21adfc82&prod&lang=scss&scoped=true
81468
+ var chatvue_type_style_index_0_id_21adfc82_prod_lang_scss_scoped_true = __webpack_require__("c67e");
81473
81469
 
81474
- // EXTERNAL MODULE: ./src/components/agentComponent/chat.vue?vue&type=style&index=1&id=7d856dfe&prod&scoped=true&lang=css
81475
- var chatvue_type_style_index_1_id_7d856dfe_prod_scoped_true_lang_css = __webpack_require__("276c");
81470
+ // EXTERNAL MODULE: ./src/components/agentComponent/chat.vue?vue&type=style&index=1&id=21adfc82&prod&scoped=true&lang=css
81471
+ var chatvue_type_style_index_1_id_21adfc82_prod_scoped_true_lang_css = __webpack_require__("aa19");
81476
81472
 
81477
81473
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
81478
81474
  /* globals __VUE_SSR_CONTEXT__ */
@@ -81584,11 +81580,11 @@ function normalizeComponent(
81584
81580
 
81585
81581
  var component = normalizeComponent(
81586
81582
  agentComponent_chatvue_type_script_lang_js,
81587
- chatvue_type_template_id_7d856dfe_scoped_true_render,
81588
- chatvue_type_template_id_7d856dfe_scoped_true_staticRenderFns,
81583
+ chatvue_type_template_id_21adfc82_scoped_true_render,
81584
+ chatvue_type_template_id_21adfc82_scoped_true_staticRenderFns,
81589
81585
  false,
81590
81586
  null,
81591
- "7d856dfe",
81587
+ "21adfc82",
81592
81588
  null
81593
81589
 
81594
81590
  )
@@ -84684,7 +84680,7 @@ function formatTimeDisplay(createTime) {
84684
84680
  },
84685
84681
  handlePptTemplateSelected(id) {
84686
84682
  this.coverId = id;
84687
- this.userInput = `帮我生成PPT,主题${this.PPTTitle}。`;
84683
+ this.userInput = `帮我生成PPT,${this.PPTTitle}。`;
84688
84684
  this.sendMessage('', 2);
84689
84685
  },
84690
84686
  // 设置焦点到课程名称输入框
@@ -84730,7 +84726,7 @@ function formatTimeDisplay(createTime) {
84730
84726
  generateLessonPlanPPT() {
84731
84727
  this.pptSections = [];
84732
84728
  this.PPTTitle = this.$refs.PPTTitle.innerText;
84733
- this.userInput = `帮我生成PPT,主题${this.PPTTitle}。`;
84729
+ this.userInput = `帮我生成PPT,主题为:${this.PPTTitle}。`;
84734
84730
  this.sendMessage('', 2);
84735
84731
  },
84736
84732
 
@@ -84805,11 +84801,11 @@ function formatTimeDisplay(createTime) {
84805
84801
 
84806
84802
  // CONCATENATED MODULE: ./src/components/banwoxueAgentComponent.vue?vue&type=script&lang=js
84807
84803
  /* harmony default export */ var components_banwoxueAgentComponentvue_type_script_lang_js = (banwoxueAgentComponentvue_type_script_lang_js);
84808
- // EXTERNAL MODULE: ./src/components/banwoxueAgentComponent.vue?vue&type=style&index=0&id=0902c76a&prod&lang=css
84809
- var banwoxueAgentComponentvue_type_style_index_0_id_0902c76a_prod_lang_css = __webpack_require__("569a");
84804
+ // EXTERNAL MODULE: ./src/components/banwoxueAgentComponent.vue?vue&type=style&index=0&id=1ac384ce&prod&lang=css
84805
+ var banwoxueAgentComponentvue_type_style_index_0_id_1ac384ce_prod_lang_css = __webpack_require__("9dd2");
84810
84806
 
84811
- // EXTERNAL MODULE: ./src/components/banwoxueAgentComponent.vue?vue&type=style&index=1&id=0902c76a&prod&lang=scss&scoped=true
84812
- var banwoxueAgentComponentvue_type_style_index_1_id_0902c76a_prod_lang_scss_scoped_true = __webpack_require__("a60f");
84807
+ // EXTERNAL MODULE: ./src/components/banwoxueAgentComponent.vue?vue&type=style&index=1&id=1ac384ce&prod&lang=scss&scoped=true
84808
+ var banwoxueAgentComponentvue_type_style_index_1_id_1ac384ce_prod_lang_scss_scoped_true = __webpack_require__("6eb7");
84813
84809
 
84814
84810
  // CONCATENATED MODULE: ./src/components/banwoxueAgentComponent.vue
84815
84811
 
@@ -84827,7 +84823,7 @@ var banwoxueAgentComponent_component = normalizeComponent(
84827
84823
  staticRenderFns,
84828
84824
  false,
84829
84825
  null,
84830
- "0902c76a",
84826
+ "1ac384ce",
84831
84827
  null
84832
84828
 
84833
84829
  )