@ibiz-template/vue3-components 0.7.41-alpha.124 → 0.7.41-alpha.126
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-BApiCD3N.js → index-D8zxjpzd.js} +3 -3
- package/dist/{index.es-16xILT5D.js → index.es-Dow2mflM.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-BjVpWCI4.js → wang-editor-Dt9B3mzl.js} +1 -1
- package/dist/{xlsx-util-BJgXbQ94.js → xlsx-util-DN1m96Sf.js} +1 -1
- package/es/editor/ai-chat/embed-ai-chat/embed-ai-chat.mjs +18 -0
- package/es/view/login-view/login-view.mjs +1 -0
- package/lib/editor/ai-chat/embed-ai-chat/embed-ai-chat.cjs +18 -0
- package/lib/view/login-view/login-view.cjs +1 -0
- package/package.json +2 -2
- package/src/editor/ai-chat/embed-ai-chat/embed-ai-chat.tsx +16 -0
- package/src/view/login-view/login-view.tsx +1 -1
|
@@ -13,6 +13,8 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
13
13
|
const ns = useNamespace("embed-ai-chat");
|
|
14
14
|
const c = props.controller;
|
|
15
15
|
const ctrl = c.ctrl;
|
|
16
|
+
const agentMap = /* @__PURE__ */ new Map();
|
|
17
|
+
const knowledgeMap = /* @__PURE__ */ new Map();
|
|
16
18
|
const aiChatElementRef = ref(null);
|
|
17
19
|
let mountedFlag = false;
|
|
18
20
|
const mountedAIChat = async () => {
|
|
@@ -103,6 +105,22 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
103
105
|
...chatOptions,
|
|
104
106
|
sessionid,
|
|
105
107
|
isSimple: c.isSimple,
|
|
108
|
+
fetchAgentList: async (query) => {
|
|
109
|
+
let agent = agentMap.get(query);
|
|
110
|
+
if (agent == null ? void 0 : agent.length)
|
|
111
|
+
return agent;
|
|
112
|
+
agent = await chatOptions.fetchAgentList(query);
|
|
113
|
+
agentMap.set(query, agent);
|
|
114
|
+
return agent;
|
|
115
|
+
},
|
|
116
|
+
fetchKnowledgeBaseList: async (query) => {
|
|
117
|
+
let knowledge = knowledgeMap.get(query);
|
|
118
|
+
if (knowledge == null ? void 0 : knowledge.length)
|
|
119
|
+
return knowledge;
|
|
120
|
+
knowledge = await chatOptions.fetchKnowledgeBaseList(query);
|
|
121
|
+
knowledgeMap.set(query, knowledge);
|
|
122
|
+
return knowledge;
|
|
123
|
+
},
|
|
106
124
|
action: (action, message) => {
|
|
107
125
|
if (action === "send")
|
|
108
126
|
ctrl.evt.emit("onFormDetailEvent", {
|
|
@@ -114,6 +114,7 @@ const LoginView = /* @__PURE__ */ defineComponent({
|
|
|
114
114
|
const loginViewConfig = await ibiz.hub.config.view.get("AppLoginView");
|
|
115
115
|
if (loginViewConfig) {
|
|
116
116
|
loginView.value = loginViewConfig;
|
|
117
|
+
hasLoginView.value = true;
|
|
117
118
|
}
|
|
118
119
|
} catch (err) {
|
|
119
120
|
ibiz.log.warn(err);
|
|
@@ -15,6 +15,8 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
15
15
|
const ns = vue3Util.useNamespace("embed-ai-chat");
|
|
16
16
|
const c = props.controller;
|
|
17
17
|
const ctrl = c.ctrl;
|
|
18
|
+
const agentMap = /* @__PURE__ */ new Map();
|
|
19
|
+
const knowledgeMap = /* @__PURE__ */ new Map();
|
|
18
20
|
const aiChatElementRef = vue.ref(null);
|
|
19
21
|
let mountedFlag = false;
|
|
20
22
|
const mountedAIChat = async () => {
|
|
@@ -105,6 +107,22 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
105
107
|
...chatOptions,
|
|
106
108
|
sessionid,
|
|
107
109
|
isSimple: c.isSimple,
|
|
110
|
+
fetchAgentList: async (query) => {
|
|
111
|
+
let agent = agentMap.get(query);
|
|
112
|
+
if (agent == null ? void 0 : agent.length)
|
|
113
|
+
return agent;
|
|
114
|
+
agent = await chatOptions.fetchAgentList(query);
|
|
115
|
+
agentMap.set(query, agent);
|
|
116
|
+
return agent;
|
|
117
|
+
},
|
|
118
|
+
fetchKnowledgeBaseList: async (query) => {
|
|
119
|
+
let knowledge = knowledgeMap.get(query);
|
|
120
|
+
if (knowledge == null ? void 0 : knowledge.length)
|
|
121
|
+
return knowledge;
|
|
122
|
+
knowledge = await chatOptions.fetchKnowledgeBaseList(query);
|
|
123
|
+
knowledgeMap.set(query, knowledge);
|
|
124
|
+
return knowledge;
|
|
125
|
+
},
|
|
108
126
|
action: (action, message) => {
|
|
109
127
|
if (action === "send")
|
|
110
128
|
ctrl.evt.emit("onFormDetailEvent", {
|
|
@@ -116,6 +116,7 @@ const LoginView = /* @__PURE__ */ vue.defineComponent({
|
|
|
116
116
|
const loginViewConfig = await ibiz.hub.config.view.get("AppLoginView");
|
|
117
117
|
if (loginViewConfig) {
|
|
118
118
|
loginView.value = loginViewConfig;
|
|
119
|
+
hasLoginView.value = true;
|
|
119
120
|
}
|
|
120
121
|
} catch (err) {
|
|
121
122
|
ibiz.log.warn(err);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.126",
|
|
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.
|
|
34
|
+
"@ibiz-template-plugin/ai-chat": "^0.0.96",
|
|
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",
|
|
@@ -25,6 +25,8 @@ export const IBizEmbedAIChat = defineComponent({
|
|
|
25
25
|
const ns = useNamespace('embed-ai-chat');
|
|
26
26
|
const c = props.controller;
|
|
27
27
|
const ctrl = c.ctrl as EditFormController;
|
|
28
|
+
const agentMap: Map<string | undefined, IData[]> = new Map();
|
|
29
|
+
const knowledgeMap: Map<string | undefined, IData[]> = new Map();
|
|
28
30
|
|
|
29
31
|
// AI聊天框挂载元素
|
|
30
32
|
const aiChatElementRef: Ref<HTMLElement | null> = ref(null);
|
|
@@ -135,6 +137,20 @@ export const IBizEmbedAIChat = defineComponent({
|
|
|
135
137
|
...chatOptions,
|
|
136
138
|
sessionid,
|
|
137
139
|
isSimple: c.isSimple,
|
|
140
|
+
fetchAgentList: async (query?: string) => {
|
|
141
|
+
let agent = agentMap.get(query);
|
|
142
|
+
if (agent?.length) return agent;
|
|
143
|
+
agent = await chatOptions.fetchAgentList(query);
|
|
144
|
+
agentMap.set(query, agent as IData[]);
|
|
145
|
+
return agent;
|
|
146
|
+
},
|
|
147
|
+
fetchKnowledgeBaseList: async (query?: string) => {
|
|
148
|
+
let knowledge = knowledgeMap.get(query);
|
|
149
|
+
if (knowledge?.length) return knowledge;
|
|
150
|
+
knowledge = await chatOptions.fetchKnowledgeBaseList(query);
|
|
151
|
+
knowledgeMap.set(query, knowledge as IData[]);
|
|
152
|
+
return knowledge;
|
|
153
|
+
},
|
|
138
154
|
action: (action: string, message: IData) => {
|
|
139
155
|
if (action === 'send')
|
|
140
156
|
ctrl.evt.emit('onFormDetailEvent', {
|
|
@@ -170,7 +170,7 @@ export const LoginView = defineComponent({
|
|
|
170
170
|
await ibiz.hub.config.view.get('AppLoginView');
|
|
171
171
|
if (loginViewConfig) {
|
|
172
172
|
loginView.value = loginViewConfig;
|
|
173
|
-
|
|
173
|
+
hasLoginView.value = true;
|
|
174
174
|
}
|
|
175
175
|
} catch (err) {
|
|
176
176
|
ibiz.log.warn(err);
|