@ibiz-template/vue3-components 0.7.41-alpha.50 → 0.7.41-alpha.52

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.
Files changed (38) hide show
  1. package/dist/chart-B_uQaEfA.js +1 -0
  2. package/dist/{index-CXRnZZS2.js → index-DFvp2f5r.js} +4 -4
  3. package/dist/index.min.css +1 -1
  4. package/dist/index.system.min.js +1 -1
  5. package/dist/{wang-editor-9WDOiHof.js → wang-editor-BbR16ZTX.js} +1 -1
  6. package/dist/{xlsx-util-CgGjW9-u.js → xlsx-util-BkJoKKKt.js} +1 -1
  7. package/es/control/chart/chart.mjs +1 -0
  8. package/es/control/drtab/drtab-control.util.mjs +1 -1
  9. package/es/control/form/form-detail/form-button/form-button.css +1 -1
  10. package/es/control/form/form-detail/form-button/form-button.mjs +1 -1
  11. package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.mjs +10 -1
  12. package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
  13. package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.mjs +3 -2
  14. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.mjs +2 -1
  15. package/es/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.mjs +2 -4
  16. package/es/util/ai-chat-util/ai-chat-util.mjs +66 -30
  17. package/es/util/fullscreen/fullscreen-util.mjs +1 -1
  18. package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.mjs +29 -16
  19. package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.mjs +10 -11
  20. package/es/web-app/router/index.mjs +181 -95
  21. package/lib/control/chart/chart.cjs +1 -0
  22. package/lib/control/drtab/drtab-control.util.cjs +1 -1
  23. package/lib/control/form/form-detail/form-button/form-button.cjs +1 -1
  24. package/lib/control/form/form-detail/form-button/form-button.css +1 -1
  25. package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.cjs +3 -2
  26. package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.cjs +10 -1
  27. package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
  28. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.cjs +2 -1
  29. package/lib/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.cjs +2 -4
  30. package/lib/util/ai-chat-util/ai-chat-util.cjs +66 -30
  31. package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
  32. package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.cjs +10 -11
  33. package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.cjs +28 -15
  34. package/lib/web-app/router/index.cjs +181 -95
  35. package/package.json +6 -6
  36. package/dist/chart-pMMcGXRE.js +0 -1
  37. /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.52_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.53_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
  38. /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.52_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.53_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
@@ -81,12 +81,9 @@ class AIChatUtil {
81
81
  if (editorParams.srfaiagent) {
82
82
  chatOptions.activeAIAgentID = editorParams.srfaiagent;
83
83
  }
84
- const aiAgentlist = await this.getAIAgentList(
85
- context,
86
- params,
87
- editorParams
88
- );
89
- chatOptions.aiAgentlist = aiAgentlist;
84
+ chatOptions.fetchAgentList = () => {
85
+ return this.getAIAgentList(context, params, editorParams);
86
+ };
90
87
  if (deACMode) {
91
88
  const {
92
89
  contentToolbarItems,
@@ -183,7 +180,8 @@ class AIChatUtil {
183
180
  state: msg.actionstate,
184
181
  type: "DEFAULT",
185
182
  role: "ASSISTANT",
186
- content: msg.actionresult
183
+ content: msg.actionresult,
184
+ status: "pending"
187
185
  });
188
186
  } else if (msg.actionstate === 30 && msg.actionresult) {
189
187
  const result = JSON.parse(msg.actionresult);
@@ -195,7 +193,8 @@ class AIChatUtil {
195
193
  type: "DEFAULT",
196
194
  role: "ASSISTANT",
197
195
  content: choices[0].content || "",
198
- realmessageid: choices[0].messageid
196
+ realmessageid: choices[0].messageid,
197
+ status: "sent"
199
198
  });
200
199
  }
201
200
  } else if (msg.actionstate === 40) {
@@ -204,7 +203,8 @@ class AIChatUtil {
204
203
  state: msg.actionstate,
205
204
  type: "ERROR",
206
205
  role: "ASSISTANT",
207
- content: msg.actionresult
206
+ content: msg.actionresult,
207
+ status: "failed"
208
208
  });
209
209
  }
210
210
  },
@@ -219,7 +219,8 @@ class AIChatUtil {
219
219
  state: 40,
220
220
  type: "ERROR",
221
221
  role: "ASSISTANT",
222
- content: error.message || ibiz.i18n.t("app.aiError")
222
+ content: error.message || ibiz.i18n.t("app.aiError"),
223
+ status: "failed"
223
224
  });
