@ibiz-template/vue3-components 0.7.41-alpha.43 → 0.7.41-alpha.45

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 (74) hide show
  1. package/dist/ibiz-markdown-editor-C7wR017-.js +1 -0
  2. package/dist/{index-CG3sQH0b.js → index-DgqTP4Vw.js} +1 -1
  3. package/dist/{index-kZrZndeH.js → index-Dr0VM8iS.js} +1 -1
  4. package/dist/index-yLzheFmH.js +11 -0
  5. package/dist/index.min.css +1 -1
  6. package/dist/index.system.min.js +1 -1
  7. package/dist/wang-editor-homqxACE.js +1 -0
  8. package/dist/{xlsx-util-8YSXhmdI.js → xlsx-util-C5MBICNN.js} +1 -1
  9. package/es/control/grid/grid-column/grid-field-column/attachment-column/attachment-column.mjs +2 -1
  10. package/es/control/grid/grid-column/grid-field-column/attachment-column/file-util.mjs +22 -11
  11. package/es/editor/carousel/ibiz-carousel/ibiz-carousel.mjs +5 -2
  12. package/es/editor/code/monaco-editor/monaco-editor.mjs +2 -0
  13. package/es/editor/html/wang-editor/wang-editor.mjs +15 -6
  14. package/es/editor/markdown/ibiz-markdown-editor/custom-menu.mjs +5 -0
  15. package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
  16. package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +23 -12
  17. package/es/editor/text-box/input/input.mjs +2 -0
  18. package/es/editor/text-box/signature/signature.mjs +28 -15
  19. package/es/editor/upload/upload-editor.controller.mjs +12 -1
  20. package/es/editor/upload/use/use-iview-upload.mjs +28 -13
  21. package/es/locale/en/index.mjs +5 -1
  22. package/es/locale/zh-CN/index.mjs +5 -1
  23. package/es/panel-component/coop-pos/coop-pos.controller.mjs +11 -1
  24. package/es/panel-component/panel-app-title/panel-app-title.controller.mjs +3 -1
  25. package/es/panel-component/panel-app-title/panel-app-title.mjs +4 -2
  26. package/es/util/ai-chat-util/ai-chat-util.mjs +70 -35
  27. package/es/util/app-util/app-util.mjs +2 -1
  28. package/es/util/inline-ai-util/inline-ai-textarea/common/ai-think/ai-think.css +1 -0
  29. package/es/util/inline-ai-util/inline-ai-textarea/common/ai-think/ai-think.mjs +56 -0
  30. package/es/util/inline-ai-util/inline-ai-textarea/common/ai-tool-call/ai-tool-call.css +1 -0
  31. package/es/util/inline-ai-util/inline-ai-textarea/common/ai-tool-call/ai-tool-call.mjs +52 -0
  32. package/es/util/inline-ai-util/inline-ai-textarea/common/ai-tool-call-item/ai-tool-call-item.css +1 -0
  33. package/es/util/inline-ai-util/inline-ai-textarea/common/ai-tool-call-item/ai-tool-call-item.mjs +143 -0
  34. package/es/util/inline-ai-util/inline-ai-textarea/common/index.mjs +4 -0
  35. package/es/util/inline-ai-util/inline-ai-textarea/icon.mjs +52 -1
  36. package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
  37. package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.mjs +29 -3
  38. package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.mjs +32 -25
  39. package/es/util/inline-ai-util/inline-ai-textarea/interface.mjs +1 -0
  40. package/lib/control/grid/grid-column/grid-field-column/attachment-column/attachment-column.cjs +2 -1
  41. package/lib/control/grid/grid-column/grid-field-column/attachment-column/file-util.cjs +22 -11
  42. package/lib/editor/carousel/ibiz-carousel/ibiz-carousel.cjs +5 -2
  43. package/lib/editor/code/monaco-editor/monaco-editor.cjs +2 -0
  44. package/lib/editor/html/wang-editor/wang-editor.cjs +15 -6
  45. package/lib/editor/markdown/ibiz-markdown-editor/custom-menu.cjs +5 -0
  46. package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +23 -12
  47. package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
  48. package/lib/editor/text-box/input/input.cjs +2 -0
  49. package/lib/editor/text-box/signature/signature.cjs +28 -15
  50. package/lib/editor/upload/upload-editor.controller.cjs +12 -1
  51. package/lib/editor/upload/use/use-iview-upload.cjs +28 -13
  52. package/lib/locale/en/index.cjs +5 -1
  53. package/lib/locale/zh-CN/index.cjs +5 -1
  54. package/lib/panel-component/coop-pos/coop-pos.controller.cjs +11 -1
  55. package/lib/panel-component/panel-app-title/panel-app-title.cjs +4 -2
  56. package/lib/panel-component/panel-app-title/panel-app-title.controller.cjs +3 -1
  57. package/lib/util/ai-chat-util/ai-chat-util.cjs +70 -35
  58. package/lib/util/app-util/app-util.cjs +2 -1
  59. package/lib/util/inline-ai-util/inline-ai-textarea/common/ai-think/ai-think.cjs +58 -0
  60. package/lib/util/inline-ai-util/inline-ai-textarea/common/ai-think/ai-think.css +1 -0
  61. package/lib/util/inline-ai-util/inline-ai-textarea/common/ai-tool-call/ai-tool-call.cjs +54 -0
  62. package/lib/util/inline-ai-util/inline-ai-textarea/common/ai-tool-call/ai-tool-call.css +1 -0
  63. package/lib/util/inline-ai-util/inline-ai-textarea/common/ai-tool-call-item/ai-tool-call-item.cjs +145 -0
  64. package/lib/util/inline-ai-util/inline-ai-textarea/common/ai-tool-call-item/ai-tool-call-item.css +1 -0
  65. package/lib/util/inline-ai-util/inline-ai-textarea/common/index.cjs +9 -0
  66. package/lib/util/inline-ai-util/inline-ai-textarea/icon.cjs +54 -0
  67. package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.cjs +31 -24
  68. package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
  69. package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.cjs +29 -3
  70. package/lib/util/inline-ai-util/inline-ai-textarea/interface.cjs +3 -0
  71. package/package.json +5 -5
  72. package/dist/ibiz-markdown-editor-DJ662N4_.js +0 -1
  73. package/dist/index-D3x_MFr-.js +0 -11
  74. package/dist/wang-editor-DDSO3Ha9.js +0 -1
