@ibiz-template/vue3-components 0.7.41-alpha.164 → 0.7.41-alpha.166
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.
- package/dist/{index-DWRQ9IG6.js → index-CCoBeNIV.js} +6 -6
- package/dist/{index.es-BJBzhTrX.js → index.es-D1vng-7i.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-DtLGL_ju.js → wang-editor-B0ZpE6o-.js} +1 -1
- package/dist/{xlsx-util-k3HzMMjk.js → xlsx-util-Djaaq9Po.js} +1 -1
- package/es/editor/index.mjs +8 -0
- package/es/editor/work-space/embed-work-space/embed-work-space.css +1 -0
- package/es/editor/work-space/embed-work-space/embed-work-space.mjs +75 -0
- package/es/editor/work-space/embed-work-space.controller.mjs +62 -0
- package/es/editor/work-space/embed-work-space.provider.mjs +22 -0
- package/es/editor/work-space/index.mjs +5 -0
- package/es/util/ai-chat-util/ai-chat-util.mjs +311 -252
- package/es/util/message-util/message-util.mjs +12 -8
- package/es/util/notification-util/notification-util.mjs +1 -0
- package/lib/editor/index.cjs +8 -0
- package/lib/editor/work-space/embed-work-space/embed-work-space.cjs +77 -0
- package/lib/editor/work-space/embed-work-space/embed-work-space.css +1 -0
- package/lib/editor/work-space/embed-work-space.controller.cjs +64 -0
- package/lib/editor/work-space/embed-work-space.provider.cjs +24 -0
- package/lib/editor/work-space/index.cjs +11 -0
- package/lib/util/ai-chat-util/ai-chat-util.cjs +311 -252
- package/lib/util/message-util/message-util.cjs +12 -8
- package/lib/util/notification-util/notification-util.cjs +1 -0
- package/package.json +5 -5
- package/src/editor/index.ts +7 -1
- package/src/editor/work-space/embed-work-space/embed-work-space.scss +8 -0
- package/src/editor/work-space/embed-work-space/embed-work-space.tsx +78 -0
- package/src/editor/work-space/embed-work-space.controller.ts +70 -0
- package/src/editor/work-space/embed-work-space.provider.ts +28 -0
- package/src/editor/work-space/index.ts +3 -0
- package/src/util/ai-chat-util/ai-chat-util.ts +391 -287
- package/src/util/message-util/message-util.ts +8 -0
- package/src/util/notification-util/notification-util.ts +1 -0
package/es/editor/index.mjs
CHANGED
|
@@ -32,6 +32,7 @@ import './date-range-select/index.mjs';
|
|
|
32
32
|
import './map-picker/index.mjs';
|
|
33
33
|
import './ai-chat/index.mjs';
|
|
34
34
|
import './html-preview/index.mjs';
|
|
35
|
+
import './work-space/index.mjs';
|
|
35
36
|
import { IBizImageCropping } from './upload/ibiz-image-cropping/ibiz-image-cropping.mjs';
|
|
36
37
|
import { IBizSpan } from './span/span/span.mjs';
|
|
37
38
|
import { IBizSpanLink } from './span/span-link/span-link.mjs';
|
|
@@ -76,6 +77,7 @@ import { IBizSearchCondEdit } from './user/ibiz-searchcond-edit/ibiz-searchcond-
|
|
|
76
77
|
import { IBizCarousel } from './carousel/ibiz-carousel/ibiz-carousel.mjs';
|
|
77
78
|
import { IBizMapPicker } from './map-picker/ibiz-map-picker/ibiz-map-picker.mjs';
|
|
78
79
|
import { IBizEmbedAIChat } from './ai-chat/embed-ai-chat/embed-ai-chat.mjs';
|
|
80
|
+
import { IBizEmbedWorkSpace } from './work-space/embed-work-space/embed-work-space.mjs';
|
|
79
81
|
import { IBizHtmlPreview } from './html-preview/ibiz-html-preview/ibiz-html-preview.mjs';
|
|
80
82
|
import { IBizDateRangeSelect } from './date-range-select/date-range-select-picker/date-range-select.mjs';
|
|
81
83
|
import { IBizVirtualizedList } from './dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.mjs';
|
|
@@ -108,6 +110,7 @@ import { ColorPickerEditorProvider } from './color-picker/color-picker-editor.pr
|
|
|
108
110
|
import { SearchCondEditEditorProvider } from './user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.mjs';
|
|
109
111
|
import { MapPickerEditorProvider } from './map-picker/map-picker-editor.provider.mjs';
|
|
110
112
|
import { EmbedAIChatEditorProvider } from './ai-chat/embed-ai-chat-editor.provider.mjs';
|
|
113
|
+
import { EmbedWorkSpaceProvider } from './work-space/embed-work-space.provider.mjs';
|
|
111
114
|
import { CarouselEditorProvider } from './carousel/carousel-editor.provider.mjs';
|
|
112
115
|
|
|
113
116
|
"use strict";
|
|
@@ -158,6 +161,7 @@ const IBizEditor = {
|
|
|
158
161
|
v.component(IBizCarousel.name, IBizCarousel);
|
|
159
162
|
v.component(IBizMapPicker.name, IBizMapPicker);
|
|
160
163
|
v.component(IBizEmbedAIChat.name, IBizEmbedAIChat);
|
|
164
|
+
v.component(IBizEmbedWorkSpace.name, IBizEmbedWorkSpace);
|
|
161
165
|
v.component(
|
|
162
166
|
"IBizHtml",
|
|
163
167
|
defineAsyncComponent(() => import('./html/wang-editor/wang-editor.mjs'))
|
|
@@ -455,6 +459,10 @@ const IBizEditor = {
|
|
|
455
459
|
"TEXTAREA_EMBED_AI_CHAT",
|
|
456
460
|
() => new EmbedAIChatEditorProvider()
|
|
457
461
|
);
|
|
462
|
+
registerEditorProvider(
|
|
463
|
+
"TEXTAREA_EMBED_WORK_SPACE",
|
|
464
|
+
() => new EmbedWorkSpaceProvider()
|
|
465
|
+
);
|
|
458
466
|
registerEditorProvider(
|
|
459
467
|
"FIELD_IMAGE_PICTURE_ONE",
|
|
460
468
|
() => new FileUploaderEditorProvider("PICTURE_ONE")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-embed-work-space{width:100%;height:100%}.ibiz-embed-work-space__container{width:100%;height:100%}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defineComponent, createVNode, ref, onMounted, onUnmounted } from 'vue';
|
|
2
|
+
import { createUUID } from 'qx-util';
|
|
3
|
+
import { convertNavData } from '@ibiz-template/runtime';
|
|
4
|
+
import { useNamespace, getEditorEmits, getInputProps } from '@ibiz-template/vue3-util';
|
|
5
|
+
import './embed-work-space.css';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const IBizEmbedWorkSpace = /* @__PURE__ */ defineComponent({
|
|
9
|
+
name: "IBizEmbedWorkSpace",
|
|
10
|
+
props: getInputProps(),
|
|
11
|
+
emits: getEditorEmits(),
|
|
12
|
+
setup(props) {
|
|
13
|
+
const ns = useNamespace("embed-work-space");
|
|
14
|
+
const c = props.controller;
|
|
15
|
+
const containerRef = ref(null);
|
|
16
|
+
const mountedAIChat = async () => {
|
|
17
|
+
const appDataEntityId = c.model.appDataEntityId;
|
|
18
|
+
if (!appDataEntityId || !c.deACMode || !c.workSpaceInstance)
|
|
19
|
+
return;
|
|
20
|
+
const editorParams = {
|
|
21
|
+
...c.editorParams
|
|
22
|
+
};
|
|
23
|
+
if (editorParams && Object.keys(editorParams).length > 0) {
|
|
24
|
+
const addParams = convertNavData(editorParams, {}, c.context, c.params);
|
|
25
|
+
Object.assign(editorParams, addParams);
|
|
26
|
+
}
|
|
27
|
+
const sessionid = editorParams.srfsessionid || createUUID();
|
|
28
|
+
const tempParams = {
|
|
29
|
+
...c.params,
|
|
30
|
+
srfactag: c.deACMode.codeName
|
|
31
|
+
};
|
|
32
|
+
const {
|
|
33
|
+
chatOptions
|
|
34
|
+
} = await ibiz.aiChatUtil.getEditorExAIChatParams(editorParams, c.context, c.params, props.data, c.deACMode, {
|
|
35
|
+
chatInstance: c.workSpaceInstance,
|
|
36
|
+
view: c.view,
|
|
37
|
+
ctrl: c.ctrl
|
|
38
|
+
});
|
|
39
|
+
const workSpaceInstance = {
|
|
40
|
+
...chatOptions,
|
|
41
|
+
container: containerRef.value,
|
|
42
|
+
context: {
|
|
43
|
+
...c.context
|
|
44
|
+
},
|
|
45
|
+
params: tempParams,
|
|
46
|
+
appDataEntityId,
|
|
47
|
+
sessionid,
|
|
48
|
+
hideWorkSpaceHeader: editorParams.hideworkspaceheader === "true"
|
|
49
|
+
};
|
|
50
|
+
c.workSpaceInstance.create(workSpaceInstance);
|
|
51
|
+
};
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
mountedAIChat();
|
|
54
|
+
});
|
|
55
|
+
onUnmounted(() => {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = c.workSpaceInstance) == null ? void 0 : _a.close();
|
|
58
|
+
});
|
|
59
|
+
return {
|
|
60
|
+
c,
|
|
61
|
+
ns,
|
|
62
|
+
containerRef
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
render() {
|
|
66
|
+
return createVNode("div", {
|
|
67
|
+
"class": this.ns.b()
|
|
68
|
+
}, [createVNode("div", {
|
|
69
|
+
"class": this.ns.e("container"),
|
|
70
|
+
"ref": "containerRef"
|
|
71
|
+
}, null)]);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export { IBizEmbedWorkSpace };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { EditorController, getDeACMode } from '@ibiz-template/runtime';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => {
|
|
7
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
class EmbedWorkSpaceController extends EditorController {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* @description 工作空间实例
|
|
15
|
+
* @type {*}
|
|
16
|
+
* @memberof EmbedWorkSpaceController
|
|
17
|
+
*/
|
|
18
|
+
__publicField(this, "workSpaceInstance");
|
|
19
|
+
/**
|
|
20
|
+
* @description 应用实体服务
|
|
21
|
+
* @type {IAppDEService}
|
|
22
|
+
* @memberof EmbedWorkSpaceController
|
|
23
|
+
*/
|
|
24
|
+
__publicField(this, "deService");
|
|
25
|
+
/**
|
|
26
|
+
* @description 自填模式
|
|
27
|
+
* @type {IAppDEACMode}
|
|
28
|
+
* @memberof EmbedWorkSpaceController
|
|
29
|
+
*/
|
|
30
|
+
__publicField(this, "deACMode");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @description 初始化
|
|
34
|
+
* @protected
|
|
35
|
+
* @returns {*} {Promise<void>}
|
|
36
|
+
* @memberof EmbedWorkSpaceController
|
|
37
|
+
*/
|
|
38
|
+
async onInit() {
|
|
39
|
+
await super.onInit();
|
|
40
|
+
const model = this.model;
|
|
41
|
+
if (model.appDEACModeId) {
|
|
42
|
+
this.deACMode = await getDeACMode(
|
|
43
|
+
model.appDEACModeId,
|
|
44
|
+
model.appDataEntityId,
|
|
45
|
+
this.context.srfappid
|
|
46
|
+
);
|
|
47
|
+
if (this.deACMode) {
|
|
48
|
+
if (this.deACMode.actype === "CHATCOMPLETION" && ibiz.env.enableAI) {
|
|
49
|
+
this.deService = await ibiz.hub.getApp(model.appId).deService.getService(this.context, model.appDataEntityId);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const module = await import('@ibiz-template-plugin/ai-chat');
|
|
54
|
+
if (module && module.createWorkSpace) {
|
|
55
|
+
this.workSpaceInstance = module.createWorkSpace();
|
|
56
|
+
} else if (module && module.default && module.default.createWorkSpace) {
|
|
57
|
+
this.workSpaceInstance = module.default.createWorkSpace();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { EmbedWorkSpaceController };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EmbedWorkSpaceController } from './embed-work-space.controller.mjs';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => {
|
|
7
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
class EmbedWorkSpaceProvider {
|
|
11
|
+
constructor() {
|
|
12
|
+
__publicField(this, "formEditor", "IBizEmbedWorkSpace");
|
|
13
|
+
__publicField(this, "gridEditor", "IBizEmbedWorkSpace");
|
|
14
|
+
}
|
|
15
|
+
async createController(editorModel, parentController) {
|
|
16
|
+
const c = new EmbedWorkSpaceController(editorModel, parentController);
|
|
17
|
+
await c.init();
|
|
18
|
+
return c;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { EmbedWorkSpaceProvider };
|