@ibiz-template/vue3-components 0.7.41-alpha.150 → 0.7.41-alpha.152
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/{index-Dki2yYe9.js → index-Cs2bf-qT.js} +4 -4
- package/dist/{index.es-7UWnjdb2.js → index.es-CZeEzytG.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-DRcvMIVh.js → wang-editor-C09nwfM5.js} +1 -1
- package/dist/{xlsx-util-CkixgGjt.js → xlsx-util-C0viiHdq.js} +1 -1
- package/es/control/calendar/calendar.mjs +8 -5
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/editor/ai-chat/embed-ai-chat/embed-ai-chat.mjs +2 -1
- package/es/editor/upload/use/use-custom-upload.mjs +3 -1
- package/es/util/ai-chat-util/ai-chat-util.mjs +85 -28
- package/es/util/fullscreen/fullscreen-util.mjs +1 -1
- package/lib/control/calendar/calendar.cjs +7 -4
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/editor/ai-chat/embed-ai-chat/embed-ai-chat.cjs +2 -1
- package/lib/editor/upload/use/use-custom-upload.cjs +3 -1
- package/lib/util/ai-chat-util/ai-chat-util.cjs +85 -28
- package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
- package/package.json +6 -6
- package/src/control/calendar/calendar.tsx +3 -1
- package/src/editor/ai-chat/embed-ai-chat/embed-ai-chat.tsx +1 -0
- package/src/editor/upload/use/use-custom-upload.ts +5 -1
- package/src/util/ai-chat-util/ai-chat-util.ts +130 -44
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.150_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.152_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
- /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.150_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.152_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode, defineComponent, createVNode, resolveComponent, withDirectives, resolveDirective, ref, computed, watch } from 'vue';
|
|
1
|
+
import { isVNode, defineComponent, createVNode, resolveComponent, mergeProps, withDirectives, resolveDirective, ref, computed, watch } from 'vue';
|
|
2
2
|
import { hasEmptyPanelRenderer, IBizCustomRender, useControlController, useNamespace, useUIStore, useSemanticNode } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { CalendarController } from '@ibiz-template/runtime';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
@@ -470,16 +470,19 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
470
470
|
let content;
|
|
471
471
|
if (!htmlCode)
|
|
472
472
|
content = this.showDateRange ? date && (dayjs(date).isSame(item.beginTime, "day") || dayjs(date).day() === 0 || !item.beginTime && dayjs(date).isSame(item.endTime, "day")) ? item.text : "" : item.text;
|
|
473
|
-
|
|
473
|
+
const vHtmlProps = htmlCode ? {
|
|
474
|
+
"v-html": htmlCode
|
|
475
|
+
} : {};
|
|
476
|
+
return createVNode("div", mergeProps({
|
|
474
477
|
"class": itemClass,
|
|
475
478
|
"style": style,
|
|
476
|
-
"key": item.deData.srfkey
|
|
477
|
-
|
|
479
|
+
"key": item.deData.srfkey
|
|
480
|
+
}, vHtmlProps, {
|
|
478
481
|
"title": showTitle(item.tips || item.text),
|
|
479
482
|
"onClick": () => this.c.onRowClick(item),
|
|
480
483
|
"onDblclick": () => this.c.onDbRowClick(item),
|
|
481
484
|
"onContextmenu": (evt) => this.onNodeContextmenu(item, evt)
|
|
482
|
-
}, [content]);
|
|
485
|
+
}), [content]);
|
|
483
486
|
};
|
|
484
487
|
const renderCalendarItem = (item, date) => {
|
|
485
488
|
var _a, _b, _c;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, watch, watchEffect, onUnmounted } from 'vue';
|
|
2
|
-
import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.
|
|
2
|
+
import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.152_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs';
|
|
3
3
|
|
|
4
4
|
"use strict";
|
|
5
5
|
function useAppDRTab(c, controlRef, counterData) {
|
|
@@ -83,7 +83,8 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
83
83
|
resourceOptions,
|
|
84
84
|
containerOptions: {
|
|
85
85
|
container: aiChatElementRef.value,
|
|
86
|
-
compWrapperId: editorParams.compwrapperid || "DEFAULT"
|
|
86
|
+
compWrapperId: editorParams.compwrapperid || "DEFAULT",
|
|
87
|
+
enableBackFill: false
|
|
87
88
|
},
|
|
88
89
|
topicOptions: {
|
|
89
90
|
appid: ibiz.env.appId,
|
|
@@ -146,7 +146,9 @@ function useCustomUpload(c, options, emit) {
|
|
|
146
146
|
for (const file of files) {
|
|
147
147
|
const rawFile = file;
|
|
148
148
|
rawFile.uid = genFileId();
|
|
149
|
-
|
|
149
|
+
const relativePath = file.webkitRelativePath;
|
|
150
|
+
const lastSlash = relativePath.lastIndexOf("/");
|
|
151
|
+
rawFile.path = lastSlash > -1 ? relativePath.slice(0, lastSlash) : relativePath;
|
|
150
152
|
if (options.addCacheCount) {
|
|
151
153
|
options.addCacheCount();
|
|
152
154
|
}
|
|
@@ -251,19 +251,8 @@ class AIChatUtil {
|
|
|
251
251
|
let id = "";
|
|
252
252
|
let abortController;
|
|
253
253
|
const { chatInstance, view, ctrl } = args;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const response = await deService.aiChatProject(
|
|
257
|
-
ctx,
|
|
258
|
-
{ srfactag: param.srfactag },
|
|
259
|
-
other
|
|
260
|
-
);
|
|
261
|
-
let result = [];
|
|
262
|
-
if (response.data) {
|
|
263
|
-
result = Array.isArray(response.data) ? response.data : response.data.children;
|
|
264
|
-
}
|
|
265
|
-
return result;
|
|
266
|
-
};
|
|
254
|
+
const fileSystemOptions = await this.getAIFileSystemOptions();
|
|
255
|
+
chatOptions.fileSystemOptions = fileSystemOptions;
|
|
267
256
|
chatOptions.history = async (ctx, param, other) => {
|
|
268
257
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
269
258
|
const historyRequestData = {};
|
|
@@ -323,7 +312,8 @@ class AIChatUtil {
|
|
|
323
312
|
}
|
|
324
313
|
return true;
|
|
325
314
|
};
|
|
326
|
-
chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid2, srfaiagent, srfmode, srfscope, srfknowledgebases, srfaiagentconfig, appendcurdata, mcpservers, sessionmeta, srfproject) => {
|
|
315
|
+
chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid2, srfaiagent, srfmode, srfscope, srfknowledgebases, srfaiagentconfig, appendcurdata, mcpservers, sessionmeta, srfproject, localMsgID) => {
|
|
316
|
+
let updateFlag = true;
|
|
327
317
|
id = createUUID();
|
|
328
318
|
abortController = new AbortController();
|
|
329
319
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
@@ -365,9 +355,15 @@ class AIChatUtil {
|
|
|
365
355
|
if (extParams && Object.keys(extParams).length > 0) {
|
|
366
356
|
Object.assign(questionRequestData, { srfextparams: extParams });
|
|
367
357
|
}
|
|
358
|
+
aiChat.addWaitingMessage(id);
|
|
368
359
|
await deService.aiChatSse(
|
|
369
360
|
(msg) => {
|
|
370
361
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
362
|
+
aiChat.removeWaitingMessage(id);
|
|
363
|
+
if (msg.asextparam && localMsgID && updateFlag) {
|
|
364
|
+
aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
|
|
365
|
+
updateFlag = false;
|
|
366
|
+
}
|
|
371
367
|
if (!aiChat.getActiveAsyncacitonId()) {
|
|
372
368
|
aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
|
|
373
369
|
}
|
|
@@ -434,6 +430,7 @@ class AIChatUtil {
|
|
|
434
430
|
}
|
|
435
431
|
abortController == null ? void 0 : abortController.abort();
|
|
436
432
|
} finally {
|
|
433
|
+
aiChat.removeWaitingMessage(id);
|
|
437
434
|
aiChat.completeMessage(id, true);
|
|
438
435
|
aiChat.setActiveAsyncacitonId("");
|
|
439
436
|
return true;
|
|
@@ -493,9 +490,11 @@ class AIChatUtil {
|
|
|
493
490
|
srfproject: other.srfproject
|
|
494
491
|
});
|
|
495
492
|
try {
|
|
493
|
+
aiChat.addWaitingMessage(id);
|
|
496
494
|
await deService.aiResumeSse(
|
|
497
495
|
(msg) => {
|
|
498
496
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
497
|
+
aiChat.removeWaitingMessage(id);
|
|
499
498
|
aiChat.isLoading.value = true;
|
|
500
499
|
if (!aiChat.getActiveAsyncacitonId()) {
|
|
501
500
|
aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
|
|
@@ -565,6 +564,7 @@ class AIChatUtil {
|
|
|
565
564
|
}
|
|
566
565
|
abortController == null ? void 0 : abortController.abort();
|
|
567
566
|
} finally {
|
|
567
|
+
aiChat.removeWaitingMessage(id);
|
|
568
568
|
aiChat.isLoading.value = false;
|
|
569
569
|
aiChat.completeMessage(id, true);
|
|
570
570
|
aiChat.setActiveAsyncacitonId("");
|
|
@@ -1054,19 +1054,8 @@ class AIChatUtil {
|
|
|
1054
1054
|
let id = "";
|
|
1055
1055
|
let abortController;
|
|
1056
1056
|
const { chatInstance, view, ctrl } = args;
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
const response = await deService.aiChatProject(
|
|
1060
|
-
ctx,
|
|
1061
|
-
{ srfactag: param.srfactag },
|
|
1062
|
-
other
|
|
1063
|
-
);
|
|
1064
|
-
let result = [];
|
|
1065
|
-
if (response.data) {
|
|
1066
|
-
result = Array.isArray(response.data) ? response.data : response.data.children;
|
|
1067
|
-
}
|
|
1068
|
-
return result;
|
|
1069
|
-
};
|
|
1057
|
+
const fileSystemOptions = await this.getAIFileSystemOptions();
|
|
1058
|
+
chatOptions.fileSystemOptions = fileSystemOptions;
|
|
1070
1059
|
chatOptions.history = async (ctx, param, other) => {
|
|
1071
1060
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
1072
1061
|
const historyRequestData = {};
|
|
@@ -1126,7 +1115,8 @@ class AIChatUtil {
|
|
|
1126
1115
|
}
|
|
1127
1116
|
return true;
|
|
1128
1117
|
};
|
|
1129
|
-
chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode, srfscope, srfknowledgebases, srfaiagentconfig, appendcurdata, mcpservers, sessionmeta, srfproject) => {
|
|
1118
|
+
chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode, srfscope, srfknowledgebases, srfaiagentconfig, appendcurdata, mcpservers, sessionmeta, srfproject, localMsgID) => {
|
|
1119
|
+
let updateFlag = true;
|
|
1130
1120
|
id = createUUID();
|
|
1131
1121
|
abortController = new AbortController();
|
|
1132
1122
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
@@ -1166,9 +1156,15 @@ class AIChatUtil {
|
|
|
1166
1156
|
if (extParams && Object.keys(extParams).length > 0) {
|
|
1167
1157
|
Object.assign(questionRequestData, { srfextparams: extParams });
|
|
1168
1158
|
}
|
|
1159
|
+
aiChat.addWaitingMessage(id);
|
|
1169
1160
|
await deService.aiChatSse(
|
|
1170
1161
|
(msg) => {
|
|
1171
1162
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
1163
|
+
aiChat.removeWaitingMessage(id);
|
|
1164
|
+
if (msg.asextparam && localMsgID && updateFlag) {
|
|
1165
|
+
aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
|
|
1166
|
+
updateFlag = false;
|
|
1167
|
+
}
|
|
1172
1168
|
if (!aiChat.getActiveAsyncacitonId()) {
|
|
1173
1169
|
aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
|
|
1174
1170
|
}
|
|
@@ -1235,6 +1231,7 @@ class AIChatUtil {
|
|
|
1235
1231
|
}
|
|
1236
1232
|
abortController == null ? void 0 : abortController.abort();
|
|
1237
1233
|
} finally {
|
|
1234
|
+
aiChat.removeWaitingMessage(id);
|
|
1238
1235
|
aiChat.setActiveAsyncacitonId("");
|
|
1239
1236
|
aiChat.completeMessage(id, true);
|
|
1240
1237
|
return true;
|
|
@@ -1294,9 +1291,11 @@ class AIChatUtil {
|
|
|
1294
1291
|
srfproject: other.srfproject
|
|
1295
1292
|
});
|
|
1296
1293
|
try {
|
|
1294
|
+
aiChat.addWaitingMessage(id);
|
|
1297
1295
|
await deService.aiResumeSse(
|
|
1298
1296
|
(msg) => {
|
|
1299
1297
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
1298
|
+
aiChat.removeWaitingMessage(id);
|
|
1300
1299
|
aiChat.isLoading.value = true;
|
|
1301
1300
|
if (!aiChat.getActiveAsyncacitonId()) {
|
|
1302
1301
|
aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
|
|
@@ -1366,6 +1365,7 @@ class AIChatUtil {
|
|
|
1366
1365
|
}
|
|
1367
1366
|
abortController == null ? void 0 : abortController.abort();
|
|
1368
1367
|
} finally {
|
|
1368
|
+
aiChat.removeWaitingMessage(id);
|
|
1369
1369
|
aiChat.isLoading.value = false;
|
|
1370
1370
|
aiChat.completeMessage(id, true);
|
|
1371
1371
|
aiChat.setActiveAsyncacitonId("");
|
|
@@ -1886,6 +1886,63 @@ class AIChatUtil {
|
|
|
1886
1886
|
};
|
|
1887
1887
|
return resourceOptions;
|
|
1888
1888
|
}
|
|
1889
|
+
/**
|
|
1890
|
+
* @description 获取AI文件系统相关参数
|
|
1891
|
+
* @returns {*} {Promise<IData>}
|
|
1892
|
+
* @memberof AIChatUtil
|
|
1893
|
+
*/
|
|
1894
|
+
async getAIFileSystemOptions() {
|
|
1895
|
+
const fileSystemOptions = {};
|
|
1896
|
+
fileSystemOptions.getFileList = async (ctx, param, other) => {
|
|
1897
|
+
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
|
|
1898
|
+
const response = await deService.aiChatProject(
|
|
1899
|
+
ctx,
|
|
1900
|
+
{ srfactag: param.srfactag },
|
|
1901
|
+
{ ...other }
|
|
1902
|
+
);
|
|
1903
|
+
if (response.ok)
|
|
1904
|
+
return response.data;
|
|
1905
|
+
return void 0;
|
|
1906
|
+
};
|
|
1907
|
+
fileSystemOptions.uploadFile = async (ctx, param, other) => {
|
|
1908
|
+
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
|
|
1909
|
+
const response = await deService.aiChatProject(
|
|
1910
|
+
ctx,
|
|
1911
|
+
{ srfactag: param.srfactag },
|
|
1912
|
+
{ ...other, action: "UPLOAD" }
|
|
1913
|
+
);
|
|
1914
|
+
if (response.ok)
|
|
1915
|
+
return response.data;
|
|
1916
|
+
return void 0;
|
|
1917
|
+
};
|
|
1918
|
+
fileSystemOptions.getContent = async (ctx, param, id, type, cat) => {
|
|
1919
|
+
const app = await ibiz.hub.getAppAsync(ctx.appId);
|
|
1920
|
+
const requestUrl = "/ibizutil/downloadtxt/".concat(cat ? "".concat(cat, "/") : "").concat(id, "?type=").concat(type);
|
|
1921
|
+
const res = await app.net.get(requestUrl);
|
|
1922
|
+
if (res && res.ok && res.data) {
|
|
1923
|
+
return res.data;
|
|
1924
|
+
}
|
|
1925
|
+
};
|
|
1926
|
+
fileSystemOptions.getImgContent = async (ctx, param, id, type, cat) => {
|
|
1927
|
+
const { downloadUrl } = ibiz.util.file.calcFileUpDownUrl(
|
|
1928
|
+
ctx,
|
|
1929
|
+
param,
|
|
1930
|
+
{},
|
|
1931
|
+
{ osscat: cat }
|
|
1932
|
+
);
|
|
1933
|
+
let content = downloadUrl.replace("%fileId%", id);
|
|
1934
|
+
if (type === "svg") {
|
|
1935
|
+
const response = await ibiz.net.request(content, {
|
|
1936
|
+
method: "get",
|
|
1937
|
+
responseType: "blob",
|
|
1938
|
+
baseURL: ""
|
|
1939
|
+
});
|
|
1940
|
+
content = await response.data.text();
|
|
1941
|
+
}
|
|
1942
|
+
return content;
|
|
1943
|
+
};
|
|
1944
|
+
return fileSystemOptions;
|
|
1945
|
+
}
|
|
1889
1946
|
}
|
|
1890
1947
|
|
|
1891
1948
|
export { AIChatUtil };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createApp } from 'vue';
|
|
2
2
|
import ElementPlus from 'element-plus';
|
|
3
|
-
import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.
|
|
3
|
+
import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.152_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs';
|
|
4
4
|
import { IBizFullscreenToolbar } from '../../common/fullscreen-toolbar/fullscreen-toolbar.mjs';
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
@@ -472,16 +472,19 @@ const CalendarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
472
472
|
let content;
|
|
473
473
|
if (!htmlCode)
|
|
474
474
|
content = this.showDateRange ? date && (dayjs(date).isSame(item.beginTime, "day") || dayjs(date).day() === 0 || !item.beginTime && dayjs(date).isSame(item.endTime, "day")) ? item.text : "" : item.text;
|
|
475
|
-
|
|
475
|
+
const vHtmlProps = htmlCode ? {
|
|
476
|
+
"v-html": htmlCode
|
|
477
|
+
} : {};
|
|
478
|
+
return vue.createVNode("div", vue.mergeProps({
|
|
476
479
|
"class": itemClass,
|
|
477
480
|
"style": style,
|
|
478
|
-
"key": item.deData.srfkey
|
|
479
|
-
|
|
481
|
+
"key": item.deData.srfkey
|
|
482
|
+
}, vHtmlProps, {
|
|
480
483
|
"title": core.showTitle(item.tips || item.text),
|
|
481
484
|
"onClick": () => this.c.onRowClick(item),
|
|
482
485
|
"onDblclick": () => this.c.onDbRowClick(item),
|
|
483
486
|
"onContextmenu": (evt) => this.onNodeContextmenu(item, evt)
|
|
484
|
-
}, [content]);
|
|
487
|
+
}), [content]);
|
|
485
488
|
};
|
|
486
489
|
const renderCalendarItem = (item, date) => {
|
|
487
490
|
var _a, _b, _c;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
-
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.
|
|
4
|
+
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.152_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
function useAppDRTab(c, controlRef, counterData) {
|
|
@@ -85,7 +85,8 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
85
85
|
resourceOptions,
|
|
86
86
|
containerOptions: {
|
|
87
87
|
container: aiChatElementRef.value,
|
|
88
|
-
compWrapperId: editorParams.compwrapperid || "DEFAULT"
|
|
88
|
+
compWrapperId: editorParams.compwrapperid || "DEFAULT",
|
|
89
|
+
enableBackFill: false
|
|
89
90
|
},
|
|
90
91
|
topicOptions: {
|
|
91
92
|
appid: ibiz.env.appId,
|
|
@@ -148,7 +148,9 @@ function useCustomUpload(c, options, emit) {
|
|
|
148
148
|
for (const file of files) {
|
|
149
149
|
const rawFile = file;
|
|
150
150
|
rawFile.uid = genFileId();
|
|
151
|
-
|
|
151
|
+
const relativePath = file.webkitRelativePath;
|
|
152
|
+
const lastSlash = relativePath.lastIndexOf("/");
|
|
153
|
+
rawFile.path = lastSlash > -1 ? relativePath.slice(0, lastSlash) : relativePath;
|
|
152
154
|
if (options.addCacheCount) {
|
|
153
155
|
options.addCacheCount();
|
|
154
156
|
}
|
|
@@ -253,19 +253,8 @@ class AIChatUtil {
|
|
|
253
253
|
let id = "";
|
|
254
254
|
let abortController;
|
|
255
255
|
const { chatInstance, view, ctrl } = args;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const response = await deService.aiChatProject(
|
|
259
|
-
ctx,
|
|
260
|
-
{ srfactag: param.srfactag },
|
|
261
|
-
other
|
|
262
|
-
);
|
|
263
|
-
let result = [];
|
|
264
|
-
if (response.data) {
|
|
265
|
-
result = Array.isArray(response.data) ? response.data : response.data.children;
|
|
266
|
-
}
|
|
267
|
-
return result;
|
|
268
|
-
};
|
|
256
|
+
const fileSystemOptions = await this.getAIFileSystemOptions();
|
|
257
|
+
chatOptions.fileSystemOptions = fileSystemOptions;
|
|
269
258
|
chatOptions.history = async (ctx, param, other) => {
|
|
270
259
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
271
260
|
const historyRequestData = {};
|
|
@@ -325,7 +314,8 @@ class AIChatUtil {
|
|
|
325
314
|
}
|
|
326
315
|
return true;
|
|
327
316
|
};
|
|
328
|
-
chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid2, srfaiagent, srfmode, srfscope, srfknowledgebases, srfaiagentconfig, appendcurdata, mcpservers, sessionmeta, srfproject) => {
|
|
317
|
+
chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid2, srfaiagent, srfmode, srfscope, srfknowledgebases, srfaiagentconfig, appendcurdata, mcpservers, sessionmeta, srfproject, localMsgID) => {
|
|
318
|
+
let updateFlag = true;
|
|
329
319
|
id = qxUtil.createUUID();
|
|
330
320
|
abortController = new AbortController();
|
|
331
321
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
@@ -367,9 +357,15 @@ class AIChatUtil {
|
|
|
367
357
|
if (extParams && Object.keys(extParams).length > 0) {
|
|
368
358
|
Object.assign(questionRequestData, { srfextparams: extParams });
|
|
369
359
|
}
|
|
360
|
+
aiChat.addWaitingMessage(id);
|
|
370
361
|
await deService.aiChatSse(
|
|
371
362
|
(msg) => {
|
|
372
363
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
364
|
+
aiChat.removeWaitingMessage(id);
|
|
365
|
+
if (msg.asextparam && localMsgID && updateFlag) {
|
|
366
|
+
aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
|
|
367
|
+
updateFlag = false;
|
|
368
|
+
}
|
|
373
369
|
if (!aiChat.getActiveAsyncacitonId()) {
|
|
374
370
|
aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
|
|
375
371
|
}
|
|
@@ -436,6 +432,7 @@ class AIChatUtil {
|
|
|
436
432
|
}
|
|
437
433
|
abortController == null ? void 0 : abortController.abort();
|
|
438
434
|
} finally {
|
|
435
|
+
aiChat.removeWaitingMessage(id);
|
|
439
436
|
aiChat.completeMessage(id, true);
|
|
440
437
|
aiChat.setActiveAsyncacitonId("");
|
|
441
438
|
return true;
|
|
@@ -495,9 +492,11 @@ class AIChatUtil {
|
|
|
495
492
|
srfproject: other.srfproject
|
|
496
493
|
});
|
|
497
494
|
try {
|
|
495
|
+
aiChat.addWaitingMessage(id);
|
|
498
496
|
await deService.aiResumeSse(
|
|
499
497
|
(msg) => {
|
|
500
498
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
499
|
+
aiChat.removeWaitingMessage(id);
|
|
501
500
|
aiChat.isLoading.value = true;
|
|
502
501
|
if (!aiChat.getActiveAsyncacitonId()) {
|
|
503
502
|
aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
|
|
@@ -567,6 +566,7 @@ class AIChatUtil {
|
|
|
567
566
|
}
|
|
568
567
|
abortController == null ? void 0 : abortController.abort();
|
|
569
568
|
} finally {
|
|
569
|
+
aiChat.removeWaitingMessage(id);
|
|
570
570
|
aiChat.isLoading.value = false;
|
|
571
571
|
aiChat.completeMessage(id, true);
|
|
572
572
|
aiChat.setActiveAsyncacitonId("");
|
|
@@ -1056,19 +1056,8 @@ class AIChatUtil {
|
|
|
1056
1056
|
let id = "";
|
|
1057
1057
|
let abortController;
|
|
1058
1058
|
const { chatInstance, view, ctrl } = args;
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
const response = await deService.aiChatProject(
|
|
1062
|
-
ctx,
|
|
1063
|
-
{ srfactag: param.srfactag },
|
|
1064
|
-
other
|
|
1065
|
-
);
|
|
1066
|
-
let result = [];
|
|
1067
|
-
if (response.data) {
|
|
1068
|
-
result = Array.isArray(response.data) ? response.data : response.data.children;
|
|
1069
|
-
}
|
|
1070
|
-
return result;
|
|
1071
|
-
};
|
|
1059
|
+
const fileSystemOptions = await this.getAIFileSystemOptions();
|
|
1060
|
+
chatOptions.fileSystemOptions = fileSystemOptions;
|
|
1072
1061
|
chatOptions.history = async (ctx, param, other) => {
|
|
1073
1062
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
1074
1063
|
const historyRequestData = {};
|
|
@@ -1128,7 +1117,8 @@ class AIChatUtil {
|
|
|
1128
1117
|
}
|
|
1129
1118
|
return true;
|
|
1130
1119
|
};
|
|
1131
|
-
chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode, srfscope, srfknowledgebases, srfaiagentconfig, appendcurdata, mcpservers, sessionmeta, srfproject) => {
|
|
1120
|
+
chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode, srfscope, srfknowledgebases, srfaiagentconfig, appendcurdata, mcpservers, sessionmeta, srfproject, localMsgID) => {
|
|
1121
|
+
let updateFlag = true;
|
|
1132
1122
|
id = qxUtil.createUUID();
|
|
1133
1123
|
abortController = new AbortController();
|
|
1134
1124
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
@@ -1168,9 +1158,15 @@ class AIChatUtil {
|
|
|
1168
1158
|
if (extParams && Object.keys(extParams).length > 0) {
|
|
1169
1159
|
Object.assign(questionRequestData, { srfextparams: extParams });
|
|
1170
1160
|
}
|
|
1161
|
+
aiChat.addWaitingMessage(id);
|
|
1171
1162
|
await deService.aiChatSse(
|
|
1172
1163
|
(msg) => {
|
|
1173
1164
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
1165
|
+
aiChat.removeWaitingMessage(id);
|
|
1166
|
+
if (msg.asextparam && localMsgID && updateFlag) {
|
|
1167
|
+
aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
|
|
1168
|
+
updateFlag = false;
|
|
1169
|
+
}
|
|
1174
1170
|
if (!aiChat.getActiveAsyncacitonId()) {
|
|
1175
1171
|
aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
|
|
1176
1172
|
}
|
|
@@ -1237,6 +1233,7 @@ class AIChatUtil {
|
|
|
1237
1233
|
}
|
|
1238
1234
|
abortController == null ? void 0 : abortController.abort();
|
|
1239
1235
|
} finally {
|
|
1236
|
+
aiChat.removeWaitingMessage(id);
|
|
1240
1237
|
aiChat.setActiveAsyncacitonId("");
|
|
1241
1238
|
aiChat.completeMessage(id, true);
|
|
1242
1239
|
return true;
|
|
@@ -1296,9 +1293,11 @@ class AIChatUtil {
|
|
|
1296
1293
|
srfproject: other.srfproject
|
|
1297
1294
|
});
|
|
1298
1295
|
try {
|
|
1296
|
+
aiChat.addWaitingMessage(id);
|
|
1299
1297
|
await deService.aiResumeSse(
|
|
1300
1298
|
(msg) => {
|
|
1301
1299
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
1300
|
+
aiChat.removeWaitingMessage(id);
|
|
1302
1301
|
aiChat.isLoading.value = true;
|
|
1303
1302
|
if (!aiChat.getActiveAsyncacitonId()) {
|
|
1304
1303
|
aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
|
|
@@ -1368,6 +1367,7 @@ class AIChatUtil {
|
|
|
1368
1367
|
}
|
|
1369
1368
|
abortController == null ? void 0 : abortController.abort();
|
|
1370
1369
|
} finally {
|
|
1370
|
+
aiChat.removeWaitingMessage(id);
|
|
1371
1371
|
aiChat.isLoading.value = false;
|
|
1372
1372
|
aiChat.completeMessage(id, true);
|
|
1373
1373
|
aiChat.setActiveAsyncacitonId("");
|
|
@@ -1888,6 +1888,63 @@ class AIChatUtil {
|
|
|
1888
1888
|
};
|
|
1889
1889
|
return resourceOptions;
|
|
1890
1890
|
}
|
|
1891
|
+
/**
|
|
1892
|
+
* @description 获取AI文件系统相关参数
|
|
1893
|
+
* @returns {*} {Promise<IData>}
|
|
1894
|
+
* @memberof AIChatUtil
|
|
1895
|
+
*/
|
|
1896
|
+
async getAIFileSystemOptions() {
|
|
1897
|
+
const fileSystemOptions = {};
|
|
1898
|
+
fileSystemOptions.getFileList = async (ctx, param, other) => {
|
|
1899
|
+
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
|
|
1900
|
+
const response = await deService.aiChatProject(
|
|
1901
|
+
ctx,
|
|
1902
|
+
{ srfactag: param.srfactag },
|
|
1903
|
+
{ ...other }
|
|
1904
|
+
);
|
|
1905
|
+
if (response.ok)
|
|
1906
|
+
return response.data;
|
|
1907
|
+
return void 0;
|
|
1908
|
+
};
|
|
1909
|
+
fileSystemOptions.uploadFile = async (ctx, param, other) => {
|
|
1910
|
+
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
|
|
1911
|
+
const response = await deService.aiChatProject(
|
|
1912
|
+
ctx,
|
|
1913
|
+
{ srfactag: param.srfactag },
|
|
1914
|
+
{ ...other, action: "UPLOAD" }
|
|
1915
|
+
);
|
|
1916
|
+
if (response.ok)
|
|
1917
|
+
return response.data;
|
|
1918
|
+
return void 0;
|
|
1919
|
+
};
|
|
1920
|
+
fileSystemOptions.getContent = async (ctx, param, id, type, cat) => {
|
|
1921
|
+
const app = await ibiz.hub.getAppAsync(ctx.appId);
|
|
1922
|
+
const requestUrl = "/ibizutil/downloadtxt/".concat(cat ? "".concat(cat, "/") : "").concat(id, "?type=").concat(type);
|
|
1923
|
+
const res = await app.net.get(requestUrl);
|
|
1924
|
+
if (res && res.ok && res.data) {
|
|
1925
|
+
return res.data;
|
|
1926
|
+
}
|
|
1927
|
+
};
|
|
1928
|
+
fileSystemOptions.getImgContent = async (ctx, param, id, type, cat) => {
|
|
1929
|
+
const { downloadUrl } = ibiz.util.file.calcFileUpDownUrl(
|
|
1930
|
+
ctx,
|
|
1931
|
+
param,
|
|
1932
|
+
{},
|
|
1933
|
+
{ osscat: cat }
|
|
1934
|
+
);
|
|
1935
|
+
let content = downloadUrl.replace("%fileId%", id);
|
|
1936
|
+
if (type === "svg") {
|
|
1937
|
+
const response = await ibiz.net.request(content, {
|
|
1938
|
+
method: "get",
|
|
1939
|
+
responseType: "blob",
|
|
1940
|
+
baseURL: ""
|
|
1941
|
+
});
|
|
1942
|
+
content = await response.data.text();
|
|
1943
|
+
}
|
|
1944
|
+
return content;
|
|
1945
|
+
};
|
|
1946
|
+
return fileSystemOptions;
|
|
1947
|
+
}
|
|
1891
1948
|
}
|
|
1892
1949
|
|
|
1893
1950
|
exports.AIChatUtil = AIChatUtil;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var ElementPlus = require('element-plus');
|
|
5
|
-
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.
|
|
5
|
+
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.152_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
|
|
6
6
|
var fullscreenToolbar = require('../../common/fullscreen-toolbar/fullscreen-toolbar.cjs');
|
|
7
7
|
|
|
8
8
|
"use strict";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.152",
|
|
4
4
|
"description": "web端组件库(vue3)",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
33
33
|
"@floating-ui/dom": "^1.5.3",
|
|
34
|
-
"@ibiz-template-plugin/ai-chat": "^0.0.
|
|
34
|
+
"@ibiz-template-plugin/ai-chat": "^0.0.117",
|
|
35
35
|
"@ibiz-template-plugin/gantt": "0.1.8-alpha.468",
|
|
36
36
|
"@ibiz-template-plugin/bi-report": "0.0.32",
|
|
37
37
|
"@ibiz-template-plugin/data-view": "0.0.8",
|
|
38
|
-
"@ibiz-template/core": "0.7.41-alpha.
|
|
38
|
+
"@ibiz-template/core": "0.7.41-alpha.152",
|
|
39
39
|
"@ibiz-template/devtool": "0.0.17",
|
|
40
|
-
"@ibiz-template/model-helper": "0.7.41-alpha.
|
|
41
|
-
"@ibiz-template/runtime": "0.7.41-alpha.
|
|
40
|
+
"@ibiz-template/model-helper": "0.7.41-alpha.152",
|
|
41
|
+
"@ibiz-template/runtime": "0.7.41-alpha.152",
|
|
42
42
|
"@ibiz-template/theme": "0.7.39",
|
|
43
|
-
"@ibiz-template/vue3-util": "0.7.41-alpha.
|
|
43
|
+
"@ibiz-template/vue3-util": "0.7.41-alpha.152",
|
|
44
44
|
"@ibiz-template/web-theme": "3.16.0",
|
|
45
45
|
"@ibiz/model-core": "^0.1.89",
|
|
46
46
|
"@imengyu/vue3-context-menu": "^1.3.5",
|
|
@@ -697,12 +697,14 @@ export const CalendarControl = defineComponent({
|
|
|
697
697
|
? item.text
|
|
698
698
|
: ''
|
|
699
699
|
: item.text;
|
|
700
|
+
// htmlCode 有值时才传 v-html,否则传 children
|
|
701
|
+
const vHtmlProps = htmlCode ? { 'v-html': htmlCode } : {};
|
|
700
702
|
return (
|
|
701
703
|
<div
|
|
702
704
|
class={itemClass}
|
|
703
705
|
style={style}
|
|
704
706
|
key={item.deData.srfkey}
|
|
705
|
-
|
|
707
|
+
{...vHtmlProps}
|
|
706
708
|
title={showTitle(item.tips || item.text)}
|
|
707
709
|
onClick={(): Promise<void> => this.c.onRowClick(item)}
|
|
708
710
|
onDblclick={(): Promise<void> => this.c.onDbRowClick(item)}
|
|
@@ -253,7 +253,11 @@ export function useCustomUpload(
|
|
|
253
253
|
for (const file of files) {
|
|
254
254
|
const rawFile = file as UploadRawFile;
|
|
255
255
|
rawFile.uid = genFileId();
|
|
256
|
-
|
|
256
|
+
// path 仅保留目录部分,去掉自身文件名
|
|
257
|
+
const relativePath = file.webkitRelativePath;
|
|
258
|
+
const lastSlash = relativePath.lastIndexOf('/');
|
|
259
|
+
rawFile.path =
|
|
260
|
+
lastSlash > -1 ? relativePath.slice(0, lastSlash) : relativePath;
|
|
257
261
|
|
|
258
262
|
// 文件夹上传绕过 beforeUpload 钩子,需要手动补偿缓存计数
|
|
259
263
|
if (options.addCacheCount) {
|