@@ -13,6 +13,7 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
13
13
  setup(props, {
14
14
  emit
15
15
  }) {
16
+ var _a;
16
17
  const ns = vue3Util.useNamespace("signature");
17
18
  const c = props.controller;
18
19
  const editorModel = c.model;
@@ -25,6 +26,7 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
25
26
  const fullScreen = vue.ref(false);
26
27
  const currentDataURL = vue.ref("");
27
28
  const currentVal = vue.ref("");
29
+ let enableNoAccess = ((_a = c == null ? void 0 : c.editorParams) == null ? void 0 : _a.enablenoaccess) === "true";
28
30
  let saveMode = "img";
29
31
  let buttons = [{
30
32
  label: ibiz.i18n.t("editor.signature.undo"),
@@ -48,6 +50,9 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
48
50
  ibiz.log.error(error);
49
51
  }
50
52
  }
53
+ if (editorModel.editorParams.enablenoaccess) {
54
+ enableNoAccess = editorModel.editorParams.enablenoaccess === "true";
55
+ }
51
56
  }
52
57
  const showFormDefaultContent = vue.computed(() => {
53
58
  if (props.controlParams && props.controlParams.editmode === "hover" && !props.readonly) {
@@ -56,12 +61,12 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
56
61
  return false;
57
62
  });
58
63
  const restCavans = () => {
59
- var _a;
60
- (_a = signatureRef.value) == null ? void 0 : _a.updateSignaturePad(() => {
64
+ var _a2;
65
+ (_a2 = signatureRef.value) == null ? void 0 : _a2.updateSignaturePad(() => {
61
66
  vue.nextTick(() => {
62
- var _a2, _b;
67
+ var _a3, _b;
63
68
  if (currentDataURL.value) {
64
- (_a2 = signatureRef.value) == null ? void 0 : _a2.signaturePad.fromDataURL(currentDataURL.value);
69
+ (_a3 = signatureRef.value) == null ? void 0 : _a3.signaturePad.fromDataURL(currentDataURL.value);
65
70
  } else {
66
71
  (_b = signatureRef.value) == null ? void 0 : _b.signaturePad.clear();
67
72
  }
@@ -69,7 +74,7 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
69
74
  });
70
75
  };
71
76
  const handleCurrentVal = async () => {
72
- var _a, _b;
77
+ var _a2, _b;
73
78
  if (currentVal.value) {
74
79
  ibiz.loading.showRedirect();
75
80
  if (saveMode === "img") {
@@ -79,7 +84,8 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
79
84
  const _url = downloadUrl.value.replace("%fileId%", fileData.id);
80
85
  try {
81
86
  const editorParams = {
82
- ...c.editorParams
87
+ ...c.editorParams,
88
+ enableNoAccess
83
89
  };
84
90
  if (editorParams.exportparams) {
85
91
  editorParams.exportParams = JSON.parse(editorParams.exportparams);
@@ -93,8 +99,8 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
93
99
  },
94
100
  extraParams: editorParams,
95
101
  downloadTicketParams: c.downloadTicketParams
96
- });
97
- const dataUrl = await ((_a = signatureRef.value) == null ? void 0 : _a.signaturePad.blobToDataURL(fileBlob));
102
+ }, void 0, enableNoAccess);
103
+ const dataUrl = await ((_a2 = signatureRef.value) == null ? void 0 : _a2.signaturePad.blobToDataURL(fileBlob));
98
104
  currentDataURL.value = dataUrl;
99
105
  } catch (error) {
100
106
  ibiz.log.error(error);
@@ -108,7 +114,14 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
108
114
  };
109
115
  vue.watch(() => props.data, (newVal) => {
110
116
  if (newVal) {
111
- const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, c.editorParams);
117
+ const editorParams = {
118
+ ...c.editorParams,
119
+ enableNoAccess
120
+ };
121
+ if (editorParams.uploadparams) {
122
+ editorParams.uploadParams = JSON.parse(editorParams.uploadparams);
123
+ }
124
+ const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, editorParams);
112
125
  uploadUrl.value = urls.uploadUrl;
113
126
  downloadUrl.value = urls.downloadUrl;
114
127
  }
@@ -151,8 +164,8 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
151
164
  return fileInfo;
152
165
  };
153
166
  const handleRemove = () => {
154
- var _a;
155
- (_a = signatureRef.value) == null ? void 0 : _a.signaturePad.clear();
167
+ var _a2;
168
+ (_a2 = signatureRef.value) == null ? void 0 : _a2.signaturePad.clear();
156
169
  currentDataURL.value = "";
157
170
  handleEmit(null);
158
171
  };
@@ -164,9 +177,9 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
164
177
  }]));