224
225
  abortController == null ? void 0 : abortController.abort();
225
226
  } finally {
@@ -249,7 +250,8 @@ class AIChatUtil {
249
250
  state: 30,
250
251
  type: "DEFAULT",
251
252
  role: "ASSISTANT",
252
- content: ""
253
+ content: "",
254
+ status: "canceled"
253
255
  });
254
256
  await aiChat.completeMessage(id, true);
255
257
  };
@@ -298,18 +300,32 @@ class AIChatUtil {
298
300
  }
299
301
  };
300
302
  chatOptions.extendToolbarClick = async (event, source, context2, params2, data2) => {
301
- var _a, _b;
303
+ var _a, _b, _c;
304
+ const { id: id2, isPluginApp } = source;
305
+ let appId = source.appId;
306
+ const tempContext = core.IBizContext.create(context2);
307
+ if (isPluginApp) {
308
+ const mainApp = ibiz.hub.getApp();
309
+ const targetApp = (_a = mainApp.model.subAppRefs) == null ? void 0 : _a.find(
310
+ (subAppRef) => subAppRef.appId.endsWith("__".concat(appId))
311
+ );
312
+ if (targetApp) {
313
+ const targetAppId = targetApp.appId;
314
+ tempContext.srfappid = targetAppId;
315
+ appId = targetAppId;
316
+ }
317
+ }
302
318
  const result = await runtime.UIActionUtil.exec(
303
- source.id,
319
+ id2,
304
320
  {
305
321
  view,
306
322
  ctrl,
307
- context: core.IBizContext.create(context2),
323
+ context: tempContext,
308
324
  params: params2,
309
325
  data: [data2],
310
326
  event
311
327
  },
312
- source.appId
328
+ appId
313
329
  );
314
330
  if (result.closeView) {
315
331
  view.closeView({ ok: true });
@@ -319,10 +335,10 @@ class AIChatUtil {
319
335
  view.callUIAction(runtime.SysUIActionTag.REFRESH);
320
336
  break;
321
337
  case 2:
322
- (_a = view.parentView) == null ? void 0 : _a.callUIAction(runtime.SysUIActionTag.REFRESH);
338
+ (_b = view.parentView) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
323
339
  break;
324
340
  case 3:
325
- (_b = view.getTopView()) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
341
+ (_c = view.getTopView()) == null ? void 0 : _c.callUIAction(runtime.SysUIActionTag.REFRESH);
326
342
  break;
327
343
  default:
328
344
  }
@@ -445,8 +461,9 @@ class AIChatUtil {
445
461
  delete params.srfenableaiagentchange;
446
462
  }
447
463
  chatOptions.enableAIAgentChange = enableAIAgentChange;
448
- const aiAgentlist = await this.getAIAgentList(context, params);
449
- chatOptions.aiAgentlist = aiAgentlist;
464
+ chatOptions.fetchAgentList = () => {
465
+ return this.getAIAgentList(context, params);
466
+ };
450
467
  if (deACMode) {
451
468
  const {
452
469
  contentToolbarItems,
@@ -541,7 +558,8 @@ class AIChatUtil {
541
558
  state: msg.actionstate,
542
559
  type: "DEFAULT",
543
560
  role: "ASSISTANT",
544
- content: msg.actionresult
561
+ content: msg.actionresult,
562
+ status: "pending"
545
563
  });
546
564
  } else if (msg.actionstate === 30 && msg.actionresult) {
547
565
  const result = JSON.parse(msg.actionresult);
@@ -553,7 +571,8 @@ class AIChatUtil {
553
571
  type: "DEFAULT",
554
572
  role: "ASSISTANT",
555
573
  content: choices[0].content || "",
556
- realmessageid: choices[0].messageid
574
+ realmessageid: choices[0].messageid,
575
+ status: "sent"
557
576
  });
558
577
  }
559
578
  } else if (msg.actionstate === 40) {
@@ -562,7 +581,8 @@ class AIChatUtil {
562
581
  state: msg.actionstate,
563
582
  type: "ERROR",
564
583
  role: "ASSISTANT",
565
- content: msg.actionresult
584
+ content: msg.actionresult,
585
+ status: "failed"
566
586
  });
567
587
  }
568
588
  },
@@ -577,7 +597,8 @@ class AIChatUtil {
577
597
  state: 40,
578
598
  type: "ERROR",
579
599
  role: "ASSISTANT",
580
- content: error.message || ibiz.i18n.t("app.aiError")
600
+ content: error.message || ibiz.i18n.t("app.aiError"),
601
+ status: "failed"
581
602
  });
