@ibiz-template/vue3-components 0.7.41-alpha.165 → 0.7.41-alpha.167

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 (34) hide show
  1. package/dist/{index-li-EqXGB.js → index-DXoEi5m-.js} +28 -28
  2. package/dist/{index.es-CA0rGKdK.js → index.es-nZgG-TGm.js} +1 -1
  3. package/dist/index.min.css +1 -1
  4. package/dist/index.system.min.js +1 -1
  5. package/dist/{wang-editor-BPGsMZgX.js → wang-editor-CK60NH54.js} +1 -1
  6. package/dist/{xlsx-util-Bv9fDQB8.js → xlsx-util-5Xgq-UOe.js} +1 -1
  7. package/es/editor/index.mjs +8 -0
  8. package/es/editor/work-space/embed-work-space/embed-work-space.css +1 -0
  9. package/es/editor/work-space/embed-work-space/embed-work-space.mjs +75 -0
  10. package/es/editor/work-space/embed-work-space.controller.mjs +62 -0
  11. package/es/editor/work-space/embed-work-space.provider.mjs +22 -0
  12. package/es/editor/work-space/index.mjs +5 -0
  13. package/es/panel-component/user-message/async-action/async-action/async-action.provider.mjs +44 -41
  14. package/es/util/ai-chat-util/ai-chat-util.mjs +326 -244
  15. package/es/web-app/main.mjs +1 -1
  16. package/lib/editor/index.cjs +8 -0
  17. package/lib/editor/work-space/embed-work-space/embed-work-space.cjs +77 -0
  18. package/lib/editor/work-space/embed-work-space/embed-work-space.css +1 -0
  19. package/lib/editor/work-space/embed-work-space.controller.cjs +64 -0
  20. package/lib/editor/work-space/embed-work-space.provider.cjs +24 -0
  21. package/lib/editor/work-space/index.cjs +11 -0
  22. package/lib/panel-component/user-message/async-action/async-action/async-action.provider.cjs +44 -40
  23. package/lib/util/ai-chat-util/ai-chat-util.cjs +324 -242
  24. package/lib/web-app/main.cjs +1 -1
  25. package/package.json +5 -5
  26. package/src/editor/index.ts +7 -1
  27. package/src/editor/work-space/embed-work-space/embed-work-space.scss +8 -0
  28. package/src/editor/work-space/embed-work-space/embed-work-space.tsx +78 -0
  29. package/src/editor/work-space/embed-work-space.controller.ts +70 -0
  30. package/src/editor/work-space/embed-work-space.provider.ts +28 -0
  31. package/src/editor/work-space/index.ts +3 -0
  32. package/src/panel-component/user-message/async-action/async-action/async-action.provider.ts +58 -42
  33. package/src/util/ai-chat-util/ai-chat-util.ts +418 -279
  34. package/src/web-app/main.ts +1 -1
