@ibiz-template/vue3-components 0.7.41-alpha.40 → 0.7.41-alpha.41
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/ibiz-markdown-editor-DEV-iSvz.js +1 -0
- package/dist/index-Bv2fgePf.js +11 -0
- package/dist/{index-BewO9StC.js → index-CD2XM6M6.js} +1 -1
- package/dist/{index-ClxO69TM.js → index-CaWTEUU1.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-4cNAgOaJ.js +1 -0
- package/dist/{xlsx-util-Cg5zMYCC.js → xlsx-util-Dvg2kWh7.js} +1 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.mjs +2 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.mjs +12 -2
- package/es/editor/code/monaco-editor/monaco-editor.mjs +41 -32
- package/es/editor/html/wang-editor/config/index.mjs +3 -0
- package/es/editor/html/wang-editor/config/toolbar.mjs +90 -0
- package/es/editor/html/wang-editor/constants/svg.mjs +8 -0
- package/es/editor/html/wang-editor/wang-editor.css +1 -1
- package/es/editor/html/wang-editor/wang-editor.mjs +52 -39
- package/es/editor/markdown/ibiz-markdown-editor/custom-menu.mjs +264 -2
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +38 -6
- package/es/editor/markdown/ibiz-markdown-editor/render-util.mjs +33 -4
- package/es/editor/text-box/input/input.mjs +41 -32
- package/es/index.mjs +1 -1
- package/es/locale/en/index.mjs +3 -1
- package/es/locale/zh-CN/index.mjs +3 -1
- package/es/util/ai-chat-util/ai-chat-util.mjs +216 -0
- package/es/util/app-util/app-util.mjs +20 -48
- package/es/util/index.mjs +1 -1
- package/es/util/inline-ai-util/inline-ai-textarea/icon.mjs +75 -1
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.mjs +136 -43
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.mjs +130 -48
- package/es/util/inline-ai-util/inline-ai-util.mjs +2 -1
- package/es/web-app/main.mjs +2 -0
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.cjs +12 -2
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.cjs +2 -1
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +40 -31
- package/lib/editor/html/wang-editor/config/index.cjs +7 -0
- package/lib/editor/html/wang-editor/config/toolbar.cjs +92 -0
- package/lib/editor/html/wang-editor/constants/svg.cjs +14 -0
- package/lib/editor/html/wang-editor/wang-editor.cjs +51 -38
- package/lib/editor/html/wang-editor/wang-editor.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/custom-menu.cjs +264 -2
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +38 -6
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/render-util.cjs +33 -4
- package/lib/editor/text-box/input/input.cjs +40 -31
- package/lib/index.cjs +2 -2
- package/lib/locale/en/index.cjs +3 -1
- package/lib/locale/zh-CN/index.cjs +3 -1
- package/lib/util/ai-chat-util/ai-chat-util.cjs +218 -0
- package/lib/util/app-util/app-util.cjs +19 -47
- package/lib/util/index.cjs +2 -2
- package/lib/util/inline-ai-util/inline-ai-textarea/icon.cjs +78 -0
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.cjs +129 -47
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.cjs +135 -42
- package/lib/util/inline-ai-util/inline-ai-util.cjs +2 -1
- package/lib/web-app/main.cjs +2 -0
- package/package.json +5 -5
- package/dist/ibiz-markdown-editor-CxFS8frQ.js +0 -1
- package/dist/index-2eZnbrr4.js +0 -11
- package/dist/wang-editor-BPl509oX.js +0 -1
- package/es/util/ai-util/ai-util.mjs +0 -68
- package/lib/util/ai-util/ai-util.cjs +0 -71
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["vue","@wangeditor/editor-for-vue","qx-util","ramda","@ibiz-template/vue3-util","@ibiz-template/core","@ibiz-template/runtime","element-plus","./index-2eZnbrr4.js","lodash-es","@floating-ui/dom","interactjs","dayjs","qs","vuedraggable","@wangeditor/editor","@imengyu/vue3-context-menu","vue-router","async-validator","@ibiz-template/devtool","axios","dayjs/plugin/customParseFormat","vue-i18n","@ibiz-template/model-helper"],function(e,t){"use strict";var a,o,l,n,i,s,r,c,d,u,m,p,v,h,f,b,g,y,w,C,S,I,T,x,E,z;return{setters:[function(e){a=e.defineComponent,o=e.createVNode,l=e.resolveComponent,n=e.ref,i=e.shallowRef,s=e.watch,r=e.onBeforeUnmount,c=e.onMounted,d=e.nextTick,u=e.onUnmounted},function(e){m=e.Toolbar,p=e.Editor},function(e){v=e.createUUID},function(e){h=e.isNil},function(e){f=e.getEditorEmits,b=e.getHtmlProps,g=e.useNamespace,y=e.useUIStore},function(e){w=e.awaitTimeout,C=e.StringUtil,S=e.IBizContext},function(e){I=e.UIActionUtil,T=e.SysUIActionTag},function(e){x=e.ElMessageBox},function(e){E=e.h,z=e.c},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],execute:function(){e("default",a({name:"IBizHtml",props:b(),emits:f(),setup(e,{emit:a,slots:l}){const f=g("html"),b=e.controller,U=n(),A=n({});let P=null,k=0;const F=n(),D=i(),M=n(""),R=ibiz.util.file.getUploadHeaders(),N=n({...R}),O=n(""),H=n(!0),B=n(!1),L=n(!1),V=n(!1),j=n(!1);let q;const J=b.model;if(J.editorParams&&(J.editorParams.enableEdit&&(B.value=!0,L.value=!0,H.value=b.toBoolean(J.editorParams.enableEdit)&&!e.readonly&&!e.disabled),J.editorParams.enableedit&&(B.value=!0,L.value=!0,H.value=b.toBoolean(J.editorParams.enableedit)&&!e.readonly&&!e.disabled),J.editorParams.enableFullScreen&&(V.value=b.toBoolean(J.editorParams.enableFullScreen)),J.editorParams.enablefullscreen&&(V.value=b.toBoolean(J.editorParams.enablefullscreen)),J.editorParams.autoclose))try{q=JSON.parse(J.editorParams.autoclose)}catch(e){ibiz.log.error(e)}e.readonly&&(B.value=!1,L.value=!0);s(()=>e.data,e=>{if(e){const t={...b.editorParams};t.uploadparams&&(t.uploadParams=JSON.parse(t.uploadparams));const a=ibiz.util.file.calcFileUpDownUrl(b.context,b.params,e,t);O.value=a.uploadUrl}},{immediate:!0,deep:!0});const K=(e,t)=>{if(t)return!0},Q=e=>e,$={excludeKeys:["group-video","emotion"],insertKeys:{index:60,keys:b.chatCompletion?["emoji","|","aichart"]:["emoji"]}},_={placeholder:b.placeHolder,readOnly:B.value?L.value:e.readonly,MENU_CONF:{uploadImage:{server:O.value,fieldName:"file",maxFileSize:10485760,maxNumberOfFiles:10,allowedFileTypes:[],headers:N.value,withCredentials:!0,onBeforeUpload:e=>e,onProgress(e){console.log("progress",e)},onSuccess(e,t){ibiz.config.common.enableDownloadTicket&&t.ticket&&ibiz.util.file.setDownloadTicket(t.id,t.ticket),console.log("".concat(e.name," 上传成功"),t)},onFailed(e,t){console.log("".concat(e.name," 上传失败"),t)},onError(e,t,a){console.log("".concat(e.name," 上传出错"),t,a)},async customInsert(t,a){const o=((e,t)=>{const a={...b.editorParams};return a.exportparams&&(a.exportParams=JSON.parse(a.exportparams)),t&&t.folder&&(a.osscat=t.folder),ibiz.util.file.calcFileUpDownUrl(b.context,b.params,e,a).downloadUrl})(e.data,t);let l=o.replace("%fileId%",t.id);const n=t.filename;if(ibiz.config.common.enableDownloadTicket){const i=await ibiz.util.file.getDownloadTicket(b.context,b.params,e.data,{fileId:t.id},b.downloadTicketParams);i&&i.ticket&&(l=o.replace("%fileId%",i.ticket),a(l,n,""))}else a(l,n,"")}},insertLink:{checkLink:K,parseLinkUrl:Q},editLink:{checkLink:K,parseLinkUrl:Q}},hoverbarKeys:E};let G;r(()=>{const e=D.value;null!=e&&e.destroy()});const W=o=>{D.value=o,b.onCreated(D.value),o.setHtml(M.value),o.on("aiClick",()=>{(async()=>{const o=b.model.appDataEntityId;if(!o||!b.deACMode)return;const{contentToolbarItems:l,footerToolbarItems:n,questionToolbarItems:i,otherToolbarItems:s}=z(b.deACMode),{zIndex:r}=y(),c=r.increment(),d=await t.import("@ibiz-template-plugin/ai-chat");G=d.chat||d.default.chat;let u,m="";G.create({containerOptions:{zIndex:c},chatOptions:{caption:b.deACMode.logicName,context:{...b.context},params:{...b.params,srfactag:b.deACMode.codeName},appDataEntityId:o,contentToolbarItems:l,footerToolbarItems:n,questionToolbarItems:i,otherToolbarItems:s,appendCurData:"true"===b.editorParams.srfaiappendcurdata?e.data:void 0,autoQuestion:"false"!==b.editorParams.autoquestion,autoFill:"true"===b.editorParams.autofill,openMode:b.editorParams.openmode,autoClose:q,appendCurContent:b.editorParams.srfaiappendcurcontent?C.fill(b.editorParams.srfaiappendcurcontent,b.context,b.params,e.data):void 0,question:async(e,t,a,o,l,n)=>{m=v(),u=new AbortController;const i=await ibiz.hub.getApp(t.srfappid).deService.getService(t,o.appDataEntityId);try{await i.aiChatSse(t=>{if(20===t.actionstate&&t.actionresult)e.addMessage({messageid:m,state:t.actionstate,type:"DEFAULT",role:"ASSISTANT",content:t.actionresult});else if(30===t.actionstate&&t.actionresult){const a=JSON.parse(t.actionresult).choices;a&&a.length>0&&e.replaceMessage({messageid:m,state:t.actionstate,type:"DEFAULT",role:"ASSISTANT",content:a[0].content||""})}else 40===t.actionstate&&e.replaceMessage({messageid:m,state:t.actionstate,type:"ERROR",role:"ASSISTANT",content:t.actionresult})},u,t,a,{messages:l,sessionid:n})}catch(t){e.replaceMessage({messageid:m,state:40,type:"ERROR",role:"ASSISTANT",content:t.message||ibiz.i18n.t("app.aiError")}),null==u||u.abort()}finally{return e.completeMessage(m,!0),!0}},abortQuestion:async e=>{null==u||u.abort(),await e.stopMessage({messageid:m,state:30,type:"DEFAULT",role:"ASSISTANT",content:""}),await e.completeMessage(m,!0)},action:(e,t)=>{"backfill"===e&&(B.value?M.value=t.realcontent||"":a("change",t.realcontent))},history:async(e,t,a)=>{const o=await ibiz.hub.getApp(e.srfappid).deService.getService(e,a.appDataEntityId),l=a.appendCurData?a.appendCurData:{},n=await o.aiChatHistory(e,t,l);if(n.data&&Array.isArray(n.data)){let e;n.data.forEach(t=>{if("TOOL"===t.role)e&&t.content&&G.aiChat.updateRecommendPrompt(e,t.content);else{const a={messageid:v(),state:30,type:"DEFAULT",role:t.role,content:t.content,completed:!0};e=a,G.aiChat.addMessage(a)}})}return!0},recommendPrompt:async(e,t,a)=>{const o=await ibiz.hub.getApp(e.srfappid).deService.getService(e,a.appDataEntityId),l=await o.aiChatRecommendPrompt(e,t,a.message);if(l.ok&&l.data){const e=l.data.choices;return e&&e.length>0?e[0]:null}return null},uploader:{onUpload:async(e,t,a)=>{const o=ibiz.util.file.calcFileUpDownUrl((null==a?void 0:a.context)||b.context,(null==a?void 0:a.params)||b.params,{}),l=ibiz.util.file.getUploadHeaders(),n=new FormData;return n.append("file",e),(await ibiz.net.axios({url:o.uploadUrl,method:"post",headers:l,data:n,onUploadProgress:e=>{const a=e.loaded/e.total*100;t(a)}})).data}},extendToolbarClick:async(e,t,a,o,l)=>{var n,i;const s=await I.exec(t.id,{view:b.view,ctrl:b.ctrl,context:S.create(a),params:o,data:[l],event:e},t.appId);if(s.closeView)b.view.closeView({ok:!0});else if(s.refresh)switch(s.refreshMode){case 1:b.view.callUIAction(T.REFRESH);break;case 2:null==(n=b.view.parentView)||n.callUIAction(T.REFRESH);break;case 3:null==(i=b.view.getTopView())||i.callUIAction(T.REFRESH)}return s}}})})()}),o.on("lineAiClick",()=>{const e=o.getSelectionPosition();if(!e||!e.left||!e.top)return;const t=ibiz.inLineAIUtil.calcContextMenus(b.deACMode,e=>{b.doInLineAIUIAction(e,b.model.appId)});if(0===t.length)return;const a=o.getEditableContainer().getBoundingClientRect();ibiz.inLineAIUtil.showContextMenus(a.x+Number(e.left.replace("px","")),a.y+Number(e.top.replace("px",""))+42,t)})},X=t=>{const o=t.getHtml(),l="<p><br></p>"===o?"":o;l===e.value||""===l&&h(e.value)||!B.value&&t.isFocused()&&a("change",l)},Y=e=>{},Z=e=>{a("focus")},ee=e=>{a("blur")},te=(e,t)=>{alert("【".concat(ibiz.i18n.t("editor.html.wangEditor.customTips"),"】").concat(t," - ").concat(e))},ae=(e,t,a)=>{a(!0)},oe=()=>{const e=D.value;null!=e&&e.disable()},le=()=>{const e=D.value;null!=e&&e.enable()};c(()=>{s(()=>e.value,(t,a)=>{t===a||"string"!=typeof e.value&&null!=t||d(null==t?()=>{M.value=""}:()=>{M.value=t})},{immediate:!0}),s(()=>e.disabled,(e,t)=>{e!==t&&(!0===e?oe():le())},{immediate:!0})});const ne=()=>{L.value=!L.value,L.value?oe():(le(),D.value.focus(),(()=>{var t,a;if(e.value){const o=e.value.indexOf("</p>");if(o>=0){const e=null==(t=D.value.selection.anchor)?void 0:t.offset,l=null==(a=D.value.selection.anchor)?void 0:a.path;0===e&&l.length>0&&0===l[0]&&D.value.move(o-3)}}})())},ie=()=>{j.value=!j.value,d(()=>{L.value?oe():(le(),D.value.focus())})};return c(()=>{w(0,()=>{if(U.value&&F.value){const e=U.value.offsetHeight;P=new ResizeObserver(t=>{const a=t[0].contentRect.height;if(a!==k){const o={height:"".concat(e-t[0].contentRect.height+(0!==a?300:0),"px")};A.value=f.cssVarBlock(o),k=a}}),P.observe(F.value.selector)}})}),u(()=>{b.onDestroyed(),P&&P.disconnect(),G&&G.close()}),{ns:f,editorRef:D,mode:"default",valueHtml:M,toolbarConfig:$,editorConfig:_,handleCreated:W,handleChange:X,handleDestroyed:Y,handleFocus:Z,handleBlur:ee,customAlert:te,customPaste:ae,insertText:e=>{const t=D.value;null!=t&&t.insertText(e)},printHtml:()=>{const e=D.value;null!=e&&console.log(e.getHtml())},disable:oe,enable:le,renderHeaserToolbar:()=>B.value||V.value?o("div",{class:f.b("custom-toolbar")},[B.value&&H.value&&L.value?o("i",{class:"fa fa-edit","aria-hidden":"true",title:ibiz.i18n.t("editor.html.enableedit"),onClick:()=>ne()},null):null,V.value?j.value?o("i",{class:"fa fa-compress","aria-hidden":"true",title:ibiz.i18n.t("editor.html.reduce"),onClick:()=>ie()},null):o("i",{class:"fa fa-expand","aria-hidden":"true",title:ibiz.i18n.t("editor.html.expand"),onClick:()=>ie()},null):null]):null,renderEditorContent:()=>{var e;return o("div",{class:[f.b("content"),f.is("editing",!L.value)],ref:"htmlContent",style:A.value},[null==(e=l.editorSwitchMenu)?void 0:e.call(l),o(m,{ref:"toolbarRef",editor:D.value,"default-config":$,mode:"default",class:f.b("toolbar")},null),o(p,{class:[f.b("editor"),f.is("readonly",L.value)],modelValue:M.value,"onUpdate:modelValue":e=>M.value=e,"default-config":_,mode:"default",onOnCreated:W,onOnChange:X,onOnDestroyed:Y,onOnFocus:Z,onOnBlur:ee,oncustomAlert:te,oncustomPaste:ae},null)])},renderFooter:()=>B.value?o("div",{class:[f.b("footer"),{[f.b("footer-dialog")]:j.value}]},[o("div",{class:f.be("footer","cancel"),onClick:()=>{e.value!==M.value?x({title:ibiz.i18n.t("editor.common.confirmCancel"),type:"warning",customClass:f.b("message"),message:o("div",{class:f.be("message","message-content")},[o("p",null,[ibiz.i18n.t("editor.common.confirmCancelPrompt")]),o("p",{class:f.bem("message","message-content","message-tip")},[ibiz.i18n.t("editor.common.cancelEditPrompt")])]),showCancelButton:!0,cancelButtonClass:f.be("message","message-cancel"),confirmButtonClass:f.be("message","message-comfire")}).then(()=>{M.value=e.value||"",ne()}).catch(()=>{D.value.focus()}):ne()}},[ibiz.i18n.t("app.cancel")]),o("div",{class:f.be("footer","save"),onClick:()=>(()=>{L.value=!0,D.value.disable();const e=M.value;a("change",e),j.value&&(j.value=!1)})()},[ibiz.i18n.t("app.save")])]):null,htmlContent:U,hasEnableEdit:B,cssVars:A,toolbarRef:F,isFullScreen:j,readonlyState:L,changeFullScreenState:ie}},render(){const e=!!this.$slots.editorSwitchMenu;return this.isFullScreen?o(l("el-dialog"),{modelValue:this.isFullScreen,"onUpdate:modelValue":e=>this.isFullScreen=e,width:"80%",top:"10vh",class:[this.ns.b("dialog-full-screen"),this.ns.is("editing",!this.readonlyState)],onClose:()=>this.changeFullScreenState()},{default:()=>[o("div",{class:[this.ns.b(),{[this.ns.b("editor-readonly")]:this.readonlyState},this.ns.is("show-editor-switch-menu",e)]},[this.renderHeaserToolbar(),this.renderEditorContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null])]}):o("div",{class:[this.ns.b(),{[this.ns.b("editor-readonly")]:this.readonlyState},this.ns.is("show-ai",!0),this.ns.is("enable-edit",!this.readonly&&!this.disabled),this.ns.is("show-editor-switch-menu",e)]},[this.renderHeaserToolbar(),this.renderEditorContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null])}}))}}});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { UtilService } from '@ibiz-template/runtime';
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
function calcAiToolbarItemsByAc(deACMode) {
|
|
5
|
-
var _a, _b;
|
|
6
|
-
const contentToolbarItems = [];
|
|
7
|
-
const footerToolbarItems = [];
|
|
8
|
-
const questionToolbarItems = [];
|
|
9
|
-
const functionToolbarItems = [];
|
|
10
|
-
const inlineToolbarItems = [];
|
|
11
|
-
const otherToolbarItems = [];
|
|
12
|
-
(_b = (_a = deACMode.deuiactionGroup) == null ? void 0 : _a.uiactionGroupDetails) == null ? void 0 : _b.forEach(
|
|
13
|
-
(item) => {
|
|
14
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
15
|
-
const toolbarItem = {
|
|
16
|
-
appId: item.appId,
|
|
17
|
-
id: item.uiactionId,
|
|
18
|
-
label: item.showCaption ? item.caption : "",
|
|
19
|
-
title: item.tooltip,
|
|
20
|
-
icon: {
|
|
21
|
-
showIcon: item.showIcon,
|
|
22
|
-
cssClass: (_a2 = item.sysImage) == null ? void 0 : _a2.cssClass,
|
|
23
|
-
imagePath: (_b2 = item.sysImage) == null ? void 0 : _b2.imagePath
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
if (item.sysImage && item.sysImage.imagePath && !item.sysImage.imagePath.startsWith("http")) {
|
|
27
|
-
toolbarItem.icon.imagePath = "".concat(ibiz.env.assetsUrl, "/images/").concat(item.sysImage.imagePath);
|
|
28
|
-
}
|
|
29
|
-
if ((_c = item.uiactionId) == null ? void 0 : _c.startsWith("msg_content_")) {
|
|
30
|
-
contentToolbarItems.push(toolbarItem);
|
|
31
|
-
} else if ((_d = item.uiactionId) == null ? void 0 : _d.startsWith("msg_footer_")) {
|
|
32
|
-
footerToolbarItems.push(toolbarItem);
|
|
33
|
-
} else if ((_e = item.uiactionId) == null ? void 0 : _e.startsWith("question_")) {
|
|
34
|
-
questionToolbarItems.push(toolbarItem);
|
|
35
|
-
} else if ((_f = item.uiactionId) == null ? void 0 : _f.startsWith("function_")) {
|
|
36
|
-
functionToolbarItems.push(toolbarItem);
|
|
37
|
-
} else if (((_g = item.uiactionId) == null ? void 0 : _g.startsWith("inline")) || item.refUIActionGroup && ((_h = item.refUIActionGroup.id) == null ? void 0 : _h.startsWith("inline"))) {
|
|
38
|
-
inlineToolbarItems.push(toolbarItem);
|
|
39
|
-
} else {
|
|
40
|
-
otherToolbarItems.push(toolbarItem);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
return {
|
|
45
|
-
contentToolbarItems,
|
|
46
|
-
footerToolbarItems,
|
|
47
|
-
questionToolbarItems,
|
|
48
|
-
otherToolbarItems,
|
|
49
|
-
functionToolbarItems,
|
|
50
|
-
inlineToolbarItems
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const getAIAgentList = async (context, params) => {
|
|
54
|
-
const emptyList = [];
|
|
55
|
-
const app = ibiz.hub.getApp(ibiz.env.appId);
|
|
56
|
-
const aiAgentUtil = app.getAppUtil("DYNAMICAIGENT", "CUSTOM");
|
|
57
|
-
if (!aiAgentUtil) {
|
|
58
|
-
return emptyList;
|
|
59
|
-
}
|
|
60
|
-
const utilService = new UtilService(aiAgentUtil);
|
|
61
|
-
const data = await utilService.load("", context, params);
|
|
62
|
-
if (!data || data.length === 0) {
|
|
63
|
-
return emptyList;
|
|
64
|
-
}
|
|
65
|
-
return data;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export { calcAiToolbarItemsByAc, getAIAgentList };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var runtime = require('@ibiz-template/runtime');
|
|
4
|
-
|
|
5
|
-
"use strict";
|
|
6
|
-
function calcAiToolbarItemsByAc(deACMode) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
const contentToolbarItems = [];
|
|
9
|
-
const footerToolbarItems = [];
|
|
10
|
-
const questionToolbarItems = [];
|
|
11
|
-
const functionToolbarItems = [];
|
|
12
|
-
const inlineToolbarItems = [];
|
|
13
|
-
const otherToolbarItems = [];
|
|
14
|
-
(_b = (_a = deACMode.deuiactionGroup) == null ? void 0 : _a.uiactionGroupDetails) == null ? void 0 : _b.forEach(
|
|
15
|
-
(item) => {
|
|
16
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
17
|
-
const toolbarItem = {
|
|
18
|
-
appId: item.appId,
|
|
19
|
-
id: item.uiactionId,
|
|
20
|
-
label: item.showCaption ? item.caption : "",
|
|
21
|
-
title: item.tooltip,
|
|
22
|
-
icon: {
|
|
23
|
-
showIcon: item.showIcon,
|
|
24
|
-
cssClass: (_a2 = item.sysImage) == null ? void 0 : _a2.cssClass,
|
|
25
|
-
imagePath: (_b2 = item.sysImage) == null ? void 0 : _b2.imagePath
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
if (item.sysImage && item.sysImage.imagePath && !item.sysImage.imagePath.startsWith("http")) {
|
|
29
|
-
toolbarItem.icon.imagePath = "".concat(ibiz.env.assetsUrl, "/images/").concat(item.sysImage.imagePath);
|
|
30
|
-
}
|
|
31
|
-
if ((_c = item.uiactionId) == null ? void 0 : _c.startsWith("msg_content_")) {
|
|
32
|
-
contentToolbarItems.push(toolbarItem);
|
|
33
|
-
} else if ((_d = item.uiactionId) == null ? void 0 : _d.startsWith("msg_footer_")) {
|
|
34
|
-
footerToolbarItems.push(toolbarItem);
|
|
35
|
-
} else if ((_e = item.uiactionId) == null ? void 0 : _e.startsWith("question_")) {
|
|
36
|
-
questionToolbarItems.push(toolbarItem);
|
|
37
|
-
} else if ((_f = item.uiactionId) == null ? void 0 : _f.startsWith("function_")) {
|
|
38
|
-
functionToolbarItems.push(toolbarItem);
|
|
39
|
-
} else if (((_g = item.uiactionId) == null ? void 0 : _g.startsWith("inline")) || item.refUIActionGroup && ((_h = item.refUIActionGroup.id) == null ? void 0 : _h.startsWith("inline"))) {
|
|
40
|
-
inlineToolbarItems.push(toolbarItem);
|
|
41
|
-
} else {
|
|
42
|
-
otherToolbarItems.push(toolbarItem);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
return {
|
|
47
|
-
contentToolbarItems,
|
|
48
|
-
footerToolbarItems,
|
|
49
|
-
questionToolbarItems,
|
|
50
|
-
otherToolbarItems,
|
|
51
|
-
functionToolbarItems,
|
|
52
|
-
inlineToolbarItems
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const getAIAgentList = async (context, params) => {
|
|
56
|
-
const emptyList = [];
|
|
57
|
-
const app = ibiz.hub.getApp(ibiz.env.appId);
|
|
58
|
-
const aiAgentUtil = app.getAppUtil("DYNAMICAIGENT", "CUSTOM");
|
|
59
|
-
if (!aiAgentUtil) {
|
|
60
|
-
return emptyList;
|
|
61
|
-
}
|
|
62
|
-
const utilService = new runtime.UtilService(aiAgentUtil);
|
|
63
|
-
const data = await utilService.load("", context, params);
|
|
64
|
-
if (!data || data.length === 0) {
|
|
65
|
-
return emptyList;
|
|
66
|
-
}
|
|
67
|
-
return data;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
exports.calcAiToolbarItemsByAc = calcAiToolbarItemsByAc;
|
|
71
|
-
exports.getAIAgentList = getAIAgentList;
|