centaline-data-driven-v3 0.0.80 → 0.0.81
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/package.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<div class="chat-editor" v-if="showAI">
|
|
31
31
|
<div class="chat-input-editor-container">
|
|
32
32
|
<textarea ref="textareaRef" class="chat-input" v-model="inputMessage" @keydown="handleKeydown"
|
|
33
|
-
placeholder="
|
|
33
|
+
:placeholder="model.placeholder"></textarea>
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
</div>
|
|
@@ -194,7 +194,6 @@ const sendMessage = async () => {
|
|
|
194
194
|
sender: 'ai',
|
|
195
195
|
type: ''
|
|
196
196
|
})
|
|
197
|
-
|
|
198
197
|
// AI回复
|
|
199
198
|
await fetchAIResponse({
|
|
200
199
|
"query": inputMessage.value
|
|
@@ -207,7 +206,7 @@ const addMessage = (message) => {
|
|
|
207
206
|
...message,
|
|
208
207
|
timestamp: new Date()
|
|
209
208
|
})
|
|
210
|
-
scheduleScroll()
|
|
209
|
+
scheduleScroll(true);
|
|
211
210
|
}
|
|
212
211
|
// 添加消息通用方法
|
|
213
212
|
const appendMessage = (message) => {
|
|
@@ -222,13 +221,13 @@ const UpdateMessageType = (type) => {
|
|
|
222
221
|
}
|
|
223
222
|
|
|
224
223
|
// 防抖滚动
|
|
225
|
-
const scheduleScroll = () => {
|
|
224
|
+
const scheduleScroll = (flagScroll) => {
|
|
226
225
|
if (!scrollPending) {
|
|
227
226
|
if (messagesContainer.value) {
|
|
228
227
|
const container = messagesContainer.value;
|
|
229
|
-
|
|
228
|
+
|
|
230
229
|
const distanceToBottom = container.scrollHeight - (container.scrollTop + container.clientHeight);
|
|
231
|
-
if (distanceToBottom <= 20) {
|
|
230
|
+
if (flagScroll||distanceToBottom <= 20) {
|
|
232
231
|
scrollPending = true
|
|
233
232
|
nextTick(() => {
|
|
234
233
|
if (messagesContainer.value) {
|
|
@@ -507,12 +506,12 @@ function hideAI() {
|
|
|
507
506
|
background-color: #fff;
|
|
508
507
|
display: flex;
|
|
509
508
|
flex-direction: row;
|
|
510
|
-
/* 子元素水平排列
|
|
511
|
-
gap: 5px;
|
|
509
|
+
/* 子元素水平排列
|
|
510
|
+
gap: 5px; */
|
|
512
511
|
|
|
513
512
|
/* 子元素之间的间距为5像素 */
|
|
514
513
|
.header-item {
|
|
515
|
-
padding: 10px;
|
|
514
|
+
padding: 10px 0px 10px 10px;
|
|
516
515
|
}
|
|
517
516
|
}
|
|
518
517
|
|
package/src/loader/src/AIChat.js
CHANGED
|
@@ -6,7 +6,9 @@ function loadFromModel(source, messages, router) {
|
|
|
6
6
|
|
|
7
7
|
var init = function (data) {
|
|
8
8
|
var rtn = {
|
|
9
|
-
|
|
9
|
+
get placeholder() {
|
|
10
|
+
return source.placeholder1 || '输入你的消息...';
|
|
11
|
+
},
|
|
10
12
|
messages:messages,
|
|
11
13
|
get action() {
|
|
12
14
|
return router && router.action ? router.action : "";//上传完整地址
|
|
@@ -14,6 +16,7 @@ function loadFromModel(source, messages, router) {
|
|
|
14
16
|
set action(v) {
|
|
15
17
|
router.action = v;
|
|
16
18
|
},
|
|
19
|
+
|
|
17
20
|
getFormObj() {
|
|
18
21
|
var rtnFormObj = {};
|
|
19
22
|
var that = this;
|