@ibiz-template/vue3-components 0.7.41-alpha.40 → 0.7.41-alpha.41
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/ibiz-markdown-editor-DEV-iSvz.js +1 -0
- package/dist/index-Bv2fgePf.js +11 -0
- package/dist/{index-BewO9StC.js → index-CD2XM6M6.js} +1 -1
- package/dist/{index-ClxO69TM.js → index-CaWTEUU1.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-4cNAgOaJ.js +1 -0
- package/dist/{xlsx-util-Cg5zMYCC.js → xlsx-util-Dvg2kWh7.js} +1 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.mjs +2 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.mjs +12 -2
- package/es/editor/code/monaco-editor/monaco-editor.mjs +41 -32
- package/es/editor/html/wang-editor/config/index.mjs +3 -0
- package/es/editor/html/wang-editor/config/toolbar.mjs +90 -0
- package/es/editor/html/wang-editor/constants/svg.mjs +8 -0
- package/es/editor/html/wang-editor/wang-editor.css +1 -1
- package/es/editor/html/wang-editor/wang-editor.mjs +52 -39
- package/es/editor/markdown/ibiz-markdown-editor/custom-menu.mjs +264 -2
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +38 -6
- package/es/editor/markdown/ibiz-markdown-editor/render-util.mjs +33 -4
- package/es/editor/text-box/input/input.mjs +41 -32
- package/es/index.mjs +1 -1
- package/es/locale/en/index.mjs +3 -1
- package/es/locale/zh-CN/index.mjs +3 -1
- package/es/util/ai-chat-util/ai-chat-util.mjs +216 -0
- package/es/util/app-util/app-util.mjs +20 -48
- package/es/util/index.mjs +1 -1
- package/es/util/inline-ai-util/inline-ai-textarea/icon.mjs +75 -1
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.mjs +136 -43
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.mjs +130 -48
- package/es/util/inline-ai-util/inline-ai-util.mjs +2 -1
- package/es/web-app/main.mjs +2 -0
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.cjs +12 -2
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.cjs +2 -1
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +40 -31
- package/lib/editor/html/wang-editor/config/index.cjs +7 -0
- package/lib/editor/html/wang-editor/config/toolbar.cjs +92 -0
- package/lib/editor/html/wang-editor/constants/svg.cjs +14 -0
- package/lib/editor/html/wang-editor/wang-editor.cjs +51 -38
- package/lib/editor/html/wang-editor/wang-editor.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/custom-menu.cjs +264 -2
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +38 -6
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/render-util.cjs +33 -4
- package/lib/editor/text-box/input/input.cjs +40 -31
- package/lib/index.cjs +2 -2
- package/lib/locale/en/index.cjs +3 -1
- package/lib/locale/zh-CN/index.cjs +3 -1
- package/lib/util/ai-chat-util/ai-chat-util.cjs +218 -0
- package/lib/util/app-util/app-util.cjs +19 -47
- package/lib/util/index.cjs +2 -2
- package/lib/util/inline-ai-util/inline-ai-textarea/icon.cjs +78 -0
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.cjs +129 -47
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.cjs +135 -42
- package/lib/util/inline-ai-util/inline-ai-util.cjs +2 -1
- package/lib/web-app/main.cjs +2 -0
- package/package.json +5 -5
- package/dist/ibiz-markdown-editor-CxFS8frQ.js +0 -1
- package/dist/index-2eZnbrr4.js +0 -11
- package/dist/wang-editor-BPl509oX.js +0 -1
- package/es/util/ai-util/ai-util.mjs +0 -68
- package/lib/util/ai-util/ai-util.cjs +0 -71
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var runtime = require('@ibiz-template/runtime');
|
|
4
|
+
var core = require('@ibiz-template/core');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
class AIChatUtil {
|
|
8
|
+
/**
|
|
9
|
+
* 获取AI聊天对象
|
|
10
|
+
*/
|
|
11
|
+
async getAIChat() {
|
|
12
|
+
const module = await import('@ibiz-template-plugin/ai-chat');
|
|
13
|
+
const chatInstance = module.chat || module.default.chat;
|
|
14
|
+
return chatInstance;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 添加资源
|
|
18
|
+
* @param resource
|
|
19
|
+
*/
|
|
20
|
+
addResource(resource) {
|
|
21
|
+
throw new Error("Method not implemented.");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 获取编辑器扩展AI聊天参数
|
|
25
|
+
* @param editorParams
|
|
26
|
+
* @param context
|
|
27
|
+
* @param params
|
|
28
|
+
* @param data
|
|
29
|
+
*/
|
|
30
|
+
getEditorExAIChatParams(editorParams, context, params, data) {
|
|
31
|
+
const containerOptions = {};
|
|
32
|
+
if (editorParams.enableaiminimize) {
|
|
33
|
+
containerOptions.enableAIMinimize = editorParams.enableaiminimize === "true";
|
|
34
|
+
}
|
|
35
|
+
if (editorParams.openmode) {
|
|
36
|
+
containerOptions.openMode = containerOptions.enableAIMinimize ? editorParams.openmode : "default";
|
|
37
|
+
} else {
|
|
38
|
+
containerOptions.enableAIMinimize = ibiz.config.common.enableAIMinimize;
|
|
39
|
+
}
|
|
40
|
+
if (editorParams.autoclose) {
|
|
41
|
+
try {
|
|
42
|
+
const autoClose = JSON.parse(editorParams.autoclose);
|
|
43
|
+
if (!containerOptions.enableAIMinimize && autoClose && autoClose.mode === "minimize") {
|
|
44
|
+
autoClose.mode = "close";
|
|
45
|
+
}
|
|
46
|
+
containerOptions.autoClose = autoClose;
|
|
47
|
+
} catch (error) {
|
|
48
|
+
ibiz.log.error(error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const chatOptions = {};
|
|
52
|
+
if (editorParams.srfaiappendcurdata) {
|
|
53
|
+
chatOptions.appendCurData = editorParams.srfaiappendcurdata === "true" ? data : void 0;
|
|
54
|
+
}
|
|
55
|
+
chatOptions.appendCurContent = editorParams.srfaiappendcurcontent ? core.StringUtil.fill(
|
|
56
|
+
editorParams.srfaiappendcurcontent,
|
|
57
|
+
context,
|
|
58
|
+
params,
|
|
59
|
+
data
|
|
60
|
+
) : void 0;
|
|
61
|
+
chatOptions.autoQuestion = editorParams.autoquestion !== "false";
|
|
62
|
+
chatOptions.autoFill = editorParams.autofill === "true";
|
|
63
|
+
chatOptions.appendCurResource = editorParams.srfaiappendresource ? core.StringUtil.fill(editorParams.srfaiappendresource, context, params, data) : void 0;
|
|
64
|
+
if (editorParams.srfmode) {
|
|
65
|
+
chatOptions.srfMode = editorParams.srfmode;
|
|
66
|
+
}
|
|
67
|
+
return { containerOptions, chatOptions };
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 获取界面行为扩展AI聊天参数
|
|
71
|
+
* @param context
|
|
72
|
+
* @param params
|
|
73
|
+
* @param data
|
|
74
|
+
*/
|
|
75
|
+
getUIActionExAIChatParams(context, params, data) {
|
|
76
|
+
const containerOptions = {};
|
|
77
|
+
if (params.hasOwnProperty("enableaiminimize")) {
|
|
78
|
+
containerOptions.enableAIMinimize = params.enableaiminimize === "true";
|
|
79
|
+
delete params.disableminimize;
|
|
80
|
+
} else {
|
|
81
|
+
containerOptions.enableAIMinimize = ibiz.config.common.enableAIMinimize;
|
|
82
|
+
}
|
|
83
|
+
if (params.hasOwnProperty("openmode")) {
|
|
84
|
+
containerOptions.openMode = containerOptions.enableAIMinimize ? params.openmode : "default";
|
|
85
|
+
delete params.openmode;
|
|
86
|
+
}
|
|
87
|
+
if (params.hasOwnProperty("autoclose")) {
|
|
88
|
+
try {
|
|
89
|
+
const autoClose = JSON.parse(params.autoclose);
|
|
90
|
+
if (!containerOptions.enableAIMinimize && autoClose && autoClose.mode === "minimize") {
|
|
91
|
+
autoClose.mode = "close";
|
|
92
|
+
}
|
|
93
|
+
containerOptions.autoClose = autoClose;
|
|
94
|
+
delete params.autoclose;
|
|
95
|
+
} catch (error) {
|
|
96
|
+
ibiz.log.error(error);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const chatOptions = {};
|
|
100
|
+
if (context.srfaiappendcurdata === "true") {
|
|
101
|
+
chatOptions.appendCurData = data;
|
|
102
|
+
} else if (params.hasOwnProperty("srfaiappendcurdata")) {
|
|
103
|
+
chatOptions.appendCurData = params.srfaiappendcurdata === "true" ? data : void 0;
|
|
104
|
+
delete params.srfaiappendcurdata;
|
|
105
|
+
}
|
|
106
|
+
if (params.hasOwnProperty("srfaiappendcurcontent")) {
|
|
107
|
+
chatOptions.appendCurContent = core.StringUtil.fill(
|
|
108
|
+
params.srfaiappendcurcontent,
|
|
109
|
+
context,
|
|
110
|
+
params,
|
|
111
|
+
data
|
|
112
|
+
);
|
|
113
|
+
delete params.srfaiappendcurcontent;
|
|
114
|
+
}
|
|
115
|
+
if (params.hasOwnProperty("autoquestion")) {
|
|
116
|
+
chatOptions.autoQuestion = params.autoquestion !== "false";
|
|
117
|
+
delete params.autoquestion;
|
|
118
|
+
}
|
|
119
|
+
if (params.hasOwnProperty("srfaiappendresource")) {
|
|
120
|
+
chatOptions.appendCurResource = core.StringUtil.fill(
|
|
121
|
+
params.srfaiappendresource,
|
|
122
|
+
context,
|
|
123
|
+
params,
|
|
124
|
+
data
|
|
125
|
+
);
|
|
126
|
+
delete params.srfaiappendresource;
|
|
127
|
+
}
|
|
128
|
+
if (params.hasOwnProperty("srfmode")) {
|
|
129
|
+
chatOptions.srfMode = params.srfmode;
|
|
130
|
+
delete params.srfmode;
|
|
131
|
+
}
|
|
132
|
+
return { containerOptions, chatOptions };
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 计算界面行为扩展AI聊天工具栏项
|
|
136
|
+
* @param deACMode 自填模式
|
|
137
|
+
*/
|
|
138
|
+
calcAiToolbarItemsByAc(deACMode) {
|
|
139
|
+
var _a;
|
|
140
|
+
const contentToolbarItems = [];
|
|
141
|
+
const footerToolbarItems = [];
|
|
142
|
+
const questionToolbarItems = [];
|
|
143
|
+
const functionToolbarItems = [];
|
|
144
|
+
const inlineToolbarItems = [];
|
|
145
|
+
const otherToolbarItems = [];
|
|
146
|
+
if (!deACMode || !deACMode.deuiactionGroup) {
|
|
147
|
+
return {
|
|
148
|
+
contentToolbarItems,
|
|
149
|
+
footerToolbarItems,
|
|
150
|
+
questionToolbarItems,
|
|
151
|
+
otherToolbarItems,
|
|
152
|
+
functionToolbarItems,
|
|
153
|
+
inlineToolbarItems
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
(_a = deACMode.deuiactionGroup.uiactionGroupDetails) == null ? void 0 : _a.forEach(
|
|
157
|
+
(item) => {
|
|
158
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
159
|
+
const toolbarItem = {
|
|
160
|
+
appId: item.appId,
|
|
161
|
+
id: item.uiactionId,
|
|
162
|
+
label: item.showCaption ? item.caption : "",
|
|
163
|
+
title: item.tooltip,
|
|
164
|
+
icon: {
|
|
165
|
+
showIcon: item.showIcon,
|
|
166
|
+
cssClass: (_a2 = item.sysImage) == null ? void 0 : _a2.cssClass,
|
|
167
|
+
imagePath: (_b = item.sysImage) == null ? void 0 : _b.imagePath
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
if (item.sysImage && item.sysImage.imagePath && !item.sysImage.imagePath.startsWith("http")) {
|
|
171
|
+
toolbarItem.icon.imagePath = "".concat(ibiz.env.assetsUrl, "/images/").concat(item.sysImage.imagePath);
|
|
172
|
+
}
|
|
173
|
+
if ((_c = item.uiactionId) == null ? void 0 : _c.startsWith("msg_content_")) {
|
|
174
|
+
contentToolbarItems.push(toolbarItem);
|
|
175
|
+
} else if ((_d = item.uiactionId) == null ? void 0 : _d.startsWith("msg_footer_")) {
|
|
176
|
+
footerToolbarItems.push(toolbarItem);
|
|
177
|
+
} else if ((_e = item.uiactionId) == null ? void 0 : _e.startsWith("question_")) {
|
|
178
|
+
questionToolbarItems.push(toolbarItem);
|
|
179
|
+
} else if ((_f = item.uiactionId) == null ? void 0 : _f.startsWith("function_")) {
|
|
180
|
+
functionToolbarItems.push(toolbarItem);
|
|
181
|
+
} else if (((_g = item.uiactionId) == null ? void 0 : _g.startsWith("inline")) || item.refUIActionGroup && ((_h = item.refUIActionGroup.id) == null ? void 0 : _h.startsWith("inline"))) {
|
|
182
|
+
inlineToolbarItems.push(toolbarItem);
|
|
183
|
+
} else {
|
|
184
|
+
otherToolbarItems.push(toolbarItem);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
return {
|
|
189
|
+
contentToolbarItems,
|
|
190
|
+
footerToolbarItems,
|
|
191
|
+
questionToolbarItems,
|
|
192
|
+
otherToolbarItems,
|
|
193
|
+
functionToolbarItems,
|
|
194
|
+
inlineToolbarItems
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* 获取AI代理列表
|
|
199
|
+
* @param context
|
|
200
|
+
* @param params
|
|
201
|
+
*/
|
|
202
|
+
async getAIAgentList(context, params) {
|
|
203
|
+
const emptyList = [];
|
|
204
|
+
const app = ibiz.hub.getApp(ibiz.env.appId);
|
|
205
|
+
const aiAgentUtil = app.getAppUtil("DYNAMICAIGENT", "CUSTOM");
|
|
206
|
+
if (!aiAgentUtil) {
|
|
207
|
+
return emptyList;
|
|
208
|
+
}
|
|
209
|
+
const utilService = new runtime.UtilService(aiAgentUtil);
|
|
210
|
+
const data = await utilService.load("", context, params);
|
|
211
|
+
if (!data || data.length === 0) {
|
|
212
|
+
return emptyList;
|
|
213
|
+
}
|
|
214
|
+
return data;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
exports.AIChatUtil = AIChatUtil;
|
|
@@ -4,7 +4,6 @@ var runtime = require('@ibiz-template/runtime');
|
|
|
4
4
|
var qxUtil = require('qx-util');
|
|
5
5
|
var core = require('@ibiz-template/core');
|
|
6
6
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
7
|
-
var aiUtil = require('../ai-util/ai-util.cjs');
|
|
8
7
|
|
|
9
8
|
"use strict";
|
|
10
9
|
var __defProp = Object.defineProperty;
|
|
@@ -186,42 +185,6 @@ class AppUtil {
|
|
|
186
185
|
}
|
|
187
186
|
return true;
|
|
188
187
|
}
|
|
189
|
-
/**
|
|
190
|
-
* 计算AI扩展参数
|
|
191
|
-
*
|
|
192
|
-
* @private
|
|
193
|
-
* @param {IData} params
|
|
194
|
-
* @return {*} {IData}
|
|
195
|
-
*/
|
|
196
|
-
computeAiExParams(context, params, data) {
|
|
197
|
-
const exParams = {};
|
|
198
|
-
if (params.hasOwnProperty("autoquestion")) {
|
|
199
|
-
exParams.autoQuestion = params.autoquestion !== "false";
|
|
200
|
-
delete params.autoquestion;
|
|
201
|
-
}
|
|
202
|
-
if (params.hasOwnProperty("openmode")) {
|
|
203
|
-
exParams.openMode = params.openmode;
|
|
204
|
-
delete params.openmode;
|
|
205
|
-
}
|
|
206
|
-
if (params.hasOwnProperty("autoclose")) {
|
|
207
|
-
try {
|
|
208
|
-
exParams.autoClose = JSON.parse(params.autoclose);
|
|
209
|
-
delete params.autoclose;
|
|
210
|
-
} catch (error) {
|
|
211
|
-
ibiz.log.error(error);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
if (params.hasOwnProperty("srfaiappendcurcontent")) {
|
|
215
|
-
exParams.appendCurContent = core.StringUtil.fill(
|
|
216
|
-
params.srfaiappendcurcontent,
|
|
217
|
-
context,
|
|
218
|
-
params,
|
|
219
|
-
data
|
|
220
|
-
);
|
|
221
|
-
delete params.srfaiappendcurcontent;
|
|
222
|
-
}
|
|
223
|
-
return exParams;
|
|
224
|
-
}
|
|
225
188
|
/**
|
|
226
189
|
* 打开AI聊天
|
|
227
190
|
*
|
|
@@ -239,8 +202,11 @@ class AppUtil {
|
|
|
239
202
|
appDEACModeId,
|
|
240
203
|
appDataEntityId
|
|
241
204
|
} = chartParams;
|
|
242
|
-
const
|
|
243
|
-
const
|
|
205
|
+
const { containerOptions, chatOptions } = ibiz.aiChatUtil.getUIActionExAIChatParams(context, params, data);
|
|
206
|
+
const aiAgentlist = await ibiz.aiChatUtil.getAIAgentList(
|
|
207
|
+
context,
|
|
208
|
+
params
|
|
209
|
+
);
|
|
244
210
|
const deACMode = await runtime.getDeACMode(
|
|
245
211
|
appDEACModeId,
|
|
246
212
|
appDataEntityId,
|
|
@@ -253,9 +219,8 @@ class AppUtil {
|
|
|
253
219
|
footerToolbarItems,
|
|
254
220
|
questionToolbarItems,
|
|
255
221
|
otherToolbarItems
|
|
256
|
-
} =
|
|
257
|
-
const
|
|
258
|
-
const chatInstance = module.chat || module.default.chat;
|
|
222
|
+
} = ibiz.aiChatUtil.calcAiToolbarItemsByAc(deACMode);
|
|
223
|
+
const chatInstance = await ibiz.aiChatUtil.getAIChat();
|
|
259
224
|
const messages = [];
|
|
260
225
|
const appDataEntityName = runtime.calcDeCodeNameById(appDataEntityId);
|
|
261
226
|
let topicId = "".concat(context.srfsystemid, "_").concat(context.srfappid, "_").concat(appDataEntityId, "_").concat(appDEACModeId, "_");
|
|
@@ -271,7 +236,8 @@ class AppUtil {
|
|
|
271
236
|
mode: "TOPIC",
|
|
272
237
|
containerOptions: {
|
|
273
238
|
zIndex: containerZIndex,
|
|
274
|
-
enableBackFill: false
|
|
239
|
+
enableBackFill: false,
|
|
240
|
+
...containerOptions
|
|
275
241
|
},
|
|
276
242
|
topicOptions: {
|
|
277
243
|
appid: ibiz.env.appId,
|
|
@@ -305,15 +271,13 @@ class AppUtil {
|
|
|
305
271
|
caption: deACMode.logicName,
|
|
306
272
|
context: { ...context },
|
|
307
273
|
params: tempParams,
|
|
308
|
-
// 界面行为导航上下文参数srfaiappendcurdata,是否传入对象参数,用于历史查询传参
|
|
309
|
-
appendCurData: context.srfaiappendcurdata === "true" ? data : void 0,
|
|
310
274
|
appDataEntityId,
|
|
311
275
|
contentToolbarItems,
|
|
312
276
|
footerToolbarItems,
|
|
313
277
|
questionToolbarItems,
|
|
314
278
|
otherToolbarItems,
|
|
315
279
|
aiAgentlist,
|
|
316
|
-
question: async (aiChat, ctx, param, other, arr, sessionid, srfaiagent) => {
|
|
280
|
+
question: async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode) => {
|
|
317
281
|
id = qxUtil.createUUID();
|
|
318
282
|
abortController = new AbortController();
|
|
319
283
|
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
@@ -325,6 +289,9 @@ class AppUtil {
|
|
|
325
289
|
if (srfaiagent) {
|
|
326
290
|
questionRequestData.srfaiagent = srfaiagent;
|
|
327
291
|
}
|
|
292
|
+
if (srfmode) {
|
|
293
|
+
questionRequestData.mode = srfmode;
|
|
294
|
+
}
|
|
328
295
|
await deService.aiChatSse(
|
|
329
296
|
(msg) => {
|
|
330
297
|
if (msg.actionstate === 20 && msg.actionresult) {
|
|
@@ -403,6 +370,11 @@ class AppUtil {
|
|
|
403
370
|
srfaiagent: other.srfaiagent
|
|
404
371
|
});
|
|
405
372
|
}
|
|
373
|
+
if (other.srfmode) {
|
|
374
|
+
Object.assign(historyRequestData, {
|
|
375
|
+
mode: other.srfmode
|
|
376
|
+
});
|
|
377
|
+
}
|
|
406
378
|
const result = await deService.aiChatHistory(
|
|
407
379
|
ctx,
|
|
408
380
|
param,
|
|
@@ -506,7 +478,7 @@ class AppUtil {
|
|
|
506
478
|
return result;
|
|
507
479
|
},
|
|
508
480
|
// 扩展参数
|
|
509
|
-
...
|
|
481
|
+
...chatOptions
|
|
510
482
|
}
|
|
511
483
|
});
|
|
512
484
|
});
|
package/lib/util/index.cjs
CHANGED
|
@@ -14,10 +14,10 @@ var appUtil = require('./app-util/app-util.cjs');
|
|
|
14
14
|
var fullscreenUtil = require('./fullscreen/fullscreen-util.cjs');
|
|
15
15
|
var wangEditorUtil = require('./wang-editor-util/wang-editor-util.cjs');
|
|
16
16
|
var keydownUtil = require('./keydown-util/keydown-util.cjs');
|
|
17
|
-
var aiUtil = require('./ai-util/ai-util.cjs');
|
|
18
17
|
var buttonUtil = require('./button-util/button-util.cjs');
|
|
19
18
|
var icon = require('./icon/icon.cjs');
|
|
20
19
|
var inlineAiUtil = require('./inline-ai-util/inline-ai-util.cjs');
|
|
20
|
+
var aiChatUtil = require('./ai-chat-util/ai-chat-util.cjs');
|
|
21
21
|
|
|
22
22
|
"use strict";
|
|
23
23
|
|
|
@@ -35,8 +35,8 @@ exports.AppUtil = appUtil.AppUtil;
|
|
|
35
35
|
exports.FullscreenUtil = fullscreenUtil.FullscreenUtil;
|
|
36
36
|
exports.parseHtml = wangEditorUtil.parseHtml;
|
|
37
37
|
exports.useFocusByEnter = keydownUtil.useFocusByEnter;
|
|
38
|
-
exports.calcAiToolbarItemsByAc = aiUtil.calcAiToolbarItemsByAc;
|
|
39
38
|
exports.convertBtnType = buttonUtil.convertBtnType;
|
|
40
39
|
exports.ArrowLeftBold = icon.ArrowLeftBold;
|
|
41
40
|
exports.ArrowRightBold = icon.ArrowRightBold;
|
|
42
41
|
exports.InLineAIUtil = inlineAiUtil.InLineAIUtil;
|
|
42
|
+
exports.AIChatUtil = aiChatUtil.AIChatUtil;
|
|
@@ -140,12 +140,90 @@ const CancelIcon = vue.createVNode("svg", {
|
|
|
140
140
|
"d": "M4.002 3.403V1a1 1 0 011-1h6.003a1 1 0 011 1v2.403h3.396a.6.6 0 110 1.2h-1.395V15a1 1 0 01-1 1H3a1 1 0 01-1-1V4.603H.6a.6.6 0 110-1.2h3.4zm8.804 1.205H3.2V14.8h9.605V4.608zM5.202 1.2v2.155h5.603V1.2H5.202zm.6 6.417a.6.6 0 011.201 0v4.758a.6.6 0 01-1.2 0V7.617zm3.202 0a.6.6 0 011.2 0v4.758a.6.6 0 01-1.2 0V7.617z",
|
|
141
141
|
"id": "bbh\u5220\u9664"
|
|
142
142
|
}, null)])]);
|
|
143
|
+
const LoadingIcon = vue.createVNode("svg", {
|
|
144
|
+
"width": "16",
|
|
145
|
+
"height": "16",
|
|
146
|
+
"viewBox": "0 0 50 50",
|
|
147
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
148
|
+
}, [vue.createVNode("circle", {
|
|
149
|
+
"cx": "25",
|
|
150
|
+
"cy": "25",
|
|
151
|
+
"r": "20",
|
|
152
|
+
"fill": "none",
|
|
153
|
+
"stroke": "currentColor",
|
|
154
|
+
"stroke-width": "5",
|
|
155
|
+
"stroke-dasharray": "31.415, 31.415",
|
|
156
|
+
"stroke-linecap": "round"
|
|
157
|
+
}, [vue.createVNode("animateTransform", {
|
|
158
|
+
"attributeName": "transform",
|
|
159
|
+
"type": "rotate",
|
|
160
|
+
"from": "0 25 25",
|
|
161
|
+
"to": "360 25 25",
|
|
162
|
+
"dur": "1s",
|
|
163
|
+
"repeatCount": "indefinite"
|
|
164
|
+
}, null)])]);
|
|
165
|
+
const ThinkSuccessIcon = vue.createVNode("svg", {
|
|
166
|
+
"viewBox": "0 0 16 16",
|
|
167
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
168
|
+
"width": "16",
|
|
169
|
+
"height": "16",
|
|
170
|
+
"fill": "currentColor",
|
|
171
|
+
"preserveAspectRatio": "xMidYMid meet",
|
|
172
|
+
"focusable": "false"
|
|
173
|
+
}, [vue.createVNode("g", {
|
|
174
|
+
"id": "agptips/check-circle",
|
|
175
|
+
"stroke-width": "1",
|
|
176
|
+
"fill-rule": "evenodd"
|
|
177
|
+
}, [vue.createVNode("path", {
|
|
178
|
+
"d": "M8 16A8 8 0 118 0a8 8 0 010 16zm0-1.2A6.8 6.8 0 108 1.2a6.8 6.8 0 000 13.6zM5.666 7.207l1.8 1.845 3.482-3.554.857.84-4.34 4.43-2.658-2.723.86-.838z",
|
|
179
|
+
"id": "agp\u5F62\u72B6\u7ED3\u5408"
|
|
180
|
+
}, null)])]);
|
|
181
|
+
const UpIcon = vue.createVNode("svg", {
|
|
182
|
+
"viewBox": "0 0 16 16",
|
|
183
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
184
|
+
"width": "16",
|
|
185
|
+
"height": "16",
|
|
186
|
+
"fill": "currentColor",
|
|
187
|
+
"preserveAspectRatio": "xMidYMid meet",
|
|
188
|
+
"focusable": "false",
|
|
189
|
+
"style": "transform: rotate(-90deg);"
|
|
190
|
+
}, [vue.createVNode("g", {
|
|
191
|
+
"id": "abfnavigation/angle-right",
|
|
192
|
+
"stroke-width": "1",
|
|
193
|
+
"fill-rule": "evenodd"
|
|
194
|
+
}, [vue.createVNode("path", {
|
|
195
|
+
"d": "M7.978 11.498l-.005.005L2.3 5.831 3.13 5l4.848 4.848L12.826 5l.83.831-5.673 5.672-.005-.005z",
|
|
196
|
+
"id": "abf\u5F62\u72B6\u7ED3\u5408",
|
|
197
|
+
"transform": "rotate(-90 7.978 8.252)"
|
|
198
|
+
}, null)])]);
|
|
199
|
+
const DownIcon = vue.createVNode("svg", {
|
|
200
|
+
"viewBox": "0 0 16 16",
|
|
201
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
202
|
+
"width": "16",
|
|
203
|
+
"height": "16",
|
|
204
|
+
"fill": "currentColor",
|
|
205
|
+
"preserveAspectRatio": "xMidYMid meet",
|
|
206
|
+
"focusable": "false",
|
|
207
|
+
"style": "transform: rotate(90deg);"
|
|
208
|
+
}, [vue.createVNode("g", {
|
|
209
|
+
"id": "abfnavigation/angle-right",
|
|
210
|
+
"stroke-width": "1",
|
|
211
|
+
"fill-rule": "evenodd"
|
|
212
|
+
}, [vue.createVNode("path", {
|
|
213
|
+
"d": "M7.978 11.498l-.005.005L2.3 5.831 3.13 5l4.848 4.848L12.826 5l.83.831-5.673 5.672-.005-.005z",
|
|
214
|
+
"id": "abf\u5F62\u72B6\u7ED3\u5408",
|
|
215
|
+
"transform": "rotate(-90 7.978 8.252)"
|
|
216
|
+
}, null)])]);
|
|
143
217
|
|
|
144
218
|
exports.AIIcon = AIIcon;
|
|
145
219
|
exports.CancelIcon = CancelIcon;
|
|
146
220
|
exports.CopyTextIcon = CopyTextIcon;
|
|
221
|
+
exports.DownIcon = DownIcon;
|
|
222
|
+
exports.LoadingIcon = LoadingIcon;
|
|
147
223
|
exports.RegenerateIcon = RegenerateIcon;
|
|
148
224
|
exports.ReplaceTextIcon = ReplaceTextIcon;
|
|
149
225
|
exports.SendIcon = SendIcon;
|
|
150
226
|
exports.StopIcon = StopIcon;
|
|
227
|
+
exports.ThinkSuccessIcon = ThinkSuccessIcon;
|
|
228
|
+
exports.UpIcon = UpIcon;
|
|
151
229
|
exports.insertTextIcon = insertTextIcon;
|