@ibiz-template/vue3-components 0.7.41-alpha.152 → 0.7.41-alpha.153

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.
@@ -2,6 +2,7 @@ import { defineComponent, createVNode, resolveComponent, ref, watch } from 'vue'
2
2
  import { useNamespace } from '@ibiz-template/vue3-util';
3
3
  import { createUUID } from 'qx-util';
4
4
  import { isBase64Image, isBase64, isSvg } from '@ibiz-template/core';
5
+ import { isObject } from 'lodash-es';
5
6
  import '../../util/index.mjs';
6
7
  import './rawitem.css';
7
8
  import { parseHtml } from '../../util/wang-editor-util/wang-editor-util.mjs';
@@ -119,7 +120,8 @@ const IBizRawItem = /* @__PURE__ */ defineComponent({
119
120
  }
120
121
  } else if (["INFO", "WARNING", "ERROR"].includes(contentType)) {
121
122
  rawItemContent.value = rawItem.rawContent;
122
- } else if (["VIDEO", "DIVIDER"].includes(contentType)) {
123
+ } else if (contentType === "DIVIDER" && !rawItem.rawItemParams) {
124
+ rawItemContent.value = rawItem.rawContent;
123
125
  } else if (contentType === "IMAGE" && sysImage) {
124
126
  rawItemContent.value = sysImage;
125
127
  }
@@ -157,6 +159,15 @@ const IBizRawItem = /* @__PURE__ */ defineComponent({
157
159
  showIcon: false
158
160
  });
159
161
  const rawItemText = ref("");
