@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.
- package/dist/{index-li-EqXGB.js → index-DXoEi5m-.js} +28 -28
- package/dist/{index.es-CA0rGKdK.js → index.es-nZgG-TGm.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-BPGsMZgX.js → wang-editor-CK60NH54.js} +1 -1
- package/dist/{xlsx-util-Bv9fDQB8.js → xlsx-util-5Xgq-UOe.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/panel-component/user-message/async-action/async-action/async-action.provider.mjs +44 -41
- package/es/util/ai-chat-util/ai-chat-util.mjs +326 -244
- package/es/web-app/main.mjs +1 -1
- 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/panel-component/user-message/async-action/async-action/async-action.provider.cjs +44 -40
- package/lib/util/ai-chat-util/ai-chat-util.cjs +324 -242
- package/lib/web-app/main.cjs +1 -1
- 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/panel-component/user-message/async-action/async-action/async-action.provider.ts +58 -42
- package/src/util/ai-chat-util/ai-chat-util.ts +418 -279
- package/src/web-app/main.ts +1 -1
package/es/web-app/main.mjs
CHANGED
|
@@ -89,7 +89,7 @@ async function runApp(plugins, opts) {
|
|
|
89
89
|
ibiz.overlay = new OverlayController();
|
|
90
90
|
ibiz.inLineAIUtil = new InLineAIUtil();
|
|
91
91
|
ibiz.screenShotUtil = new ScreenShotUtil();
|
|
92
|
-
ibiz.aiChatUtil = new AIChatUtil();
|
|
92
|
+
ibiz.aiChatUtil = new AIChatUtil(app);
|
|
93
93
|
ibiz.util.text.format = (value, code) => {
|
|
94
94
|
return app.config.globalProperties.$textFormat(value, code);
|
|
95
95
|
};
|
package/lib/editor/index.cjs
CHANGED
|
@@ -36,6 +36,7 @@ require('./date-range-select/index.cjs');
|
|
|
36
36
|
require('./map-picker/index.cjs');
|
|
37
37
|
require('./ai-chat/index.cjs');
|
|
38
38
|
require('./html-preview/index.cjs');
|
|
39
|
+
require('./work-space/index.cjs');
|
|
39
40
|
var ibizImageCropping = require('./upload/ibiz-image-cropping/ibiz-image-cropping.cjs');
|
|
40
41
|
var span = require('./span/span/span.cjs');
|
|
41
42
|
var spanLink = require('./span/span-link/span-link.cjs');
|
|
@@ -80,6 +81,7 @@ var ibizSearchcondEdit = require('./user/ibiz-searchcond-edit/ibiz-searchcond-ed
|
|
|
80
81
|
var ibizCarousel = require('./carousel/ibiz-carousel/ibiz-carousel.cjs');
|
|
81
82
|
var ibizMapPicker = require('./map-picker/ibiz-map-picker/ibiz-map-picker.cjs');
|
|
82
83
|
var embedAiChat = require('./ai-chat/embed-ai-chat/embed-ai-chat.cjs');
|
|
84
|
+
var embedWorkSpace = require('./work-space/embed-work-space/embed-work-space.cjs');
|
|
83
85
|
var ibizHtmlPreview = require('./html-preview/ibiz-html-preview/ibiz-html-preview.cjs');
|
|
84
86
|
var dateRangeSelect = require('./date-range-select/date-range-select-picker/date-range-select.cjs');
|
|
85
87
|
var ibizVirtualizedList = require('./dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.cjs');
|
|
@@ -112,6 +114,7 @@ var colorPickerEditor_provider = require('./color-picker/color-picker-editor.pro
|
|
|
112
114
|
var ibizSearchcondEdit_provider = require('./user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.cjs');
|
|
113
115
|
var mapPickerEditor_provider = require('./map-picker/map-picker-editor.provider.cjs');
|
|
114
116
|
var embedAiChatEditor_provider = require('./ai-chat/embed-ai-chat-editor.provider.cjs');
|
|
117
|
+
var embedWorkSpace_provider = require('./work-space/embed-work-space.provider.cjs');
|
|
115
118
|
var carouselEditor_provider = require('./carousel/carousel-editor.provider.cjs');
|
|
116
119
|
|
|
117
120
|
"use strict";
|
|
@@ -162,6 +165,7 @@ const IBizEditor = {
|
|
|
162
165
|
v.component(ibizCarousel.IBizCarousel.name, ibizCarousel.IBizCarousel);
|
|
163
166
|
v.component(ibizMapPicker.IBizMapPicker.name, ibizMapPicker.IBizMapPicker);
|
|
164
167
|
v.component(embedAiChat.IBizEmbedAIChat.name, embedAiChat.IBizEmbedAIChat);
|
|
168
|
+
v.component(embedWorkSpace.IBizEmbedWorkSpace.name, embedWorkSpace.IBizEmbedWorkSpace);
|
|
165
169
|
v.component(
|
|
166
170
|
"IBizHtml",
|
|
167
171
|
vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('./html/wang-editor/wang-editor.cjs'); }))
|
|
@@ -459,6 +463,10 @@ const IBizEditor = {
|
|
|
459
463
|
"TEXTAREA_EMBED_AI_CHAT",
|
|
460
464
|
() => new embedAiChatEditor_provider.EmbedAIChatEditorProvider()
|
|
461
465
|
);
|
|
466
|
+
runtime.registerEditorProvider(
|
|
467
|
+
"TEXTAREA_EMBED_WORK_SPACE",
|
|
468
|
+
() => new embedWorkSpace_provider.EmbedWorkSpaceProvider()
|
|
469
|
+
);
|
|
462
470
|
runtime.registerEditorProvider(
|
|
463
471
|
"FIELD_IMAGE_PICTURE_ONE",
|
|
464
472
|
() => new uploadEditor_provider.FileUploaderEditorProvider("PICTURE_ONE")
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var qxUtil = require('qx-util');
|
|
5
|
+
var runtime = require('@ibiz-template/runtime');
|
|
6
|
+
var vue3Util = require('@ibiz-template/vue3-util');
|
|
7
|
+
require('./embed-work-space.css');
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
const IBizEmbedWorkSpace = /* @__PURE__ */ vue.defineComponent({
|
|
11
|
+
name: "IBizEmbedWorkSpace",
|
|
12
|
+
props: vue3Util.getInputProps(),
|
|
13
|
+
emits: vue3Util.getEditorEmits(),
|
|
14
|
+
setup(props) {
|
|
15
|
+
const ns = vue3Util.useNamespace("embed-work-space");
|
|
16
|
+
const c = props.controller;
|
|
17
|
+
const containerRef = vue.ref(null);
|
|
18
|
+
const mountedAIChat = async () => {
|
|
19
|
+
const appDataEntityId = c.model.appDataEntityId;
|
|
20
|
+
if (!appDataEntityId || !c.deACMode || !c.workSpaceInstance)
|
|
21
|
+
return;
|
|
22
|
+
const editorParams = {
|
|
23
|
+
...c.editorParams
|
|
24
|
+
};
|
|
25
|
+
if (editorParams && Object.keys(editorParams).length > 0) {
|
|
26
|
+
const addParams = runtime.convertNavData(editorParams, {}, c.context, c.params);
|
|
27
|
+
Object.assign(editorParams, addParams);
|
|
28
|
+
}
|
|
29
|
+
const sessionid = editorParams.srfsessionid || qxUtil.createUUID();
|
|
30
|
+
const tempParams = {
|
|
31
|
+
...c.params,
|
|
32
|
+
srfactag: c.deACMode.codeName
|
|
33
|
+
};
|
|
34
|
+
const {
|
|
35
|
+
chatOptions
|
|
36
|
+
} = await ibiz.aiChatUtil.getEditorExAIChatParams(editorParams, c.context, c.params, props.data, c.deACMode, {
|
|
37
|
+
chatInstance: c.workSpaceInstance,
|
|
38
|
+
view: c.view,
|
|
39
|
+
ctrl: c.ctrl
|
|
40
|
+
});
|
|
41
|
+
const workSpaceInstance = {
|
|
42
|
+
...chatOptions,
|
|
43
|
+
container: containerRef.value,
|
|
44
|
+
context: {
|
|
45
|
+
...c.context
|
|
46
|
+
},
|
|
47
|
+
params: tempParams,
|
|
48
|
+
appDataEntityId,
|
|
49
|
+
sessionid,
|
|
50
|
+
hideWorkSpaceHeader: editorParams.hideworkspaceheader === "true"
|
|
51
|
+
};
|
|
52
|
+
c.workSpaceInstance.create(workSpaceInstance);
|
|
53
|
+
};
|
|
54
|
+
vue.onMounted(() => {
|
|
55
|
+
mountedAIChat();
|
|
56
|
+
});
|
|
57
|
+
vue.onUnmounted(() => {
|
|
58
|
+
var _a;
|
|
59
|
+
(_a = c.workSpaceInstance) == null ? void 0 : _a.close();
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
c,
|
|
63
|
+
ns,
|
|
64
|
+
containerRef
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
render() {
|
|
68
|
+
return vue.createVNode("div", {
|
|
69
|
+
"class": this.ns.b()
|
|
70
|
+
}, [vue.createVNode("div", {
|
|
71
|
+
"class": this.ns.e("container"),
|
|
72
|
+
"ref": "containerRef"
|
|
73
|
+
}, null)]);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
exports.IBizEmbedWorkSpace = IBizEmbedWorkSpace;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-embed-work-space{width:100%;height:100%}.ibiz-embed-work-space__container{width:100%;height:100%}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var runtime = require('@ibiz-template/runtime');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __publicField = (obj, key, value) => {
|
|
9
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
class EmbedWorkSpaceController extends runtime.EditorController {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
/**
|
|
16
|
+
* @description 工作空间实例
|
|
17
|
+
* @type {*}
|
|
18
|
+
* @memberof EmbedWorkSpaceController
|
|
19
|
+
*/
|
|
20
|
+
__publicField(this, "workSpaceInstance");
|
|
21
|
+
/**
|
|
22
|
+
* @description 应用实体服务
|
|
23
|
+
* @type {IAppDEService}
|
|
24
|
+
* @memberof EmbedWorkSpaceController
|
|
25
|
+
*/
|
|
26
|
+
__publicField(this, "deService");
|
|
27
|
+
/**
|
|
28
|
+
* @description 自填模式
|
|
29
|
+
* @type {IAppDEACMode}
|
|
30
|
+
* @memberof EmbedWorkSpaceController
|
|
31
|
+
*/
|
|
32
|
+
__publicField(this, "deACMode");
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @description 初始化
|
|
36
|
+
* @protected
|
|
37
|
+
* @returns {*} {Promise<void>}
|
|
38
|
+
* @memberof EmbedWorkSpaceController
|
|
39
|
+
*/
|
|
40
|
+
async onInit() {
|
|
41
|
+
await super.onInit();
|
|
42
|
+
const model = this.model;
|
|
43
|
+
if (model.appDEACModeId) {
|
|
44
|
+
this.deACMode = await runtime.getDeACMode(
|
|
45
|
+
model.appDEACModeId,
|
|
46
|
+
model.appDataEntityId,
|
|
47
|
+
this.context.srfappid
|
|
48
|
+
);
|
|
49
|
+
if (this.deACMode) {
|
|
50
|
+
if (this.deACMode.actype === "CHATCOMPLETION" && ibiz.env.enableAI) {
|
|
51
|
+
this.deService = await ibiz.hub.getApp(model.appId).deService.getService(this.context, model.appDataEntityId);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const module = await import('@ibiz-template-plugin/ai-chat');
|
|
56
|
+
if (module && module.createWorkSpace) {
|
|
57
|
+
this.workSpaceInstance = module.createWorkSpace();
|
|
58
|
+
} else if (module && module.default && module.default.createWorkSpace) {
|
|
59
|
+
this.workSpaceInstance = module.default.createWorkSpace();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
exports.EmbedWorkSpaceController = EmbedWorkSpaceController;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var embedWorkSpace_controller = require('./embed-work-space.controller.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __publicField = (obj, key, value) => {
|
|
9
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
class EmbedWorkSpaceProvider {
|
|
13
|
+
constructor() {
|
|
14
|
+
__publicField(this, "formEditor", "IBizEmbedWorkSpace");
|
|
15
|
+
__publicField(this, "gridEditor", "IBizEmbedWorkSpace");
|
|
16
|
+
}
|
|
17
|
+
async createController(editorModel, parentController) {
|
|
18
|
+
const c = new embedWorkSpace_controller.EmbedWorkSpaceController(editorModel, parentController);
|
|
19
|
+
await c.init();
|
|
20
|
+
return c;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.EmbedWorkSpaceProvider = EmbedWorkSpaceProvider;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var embedWorkSpace = require('./embed-work-space/embed-work-space.cjs');
|
|
4
|
+
var embedWorkSpace_controller = require('./embed-work-space.controller.cjs');
|
|
5
|
+
var embedWorkSpace_provider = require('./embed-work-space.provider.cjs');
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
exports.IBizEmbedWorkSpace = embedWorkSpace.IBizEmbedWorkSpace;
|
|
10
|
+
exports.EmbedWorkSpaceController = embedWorkSpace_controller.EmbedWorkSpaceController;
|
|
11
|
+
exports.EmbedWorkSpaceProvider = embedWorkSpace_provider.EmbedWorkSpaceProvider;
|
package/lib/panel-component/user-message/async-action/async-action/async-action.provider.cjs
CHANGED
|
@@ -14,6 +14,48 @@ var __publicField = (obj, key, value) => {
|
|
|
14
14
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15
15
|
return value;
|
|
16
16
|
};
|
|
17
|
+
async function openAsyncActionModal(asyncAction) {
|
|
18
|
+
if (lodashEs.isNil(asyncAction.actiontype) || asyncAction.actiontype === "asyncaction") {
|
|
19
|
+
ibiz.overlay.modal(
|
|
20
|
+
(modal) => {
|
|
21
|
+
return vue.h(asyncActionResult.AsyncActionResult, {
|
|
22
|
+
asyncAction,
|
|
23
|
+
modal
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
{},
|
|
27
|
+
{ width: "80%", height: "80%" }
|
|
28
|
+
);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (asyncAction.actiontype === "DEEXPORTDATA") {
|
|
32
|
+
ibiz.overlay.modal(
|
|
33
|
+
(modal) => {
|
|
34
|
+
return vue.h(asyncDataExport.AsyncDataExport, {
|
|
35
|
+
asyncAction,
|
|
36
|
+
modal
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
{},
|
|
40
|
+
{ width: "80%", height: "80%" }
|
|
41
|
+
);
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
if (lodashEs.isObject(asyncAction.actionresult)) {
|
|
45
|
+
ibiz.overlay.modal(
|
|
46
|
+
(modal) => {
|
|
47
|
+
return vue.h(asyncActionPreview.AsyncActionPreview, {
|
|
48
|
+
asyncAction,
|
|
49
|
+
modal
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
{},
|
|
53
|
+
{ width: "80%", height: "80%" }
|
|
54
|
+
);
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
17
59
|
class AsyncActionProvider {
|
|
18
60
|
constructor() {
|
|
19
61
|
__publicField(this, "component", asyncAction.AsyncAction);
|
|
@@ -25,47 +67,9 @@ class AsyncActionProvider {
|
|
|
25
67
|
});
|
|
26
68
|
}
|
|
27
69
|
async onClick(asyncAction, _event) {
|
|
28
|
-
|
|
29
|
-
ibiz.overlay.modal(
|
|
30
|
-
(modal) => {
|
|
31
|
-
return vue.h(asyncActionResult.AsyncActionResult, {
|
|
32
|
-
asyncAction,
|
|
33
|
-
modal
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
{},
|
|
37
|
-
{ width: "80%", height: "80%" }
|
|
38
|
-
);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
if (asyncAction.actiontype === "DEEXPORTDATA") {
|
|
42
|
-
ibiz.overlay.modal(
|
|
43
|
-
(modal) => {
|
|
44
|
-
return vue.h(asyncDataExport.AsyncDataExport, {
|
|
45
|
-
asyncAction,
|
|
46
|
-
modal
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
{},
|
|
50
|
-
{ width: "80%", height: "80%" }
|
|
51
|
-
);
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
if (lodashEs.isObject(asyncAction.actionresult)) {
|
|
55
|
-
ibiz.overlay.modal(
|
|
56
|
-
(modal) => {
|
|
57
|
-
return vue.h(asyncActionPreview.AsyncActionPreview, {
|
|
58
|
-
asyncAction,
|
|
59
|
-
modal
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
{},
|
|
63
|
-
{ width: "80%", height: "80%" }
|
|
64
|
-
);
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
return false;
|
|
70
|
+
return openAsyncActionModal(asyncAction);
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
exports.AsyncActionProvider = AsyncActionProvider;
|
|
75
|
+
exports.openAsyncActionModal = openAsyncActionModal;
|