@gis_victory/ai-chat 1.0.1 → 1.0.3
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/ai-chat.css
CHANGED
|
@@ -85,7 +85,8 @@
|
|
|
85
85
|
display: flex;
|
|
86
86
|
flex-direction: column;
|
|
87
87
|
transform-origin: bottom right;
|
|
88
|
-
height:
|
|
88
|
+
height: 60vh;
|
|
89
|
+
/* 固定高度,避免内容撑开 */
|
|
89
90
|
scrollbar-width: none;
|
|
90
91
|
-ms-overflow-style: none;
|
|
91
92
|
}
|
|
@@ -367,9 +368,11 @@
|
|
|
367
368
|
justify-content: center;
|
|
368
369
|
padding: 40px 20px;
|
|
369
370
|
text-align: center;
|
|
370
|
-
flex: 1;
|
|
371
|
+
flex: 1;
|
|
372
|
+
/* 占满剩余空间,在固定高度弹窗中居中 */
|
|
371
373
|
width: 100%;
|
|
372
|
-
min-height: 0;
|
|
374
|
+
min-height: 0;
|
|
375
|
+
/* 允许在固定高度下收缩 */
|
|
373
376
|
}
|
|
374
377
|
.empty-icon {
|
|
375
378
|
width: 56px;
|
package/dist/ai-chat.mjs
CHANGED
|
@@ -18286,12 +18286,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18286
18286
|
onLoadHistory: {},
|
|
18287
18287
|
defaultSkill: {},
|
|
18288
18288
|
baseURL: {},
|
|
18289
|
+
baseUrl: {},
|
|
18289
18290
|
token: {},
|
|
18290
18291
|
appId: {}
|
|
18291
18292
|
},
|
|
18292
18293
|
emits: ["open", "close", "update:open", "send", "new-chat", "clear-history", "skill-change"],
|
|
18293
18294
|
setup(__props, { emit: __emit }) {
|
|
18294
18295
|
const props = __props;
|
|
18296
|
+
const effectiveBaseURL = computed(() => {
|
|
18297
|
+
return `${props.baseURL || props.baseUrl}/AiServer/Chat`;
|
|
18298
|
+
});
|
|
18295
18299
|
const emit = __emit;
|
|
18296
18300
|
const chatRef = ref();
|
|
18297
18301
|
const queryText = ref("");
|
|
@@ -18535,9 +18539,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18535
18539
|
abortController = new AbortController();
|
|
18536
18540
|
let baseURL = "";
|
|
18537
18541
|
if (currentSkill.value === "enterprise_profile") {
|
|
18538
|
-
baseURL =
|
|
18542
|
+
baseURL = effectiveBaseURL.value + "/NoStream";
|
|
18539
18543
|
} else {
|
|
18540
|
-
baseURL =
|
|
18544
|
+
baseURL = effectiveBaseURL.value + "/Sse";
|
|
18541
18545
|
}
|
|
18542
18546
|
if (!baseURL) {
|
|
18543
18547
|
loadingMsg.content = "未配置 API 地址,请设置 baseURL 参数";
|
|
@@ -18754,7 +18758,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18754
18758
|
conv.messages.push(loadingMsg);
|
|
18755
18759
|
conv.updatedAt = Date.now();
|
|
18756
18760
|
abortController = new AbortController();
|
|
18757
|
-
const baseURL =
|
|
18761
|
+
const baseURL = effectiveBaseURL.value + "/NoStream";
|
|
18758
18762
|
const headers = { "Content-Type": "application/json" };
|
|
18759
18763
|
const token = props.token;
|
|
18760
18764
|
if (token) headers["Authorization"] = token;
|
|
@@ -18897,7 +18901,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18897
18901
|
async function callDeleteChatLogs(sessionIds) {
|
|
18898
18902
|
if (sessionIds.length === 0) return;
|
|
18899
18903
|
try {
|
|
18900
|
-
const base =
|
|
18904
|
+
const base = effectiveBaseURL.value + "/Sse";
|
|
18901
18905
|
const idx = base.lastIndexOf("/");
|
|
18902
18906
|
const deleteUrl = base.substring(0, idx) + "/deleteChatLogs";
|
|
18903
18907
|
const headers = { "Content-Type": "application/json" };
|
|
@@ -18949,7 +18953,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18949
18953
|
return `${date.getMonth() + 1}月${date.getDate()}日 ${hh}:${mm}`;
|
|
18950
18954
|
}
|
|
18951
18955
|
function getChatApiBase() {
|
|
18952
|
-
const baseURL =
|
|
18956
|
+
const baseURL = effectiveBaseURL.value + "/Sse";
|
|
18953
18957
|
return baseURL.substring(0, baseURL.lastIndexOf("/"));
|
|
18954
18958
|
}
|
|
18955
18959
|
async function fetchChatLogs(sessionId) {
|
|
@@ -59,8 +59,10 @@ export interface AiChatPanelProps {
|
|
|
59
59
|
/** API base URL */
|
|
60
60
|
/** Default selected skill id; first skill is used if not specified */
|
|
61
61
|
defaultSkill?: SkillId;
|
|
62
|
-
/** API base URL */
|
|
62
|
+
/** API base URL (支持 baseUrl 和 baseURL 两种写法) */
|
|
63
63
|
baseURL?: string;
|
|
64
|
+
/** API base URL (别名,支持小写写法) */
|
|
65
|
+
baseUrl?: string;
|
|
64
66
|
/** Auth token */
|
|
65
67
|
token?: string;
|
|
66
68
|
/** Application ID */
|