@ibiz-template/mob-vue3-components 0.7.41-alpha.21 → 0.7.41-alpha.23

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.
Files changed (432) hide show
  1. package/dist/chart-CVnUjHjl.js +2 -0
  2. package/dist/{chart-j1WkpBhc.js.map → chart-CVnUjHjl.js.map} +1 -1
  3. package/dist/ibiz-markdown-editor-MwEhH1r_.js +2 -0
  4. package/dist/ibiz-markdown-editor-MwEhH1r_.js.map +1 -0
  5. package/dist/index-CopTozpr.js +2 -0
  6. package/dist/index-CopTozpr.js.map +1 -0
  7. package/dist/index-Cxv8dJIk.js +2 -0
  8. package/dist/index-Cxv8dJIk.js.map +1 -0
  9. package/dist/index-DV0pS0zU.js +2 -0
  10. package/dist/index-DV0pS0zU.js.map +1 -0
  11. package/dist/index.min.css +14 -14
  12. package/dist/index.system.min.js +1 -1
  13. package/dist/quill-CeDXLpcJ.js +2 -0
  14. package/dist/{quill-D-355-KZ.js.map → quill-CeDXLpcJ.js.map} +1 -1
  15. package/dist/quill-editor-C5mEMG93.js +2 -0
  16. package/dist/quill-editor-C5mEMG93.js.map +1 -0
  17. package/dist/quill-editor-preview-BPS9uMa7.js +2 -0
  18. package/dist/quill-editor-preview-BPS9uMa7.js.map +1 -0
  19. package/dist/tree-SAqvldtV.js +2 -0
  20. package/dist/{tree-sdPuTW-7.js.map → tree-SAqvldtV.js.map} +1 -1
  21. package/dist/xlsx-util-b5CesqYd.js +3 -0
  22. package/dist/xlsx-util-b5CesqYd.js.map +1 -0
  23. package/es/_virtual/FileSaver.min.mjs +3 -0
  24. package/es/_virtual/index12.mjs +2 -2
  25. package/es/_virtual/index13.mjs +2 -2
  26. package/es/_virtual/index14.mjs +2 -2
  27. package/es/_virtual/index18.mjs +2 -2
  28. package/es/_virtual/index19.mjs +2 -2
  29. package/es/common/action-group/action-group.css +1 -1
  30. package/es/common/action-group/action-group.mjs +44 -43
  31. package/es/common/button-list/button-list.css +1 -1
  32. package/es/common/button-list/button-list.mjs +16 -25
  33. package/es/common/col/col.mjs +1 -1
  34. package/es/common/cropping/cropping.mjs +5 -5
  35. package/es/common/date-range-picker/components/range-picker/range-picker.mjs +2 -4
  36. package/es/common/date-range-picker/components/single-picker/single-picker.mjs +2 -4
  37. package/es/common/date-range-picker/date-range-picker.mjs +2 -2
  38. package/es/common/emoji-select/components/emoji-item/emoji-item.mjs +4 -4
  39. package/es/common/emoji-select/components/emoji-list/emoji-list.mjs +1 -1
  40. package/es/common/emoji-select/icons/categories.mjs +9 -57
  41. package/es/common/float-button/float-button.css +1 -1
  42. package/es/common/float-button/float-button.mjs +12 -7
  43. package/es/common/keep-alive/keep-alive.mjs +2 -2
  44. package/es/common/keep-alive/scheduler.mjs +1 -1
  45. package/es/common/preview-image/preview-image.mjs +4 -4
  46. package/es/common/rawitem/rawitem.mjs +2 -2
  47. package/es/common/row/row.mjs +1 -1
  48. package/es/common/split/split.mjs +9 -9
  49. package/es/common/split-trigger/split-trigger.css +1 -1
  50. package/es/common/split-trigger/split-trigger.mjs +1 -1
  51. package/es/common/tab-layout/tab-default-layout/tab-default-layout.mjs +1 -0
  52. package/es/common/tab-layout/tab-dropdown/tab-dropdown.mjs +1 -1
  53. package/es/common/tab-layout/tab-sidebar-layout/tab-sidebar-layout.css +1 -1
  54. package/es/common/view-message/view-message.mjs +1 -1
  55. package/es/control/app-menu/app-menu.mjs +1 -1
  56. package/es/control/app-menu/custom-menu-design/custom-menu-design.mjs +1 -1
  57. package/es/control/app-menu/menu-render-util.mjs +2 -0
  58. package/es/control/app-menu-icon-view/app-menu-icon-view.css +1 -1
  59. package/es/control/app-menu-icon-view/app-menu-icon-view.mjs +2 -2
  60. package/es/control/app-menu-icon-view/index.mjs +1 -1
  61. package/es/control/app-menu-list-view/app-menu-list-view.css +1 -1
  62. package/es/control/app-menu-list-view/app-menu-list-view.mjs +1 -1
  63. package/es/control/app-menu-list-view/index.mjs +1 -1
  64. package/es/control/calendar/calendar.css +1 -1
  65. package/es/control/calendar/calendar.mjs +7 -7
  66. package/es/control/caption-bar/caption-bar.css +1 -1
  67. package/es/control/caption-bar/caption-bar.mjs +1 -1
  68. package/es/control/chart/chart.mjs +1 -1
  69. package/es/control/dashboard/custom-dashboard-design/custom-dashboard-design.css +1 -1
  70. package/es/control/dashboard/dashboard.css +1 -1
  71. package/es/control/dashboard/dashboard.mjs +3 -1
  72. package/es/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.mjs +1 -1
  73. package/es/control/dashboard/portlet/chart-portlet/chart-portlet.mjs +1 -1
  74. package/es/control/dashboard/portlet/container-portlet/container-portlet.mjs +1 -1
  75. package/es/control/dashboard/portlet/html-portlet/html-portlet.mjs +1 -1
  76. package/es/control/dashboard/portlet/list-portlet/list-portlet.mjs +1 -1
  77. package/es/control/dashboard/portlet/menu-portlet/menu-portlet.mjs +1 -1
  78. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
  79. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +4 -4
  80. package/es/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.mjs +1 -1
  81. package/es/control/dashboard/portlet/view-portlet/view-portlet.mjs +1 -1
  82. package/es/control/data-view/data-view.css +1 -1
  83. package/es/control/data-view/data-view.mjs +7 -7
  84. package/es/control/drbar/drbar.css +1 -1
  85. package/es/control/drbar/drbar.mjs +1 -1
  86. package/es/control/drtab/drtab.controller.mjs +2 -2
  87. package/es/control/drtab/drtab.css +1 -1
  88. package/es/control/drtab/drtab.mjs +1 -1
  89. package/es/control/form/edit-form/edit-form.mjs +1 -1
  90. package/es/control/form/form/form.mjs +2 -2
  91. package/es/control/form/form-detail/form-button/form-button.css +1 -1
  92. package/es/control/form/form-detail/form-button/form-button.mjs +1 -1
  93. package/es/control/form/form-detail/form-group-panel/form-group-panel.mjs +1 -1
  94. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.mjs +1 -1
  95. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.mjs +6 -6
  96. package/es/control/form/form-detail/form-mdctrl/form-mdctrl.provider.mjs +2 -2
  97. package/es/control/form/search-form/search-form.mjs +1 -1
  98. package/es/control/list/list/list.mjs +1 -1
  99. package/es/control/list/md-ctrl/md-ctrl.css +1 -1
  100. package/es/control/list/md-ctrl/md-ctrl.mjs +2 -2
  101. package/es/control/pickup-view-panel/pickup-view-panel.mjs +1 -1
  102. package/es/control/search-bar/filter-field-select/filter-field-select.mjs +1 -1
  103. package/es/control/search-bar/filter-mode-select/filter-mode-select.mjs +1 -1
  104. package/es/control/search-bar/filter-tree/filter-tree.css +1 -1
  105. package/es/control/search-bar/filter-tree/filter-tree.mjs +1 -1
  106. package/es/control/search-bar/search-bar.css +1 -1
  107. package/es/control/search-bar/search-bar.mjs +10 -6
  108. package/es/control/tab-exp-panel/tab-exp-panel.css +1 -1
  109. package/es/control/tab-exp-panel/tab-exp-panel.mjs +1 -1
  110. package/es/control/toolbar/float-toolbar/float-toolbar.css +1 -1
  111. package/es/control/toolbar/float-toolbar/float-toolbar.mjs +13 -7
  112. package/es/control/toolbar/toolbar-render-util.mjs +59 -32
  113. package/es/control/toolbar/toolbar.css +1 -1
  114. package/es/control/toolbar/toolbar.mjs +1 -1
  115. package/es/control/tree/tree.css +1 -1
  116. package/es/control/tree/tree.mjs +9 -9
  117. package/es/control/tree-exp-bar/tree-exp-bar.mjs +1 -1
  118. package/es/control/wizard-panel/wizard-panel.css +1 -1
  119. package/es/control/wizard-panel/wizard-panel.mjs +6 -6
  120. package/es/editor/array/ibiz-array/ibiz-array.css +1 -1
  121. package/es/editor/cascader/ibiz-cascader/ibiz-cascader.mjs +2 -2
  122. package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.mjs +1 -1
  123. package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +2 -2
  124. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +2 -2
  125. package/es/editor/data-picker/picker-editor.controller.mjs +2 -2
  126. package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.css +1 -1
  127. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +7 -7
  128. package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.mjs +1 -1
  129. package/es/editor/html/html-editor.controller.mjs +26 -9
  130. package/es/editor/html/quill-editor/quill-editor.css +1 -1
  131. package/es/editor/html/quill-editor/quill-editor.mjs +12 -3
  132. package/es/editor/html/quill-editor-preview/quill-editor-preview.css +1 -1
  133. package/es/editor/html/quill-editor-preview/quill-editor-preview.mjs +5 -6
  134. package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +15 -4
  135. package/es/editor/markdown/markdown-editor.controller.mjs +23 -3
  136. package/es/editor/qrcode/ibiz-qrcode/ibiz-qrcode.mjs +1 -1
  137. package/es/editor/slider/ibiz-slider/ibiz-slider.css +1 -1
  138. package/es/editor/slider/ibiz-slider/ibiz-slider.mjs +2 -2
  139. package/es/editor/span/span/span.mjs +7 -7
  140. package/es/editor/span/span-link/span-link.mjs +1 -1
  141. package/es/editor/stepper/ibiz-stepper/ibiz-stepper.css +1 -1
  142. package/es/editor/stepper/ibiz-stepper/ibiz-stepper.mjs +1 -1
  143. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.css +1 -1
  144. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.mjs +1 -1
  145. package/es/editor/text-box/input/input.mjs +36 -5
  146. package/es/editor/text-box/signature/signature.mjs +59 -19
  147. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.css +1 -1
  148. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.mjs +2 -2
  149. package/es/editor/upload/upload-editor.controller.mjs +18 -1
  150. package/es/editor/upload/use/use-van-upload.mjs +6 -2
  151. package/es/ibiz-vue3.mjs +1 -0
  152. package/es/index.mjs +5 -1
  153. package/es/locale/en/index.mjs +26 -0
  154. package/es/locale/zh-CN/index.mjs +29 -1
  155. package/es/mob-app/App.mjs +10 -1
  156. package/es/mob-app/components/modal-router-shell/modal-router-shell.mjs +6 -4
  157. package/es/mob-app/components/router-shell/router-shell.mjs +1 -1
  158. package/es/mob-app/guard/auth-guard/auth-guard.mjs +206 -194
  159. package/es/mob-app/guard/auth-guard/dyna-auth-guard.mjs +65 -0
  160. package/es/mob-app/guard/index.mjs +1 -0
  161. package/es/mob-app/index.mjs +1 -0
  162. package/es/mob-app/main.mjs +17 -2
  163. package/es/mob-app/router/index.mjs +136 -79
  164. package/es/mob-app/util/unauthorized-handler/unauthorized-handler.mjs +5 -5
  165. package/es/node_modules/.pnpm/@amap_amap-jsapi-loader@1.0.1_patch_hash_73bpcwbs2m5ip4qppmz6a7epsa/node_modules/@amap/amap-jsapi-loader/dist/index.mjs +1 -1
  166. package/es/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/packages/frame-talk-client-pc/index.mjs +1 -1
  167. package/es/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/sdk/middlewares/index.mjs +1 -1
  168. package/es/node_modules/.pnpm/file-saver@2.0.5/node_modules/file-saver/dist/FileSaver.min.mjs +15 -0
  169. package/es/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.mjs +1 -1
  170. package/es/node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.mjs +1 -1
  171. package/es/node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/xlsx.mjs +24580 -0
  172. package/es/panel-component/async-action/async-action/async-action.mjs +2 -2
  173. package/es/panel-component/async-action/async-action-preview/async-action-preview.mjs +3 -3
  174. package/es/panel-component/async-action/async-action-result/async-action-result.mjs +1 -1
  175. package/es/panel-component/nav-pos-index/nav-pos-index.controller.mjs +2 -2
  176. package/es/panel-component/panel-app-title/panel-app-title.mjs +2 -2
  177. package/es/panel-component/panel-button/panel-button.css +1 -1
  178. package/es/panel-component/panel-carousel/panel-carousel.controller.mjs +1 -1
  179. package/es/panel-component/panel-video-player/panel-video-player.controller.mjs +2 -2
  180. package/es/panel-component/split-container/split-container.controller.mjs +1 -1
  181. package/es/panel-component/user-message/common/internal-message-default/internal-message-default.provider.mjs +1 -1
  182. package/es/panel-component/user-message/user-message.mjs +1 -1
  183. package/es/panel-component/user-message/user-message.util.mjs +1 -1
  184. package/es/panel-component/view-content-panel-container/view-content-panel-container.css +1 -1
  185. package/es/panel-component/view-content-panel-container/view-content-panel-container.mjs +29 -15
  186. package/es/platform/ios-platform-provider.mjs +2 -2
  187. package/es/platform/wechat-official-platform-provider.mjs +1 -1
  188. package/es/util/ai-chat-util/ai-chat-util.mjs +1095 -0
  189. package/es/util/ai-chat-util/ai-feedback/ai-feedback.css +1 -0
  190. package/es/util/ai-chat-util/ai-feedback/ai-feedback.mjs +140 -0
  191. package/es/util/app-drawer/app-drawer-component.mjs +18 -14
  192. package/es/util/app-modal/app-modal-component.mjs +7 -2
  193. package/es/util/app-popover/app-popover-component.mjs +4 -4
  194. package/es/util/app-util/app-util.mjs +112 -7
  195. package/es/util/button-util/button-util.mjs +33 -1
  196. package/es/util/confirm-util/confirm-util.mjs +4 -4
  197. package/es/util/directive/loading.mjs +1 -1
  198. package/es/util/fullscreen/fullscreen-util.mjs +1 -1
  199. package/es/util/index.mjs +4 -1
  200. package/es/util/list-util/list-render-util.mjs +24 -5
  201. package/es/util/loading-util/loading-util.mjs +1 -1
  202. package/es/util/open-view-util/open-view-util.mjs +1 -1
  203. package/es/util/print-preview-util/print-preview-markdown/icon/icon.mjs +46 -0
  204. package/es/util/print-preview-util/print-preview-markdown/print-preview-markdown.css +1 -0
  205. package/es/util/print-preview-util/print-preview-markdown/print-preview-markdown.mjs +62 -0
  206. package/es/util/print-preview-util/print-preview-util.mjs +57 -0
  207. package/es/util/scan-qrcode/scan-qrcode.mjs +1 -1
  208. package/es/util/user-route-util/user-route-util.mjs +55 -0
  209. package/es/util/xlsx-util/xlsx-util.mjs +163 -0
  210. package/es/view/portal-view/portal-view.mjs +3 -2
  211. package/es/view-engine/index-view.engine.mjs +4 -0
  212. package/es/view-engine/index.mjs +31 -31
  213. package/es/view-engine/login-view.engine.mjs +1 -1
  214. package/es/view-engine/mob-calendar-view.engine.mjs +12 -1
  215. package/es/view-engine/mob-edit-view.engine.mjs +1 -1
  216. package/es/view-engine/mob-pickup-md-view.engine.mjs +1 -0
  217. package/es/view-engine/mob-wf-dyna-action-view.engine.mjs +1 -1
  218. package/es/view-engine/mob-wf-dyna-edit-view.engine.mjs +1 -1
  219. package/es/view-engine/mob-wf-dyna-start-view.engine.mjs +1 -1
  220. package/lib/_virtual/FileSaver.min.cjs +5 -0
  221. package/lib/_virtual/index12.cjs +2 -2
  222. package/lib/_virtual/index13.cjs +2 -2
  223. package/lib/_virtual/index14.cjs +2 -2
  224. package/lib/_virtual/index18.cjs +2 -2
  225. package/lib/_virtual/index19.cjs +2 -2
  226. package/lib/common/action-group/action-group.cjs +42 -41
  227. package/lib/common/action-group/action-group.css +1 -1
  228. package/lib/common/button-list/button-list.cjs +14 -23
  229. package/lib/common/button-list/button-list.css +1 -1
  230. package/lib/common/col/col.cjs +1 -1
  231. package/lib/common/cropping/cropping.cjs +5 -5
  232. package/lib/common/date-range-picker/components/range-picker/range-picker.cjs +2 -4
  233. package/lib/common/date-range-picker/components/single-picker/single-picker.cjs +2 -4
  234. package/lib/common/date-range-picker/date-range-picker.cjs +2 -2
  235. package/lib/common/emoji-select/components/emoji-item/emoji-item.cjs +4 -4
  236. package/lib/common/emoji-select/components/emoji-list/emoji-list.cjs +1 -1
  237. package/lib/common/emoji-select/icons/categories.cjs +9 -57
  238. package/lib/common/float-button/float-button.cjs +11 -6
  239. package/lib/common/float-button/float-button.css +1 -1
  240. package/lib/common/keep-alive/keep-alive.cjs +2 -2
  241. package/lib/common/keep-alive/scheduler.cjs +1 -1
  242. package/lib/common/preview-image/preview-image.cjs +4 -4
  243. package/lib/common/rawitem/rawitem.cjs +2 -2
  244. package/lib/common/row/row.cjs +1 -1
  245. package/lib/common/split/split.cjs +9 -9
  246. package/lib/common/split-trigger/split-trigger.cjs +1 -1
  247. package/lib/common/split-trigger/split-trigger.css +1 -1
  248. package/lib/common/tab-layout/tab-default-layout/tab-default-layout.cjs +1 -0
  249. package/lib/common/tab-layout/tab-dropdown/tab-dropdown.cjs +1 -1
  250. package/lib/common/tab-layout/tab-sidebar-layout/tab-sidebar-layout.css +1 -1
  251. package/lib/common/view-message/view-message.cjs +1 -1
  252. package/lib/control/app-menu/app-menu.cjs +1 -1
  253. package/lib/control/app-menu/custom-menu-design/custom-menu-design.cjs +1 -1
  254. package/lib/control/app-menu/menu-render-util.cjs +2 -0
  255. package/lib/control/app-menu-icon-view/app-menu-icon-view.cjs +2 -2
  256. package/lib/control/app-menu-icon-view/app-menu-icon-view.css +1 -1
  257. package/lib/control/app-menu-icon-view/index.cjs +1 -1
  258. package/lib/control/app-menu-list-view/app-menu-list-view.cjs +1 -1
  259. package/lib/control/app-menu-list-view/app-menu-list-view.css +1 -1
  260. package/lib/control/app-menu-list-view/index.cjs +1 -1
  261. package/lib/control/calendar/calendar.cjs +7 -7
  262. package/lib/control/calendar/calendar.css +1 -1
  263. package/lib/control/caption-bar/caption-bar.cjs +1 -1
  264. package/lib/control/caption-bar/caption-bar.css +1 -1
  265. package/lib/control/chart/chart.cjs +1 -1
  266. package/lib/control/dashboard/custom-dashboard-design/custom-dashboard-design.css +1 -1
  267. package/lib/control/dashboard/dashboard.cjs +3 -1
  268. package/lib/control/dashboard/dashboard.css +1 -1
  269. package/lib/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.cjs +1 -1
  270. package/lib/control/dashboard/portlet/chart-portlet/chart-portlet.cjs +1 -1
  271. package/lib/control/dashboard/portlet/container-portlet/container-portlet.cjs +1 -1
  272. package/lib/control/dashboard/portlet/html-portlet/html-portlet.cjs +1 -1
  273. package/lib/control/dashboard/portlet/list-portlet/list-portlet.cjs +1 -1
  274. package/lib/control/dashboard/portlet/menu-portlet/menu-portlet.cjs +1 -1
  275. package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +4 -4
  276. package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
  277. package/lib/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.cjs +1 -1
  278. package/lib/control/dashboard/portlet/view-portlet/view-portlet.cjs +1 -1
  279. package/lib/control/data-view/data-view.cjs +7 -7
  280. package/lib/control/data-view/data-view.css +1 -1
  281. package/lib/control/drbar/drbar.cjs +1 -1
  282. package/lib/control/drbar/drbar.css +1 -1
  283. package/lib/control/drtab/drtab.cjs +1 -1
  284. package/lib/control/drtab/drtab.controller.cjs +2 -2
  285. package/lib/control/drtab/drtab.css +1 -1
  286. package/lib/control/form/edit-form/edit-form.cjs +1 -1
  287. package/lib/control/form/form/form.cjs +2 -2
  288. package/lib/control/form/form-detail/form-button/form-button.cjs +1 -1
  289. package/lib/control/form/form-detail/form-button/form-button.css +1 -1
  290. package/lib/control/form/form-detail/form-group-panel/form-group-panel.cjs +1 -1
  291. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.cjs +1 -1
  292. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.cjs +6 -6
  293. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.provider.cjs +2 -2
  294. package/lib/control/form/search-form/search-form.cjs +1 -1
  295. package/lib/control/list/list/list.cjs +1 -1
  296. package/lib/control/list/md-ctrl/md-ctrl.cjs +2 -2
  297. package/lib/control/list/md-ctrl/md-ctrl.css +1 -1
  298. package/lib/control/pickup-view-panel/pickup-view-panel.cjs +1 -1
  299. package/lib/control/search-bar/filter-field-select/filter-field-select.cjs +1 -1
  300. package/lib/control/search-bar/filter-mode-select/filter-mode-select.cjs +1 -1
  301. package/lib/control/search-bar/filter-tree/filter-tree.cjs +1 -1
  302. package/lib/control/search-bar/filter-tree/filter-tree.css +1 -1
  303. package/lib/control/search-bar/search-bar.cjs +10 -6
  304. package/lib/control/search-bar/search-bar.css +1 -1
  305. package/lib/control/tab-exp-panel/tab-exp-panel.cjs +1 -1
  306. package/lib/control/tab-exp-panel/tab-exp-panel.css +1 -1
  307. package/lib/control/toolbar/float-toolbar/float-toolbar.cjs +13 -7
  308. package/lib/control/toolbar/float-toolbar/float-toolbar.css +1 -1
  309. package/lib/control/toolbar/toolbar-render-util.cjs +59 -32
  310. package/lib/control/toolbar/toolbar.cjs +1 -1
  311. package/lib/control/toolbar/toolbar.css +1 -1
  312. package/lib/control/tree/tree.cjs +9 -9
  313. package/lib/control/tree/tree.css +1 -1
  314. package/lib/control/tree-exp-bar/tree-exp-bar.cjs +1 -1
  315. package/lib/control/wizard-panel/wizard-panel.cjs +6 -6
  316. package/lib/control/wizard-panel/wizard-panel.css +1 -1
  317. package/lib/editor/array/ibiz-array/ibiz-array.css +1 -1
  318. package/lib/editor/cascader/ibiz-cascader/ibiz-cascader.cjs +2 -2
  319. package/lib/editor/color-picker/ibiz-color-picker/ibiz-color-picker.cjs +1 -1
  320. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +2 -2
  321. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +2 -2
  322. package/lib/editor/data-picker/picker-editor.controller.cjs +2 -2
  323. package/lib/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.css +1 -1
  324. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +7 -7
  325. package/lib/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.cjs +1 -1
  326. package/lib/editor/html/html-editor.controller.cjs +26 -9
  327. package/lib/editor/html/quill-editor/quill-editor.cjs +12 -3
  328. package/lib/editor/html/quill-editor/quill-editor.css +1 -1
  329. package/lib/editor/html/quill-editor-preview/quill-editor-preview.cjs +5 -6
  330. package/lib/editor/html/quill-editor-preview/quill-editor-preview.css +1 -1
  331. package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +15 -4
  332. package/lib/editor/markdown/markdown-editor.controller.cjs +23 -3
  333. package/lib/editor/qrcode/ibiz-qrcode/ibiz-qrcode.cjs +1 -1
  334. package/lib/editor/slider/ibiz-slider/ibiz-slider.cjs +2 -2
  335. package/lib/editor/slider/ibiz-slider/ibiz-slider.css +1 -1
  336. package/lib/editor/span/span/span.cjs +7 -7
  337. package/lib/editor/span/span-link/span-link.cjs +1 -1
  338. package/lib/editor/stepper/ibiz-stepper/ibiz-stepper.cjs +1 -1
  339. package/lib/editor/stepper/ibiz-stepper/ibiz-stepper.css +1 -1
  340. package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.cjs +1 -1
  341. package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.css +1 -1
  342. package/lib/editor/text-box/input/input.cjs +35 -4
  343. package/lib/editor/text-box/signature/signature.cjs +59 -19
  344. package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.cjs +2 -2
  345. package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.css +1 -1
  346. package/lib/editor/upload/upload-editor.controller.cjs +18 -1
  347. package/lib/editor/upload/use/use-van-upload.cjs +6 -2
  348. package/lib/ibiz-vue3.cjs +1 -0
  349. package/lib/index.cjs +10 -0
  350. package/lib/locale/en/index.cjs +26 -0
  351. package/lib/locale/zh-CN/index.cjs +29 -1
  352. package/lib/mob-app/App.cjs +9 -0
  353. package/lib/mob-app/components/modal-router-shell/modal-router-shell.cjs +6 -4
  354. package/lib/mob-app/components/router-shell/router-shell.cjs +1 -1
  355. package/lib/mob-app/guard/auth-guard/auth-guard.cjs +206 -194
  356. package/lib/mob-app/guard/auth-guard/dyna-auth-guard.cjs +67 -0
  357. package/lib/mob-app/guard/index.cjs +2 -0
  358. package/lib/mob-app/index.cjs +2 -0
  359. package/lib/mob-app/main.cjs +17 -2
  360. package/lib/mob-app/router/index.cjs +136 -79
  361. package/lib/mob-app/util/unauthorized-handler/unauthorized-handler.cjs +5 -5
  362. package/lib/node_modules/.pnpm/@amap_amap-jsapi-loader@1.0.1_patch_hash_73bpcwbs2m5ip4qppmz6a7epsa/node_modules/@amap/amap-jsapi-loader/dist/index.cjs +1 -1
  363. package/lib/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/packages/frame-talk-client-pc/index.cjs +1 -1
  364. package/lib/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/sdk/middlewares/index.cjs +1 -1
  365. package/lib/node_modules/.pnpm/file-saver@2.0.5/node_modules/file-saver/dist/FileSaver.min.cjs +20 -0
  366. package/lib/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.cjs +1 -1
  367. package/lib/node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.cjs +1 -1
  368. package/lib/node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/xlsx.cjs +24599 -0
  369. package/lib/panel-component/async-action/async-action/async-action.cjs +2 -2
  370. package/lib/panel-component/async-action/async-action-preview/async-action-preview.cjs +3 -3
  371. package/lib/panel-component/async-action/async-action-result/async-action-result.cjs +1 -1
  372. package/lib/panel-component/nav-pos-index/nav-pos-index.controller.cjs +2 -2
  373. package/lib/panel-component/panel-app-title/panel-app-title.cjs +2 -2
  374. package/lib/panel-component/panel-button/panel-button.css +1 -1
  375. package/lib/panel-component/panel-carousel/panel-carousel.controller.cjs +1 -1
  376. package/lib/panel-component/panel-video-player/panel-video-player.controller.cjs +2 -2
  377. package/lib/panel-component/split-container/split-container.controller.cjs +1 -1
  378. package/lib/panel-component/user-message/common/internal-message-default/internal-message-default.provider.cjs +1 -1
  379. package/lib/panel-component/user-message/user-message.cjs +1 -1
  380. package/lib/panel-component/user-message/user-message.util.cjs +1 -1
  381. package/lib/panel-component/view-content-panel-container/view-content-panel-container.cjs +29 -15
  382. package/lib/panel-component/view-content-panel-container/view-content-panel-container.css +1 -1
  383. package/lib/platform/ios-platform-provider.cjs +2 -2
  384. package/lib/platform/wechat-official-platform-provider.cjs +1 -1
  385. package/lib/util/ai-chat-util/ai-chat-util.cjs +1097 -0
  386. package/lib/util/ai-chat-util/ai-feedback/ai-feedback.cjs +142 -0
  387. package/lib/util/ai-chat-util/ai-feedback/ai-feedback.css +1 -0
  388. package/lib/util/app-drawer/app-drawer-component.cjs +18 -14
  389. package/lib/util/app-modal/app-modal-component.cjs +7 -2
  390. package/lib/util/app-popover/app-popover-component.cjs +4 -4
  391. package/lib/util/app-util/app-util.cjs +111 -6
  392. package/lib/util/button-util/button-util.cjs +34 -0
  393. package/lib/util/confirm-util/confirm-util.cjs +4 -4
  394. package/lib/util/directive/loading.cjs +1 -1
  395. package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
  396. package/lib/util/index.cjs +8 -0
  397. package/lib/util/list-util/list-render-util.cjs +24 -5
  398. package/lib/util/loading-util/loading-util.cjs +1 -1
  399. package/lib/util/open-view-util/open-view-util.cjs +1 -1
  400. package/lib/util/print-preview-util/print-preview-markdown/icon/icon.cjs +52 -0
  401. package/lib/util/print-preview-util/print-preview-markdown/print-preview-markdown.cjs +64 -0
  402. package/lib/util/print-preview-util/print-preview-markdown/print-preview-markdown.css +1 -0
  403. package/lib/util/print-preview-util/print-preview-util.cjs +59 -0
  404. package/lib/util/scan-qrcode/scan-qrcode.cjs +1 -1
  405. package/lib/util/user-route-util/user-route-util.cjs +58 -0
  406. package/lib/util/xlsx-util/xlsx-util.cjs +166 -0
  407. package/lib/view/portal-view/portal-view.cjs +3 -2
  408. package/lib/view-engine/index-view.engine.cjs +4 -0
  409. package/lib/view-engine/index.cjs +31 -31
  410. package/lib/view-engine/login-view.engine.cjs +1 -1
  411. package/lib/view-engine/mob-calendar-view.engine.cjs +11 -0
  412. package/lib/view-engine/mob-edit-view.engine.cjs +1 -1
  413. package/lib/view-engine/mob-pickup-md-view.engine.cjs +1 -0
  414. package/lib/view-engine/mob-wf-dyna-action-view.engine.cjs +1 -1
  415. package/lib/view-engine/mob-wf-dyna-edit-view.engine.cjs +1 -1
  416. package/lib/view-engine/mob-wf-dyna-start-view.engine.cjs +1 -1
  417. package/package.json +14 -11
  418. package/dist/chart-j1WkpBhc.js +0 -2
  419. package/dist/ibiz-markdown-editor-DMe7ZdYW.js +0 -2
  420. package/dist/ibiz-markdown-editor-DMe7ZdYW.js.map +0 -1
  421. package/dist/index-BkzKmBm3.js +0 -2
  422. package/dist/index-BkzKmBm3.js.map +0 -1
  423. package/dist/index-CADWRoaa.js +0 -76
  424. package/dist/index-CADWRoaa.js.map +0 -1
  425. package/dist/index-ugd4IDkI.js +0 -2
  426. package/dist/index-ugd4IDkI.js.map +0 -1
  427. package/dist/quill-D-355-KZ.js +0 -50
  428. package/dist/quill-editor-DyVF1l3P.js +0 -2
  429. package/dist/quill-editor-DyVF1l3P.js.map +0 -1
  430. package/dist/quill-editor-preview-3eAbHBYz.js +0 -2
  431. package/dist/quill-editor-preview-3eAbHBYz.js.map +0 -1
  432. package/dist/tree-sdPuTW-7.js +0 -2
