@ibiz-template/vue3-components 0.7.41-alpha.165 → 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-li-EqXGB.js → index-CCoBeNIV.js} +6 -6
- package/dist/{index.es-CA0rGKdK.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-BPGsMZgX.js → wang-editor-B0ZpE6o-.js} +1 -1
- package/dist/{xlsx-util-Bv9fDQB8.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 +217 -240
- 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 +217 -240
- 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 +256 -276
|
@@ -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;
|