@@ -91,7 +91,7 @@ async function runApp(plugins, opts) {
91
91
  ibiz.overlay = new overlayController.OverlayController();
92
92
  ibiz.inLineAIUtil = new inlineAiUtil.InLineAIUtil();
93
93
  ibiz.screenShotUtil = new screenShotUtil.ScreenShotUtil();
94
- ibiz.aiChatUtil = new aiChatUtil.AIChatUtil();
94
+ ibiz.aiChatUtil = new aiChatUtil.AIChatUtil(app);
95
95
  ibiz.util.text.format = (value, code) => {
96
96
  return app.config.globalProperties.$textFormat(value, code);
97
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.165",
3
+ "version": "0.7.41-alpha.167",
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.132",
34
+ "@ibiz-template-plugin/ai-chat": "^0.0.134",
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.18",
40
- "@ibiz-template/model-helper": "0.7.41-alpha.156",
41
- "@ibiz-template/runtime": "0.7.41-alpha.156",
40
+ "@ibiz-template/model-helper": "0.7.41-alpha.158",
41
+ "@ibiz-template/runtime": "0.7.41-alpha.158",
42
42
  "@ibiz-template/theme": "0.7.39",
43
- "@ibiz-template/vue3-util": "0.7.41-alpha.156",
43
+ "@ibiz-template/vue3-util": "0.7.41-alpha.158",
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",
@@ -68,6 +68,7 @@ import {
68
68
  import { IBizMapPicker, MapPickerEditorProvider } from './map-picker';
69
69
  import { EmbedAIChatEditorProvider, IBizEmbedAIChat } from './ai-chat';
70
70
  import { IBizHtmlPreview, HtmlPreviewEditorProvider } from './html-preview';
71
+ import { IBizEmbedWorkSpace, EmbedWorkSpaceProvider } from './work-space';
71
72
 
72
73
  export const IBizEditor = {
73
74
  install: (v: App): void => {
@@ -117,6 +118,7 @@ export const IBizEditor = {
117
118
  v.component(IBizCarousel.name, IBizCarousel);
118
119
  v.component(IBizMapPicker.name, IBizMapPicker);
119
120
  v.component(IBizEmbedAIChat.name!, IBizEmbedAIChat);
121
+ v.component(IBizEmbedWorkSpace.name!, IBizEmbedWorkSpace);
120
122
  v.component(
121
123
  'IBizHtml',
122
124
  defineAsyncComponent(() => import('./html/wang-editor/wang-editor')),
@@ -455,7 +457,11 @@ export const IBizEditor = {
455
457
  'TEXTAREA_EMBED_AI_CHAT',
456
458
  () => new EmbedAIChatEditorProvider(),
457
459
  );
458
-
460
+ // 嵌入工作空间
461
+ registerEditorProvider(
462
+ 'TEXTAREA_EMBED_WORK_SPACE',
463
+ () => new EmbedWorkSpaceProvider(),
464
+ );
459
465
  // 预置类型编辑器 `${predefinedType}_${editorType}`;
460
466
  registerEditorProvider(
461
467
  'FIELD_IMAGE_PICTURE_ONE',
@@ -0,0 +1,8 @@
1
+ @include b(embed-work-space) {
2
+ width: 100%;
3
+ height: 100%;
4
+ @include e(container) {
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+ }
@@ -0,0 +1,78 @@
1
+ /* eslint-disable no-nested-ternary */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ import { createUUID } from 'qx-util';
4
+ import { Ref, ref, onMounted, onUnmounted, defineComponent } from 'vue';
5
+ import { convertNavData } from '@ibiz-template/runtime';
6
+ import {
7
+ getEditorEmits,
8
+ getInputProps,
9
+ useNamespace,
10
+ } from '@ibiz-template/vue3-util';
11
+ import { EmbedWorkSpaceController } from '../embed-work-space.controller';
12
+ import './embed-work-space.scss';
13
+
14
+ export const IBizEmbedWorkSpace = defineComponent({
15
+ name: 'IBizEmbedWorkSpace',
16
+ props: getInputProps<EmbedWorkSpaceController>(),
17
+ emits: getEditorEmits(),
18
+ setup(props) {
19
+ const ns = useNamespace('embed-work-space');
20
+ const c = props.controller;
21
+ // 挂载容器元素
22
+ const containerRef: Ref<HTMLElement | null> = ref(null);
23
+
24
+ // 挂载AI聊天框
25
+ const mountedAIChat = async () => {
26
+ const appDataEntityId = c.model.appDataEntityId;
27
+ if (!appDataEntityId || !c.deACMode || !c.workSpaceInstance) return;
28
+
29
+ const editorParams = { ...c.editorParams };
30
+ if (editorParams && Object.keys(editorParams).length > 0) {
31
+ const addParams = convertNavData(editorParams, {}, c.context, c.params);
32
+ Object.assign(editorParams, addParams);
33
+ }
34
+ const sessionid = editorParams.srfsessionid || createUUID();
35
+ const tempParams = { ...c.params, srfactag: c.deACMode.codeName };
36
+ const { chatOptions } = await ibiz.aiChatUtil.getEditorExAIChatParams(
37
+ editorParams,
38
+ c.context,
39
+ c.params,
40
+ props.data,
41
+ c.deACMode,
42
+ { chatInstance: c.workSpaceInstance, view: c.view, ctrl: c.ctrl },
43
+ );
44
+
45
+ const workSpaceInstance: IData = {
46
+ ...chatOptions,
47
+ container: containerRef.value,
48
+ context: { ...c.context },
49
+ params: tempParams,
50
+ appDataEntityId,
51
+ sessionid,
52
+ hideWorkSpaceHeader: editorParams.hideworkspaceheader === 'true',
53
+ };
54
+ c.workSpaceInstance.create(workSpaceInstance);
55
+ };
56
+
57
+ onMounted(() => {
58
+ mountedAIChat();
59
+ });
60
+
61
+ onUnmounted(() => {
62
+ c.workSpaceInstance?.close();
63
+ });
64
+
65
+ return {
66
+ c,
67
+ ns,
68
+ containerRef,
69
+ };
70
+ },
71
+ render() {
72
+ return (
73
+ <div class={this.ns.b()}>
74
+ <div class={this.ns.e('container')} ref='containerRef'></div>
75
+ </div>
76
+ );
77
+ },
78
+ });
@@ -0,0 +1,70 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import {
3
+ getDeACMode,
4
+ IAppDEService,
5
+ EditorController,
6
+ } from '@ibiz-template/runtime';
7
+ import { IAppDEACMode, ITextArea } from '@ibiz/model-core';
8
+
9
+ /**
10
+ * @description 嵌入式工作空间
11
+ * @export
12
+ * @class EmbedWorkSpaceController
13
+ * @extends {EditorController<ITextArea>}
14
+ */
15
+ export class EmbedWorkSpaceController extends EditorController<ITextArea> {
16
+ /**
17
+ * @description 工作空间实例
18
+ * @type {*}
19
+ * @memberof EmbedWorkSpaceController
20
+ */
21
+ public workSpaceInstance: any;
22
+
23
+ /**
24
+ * @description 应用实体服务
25
+ * @type {IAppDEService}
26
+ * @memberof EmbedWorkSpaceController
27
+ */
28
+ deService?: IAppDEService;
29
+
30
+ /**
31
+ * @description 自填模式
32
+ * @type {IAppDEACMode}
33
+ * @memberof EmbedWorkSpaceController
34
+ */
35
+ deACMode?: IAppDEACMode;
36
+
37
+ /**
38
+ * @description 初始化
39
+ * @protected
40
+ * @returns {*} {Promise<void>}
41
+ * @memberof EmbedWorkSpaceController
42
+ */
43
+ protected async onInit(): Promise<void> {
44
+ await super.onInit();
45
+ const model = this.model;
46
+ if (model.appDEACModeId) {
47
+ // 1.自填模式
48
+ this.deACMode = await getDeACMode(
49
+ model.appDEACModeId,
50
+ model.appDataEntityId!,
51
+ this.context.srfappid,
52
+ );
53
+ if (this.deACMode) {
54
+ if (this.deACMode.actype === 'CHATCOMPLETION' && ibiz.env.enableAI) {
55
+ // 2.实体服务
56
+ this.deService = await ibiz.hub
57
+ .getApp(model.appId)
58
+ .deService.getService(this.context, model.appDataEntityId!);
59
+ }
60
+ }
61
+ }
62
+ // 3.创建工作空间实例
63
+ const module = await import('@ibiz-template-plugin/ai-chat');
64
+ if (module && module.createWorkSpace) {
65
+ this.workSpaceInstance = module.createWorkSpace();
66
+ } else if (module && module.default && module.default.createWorkSpace) {
67
+ this.workSpaceInstance = module.default.createWorkSpace();
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,28 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import {
3
+ IEditorContainerController,
4
+ IEditorProvider,
5
+ } from '@ibiz-template/runtime';
6
+ import { ITextBox } from '@ibiz/model-core';
7
+ import { EmbedWorkSpaceController } from './embed-work-space.controller';
8
+
9
+ /**
10
+ * @description 嵌入式工作空间
11
+ * @export
12
+ * @class EmbedWorkSpaceProvider
13
+ * @implements {IEditorProvider}
14
+ */
15
+ export class EmbedWorkSpaceProvider implements IEditorProvider {
16
+ formEditor: string = 'IBizEmbedWorkSpace';
17
+
18
+ gridEditor: string = 'IBizEmbedWorkSpace';
19
+
20
+ async createController(
21
+ editorModel: ITextBox,
22
+ parentController: IEditorContainerController,
23
+ ): Promise<EmbedWorkSpaceController> {
24
+ const c = new EmbedWorkSpaceController(editorModel, parentController);
25
+ await c.init();
26
+ return c;
27
+ }
28
+ }
@@ -0,0 +1,3 @@
1
+ export { IBizEmbedWorkSpace } from './embed-work-space/embed-work-space';
2
+ export { EmbedWorkSpaceController } from './embed-work-space.controller';
3
+ export { EmbedWorkSpaceProvider } from './embed-work-space.provider';
@@ -7,6 +7,63 @@ import { AsyncActionResult } from '../async-action-result/async-action-result';
7
7
  import { AsyncDataExport } from '../async-data-export/async-data-export';
8
8
  import { AsyncAction } from './async-action';
9
9
 
10
+ /**
11
+ * 打开异步作业详情弹窗,按作业类型选择对应展示组件
12
+ * @author zk
13
+ * @date 2026-11-19
14
+ * @param {IPortalAsyncAction} asyncAction
15
+ * @return {*} {boolean} 是否打开了弹窗
16
+ */
17
+ export async function openAsyncActionModal(
18
+ asyncAction: IPortalAsyncAction,
19
+ ): Promise<boolean> {
20
+ if (
21
+ isNil(asyncAction.actiontype) ||
22
+ asyncAction.actiontype === 'asyncaction'
23
+ ) {
24
+ ibiz.overlay.modal(
25
+ (modal: IModal) => {
26
+ return h(AsyncActionResult, {
27
+ asyncAction,
28
+ modal,
29
+ });
30
+ },
31
+ {},
32
+ { width: '80%', height: '80%' },
33
+ );
34
+ return true;
35
+ }
36
+ // 导出数据
37
+ if (asyncAction.actiontype === 'DEEXPORTDATA') {
38
+ ibiz.overlay.modal(
39
+ (modal: IModal) => {
40
+ return h(AsyncDataExport, {
41
+ asyncAction,
42
+ modal,
43
+ });
44
+ },
45
+ {},
46
+ { width: '80%', height: '80%' },
47
+ );
48
+ return true;
49
+ }
50
+ // 导入数据,actionresult有值且是对象时才能打开详情页面
51
+ if (isObject(asyncAction.actionresult)) {
52
+ ibiz.overlay.modal(
53
+ (modal: IModal) => {
54
+ return h(AsyncActionPreview, {
55
+ asyncAction,
56
+ modal,
57
+ });
58
+ },
59
+ {},
60
+ { width: '80%', height: '80%' },
61
+ );
62
+ return true;
63
+ }
64
+ return false;
65
+ }
66
+
10
67
  export class AsyncActionProvider implements IAsyncActionProvider {
11
68
  component = AsyncAction;
12
69
 
@@ -21,47 +78,6 @@ export class AsyncActionProvider implements IAsyncActionProvider {
21
78
  asyncAction: IPortalAsyncAction,
22
79
  _event: MouseEvent,
23
80
  ): Promise<boolean> {
24
- if (isNil(asyncAction.actiontype)) {
25
- ibiz.overlay.modal(
26
- (modal: IModal) => {
27
- return h(AsyncActionResult, {
28
- asyncAction,
29
- modal,
30
- });
31
- },
32
- {},
33
- { width: '80%', height: '80%' },
34
- );
35
- return true;
36
- }
37
- // 导出数据
38
- if (asyncAction.actiontype === 'DEEXPORTDATA') {
39
- ibiz.overlay.modal(
40
- (modal: IModal) => {
41
- return h(AsyncDataExport, {
42
- asyncAction,
43
- modal,
44
- });
45
- },
46
- {},
47
- { width: '80%', height: '80%' },
48
- );
49
- return true;
50
- }
51
- // 导入数据,actionresult有值且是对象时才能打开详情页面
52
- if (isObject(asyncAction.actionresult)) {
53
- ibiz.overlay.modal(
54
- (modal: IModal) => {
55
- return h(AsyncActionPreview, {
56
- asyncAction,
57
- modal,
58
- });
59
- },
60
- {},
61
- { width: '80%', height: '80%' },
62
- );
63
- return true;
64
- }
65
- return false;
81
+ return openAsyncActionModal(asyncAction);
66
82
  }
67
83
  }