@ibiz-template/vue3-components 0.7.41-alpha.160 → 0.7.41-alpha.162

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.
@@ -2015,7 +2015,8 @@ class AIChatUtil {
2015
2015
  const { protocol, hostname, port } = window.location;
2016
2016
  const actualPort = port || (protocol === "https:" ? "443" : "80");
2017
2017
  const windowInfo = "".concat(protocol, "//").concat(hostname, ":").concat(actualPort);
2018
- const filedownloadurl = "".concat(windowInfo).concat(downloadUrl, "?fullfilename=").concat(name);
2018
+ const hashName = "".concat(ibiz.util.md5("".concat(id, "_").concat(name)), "/").concat(name);
2019
+ const filedownloadurl = "".concat(windowInfo).concat(downloadUrl, "?fullfilename=").concat(hashName);
2019
2020
  const b64Encoded = ibiz.util.base64.encode(filedownloadurl);
2020
2021
  const previewUrl = "".concat(filePreviewAddress, "/onlinePreview?url=").concat(encodeURIComponent(b64Encoded));
2021
2022
  return previewUrl;
@@ -2087,6 +2088,24 @@ class AIChatUtil {
2087
2088
  );
2088
2089
  return response.data;
2089
2090
  };
2091
+ fileSystemOptions.uploadFolder = async (ctx, param, other) => {
2092
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
2093
+ const response = await deService.aiChatProject(
2094
+ ctx,
2095
+ { srfactag: param.srfactag },
2096
+ { recursive: true, action: "UPLOAD_FOLDER", ...other }
2097
+ );
2098
+ return response.data;
2099
+ };
2100
+ fileSystemOptions.previewFolder = async (ctx, param, other) => {
2101
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
2102
+ const response = await deService.aiChatProject(
2103
+ ctx,
2104
+ { srfactag: param.srfactag },
2105
+ { recursive: true, action: "PREVIEW_FOLDER", ...other }
2106
+ );
2107
+ return response.data;
2108
+ };
2090
2109
  fileSystemOptions.readFile = async (ctx, param, other) => {
2091
2110
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
2092
2111
  const response = await deService.aiChatProject(
@@ -2017,7 +2017,8 @@ class AIChatUtil {
2017
2017
  const { protocol, hostname, port } = window.location;
2018
2018
  const actualPort = port || (protocol === "https:" ? "443" : "80");
2019
2019
  const windowInfo = "".concat(protocol, "//").concat(hostname, ":").concat(actualPort);
2020
- const filedownloadurl = "".concat(windowInfo).concat(downloadUrl, "?fullfilename=").concat(name);
2020
+ const hashName = "".concat(ibiz.util.md5("".concat(id, "_").concat(name)), "/").concat(name);
2021
+ const filedownloadurl = "".concat(windowInfo).concat(downloadUrl, "?fullfilename=").concat(hashName);
2021
2022
  const b64Encoded = ibiz.util.base64.encode(filedownloadurl);
2022
2023
  const previewUrl = "".concat(filePreviewAddress, "/onlinePreview?url=").concat(encodeURIComponent(b64Encoded));
2023
2024
  return previewUrl;
@@ -2089,6 +2090,24 @@ class AIChatUtil {
2089
2090
  );
2090
2091
  return response.data;
2091
2092
  };
2093
+ fileSystemOptions.uploadFolder = async (ctx, param, other) => {
2094
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
2095
+ const response = await deService.aiChatProject(
2096
+ ctx,
2097
+ { srfactag: param.srfactag },
2098
+ { recursive: true, action: "UPLOAD_FOLDER", ...other }
2099
+ );
2100
+ return response.data;
2101
+ };
2102
+ fileSystemOptions.previewFolder = async (ctx, param, other) => {
2103
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
2104
+ const response = await deService.aiChatProject(
2105
+ ctx,
2106
+ { srfactag: param.srfactag },
2107
+ { recursive: true, action: "PREVIEW_FOLDER", ...other }
2108
+ );
2109
+ return response.data;
2110
+ };
2092
2111
  fileSystemOptions.readFile = async (ctx, param, other) => {
2093
2112
  const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, param.appDataEntityId);
2094
2113
  const response = await deService.aiChatProject(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.160",
3
+ "version": "0.7.41-alpha.162",
4
4
  "description": "web端组件库(vue3)",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -31,7 +31,7 @@
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.126",
34
+ "@ibiz-template-plugin/ai-chat": "^0.0.129",
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",
@@ -2586,7 +2586,9 @@ export class AIChatUtil implements IApiAIChatUtil {
2586
2586
  // 没有端口使用默认端口
2587
2587
  const actualPort = port || (protocol === 'https:' ? '443' : '80');
2588
2588
  const windowInfo = `${protocol}//${hostname}:${actualPort}`;
2589
- const filedownloadurl = `${windowInfo}${downloadUrl}?fullfilename=${name}`;
2589
+ // fullfilename 参与预览服务端缓存 key,用 id_name 的 md5 保证不同目录同名文件缓存不冲突
2590
+ const hashName = `${ibiz.util.md5(`${id}_${name}`)}/${name}`;
2591
+ const filedownloadurl = `${windowInfo}${downloadUrl}?fullfilename=${hashName}`;
2590
2592
  const b64Encoded = ibiz.util.base64.encode(filedownloadurl);
2591
2593
  const previewUrl = `${filePreviewAddress}/onlinePreview?url=${encodeURIComponent(b64Encoded)}`;
2592
2594
  return previewUrl;
@@ -2705,6 +2707,38 @@ export class AIChatUtil implements IApiAIChatUtil {
2705
2707
  );
2706
2708
  return response.data;
2707
2709
  };
2710
+ // 上传文件夹
2711
+ fileSystemOptions.uploadFolder = async (
2712
+ ctx: IContext,
2713
+ param: IParams,
2714
+ other: IParams,
2715
+ ): Promise<IData> => {
2716
+ const deService = await ibiz.hub
2717
+ .getApp(ctx.srfappid)
2718
+ .deService.getService(ctx, param.appDataEntityId);
2719
+ const response = await deService.aiChatProject(
2720
+ ctx,
2721
+ { srfactag: param.srfactag },
2722
+ { recursive: true, action: 'UPLOAD_FOLDER', ...other },
2723
+ );
2724
+ return response.data;
2725
+ };
2726
+ // 预览文件夹
2727
+ fileSystemOptions.previewFolder = async (
2728
+ ctx: IContext,
2729
+ param: IParams,
2730
+ other: IParams,
2731
+ ): Promise<IData> => {
2732
+ const deService = await ibiz.hub
2733
+ .getApp(ctx.srfappid)
2734
+ .deService.getService(ctx, param.appDataEntityId);
2735
+ const response = await deService.aiChatProject(
2736
+ ctx,
2737
+ { srfactag: param.srfactag },
2738
+ { recursive: true, action: 'PREVIEW_FOLDER', ...other },
2739
+ );
2740
+ return response.data;
2741
+ };
2708
2742
  // 读取文件内容
2709
2743
  fileSystemOptions.readFile = async (
2710
2744
  ctx: IContext,