582
603
  abortController == null ? void 0 : abortController.abort();
583
604
  } finally {
@@ -607,7 +628,8 @@ class AIChatUtil {
607
628
  state: 30,
608
629
  type: "DEFAULT",
609
630
  role: "ASSISTANT",
610
- content: ""
631
+ content: "",
632
+ status: "canceled"
611
633
  });
612
634
  await aiChat.completeMessage(id, true);
613
635
  };
@@ -656,18 +678,32 @@ class AIChatUtil {
656
678
  }
657
679
  };
658
680
  chatOptions.extendToolbarClick = async (event, source, context2, params2, data2) => {
659
- var _a, _b;
681
+ var _a, _b, _c;
682
+ const { id: id2, isPluginApp } = source;
683
+ let appId = source.appId;
684
+ const tempContext = core.IBizContext.create(context2);
685
+ if (isPluginApp) {
686
+ const mainApp = ibiz.hub.getApp();
687
+ const targetApp = (_a = mainApp.model.subAppRefs) == null ? void 0 : _a.find(
688
+ (subAppRef) => subAppRef.appId.endsWith("__".concat(appId))
689
+ );
690
+ if (targetApp) {
691
+ const targetAppId = targetApp.appId;
692
+ tempContext.srfappid = targetAppId;
693
+ appId = targetAppId;
694
+ }
695
+ }
660
696
  const result = await runtime.UIActionUtil.exec(
661
- source.id,
697
+ id2,
662
698
  {
663
699
  view,
664
700
  ctrl,
665
- context: core.IBizContext.create(context2),
701
+ context: tempContext,
666
702
  params: params2,
667
703
  data: [data2],
668
704
  event
669
705
  },
670
- source.appId
706
+ appId
671
707
  );
672
708
  if (result.closeView) {
673
709
  view.closeView({ ok: true });
@@ -677,10 +713,10 @@ class AIChatUtil {
677
713
  view.callUIAction(runtime.SysUIActionTag.REFRESH);
678
714
  break;
679
715
  case 2:
680
- (_a = view.parentView) == null ? void 0 : _a.callUIAction(runtime.SysUIActionTag.REFRESH);
716
+ (_b = view.parentView) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
681
717
  break;
682
718
  case 3:
683
- (_b = view.getTopView()) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
719
+ (_c = view.getTopView()) == null ? void 0 : _c.callUIAction(runtime.SysUIActionTag.REFRESH);
684
720
  break;
685
721
  default:
686
722
  }
@@ -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.52_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
+ var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.53_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";
@@ -98,22 +98,21 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
98
98
  textareaRef
99
99
  }, message);
100
100
  const {
101
+ stopAsk,
101
102
  syncAskAI,
102
103
  asyncAskAI,
103
104
  parseContent,
104
- loadAiHistory,
105
- abortController
105
+ loadAiHistory
106
106
  } = inlineAiTextarea_hook.useAI(props, {
107
107
  srfmode,
108
108
  srfaiagent,
109
109
  srfaiappendcurdata
110
110
  });
111
- inlineAiTextarea_hook.useInLineAIContainerClick(props, message, isLoading, abortController);
112
- const stopQuestionAndClose = () => {
113
- var _a;
114
- (_a = abortController.value) == null ? void 0 : _a.abort();
115
- props.unMountAIChat();
116
- };
111
+ inlineAiTextarea_hook.useInLineAIContainerClick(props, {
112
+ message,
113
+ isLoading,
114
+ stopAsk
115
+ });
117
116
  const handleAnswer = (answer) => {
118
117
  switch (answer.state) {
119
118
  case 20:
@@ -255,12 +254,12 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
255
254
  containerRef,
256
255
  contentStyle,
257
256
  containerStyle,
257
+ stopAsk,
258
258
  onKeydown,
259
259
  renderError,
260
260
  sendQuestion,
261
261
  handleAction,
262
- renderLoading,
263
- stopQuestionAndClose
262
+ renderLoading
264
263
  };
265
264
  },