@@ -0,0 +1,1095 @@
1
+ import { h } from 'vue';
2
+ import { createUUID } from 'qx-util';
3
+ import { UIActionUtil, SysUIActionTag, ConfigService, UtilService, AIUtilService } from '@ibiz-template/runtime';
4
+ import { StringUtil, IBizContext } from '@ibiz-template/core';
5
+ import { AIFeedback } from './ai-feedback/ai-feedback.mjs';
6
+
7
+ "use strict";
8
+ var __defProp = Object.defineProperty;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __publicField = (obj, key, value) => {
11
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
12
+ return value;
13
+ };
14
+ class AIChatUtil {
15
+ constructor() {
16
+ __publicField(this, "TOPIC_CHAT_PREFIX", "topic");
17
+ __publicField(this, "INLINE_CHAT_SUFFIX", "inline");
18
+ __publicField(this, "TEMP_CHAT_SUFFIX", "temp");
19
+ __publicField(this, "UNKOWN_CHAT_SUFFIX", "unknow");
20
+ __publicField(this, "PRE_ERROR_MESSAGE", "Expected content-type to be text/event-stream, Actual: application/json;charset=UTF-8");
21
+ }
22
+ /**
23
+ * 获取AI聊天对象
24
+ */
25
+ async getAIChat() {
26
+ const module = await import('@ibiz-template-plugin/ibiz-mob-ai-chat');
27
+ const chatInstance = module.chat || module.default.chat;
28
+ return chatInstance;
29
+ }
30
+ /**
31
+ * 获取编辑器扩展AI聊天参数
32
+ * @param editorParams
33
+ * @param context
34
+ * @param params
35
+ * @param data
36
+ */
37
+ async getEditorExAIChatParams(editorParams, context, params, data, deACMode, args) {
38
+ var _a;
39
+ const containerOptions = {};
40
+ if (editorParams.autoclose) {
41
+ try {
42
+ containerOptions.autoClose = JSON.parse(editorParams.autoclose);
43
+ } catch (error) {
44
+ ibiz.log.error(error);
45
+ }
46
+ }
47
+ if (editorParams.openmode)
48
+ containerOptions.openMode = editorParams.openmode;
49
+ if (editorParams.containerheight)
50
+ containerOptions.containerHeight = Number(editorParams.containerheight);
51
+ const topicOptions = {};
52
+ const chatOptions = {};
53
+ if (editorParams.srfaiappendcurdata) {
54
+ chatOptions.appendCurData = editorParams.srfaiappendcurdata === "true" ? data : void 0;
55
+ }
56
+ chatOptions.appendCurContent = editorParams.srfaiappendcurcontent ? StringUtil.fill(
57
+ editorParams.srfaiappendcurcontent,
58
+ context,
59
+ params,
60
+ data
61
+ ) : void 0;
62
+ chatOptions.autoQuestion = editorParams.autoquestion !== "false";
63
+ chatOptions.autoFill = editorParams.autofill === "true";
64
+ chatOptions.appendCurResource = editorParams.srfaiappendresource ? StringUtil.fill(editorParams.srfaiappendresource, context, params, data) : void 0;
65
+ if (editorParams.srfmode) {
66
+ chatOptions.srfMode = editorParams.srfmode;
67
+ }
68
+ let enableAIAgentChange = ibiz.config.common.enableAIAgentChange;
69
+ if (editorParams.srfenableaiagentchange) {
70
+ enableAIAgentChange = editorParams.srfenableaiagentchange === "true";
71
+ }
72
+ chatOptions.enableAIAgentChange = enableAIAgentChange;
73
+ if (editorParams.srfaiagent) {
74
+ chatOptions.activeAIAgentID = editorParams.srfaiagent;
75
+ }
76
+ chatOptions.fetchAgentList = () => {
77
+ return this.getAIAgentList(context, params, editorParams);
78
+ };
79
+ if (deACMode) {
80
+ const {
81
+ contentToolbarItems,
82
+ footerToolbarItems,
83
+ questionToolbarItems,
84
+ otherToolbarItems
85
+ } = this.calcAiToolbarItemsByAc(deACMode);
86
+ chatOptions.contentToolbarItems = contentToolbarItems;
87
+ chatOptions.footerToolbarItems = footerToolbarItems;
88
+ chatOptions.questionToolbarItems = questionToolbarItems;
89
+ chatOptions.otherToolbarItems = otherToolbarItems;
90
+ }
91
+ const sessionid = this.getChatSessionId("TEMP");
92
+ chatOptions.sessionid = sessionid;
93
+ let id = "";
94
+ let abortController;
95
+ let asyncacitonid = "";
96
+ const { chatInstance, view, ctrl } = args;
97
+ chatOptions.history = async (ctx, param, other) => {
98
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
99
+ const historyRequestData = {};
100
+ if (other.appendCurData) {
101
+ Object.assign(historyRequestData, {
102
+ ...other.appendCurData
103
+ });
104
+ }
105
+ if (other.sessionid) {
106
+ Object.assign(historyRequestData, {
107
+ sessionid: other.sessionid
108
+ });
109
+ }
110
+ if (other.srfaiagent) {
111
+ Object.assign(historyRequestData, {
112
+ srfaiagent: other.srfaiagent
113
+ });
114
+ }
115
+ if (other.srfmode) {
116
+ Object.assign(historyRequestData, {
117
+ mode: other.srfmode
118
+ });
119
+ }
120
+ const result = await deService.aiChatHistory(
121
+ ctx,
122
+ param,
123
+ historyRequestData
124
+ );
125
+ if (result.data && Array.isArray(result.data)) {
126
+ let preMsg;
127
+ result.data.forEach((item) => {
128
+ if (item.role === "TOOL") {
129
+ if (preMsg && item.content) {
130
+ chatInstance.aiChat.updateRecommendPrompt(
131
+ preMsg,
132
+ item.content
133
+ );
134
+ }
135
+ } else {
136
+ const msg = {
137
+ messageid: createUUID(),
138
+ state: 30,
139
+ type: "DEFAULT",
140
+ role: item.role,
141
+ content: item.content,
142
+ completed: true
143
+ };
144
+ preMsg = msg;
145
+ chatInstance.aiChat.addMessage(msg);
146
+ }
147
+ });
148
+ }
149
+ return true;
150
+ };
151
+ chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid2, srfaiagent, srfmode) => {
152
+ id = createUUID();
153
+ abortController = new AbortController();
154
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
155
+ try {
156
+ const questionRequestData = {
157
+ messages: arr,
158
+ sessionid: sessionid2
159
+ };
160
+ if (srfaiagent) {
161
+ questionRequestData.srfaiagent = srfaiagent;
162
+ }
163
+ if (srfmode) {
164
+ questionRequestData.mode = srfmode;
165
+ }
166
+ await deService.aiChatSse(
167
+ (msg) => {
168
+ if (msg.actionstate === 20 && msg.actionresult) {
169
+ asyncacitonid = msg.asyncacitonid;
170
+ aiChat.addMessage({
171
+ messageid: id,
172
+ state: msg.actionstate,
173
+ type: "DEFAULT",
174
+ role: "ASSISTANT",
175
+ content: msg.actionresult,
176
+ status: "pending"
177
+ });
178
+ } else if (msg.actionstate === 30 && msg.actionresult) {
179
+ const result = JSON.parse(msg.actionresult);
180
+ const choices = result.choices;
181
+ if (choices && choices.length > 0) {
182
+ aiChat.replaceMessage({
183
+ messageid: id,
184
+ state: msg.actionstate,
185
+ type: "DEFAULT",
186
+ role: "ASSISTANT",
187
+ content: choices[0].content || "",
188
+ realmessageid: choices[0].messageid,
189
+ status: "sent"
190
+ });
191
+ }
192
+ } else if (msg.actionstate === 40) {
193
+ aiChat.replaceMessage({
194
+ messageid: id,
195
+ state: msg.actionstate,
196
+ type: "ERROR",
197
+ role: "ASSISTANT",
198
+ content: msg.actionresult,
199
+ status: "failed"
200
+ });
201
+ }
202
+ },
203
+ abortController,
204
+ ctx,
205
+ param,
206
+ { ...questionRequestData }
207
+ );
208
+ } catch (error) {
209
+ if (error && error.message !== this.PRE_ERROR_MESSAGE) {
210
+ aiChat.replaceMessage({
211
+ messageid: id,
212
+ state: 40,
213
+ type: "ERROR",
214
+ role: "ASSISTANT",
215
+ content: error.message || ibiz.i18n.t("app.aiError"),
216
+ status: "failed"
217
+ });
218
+ } else {
219
+ const lastMessage = arr[arr.length - 1];
220
+ aiChat.replaceMessage(
221
+ {
222
+ ...lastMessage,
223
+ state: 40
224
+ },
225
+ false
226
+ );
227
+ }
228
+ abortController == null ? void 0 : abortController.abort();
229
+ } finally {
230
+ aiChat.completeMessage(id, true);
231
+ return true;
232
+ }
233
+ };
234
+ chatOptions.abortQuestion = async (aiChat, ctx, param, other) => {
235
+ abortController == null ? void 0 : abortController.abort();
236
+ if (asyncacitonid) {
237
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
238
+ const abortRequestData = { asyncacitonid };
239
+ if (other.sessionid) {
240
+ Object.assign(abortRequestData, {
241
+ sessionid: other.sessionid
242
+ });
243
+ }
244
+ const result = await deService.aiChatCancel(
245
+ ctx,
246
+ param,
247
+ abortRequestData
248
+ );
249
+ asyncacitonid = "";
250
+ }
251
+ await aiChat.stopMessage({
252
+ messageid: id,
253
+ state: 30,
254
+ type: "DEFAULT",
255
+ role: "ASSISTANT",
256
+ content: "",
257
+ status: "canceled"
258
+ });
259
+ await aiChat.completeMessage(id, true);
260
+ };
261
+ chatOptions.recommendPrompt = async (ctx, param, other) => {
262
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
263
+ const tempParams = { ...param };
264
+ if (other.srfaiagent) {
265
+ tempParams.srfaiagent = other.srfaiagent;
266
+ }
267
+ const result = await deService.aiChatRecommendPrompt(
268
+ ctx,
269
+ tempParams,
270
+ other.message
271
+ );
272
+ if (result.ok && result.data) {
273
+ const choices = result.data.choices;
274
+ if (choices && choices.length > 0) {
275
+ return choices[0];
276
+ }
277
+ return null;
278
+ }
279
+ return null;
280
+ };
281
+ chatOptions.chatDigest = async (ctx, param, other) => {
282
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
283
+ const tempParams = { ...param };
284
+ if (other.srfaiagent) {
285
+ tempParams.srfaiagent = other.srfaiagent;
286
+ }
287
+ const result = await deService.aiChatChatDigest(
288
+ ctx,
289
+ tempParams,
290
+ other.message
291
+ );
292
+ if (result.ok && result.data) {
293
+ const choices = result.data.choices;
294
+ if (choices && choices.length > 0) {
295
+ return choices[0];
296
+ }
297
+ return null;
298
+ }
299
+ return null;
300
+ };
301
+ const app = ibiz.hub.getApp(context.srfappid);
302
+ const folder = ibiz.env.defaultOSSCat || app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
303
+ let globalDownloadPrifix = false;
304
+ if (editorParams.globaldownloadprifix) {
305
+ globalDownloadPrifix = editorParams.globaldownloadprifix === "true";
306
+ } else {
307
+ globalDownloadPrifix = ibiz.config.common.globalDownloadPrifix;
308
+ }
309
+ chatOptions.uploader = {
310
+ folder: "".concat(folder, "$"),
311
+ globalDownloadPrifix,
312
+ onUpload: async (file, reportProgress, options) => {
313
+ const fileMeata = ibiz.util.file.calcFileUpDownUrl(
314
+ (options == null ? void 0 : options.context) || context,
315
+ (options == null ? void 0 : options.params) || params,
316
+ {},
317
+ { enableNoAccess: true, osscat: folder }
318
+ );
319
+ const fielUploadHeaders = ibiz.util.file.getUploadHeaders();
320
+ const formData = new FormData();
321
+ formData.append("file", file);
322
+ const res = await ibiz.net.axios({
323
+ url: fileMeata.uploadUrl,
324
+ method: "post",
325
+ headers: fielUploadHeaders,
326
+ data: formData,
327
+ onUploadProgress: (progressEvent) => {
328
+ const percent = progressEvent.loaded / progressEvent.total * 100;
329
+ reportProgress(percent);
330
+ }
331
+ });
332
+ return res.data;
333
+ },
334
+ onDownLoad: async (file, options) => {
335
+ const { downloadUrl } = ibiz.util.file.calcFileUpDownUrl(
336
+ (options == null ? void 0 : options.context) || context,
337
+ (options == null ? void 0 : options.params) || params,
338
+ {},
339
+ { enableNoAccess: true, osscat: folder, globalDownloadPrifix }
340
+ );
341
+ const url = downloadUrl.replace("%fileId%", file.fileid);
342
+ await ibiz.util.file.fileDownload(
343
+ url,
344
+ file.filename,
345
+ {
346
+ context: (options == null ? void 0 : options.context) || context,
347
+ params: (options == null ? void 0 : options.params) || params,
348
+ data: {},
349
+ file: { fileId: file.id, ...file },
350
+ extraParams: {
351
+ enableNoAccess: true,
352
+ osscat: folder,
353
+ globalDownloadPrifix
354
+ }
355
+ },
356
+ void 0,
357
+ true
358
+ );
359
+ }
360
+ };
361
+ chatOptions.extendToolbarClick = async (event, source, context2, params2, data2) => {
362
+ var _a2, _b, _c;
363
+ const { id: id2, isPluginApp } = source;
364
+ let appId = source.appId;
365
+ const tempContext = IBizContext.create(context2);
366
+ if (isPluginApp) {
367
+ const mainApp = ibiz.hub.getApp();
368
+ const targetApp = (_a2 = mainApp.model.subAppRefs) == null ? void 0 : _a2.find(
369
+ (subAppRef) => subAppRef.appId.endsWith("__".concat(appId))
370
+ );
371
+ if (targetApp) {
372
+ const targetAppId = targetApp.appId;
373
+ tempContext.srfappid = targetAppId;
374
+ appId = targetAppId;
375
+ }
376
+ }
377
+ const result = await UIActionUtil.exec(
378
+ id2,
379
+ {
380
+ view,
381
+ ctrl,
382
+ context: tempContext,
383
+ params: params2,
384
+ data: [data2],
385
+ event
386
+ },
387
+ appId
388
+ );
389
+ if (result.closeView) {
390
+ view.closeView({ ok: true });
391
+ } else if (result.refresh) {
392
+ switch (result.refreshMode) {
393
+ case 1:
394
+ view.callUIAction(SysUIActionTag.REFRESH);
395
+ break;
396
+ case 2:
397
+ (_b = view.parentView) == null ? void 0 : _b.callUIAction(SysUIActionTag.REFRESH);
398
+ break;
399
+ case 3:
400
+ (_c = view.getTopView()) == null ? void 0 : _c.callUIAction(SysUIActionTag.REFRESH);
401
+ break;
402
+ default:
403
+ }
404
+ }
405
+ return result;
406
+ };
407
+ return { containerOptions, topicOptions, chatOptions };
408
+ }
409
+ /**
410
+ * 获取界面行为扩展AI聊天参数
411
+ * @param context
412
+ * @param params
413
+ * @param data
414
+ * @param deACMode
415
+ * @param args
416
+ * @returns
417
+ */
418
+ async getUIActionExAIChatParams(context, params, data, deACMode, args) {
419
+ var _a;
420
+ const containerOptions = {};
421
+ if (params.hasOwnProperty("autoclose")) {
422
+ try {
423
+ containerOptions.autoClose = JSON.parse(params.autoclose);
424
+ delete params.autoclose;
425
+ } catch (error) {
426
+ ibiz.log.error(error);
427
+ }
428
+ }
429
+ if (params.hasOwnProperty("openmode")) {
430
+ containerOptions.openMode = params.openmode;
431
+ delete params.openmode;
432
+ }
433
+ if (params.hasOwnProperty("containerheight")) {
434
+ containerOptions.containerHeight = Number(params.containerheight);
435
+ delete params.containerheight;
436
+ }
437
+ const topicOptions = {};
438
+ if (params.hasOwnProperty("topiccaptionmode")) {
439
+ topicOptions.captionMode = params.topiccaptionmode;
440
+ delete params.topiccaptionmode;
441
+ } else {
442
+ topicOptions.captionMode = ibiz.config.common.aiChatTopicCaptionMode;
443
+ }
444
+ topicOptions.disableStorage = false;
445
+ if (params.hasOwnProperty("disabletopicstorage")) {
446
+ topicOptions.disableStorage = params.disabletopicstorage === "true";
447
+ delete params.disabletopicstorage;
448
+ }
449
+ topicOptions.beforeDelete = async (...args2) => {
450
+ const isBatchRemove = args2[4];
451
+ const result = await ibiz.confirm.warning({
452
+ title: ibiz.i18n.t(
453
+ "util.appUtil.".concat(isBatchRemove ? "clearTopic" : "aiTitle")
454
+ ),
455
+ desc: ibiz.i18n.t(
456
+ "util.appUtil.".concat(isBatchRemove ? "clearTopicDesc" : "aiDesc")
457
+ )
458
+ });
459
+ return result;
460
+ };
461
+ topicOptions.action = async (action, context2, params2, data2, event) => {
462
+ if (action === "LINK")
463
+ await ibiz.openView.push(data2.url);
464
+ return true;
465
+ };
466
+ topicOptions.configService = (appid, storageType, subType) => {
467
+ return new ConfigService(appid, storageType, subType);
468
+ };
469
+ const chatOptions = {};
470
+ if (context.srfaiappendcurdata === "true") {
471
+ chatOptions.appendCurData = data;
472
+ } else if (params.hasOwnProperty("srfaiappendcurdata")) {
473
+ chatOptions.appendCurData = params.srfaiappendcurdata === "true" ? data : void 0;
474
+ delete params.srfaiappendcurdata;
475
+ }
476
+ if (params.hasOwnProperty("srfaiappendcurcontent")) {
477
+ chatOptions.appendCurContent = StringUtil.fill(
478
+ params.srfaiappendcurcontent,
479
+ context,
480
+ params,
481
+ data
482
+ );
483
+ delete params.srfaiappendcurcontent;
484
+ }
485
+ if (params.hasOwnProperty("autoquestion")) {
486
+ chatOptions.autoQuestion = params.autoquestion !== "false";
487
+ delete params.autoquestion;
488
+ }
489
+ if (params.hasOwnProperty("srfaiappendresource")) {
490
+ chatOptions.appendCurResource = StringUtil.fill(
491
+ params.srfaiappendresource,
492
+ context,
493
+ params,
494
+ data
495
+ );
496
+ delete params.srfaiappendresource;
497
+ }
498
+ if (params.hasOwnProperty("srfmode")) {
499
+ chatOptions.srfMode = params.srfmode;
500
+ delete params.srfmode;
501
+ }
502
+ if (params.hasOwnProperty("srfaiagent")) {
503
+ chatOptions.activeAIAgentID = params.srfaiagent;
504
+ delete params.srfaiagent;
505
+ }
506
+ let enableAIAgentChange = ibiz.config.common.enableAIAgentChange;
507
+ if (params.hasOwnProperty("srfenableaiagentchange")) {
508
+ enableAIAgentChange = params.srfenableaiagentchange === "true";
509
+ delete params.srfenableaiagentchange;
510
+ }
511
+ chatOptions.enableAIAgentChange = enableAIAgentChange;
512
+ chatOptions.fetchAgentList = () => {
513
+ return this.getAIAgentList(context, params);
514
+ };
515
+ if (deACMode) {
516
+ const {
517
+ contentToolbarItems,
518
+ footerToolbarItems,
519
+ questionToolbarItems,
520
+ otherToolbarItems
521
+ } = this.calcAiToolbarItemsByAc(deACMode);
522
+ chatOptions.contentToolbarItems = contentToolbarItems;
523
+ chatOptions.footerToolbarItems = footerToolbarItems;
524
+ chatOptions.questionToolbarItems = questionToolbarItems;
525
+ chatOptions.otherToolbarItems = otherToolbarItems;
526
+ }
527
+ let id = "";
528
+ let abortController;
529
+ let asyncacitonid = "";
530
+ const { chatInstance, view, ctrl } = args;
531
+ chatOptions.history = async (ctx, param, other) => {
532
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
533
+ const historyRequestData = {};
534
+ if (other.appendCurData) {
535
+ Object.assign(historyRequestData, {
536
+ ...other.appendCurData
537
+ });
538
+ }
539
+ if (other.sessionid) {
540
+ Object.assign(historyRequestData, {
541
+ sessionid: other.sessionid
542
+ });
543
+ }
544
+ if (other.srfaiagent) {
545
+ Object.assign(historyRequestData, {
546
+ srfaiagent: other.srfaiagent
547
+ });
548
+ }
549
+ if (other.srfmode) {
550
+ Object.assign(historyRequestData, {
551
+ mode: other.srfmode
552
+ });
553
+ }
554
+ const result = await deService.aiChatHistory(
555
+ ctx,
556
+ param,
557
+ historyRequestData
558
+ );
559
+ if (result.data && Array.isArray(result.data)) {
560
+ let preMsg;
561
+ result.data.forEach((item) => {
562
+ if (item.role === "TOOL") {
563
+ if (preMsg && item.content) {
564
+ chatInstance.aiChat.updateRecommendPrompt(
565
+ preMsg,
566
+ item.content
567
+ );
568
+ }
569
+ } else {
570
+ const msg = {
571
+ messageid: createUUID(),
572
+ state: 30,
573
+ type: "DEFAULT",
574
+ role: item.role,
575
+ content: item.content,
576
+ completed: true
577
+ };
578
+ preMsg = msg;
579
+ chatInstance.aiChat.addMessage(msg);
580
+ }
581
+ });
582
+ }
583
+ return true;
584
+ };
585
+ chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode) => {
586
+ id = createUUID();
587
+ abortController = new AbortController();
588
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
589
+ try {
590
+ const questionRequestData = {
591
+ messages: arr,
592
+ sessionid
593
+ };
594
+ if (srfaiagent) {
595
+ questionRequestData.srfaiagent = srfaiagent;
596
+ }
597
+ if (srfmode) {
598
+ questionRequestData.mode = srfmode;
599
+ }
600
+ await deService.aiChatSse(
601
+ (msg) => {
602
+ if (msg.actionstate === 20 && msg.actionresult) {
603
+ asyncacitonid = msg.asyncacitonid;
604
+ aiChat.addMessage({
605
+ messageid: id,
606
+ state: msg.actionstate,
607
+ type: "DEFAULT",
608
+ role: "ASSISTANT",
609
+ content: msg.actionresult,
610
+ status: "pending"
611
+ });
612
+ } else if (msg.actionstate === 30 && msg.actionresult) {
613
+ const result = JSON.parse(msg.actionresult);
614
+ const choices = result.choices;
615
+ if (choices && choices.length > 0) {
616
+ aiChat.replaceMessage({
617
+ messageid: id,
618
+ state: msg.actionstate,
619
+ type: "DEFAULT",
620
+ role: "ASSISTANT",
621
+ content: choices[0].content || "",
622
+ realmessageid: choices[0].messageid,
623
+ status: "sent"
624
+ });
625
+ }
626
+ } else if (msg.actionstate === 40) {
627
+ aiChat.replaceMessage({
628
+ messageid: id,
629
+ state: msg.actionstate,
630
+ type: "ERROR",
631
+ role: "ASSISTANT",
632
+ content: msg.actionresult,
633
+ status: "failed"
634
+ });
635
+ }
636
+ },
637
+ abortController,
638
+ ctx,
639
+ param,
640
+ { ...questionRequestData }
641
+ );
642
+ } catch (error) {
643
+ if (error && error.message !== this.PRE_ERROR_MESSAGE) {
644
+ aiChat.replaceMessage({
645
+ messageid: id,
646
+ state: 40,
647
+ type: "ERROR",
648
+ role: "ASSISTANT",
649
+ content: error.message || ibiz.i18n.t("app.aiError"),
650
+ status: "failed"
651
+ });
652
+ } else {
653
+ const lastMessage = arr[arr.length - 1];
654
+ aiChat.replaceMessage(
655
+ {
656
+ ...lastMessage,
657
+ state: 40
658
+ },
659
+ false
660
+ );
661
+ }
662
+ abortController == null ? void 0 : abortController.abort();
663
+ } finally {
664
+ aiChat.completeMessage(id, true);
665
+ return true;
666
+ }
667
+ };
668
+ chatOptions.abortQuestion = async (aiChat, ctx, param, other) => {
669
+ abortController == null ? void 0 : abortController.abort();
670
+ if (asyncacitonid) {
671
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
672
+ const abortRequestData = { asyncacitonid };
673
+ if (other.sessionid) {
674
+ Object.assign(abortRequestData, {
675
+ sessionid: other.sessionid
676
+ });
677
+ }
678
+ const result = await deService.aiChatCancel(
679
+ ctx,
680
+ param,
681
+ abortRequestData
682
+ );
683
+ asyncacitonid = "";
684
+ }
685
+ await aiChat.stopMessage({
686
+ messageid: id,
687
+ state: 30,
688
+ type: "DEFAULT",
689
+ role: "ASSISTANT",
690
+ content: "",
691
+ status: "canceled"
692
+ });
693
+ await aiChat.completeMessage(id, true);
694
+ };
695
+ chatOptions.recommendPrompt = async (ctx, param, other) => {
696
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
697
+ const tempParams = { ...param };
698
+ if (other.srfaiagent) {
699
+ tempParams.srfaiagent = other.srfaiagent;
700
+ }
701
+ const result = await deService.aiChatRecommendPrompt(
702
+ ctx,
703
+ tempParams,
704
+ other.message
705
+ );
706
+ if (result.ok && result.data) {
707
+ const choices = result.data.choices;
708
+ if (choices && choices.length > 0) {
709
+ return choices[0];
710
+ }
711
+ return null;
712
+ }
713
+ return null;
714
+ };
715
+ chatOptions.chatDigest = async (ctx, param, other) => {
716
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
717
+ const tempParams = { ...param };
718
+ if (other.srfaiagent) {
719
+ tempParams.srfaiagent = other.srfaiagent;
720
+ }
721
+ const result = await deService.aiChatChatDigest(
722
+ ctx,
723
+ tempParams,
724
+ other.message
725
+ );
726
+ if (result.ok && result.data) {
727
+ const choices = result.data.choices;
728
+ if (choices && choices.length > 0) {
729
+ return choices[0];
730
+ }
731
+ return null;
732
+ }
733
+ return null;
734
+ };
735
+ const app = ibiz.hub.getApp(context.srfappid);
736
+ const folder = ibiz.env.defaultOSSCat || app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
737
+ let globalDownloadPrifix = false;
738
+ if (params.hasOwnProperty("globaldownloadprifix")) {
739
+ globalDownloadPrifix = params.globaldownloadprifix === "true";
740
+ delete params.globaldownloadprifix;
741
+ } else {
742
+ globalDownloadPrifix = ibiz.config.common.globalDownloadPrifix;
743
+ }
744
+ chatOptions.uploader = {
745
+ folder: "".concat(folder, "$"),
746
+ globalDownloadPrifix,
747
+ onUpload: async (file, reportProgress, options) => {
748
+ const { uploadUrl } = ibiz.util.file.calcFileUpDownUrl(
749
+ (options == null ? void 0 : options.context) || context,
750
+ (options == null ? void 0 : options.params) || params,
751
+ {},
752
+ { enableNoAccess: true, osscat: folder }
753
+ );
754
+ const headers = ibiz.util.file.getUploadHeaders();
755
+ const formData = new FormData();
756
+ formData.append("file", file);
757
+ const res = await ibiz.net.axios({
758
+ url: uploadUrl,
759
+ method: "post",
760
+ headers,
761
+ data: formData,
762
+ onUploadProgress: (progressEvent) => {
763
+ const percent = progressEvent.loaded / progressEvent.total * 100;
764
+ reportProgress(percent);
765
+ }
766
+ });
767
+ return res.data;
768
+ },
769
+ onDownLoad: async (file, options) => {
770
+ const { downloadUrl } = ibiz.util.file.calcFileUpDownUrl(
771
+ (options == null ? void 0 : options.context) || context,
772
+ (options == null ? void 0 : options.params) || params,
773
+ {},
774
+ { enableNoAccess: true, osscat: folder, globalDownloadPrifix }
775
+ );
776
+ const url = downloadUrl.replace("%fileId%", file.fileid);
777
+ await ibiz.util.file.fileDownload(
778
+ url,
779
+ file.filename,
780
+ {
781
+ context: (options == null ? void 0 : options.context) || context,
782
+ params: (options == null ? void 0 : options.params) || params,
783
+ data: {},
784
+ file: { fileId: file.id, ...file },
785
+ extraParams: {
786
+ enableNoAccess: true,
787
+ osscat: folder,
788
+ globalDownloadPrifix
789
+ }
790
+ },
791
+ void 0,
792
+ true
793
+ );
794
+ }
795
+ };
796
+ chatOptions.extendToolbarClick = async (event, source, context2, params2, data2) => {
797
+ var _a2, _b, _c;
798
+ const { id: id2, isPluginApp } = source;
799
+ let appId = source.appId;
800
+ const tempContext = IBizContext.create(context2);
801
+ if (isPluginApp) {
802
+ const mainApp = ibiz.hub.getApp();
803
+ const targetApp = (_a2 = mainApp.model.subAppRefs) == null ? void 0 : _a2.find(
804
+ (subAppRef) => subAppRef.appId.endsWith("__".concat(appId))
805
+ );
806
+ if (targetApp) {
807
+ const targetAppId = targetApp.appId;
808
+ tempContext.srfappid = targetAppId;
809
+ appId = targetAppId;
810
+ }
811
+ }
812
+ const result = await UIActionUtil.exec(
813
+ id2,
814
+ {
815
+ view,
816
+ ctrl,
817
+ context: tempContext,
818
+ params: params2,
819
+ data: [data2],
820
+ event
821
+ },
822
+ appId
823
+ );
824
+ if (result.closeView) {
825
+ view.closeView({ ok: true });
826
+ } else if (result.refresh) {
827
+ switch (result.refreshMode) {
828
+ case 1:
829
+ view.callUIAction(SysUIActionTag.REFRESH);
830
+ break;
831
+ case 2:
832
+ (_b = view.parentView) == null ? void 0 : _b.callUIAction(SysUIActionTag.REFRESH);
833
+ break;
834
+ case 3:
835
+ (_c = view.getTopView()) == null ? void 0 : _c.callUIAction(SysUIActionTag.REFRESH);
836
+ break;
837
+ default:
838
+ }
839
+ }
840
+ return result;
841
+ };
842
+ return { containerOptions, topicOptions, chatOptions };
843
+ }
844
+ /**
845
+ * 计算界面行为扩展AI聊天工具栏项
846
+ * @param deACMode 自填模式
847
+ */
848
+ calcAiToolbarItemsByAc(deACMode) {
849
+ var _a;
850
+ const contentToolbarItems = [];
851
+ const footerToolbarItems = [];
852
+ const questionToolbarItems = [];
853
+ const functionToolbarItems = [];
854
+ const inlineToolbarItems = [];
855
+ const otherToolbarItems = [];
856
+ if (!deACMode || !deACMode.deuiactionGroup) {
857
+ return {
858
+ contentToolbarItems,
859
+ footerToolbarItems,
860
+ questionToolbarItems,
861
+ otherToolbarItems,
862
+ functionToolbarItems,
863
+ inlineToolbarItems
864
+ };
865
+ }
866
+ (_a = deACMode.deuiactionGroup.uiactionGroupDetails) == null ? void 0 : _a.forEach(
867
+ (item) => {
868
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
869
+ const toolbarItem = {
870
+ appId: item.appId,
871
+ id: item.uiactionId,
872
+ label: item.showCaption ? item.caption : "",
873
+ title: item.tooltip,
874
+ icon: {
875
+ showIcon: item.showIcon,
876
+ cssClass: (_a2 = item.sysImage) == null ? void 0 : _a2.cssClass,
877
+ imagePath: (_b = item.sysImage) == null ? void 0 : _b.imagePath
878
+ }
879
+ };
880
+ if (item.sysImage && item.sysImage.imagePath && !item.sysImage.imagePath.startsWith("http")) {
881
+ toolbarItem.icon.imagePath = "".concat(ibiz.env.assetsUrl, "/images/").concat(item.sysImage.imagePath);
882
+ }
883
+ if ((_c = item.uiactionId) == null ? void 0 : _c.startsWith("mob_msg_content_")) {
884
+ contentToolbarItems.push(toolbarItem);
885
+ } else if ((_d = item.uiactionId) == null ? void 0 : _d.startsWith("mob_msg_footer_")) {
886
+ footerToolbarItems.push(toolbarItem);
887
+ } else if ((_e = item.uiactionId) == null ? void 0 : _e.startsWith("mob_question_")) {
888
+ questionToolbarItems.push(toolbarItem);
889
+ } else if ((_f = item.uiactionId) == null ? void 0 : _f.startsWith("mob_function_")) {
890
+ functionToolbarItems.push(toolbarItem);
891
+ } else if (((_g = item.uiactionId) == null ? void 0 : _g.startsWith("mob_inline")) || item.refUIActionGroup && ((_h = item.refUIActionGroup.id) == null ? void 0 : _h.startsWith("mob_inline"))) {
892
+ inlineToolbarItems.push(toolbarItem);
893
+ } else {
894
+ otherToolbarItems.push(toolbarItem);
895
+ }
896
+ }
897
+ );
898
+ return {
899
+ contentToolbarItems,
900
+ footerToolbarItems,
901
+ questionToolbarItems,
902
+ otherToolbarItems,
903
+ functionToolbarItems,
904
+ inlineToolbarItems
905
+ };
906
+ }
907
+ /**
908
+ * 获取AI代理列表
909
+ * @param context
910
+ * @param params
911
+ */
912
+ async getAIAgentList(context, params, editorParams) {
913
+ const emptyList = [];
914
+ const app = ibiz.hub.getApp(ibiz.env.appId);
915
+ const aiAgentUtil = app.getAppUtil("DYNAMICAIGENT", "CUSTOM");
916
+ if (!aiAgentUtil)
917
+ return emptyList;
918
+ const utilService = new UtilService(aiAgentUtil);
919
+ const resultParams = { ...params, page: 0, size: 1e3 };
920
+ if (editorParams && editorParams.srfaiagentscope) {
921
+ Object.assign(resultParams, {
922
+ srfaiagentscope: editorParams.srfaiagentscope
923
+ });
924
+ }
925
+ const data = await utilService.load("", context, resultParams);
926
+ if (!data || data.length === 0)
927
+ return emptyList;
928
+ return data;
929
+ }
930
+ /**
931
+ * 获取会话标识(TOPIC:适用于多话题场景;INLINE:适用于ai行内会话场景;TEMP:适用于传统ai编辑器会话场景)
932
+ * @param sessionID
933
+ */
934
+ getChatSessionId(type, sessionID) {
935
+ let tempSessionID = "";
936
+ switch (type) {
937
+ case "TOPIC":
938
+ tempSessionID += this.TOPIC_CHAT_PREFIX;
939
+ break;
940
+ case "INLINE":
941
+ tempSessionID += this.INLINE_CHAT_SUFFIX;
942
+ break;
943
+ case "TEMP":
944
+ tempSessionID += this.TEMP_CHAT_SUFFIX;
945
+ break;
946
+ default:
947
+ tempSessionID += this.UNKOWN_CHAT_SUFFIX;
948
+ break;
949
+ }
950
+ tempSessionID += "@".concat(sessionID || "mob@".concat(createUUID()), "@").concat((/* @__PURE__ */ new Date()).getTime());
951
+ return tempSessionID;
952
+ }
953
+ /**
954
+ * 获取AI会话应用功能
955
+ * @returns
956
+ */
957
+ async getAIResourceUtil() {
958
+ const app = ibiz.hub.getApp(ibiz.env.appId);
959
+ const aiSessionUtil = app.getAppUtil("DYNAMICAISESSION", "CUSTOM");
960
+ return aiSessionUtil;
961
+ }
962
+ /**
963
+ * 获取AI资源参数
964
+ * @returns
965
+ */
966
+ async getAIResourceOptions(context, params) {
967
+ const resourceOptions = {};
968
+ if (ibiz.config.common.aiResourceMode) {
969
+ resourceOptions.resourceMode = ibiz.config.common.aiResourceMode;
970
+ return resourceOptions;
971
+ }
972
+ const aiSessionUtil = await this.getAIResourceUtil();
973
+ resourceOptions.resourceMode = aiSessionUtil ? "REMOTE" : "LOCAL";
974
+ if (!aiSessionUtil) {
975
+ return resourceOptions;
976
+ }
977
+ const utilService = new AIUtilService(aiSessionUtil);
978
+ resourceOptions.getSessionList = async (args = {}) => {
979
+ const tempParams = { ...params, page: 0, size: 1e3, ...args };
980
+ const result = await utilService.getSessionList(context, tempParams);
981
+ return result;
982
+ };
983
+ resourceOptions.updateSession = async (realID, data) => {
984
+ const result = await utilService.updateSession(
985
+ context,
986
+ params,
987
+ realID,
988
+ data
989
+ );
990
+ return result;
991
+ };
992
+ resourceOptions.deleteSession = async (realID) => {
993
+ const result = await utilService.deleteSession(context, params, realID);
994
+ return result;
995
+ };
996
+ resourceOptions.getMessages = async (args = {}) => {
997
+ const tempParams = { ...params, page: 0, size: 1e3, ...args };
998
+ const result = await utilService.getMessageList(context, tempParams);
999
+ return result;
1000
+ };
1001
+ resourceOptions.deleteMessage = async (messageID) => {
1002
+ const result = await utilService.deleteMessage(
1003
+ context,
1004
+ params,
1005
+ messageID
1006
+ );
1007
+ return result;
1008
+ };
1009
+ resourceOptions.likeMessage = async (messageID) => {
1010
+ const result = await utilService.likeMessage(context, params, messageID);
1011
+ return result;
1012
+ };
1013
+ resourceOptions.dislikeMessage = async (messageID, feedbackContent) => {
1014
+ var _a, _b;
1015
+ const overlay = ibiz.overlay.createDrawer(
1016
+ (modal) => {
1017
+ return h(AIFeedback, {
1018
+ modal,
1019
+ content: feedbackContent
1020
+ });
1021
+ },
1022
+ void 0,
1023
+ {
1024
+ height: "auto",
1025
+ placement: "bottom",
1026
+ attrs: {
1027
+ closeable: false
1028
+ }
1029
+ }
1030
+ );
1031
+ overlay.present();
1032
+ const result = await overlay.onWillDismiss();
1033
+ if (!result.ok)
1034
+ return false;
1035
+ const content = (_b = (_a = result.data) == null ? void 0 : _a[0]) == null ? void 0 : _b.feedbackContent;
1036
+ const _result = await utilService.dislikeMessage(
1037
+ context,
1038
+ params,
1039
+ messageID,
1040
+ content
1041
+ );
1042
+ return _result;
1043
+ };
1044
+ resourceOptions.cancelFeedback = async (messageID) => {
1045
+ const result = await utilService.cancelFeedback(
1046
+ context,
1047
+ params,
1048
+ messageID
1049
+ );
1050
+ return result;
1051
+ };
1052
+ resourceOptions.clearAllSession = async (excludeSessionID) => {
1053
+ const result = await utilService.clearAllSession(
1054
+ context,
1055
+ params,
1056
+ excludeSessionID
1057
+ );
1058
+ return result;
1059
+ };
1060
+ resourceOptions.clearAllMessageBySessionId = async (realID) => {
1061
+ const result = await utilService.clearAllMessageBySessionId(
1062
+ context,
1063
+ params,
1064
+ realID
1065
+ );
1066
+ return result;
1067
+ };
1068
+ return resourceOptions;
1069
+ }
1070
+ /**
1071
+ * @description 获取AI聊天模式
1072
+ * @param {('UIACTION' | 'EDITOR')} type 场景类型:UIACTION:界面行为;EDITOR:编辑器
1073
+ * @param {IContext} context
1074
+ * @param {IParams} params
1075
+ * @param {IData} [editorParams]
1076
+ * @returns {*} {('DEFAULT' | 'TOPIC')}
1077
+ * @memberof AIChatUtil
1078
+ */
1079
+ getAIChatMode(type, context, params, editorParams) {
1080
+ switch (type) {
1081
+ case "UIACTION":
1082
+ if (params.srfenabletempmode && params.srfenabletempmode === "true") {
1083
+ delete params.srfenabletempmode;
1084
+ return "DEFAULT";
1085
+ }
1086
+ return "TOPIC";
1087
+ case "EDITOR":
1088
+ return "DEFAULT";
1089
+ default:
1090
+ return "DEFAULT";
1091
+ }
1092
+ }
1093
+ }
1094
+
1095
+ export { AIChatUtil };