165
178
  };
166
179
  const handleConfirm = () => {
167
- var _a, _b, _c;
180
+ var _a2, _b, _c;
168
181
  fullScreen.value = false;
169
- if (!((_a = signatureRef.value) == null ? void 0 : _a.signaturePad.isRedrawn()))
182
+ if (!((_a2 = signatureRef.value) == null ? void 0 : _a2.signaturePad.isRedrawn()))
170
183
  return;
171
184
  if ((_b = signatureRef.value) == null ? void 0 : _b.signaturePad.isEmpty()) {
172
185
  handleRemove();
@@ -187,10 +200,10 @@ const IBizSignature = /* @__PURE__ */ vue.defineComponent({
187
200
  }
188
201
  };
189
202
  const handleButtonClick = (_type) => {
190
- var _a, _b;
203
+ var _a2, _b;
191
204
  switch (_type) {
192
205
  case "undo":
193
- (_a = signatureRef.value) == null ? void 0 : _a.signaturePad.undoLastStep();
206
+ (_a2 = signatureRef.value) == null ? void 0 : _a2.signaturePad.undoLastStep();
194
207
  break;
195
208
  case "rewrite":
196
209
  (_b = signatureRef.value) == null ? void 0 : _b.signaturePad.clear();
@@ -52,6 +52,13 @@ class UploadEditorController extends runtime.EditorController {
52
52
  * @memberof UploadEditorController
53
53
  */
54
54
  __publicField(this, "autoPreview", false);
55
+ /**
56
+ * 是否启用无权限
57
+ *
58
+ * @type {boolean}
59
+ * @memberof UploadEditorController
60
+ */
61
+ __publicField(this, "enableNoAccess", false);
55
62
  /**
56
63
  * 根据配置的映射关系转换对象属性
57
64
  * 将源对象的指定属性,按照映射规则映射到新对象的目标属性
@@ -115,7 +122,8 @@ class UploadEditorController extends runtime.EditorController {
115
122
  uploadparams,
116
123
  exportparams,
117
124
  autopreview,
118
- infomap
125
+ infomap,
126
+ enablenoaccess
119
127
  } = this.editorParams;
120
128
  if (isDrag) {
121
129
  this.isDrag = Boolean(isDrag);
@@ -141,6 +149,9 @@ class UploadEditorController extends runtime.EditorController {
141
149
  if (infomap) {
142
150
  this.infoMap = infomap;
143
151
  }
152
+ if (enablenoaccess) {
153
+ this.enableNoAccess = enablenoaccess === "true";
154
+ }
144
155
  if (uploadParams) {
145
156
  try {
146
157
  this.uploadParams = JSON.parse(uploadParams);
@@ -23,7 +23,10 @@ function useIViewUpload(props, valueChange, c) {
23
23
  { immediate: true }
24
24
  );
25
25
  const getDownloadUrl = (data, file) => {
26
- const editorParams = { ...c.editorParams };
26
+ const editorParams = {
27
+ ...c.editorParams,
28
+ enableNoAccess: c.enableNoAccess
29
+ };
27
30
  if (editorParams.exportparams) {
28
31
  editorParams.exportParams = JSON.parse(editorParams.exportparams);
29
32
  }
@@ -42,7 +45,10 @@ function useIViewUpload(props, valueChange, c) {
42
45
  () => props.data,
43
46
  (newVal) => {
44
47
  if (newVal) {
45
- const editorParams = { ...c.editorParams };
48
+ const editorParams = {
49
+ ...c.editorParams,
50
+ enableNoAccess: c.enableNoAccess
51
+ };
46
52
  if (editorParams.uploadparams) {
47
53
  editorParams.uploadParams = JSON.parse(editorParams.uploadparams);
48
54
  }
@@ -101,7 +107,7 @@ function useIViewUpload(props, valueChange, c) {
101
107
  newVal.forEach((file) => {
102
108
  const downloadUrl = getDownloadUrl(props.data, file);
103
109
  file.url = file.url || downloadUrl.replace("%fileId%", file.id);
104
- if (ibiz.config.common.enableDownloadTicket) {
110
+ if (ibiz.config.common.enableDownloadTicket && !c.enableNoAccess) {
105
111
  ibiz.util.file.getDownloadTicket(
106
112
  c.context,
107
113
  c.params,
@@ -161,7 +167,7 @@ function useIViewUpload(props, valueChange, c) {
161
167
  if (!response) {
162
168
  return;
163
169
  }
164
- if (ibiz.config.common.enableDownloadTicket && response.ticket) {
170
+ if (ibiz.config.common.enableDownloadTicket && !c.enableNoAccess && response.ticket) {
165
171
  ibiz.util.file.setDownloadTicket(response.id, response.ticket);
166
172
  }
167
173
  uploadCache.cacheFiles.push({
@@ -202,18 +208,27 @@ function useIViewUpload(props, valueChange, c) {
202
208
  const onDownload = (file) => {
203
209
  const downloadUrl = getDownloadUrl(props.data, file);
204
210
  const url = file.url || downloadUrl.replace("%fileId%", file.id);
205
- const editorParams = { ...c.editorParams };
211
+ const editorParams = {
212
+ ...c.editorParams,
213
+ enableNoAccess: c.enableNoAccess
214
+ };
206
215
  if (editorParams.exportparams) {
207
216
  editorParams.exportParams = JSON.parse(editorParams.exportparams);
208
217
  }
209
- ibiz.util.file.fileDownload(url, file.name, {
210
- context: c.context,
211
- params: c.params,
212
- data: props.data,
213
- file: { fileId: file.id, ...file },
214
- extraParams: editorParams,
215
- downloadTicketParams: c.downloadTicketParams
216
- });
218
+ ibiz.util.file.fileDownload(
219
+ url,
220
+ file.name,
221
+ {
222
+ context: c.context,
223
+ params: c.params,
224
+ data: props.data,
225
+ file: { fileId: file.id, ...file },
226
+ extraParams: editorParams,
227
+ downloadTicketParams: c.downloadTicketParams
228
+ },
229
+ void 0,
230
+ c.enableNoAccess
231
+ );
217
232
  };
218
233
  const limit = vue.computed(() => {
219
234
  return c.multiple ? 9999 : 1;
@@ -851,7 +851,11 @@ var index = {
851
851
  warningTitle: "Confirm termination",
852
852
  warningDesc: "Are you sure to terminate the creation?",
853
853
  thinking: "In depth thinking",
854
- thinked: "Deeply pondered"
854
+ thinked: "Deeply pondered",
855
+ collapseToolCall: "Retract tool calls",
856
+ expandToolCall: "Expand all {number} tool calls",
857
+ error: "An error occurred",
858
+ copy: "Copied"
855
859
  },
856
860
  aiChartUtil: {
857
861
  feedback: "Feedback",
@@ -847,7 +847,11 @@ var index = {
847
847
  warningTitle: "\u786E\u8BA4\u4E2D\u6B62",
848
848
  warningDesc: "\u786E\u8BA4\u4E2D\u6B62\u521B\u4F5C\u5417\uFF1F",
849
849
  thinking: "\u6DF1\u5EA6\u601D\u8003\u4E2D",
850
- thinked: "\u5DF2\u6DF1\u5EA6\u601D\u8003"
850
+ thinked: "\u5DF2\u6DF1\u5EA6\u601D\u8003",
851
+ collapseToolCall: "\u6536\u8D77\u5DE5\u5177\u8C03\u7528",
852
+ expandToolCall: "\u5C55\u5F00\u5168\u90E8 {number} \u4E2A\u5DE5\u5177\u8C03\u7528",
853
+ error: "\u53D1\u751F\u9519\u8BEF",
854
+ copy: "\u5DF2\u590D\u5236"
851
855
  },
852
856
  aiChartUtil: {
853
857
  feedback: "\u53CD\u9988",
@@ -34,6 +34,13 @@ class CoopPosController extends runtime.PanelItemController {
34
34
  * @memberof CoopPosController
35
35
  */
36
36
  __publicField(this, "showMode", "default");
37
+ /**
38
+ * 是否启用无权限
39
+ *
40
+ * @type {boolean}
41
+ * @memberof CoopPosController
42
+ */
43
+ __publicField(this, "enableNoAccess", false);
37
44
  /**
38
45
  * 消息模式映射
39
46
  * - 视图打开数据模式映射消息类型
@@ -55,6 +62,7 @@ class CoopPosController extends runtime.PanelItemController {
55
62
  await super.onInit();
56
63
  this.handleRawItemParams();
57
64
  this.showMode = this.rawItemParams.showmode;
65
+ this.enableNoAccess = this.rawItemParams.enablenoaccess === "true";
58
66
  await this.getOperator();
59
67
  }
60
68
  /**
@@ -154,7 +162,9 @@ class CoopPosController extends runtime.PanelItemController {
154
162
  }
155
163
  const { downloadUrl } = ibiz.util.file.calcFileUpDownUrl(
156
164
  this.panel.context,
157
- this.panel.params
165
+ this.panel.params,
166
+ {},
167
+ { enableNoAccess: this.enableNoAccess }
158
168
  );
159
169
  return downloadUrl.replace("%fileId%", urlConfig[0].id);
160
170
  }
@@ -89,6 +89,7 @@ const PanelAppTitle = /* @__PURE__ */ vue.defineComponent({
89
89
  render() {
90
90
  const {
91
91
  icon,
92
+ icon2,
92
93
  caption,
93
94
  caption2,
94
95
  subCaption,
@@ -104,13 +105,14 @@ const PanelAppTitle = /* @__PURE__ */ vue.defineComponent({
104
105
  } else {
105
106
  if (this.menuAlign === "LEFT") {
106
107
  if (this.isCollapse) {
107
- if (icon) {
108
+ const collapseIcon = icon2 || icon;
109
+ if (collapseIcon) {
108
110
  iconVNode = vue.createVNode("div", {
109
111
  "class": this.ns.e("collpase-icon")
110
112
  }, [vue.createVNode(vue.resolveComponent("iBizIcon"), {
111
113
  "class": this.ns.e("logo"),
112
114
  "icon": {
113
- rawContent: icon
115
+ rawContent: collapseIcon
114
116
  }
115
117
  }, null)]);
116
118
  } else {
@@ -58,7 +58,9 @@ class PanelAppTitleController extends runtime.PanelItemController {
58
58
  } else if (indexViewModel.appIconPath) {
59
59
  this.state.icon = indexViewModel.appIconPath;
60
60
  }
61
- if (indexViewModel.appIconPath2) {
61
+ if (indexViewModel.sysImage && indexViewModel.sysImage.rawContent) {
62
+ this.state.icon2 = indexViewModel.sysImage.rawContent;
63
+ } else if (indexViewModel.appIconPath2) {
62
64
  this.state.icon2 = indexViewModel.appIconPath2;
63
65
  }
64
66
  if (indexViewModel.caption) {
@@ -187,7 +187,8 @@ class AIChatUtil {
187
187
  state: msg.actionstate,
188
188
  type: "DEFAULT",
189
189
  role: "ASSISTANT",
190
- content: choices[0].content || ""
190
+ content: choices[0].content || "",
191
+ realmessageid: choices[0].messageid
191
192
  });
192
193
  }
193
194
  } else if (msg.actionstate === 40) {
@@ -232,9 +233,13 @@ class AIChatUtil {
232
233
  };
233
234
  chatOptions.recommendPrompt = async (ctx, param, other) => {
234
235
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
236
+ const tempParams = { ...param };
237
+ if (other.srfaiagent) {
238
+ tempParams.srfaiagent = other.srfaiagent;
239
+ }
235
240
  const result = await deService.aiChatRecommendPrompt(
236
241
  ctx,
237
- param,
242
+ tempParams,
238
243
  other.message
239
244
  );
240
245
  if (result.ok && result.data) {
@@ -251,7 +256,8 @@ class AIChatUtil {
251
256
  const fileMeata = ibiz.util.file.calcFileUpDownUrl(
252
257
  (options == null ? void 0 : options.context) || context,
253
258
  (options == null ? void 0 : options.params) || params,
254
- {}
259
+ {},
260
+ { enableNoAccess: true }
255
261
  );
256
262
  const fielUploadHeaders = ibiz.util.file.getUploadHeaders();
257
263
  const formData = new FormData();
@@ -506,7 +512,8 @@ class AIChatUtil {
506
512
  state: msg.actionstate,
507
513
  type: "DEFAULT",
508
514
  role: "ASSISTANT",
509
- content: choices[0].content || ""
515
+ content: choices[0].content || "",
516
+ realmessageid: choices[0].messageid
510
517
  });
511
518
  }
512
519
  } else if (msg.actionstate === 40) {
@@ -551,9 +558,13 @@ class AIChatUtil {
551
558
  };
552
559
  chatOptions.recommendPrompt = async (ctx, param, other) => {
553
560
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
561
+ const tempParams = { ...param };
562
+ if (other.srfaiagent) {
563
+ tempParams.srfaiagent = other.srfaiagent;
564
+ }
554
565
  const result = await deService.aiChatRecommendPrompt(
555
566
  ctx,
556
- param,
567
+ tempParams,
557
568
  other.message
558
569
  );
559
570
  if (result.ok && result.data) {
@@ -570,7 +581,8 @@ class AIChatUtil {
570
581
  const { uploadUrl } = ibiz.util.file.calcFileUpDownUrl(
571
582
  (options == null ? void 0 : options.context) || context,
572
583
  (options == null ? void 0 : options.params) || params,
573
- {}
584
+ {},
585
+ { enableNoAccess: true }
574
586
  );
575
587
  const headers = ibiz.util.file.getUploadHeaders();
576
588
  const formData = new FormData();
@@ -758,54 +770,42 @@ class AIChatUtil {
758
770
  return resourceOptions;
759
771
  }
760
772
  const utilService = new runtime.AIUtilService(aiSessionUtil);
761
- resourceOptions.getSessionList = async () => {
762
- const result = await utilService.getSessionList(context, params);
773
+ resourceOptions.getSessionList = async (args = {}) => {
774
+ const tempParams = { ...params, page: 0, size: 1e3, ...args };
775
+ const result = await utilService.getSessionList(context, tempParams);
763
776
  return result;
764
777
  };
765
- resourceOptions.updateSession = async (sessionID, data) => {
778
+ resourceOptions.updateSession = async (realID, data) => {
766
779
  const result = await utilService.updateSession(
767
780
  context,
768
781
  params,
769
- sessionID,
782
+ realID,
770
783
  data
771
784
  );
772
785
  return result;
773
786
  };
774
- resourceOptions.deleteSession = async (sessionID) => {
775
- const result = await utilService.deleteSession(
776
- context,
777
- params,
778
- sessionID
779
- );
787
+ resourceOptions.deleteSession = async (realID) => {
788
+ const result = await utilService.deleteSession(context, params, realID);
780
789
  return result;
781
790
  };
782
- resourceOptions.getMessages = async (sessionID) => {
783
- const result = await utilService.getMessageList(
784
- context,
785
- params,
786
- sessionID
787
- );
791
+ resourceOptions.getMessages = async (args = {}) => {
792
+ const tempParams = { ...params, page: 0, size: 1e3, ...args };
793
+ const result = await utilService.getMessageList(context, tempParams);
788
794
  return result;
789
795
  };
790
- resourceOptions.deleteMessage = async (sessionID, messageID) => {
796
+ resourceOptions.deleteMessage = async (messageID) => {
791
797
  const result = await utilService.deleteMessage(
792
798
  context,
793
799
  params,
794
- sessionID,
795
800
  messageID
796
801
  );
797
802
  return result;
798
803
  };
799
- resourceOptions.likeMessage = async (sessionID, messageID) => {
800
- const result = await utilService.likeMessage(
801
- context,
802
- params,
803
- sessionID,
804
- messageID
805
- );
804
+ resourceOptions.likeMessage = async (messageID) => {
805
+ const result = await utilService.likeMessage(context, params, messageID);
806
806
  return result;
807
807
  };
808
- resourceOptions.dislikeMessage = async (sessionID, messageID, feedbackContent) => {
808
+ resourceOptions.dislikeMessage = async (messageID, feedbackContent) => {
809
809
  var _a, _b;
810
810
  const overlay = ibiz.overlay.createModal(
811
811
  (modal) => {
@@ -825,23 +825,58 @@ class AIChatUtil {
825
825
  const _result = await utilService.dislikeMessage(
826
826
  context,
827
827
  params,
828
- sessionID,
829
828
  messageID,
830
829
  content
831
830
  );
832
831
  return _result;
833
832
  };
834
- resourceOptions.cancelFeedback = async (sessionID, messageID) => {
833
+ resourceOptions.cancelFeedback = async (messageID) => {
835
834
  const result = await utilService.cancelFeedback(
836
835
  context,
837
836
  params,
838
- sessionID,
839
837
  messageID
840
838
  );
841
839
  return result;
842
840
  };
841
+ resourceOptions.clearAllSession = async (excludeSessionID) => {
842
+ const result = await utilService.clearAllSession(
843
+ context,
844
+ params,
845
+ excludeSessionID
846
+ );
847
+ return result;
848
+ };
849
+ resourceOptions.clearAllMessageBySessionId = async (realID) => {
850
+ const result = await utilService.clearAllMessageBySessionId(
851
+ context,
852
+ params,
853
+ realID
854
+ );
855
+ return result;
856
+ };
843
857
  return resourceOptions;
844
858
  }
859
+ /**
860
+ * 获取AI聊天模式
861
+ * @param type 场景类型:UIACTION:界面行为;EDITOR:编辑器
862
+ * @param context
863
+ * @param params
864
+ * @param editorParams
865
+ */
866
+ getAIChatMode(type, context, params, editorParams) {
867
+ switch (type) {
868
+ case "UIACTION":
869
+ if (params.srfenabletempmode && params.srfenabletempmode === "true") {
870
+ delete params.srfenabletempmode;
871
+ return "DEFAULT";
872
+ }
873
+ return "TOPIC";
874
+ case "EDITOR":
875
+ return "DEFAULT";
876
+ default:
877
+ return "DEFAULT";
878
+ }
879
+ }
845
880
  }
846
881
 
847
882
  exports.AIChatUtil = AIChatUtil;
@@ -224,13 +224,14 @@ class AppUtil {
224
224
  deACMode,
225
225
  { chatInstance, view, ctrl }
226
226
  );
227
+ const chatMode = ibiz.aiChatUtil.getAIChatMode("UIACTION", context, params);
227
228
  const resourceOptions = await ibiz.aiChatUtil.getAIResourceOptions(
228
229
  context,
229
230
  params
230
231
  );
231
232
  return new Promise((resolve) => {
232
233
  chatInstance.create({
233
- mode: "TOPIC",
234
+ mode: chatMode,
234
235
  resourceOptions,
235
236
  containerOptions: {
236
237
  zIndex: containerZIndex,
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var vue3Util = require('@ibiz-template/vue3-util');
5
+ var icon = require('../../icon.cjs');
6
+ require('./ai-think.css');
7
+
8
+ "use strict";
9
+ const AIThink = /* @__PURE__ */ vue.defineComponent({
10
+ props: {
11
+ think: {
12
+ type: String
13
+ },
14
+ isLoading: {
15
+ type: Boolean,
16
+ required: true
17
+ },
18
+ isCollapse: {
19
+ type: Boolean,
20
+ required: true
21
+ }
22
+ },
23
+ emits: {
24
+ collapseChange: (_value) => true
25
+ },
26
+ setup(props, {
27
+ emit
28
+ }) {
29
+ const ns = vue3Util.useNamespace("ai-think");
30
+ const onCollapseChange = () => {
31
+ emit("collapseChange", !props.isCollapse);
32
+ };
33
+ return {
34
+ ns,
35
+ onCollapseChange
36
+ };
37
+ },
38
+ render() {
39
+ if (!this.think)
40
+ return;
41
+ return vue.createVNode("div", {
42
+ "class": this.ns.b()
43
+ }, [vue.createVNode("div", {
44
+ "class": this.ns.e("header"),
45
+ "onClick": this.onCollapseChange
46
+ }, [vue.createVNode("div", {
47
+ "class": [this.ns.em("header", "state-icon"), this.ns.is("loading", this.isLoading)]
48
+ }, [this.isLoading ? icon.LoadingIcon : icon.ThinkSuccessIcon]), vue.createVNode("div", {
49
+ "class": this.ns.em("header", "title")
50
+ }, [this.isLoading ? ibiz.i18n.t("util.inlineAiUtil.thinking") : ibiz.i18n.t("util.inlineAiUtil.thinked")]), vue.createVNode("div", {
51
+ "class": this.ns.em("header", "collapse-icon")
52
+ }, [this.isCollapse ? icon.DownIcon : icon.UpIcon])]), !this.isCollapse && vue.createVNode("div", {
53
+ "class": this.ns.e("content")
54
+ }, [this.think])]);
55
+ }
56
+ });
57
+
58
+ exports.AIThink = AIThink;
@@ -0,0 +1 @@
1
+ .ibiz-ai-think{width:100%;height:auto;font-size:var(--ibiz-font-size-small);color:var(--ibiz-inline-ai-textarea-container-color-text-1)}.ibiz-ai-think__header{display:flex;gap:var(--ibiz-spacing-extra-tight);align-items:center;margin-bottom:var(--ibiz-spacing-tight);cursor:pointer}.ibiz-ai-think__header:hover{color:var(--ibiz-inline-ai-textarea-container-color-text-hove-1)}.ibiz-ai-think__header--state-icon{display:flex;align-items:center;color:var(--ibiz-color-success)}.ibiz-ai-think__header--state-icon.is-loading{color:var(--ibiz-inline-ai-textarea-container-color-loading)}.ibiz-ai-think__header--collapse-icon{display:flex;align-items:center}.ibiz-ai-think__content{position:relative;padding-left:var(--ibiz-spacing-tight);word-wrap:break-word;white-space:pre-wrap;transition:height .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}.ibiz-ai-think__content::before{position:absolute;top:0;bottom:0;left:0;width:2px;content:"";background-color:var(--ibiz-inline-ai-textarea-container-color-border)}
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var vue3Util = require('@ibiz-template/vue3-util');
5
+ var aiToolCallItem = require('../ai-tool-call-item/ai-tool-call-item.cjs');
6
+ require('./ai-tool-call.css');
7
+
8
+ "use strict";
9
+ const AIToolCall = /* @__PURE__ */ vue.defineComponent({
10
+ props: {
11
+ toolCalls: {
12
+ type: Object,
13
+ required: true
14
+ }
15
+ },
16
+ setup(props) {
17
+ const ns = vue3Util.useNamespace("ai-tool-call");
18
+ const isExpanded = vue.ref(false);
19
+ const showToggle = vue.computed(() => {
20
+ return props.toolCalls.length > 4;
21
+ });
22
+ const items = vue.computed(() => {
23
+ return showToggle.value && !isExpanded.value ? props.toolCalls.slice(0, 4) : props.toolCalls;
24
+ });
25
+ const handleToggle = () => {
26
+ isExpanded.value = !isExpanded.value;
27
+ };
28
+ return {
29
+ ns,
30
+ items,
31
+ showToggle,
32
+ isExpanded,
33
+ handleToggle
34
+ };
35
+ },
36
+ render() {
37
+ if (!this.toolCalls.length)
38
+ return;
39
+ return vue.createVNode("div", {
40
+ "class": this.ns.b()
41
+ }, [this.items.map((item) => {
42
+ return vue.createVNode(aiToolCallItem.AIToolCallItem, {
43
+ "toolCall": item
44
+ }, null);
45
+ }), this.showToggle && vue.createVNode("div", {
46
+ "class": this.ns.e("toggle"),
47
+ "onClick": this.handleToggle
48
+ }, [this.isExpanded ? ibiz.i18n.t("util.inlineAiUtil.collapseToolCall") : ibiz.i18n.t("util.inlineAiUtil.expandToolCall", {
49
+ number: this.toolCalls.length
50
+ })])]);
51
+ }
52
+ });
53
+
54
+ exports.AIToolCall = AIToolCall;
@@ -0,0 +1 @@
1
+ .ibiz-ai-tool-call{color:var(--ibiz-inline-ai-textarea-container-color-text-0)}.ibiz-ai-tool-call__toggle{display:block;padding:var(--ibiz-spacing-tight) 0;margin-top:var(--ibiz-spacing-tight);text-align:center;cursor:pointer;background-color:var(--ibiz-inline-ai-textarea-container-color-bg-1);border-radius:var(--ibiz-border-radius-small)}.ibiz-ai-tool-call__toggle:hover{background-color:var(--ibiz-inline-ai-textarea-container-color-bg-hover-1)}