266
265
  render() {
@@ -298,7 +297,7 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
298
297
  "class": this.ns.em("content", "suffix")
299
298
  }, [this.isLoading && vue.createVNode("div", {
300
299
  "class": this.ns.em("content", "stop-icon"),
301
- "onClick": () => this.stopQuestionAndClose()
300
+ "onClick": () => this.stopAsk()
302
301
  }, [icon.StopIcon, vue.createVNode("span", null, [ibiz.i18n.t("util.inlineAiUtil.stopEdit")])]), !this.disabled && vue.createVNode("div", {
303
302
  "class": this.ns.em("content", "sand-icon"),
304
303
  "onClick": () => this.sendQuestion(this.message.content)
@@ -26,9 +26,9 @@ const computedInLineAIParams = (props) => {
26
26
  inlinecompletionmode: (_g = (_f = params.inlinecompletionmode) != null ? _f : editorParams.inlinecompletionmode) != null ? _g : "async"
27
27
  };
28
28
  };
29
- const useInLineAIContainerClick = (props, message, isLoading, abortController) => {
29
+ const useInLineAIContainerClick = (props, opts) => {
30
+ const { message, isLoading, stopAsk } = opts;
30
31
  const handMousedown = async (evt) => {
31
- var _a;
32
32
  const target = evt.target;
33
33
  if (!target.closest(".ibiz-inline-ai-textarea-container") && !target.closest(".ibiz-inline-ai-alert")) {
34
34
  const isChange = props.content !== message.value.content;
@@ -42,12 +42,8 @@ const useInLineAIContainerClick = (props, message, isLoading, abortController) =
42
42
  }
43
43
  });
44
44
  }
45
- if (isClose) {
46
- if (isLoading.value) {
47
- (_a = abortController.value) == null ? void 0 : _a.abort();
48
- }
49
- props.unMountAIChat();
50
- }
45
+ if (isClose)
46
+ await stopAsk();
51
47
  }
52
48
  };
53
49
  vue.onMounted(() => {
@@ -95,7 +91,6 @@ const useAI = (props, opts) => {
95
91
  );
96
92
  }
97
93
  };
98
- const abortController = vue.ref();
99
94
  const attachUrlParam = (url) => {
100
95
  {
101
96
  const urlSplit = url.split("?");
@@ -174,6 +169,8 @@ const useAI = (props, opts) => {
174
169
  }
175
170
  return { think, content, toolcalls };
176
171
  };
172
+ let asyncacitonid;
173
+ const abortController = vue.ref();
177
174
  const asyncAskAI = (question, callBack, errorBack) => {
178
175
  return new Promise((resolve) => {
179
176
  abortController.value = new AbortController();
@@ -189,6 +186,8 @@ const useAI = (props, opts) => {
189
186
  if (e.data) {
190
187
  const msg = JSON.parse(e.data);
191
188
  let content = msg.actionresult || "";
189
+ if (msg.actionstate === 20)
190
+ asyncacitonid = msg.asyncacitonid;
192
191
  if (msg.actionstate === 30 && content)
193
192
  content = (_a = JSON.parse(content).choices) == null ? void 0 : _a[0].content;
194
193
  callBack({ state: msg.actionstate, content });
@@ -235,12 +234,28 @@ const useAI = (props, opts) => {
235
234
  return answer;
236
235
  }
237
236
  };
237
+ const stopAsk = async () => {
238
+ var _a;
239
+ (_a = abortController.value) == null ? void 0 : _a.abort();
240
+ if (asyncacitonid) {
241
+ const deService = await app.deService.getService(
242
+ context,
243
+ deACMode.appDataEntityId
244
+ );
245
+ await deService.aiChatCancel(context, params, {
246
+ asyncacitonid,
247
+ sessionid
248
+ });
249
+ asyncacitonid = void 0;
250
+ }
251
+ props.unMountAIChat();
252
+ };
238
253
  return {
254
+ stopAsk,
239
255
  syncAskAI,
240
256
  asyncAskAI,
241
257
  parseContent,
242
- loadAiHistory,
243
- abortController
258
+ loadAiHistory
244
259
  };
245
260
  };
246
261
  const useBase = (props, element, message) => {
@@ -297,11 +312,8 @@ const useBase = (props, element, message) => {
297
312
  height: options.height ? "".concat(options.height, "px") : "auto",
298
313
  "max-height": "".concat(options.maxHeight || (options.height && options.height > 300 ? options.height : 300), "px")
299
314
  });
300
- const toolcalls = vue.computed(() => {
301
- return message.value.toolcalls || [];
302
- });
303
315
  vue.watch(
304
- () => [toolcalls.value.length, message.value.think, message.value.content],
316
+ () => message.value,
305
317
  () => {
306
318
  vue.nextTick(() => {
307
319
  if (!textareaRef.value)
@@ -312,6 +324,7 @@ const useBase = (props, element, message) => {
312
324
  });
313
325
  },
314
326
  {
327
+ deep: true,
315
328
  immediate: true
316
329
  }
317
330
  );