@ibiz-template/vue3-components 0.7.41-alpha.94 → 0.7.41-alpha.95

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 (62) hide show
  1. package/dist/index-1KhprUjB.js +339 -0
  2. package/dist/index-ChKlnzfZ.js +1 -0
  3. package/dist/index-DiSn0c6_.js +1 -0
  4. package/dist/{index.es-DFx4k2jd.js → index.es-Cvhhf-Jp.js} +1 -1
  5. package/dist/index.min.css +1 -1
  6. package/dist/index.system.min.js +1 -1
  7. package/dist/{wang-editor-DYEAyKoh.js → wang-editor-D7CsxIdH.js} +1 -1
  8. package/dist/{xlsx-util-DwFMdVBD.js → xlsx-util-Dq_UVHCG.js} +1 -1
  9. package/es/common/emoji-select/components/categories/categories.mjs +1 -1
  10. package/es/common/rawitem/rawitem.mjs +1 -0
  11. package/es/control/dashboard/dashboard-design/dashboard-design.mjs +9 -2
  12. package/es/control/kanban/swimlane-kanban/swimlane-kanban.mjs +1 -1
  13. package/es/editor/ai-chat/embed-ai-chat/embed-ai-chat.css +1 -0
  14. package/es/editor/ai-chat/embed-ai-chat/embed-ai-chat.mjs +91 -0
  15. package/es/editor/ai-chat/embed-ai-chat-editor.controller.mjs +70 -0
  16. package/es/editor/ai-chat/embed-ai-chat-editor.provider.mjs +22 -0
  17. package/es/editor/ai-chat/index.mjs +5 -0
  18. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +1 -1
  19. package/es/editor/index.mjs +8 -0
  20. package/es/index.mjs +1 -0
  21. package/es/locale/en/index.mjs +2 -1
  22. package/es/locale/zh-CN/index.mjs +2 -1
  23. package/es/panel-component/user-message/user-message.mjs +2 -3
  24. package/es/util/ai-chat-util/ai-chat-util.mjs +34 -1
  25. package/es/util/app-util/app-util.mjs +12 -23
  26. package/es/view/login-view/login-view.mjs +7 -11
  27. package/es/view-engine/login-view.engine.mjs +12 -21
  28. package/es/view-engine/pickup-tree-view.engine.mjs +17 -1
  29. package/es/web-app/guard/auth-guard/auth-guard.mjs +5 -9
  30. package/es/web-app/index.mjs +2 -0
  31. package/es/web-app/main.mjs +3 -1
  32. package/es/web-app/util/app-func-block-provider/app-func-block-provider.mjs +98 -0
  33. package/es/web-app/util/index.mjs +1 -0
  34. package/lib/common/emoji-select/components/categories/categories.cjs +1 -1
  35. package/lib/common/rawitem/rawitem.cjs +1 -0
  36. package/lib/control/dashboard/dashboard-design/dashboard-design.cjs +9 -2
  37. package/lib/control/kanban/swimlane-kanban/swimlane-kanban.cjs +1 -1
  38. package/lib/editor/ai-chat/embed-ai-chat/embed-ai-chat.cjs +93 -0
  39. package/lib/editor/ai-chat/embed-ai-chat/embed-ai-chat.css +1 -0
  40. package/lib/editor/ai-chat/embed-ai-chat-editor.controller.cjs +72 -0
  41. package/lib/editor/ai-chat/embed-ai-chat-editor.provider.cjs +24 -0
  42. package/lib/editor/ai-chat/index.cjs +11 -0
  43. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +1 -1
  44. package/lib/editor/index.cjs +8 -0
  45. package/lib/index.cjs +2 -0
  46. package/lib/locale/en/index.cjs +2 -1
  47. package/lib/locale/zh-CN/index.cjs +2 -1
  48. package/lib/panel-component/user-message/user-message.cjs +2 -3
  49. package/lib/util/ai-chat-util/ai-chat-util.cjs +33 -0
  50. package/lib/util/app-util/app-util.cjs +11 -22
  51. package/lib/view/login-view/login-view.cjs +7 -11
  52. package/lib/view-engine/login-view.engine.cjs +11 -20
  53. package/lib/view-engine/pickup-tree-view.engine.cjs +17 -1
  54. package/lib/web-app/guard/auth-guard/auth-guard.cjs +5 -9
  55. package/lib/web-app/index.cjs +3 -0
  56. package/lib/web-app/main.cjs +2 -0
  57. package/lib/web-app/util/app-func-block-provider/app-func-block-provider.cjs +100 -0
  58. package/lib/web-app/util/index.cjs +2 -0
  59. package/package.json +5 -5
  60. package/dist/index-CVIuun-0.js +0 -339
  61. package/dist/index-DWSyHHzh.js +0 -1
  62. package/dist/index-X0zcJbo7.js +0 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  var core = require('@ibiz-template/core');
