inl-ui 0.1.16 → 0.1.18
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/dist/components/index.cjs +10 -577
- package/dist/components/index.d.ts +2 -47
- package/dist/components/index.js +17 -583
- package/dist/index.cjs +12 -579
- package/dist/index.d.ts +2 -49
- package/dist/index.js +18 -585
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,6 @@ var qiankun = require('qiankun');
|
|
|
14
14
|
require('vite-plugin-qiankun');
|
|
15
15
|
var renderWithQiankun = require('vite-plugin-qiankun/dist/helper');
|
|
16
16
|
var mobile = require('@sszj-temp/mobile');
|
|
17
|
-
var marked = require('marked');
|
|
18
17
|
|
|
19
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
19
|
|
|
@@ -6036,6 +6035,8 @@ const Layout = vue.defineComponent({
|
|
|
6036
6035
|
siderMenu.value = [refMenu];
|
|
6037
6036
|
}
|
|
6038
6037
|
}
|
|
6038
|
+
}, {
|
|
6039
|
+
immediate: true
|
|
6039
6040
|
});
|
|
6040
6041
|
const showHeader = vue.computed(() => props.withMenu && !menuRef && !isOnlyPage);
|
|
6041
6042
|
const showSide = vue.computed(() => showSideMenu.value && !isOnlyPage);
|
|
@@ -11007,6 +11008,12 @@ const getMenuDetail = () => vue.defineComponent({
|
|
|
11007
11008
|
});
|
|
11008
11009
|
|
|
11009
11010
|
const fonts = [{
|
|
11011
|
+
label: "\u9ED8\u8BA4",
|
|
11012
|
+
value: ""
|
|
11013
|
+
}, {
|
|
11014
|
+
label: "Arial",
|
|
11015
|
+
value: "Arial"
|
|
11016
|
+
}, {
|
|
11010
11017
|
label: "\u5FAE\u8F6F\u96C5\u9ED1",
|
|
11011
11018
|
value: "Microsoft YaHei"
|
|
11012
11019
|
}, {
|
|
@@ -11072,25 +11079,14 @@ const FontSelect = vue.defineComponent({
|
|
|
11072
11079
|
emits: ["update:value", "change"],
|
|
11073
11080
|
props: {
|
|
11074
11081
|
value: String,
|
|
11075
|
-
selectOptions: Object
|
|
11076
|
-
suffix: {
|
|
11077
|
-
type: Array,
|
|
11078
|
-
default: () => []
|
|
11079
|
-
},
|
|
11080
|
-
prefix: {
|
|
11081
|
-
type: Array,
|
|
11082
|
-
default: () => []
|
|
11083
|
-
}
|
|
11082
|
+
selectOptions: Object
|
|
11084
11083
|
},
|
|
11085
11084
|
setup(props, {
|
|
11086
11085
|
emit
|
|
11087
11086
|
}) {
|
|
11088
11087
|
const modelValue = core.useVModel(props, "value", emit);
|
|
11089
|
-
const options = vue.computed(() => {
|
|
11090
|
-
return _.concat(props.prefix, fonts, props.suffix);
|
|
11091
|
-
});
|
|
11092
11088
|
return () => vue.createVNode(vue.resolveComponent("a-select"), vue.mergeProps({
|
|
11093
|
-
"options":
|
|
11089
|
+
"options": fonts,
|
|
11094
11090
|
"onChange": e => emit("change", e)
|
|
11095
11091
|
}, props.selectOptions, {
|
|
11096
11092
|
"value": modelValue.value,
|
|
@@ -11243,568 +11239,6 @@ const SszComment = vue.defineComponent({
|
|
|
11243
11239
|
});
|
|
11244
11240
|
var index = installComponent(SszComment, "ssz-comment");
|
|
11245
11241
|
|
|
11246
|
-
function formatDataString(str) {
|
|
11247
|
-
const lines = str.split("\n");
|
|
11248
|
-
const result = lines.filter(line => !!line.trim()).map(line => {
|
|
11249
|
-
const data = JSON.parse(line.replace(/^data: /, ""));
|
|
11250
|
-
return data.text;
|
|
11251
|
-
}).filter(line => line !== void 0).join("");
|
|
11252
|
-
return result;
|
|
11253
|
-
}
|
|
11254
|
-
function request(question, streamCallback, doneCallback) {
|
|
11255
|
-
const controller = new AbortController();
|
|
11256
|
-
const signal = controller.signal;
|
|
11257
|
-
fetch("/mt_cpp_gpt/chat", {
|
|
11258
|
-
signal,
|
|
11259
|
-
method: "POST",
|
|
11260
|
-
headers: {
|
|
11261
|
-
"Content-Type": "application/json"
|
|
11262
|
-
},
|
|
11263
|
-
body: JSON.stringify({
|
|
11264
|
-
query: question,
|
|
11265
|
-
conversation_id: ""
|
|
11266
|
-
})
|
|
11267
|
-
}).then(res => {
|
|
11268
|
-
const stream = res.body;
|
|
11269
|
-
const decoder = new TextDecoder();
|
|
11270
|
-
const reader = stream.getReader();
|
|
11271
|
-
let result = "";
|
|
11272
|
-
function processText() {
|
|
11273
|
-
return reader.read().then(({
|
|
11274
|
-
done,
|
|
11275
|
-
value
|
|
11276
|
-
}) => {
|
|
11277
|
-
if (done) {
|
|
11278
|
-
doneCallback();
|
|
11279
|
-
return;
|
|
11280
|
-
}
|
|
11281
|
-
try {
|
|
11282
|
-
const dataString = decoder.decode(value, {
|
|
11283
|
-
stream: true
|
|
11284
|
-
});
|
|
11285
|
-
const str = formatDataString(dataString);
|
|
11286
|
-
result += str;
|
|
11287
|
-
streamCallback(result);
|
|
11288
|
-
} catch (e) {}
|
|
11289
|
-
return processText();
|
|
11290
|
-
}).catch(() => {
|
|
11291
|
-
doneCallback();
|
|
11292
|
-
});
|
|
11293
|
-
}
|
|
11294
|
-
return processText();
|
|
11295
|
-
}).catch(() => {
|
|
11296
|
-
doneCallback();
|
|
11297
|
-
});
|
|
11298
|
-
return function stop() {
|
|
11299
|
-
controller.abort();
|
|
11300
|
-
};
|
|
11301
|
-
}
|
|
11302
|
-
function useQA() {
|
|
11303
|
-
const context = vue.ref([]);
|
|
11304
|
-
const answerLoading = vue.ref(false);
|
|
11305
|
-
const answer = vue.ref("");
|
|
11306
|
-
let abort = null;
|
|
11307
|
-
setTimeout(() => {
|
|
11308
|
-
const questionItem = {
|
|
11309
|
-
type: "answer",
|
|
11310
|
-
content: "",
|
|
11311
|
-
id: /* @__PURE__ */new Date().getTime(),
|
|
11312
|
-
timestamp: /* @__PURE__ */new Date().getTime(),
|
|
11313
|
-
answers: [{
|
|
11314
|
-
content: "\u4F60\u597D\uFF0C\u6211\u662F\u4F60\u7684\u5DE5\u4F5C\u4F19\u4F34 \u7F8E\u5C0F\u817E! \u6211\u53EF\u4EE5\u8F85\u52A9\u4F60\u5FEB\u901F\u83B7\u53D6\u4FE1\u606F\uFF0C\u76D1\u63A7\u3001\u67E5\u770B\u751F\u4EA7\u6307\u6807\uFF0C\u56DE\u7B54\u60A8\u7684\u9009\u7164\u4E13\u4E1A\u95EE\u9898\uFF0C\u5FEB\u8BD5\u8BD5\u4E0B\u9762\u5BF9\u8BDD\u5427\u3002",
|
|
11315
|
-
timestamp: /* @__PURE__ */new Date().getTime(),
|
|
11316
|
-
hideOperates: true,
|
|
11317
|
-
id: /* @__PURE__ */new Date().getTime()
|
|
11318
|
-
}]
|
|
11319
|
-
};
|
|
11320
|
-
context.value.push(questionItem);
|
|
11321
|
-
}, 1e3);
|
|
11322
|
-
function sendQuestion(question, questionId) {
|
|
11323
|
-
if (answerLoading.value) return;
|
|
11324
|
-
answerLoading.value = true;
|
|
11325
|
-
let questionItem = context.value.find(item => item.id === questionId);
|
|
11326
|
-
question = questionItem?.content || question;
|
|
11327
|
-
if (!questionId) {
|
|
11328
|
-
questionItem = {
|
|
11329
|
-
id: /* @__PURE__ */new Date().getTime(),
|
|
11330
|
-
timestamp: /* @__PURE__ */new Date().getTime(),
|
|
11331
|
-
content: question,
|
|
11332
|
-
answers: []
|
|
11333
|
-
};
|
|
11334
|
-
context.value.push(questionItem);
|
|
11335
|
-
}
|
|
11336
|
-
const answerItem = vue.ref({
|
|
11337
|
-
content: "\u6B63\u5728\u601D\u8003\u4E2D...",
|
|
11338
|
-
timestamp: /* @__PURE__ */new Date().getTime(),
|
|
11339
|
-
parentId: questionItem.id,
|
|
11340
|
-
id: /* @__PURE__ */new Date().getTime()
|
|
11341
|
-
});
|
|
11342
|
-
questionItem.answers.push(answerItem.value);
|
|
11343
|
-
abort = request(question, data => {
|
|
11344
|
-
answer.value = data;
|
|
11345
|
-
answerItem.value.content = data;
|
|
11346
|
-
}, () => {
|
|
11347
|
-
answerLoading.value = false;
|
|
11348
|
-
answerItem.value.loadEnd = true;
|
|
11349
|
-
abort = null;
|
|
11350
|
-
});
|
|
11351
|
-
}
|
|
11352
|
-
function abortRequest() {
|
|
11353
|
-
if (abort) {
|
|
11354
|
-
abort();
|
|
11355
|
-
abort = null;
|
|
11356
|
-
}
|
|
11357
|
-
}
|
|
11358
|
-
return {
|
|
11359
|
-
context,
|
|
11360
|
-
answerLoading,
|
|
11361
|
-
answer,
|
|
11362
|
-
sendQuestion,
|
|
11363
|
-
abortRequest
|
|
11364
|
-
};
|
|
11365
|
-
}
|
|
11366
|
-
|
|
11367
|
-
const Input = vue.defineComponent({
|
|
11368
|
-
emits: ["send"],
|
|
11369
|
-
setup(props, {
|
|
11370
|
-
emit,
|
|
11371
|
-
expose
|
|
11372
|
-
}) {
|
|
11373
|
-
const abortRequest = vue.inject("abortRequest");
|
|
11374
|
-
const loading = vue.inject("answerLoading");
|
|
11375
|
-
const value = vue.ref("");
|
|
11376
|
-
const isFocus = vue.ref(false);
|
|
11377
|
-
const send = () => {
|
|
11378
|
-
if (loading.value) return;
|
|
11379
|
-
if (value.value.length === 0) {
|
|
11380
|
-
antDesignVue.message.warn("\u8BF7\u8F93\u5165\u95EE\u9898");
|
|
11381
|
-
return;
|
|
11382
|
-
}
|
|
11383
|
-
emit("send", value.value);
|
|
11384
|
-
value.value = "";
|
|
11385
|
-
};
|
|
11386
|
-
const handleAbord = () => {
|
|
11387
|
-
abortRequest();
|
|
11388
|
-
};
|
|
11389
|
-
const handleMicClick = () => {
|
|
11390
|
-
antDesignVue.message.info("\u6682\u4E0D\u652F\u6301\u8BED\u97F3\u8F93\u5165");
|
|
11391
|
-
};
|
|
11392
|
-
const clear = () => value.value = "";
|
|
11393
|
-
expose({
|
|
11394
|
-
clear
|
|
11395
|
-
});
|
|
11396
|
-
return () => vue.createVNode("div", {
|
|
11397
|
-
"class": ["chat-box-input", {
|
|
11398
|
-
focus: isFocus.value
|
|
11399
|
-
}]
|
|
11400
|
-
}, [vue.createVNode("img", {
|
|
11401
|
-
"class": "img img-mic",
|
|
11402
|
-
"src": "/micro-assets/largeLanguageModel/mic.png",
|
|
11403
|
-
"alt": "",
|
|
11404
|
-
"onClick": handleMicClick
|
|
11405
|
-
}, null), vue.createVNode(vue.resolveComponent("a-input"), {
|
|
11406
|
-
"value": value.value,
|
|
11407
|
-
"onUpdate:value": $event => value.value = $event,
|
|
11408
|
-
"bordered": false,
|
|
11409
|
-
"placeholder": "\u5982: \u67E5\u770BXXX\u76AE\u5E26\u673A\u5934\u7535\u6D41\u7B49",
|
|
11410
|
-
"onFocus": () => isFocus.value = true,
|
|
11411
|
-
"onBlur": () => isFocus.value = false,
|
|
11412
|
-
"onPressEnter": send
|
|
11413
|
-
}, null), loading.value ? vue.createVNode("img", {
|
|
11414
|
-
"class": "btn-abort",
|
|
11415
|
-
"title": "\u4E2D\u6B62\u56DE\u7B54",
|
|
11416
|
-
"src": "/micro-assets/largeLanguageModel/btn-abort.png",
|
|
11417
|
-
"onClick": handleAbord
|
|
11418
|
-
}, null) : vue.createVNode("img", {
|
|
11419
|
-
"class": "img img-send",
|
|
11420
|
-
"src": "/micro-assets/largeLanguageModel/send.png",
|
|
11421
|
-
"onClick": send
|
|
11422
|
-
}, null)]);
|
|
11423
|
-
}
|
|
11424
|
-
});
|
|
11425
|
-
|
|
11426
|
-
const tips = ["\u8BBE\u5907\u5DE5\u4F5C\u539F\u7406", "\u8BBE\u5907\u7EF4\u4FDD\u624B\u518C"];
|
|
11427
|
-
const Bottom = vue.defineComponent({
|
|
11428
|
-
emits: ["send"],
|
|
11429
|
-
setup(props, {
|
|
11430
|
-
emit
|
|
11431
|
-
}) {
|
|
11432
|
-
const inputRef = vue.ref();
|
|
11433
|
-
const handleSend = msg => {
|
|
11434
|
-
inputRef.value.clear();
|
|
11435
|
-
emit("send", msg);
|
|
11436
|
-
};
|
|
11437
|
-
return () => {
|
|
11438
|
-
tips.map(tip => vue.createVNode("div", {
|
|
11439
|
-
"class": "tip",
|
|
11440
|
-
"onClick": () => handleSend(tip)
|
|
11441
|
-
}, [tip]));
|
|
11442
|
-
return vue.createVNode("div", {
|
|
11443
|
-
"class": "bottom"
|
|
11444
|
-
}, [vue.createVNode(Input, {
|
|
11445
|
-
"ref": inputRef,
|
|
11446
|
-
"onSend": handleSend
|
|
11447
|
-
}, null), vue.createVNode("div", {
|
|
11448
|
-
"class": "exemption"
|
|
11449
|
-
}, ["\u5185\u5BB9\u7531\u7F8E\u817E\u5927\u6A21\u578B\u751F\u6210\uFF0C\u4EC5\u4F5C\u4E3A\u53C2\u8003"])]);
|
|
11450
|
-
};
|
|
11451
|
-
}
|
|
11452
|
-
});
|
|
11453
|
-
|
|
11454
|
-
const Avatar = vue.defineComponent({
|
|
11455
|
-
props: {
|
|
11456
|
-
avatar: {
|
|
11457
|
-
type: String,
|
|
11458
|
-
required: true
|
|
11459
|
-
},
|
|
11460
|
-
name: {
|
|
11461
|
-
type: String,
|
|
11462
|
-
required: true
|
|
11463
|
-
},
|
|
11464
|
-
reverse: Boolean
|
|
11465
|
-
},
|
|
11466
|
-
setup(props, {
|
|
11467
|
-
emit
|
|
11468
|
-
}) {
|
|
11469
|
-
return () => vue.createVNode("div", {
|
|
11470
|
-
"class": ["chat-avatar", {
|
|
11471
|
-
"chat-avatar-reverse": props.reverse
|
|
11472
|
-
}]
|
|
11473
|
-
}, [vue.createVNode(vue.resolveComponent("a-avatar"), {
|
|
11474
|
-
"class": "avatar",
|
|
11475
|
-
"alt": "\u5934\u50CF",
|
|
11476
|
-
"src": props.avatar
|
|
11477
|
-
}, null), vue.createVNode("div", {
|
|
11478
|
-
"class": "chat-avatar-name"
|
|
11479
|
-
}, [props.name])]);
|
|
11480
|
-
}
|
|
11481
|
-
});
|
|
11482
|
-
|
|
11483
|
-
const QuestionBubble = vue.defineComponent({
|
|
11484
|
-
props: {
|
|
11485
|
-
content: {
|
|
11486
|
-
type: String,
|
|
11487
|
-
default: ""
|
|
11488
|
-
}
|
|
11489
|
-
},
|
|
11490
|
-
setup(props) {
|
|
11491
|
-
const userinfo = JSON.parse(sessionStorage.getItem("userinfo") || "{}");
|
|
11492
|
-
const avatar = userinfo.photo || "/micro-assets/platform_app/avatar.png";
|
|
11493
|
-
const name = userinfo.employeeName || userinfo.userName || "\u7528\u6237";
|
|
11494
|
-
return () => vue.createVNode("div", {
|
|
11495
|
-
"class": "question-bubble chat-bubble"
|
|
11496
|
-
}, [vue.createVNode(Avatar, {
|
|
11497
|
-
"reverse": true,
|
|
11498
|
-
"avatar": avatar,
|
|
11499
|
-
"name": name
|
|
11500
|
-
}, null), vue.createVNode("div", {
|
|
11501
|
-
"class": "bubble question"
|
|
11502
|
-
}, [props.content]), vue.createVNode("div", {
|
|
11503
|
-
"class": "operates"
|
|
11504
|
-
}, null)]);
|
|
11505
|
-
}
|
|
11506
|
-
});
|
|
11507
|
-
|
|
11508
|
-
const commonStyle = `
|
|
11509
|
-
:host > p {
|
|
11510
|
-
margin: 0;
|
|
11511
|
-
}
|
|
11512
|
-
:host {
|
|
11513
|
-
font-size: 14px;
|
|
11514
|
-
}
|
|
11515
|
-
`;
|
|
11516
|
-
const styleDark = `
|
|
11517
|
-
<style>
|
|
11518
|
-
${commonStyle}
|
|
11519
|
-
|
|
11520
|
-
* {
|
|
11521
|
-
color: #fff;
|
|
11522
|
-
}
|
|
11523
|
-
strong {
|
|
11524
|
-
color: #f3c142;
|
|
11525
|
-
}
|
|
11526
|
-
</style>
|
|
11527
|
-
`;
|
|
11528
|
-
const styleLight = `
|
|
11529
|
-
<style>
|
|
11530
|
-
${commonStyle}
|
|
11531
|
-
|
|
11532
|
-
* {
|
|
11533
|
-
color: #20242B;
|
|
11534
|
-
}
|
|
11535
|
-
strong {
|
|
11536
|
-
color: #4b7ff7;
|
|
11537
|
-
}
|
|
11538
|
-
</style>
|
|
11539
|
-
`;
|
|
11540
|
-
|
|
11541
|
-
const suggestionList = ["\u7F8E\u5C0F\u817E\u80FD\u5E2E\u6211\u505A\u4EC0\u4E48\uFF1F", "\u8FD1\u4E00\u4E2A\u6708\u7684\u4ECB\u8017\u60C5\u51B5\u5982\u4F55\uFF1F", "\u5C3E\u77FF\u8DD1\u7C97\u7684\u6392\u67E5\u5904\u7406\u65B9\u6CD5\u6709\u54EA\u4E9B\uFF1F\u5C3E\u77FF\u8DD1\u7C97\u7684\u6392\u67E5\u5904\u7406\u65B9\u6CD5\u6709\u54EA\u4E9B\u5C3E\u77FF\u8DD1\u7C97\u7684\u6392\u67E5\u5904\u7406\u65B9\u6CD5\u6709\u54EA\u4E9B\u5C3E\u77FF\u8DD1\u7C97\u7684\u6392\u67E5\u5904\u7406\u65B9\u6CD5\u6709\u54EA\u4E9B"];
|
|
11542
|
-
const AnswerBubble = vue.defineComponent({
|
|
11543
|
-
emits: ["send", "render", "delete", "regenerate"],
|
|
11544
|
-
props: {
|
|
11545
|
-
content: {
|
|
11546
|
-
type: Array,
|
|
11547
|
-
default: () => []
|
|
11548
|
-
}
|
|
11549
|
-
},
|
|
11550
|
-
setup(props, {
|
|
11551
|
-
emit
|
|
11552
|
-
}) {
|
|
11553
|
-
const chatTheme = vue.inject("chat-theme");
|
|
11554
|
-
const {
|
|
11555
|
-
copy
|
|
11556
|
-
} = core.useClipboard({
|
|
11557
|
-
legacy: true
|
|
11558
|
-
});
|
|
11559
|
-
const bubbleRef = vue.ref();
|
|
11560
|
-
const activeAnswerIndex = vue.ref(0);
|
|
11561
|
-
const activeAnswer = vue.computed(() => props.content[activeAnswerIndex.value]);
|
|
11562
|
-
let shadowRoot;
|
|
11563
|
-
const trasformMd = mdString => {
|
|
11564
|
-
return marked.marked(mdString);
|
|
11565
|
-
};
|
|
11566
|
-
vue.onMounted(() => {
|
|
11567
|
-
shadowRoot = bubbleRef.value.attachShadow({
|
|
11568
|
-
mode: "open"
|
|
11569
|
-
});
|
|
11570
|
-
renderText();
|
|
11571
|
-
});
|
|
11572
|
-
const renderText = () => {
|
|
11573
|
-
if (!shadowRoot) return;
|
|
11574
|
-
vue.nextTick(() => {
|
|
11575
|
-
emit("render", activeAnswer.value.content);
|
|
11576
|
-
});
|
|
11577
|
-
const themeStyle = chatTheme === "dark" ? styleDark : styleLight;
|
|
11578
|
-
const html = `
|
|
11579
|
-
${trasformMd(activeAnswer.value.content)}
|
|
11580
|
-
|
|
11581
|
-
${themeStyle}
|
|
11582
|
-
`;
|
|
11583
|
-
shadowRoot.innerHTML = html;
|
|
11584
|
-
};
|
|
11585
|
-
vue.watch([activeAnswer, activeAnswerIndex], renderText, {
|
|
11586
|
-
deep: true
|
|
11587
|
-
});
|
|
11588
|
-
const switchAnswer = step => {
|
|
11589
|
-
activeAnswerIndex.value += step;
|
|
11590
|
-
};
|
|
11591
|
-
const operateList = vue.reactive([{
|
|
11592
|
-
title: "\u590D\u5236",
|
|
11593
|
-
key: "copy",
|
|
11594
|
-
isActive: false
|
|
11595
|
-
}, {
|
|
11596
|
-
title: "\u6709\u7528",
|
|
11597
|
-
key: "like",
|
|
11598
|
-
isActive: vue.computed(() => activeAnswer.value.isLike)
|
|
11599
|
-
}, {
|
|
11600
|
-
title: "\u65E0\u7528",
|
|
11601
|
-
key: "dislike",
|
|
11602
|
-
isActive: vue.computed(() => activeAnswer.value.isDislike)
|
|
11603
|
-
}, {
|
|
11604
|
-
title: "\u8BC4\u8BBA",
|
|
11605
|
-
key: "comment",
|
|
11606
|
-
isActive: false
|
|
11607
|
-
}, {
|
|
11608
|
-
title: "\u91CD\u65B0\u751F\u6210",
|
|
11609
|
-
key: "regenerate",
|
|
11610
|
-
isActive: false
|
|
11611
|
-
}, {
|
|
11612
|
-
ttile: "\u5220\u9664",
|
|
11613
|
-
key: "delete",
|
|
11614
|
-
isActive: false
|
|
11615
|
-
}]);
|
|
11616
|
-
const handleOperate = key => {
|
|
11617
|
-
switch (key) {
|
|
11618
|
-
case "like":
|
|
11619
|
-
if (!activeAnswer.value.isLike && !activeAnswer.value.isDislike) {
|
|
11620
|
-
activeAnswer.value.isLike = !activeAnswer.value.isLike;
|
|
11621
|
-
}
|
|
11622
|
-
break;
|
|
11623
|
-
case "dislike":
|
|
11624
|
-
if (!activeAnswer.value.isLike && !activeAnswer.value.isDislike) {
|
|
11625
|
-
activeAnswer.value.isDislike = !activeAnswer.value.isDislike;
|
|
11626
|
-
}
|
|
11627
|
-
break;
|
|
11628
|
-
case "copy":
|
|
11629
|
-
copy(activeAnswer.value.content);
|
|
11630
|
-
antDesignVue.message.success("\u590D\u5236\u6210\u529F");
|
|
11631
|
-
break;
|
|
11632
|
-
case "delete":
|
|
11633
|
-
antDesignVue.Modal.confirm({
|
|
11634
|
-
title: "\u786E\u5B9A\u5220\u9664\u8FD9\u4E2A\u56DE\u7B54\u5417\uFF1F",
|
|
11635
|
-
onOk: () => {
|
|
11636
|
-
emit("delete", activeAnswer.value.id);
|
|
11637
|
-
if (activeAnswerIndex.value > 0 && activeAnswerIndex.value === props.content.length - 1) {
|
|
11638
|
-
activeAnswerIndex.value--;
|
|
11639
|
-
}
|
|
11640
|
-
}
|
|
11641
|
-
});
|
|
11642
|
-
break;
|
|
11643
|
-
case "comment":
|
|
11644
|
-
antDesignVue.message.info("\u6682\u672A\u5F00\u653E");
|
|
11645
|
-
break;
|
|
11646
|
-
case "regenerate":
|
|
11647
|
-
if (props.content.length >= 5) {
|
|
11648
|
-
antDesignVue.message.info("\u6700\u591A\u652F\u6301\u751F\u62105\u6761\u56DE\u7B54");
|
|
11649
|
-
return;
|
|
11650
|
-
}
|
|
11651
|
-
emit("regenerate", activeAnswer.value.id);
|
|
11652
|
-
vue.nextTick(() => {
|
|
11653
|
-
activeAnswerIndex.value = props.content.length - 1;
|
|
11654
|
-
});
|
|
11655
|
-
break;
|
|
11656
|
-
}
|
|
11657
|
-
};
|
|
11658
|
-
return () => {
|
|
11659
|
-
suggestionList.map(item => vue.createVNode("div", {
|
|
11660
|
-
"class": "suggestion-item",
|
|
11661
|
-
"onClick": () => emit("send", item)
|
|
11662
|
-
}, [item]));
|
|
11663
|
-
const showOperates = !activeAnswer.value.hideOperates && activeAnswer.value.loadEnd;
|
|
11664
|
-
const operateDom = operateList.map(item => vue.createVNode(vue.resolveComponent("a-tooltip"), {
|
|
11665
|
-
"title": item.title
|
|
11666
|
-
}, {
|
|
11667
|
-
default: () => [vue.createVNode("div", {
|
|
11668
|
-
"class": ["operate-item", item.key, {
|
|
11669
|
-
active: item.isActive
|
|
11670
|
-
}],
|
|
11671
|
-
"onClick": () => handleOperate(item.key)
|
|
11672
|
-
}, null)]
|
|
11673
|
-
}));
|
|
11674
|
-
const prevDisabled = activeAnswerIndex.value === 0;
|
|
11675
|
-
const nextDisabled = activeAnswerIndex.value === props.content.length - 1;
|
|
11676
|
-
const answerNav = vue.createVNode("div", {
|
|
11677
|
-
"class": "operate-item operate-nav"
|
|
11678
|
-
}, [vue.createVNode("span", {
|
|
11679
|
-
"class": ["nav", {
|
|
11680
|
-
disabled: prevDisabled
|
|
11681
|
-
}],
|
|
11682
|
-
"onClick": () => switchAnswer(-1)
|
|
11683
|
-
}, ["<"]), vue.createVNode("span", null, [activeAnswerIndex.value + 1]), " ", vue.createVNode("span", null, [vue.createTextVNode("/")]), vue.createVNode("span", null, [props.content.length]), vue.createVNode("span", {
|
|
11684
|
-
"class": ["nav", {
|
|
11685
|
-
disabled: nextDisabled
|
|
11686
|
-
}],
|
|
11687
|
-
"onClick": () => switchAnswer(1)
|
|
11688
|
-
}, [">"])]);
|
|
11689
|
-
return vue.createVNode("div", {
|
|
11690
|
-
"class": "answer-bubble chat-bubble"
|
|
11691
|
-
}, [vue.createVNode(Avatar, {
|
|
11692
|
-
"avatar": "/micro-assets/largeLanguageModel/robot-avatar.png",
|
|
11693
|
-
"name": "\u7F8E\u5C0F\u817E"
|
|
11694
|
-
}, null), vue.createVNode("div", {
|
|
11695
|
-
"ref": bubbleRef,
|
|
11696
|
-
"class": "bubble answer"
|
|
11697
|
-
}, null), vue.createVNode("div", {
|
|
11698
|
-
"class": "operates"
|
|
11699
|
-
}, [props.content.length > 1 && answerNav, showOperates && operateDom])]);
|
|
11700
|
-
};
|
|
11701
|
-
}
|
|
11702
|
-
});
|
|
11703
|
-
|
|
11704
|
-
const QaContext = vue.defineComponent({
|
|
11705
|
-
emits: ["regenerate"],
|
|
11706
|
-
props: {
|
|
11707
|
-
list: {
|
|
11708
|
-
type: Array,
|
|
11709
|
-
default: () => []
|
|
11710
|
-
}
|
|
11711
|
-
},
|
|
11712
|
-
setup(props, {
|
|
11713
|
-
emit
|
|
11714
|
-
}) {
|
|
11715
|
-
const containerRef = vue.ref();
|
|
11716
|
-
const onAnswerRender = text => {
|
|
11717
|
-
containerRef.value.scrollTo({
|
|
11718
|
-
top: containerRef.value.scrollHeight,
|
|
11719
|
-
behavior: "smooth"
|
|
11720
|
-
});
|
|
11721
|
-
};
|
|
11722
|
-
const handleDeleteAnswer = (questionId, answerId) => {
|
|
11723
|
-
const question = props.list.find(item => item.id === questionId);
|
|
11724
|
-
if (question) {
|
|
11725
|
-
question.answers = question.answers.filter(item => item.id !== answerId);
|
|
11726
|
-
}
|
|
11727
|
-
};
|
|
11728
|
-
return () => {
|
|
11729
|
-
const contextList = [];
|
|
11730
|
-
for (let i = 0; i < props.list.length; i++) {
|
|
11731
|
-
const questionItem = props.list[i];
|
|
11732
|
-
const prevItem = props.list[i - 1];
|
|
11733
|
-
const currentTime = questionItem.timestamp;
|
|
11734
|
-
let timeDiff = 0;
|
|
11735
|
-
if (prevItem) {
|
|
11736
|
-
const prevTime = prevItem.timestamp;
|
|
11737
|
-
timeDiff = currentTime - prevTime;
|
|
11738
|
-
}
|
|
11739
|
-
if (!prevItem || timeDiff > 1e3 * 60 * 5) {
|
|
11740
|
-
contextList.push(vue.createVNode("div", {
|
|
11741
|
-
"class": "time-line"
|
|
11742
|
-
}, [dayjs__default["default"](currentTime).format("MM/DD HH:mm")]));
|
|
11743
|
-
}
|
|
11744
|
-
if (questionItem.content) {
|
|
11745
|
-
contextList.push(vue.createVNode(QuestionBubble, {
|
|
11746
|
-
"content": questionItem.content
|
|
11747
|
-
}, null));
|
|
11748
|
-
}
|
|
11749
|
-
if (questionItem.answers.length > 0) {
|
|
11750
|
-
contextList.push(vue.createVNode(AnswerBubble, {
|
|
11751
|
-
"onRender": onAnswerRender,
|
|
11752
|
-
"content": questionItem.answers,
|
|
11753
|
-
"onDelete": answerId => handleDeleteAnswer(questionItem.id, answerId),
|
|
11754
|
-
"onRegenerate": () => emit("regenerate", questionItem.id)
|
|
11755
|
-
}, null));
|
|
11756
|
-
}
|
|
11757
|
-
}
|
|
11758
|
-
return vue.createVNode("div", {
|
|
11759
|
-
"class": "qa-context",
|
|
11760
|
-
"ref": containerRef
|
|
11761
|
-
}, [contextList]);
|
|
11762
|
-
};
|
|
11763
|
-
}
|
|
11764
|
-
});
|
|
11765
|
-
|
|
11766
|
-
const ChatBox = vue.defineComponent({
|
|
11767
|
-
props: {
|
|
11768
|
-
theme: {
|
|
11769
|
-
type: String,
|
|
11770
|
-
default: "light"
|
|
11771
|
-
},
|
|
11772
|
-
// 语音输入 TODO
|
|
11773
|
-
withSpeech: {
|
|
11774
|
-
type: Boolean,
|
|
11775
|
-
default: false
|
|
11776
|
-
}
|
|
11777
|
-
},
|
|
11778
|
-
setup(props, {
|
|
11779
|
-
emit
|
|
11780
|
-
}) {
|
|
11781
|
-
vue.provide("chat-theme", props.theme);
|
|
11782
|
-
const {
|
|
11783
|
-
context,
|
|
11784
|
-
answerLoading,
|
|
11785
|
-
sendQuestion,
|
|
11786
|
-
abortRequest
|
|
11787
|
-
} = useQA();
|
|
11788
|
-
vue.provide("answerLoading", answerLoading);
|
|
11789
|
-
vue.provide("abortRequest", abortRequest);
|
|
11790
|
-
const handleSend = (msg, questionId) => {
|
|
11791
|
-
sendQuestion(msg, questionId);
|
|
11792
|
-
};
|
|
11793
|
-
return () => {
|
|
11794
|
-
return vue.createVNode("div", {
|
|
11795
|
-
"class": ["inl-chat-box", `inl-chat-box-${props.theme}`]
|
|
11796
|
-
}, [vue.createVNode(QaContext, {
|
|
11797
|
-
"list": context.value,
|
|
11798
|
-
"onRegenerate": qId => handleSend("", qId)
|
|
11799
|
-
}, null), vue.createVNode(Bottom, {
|
|
11800
|
-
"onSend": handleSend
|
|
11801
|
-
}, null)]);
|
|
11802
|
-
};
|
|
11803
|
-
}
|
|
11804
|
-
});
|
|
11805
|
-
|
|
11806
|
-
const LlmChatBox = installComponent(ChatBox, "llm-chat-box");
|
|
11807
|
-
|
|
11808
11242
|
exports.AlarmVideo = alarmVideo;
|
|
11809
11243
|
exports.ChangeThemeSelect = index$6;
|
|
11810
11244
|
exports.ChildLayout = childLayout;
|
|
@@ -11816,7 +11250,6 @@ exports.IconSelect = icons;
|
|
|
11816
11250
|
exports.ImportModal = ImportModal;
|
|
11817
11251
|
exports.Layout = index$8;
|
|
11818
11252
|
exports.LayoutTable = table;
|
|
11819
|
-
exports.LlmChatBox = LlmChatBox;
|
|
11820
11253
|
exports.Login = index$7;
|
|
11821
11254
|
exports.ParamManager = index$2;
|
|
11822
11255
|
exports.ParamManagerV2 = ParamManagerV2;
|
|
@@ -963,32 +963,13 @@ declare const getMenuDetail: () => vue.DefineComponent<{
|
|
|
963
963
|
declare const _default$1: vue.DefineComponent<{
|
|
964
964
|
value: StringConstructor;
|
|
965
965
|
selectOptions: ObjectConstructor;
|
|
966
|
-
suffix: {
|
|
967
|
-
type: ArrayConstructor;
|
|
968
|
-
default: () => never[];
|
|
969
|
-
};
|
|
970
|
-
prefix: {
|
|
971
|
-
type: ArrayConstructor;
|
|
972
|
-
default: () => never[];
|
|
973
|
-
};
|
|
974
966
|
}, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "update:value")[], "change" | "update:value", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
975
967
|
value: StringConstructor;
|
|
976
968
|
selectOptions: ObjectConstructor;
|
|
977
|
-
suffix: {
|
|
978
|
-
type: ArrayConstructor;
|
|
979
|
-
default: () => never[];
|
|
980
|
-
};
|
|
981
|
-
prefix: {
|
|
982
|
-
type: ArrayConstructor;
|
|
983
|
-
default: () => never[];
|
|
984
|
-
};
|
|
985
969
|
}>> & {
|
|
986
970
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
987
971
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
988
|
-
}, {
|
|
989
|
-
suffix: unknown[];
|
|
990
|
-
prefix: unknown[];
|
|
991
|
-
}, {}>;
|
|
972
|
+
}, {}, {}>;
|
|
992
973
|
|
|
993
974
|
declare const _default: vue.DefineComponent<{
|
|
994
975
|
zxIp: {
|
|
@@ -1064,30 +1045,4 @@ declare const _default: vue.DefineComponent<{
|
|
|
1064
1045
|
commentHeight: string;
|
|
1065
1046
|
}, {}>;
|
|
1066
1047
|
|
|
1067
|
-
|
|
1068
|
-
* 大语言模型组件 - 对话框
|
|
1069
|
-
*/
|
|
1070
|
-
declare const LlmChatBox: vue.DefineComponent<{
|
|
1071
|
-
theme: {
|
|
1072
|
-
type: StringConstructor;
|
|
1073
|
-
default: string;
|
|
1074
|
-
};
|
|
1075
|
-
withSpeech: {
|
|
1076
|
-
type: BooleanConstructor;
|
|
1077
|
-
default: boolean;
|
|
1078
|
-
};
|
|
1079
|
-
}, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
1080
|
-
theme: {
|
|
1081
|
-
type: StringConstructor;
|
|
1082
|
-
default: string;
|
|
1083
|
-
};
|
|
1084
|
-
withSpeech: {
|
|
1085
|
-
type: BooleanConstructor;
|
|
1086
|
-
default: boolean;
|
|
1087
|
-
};
|
|
1088
|
-
}>>, {
|
|
1089
|
-
theme: string;
|
|
1090
|
-
withSpeech: boolean;
|
|
1091
|
-
}, {}>;
|
|
1092
|
-
|
|
1093
|
-
export { _default$b as AlarmVideo, _default$d as ChangeThemeSelect, _default$e as ChildLayout, _default$j as Demo, _default$1 as FontSelect, _default$6 as HeaderMenu, _default$i as IconFont, _default$5 as IconSelect, ImportModal, _default$h as Layout, _default$f as LayoutTable, LlmChatBox, _default$g as Login, _default$2 as ParamManager, ParamManagerV2, _default$3 as PeopleSelect, _default$c as PollingPlay, _default$4 as QueryFormContainer, _default as SszComment, _default$8 as VideoBox, _default$7 as VideoBoxV2, _default$9 as VideoPlayerV1, _default$a as VideoPlayerV2, getDetailContainer, getMenuDetail };
|
|
1048
|
+
export { _default$b as AlarmVideo, _default$d as ChangeThemeSelect, _default$e as ChildLayout, _default$j as Demo, _default$1 as FontSelect, _default$6 as HeaderMenu, _default$i as IconFont, _default$5 as IconSelect, ImportModal, _default$h as Layout, _default$f as LayoutTable, _default$g as Login, _default$2 as ParamManager, ParamManagerV2, _default$3 as PeopleSelect, _default$c as PollingPlay, _default$4 as QueryFormContainer, _default as SszComment, _default$8 as VideoBox, _default$7 as VideoBoxV2, _default$9 as VideoPlayerV1, _default$a as VideoPlayerV2, getDetailContainer, getMenuDetail };
|