@ibiz-template/vue3-components 0.7.41-alpha.42 → 0.7.41-alpha.43
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-DJ662N4_.js +1 -0
- package/dist/{index-CaWTEUU1.js → index-CG3sQH0b.js} +1 -1
- package/dist/index-D3x_MFr-.js +11 -0
- package/dist/{index-CD2XM6M6.js → index-kZrZndeH.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-DDSO3Ha9.js +1 -0
- package/dist/{xlsx-util-B1eGfH7d.js → xlsx-util-8YSXhmdI.js} +1 -1
- package/es/control/toolbar/export-excel/export-excel.mjs +19 -4
- package/es/editor/code/monaco-editor/monaco-editor.mjs +6 -194
- package/es/editor/html/wang-editor/module/ai-module.mjs +1 -1
- package/es/editor/html/wang-editor/wang-editor.mjs +20 -201
- package/es/editor/markdown/ibiz-markdown-editor/custom-menu.mjs +7 -223
- package/es/editor/text-box/input/input.mjs +9 -197
- package/es/locale/en/index.mjs +24 -1
- package/es/locale/zh-CN/index.mjs +24 -1
- package/es/panel-component/panel-app-title/panel-app-title.mjs +19 -42
- package/es/util/ai-chat-util/ai-chat-util.mjs +637 -7
- package/es/util/ai-chat-util/ai-feedback/ai-feedback.css +1 -0
- package/es/util/ai-chat-util/ai-feedback/ai-feedback.mjs +130 -0
- package/es/util/app-util/app-util.mjs +24 -246
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.mjs +5 -1
- package/lib/control/toolbar/export-excel/export-excel.cjs +18 -3
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +6 -194
- package/lib/editor/html/wang-editor/module/ai-module.cjs +1 -1
- package/lib/editor/html/wang-editor/wang-editor.cjs +19 -200
- package/lib/editor/markdown/ibiz-markdown-editor/custom-menu.cjs +7 -223
- package/lib/editor/text-box/input/input.cjs +8 -196
- package/lib/locale/en/index.cjs +24 -1
- package/lib/locale/zh-CN/index.cjs +24 -1
- package/lib/panel-component/panel-app-title/panel-app-title.cjs +18 -41
- package/lib/util/ai-chat-util/ai-chat-util.cjs +635 -5
- package/lib/util/ai-chat-util/ai-feedback/ai-feedback.cjs +132 -0
- package/lib/util/ai-chat-util/ai-feedback/ai-feedback.css +1 -0
- package/lib/util/app-util/app-util.cjs +23 -245
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.cjs +5 -1
- package/package.json +7 -7
- package/dist/ibiz-markdown-editor-pEdb_gS_.js +0 -1
- package/dist/index-BObZTN7-.js +0 -11
- package/dist/wang-editor-Ck-JCWqK.js +0 -1
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var Cherry = require('cherry-markdown');
|
|
4
4
|
var vue = require('vue');
|
|
5
|
-
var qxUtil = require('qx-util');
|
|
6
5
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
7
|
-
var core = require('@ibiz-template/core');
|
|
8
|
-
var runtime = require('@ibiz-template/runtime');
|
|
9
6
|
|
|
10
7
|
"use strict";
|
|
11
8
|
function initCustomMenu(c, opts) {
|
|
@@ -62,28 +59,17 @@ function initCustomMenu(c, opts) {
|
|
|
62
59
|
const appDataEntityId = c.model.appDataEntityId;
|
|
63
60
|
if (!appDataEntityId || !c.deACMode)
|
|
64
61
|
return;
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
);
|
|
70
|
-
const {
|
|
71
|
-
contentToolbarItems,
|
|
72
|
-
footerToolbarItems,
|
|
73
|
-
questionToolbarItems,
|
|
74
|
-
otherToolbarItems
|
|
75
|
-
} = ibiz.aiChatUtil.calcAiToolbarItemsByAc(c.deACMode);
|
|
76
|
-
const { containerOptions, chatOptions } = ibiz.aiChatUtil.getEditorExAIChatParams(
|
|
62
|
+
const { zIndex } = vue3Util.useUIStore();
|
|
63
|
+
const containerZIndex = zIndex.increment();
|
|
64
|
+
chatInstance = await ibiz.aiChatUtil.getAIChat();
|
|
65
|
+
const { containerOptions, chatOptions } = await ibiz.aiChatUtil.getEditorExAIChatParams(
|
|
77
66
|
c.editorParams,
|
|
78
67
|
c.context,
|
|
79
68
|
c.params,
|
|
80
|
-
props.data
|
|
69
|
+
props.data,
|
|
70
|
+
c.deACMode,
|
|
71
|
+
{ chatInstance, view: c.view, ctrl: c.ctrl }
|
|
81
72
|
);
|
|
82
|
-
const { zIndex } = vue3Util.useUIStore();
|
|
83
|
-
const containerZIndex = zIndex.increment();
|
|
84
|
-
chatInstance = await ibiz.aiChatUtil.getAIChat();
|
|
85
|
-
let id = "";
|
|
86
|
-
let abortController;
|
|
87
73
|
chatInstance.create({
|
|
88
74
|
containerOptions: {
|
|
89
75
|
zIndex: containerZIndex,
|
|
@@ -94,89 +80,7 @@ function initCustomMenu(c, opts) {
|
|
|
94
80
|
context: { ...c.context },
|
|
95
81
|
params: { ...c.params, srfactag: c.deACMode.codeName },
|
|
96
82
|
appDataEntityId,
|
|
97
|
-
contentToolbarItems,
|
|
98
|
-
footerToolbarItems,
|
|
99
|
-
questionToolbarItems,
|
|
100
|
-
otherToolbarItems,
|
|
101
|
-
aiAgentlist,
|
|
102
83
|
...chatOptions,
|
|
103
|
-
question: async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode) => {
|
|
104
|
-
id = qxUtil.createUUID();
|
|
105
|
-
abortController = new AbortController();
|
|
106
|
-
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
107
|
-
try {
|
|
108
|
-
const questionRequestData = {
|
|
109
|
-
messages: arr,
|
|
110
|
-
sessionid
|
|
111
|
-
};
|
|
112
|
-
if (srfaiagent) {
|
|
113
|
-
questionRequestData.srfaiagent = srfaiagent;
|
|
114
|
-
}
|
|
115
|
-
if (srfmode) {
|
|
116
|
-
questionRequestData.mode = srfmode;
|
|
117
|
-
}
|
|
118
|
-
await deService.aiChatSse(
|
|
119
|
-
(msg) => {
|
|
120
|
-
if (msg.actionstate === 20 && msg.actionresult) {
|
|
121
|
-
aiChat.addMessage({
|
|
122
|
-
messageid: id,
|
|
123
|
-
state: msg.actionstate,
|
|
124
|
-
type: "DEFAULT",
|
|
125
|
-
role: "ASSISTANT",
|
|
126
|
-
content: msg.actionresult
|
|
127
|
-
});
|
|
128
|
-
} else if (msg.actionstate === 30 && msg.actionresult) {
|
|
129
|
-
const result = JSON.parse(msg.actionresult);
|
|
130
|
-
const choices = result.choices;
|
|
131
|
-
if (choices && choices.length > 0) {
|
|
132
|
-
aiChat.replaceMessage({
|
|
133
|
-
messageid: id,
|
|
134
|
-
state: msg.actionstate,
|
|
135
|
-
type: "DEFAULT",
|
|
136
|
-
role: "ASSISTANT",
|
|
137
|
-
content: choices[0].content || ""
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
} else if (msg.actionstate === 40) {
|
|
141
|
-
aiChat.replaceMessage({
|
|
142
|
-
messageid: id,
|
|
143
|
-
state: msg.actionstate,
|
|
144
|
-
type: "ERROR",
|
|
145
|
-
role: "ASSISTANT",
|
|
146
|
-
content: msg.actionresult
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
abortController,
|
|
151
|
-
ctx,
|
|
152
|
-
param,
|
|
153
|
-
{ ...questionRequestData }
|
|
154
|
-
);
|
|
155
|
-
} catch (error) {
|
|
156
|
-
aiChat.replaceMessage({
|
|
157
|
-
messageid: id,
|
|
158
|
-
state: 40,
|
|
159
|
-
type: "ERROR",
|
|
160
|
-
role: "ASSISTANT",
|
|
161
|
-
content: error.message || ibiz.i18n.t("app.aiError")
|
|
162
|
-
});
|
|
163
|
-
abortController == null ? void 0 : abortController.abort();
|
|
164
|
-
} finally {
|
|
165
|
-
aiChat.completeMessage(id, true);
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
abortQuestion: async (aiChat) => {
|
|
170
|
-
abortController == null ? void 0 : abortController.abort();
|
|
171
|
-
await aiChat.stopMessage({
|
|
172
|
-
messageid: id,
|
|
173
|
-
state: 30,
|
|
174
|
-
type: "DEFAULT",
|
|
175
|
-
role: "ASSISTANT",
|
|
176
|
-
content: ""
|
|
177
|
-
});
|
|
178
|
-
await aiChat.completeMessage(id, true);
|
|
179
|
-
},
|
|
180
84
|
action: (action, message) => {
|
|
181
85
|
if (action === "backfill") {
|
|
182
86
|
if (isEditing.value) {
|
|
@@ -185,126 +89,6 @@ function initCustomMenu(c, opts) {
|
|
|
185
89
|
emit("change", message.realcontent);
|
|
186
90
|
}
|
|
187
91
|
}
|
|
188
|
-
},
|
|
189
|
-
history: async (ctx, param, other) => {
|
|
190
|
-
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
191
|
-
const historyRequestData = {};
|
|
192
|
-
if (other.appendCurData) {
|
|
193
|
-
Object.assign(historyRequestData, {
|
|
194
|
-
...other.appendCurData
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
if (other.srfaiagent) {
|
|
198
|
-
Object.assign(historyRequestData, {
|
|
199
|
-
srfaiagent: other.srfaiagent
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
if (other.srfmode) {
|
|
203
|
-
Object.assign(historyRequestData, {
|
|
204
|
-
mode: other.srfmode
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
const result = await deService.aiChatHistory(
|
|
208
|
-
ctx,
|
|
209
|
-
param,
|
|
210
|
-
historyRequestData
|
|
211
|
-
);
|
|
212
|
-
if (result.data && Array.isArray(result.data)) {
|
|
213
|
-
let preMsg;
|
|
214
|
-
result.data.forEach((item) => {
|
|
215
|
-
if (item.role === "TOOL") {
|
|
216
|
-
if (preMsg && item.content) {
|
|
217
|
-
chatInstance.aiChat.updateRecommendPrompt(
|
|
218
|
-
preMsg,
|
|
219
|
-
item.content
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
} else {
|
|
223
|
-
const msg = {
|
|
224
|
-
messageid: qxUtil.createUUID(),
|
|
225
|
-
state: 30,
|
|
226
|
-
type: "DEFAULT",
|
|
227
|
-
role: item.role,
|
|
228
|
-
content: item.content,
|
|
229
|
-
completed: true
|
|
230
|
-
};
|
|
231
|
-
preMsg = msg;
|
|
232
|
-
chatInstance.aiChat.addMessage(msg);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
return true;
|
|
237
|
-
},
|
|
238
|
-
recommendPrompt: async (ctx, param, other) => {
|
|
239
|
-
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
240
|
-
const result = await deService.aiChatRecommendPrompt(
|
|
241
|
-
ctx,
|
|
242
|
-
param,
|
|
243
|
-
other.message
|
|
244
|
-
);
|
|
245
|
-
if (result.ok && result.data) {
|
|
246
|
-
const choices = result.data.choices;
|
|
247
|
-
if (choices && choices.length > 0) {
|
|
248
|
-
return choices[0];
|
|
249
|
-
}
|
|
250
|
-
return null;
|
|
251
|
-
}
|
|
252
|
-
return null;
|
|
253
|
-
},
|
|
254
|
-
uploader: {
|
|
255
|
-
onUpload: async (file, reportProgress, options) => {
|
|
256
|
-
const fileMeata = ibiz.util.file.calcFileUpDownUrl(
|
|
257
|
-
(options == null ? void 0 : options.context) || c.context,
|
|
258
|
-
(options == null ? void 0 : options.params) || c.params,
|
|
259
|
-
{}
|
|
260
|
-
);
|
|
261
|
-
const fielUploadHeaders = ibiz.util.file.getUploadHeaders();
|
|
262
|
-
const formData = new FormData();
|
|
263
|
-
formData.append("file", file);
|
|
264
|
-
const res = await ibiz.net.axios({
|
|
265
|
-
url: fileMeata.uploadUrl,
|
|
266
|
-
method: "post",
|
|
267
|
-
headers: fielUploadHeaders,
|
|
268
|
-
data: formData,
|
|
269
|
-
onUploadProgress: (progressEvent) => {
|
|
270
|
-
const percent = progressEvent.loaded / progressEvent.total * 100;
|
|
271
|
-
reportProgress(percent);
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
return res.data;
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
extendToolbarClick: async (event, source, context, params, data) => {
|
|
278
|
-
var _a, _b;
|
|
279
|
-
const result = await runtime.UIActionUtil.exec(
|
|
280
|
-
source.id,
|
|
281
|
-
{
|
|
282
|
-
view: c.view,
|
|
283
|
-
ctrl: c.ctrl,
|
|
284
|
-
context: core.IBizContext.create(context),
|
|
285
|
-
params,
|
|
286
|
-
data: [data],
|
|
287
|
-
event
|
|
288
|
-
},
|
|
289
|
-
source.appId
|
|
290
|
-
);
|
|
291
|
-
if (result.closeView) {
|
|
292
|
-
c.view.closeView({ ok: true });
|
|
293
|
-
} else if (result.refresh) {
|
|
294
|
-
switch (result.refreshMode) {
|
|
295
|
-
case 1:
|
|
296
|
-
c.view.callUIAction(runtime.SysUIActionTag.REFRESH);
|
|
297
|
-
break;
|
|
298
|
-
case 2:
|
|
299
|
-
(_a = c.view.parentView) == null ? void 0 : _a.callUIAction(runtime.SysUIActionTag.REFRESH);
|
|
300
|
-
break;
|
|
301
|
-
case 3:
|
|
302
|
-
(_b = c.view.getTopView()) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
|
|
303
|
-
break;
|
|
304
|
-
default:
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
return result;
|
|
308
92
|
}
|
|
309
93
|
}
|
|
310
94
|
});
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var lodashEs = require('lodash-es');
|
|
5
5
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
6
|
-
var runtime = require('@ibiz-template/runtime');
|
|
7
6
|
var core = require('@ibiz-template/core');
|
|
8
|
-
var qxUtil = require('qx-util');
|
|
9
7
|
require('./input.css');
|
|
10
8
|
|
|
11
9
|
"use strict";
|
|
@@ -166,24 +164,19 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
|
|
|
166
164
|
const appDataEntityId = c.model.appDataEntityId;
|
|
167
165
|
if (!appDataEntityId || !c.deACMode)
|
|
168
166
|
return;
|
|
169
|
-
const {
|
|
170
|
-
contentToolbarItems,
|
|
171
|
-
footerToolbarItems,
|
|
172
|
-
questionToolbarItems,
|
|
173
|
-
otherToolbarItems
|
|
174
|
-
} = ibiz.aiChatUtil.calcAiToolbarItemsByAc(c.deACMode);
|
|
175
|
-
const aiAgentlist = await ibiz.aiChatUtil.getAIAgentList(c.context, c.params, c.editorParams);
|
|
176
|
-
const {
|
|
177
|
-
containerOptions,
|
|
178
|
-
chatOptions
|
|
179
|
-
} = ibiz.aiChatUtil.getEditorExAIChatParams(c.editorParams, c.context, c.params, props.data);
|
|
180
167
|
const {
|
|
181
168
|
zIndex
|
|
182
169
|
} = vue3Util.useUIStore();
|
|
183
170
|
const containerZIndex = zIndex.increment();
|
|
184
171
|
chatInstance = await ibiz.aiChatUtil.getAIChat();
|
|
185
|
-
|
|
186
|
-
|
|
172
|
+
const {
|
|
173
|
+
containerOptions,
|
|
174
|
+
chatOptions
|
|
175
|
+
} = await ibiz.aiChatUtil.getEditorExAIChatParams(c.editorParams, c.context, c.params, props.data, c.deACMode, {
|
|
176
|
+
chatInstance,
|
|
177
|
+
view: c.view,
|
|
178
|
+
ctrl: c.ctrl
|
|
179
|
+
});
|
|
187
180
|
chatInstance.create({
|
|
188
181
|
containerOptions: {
|
|
189
182
|
zIndex: containerZIndex,
|
|
@@ -199,191 +192,10 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
|
|
|
199
192
|
srfactag: c.deACMode.codeName
|
|
200
193
|
},
|
|
201
194
|
appDataEntityId,
|
|
202
|
-
contentToolbarItems,
|
|
203
|
-
footerToolbarItems,
|
|
204
|
-
questionToolbarItems,
|
|
205
|
-
otherToolbarItems,
|
|
206
|
-
aiAgentlist,
|
|
207
195
|
...chatOptions,
|
|
208
|
-
question: async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode) => {
|
|
209
|
-
id = qxUtil.createUUID();
|
|
210
|
-
abortController = new AbortController();
|
|
211
|
-
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
212
|
-
try {
|
|
213
|
-
const questionRequestData = {
|
|
214
|
-
messages: arr,
|
|
215
|
-
sessionid
|
|
216
|
-
};
|
|
217
|
-
if (srfaiagent) {
|
|
218
|
-
questionRequestData.srfaiagent = srfaiagent;
|
|
219
|
-
}
|
|
220
|
-
if (srfmode) {
|
|
221
|
-
questionRequestData.mode = srfmode;
|
|
222
|
-
}
|
|
223
|
-
await deService.aiChatSse((msg) => {
|
|
224
|
-
if (msg.actionstate === 20 && msg.actionresult) {
|
|
225
|
-
aiChat.addMessage({
|
|
226
|
-
messageid: id,
|
|
227
|
-
state: msg.actionstate,
|
|
228
|
-
type: "DEFAULT",
|
|
229
|
-
role: "ASSISTANT",
|
|
230
|
-
content: msg.actionresult
|
|
231
|
-
});
|
|
232
|
-
} else if (msg.actionstate === 30 && msg.actionresult) {
|
|
233
|
-
const result = JSON.parse(msg.actionresult);
|
|
234
|
-
const choices = result.choices;
|
|
235
|
-
if (choices && choices.length > 0) {
|
|
236
|
-
aiChat.replaceMessage({
|
|
237
|
-
messageid: id,
|
|
238
|
-
state: msg.actionstate,
|
|
239
|
-
type: "DEFAULT",
|
|
240
|
-
role: "ASSISTANT",
|
|
241
|
-
content: choices[0].content || ""
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
} else if (msg.actionstate === 40) {
|
|
245
|
-
aiChat.replaceMessage({
|
|
246
|
-
messageid: id,
|
|
247
|
-
state: msg.actionstate,
|
|
248
|
-
type: "ERROR",
|
|
249
|
-
role: "ASSISTANT",
|
|
250
|
-
content: msg.actionresult
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
}, abortController, ctx, param, {
|
|
254
|
-
...questionRequestData
|
|
255
|
-
});
|
|
256
|
-
} catch (error) {
|
|
257
|
-
aiChat.replaceMessage({
|
|
258
|
-
messageid: id,
|
|
259
|
-
state: 40,
|
|
260
|
-
type: "ERROR",
|
|
261
|
-
role: "ASSISTANT",
|
|
262
|
-
content: error.message || ibiz.i18n.t("app.aiError")
|
|
263
|
-
});
|
|
264
|
-
abortController == null ? void 0 : abortController.abort();
|
|
265
|
-
} finally {
|
|
266
|
-
aiChat.completeMessage(id, true);
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
abortQuestion: async (aiChat) => {
|
|
271
|
-
abortController == null ? void 0 : abortController.abort();
|
|
272
|
-
await aiChat.stopMessage({
|
|
273
|
-
messageid: id,
|
|
274
|
-
state: 30,
|
|
275
|
-
type: "DEFAULT",
|
|
276
|
-
role: "ASSISTANT",
|
|
277
|
-
content: ""
|
|
278
|
-
});
|
|
279
|
-
await aiChat.completeMessage(id, true);
|
|
280
|
-
},
|
|
281
196
|
action: (action, message) => {
|
|
282
197
|
if (action === "backfill")
|
|
283
198
|
emit("change", message.realcontent);
|
|
284
|
-
},
|
|
285
|
-
history: async (ctx, param, other) => {
|
|
286
|
-
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
287
|
-
const historyRequestData = {};
|
|
288
|
-
if (other.appendCurData) {
|
|
289
|
-
Object.assign(historyRequestData, {
|
|
290
|
-
...other.appendCurData
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
if (other.srfaiagent) {
|
|
294
|
-
Object.assign(historyRequestData, {
|
|
295
|
-
srfaiagent: other.srfaiagent
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
if (other.srfmode) {
|
|
299
|
-
Object.assign(historyRequestData, {
|
|
300
|
-
mode: other.srfmode
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
const result = await deService.aiChatHistory(ctx, param, historyRequestData);
|
|
304
|
-
if (result.data && Array.isArray(result.data)) {
|
|
305
|
-
let preMsg;
|
|
306
|
-
result.data.forEach((item) => {
|
|
307
|
-
if (item.role === "TOOL") {
|
|
308
|
-
if (preMsg && item.content) {
|
|
309
|
-
chatInstance.aiChat.updateRecommendPrompt(preMsg, item.content);
|
|
310
|
-
}
|
|
311
|
-
} else {
|
|
312
|
-
const msg = {
|
|
313
|
-
messageid: qxUtil.createUUID(),
|
|
314
|
-
state: 30,
|
|
315
|
-
type: "DEFAULT",
|
|
316
|
-
role: item.role,
|
|
317
|
-
content: item.content,
|
|
318
|
-
completed: true
|
|
319
|
-
};
|
|
320
|
-
preMsg = msg;
|
|
321
|
-
chatInstance.aiChat.addMessage(msg);
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
return true;
|
|
326
|
-
},
|
|
327
|
-
recommendPrompt: async (ctx, param, other) => {
|
|
328
|
-
const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
|
|
329
|
-
const result = await deService.aiChatRecommendPrompt(ctx, param, other.message);
|
|
330
|
-
if (result.ok && result.data) {
|
|
331
|
-
const choices = result.data.choices;
|
|
332
|
-
if (choices && choices.length > 0) {
|
|
333
|
-
return choices[0];
|
|
334
|
-
}
|
|
335
|
-
return null;
|
|
336
|
-
}
|
|
337
|
-
return null;
|
|
338
|
-
},
|
|
339
|
-
uploader: {
|
|
340
|
-
onUpload: async (file, reportProgress, options) => {
|
|
341
|
-
const fileMeata = ibiz.util.file.calcFileUpDownUrl((options == null ? void 0 : options.context) || c.context, (options == null ? void 0 : options.params) || c.params, {});
|
|
342
|
-
const uploadHeaders = ibiz.util.file.getUploadHeaders();
|
|
343
|
-
const formData = new FormData();
|
|
344
|
-
formData.append("file", file);
|
|
345
|
-
const res = await ibiz.net.axios({
|
|
346
|
-
url: fileMeata.uploadUrl,
|
|
347
|
-
method: "post",
|
|
348
|
-
headers: uploadHeaders,
|
|
349
|
-
data: formData,
|
|
350
|
-
onUploadProgress: (progressEvent) => {
|
|
351
|
-
const percent = progressEvent.loaded / progressEvent.total * 100;
|
|
352
|
-
reportProgress(percent);
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
return res.data;
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
extendToolbarClick: async (event, source, context, params, data) => {
|
|
359
|
-
var _a, _b;
|
|
360
|
-
const result = await runtime.UIActionUtil.exec(source.id, {
|
|
361
|
-
view: c.view,
|
|
362
|
-
ctrl: c.ctrl,
|
|
363
|
-
context: core.IBizContext.create(context),
|
|
364
|
-
params,
|
|
365
|
-
data: [data],
|
|
366
|
-
event
|
|
367
|
-
}, source.appId);
|
|
368
|
-
if (result.closeView) {
|
|
369
|
-
c.view.closeView({
|
|
370
|
-
ok: true
|
|
371
|
-
});
|
|
372
|
-
} else if (result.refresh) {
|
|
373
|
-
switch (result.refreshMode) {
|
|
374
|
-
case 1:
|
|
375
|
-
c.view.callUIAction(runtime.SysUIActionTag.REFRESH);
|
|
376
|
-
break;
|
|
377
|
-
case 2:
|
|
378
|
-
(_a = c.view.parentView) == null ? void 0 : _a.callUIAction(runtime.SysUIActionTag.REFRESH);
|
|
379
|
-
break;
|
|
380
|
-
case 3:
|
|
381
|
-
(_b = c.view.getTopView()) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
|
|
382
|
-
break;
|
|
383
|
-
default:
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
return result;
|
|
387
199
|
}
|
|
388
200
|
}
|
|
389
201
|
});
|
package/lib/locale/en/index.cjs
CHANGED
|
@@ -486,7 +486,7 @@ var index = {
|
|
|
486
486
|
},
|
|
487
487
|
toolbar: {
|
|
488
488
|
exportExcel: {
|
|
489
|
-
exportAll: "Export all(Export up to
|
|
489
|
+
exportAll: "Export all(Export up to {maxRowCount} rows)",
|
|
490
490
|
expCurrentPage: "Export current page",
|
|
491
491
|
expCurrentSelect: "Export the current selection",
|
|
492
492
|
page: "Page",
|
|
@@ -852,6 +852,29 @@ var index = {
|
|
|
852
852
|
warningDesc: "Are you sure to terminate the creation?",
|
|
853
853
|
thinking: "In depth thinking",
|
|
854
854
|
thinked: "Deeply pondered"
|
|
855
|
+
},
|
|
856
|
+
aiChartUtil: {
|
|
857
|
+
feedback: "Feedback",
|
|
858
|
+
description: "Description",
|
|
859
|
+
regardingIssue: "Regarding the problem",
|
|
860
|
+
understandProblem: "Not understanding the problem",
|
|
861
|
+
forgotContext: "Forgot the previous text",
|
|
862
|
+
notFollowingRequire: "Not Following Requirements",
|
|
863
|
+
regardingResponse: "Regarding the effectiveness of the answer",
|
|
864
|
+
incorrectAswer: "Incorrect answer",
|
|
865
|
+
logicalConfusion: "Logical confusion",
|
|
866
|
+
poorTimeliness: "Poor timeliness",
|
|
867
|
+
poorReadability: "Poor readability",
|
|
868
|
+
incompleteAnswer: "Incomplete answer",
|
|
869
|
+
unprofessional: "The answer is vague and unprofessional",
|
|
870
|
+
report: "Report",
|
|
871
|
+
pornographicVulgar: "Pornographic Vulgar",
|
|
872
|
+
politicallySensitive: "Politically sensitive",
|
|
873
|
+
illegalCriminal: "Illegal crime",
|
|
874
|
+
discriminationPrejudice: "Discrimination or Prejudice Answer",
|
|
875
|
+
violationPrivacy: "Violation of Privacy",
|
|
876
|
+
contentInfringement: "Content infringement",
|
|
877
|
+
placeholder: "Please enter"
|
|
855
878
|
}
|
|
856
879
|
},
|
|
857
880
|
// runTime
|
|
@@ -482,7 +482,7 @@ var index = {
|
|
|
482
482
|
},
|
|
483
483
|
toolbar: {
|
|
484
484
|
exportExcel: {
|
|
485
|
-
exportAll: "\u5BFC\u51FA\u5168\u90E8(\u6700\u5927\u5BFC\
|
|
485
|
+
exportAll: "\u5BFC\u51FA\u5168\u90E8(\u6700\u5927\u5BFC\u51FA{maxRowCount}\u884C)",
|
|
486
486
|
expCurrentPage: "\u5BFC\u51FA\u5F53\u524D\u9875",
|
|
487
487
|
expCurrentSelect: "\u5BFC\u51FA\u5F53\u524D\u9009\u4E2D",
|
|
488
488
|
page: "\u9875",
|
|
@@ -848,6 +848,29 @@ var index = {
|
|
|
848
848
|
warningDesc: "\u786E\u8BA4\u4E2D\u6B62\u521B\u4F5C\u5417\uFF1F",
|
|
849
849
|
thinking: "\u6DF1\u5EA6\u601D\u8003\u4E2D",
|
|
850
850
|
thinked: "\u5DF2\u6DF1\u5EA6\u601D\u8003"
|
|
851
|
+
},
|
|
852
|
+
aiChartUtil: {
|
|
853
|
+
feedback: "\u53CD\u9988",
|
|
854
|
+
description: "\u63CF\u8FF0",
|
|
855
|
+
regardingIssue: "\u9488\u5BF9\u95EE\u9898",
|
|
856
|
+
understandProblem: "\u4E0D\u7406\u89E3\u95EE\u9898",
|
|
857
|
+
forgotContext: "\u9057\u5FD8\u4E86\u4E0A\u6587",
|
|
858
|
+
notFollowingRequire: "\u4E0D\u9075\u5FAA\u8981\u6C42",
|
|
859
|
+
regardingResponse: "\u9488\u5BF9\u56DE\u7B54\u6548\u679C",
|
|
860
|
+
incorrectAswer: "\u56DE\u7B54\u9519\u8BEF",
|
|
861
|
+
logicalConfusion: "\u903B\u8F91\u6DF7\u4E71",
|
|
862
|
+
poorTimeliness: "\u65F6\u6548\u6027\u5DEE",
|
|
863
|
+
poorReadability: "\u53EF\u8BFB\u6027\u5DEE",
|
|
864
|
+
incompleteAnswer: "\u56DE\u7B54\u4E0D\u5B8C\u6574",
|
|
865
|
+
unprofessional: "\u56DE\u7B54\u7B3C\u7EDF\u4E0D\u4E13\u4E1A",
|
|
866
|
+
report: "\u4E3E\u62A5",
|
|
867
|
+
pornographicVulgar: "\u8272\u60C5\u4F4E\u4FD7",
|
|
868
|
+
politicallySensitive: "\u653F\u6CBB\u654F\u611F",
|
|
869
|
+
illegalCriminal: "\u8FDD\u6CD5\u72AF\u7F6A",
|
|
870
|
+
discriminationPrejudice: "\u6B67\u89C6\u6216\u504F\u89C1\u56DE\u7B54",
|
|
871
|
+
violationPrivacy: "\u4FB5\u72AF\u9690\u79C1",
|
|
872
|
+
contentInfringement: "\u5185\u5BB9\u4FB5\u6743",
|
|
873
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
851
874
|
}
|
|
852
875
|
},
|
|
853
876
|
// runTime
|
|
@@ -89,7 +89,6 @@ const PanelAppTitle = /* @__PURE__ */ vue.defineComponent({
|
|
|
89
89
|
render() {
|
|
90
90
|
const {
|
|
91
91
|
icon,
|
|
92
|
-
isSvg,
|
|
93
92
|
caption,
|
|
94
93
|
caption2,
|
|
95
94
|
subCaption,
|
|
@@ -106,22 +105,14 @@ const PanelAppTitle = /* @__PURE__ */ vue.defineComponent({
|
|
|
106
105
|
if (this.menuAlign === "LEFT") {
|
|
107
106
|
if (this.isCollapse) {
|
|
108
107
|
if (icon) {
|
|
109
|
-
let tempIcon = null;
|
|
110
|
-
if (isSvg) {
|
|
111
|
-
tempIcon = vue.createVNode("ion-icon", {
|
|
112
|
-
"class": this.ns.e("logo"),
|
|
113
|
-
"icon": icon
|
|
114
|
-
}, null);
|
|
115
|
-
} else {
|
|
116
|
-
tempIcon = vue.createVNode("span", {
|
|
117
|
-
"class": this.ns.e("logo")
|
|
118
|
-
}, [vue.createVNode("img", {
|
|
119
|
-
"src": icon
|
|
120
|
-
}, null)]);
|
|
121
|
-
}
|
|
122
108
|
iconVNode = vue.createVNode("div", {
|
|
123
109
|
"class": this.ns.e("collpase-icon")
|
|
124
|
-
}, [
|
|
110
|
+
}, [vue.createVNode(vue.resolveComponent("iBizIcon"), {
|
|
111
|
+
"class": this.ns.e("logo"),
|
|
112
|
+
"icon": {
|
|
113
|
+
rawContent: icon
|
|
114
|
+
}
|
|
115
|
+
}, null)]);
|
|
125
116
|
} else {
|
|
126
117
|
iconVNode = vue.createVNode("div", {
|
|
127
118
|
"class": this.ns.e("collapse-title")
|
|
@@ -132,19 +123,6 @@ const PanelAppTitle = /* @__PURE__ */ vue.defineComponent({
|
|
|
132
123
|
}, [subCaption2])]);
|
|
133
124
|
}
|
|
134
125
|
} else if (this.showIcon && icon) {
|
|
135
|
-
let tempIcon = null;
|
|
136
|
-
if (isSvg) {
|
|
137
|
-
tempIcon = vue.createVNode("ion-icon", {
|
|
138
|
-
"class": this.ns.em("logo", "expand"),
|
|
139
|
-
"icon": icon
|
|
140
|
-
}, null);
|
|
141
|
-
} else {
|
|
142
|
-
tempIcon = vue.createVNode("span", {
|
|
143
|
-
"class": this.ns.em("logo", "expand")
|
|
144
|
-
}, [vue.createVNode("img", {
|
|
145
|
-
"src": icon
|
|
146
|
-
}, null)]);
|
|
147
|
-
}
|
|
148
126
|
let tempContent = vue.createVNode("g", {
|
|
149
127
|
"id": "app-caption-panel",
|
|
150
128
|
"stroke": "none",
|
|
@@ -185,7 +163,12 @@ const PanelAppTitle = /* @__PURE__ */ vue.defineComponent({
|
|
|
185
163
|
}
|
|
186
164
|
iconVNode = vue.createVNode("span", {
|
|
187
165
|
"class": this.ns.e("logo")
|
|
188
|
-
}, [
|
|
166
|
+
}, [vue.createVNode(vue.resolveComponent("iBizIcon"), {
|
|
167
|
+
"class": this.ns.em("logo", "expand"),
|
|
168
|
+
"icon": {
|
|
169
|
+
rawContent: icon
|
|
170
|
+
}
|
|
171
|
+
}, null), vue.createVNode("svg", {
|
|
189
172
|
"width": "166px",
|
|
190
173
|
"height": "80px",
|
|
191
174
|
"viewBox": "0 0 166 90",
|
|
@@ -224,18 +207,12 @@ const PanelAppTitle = /* @__PURE__ */ vue.defineComponent({
|
|
|
224
207
|
}
|
|
225
208
|
} else if (this.menuAlign === "TOP") {
|
|
226
209
|
if (icon) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
iconVNode = vue.createVNode("span", {
|
|
234
|
-
"class": this.ns.e("logo")
|
|
235
|
-
}, [vue.createVNode("img", {
|
|
236
|
-
"src": icon
|
|
237
|
-
}, null)]);
|
|
238
|
-
}
|
|
210
|
+
iconVNode = vue.createVNode(vue.resolveComponent("iBizIcon"), {
|
|
211
|
+
"class": this.ns.e("logo"),
|
|
212
|
+
"icon": {
|
|
213
|
+
rawContent: icon
|
|
214
|
+
}
|
|
215
|
+
}, null);
|
|
239
216
|
}
|
|
240
217
|
}
|
|
241
218
|
if (this.menuAlign === "LEFT") {
|