4
4
  var ramda = require('ramda');
5
+ var runtime = require('@ibiz-template/runtime');
5
6
  var vue3Util = require('@ibiz-template/vue3-util');
6
7
  var devtool = require('@ibiz-template/devtool');
7
8
 
@@ -222,14 +223,8 @@ class AuthGuard {
222
223
  * @return {*} {Promise<void>}
223
224
  */
224
225
  async loadAppData(context) {
225
- let res;
226
- if (context && Object.keys(context).length > 0) {
227
- res = await ibiz.net.get("/appdata", context);
228
- } else {
229
- res = await ibiz.net.get("/appdata");
230
- }
231
- if (res.ok) {
232
- ibiz.appData = res.data;
226
+ const bol = await ibiz.auth.loadAppData(context);
227
+ if (bol) {
233
228
  devtool.updateDevToolConfig();
234
229
  }
235
230
  }
@@ -241,7 +236,8 @@ class AuthGuard {
241
236
  * @return {*} {Promise<void>}
242
237
  */
243
238
  async loadOrgData() {
244
- const res = await ibiz.net.get("/uaa/getbydcsystem/".concat(ibiz.env.dcSystem));
239
+ const appFuncBlockProvider = await runtime.getAppFuncBlockProvider();
240
+ const res = await appFuncBlockProvider.loadOrgData();
245
241
  if (res.ok) {
246
242
  const orgDataItems = res.data;
247
243
  if (orgDataItems) {
@@ -3,10 +3,13 @@
3
3
  require('./guard/index.cjs');
4
4
  var main = require('./main.cjs');
5
5
  var index = require('./router/index.cjs');
6
+ require('./util/index.cjs');
6
7
  var authGuard = require('./guard/auth-guard/auth-guard.cjs');
8
+ var appFuncBlockProvider = require('./util/app-func-block-provider/app-func-block-provider.cjs');
7
9
 
8
10
  "use strict";
9
11
 
10
12
  exports.runApp = main.runApp;
11
13
  exports.AppRouter = index.AppRouter;
12
14
  exports.AuthGuard = authGuard.AuthGuard;
15
+ exports.AppFuncBlockProvider = appFuncBlockProvider.AppFuncBlockProvider;
@@ -29,6 +29,7 @@ var aiChatUtil = require('../util/ai-chat-util/ai-chat-util.cjs');
29
29
  var qrcodeUtil = require('../util/qrcode-util/qrcode-util.cjs');
30
30
  var printPreviewUtil = require('../util/print-preview-util/print-preview-util.cjs');
31
31
  var fullscreenUtil = require('../util/fullscreen/fullscreen-util.cjs');
32
+ var appFuncBlockProvider = require('./util/app-func-block-provider/app-func-block-provider.cjs');
32
33
 
33
34
  "use strict";
34
35
  async function runApp(plugins, opts) {
@@ -97,6 +98,7 @@ async function runApp(plugins, opts) {
97
98
  ibiz.qrcodeUtil = new qrcodeUtil.QrcodeUtil();
98
99
  ibiz.printPreview = new printPreviewUtil.PrintPreviewUtil();
99
100
  ibiz.fullscreenUtil = new fullscreenUtil.FullscreenUtil();
101
+ runtime.registerAppFuncBlockProvider(() => new appFuncBlockProvider.AppFuncBlockProvider());
100
102
  await ibiz.i18n.init();
101
103
  app.mount("#app");
102
104
  }
@@ -0,0 +1,100 @@
1
+ 'use strict';
2
+
3
+ "use strict";
4
+ class AppFuncBlockProvider {
5
+ /**
6
+ * @description 登录
7
+ * @author tony001
8
+ * @date 2026-05-13 15:05:24
9
+ * @param {ILoginContext} ctx
10
+ * @param {(result: boolean) => void} [requestedCallback] 数据响应成功的回调
11
+ * @returns {*} {Promise<boolean>}
12
+ * @memberof AppFuncBlockProvider
13
+ */
14
+ async login(ctx, requestedCallback) {
15
+ const { loginname, password, rememberme, headers } = ctx;
16
+ const bol = await ibiz.auth.login(loginname, password, rememberme, headers);
17
+ if (requestedCallback) {
18
+ requestedCallback(bol);
19
+ }
20
+ if (bol === true) {
21
+ const loginFailed = window.location.href.indexOf("srfthird_auth_success=false") >= 0;
22
+ const hash = window.location.hash.substring(1);
23
+ const regex = new RegExp("[?&]ru=([^&]*)");
24
+ const match = hash.match(regex);
25
+ const ru = match ? decodeURIComponent(match[1]) : null;
26
+ window.location.hash = ru || "/";
27
+ window.history.pushState({}, "");
28
+ if (loginFailed) {
29
+ const path = window.location.href.replace(
30
+ "?srfthird_auth_success=false",
31
+ ""
32
+ );
33
+ window.location.href = path;
34
+ } else {
35
+ window.location.reload();
36
+ }
37
+ }
38
+ return bol;
39
+ }
40
+ /**
41
+ * @description 登出
42
+ * @author tony001
43
+ * @date 2026-05-13 16:05:28
44
+ * @param {IData} [params]
45
+ * @returns {*} {Promise<boolean>}
46
+ * @memberof AppFuncBlockProvider
47
+ */
48
+ async logout(params) {
49
+ const bol = await ibiz.auth.logout();
50
+ if (bol) {
51
+ const path = window.location;
52
+ if (path.search.indexOf("isAnonymous=true") !== -1) {
53
+ const href = "".concat(path.origin).concat(path.pathname).concat(path.hash);
54
+ window.history.replaceState({}, "", href);
55
+ }
56
+ if (params && params.router) {
57
+ await params.router.push("/login");
58
+ ibiz.util.showAppLoading();
59
+ window.location.reload();
60
+ }
61
+ }
62
+ return bol;
63
+ }
64
+ /**
65
+ * @description 加载应用数据
66
+ * @author tony001
67
+ * @date 2026-05-13 16:05:52
68
+ * @param {IParams} [context]
69
+ * @returns {*} {Promise<{ ok: boolean; data: IAppData }>}
70
+ * @memberof AppFuncBlockProvider
71
+ */
72
+ async loadAppData(context) {
73
+ let res;
74
+ if (context && Object.keys(context).length > 0) {
75
+ res = await ibiz.net.get("/appdata", context);
76
+ } else {
77
+ res = await ibiz.net.get("/appdata");
78
+ }
79
+ return {
80
+ ok: res.ok,
81
+ data: res.data
82
+ };
83
+ }
84
+ /**
85
+ * @description 获取组织数据
86
+ * @author tony001
87
+ * @date 2026-05-13 16:05:36
88
+ * @returns {*} {Promise<{ ok: boolean; data: IOrgData[] }>}
89
+ * @memberof AppFuncBlockProvider
90
+ */
91
+ async loadOrgData() {
92
+ const res = await ibiz.net.get("/uaa/getbydcsystem/".concat(ibiz.env.dcSystem));
93
+ return {
94
+ ok: res.ok,
95
+ data: res.data
96
+ };
97
+ }
98
+ }
99
+
100
+ exports.AppFuncBlockProvider = AppFuncBlockProvider;
@@ -1,7 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var unauthorizedHandler = require('./unauthorized-handler/unauthorized-handler.cjs');
4
+ var appFuncBlockProvider = require('./app-func-block-provider/app-func-block-provider.cjs');
4
5
 
5
6
  "use strict";
6
7
 
7
8
  exports.UnauthorizedHandler = unauthorizedHandler.UnauthorizedHandler;
9
+ exports.AppFuncBlockProvider = appFuncBlockProvider.AppFuncBlockProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.94",
3
+ "version": "0.7.41-alpha.95",
4
4
  "description": "web端组件库(vue3)",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -30,16 +30,16 @@
30
30
  "dependencies": {
31
31
  "@amap/amap-jsapi-loader": "^1.0.1",
32
32
  "@floating-ui/dom": "^1.5.3",
33
- "@ibiz-template-plugin/ai-chat": "^0.0.82",
33
+ "@ibiz-template-plugin/ai-chat": "^0.0.83",
34
34
  "@ibiz-template-plugin/gantt": "0.1.8-alpha.444",
35
35
  "@ibiz-template-plugin/bi-report": "0.0.32",
36
36
  "@ibiz-template-plugin/data-view": "0.0.7",
37
37
  "@ibiz-template/core": "0.7.41-alpha.101",
38
38
  "@ibiz-template/devtool": "0.0.14",
39
- "@ibiz-template/model-helper": "0.7.41-alpha.101",
40
- "@ibiz-template/runtime": "0.7.41-alpha.101",
39
+ "@ibiz-template/model-helper": "0.7.41-alpha.102",
40
+ "@ibiz-template/runtime": "0.7.41-alpha.102",
41
41
  "@ibiz-template/theme": "0.7.39",
42
- "@ibiz-template/vue3-util": "0.7.41-alpha.101",
42
+ "@ibiz-template/vue3-util": "0.7.41-alpha.102",
43
43
  "@ibiz-template/web-theme": "3.12.0",
44
44
  "@ibiz/model-core": "^0.1.86",
45
45
  "@imengyu/vue3-context-menu": "^1.3.5",