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