byt-lingxiao-ai 0.3.21 → 0.3.23
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.
- package/components/AiMessage.vue +43 -14
- package/components/utils/StreamParser.js +1 -1
- package/dist/index.common.js +258 -62
- package/dist/index.common.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.umd.js +215 -19
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/components/AiMessage.vue
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<div class="ai-thinking-time">{{ message.time ? `思考用时${message.time}秒` : '思考中...' }}</div>
|
|
11
11
|
<div class="ai-thinking-content" v-if="thinkingExpanded">{{ message.thinking }}</div>
|
|
12
12
|
</div>
|
|
13
|
-
<div class="ai-content markdown-body" v-html="renderedContent"></div>
|
|
13
|
+
<div class="ai-content markdown-body" @click="handleLinkClick" v-html="renderedContent"></div>
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
@@ -21,19 +21,22 @@ import hljs from 'highlight.js';
|
|
|
21
21
|
import 'highlight.js/styles/github.css';
|
|
22
22
|
|
|
23
23
|
// 创建自定义渲染器
|
|
24
|
-
const renderer = new marked.Renderer()
|
|
25
|
-
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
const renderer = new marked.Renderer()
|
|
25
|
+
|
|
26
|
+
// 自定义链接渲染
|
|
27
|
+
renderer.link = function ({ href, text }) {
|
|
28
|
+
let dataPath = ''
|
|
29
|
+
const url = new URL(href, window.location.origin)
|
|
30
|
+
const pathname = url.pathname
|
|
31
|
+
|
|
32
|
+
if (pathname.startsWith('/portal/')) {
|
|
33
|
+
dataPath = pathname.substring('/portal'.length)
|
|
34
|
+
return `<a href="javascript:void(0)" data-path="${dataPath}" data-text="${text}">${text}</a>`
|
|
35
|
+
} else {
|
|
36
|
+
dataPath = href
|
|
37
|
+
return `<a href="${dataPath}" target="_blank">${text}</a>`
|
|
38
|
+
}
|
|
39
|
+
}
|
|
37
40
|
marked.setOptions({
|
|
38
41
|
renderer: renderer,
|
|
39
42
|
highlight: function(code, lang) {
|
|
@@ -69,6 +72,32 @@ export default {
|
|
|
69
72
|
thinkStatus(newVal, oldVal) {
|
|
70
73
|
console.log('thinkStatus 变化:', newVal, oldVal);
|
|
71
74
|
}
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
handleLinkClick(event) {
|
|
78
|
+
const link = event.target.closest('a')
|
|
79
|
+
if (!link) return
|
|
80
|
+
|
|
81
|
+
const routePath = link.getAttribute('data-path')
|
|
82
|
+
const linkText = link.getAttribute('data-text')
|
|
83
|
+
|
|
84
|
+
if (routePath && linkText) {
|
|
85
|
+
event.preventDefault()
|
|
86
|
+
|
|
87
|
+
if (this.$appOptions?.store?.dispatch) {
|
|
88
|
+
this.$appOptions.store.dispatch('tags/addTagview', {
|
|
89
|
+
path: routePath,
|
|
90
|
+
fullPath: routePath,
|
|
91
|
+
label: linkText,
|
|
92
|
+
name: linkText,
|
|
93
|
+
meta: { title: linkText }
|
|
94
|
+
})
|
|
95
|
+
this.$appOptions.router.push({ path: routePath })
|
|
96
|
+
} else {
|
|
97
|
+
this.$router.push(routePath).catch(() => {})
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
72
101
|
}
|
|
73
102
|
}
|
|
74
103
|
</script>
|
package/dist/index.common.js
CHANGED
|
@@ -771,50 +771,19 @@ module.exports = shell;
|
|
|
771
771
|
/***/ }),
|
|
772
772
|
|
|
773
773
|
/***/ 655:
|
|
774
|
-
/***/ (function(module) {
|
|
774
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
775
775
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
776
|
+
"use strict";
|
|
777
|
+
|
|
778
|
+
var classof = __webpack_require__(6955);
|
|
779
|
+
|
|
780
|
+
var $String = String;
|
|
781
|
+
|
|
782
|
+
module.exports = function (argument) {
|
|
783
|
+
if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
784
|
+
return $String(argument);
|
|
785
|
+
};
|
|
782
786
|
|
|
783
|
-
/** @type LanguageFn */
|
|
784
|
-
function flix(hljs) {
|
|
785
|
-
const CHAR = {
|
|
786
|
-
className: 'string',
|
|
787
|
-
begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
|
|
788
|
-
};
|
|
789
|
-
const STRING = {
|
|
790
|
-
className: 'string',
|
|
791
|
-
variants: [{
|
|
792
|
-
begin: '"',
|
|
793
|
-
end: '"'
|
|
794
|
-
}]
|
|
795
|
-
};
|
|
796
|
-
const NAME = {
|
|
797
|
-
className: 'title',
|
|
798
|
-
relevance: 0,
|
|
799
|
-
begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/
|
|
800
|
-
};
|
|
801
|
-
const METHOD = {
|
|
802
|
-
className: 'function',
|
|
803
|
-
beginKeywords: 'def',
|
|
804
|
-
end: /[:={\[(\n;]/,
|
|
805
|
-
excludeEnd: true,
|
|
806
|
-
contains: [NAME]
|
|
807
|
-
};
|
|
808
|
-
return {
|
|
809
|
-
name: 'Flix',
|
|
810
|
-
keywords: {
|
|
811
|
-
keyword: ["case", "class", "def", "else", "enum", "if", "impl", "import", "in", "lat", "rel", "index", "let", "match", "namespace", "switch", "type", "yield", "with"],
|
|
812
|
-
literal: ["true", "false"]
|
|
813
|
-
},
|
|
814
|
-
contains: [hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, CHAR, STRING, METHOD, hljs.C_NUMBER_MODE]
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
module.exports = flix;
|
|
818
787
|
|
|
819
788
|
/***/ }),
|
|
820
789
|
|
|
@@ -6397,7 +6366,7 @@ hljs.registerLanguage('erlang-repl', __webpack_require__(5233));
|
|
|
6397
6366
|
hljs.registerLanguage('erlang', __webpack_require__(7755));
|
|
6398
6367
|
hljs.registerLanguage('excel', __webpack_require__(5905));
|
|
6399
6368
|
hljs.registerLanguage('fix', __webpack_require__(3041));
|
|
6400
|
-
hljs.registerLanguage('flix', __webpack_require__(
|
|
6369
|
+
hljs.registerLanguage('flix', __webpack_require__(3036));
|
|
6401
6370
|
hljs.registerLanguage('fortran', __webpack_require__(3792));
|
|
6402
6371
|
hljs.registerLanguage('fsharp', __webpack_require__(7846));
|
|
6403
6372
|
hljs.registerLanguage('gams', __webpack_require__(8092));
|
|
@@ -6627,6 +6596,21 @@ var POLYFILL = isForced.POLYFILL = 'P';
|
|
|
6627
6596
|
module.exports = isForced;
|
|
6628
6597
|
|
|
6629
6598
|
|
|
6599
|
+
/***/ }),
|
|
6600
|
+
|
|
6601
|
+
/***/ 2812:
|
|
6602
|
+
/***/ (function(module) {
|
|
6603
|
+
|
|
6604
|
+
"use strict";
|
|
6605
|
+
|
|
6606
|
+
var $TypeError = TypeError;
|
|
6607
|
+
|
|
6608
|
+
module.exports = function (passed, required) {
|
|
6609
|
+
if (passed < required) throw new $TypeError('Not enough arguments');
|
|
6610
|
+
return passed;
|
|
6611
|
+
};
|
|
6612
|
+
|
|
6613
|
+
|
|
6630
6614
|
/***/ }),
|
|
6631
6615
|
|
|
6632
6616
|
/***/ 2839:
|
|
@@ -7255,6 +7239,54 @@ module.exports = phpTemplate;
|
|
|
7255
7239
|
|
|
7256
7240
|
/***/ }),
|
|
7257
7241
|
|
|
7242
|
+
/***/ 3036:
|
|
7243
|
+
/***/ (function(module) {
|
|
7244
|
+
|
|
7245
|
+
/*
|
|
7246
|
+
Language: Flix
|
|
7247
|
+
Category: functional
|
|
7248
|
+
Author: Magnus Madsen <mmadsen@uwaterloo.ca>
|
|
7249
|
+
Website: https://flix.dev/
|
|
7250
|
+
*/
|
|
7251
|
+
|
|
7252
|
+
/** @type LanguageFn */
|
|
7253
|
+
function flix(hljs) {
|
|
7254
|
+
const CHAR = {
|
|
7255
|
+
className: 'string',
|
|
7256
|
+
begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
|
|
7257
|
+
};
|
|
7258
|
+
const STRING = {
|
|
7259
|
+
className: 'string',
|
|
7260
|
+
variants: [{
|
|
7261
|
+
begin: '"',
|
|
7262
|
+
end: '"'
|
|
7263
|
+
}]
|
|
7264
|
+
};
|
|
7265
|
+
const NAME = {
|
|
7266
|
+
className: 'title',
|
|
7267
|
+
relevance: 0,
|
|
7268
|
+
begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/
|
|
7269
|
+
};
|
|
7270
|
+
const METHOD = {
|
|
7271
|
+
className: 'function',
|
|
7272
|
+
beginKeywords: 'def',
|
|
7273
|
+
end: /[:={\[(\n;]/,
|
|
7274
|
+
excludeEnd: true,
|
|
7275
|
+
contains: [NAME]
|
|
7276
|
+
};
|
|
7277
|
+
return {
|
|
7278
|
+
name: 'Flix',
|
|
7279
|
+
keywords: {
|
|
7280
|
+
keyword: ["case", "class", "def", "else", "enum", "if", "impl", "import", "in", "lat", "rel", "index", "let", "match", "namespace", "switch", "type", "yield", "with"],
|
|
7281
|
+
literal: ["true", "false"]
|
|
7282
|
+
},
|
|
7283
|
+
contains: [hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, CHAR, STRING, METHOD, hljs.C_NUMBER_MODE]
|
|
7284
|
+
};
|
|
7285
|
+
}
|
|
7286
|
+
module.exports = flix;
|
|
7287
|
+
|
|
7288
|
+
/***/ }),
|
|
7289
|
+
|
|
7258
7290
|
/***/ 3041:
|
|
7259
7291
|
/***/ (function(module) {
|
|
7260
7292
|
|
|
@@ -13016,6 +13048,63 @@ module.exports =
|
|
|
13016
13048
|
(function () { return this; })() || Function('return this')();
|
|
13017
13049
|
|
|
13018
13050
|
|
|
13051
|
+
/***/ }),
|
|
13052
|
+
|
|
13053
|
+
/***/ 4603:
|
|
13054
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
13055
|
+
|
|
13056
|
+
"use strict";
|
|
13057
|
+
|
|
13058
|
+
var defineBuiltIn = __webpack_require__(6840);
|
|
13059
|
+
var uncurryThis = __webpack_require__(9504);
|
|
13060
|
+
var toString = __webpack_require__(655);
|
|
13061
|
+
var validateArgumentsLength = __webpack_require__(2812);
|
|
13062
|
+
|
|
13063
|
+
var $URLSearchParams = URLSearchParams;
|
|
13064
|
+
var URLSearchParamsPrototype = $URLSearchParams.prototype;
|
|
13065
|
+
var append = uncurryThis(URLSearchParamsPrototype.append);
|
|
13066
|
+
var $delete = uncurryThis(URLSearchParamsPrototype['delete']);
|
|
13067
|
+
var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
|
|
13068
|
+
var push = uncurryThis([].push);
|
|
13069
|
+
var params = new $URLSearchParams('a=1&a=2&b=3');
|
|
13070
|
+
|
|
13071
|
+
params['delete']('a', 1);
|
|
13072
|
+
// `undefined` case is a Chromium 117 bug
|
|
13073
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=14222
|
|
13074
|
+
params['delete']('b', undefined);
|
|
13075
|
+
|
|
13076
|
+
if (params + '' !== 'a=2') {
|
|
13077
|
+
defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) {
|
|
13078
|
+
var length = arguments.length;
|
|
13079
|
+
var $value = length < 2 ? undefined : arguments[1];
|
|
13080
|
+
if (length && $value === undefined) return $delete(this, name);
|
|
13081
|
+
var entries = [];
|
|
13082
|
+
forEach(this, function (v, k) { // also validates `this`
|
|
13083
|
+
push(entries, { key: k, value: v });
|
|
13084
|
+
});
|
|
13085
|
+
validateArgumentsLength(length, 1);
|
|
13086
|
+
var key = toString(name);
|
|
13087
|
+
var value = toString($value);
|
|
13088
|
+
var index = 0;
|
|
13089
|
+
var dindex = 0;
|
|
13090
|
+
var found = false;
|
|
13091
|
+
var entriesLength = entries.length;
|
|
13092
|
+
var entry;
|
|
13093
|
+
while (index < entriesLength) {
|
|
13094
|
+
entry = entries[index++];
|
|
13095
|
+
if (found || entry.key === key) {
|
|
13096
|
+
found = true;
|
|
13097
|
+
$delete(this, entry.key);
|
|
13098
|
+
} else dindex++;
|
|
13099
|
+
}
|
|
13100
|
+
while (dindex < entriesLength) {
|
|
13101
|
+
entry = entries[dindex++];
|
|
13102
|
+
if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);
|
|
13103
|
+
}
|
|
13104
|
+
}, { enumerable: true, unsafe: true });
|
|
13105
|
+
}
|
|
13106
|
+
|
|
13107
|
+
|
|
13019
13108
|
/***/ }),
|
|
13020
13109
|
|
|
13021
13110
|
/***/ 4644:
|
|
@@ -19397,6 +19486,42 @@ function brainfuck(hljs) {
|
|
|
19397
19486
|
}
|
|
19398
19487
|
module.exports = brainfuck;
|
|
19399
19488
|
|
|
19489
|
+
/***/ }),
|
|
19490
|
+
|
|
19491
|
+
/***/ 7566:
|
|
19492
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
19493
|
+
|
|
19494
|
+
"use strict";
|
|
19495
|
+
|
|
19496
|
+
var defineBuiltIn = __webpack_require__(6840);
|
|
19497
|
+
var uncurryThis = __webpack_require__(9504);
|
|
19498
|
+
var toString = __webpack_require__(655);
|
|
19499
|
+
var validateArgumentsLength = __webpack_require__(2812);
|
|
19500
|
+
|
|
19501
|
+
var $URLSearchParams = URLSearchParams;
|
|
19502
|
+
var URLSearchParamsPrototype = $URLSearchParams.prototype;
|
|
19503
|
+
var getAll = uncurryThis(URLSearchParamsPrototype.getAll);
|
|
19504
|
+
var $has = uncurryThis(URLSearchParamsPrototype.has);
|
|
19505
|
+
var params = new $URLSearchParams('a=1');
|
|
19506
|
+
|
|
19507
|
+
// `undefined` case is a Chromium 117 bug
|
|
19508
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=14222
|
|
19509
|
+
if (params.has('a', 2) || !params.has('a', undefined)) {
|
|
19510
|
+
defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) {
|
|
19511
|
+
var length = arguments.length;
|
|
19512
|
+
var $value = length < 2 ? undefined : arguments[1];
|
|
19513
|
+
if (length && $value === undefined) return $has(this, name);
|
|
19514
|
+
var values = getAll(this, name); // also validates `this`
|
|
19515
|
+
validateArgumentsLength(length, 1);
|
|
19516
|
+
var value = toString($value);
|
|
19517
|
+
var index = 0;
|
|
19518
|
+
while (index < values.length) {
|
|
19519
|
+
if (values[index++] === value) return true;
|
|
19520
|
+
} return false;
|
|
19521
|
+
}, { enumerable: true, unsafe: true });
|
|
19522
|
+
}
|
|
19523
|
+
|
|
19524
|
+
|
|
19400
19525
|
/***/ }),
|
|
19401
19526
|
|
|
19402
19527
|
/***/ 7580:
|
|
@@ -23215,6 +23340,35 @@ module.exports = DESCRIPTORS && fails(function () {
|
|
|
23215
23340
|
});
|
|
23216
23341
|
|
|
23217
23342
|
|
|
23343
|
+
/***/ }),
|
|
23344
|
+
|
|
23345
|
+
/***/ 8721:
|
|
23346
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
23347
|
+
|
|
23348
|
+
"use strict";
|
|
23349
|
+
|
|
23350
|
+
var DESCRIPTORS = __webpack_require__(3724);
|
|
23351
|
+
var uncurryThis = __webpack_require__(9504);
|
|
23352
|
+
var defineBuiltInAccessor = __webpack_require__(2106);
|
|
23353
|
+
|
|
23354
|
+
var URLSearchParamsPrototype = URLSearchParams.prototype;
|
|
23355
|
+
var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
|
|
23356
|
+
|
|
23357
|
+
// `URLSearchParams.prototype.size` getter
|
|
23358
|
+
// https://github.com/whatwg/url/pull/734
|
|
23359
|
+
if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
|
|
23360
|
+
defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
|
|
23361
|
+
get: function size() {
|
|
23362
|
+
var count = 0;
|
|
23363
|
+
forEach(this, function () { count++; });
|
|
23364
|
+
return count;
|
|
23365
|
+
},
|
|
23366
|
+
configurable: true,
|
|
23367
|
+
enumerable: true
|
|
23368
|
+
});
|
|
23369
|
+
}
|
|
23370
|
+
|
|
23371
|
+
|
|
23218
23372
|
/***/ }),
|
|
23219
23373
|
|
|
23220
23374
|
/***/ 8727:
|
|
@@ -29013,8 +29167,8 @@ var UserMessage_component = normalizeComponent(
|
|
|
29013
29167
|
)
|
|
29014
29168
|
|
|
29015
29169
|
/* harmony default export */ var UserMessage = (UserMessage_component.exports);
|
|
29016
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/AiMessage.vue?vue&type=template&id=
|
|
29017
|
-
var
|
|
29170
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/AiMessage.vue?vue&type=template&id=7f2cec94&scoped=true
|
|
29171
|
+
var AiMessagevue_type_template_id_7f2cec94_scoped_true_render = function render() {
|
|
29018
29172
|
var _vm = this,
|
|
29019
29173
|
_c = _vm._self._c;
|
|
29020
29174
|
return _c('div', {
|
|
@@ -29044,11 +29198,20 @@ var AiMessagevue_type_template_id_c82646d8_scoped_true_render = function render(
|
|
|
29044
29198
|
staticClass: "ai-content markdown-body",
|
|
29045
29199
|
domProps: {
|
|
29046
29200
|
"innerHTML": _vm._s(_vm.renderedContent)
|
|
29201
|
+
},
|
|
29202
|
+
on: {
|
|
29203
|
+
"click": _vm.handleLinkClick
|
|
29047
29204
|
}
|
|
29048
29205
|
})])]);
|
|
29049
29206
|
};
|
|
29050
|
-
var
|
|
29051
|
-
|
|
29207
|
+
var AiMessagevue_type_template_id_7f2cec94_scoped_true_staticRenderFns = [];
|
|
29208
|
+
|
|
29209
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.delete.js
|
|
29210
|
+
var web_url_search_params_delete = __webpack_require__(4603);
|
|
29211
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.has.js
|
|
29212
|
+
var web_url_search_params_has = __webpack_require__(7566);
|
|
29213
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.size.js
|
|
29214
|
+
var web_url_search_params_size = __webpack_require__(8721);
|
|
29052
29215
|
;// ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
29053
29216
|
function _typeof(o) {
|
|
29054
29217
|
"@babel/helpers - typeof";
|
|
@@ -30824,22 +30987,28 @@ var lib = __webpack_require__(2750);
|
|
|
30824
30987
|
|
|
30825
30988
|
|
|
30826
30989
|
|
|
30990
|
+
|
|
30991
|
+
|
|
30992
|
+
|
|
30993
|
+
|
|
30827
30994
|
// 创建自定义渲染器
|
|
30828
30995
|
const renderer = new d.Renderer();
|
|
30829
30996
|
|
|
30830
|
-
//
|
|
30831
|
-
// renderer.link = function(content) {
|
|
30832
|
-
// console.log(content)
|
|
30833
|
-
// return `<router-link to="http://192.168.2.24:9529/portal/permission/user">点击跳转</router-link>`
|
|
30834
|
-
// };
|
|
30997
|
+
// 自定义链接渲染
|
|
30835
30998
|
renderer.link = function ({
|
|
30836
30999
|
href,
|
|
30837
|
-
|
|
31000
|
+
text
|
|
30838
31001
|
}) {
|
|
30839
|
-
|
|
30840
|
-
|
|
30841
|
-
const
|
|
30842
|
-
|
|
31002
|
+
let dataPath = '';
|
|
31003
|
+
const url = new URL(href, window.location.origin);
|
|
31004
|
+
const pathname = url.pathname;
|
|
31005
|
+
if (pathname.startsWith('/portal/')) {
|
|
31006
|
+
dataPath = pathname.substring('/portal'.length);
|
|
31007
|
+
return `<a href="javascript:void(0)" data-path="${dataPath}" data-text="${text}">${text}</a>`;
|
|
31008
|
+
} else {
|
|
31009
|
+
dataPath = href;
|
|
31010
|
+
return `<a href="${dataPath}" target="_blank">${text}</a>`;
|
|
31011
|
+
}
|
|
30843
31012
|
};
|
|
30844
31013
|
d.setOptions({
|
|
30845
31014
|
renderer: renderer,
|
|
@@ -30877,14 +31046,41 @@ d.setOptions({
|
|
|
30877
31046
|
thinkStatus(newVal, oldVal) {
|
|
30878
31047
|
console.log('thinkStatus 变化:', newVal, oldVal);
|
|
30879
31048
|
}
|
|
31049
|
+
},
|
|
31050
|
+
methods: {
|
|
31051
|
+
handleLinkClick(event) {
|
|
31052
|
+
const link = event.target.closest('a');
|
|
31053
|
+
if (!link) return;
|
|
31054
|
+
const routePath = link.getAttribute('data-path');
|
|
31055
|
+
const linkText = link.getAttribute('data-text');
|
|
31056
|
+
if (routePath && linkText) {
|
|
31057
|
+
event.preventDefault();
|
|
31058
|
+
if (this.$appOptions?.store?.dispatch) {
|
|
31059
|
+
this.$appOptions.store.dispatch('tags/addTagview', {
|
|
31060
|
+
path: routePath,
|
|
31061
|
+
fullPath: routePath,
|
|
31062
|
+
label: linkText,
|
|
31063
|
+
name: linkText,
|
|
31064
|
+
meta: {
|
|
31065
|
+
title: linkText
|
|
31066
|
+
}
|
|
31067
|
+
});
|
|
31068
|
+
this.$appOptions.router.push({
|
|
31069
|
+
path: routePath
|
|
31070
|
+
});
|
|
31071
|
+
} else {
|
|
31072
|
+
this.$router.push(routePath).catch(() => {});
|
|
31073
|
+
}
|
|
31074
|
+
}
|
|
31075
|
+
}
|
|
30880
31076
|
}
|
|
30881
31077
|
});
|
|
30882
31078
|
;// ./components/AiMessage.vue?vue&type=script&lang=js
|
|
30883
31079
|
/* harmony default export */ var components_AiMessagevue_type_script_lang_js = (AiMessagevue_type_script_lang_js);
|
|
30884
|
-
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/AiMessage.vue?vue&type=style&index=0&id=
|
|
31080
|
+
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/AiMessage.vue?vue&type=style&index=0&id=7f2cec94&prod&scoped=true&lang=css
|
|
30885
31081
|
// extracted by mini-css-extract-plugin
|
|
30886
31082
|
|
|
30887
|
-
;// ./components/AiMessage.vue?vue&type=style&index=0&id=
|
|
31083
|
+
;// ./components/AiMessage.vue?vue&type=style&index=0&id=7f2cec94&prod&scoped=true&lang=css
|
|
30888
31084
|
|
|
30889
31085
|
;// ./components/AiMessage.vue
|
|
30890
31086
|
|
|
@@ -30897,11 +31093,11 @@ d.setOptions({
|
|
|
30897
31093
|
|
|
30898
31094
|
var AiMessage_component = normalizeComponent(
|
|
30899
31095
|
components_AiMessagevue_type_script_lang_js,
|
|
30900
|
-
|
|
30901
|
-
|
|
31096
|
+
AiMessagevue_type_template_id_7f2cec94_scoped_true_render,
|
|
31097
|
+
AiMessagevue_type_template_id_7f2cec94_scoped_true_staticRenderFns,
|
|
30902
31098
|
false,
|
|
30903
31099
|
null,
|
|
30904
|
-
"
|
|
31100
|
+
"7f2cec94",
|
|
30905
31101
|
null
|
|
30906
31102
|
|
|
30907
31103
|
)
|