162
+ const getRawItemParams = () => {
163
+ const tempParams = {};
164
+ if (rawItem && rawItem.rawItemParams && rawItem.rawItemParams.length > 0) {
165
+ rawItem.rawItemParams.forEach((item) => {
166
+ tempParams[item.key] = item.value;
167
+ });
168
+ }
169
+ return tempParams;
170
+ };
160
171
  const convertValue = () => {
161
172
  if (rawItemType.value === "IMAGE") {
162
173
  if (props.content && typeof props.content === "string") {
@@ -192,20 +203,36 @@ const IBizRawItem = /* @__PURE__ */ defineComponent({
192
203
  let rawConfig = {};
193
204
  try {
194
205
  if (typeof rawItemContent.value === "string") {
195
- const func = new Function("return (".concat(rawItemContent.value, ");"));
196
- rawConfig = func();
206
+ if (/^[[{]/.test(rawItemContent.value)) {
207
+ const func = new Function("return (".concat(rawItemContent.value, ");"));
208
+ rawConfig = func();
209
+ } else {
210
+ rawConfig = rawItemContent.value;
211
+ }
197
212
  switch (rawItemType.value) {
198
213
  case "VIDEO":
199
- Object.assign(playerParams.value, rawConfig);
214
+ if (isObject(rawConfig)) {
215
+ Object.assign(playerParams.value, rawConfig);
216
+ } else {
217
+ playerParams.value.path = rawConfig;
218
+ }
200
219
  break;
201
220
  case "DIVIDER":
202
- Object.assign(dividerParams.value, rawConfig);
221
+ if (isObject(rawConfig)) {
222
+ Object.assign(dividerParams.value, rawConfig);
223
+ } else {
224
+ dividerParams.value.html = rawConfig;
225
+ }
203
226
  break;
204
227
  case "INFO":
205
228
  case "WARNING":
206
229
  case "ERROR":
207
230
  alertParams.value.type = rawItemType.value.toLocaleLowerCase();
208
- Object.assign(alertParams.value, rawConfig);
231
+ if (isObject(rawConfig)) {
232
+ Object.assign(alertParams.value, rawConfig);
233
+ } else {
234
+ alertParams.value.title = rawConfig;
235
+ }
209
236
  break;
210
237
  default:
211
238
  break;
@@ -216,13 +243,12 @@ const IBizRawItem = /* @__PURE__ */ defineComponent({
216
243
  type: rawItemType.value
217
244
  }));
218
245
  }
219
- } else if (rawItemType.value === "VIDEO") {
220
- if (rawItem && rawItem.rawItemParams && rawItem.rawItemParams.length > 0) {
221
- const tempParams = {};
222
- rawItem.rawItemParams.forEach((item) => {
223
- tempParams[item.key] = item.value;
224
- });
246
+ } else if (["DIVIDER", "VIDEO"].includes(rawItemType.value)) {
247
+ const tempParams = getRawItemParams();
248
+ if (rawItemType.value === "VIDEO") {
225
249
  Object.assign(playerParams.value, tempParams);
250
+ } else {
251
+ Object.assign(dividerParams.value, tempParams);
226
252
  }
227
253
  }
228
254
  }
@@ -84,7 +84,8 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
84
84
  containerOptions: {
85
85
  container: aiChatElementRef.value,
86
86
  compWrapperId: editorParams.compwrapperid || "DEFAULT",
87
- enableBackFill: false
87
+ enableBackFill: false,
88
+ isEmbedAiHeaderHidden: editorParams.isembedaiheaderhidden ? editorParams.isembedaiheaderhidden === "true" : ibiz.config.common.isEmbedAiHeaderHidden
88
89
  },
89
90
  topicOptions: {
90
91
  appid: ibiz.env.appId,
@@ -921,7 +921,8 @@ var index = {
921
921
  discriminationPrejudice: "Discrimination or Prejudice Answer",
922
922
  violationPrivacy: "Violation of Privacy",
923
923
  contentInfringement: "Content infringement",
924
- placeholder: "Please enter"
924
+ placeholder: "Please enter",
925
+ noFilePreviewAddress: "No attachment preview service. Please contact the administrator to add it!"
925
926
  },
926
927
  screenShotUtil: {
927
928
  prepareCanvas: "Prepare the canvas...",
@@ -917,7 +917,8 @@ var index = {
917
917
  discriminationPrejudice: "\u6B67\u89C6\u6216\u504F\u89C1\u56DE\u7B54",
918
918
  violationPrivacy: "\u4FB5\u72AF\u9690\u79C1",
919
919
  contentInfringement: "\u5185\u5BB9\u4FB5\u6743",
920
- placeholder: "\u8BF7\u8F93\u5165"
920
+ placeholder: "\u8BF7\u8F93\u5165",
921
+ noFilePreviewAddress: "\u65E0\u9644\u4EF6\u9884\u89C8\u670D\u52A1\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0!"
921
922
  },
922
923
  screenShotUtil: {
923
924
  prepareCanvas: "\u51C6\u5907\u753B\u5E03\u4E2D...",
@@ -223,6 +223,11 @@ class AIChatUtil {
223
223
  } else {
224
224
  chatOptions.chatMessagePageSize = ibiz.config.common.aiChatMessagePageSize;
225
225
  }
226
+ if (editorParams.srfaienableworkspace) {
227
+ chatOptions.enableWorkSpace = editorParams.srfaienableworkspace === "true";
228
+ } else {
229
+ chatOptions.enableWorkSpace = ibiz.config.common.aiEnableWorkSpace;
230
+ }
226
231
  chatOptions.fetchAgentList = (args2 = {}) => {
227
232
  const { query, agentid } = args2;
228
233
  return this.getAIAgentList(
@@ -251,7 +256,11 @@ class AIChatUtil {
251
256
  let id = "";
252
257
  let abortController;
253
258
  const { chatInstance, view, ctrl } = args;
254
- const fileSystemOptions = await this.getAIFileSystemOptions();
259
+ let filePreviewMode = ibiz.config.common.aiFilePreviewMode;
260
+ if (editorParams.srfaifilepreviewmode) {
261
+ filePreviewMode = editorParams.srfaifilepreviewmode;
262
+ }
263
+ const fileSystemOptions = await this.getAIFileSystemOptions(filePreviewMode);
255
264
  chatOptions.fileSystemOptions = fileSystemOptions;
256
265
  chatOptions.history = async (ctx, param, other) => {
257
266
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
@@ -1028,6 +1037,12 @@ class AIChatUtil {
1028
1037
  } else {
1029
1038
  chatOptions.chatMessagePageSize = ibiz.config.common.aiChatMessagePageSize;
1030
1039
  }
1040
+ if (params.hasOwnProperty("srfaienableworkspace")) {
1041
+ chatOptions.enableWorkSpace = params.srfaienableworkspace === "true";
1042
+ delete params.srfaienableworkspace;
1043
+ } else {
1044
+ chatOptions.enableWorkSpace = ibiz.config.common.aiEnableWorkSpace;
1045
+ }
1031
1046
  chatOptions.fetchAgentList = (args2 = {}) => {
1032
1047
  const { query, agentid } = args2;
1033
1048
  return this.getAIAgentList(context, {
@@ -1054,7 +1069,12 @@ class AIChatUtil {
1054
1069
  let id = "";
1055
1070
  let abortController;
1056
1071
  const { chatInstance, view, ctrl } = args;
1057
- const fileSystemOptions = await this.getAIFileSystemOptions();
1072
+ let filePreviewMode = ibiz.config.common.aiFilePreviewMode;
1073
+ if (params.hasOwnProperty("srfaifilepreviewmode")) {
1074
+ filePreviewMode = params.srfaifilepreviewmode;
1075
+ delete params.srfaifilepreviewmode;
1076
+ }
1077
+ const fileSystemOptions = await this.getAIFileSystemOptions(filePreviewMode);
1058
1078
  chatOptions.fileSystemOptions = fileSystemOptions;
1059
1079
  chatOptions.history = async (ctx, param, other) => {
1060
1080
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
@@ -1891,8 +1911,34 @@ class AIChatUtil {
1891
1911
  * @returns {*} {Promise<IData>}
1892
1912
  * @memberof AIChatUtil
1893
1913
  */
1894
- async getAIFileSystemOptions() {
1914
+ async getAIFileSystemOptions(filePreviewMode) {
1895
1915
  const fileSystemOptions = {};
1916
+ fileSystemOptions.filePreviewMode = filePreviewMode;
1917
+ fileSystemOptions.getCustomFilePreviewUrl = async (ctx, param, other) => {
1918
+ var _a;
1919
+ const filePreviewAddress = (_a = ibiz.env.customParams) == null ? void 0 : _a.file_preview_address;
1920
+ if (!filePreviewAddress) {
1921
+ ibiz.message.error(
1922
+ ibiz.i18n.t("util.aiChartUtil.noFilePreviewAddress")
1923
+ );
1924
+ return "";
1925
+ }
1926
+ const { id, name, folder } = other;
1927
+ let { downloadUrl } = ibiz.util.file.calcFileUpDownUrl(
1928
+ ctx,
1929
+ param,
1930
+ {},
1931
+ { osscat: folder }
1932
+ );
1933
+ downloadUrl = downloadUrl.replace("%fileId%", id);
1934
+ const { protocol, hostname, port } = window.location;
1935
+ const actualPort = port || (protocol === "https:" ? "443" : "80");
1936
+ const windowInfo = "".concat(protocol, "//").concat(hostname, ":").concat(actualPort);
1937
+ const filedownloadurl = "".concat(windowInfo).concat(downloadUrl, "?fullfilename=").concat(name);
1938
+ const b64Encoded = ibiz.util.base64.encode(filedownloadurl);
1939
+ const previewUrl = "".concat(filePreviewAddress, "/onlinePreview?url=").concat(encodeURIComponent(b64Encoded));
1940
+ return previewUrl;
1941
+ };
1896
1942
  fileSystemOptions.getFileList = async (ctx, param, other) => {
1897
1943
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1898
1944
  const response = await deService.aiChatProject(
@@ -1909,12 +1955,57 @@ class AIChatUtil {
1909
1955
  const response = await deService.aiChatProject(
1910
1956
  ctx,
1911
1957
  { srfactag: param.srfactag },
1912
- { ...other, action: "UPLOAD" }
1958
+ { action: "UPLOAD", ...other }
1913
1959
  );
1914
1960
  if (response.ok)
1915
1961
  return response.data;
1916
1962
  return void 0;
1917
1963
  };
1964
+ fileSystemOptions.createFolder = async (ctx, param, other) => {
1965
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1966
+ const response = await deService.aiChatProject(
1967
+ ctx,
1968
+ { srfactag: param.srfactag },
1969
+ { action: "MKDIR", ...other }
1970
+ );
1971
+ return response.data;
1972
+ };
1973
+ fileSystemOptions.createFile = async (ctx, param, other) => {
1974
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1975
+ const response = await deService.aiChatProject(
1976
+ ctx,
1977
+ { srfactag: param.srfactag },
1978
+ { action: "WRITE", ...other }
1979
+ );
1980
+ return response.data;
1981
+ };
1982
+ fileSystemOptions.move = async (ctx, param, other) => {
1983
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1984
+ const response = await deService.aiChatProject(
1985
+ ctx,
1986
+ { srfactag: param.srfactag },
1987
+ { action: "MOVE", ...other }
1988
+ );
1989
+ return response.data;
1990
+ };
1991
+ fileSystemOptions.delete = async (ctx, param, other) => {
1992
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1993
+ const response = await deService.aiChatProject(
1994
+ ctx,
1995
+ { srfactag: param.srfactag },
1996
+ { recursive: true, action: "DELETE", ...other }
1997
+ );
1998
+ return response.data;
1999
+ };
2000
+ fileSystemOptions.readFile = async (ctx, param, other) => {
2001
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
2002
+ const response = await deService.aiChatProject(
2003
+ ctx,
2004
+ { srfactag: param.srfactag },
2005
+ { action: "READ", ...other }
2006
+ );
2007
+ return response.data;
2008
+ };
1918
2009
  fileSystemOptions.getContent = async (ctx, param, id, type, cat) => {
1919
2010
  const app = await ibiz.hub.getAppAsync(ctx.appId);
1920
2011
  const requestUrl = "/ibizutil/downloadtxt/".concat(cat ? "".concat(cat, "/") : "").concat(id, "?type=").concat(type);
@@ -4,6 +4,7 @@ var vue = require('vue');
4
4
  var vue3Util = require('@ibiz-template/vue3-util');
5
5
  var qxUtil = require('qx-util');
6
6
  var core = require('@ibiz-template/core');
7
+ var lodashEs = require('lodash-es');
7
8
  require('../../util/index.cjs');
8
9
  require('./rawitem.css');
9
10
  var wangEditorUtil = require('../../util/wang-editor-util/wang-editor-util.cjs');
@@ -121,7 +122,8 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
121
122
  }
122
123
  } else if (["INFO", "WARNING", "ERROR"].includes(contentType)) {
123
124
  rawItemContent.value = rawItem.rawContent;
124
- } else if (["VIDEO", "DIVIDER"].includes(contentType)) {
125
+ } else if (contentType === "DIVIDER" && !rawItem.rawItemParams) {
126
+ rawItemContent.value = rawItem.rawContent;
125
127
  } else if (contentType === "IMAGE" && sysImage) {
126
128
  rawItemContent.value = sysImage;
127
129
  }
@@ -159,6 +161,15 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
159
161
  showIcon: false
160
162
  });
161
163
  const rawItemText = vue.ref("");
164
+ const getRawItemParams = () => {
165
+ const tempParams = {};
166
+ if (rawItem && rawItem.rawItemParams && rawItem.rawItemParams.length > 0) {
167
+ rawItem.rawItemParams.forEach((item) => {
168
+ tempParams[item.key] = item.value;
169
+ });
170
+ }
171
+ return tempParams;
172
+ };
162
173
  const convertValue = () => {
163
174
  if (rawItemType.value === "IMAGE") {
164
175
  if (props.content && typeof props.content === "string") {
@@ -194,20 +205,36 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
194
205
  let rawConfig = {};
195
206
  try {
196
207
  if (typeof rawItemContent.value === "string") {
197
- const func = new Function("return (".concat(rawItemContent.value, ");"));
198
- rawConfig = func();
208
+ if (/^[[{]/.test(rawItemContent.value)) {
209
+ const func = new Function("return (".concat(rawItemContent.value, ");"));
210
+ rawConfig = func();
211
+ } else {
212
+ rawConfig = rawItemContent.value;
213
+ }
199
214
  switch (rawItemType.value) {
200
215
  case "VIDEO":
201
- Object.assign(playerParams.value, rawConfig);
216
+ if (lodashEs.isObject(rawConfig)) {
217
+ Object.assign(playerParams.value, rawConfig);
218
+ } else {
219
+ playerParams.value.path = rawConfig;
220
+ }
202
221
  break;
203
222
  case "DIVIDER":
204
- Object.assign(dividerParams.value, rawConfig);
223
+ if (lodashEs.isObject(rawConfig)) {
224
+ Object.assign(dividerParams.value, rawConfig);
225
+ } else {
226
+ dividerParams.value.html = rawConfig;
227
+ }
205
228
  break;
206
229
  case "INFO":
207
230
  case "WARNING":
208
231
  case "ERROR":
209
232
  alertParams.value.type = rawItemType.value.toLocaleLowerCase();
210
- Object.assign(alertParams.value, rawConfig);
233
+ if (lodashEs.isObject(rawConfig)) {
234
+ Object.assign(alertParams.value, rawConfig);
235
+ } else {
236
+ alertParams.value.title = rawConfig;
237
+ }
211
238
  break;
212
239
  default:
213
240
  break;
@@ -218,13 +245,12 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
218
245
  type: rawItemType.value
219
246
  }));
220
247
  }
221
- } else if (rawItemType.value === "VIDEO") {
222
- if (rawItem && rawItem.rawItemParams && rawItem.rawItemParams.length > 0) {
223
- const tempParams = {};
224
- rawItem.rawItemParams.forEach((item) => {
225
- tempParams[item.key] = item.value;
226
- });
248
+ } else if (["DIVIDER", "VIDEO"].includes(rawItemType.value)) {
249
+ const tempParams = getRawItemParams();
250
+ if (rawItemType.value === "VIDEO") {
227
251
  Object.assign(playerParams.value, tempParams);
252
+ } else {
253
+ Object.assign(dividerParams.value, tempParams);
228
254
  }
229
255
  }
230
256
  }
@@ -86,7 +86,8 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
86
86
  containerOptions: {
87
87
  container: aiChatElementRef.value,
88
88
  compWrapperId: editorParams.compwrapperid || "DEFAULT",
89
- enableBackFill: false
89
+ enableBackFill: false,
90
+ isEmbedAiHeaderHidden: editorParams.isembedaiheaderhidden ? editorParams.isembedaiheaderhidden === "true" : ibiz.config.common.isEmbedAiHeaderHidden
90
91
  },
91
92
  topicOptions: {
92
93
  appid: ibiz.env.appId,
@@ -925,7 +925,8 @@ var index = {
925
925
  discriminationPrejudice: "Discrimination or Prejudice Answer",
926
926
  violationPrivacy: "Violation of Privacy",
927
927
  contentInfringement: "Content infringement",
928
- placeholder: "Please enter"
928
+ placeholder: "Please enter",
929
+ noFilePreviewAddress: "No attachment preview service. Please contact the administrator to add it!"
929
930
  },
930
931
  screenShotUtil: {
931
932
  prepareCanvas: "Prepare the canvas...",
@@ -921,7 +921,8 @@ var index = {
921
921
  discriminationPrejudice: "\u6B67\u89C6\u6216\u504F\u89C1\u56DE\u7B54",
922
922
  violationPrivacy: "\u4FB5\u72AF\u9690\u79C1",
923
923
  contentInfringement: "\u5185\u5BB9\u4FB5\u6743",
924
- placeholder: "\u8BF7\u8F93\u5165"
924
+ placeholder: "\u8BF7\u8F93\u5165",
925
+ noFilePreviewAddress: "\u65E0\u9644\u4EF6\u9884\u89C8\u670D\u52A1\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0!"
925
926
  },
926
927
  screenShotUtil: {
927
928
  prepareCanvas: "\u51C6\u5907\u753B\u5E03\u4E2D...",
@@ -225,6 +225,11 @@ class AIChatUtil {
225
225
  } else {
226
226
  chatOptions.chatMessagePageSize = ibiz.config.common.aiChatMessagePageSize;
227
227
  }
228
+ if (editorParams.srfaienableworkspace) {
229
+ chatOptions.enableWorkSpace = editorParams.srfaienableworkspace === "true";
230
+ } else {
231
+ chatOptions.enableWorkSpace = ibiz.config.common.aiEnableWorkSpace;
232
+ }
228
233
  chatOptions.fetchAgentList = (args2 = {}) => {
229
234
  const { query, agentid } = args2;
230
235
  return this.getAIAgentList(
@@ -253,7 +258,11 @@ class AIChatUtil {
253
258
  let id = "";
254
259
  let abortController;
255
260
  const { chatInstance, view, ctrl } = args;
256
- const fileSystemOptions = await this.getAIFileSystemOptions();
261
+ let filePreviewMode = ibiz.config.common.aiFilePreviewMode;
262
+ if (editorParams.srfaifilepreviewmode) {
263
+ filePreviewMode = editorParams.srfaifilepreviewmode;
264
+ }
265
+ const fileSystemOptions = await this.getAIFileSystemOptions(filePreviewMode);
257
266
  chatOptions.fileSystemOptions = fileSystemOptions;
258
267
  chatOptions.history = async (ctx, param, other) => {
259
268
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
@@ -1030,6 +1039,12 @@ class AIChatUtil {
1030
1039
  } else {
1031
1040
  chatOptions.chatMessagePageSize = ibiz.config.common.aiChatMessagePageSize;
1032
1041
  }
1042
+ if (params.hasOwnProperty("srfaienableworkspace")) {
1043
+ chatOptions.enableWorkSpace = params.srfaienableworkspace === "true";
1044
+ delete params.srfaienableworkspace;
1045
+ } else {
1046
+ chatOptions.enableWorkSpace = ibiz.config.common.aiEnableWorkSpace;
1047
+ }
1033
1048
  chatOptions.fetchAgentList = (args2 = {}) => {
1034
1049
  const { query, agentid } = args2;
1035
1050
  return this.getAIAgentList(context, {
@@ -1056,7 +1071,12 @@ class AIChatUtil {
1056
1071
  let id = "";
1057
1072
  let abortController;
1058
1073
  const { chatInstance, view, ctrl } = args;
1059
- const fileSystemOptions = await this.getAIFileSystemOptions();
1074
+ let filePreviewMode = ibiz.config.common.aiFilePreviewMode;
1075
+ if (params.hasOwnProperty("srfaifilepreviewmode")) {
1076
+ filePreviewMode = params.srfaifilepreviewmode;
1077
+ delete params.srfaifilepreviewmode;
1078
+ }
1079
+ const fileSystemOptions = await this.getAIFileSystemOptions(filePreviewMode);
1060
1080
  chatOptions.fileSystemOptions = fileSystemOptions;
1061
1081
  chatOptions.history = async (ctx, param, other) => {
1062
1082
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
@@ -1893,8 +1913,34 @@ class AIChatUtil {
1893
1913
  * @returns {*} {Promise<IData>}
1894
1914
  * @memberof AIChatUtil
1895
1915
  */
1896
- async getAIFileSystemOptions() {
1916
+ async getAIFileSystemOptions(filePreviewMode) {
1897
1917
  const fileSystemOptions = {};
1918
+ fileSystemOptions.filePreviewMode = filePreviewMode;
1919
+ fileSystemOptions.getCustomFilePreviewUrl = async (ctx, param, other) => {
1920
+ var _a;
1921
+ const filePreviewAddress = (_a = ibiz.env.customParams) == null ? void 0 : _a.file_preview_address;
1922
+ if (!filePreviewAddress) {
1923
+ ibiz.message.error(
1924
+ ibiz.i18n.t("util.aiChartUtil.noFilePreviewAddress")
1925
+ );
1926
+ return "";
1927
+ }
1928
+ const { id, name, folder } = other;
1929
+ let { downloadUrl } = ibiz.util.file.calcFileUpDownUrl(
1930
+ ctx,
1931
+ param,
1932
+ {},
1933
+ { osscat: folder }
1934
+ );
1935
+ downloadUrl = downloadUrl.replace("%fileId%", id);
1936
+ const { protocol, hostname, port } = window.location;
1937
+ const actualPort = port || (protocol === "https:" ? "443" : "80");
1938
+ const windowInfo = "".concat(protocol, "//").concat(hostname, ":").concat(actualPort);
1939
+ const filedownloadurl = "".concat(windowInfo).concat(downloadUrl, "?fullfilename=").concat(name);
1940
+ const b64Encoded = ibiz.util.base64.encode(filedownloadurl);
1941
+ const previewUrl = "".concat(filePreviewAddress, "/onlinePreview?url=").concat(encodeURIComponent(b64Encoded));
1942
+ return previewUrl;
1943
+ };
1898
1944
  fileSystemOptions.getFileList = async (ctx, param, other) => {
1899
1945
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1900
1946
  const response = await deService.aiChatProject(
@@ -1911,12 +1957,57 @@ class AIChatUtil {
1911
1957
  const response = await deService.aiChatProject(
1912
1958
  ctx,
1913
1959
  { srfactag: param.srfactag },
1914
- { ...other, action: "UPLOAD" }
1960
+ { action: "UPLOAD", ...other }
1915
1961
  );
1916
1962
  if (response.ok)
1917
1963
  return response.data;
1918
1964
  return void 0;
1919
1965
  };
1966
+ fileSystemOptions.createFolder = async (ctx, param, other) => {
1967
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1968
+ const response = await deService.aiChatProject(
1969
+ ctx,
1970
+ { srfactag: param.srfactag },
1971
+ { action: "MKDIR", ...other }
1972
+ );
1973
+ return response.data;
1974
+ };
1975
+ fileSystemOptions.createFile = async (ctx, param, other) => {
1976
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1977
+ const response = await deService.aiChatProject(
1978
+ ctx,
1979
+ { srfactag: param.srfactag },
1980
+ { action: "WRITE", ...other }
1981
+ );
1982
+ return response.data;
1983
+ };
1984
+ fileSystemOptions.move = async (ctx, param, other) => {
1985
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1986
+ const response = await deService.aiChatProject(
1987
+ ctx,
1988
+ { srfactag: param.srfactag },
1989
+ { action: "MOVE", ...other }
1990
+ );
1991
+ return response.data;
1992
+ };
1993
+ fileSystemOptions.delete = async (ctx, param, other) => {
1994
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
1995
+ const response = await deService.aiChatProject(
1996
+ ctx,
1997
+ { srfactag: param.srfactag },
1998
+ { recursive: true, action: "DELETE", ...other }
1999
+ );
2000
+ return response.data;
2001
+ };
2002
+ fileSystemOptions.readFile = async (ctx, param, other) => {
2003
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
2004
+ const response = await deService.aiChatProject(
2005
+ ctx,
2006
+ { srfactag: param.srfactag },
2007
+ { action: "READ", ...other }
2008
+ );
2009
+ return response.data;
2010
+ };
1920
2011
  fileSystemOptions.getContent = async (ctx, param, id, type, cat) => {
1921
2012
  const app = await ibiz.hub.getAppAsync(ctx.appId);
1922
2013
  const requestUrl = "/ibizutil/downloadtxt/".concat(cat ? "".concat(cat, "/") : "").concat(id, "?type=").concat(type);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.152",
3
+ "version": "0.7.41-alpha.153",
4
4
  "description": "web端组件库(vue3)",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -31,16 +31,16 @@
31
31
  "dependencies": {
32
32
  "@amap/amap-jsapi-loader": "^1.0.1",
33
33
  "@floating-ui/dom": "^1.5.3",
34
- "@ibiz-template-plugin/ai-chat": "^0.0.117",
34
+ "@ibiz-template-plugin/ai-chat": "^0.0.118",
35
35
  "@ibiz-template-plugin/gantt": "0.1.8-alpha.468",
36
36
  "@ibiz-template-plugin/bi-report": "0.0.32",
37
37
  "@ibiz-template-plugin/data-view": "0.0.8",
38
38
  "@ibiz-template/core": "0.7.41-alpha.152",
39
39
  "@ibiz-template/devtool": "0.0.17",
40
- "@ibiz-template/model-helper": "0.7.41-alpha.152",
41
- "@ibiz-template/runtime": "0.7.41-alpha.152",
40
+ "@ibiz-template/model-helper": "0.7.41-alpha.153",
41
+ "@ibiz-template/runtime": "0.7.41-alpha.153",
42
42
  "@ibiz-template/theme": "0.7.39",
43
- "@ibiz-template/vue3-util": "0.7.41-alpha.152",
43
+ "@ibiz-template/vue3-util": "0.7.41-alpha.153",
44
44
  "@ibiz-template/web-theme": "3.16.0",
45
45
  "@ibiz/model-core": "^0.1.89",
46
46
  "@imengyu/vue3-context-menu": "^1.3.5",