@ibiz-template/vue3-components 0.7.41-alpha.50 → 0.7.41-alpha.51

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 (30) hide show
  1. package/dist/chart-B_uQaEfA.js +1 -0
  2. package/dist/{index-CXRnZZS2.js → index-CXaTaGlg.js} +4 -4
  3. package/dist/index.min.css +1 -1
  4. package/dist/index.system.min.js +1 -1
  5. package/dist/{wang-editor-9WDOiHof.js → wang-editor-Bcmawui0.js} +1 -1
  6. package/dist/{xlsx-util-CgGjW9-u.js → xlsx-util-fU5jMSIx.js} +1 -1
  7. package/es/control/chart/chart.mjs +1 -0
  8. package/es/control/drtab/drtab-control.util.mjs +1 -1
  9. package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.mjs +10 -1
  10. package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
  11. package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.mjs +3 -2
  12. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.mjs +2 -1
  13. package/es/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.mjs +2 -4
  14. package/es/util/ai-chat-util/ai-chat-util.mjs +60 -22
  15. package/es/util/fullscreen/fullscreen-util.mjs +1 -1
  16. package/es/web-app/router/index.mjs +181 -95
  17. package/lib/control/chart/chart.cjs +1 -0
  18. package/lib/control/drtab/drtab-control.util.cjs +1 -1
  19. package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.cjs +3 -2
  20. package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.cjs +10 -1
  21. package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
  22. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.cjs +2 -1
  23. package/lib/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.cjs +2 -4
  24. package/lib/util/ai-chat-util/ai-chat-util.cjs +60 -22
  25. package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
  26. package/lib/web-app/router/index.cjs +181 -95
  27. package/package.json +6 -6
  28. package/dist/chart-pMMcGXRE.js +0 -1
  29. /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.52_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.53_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
  30. /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.52_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.53_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
@@ -183,7 +183,8 @@ class AIChatUtil {
183
183
  state: msg.actionstate,
184
184
  type: "DEFAULT",
185
185
  role: "ASSISTANT",
186
- content: msg.actionresult
186
+ content: msg.actionresult,
187
+ status: "pending"
187
188
  });
188
189
  } else if (msg.actionstate === 30 && msg.actionresult) {
189
190
  const result = JSON.parse(msg.actionresult);
@@ -195,7 +196,8 @@ class AIChatUtil {
195
196
  type: "DEFAULT",
196
197
  role: "ASSISTANT",
197
198
  content: choices[0].content || "",
198
- realmessageid: choices[0].messageid
199
+ realmessageid: choices[0].messageid,
200
+ status: "sent"
199
201
  });
200
202
  }
201
203
  } else if (msg.actionstate === 40) {
@@ -204,7 +206,8 @@ class AIChatUtil {
204
206
  state: msg.actionstate,
205
207
  type: "ERROR",
206
208
  role: "ASSISTANT",
207
- content: msg.actionresult
209
+ content: msg.actionresult,
210
+ status: "failed"
208
211
  });
209
212
  }
210
213
  },
@@ -219,7 +222,8 @@ class AIChatUtil {
219
222
  state: 40,
220
223
  type: "ERROR",
221
224
  role: "ASSISTANT",
222
- content: error.message || ibiz.i18n.t("app.aiError")
225
+ content: error.message || ibiz.i18n.t("app.aiError"),
226
+ status: "failed"
223
227
  });
224
228
  abortController == null ? void 0 : abortController.abort();
225
229
  } finally {
@@ -249,7 +253,8 @@ class AIChatUtil {
249
253
  state: 30,
250
254
  type: "DEFAULT",
251
255
  role: "ASSISTANT",
252
- content: ""
256
+ content: "",
257
+ status: "canceled"
253
258
  });
254
259
  await aiChat.completeMessage(id, true);
255
260
  };
@@ -298,18 +303,32 @@ class AIChatUtil {
298
303
  }
299
304
  };
300
305
  chatOptions.extendToolbarClick = async (event, source, context2, params2, data2) => {
301
- var _a, _b;
306
+ var _a, _b, _c;
307
+ const { id: id2, isPluginApp } = source;
308
+ let appId = source.appId;
309
+ const tempContext = core.IBizContext.create(context2);
310
+ if (isPluginApp) {
311
+ const mainApp = ibiz.hub.getApp();
312
+ const targetApp = (_a = mainApp.model.subAppRefs) == null ? void 0 : _a.find(
313
+ (subAppRef) => subAppRef.appId.endsWith(appId)
314
+ );
315
+ if (targetApp) {
316
+ const targetAppId = targetApp.appId;
317
+ tempContext.srfappid = targetAppId;
318
+ appId = targetAppId;
319
+ }
320
+ }
302
321
  const result = await runtime.UIActionUtil.exec(
303
- source.id,
322
+ id2,
304
323
  {
305
324
  view,
306
325
  ctrl,
307
- context: core.IBizContext.create(context2),
326
+ context: tempContext,
308
327
  params: params2,
309
328
  data: [data2],
310
329
  event
311
330
  },
312
- source.appId
331
+ appId
313
332
  );
314
333
  if (result.closeView) {
315
334
  view.closeView({ ok: true });
@@ -319,10 +338,10 @@ class AIChatUtil {
319
338
  view.callUIAction(runtime.SysUIActionTag.REFRESH);
320
339
  break;
321
340
  case 2:
322
- (_a = view.parentView) == null ? void 0 : _a.callUIAction(runtime.SysUIActionTag.REFRESH);
341
+ (_b = view.parentView) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
323
342
  break;
324
343
  case 3:
325
- (_b = view.getTopView()) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
344
+ (_c = view.getTopView()) == null ? void 0 : _c.callUIAction(runtime.SysUIActionTag.REFRESH);
326
345
  break;
327
346
  default:
328
347
  }
@@ -541,7 +560,8 @@ class AIChatUtil {
541
560
  state: msg.actionstate,
542
561
  type: "DEFAULT",
543
562
  role: "ASSISTANT",
544
- content: msg.actionresult
563
+ content: msg.actionresult,
564
+ status: "pending"
545
565
  });
546
566
  } else if (msg.actionstate === 30 && msg.actionresult) {
547
567
  const result = JSON.parse(msg.actionresult);
@@ -553,7 +573,8 @@ class AIChatUtil {
553
573
  type: "DEFAULT",
554
574
  role: "ASSISTANT",
555
575
  content: choices[0].content || "",
556
- realmessageid: choices[0].messageid
576
+ realmessageid: choices[0].messageid,
577
+ status: "sent"
557
578
  });
558
579
  }
559
580
  } else if (msg.actionstate === 40) {
@@ -562,7 +583,8 @@ class AIChatUtil {
562
583
  state: msg.actionstate,
563
584
  type: "ERROR",
564
585
  role: "ASSISTANT",
565
- content: msg.actionresult
586
+ content: msg.actionresult,
587
+ status: "failed"
566
588
  });
567
589
  }
568
590
  },
@@ -577,7 +599,8 @@ class AIChatUtil {
577
599
  state: 40,
578
600
  type: "ERROR",
579
601
  role: "ASSISTANT",
580
- content: error.message || ibiz.i18n.t("app.aiError")
602
+ content: error.message || ibiz.i18n.t("app.aiError"),
603
+ status: "failed"
581
604
  });
582
605
  abortController == null ? void 0 : abortController.abort();
583
606
  } finally {
@@ -607,7 +630,8 @@ class AIChatUtil {
607
630
  state: 30,
608
631
  type: "DEFAULT",
609
632
  role: "ASSISTANT",
610
- content: ""
633
+ content: "",
634
+ status: "canceled"
611
635
  });
612
636
  await aiChat.completeMessage(id, true);
613
637
  };
@@ -656,18 +680,32 @@ class AIChatUtil {
656
680
  }
657
681
  };
658
682
  chatOptions.extendToolbarClick = async (event, source, context2, params2, data2) => {
659
- var _a, _b;
683
+ var _a, _b, _c;
684
+ const { id: id2, isPluginApp } = source;
685
+ let appId = source.appId;
686
+ const tempContext = core.IBizContext.create(context2);
687
+ if (isPluginApp) {
688
+ const mainApp = ibiz.hub.getApp();
689
+ const targetApp = (_a = mainApp.model.subAppRefs) == null ? void 0 : _a.find(
690
+ (subAppRef) => subAppRef.appId.endsWith(appId)
691
+ );
692
+ if (targetApp) {
693
+ const targetAppId = targetApp.appId;
694
+ tempContext.srfappid = targetAppId;
695
+ appId = targetAppId;
696
+ }
697
+ }
660
698
  const result = await runtime.UIActionUtil.exec(
661
- source.id,
699
+ id2,
662
700
  {
663
701
  view,
664
702
  ctrl,
665
- context: core.IBizContext.create(context2),
703
+ context: tempContext,
666
704
  params: params2,
667
705
  data: [data2],
668
706
  event
669
707
  },
670
- source.appId
708
+ appId
671
709
  );
672
710
  if (result.closeView) {
673
711
  view.closeView({ ok: true });
@@ -677,10 +715,10 @@ class AIChatUtil {
677
715
  view.callUIAction(runtime.SysUIActionTag.REFRESH);
678
716
  break;
679
717
  case 2:
680
- (_a = view.parentView) == null ? void 0 : _a.callUIAction(runtime.SysUIActionTag.REFRESH);
718
+ (_b = view.parentView) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
681
719
  break;
682
720
  case 3:
683
- (_b = view.getTopView()) == null ? void 0 : _b.callUIAction(runtime.SysUIActionTag.REFRESH);
721
+ (_c = view.getTopView()) == null ? void 0 : _c.callUIAction(runtime.SysUIActionTag.REFRESH);
684
722
  break;
685
723
  default:
686
724
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  var vue = require('vue');
4
4
  var ElementPlus = require('element-plus');
5
- var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.52_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
5
+ var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.53_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
6
6
  var fullscreenToolbar = require('../../common/fullscreen-toolbar/fullscreen-toolbar.cjs');
7
7
 
8
8
  "use strict";
@@ -8,11 +8,13 @@ var nprogress = require('../../node_modules/.pnpm/nprogress@0.2.0/node_modules/n
8
8
  require('../../view/index.cjs');
9
9
  require('../components/index.cjs');
10
10
  var shareView = require('../../view/share-view/share-view.cjs');
11
+ require('../../util/index.cjs');
11
12
  require('nprogress/nprogress.css');
12
13
  var loginView = require('../../view/login-view/login-view.cjs');
13
14
  var errorView = require('../../view/error-view/error-view.cjs');
14
15
  var modalRouterShell = require('../components/modal-router-shell/modal-router-shell.cjs');
15
16
  var routerShell = require('../components/router-shell/router-shell.cjs');
17
+ var userRouteUtil = require('../../util/user-route-util/user-route-util.cjs');
16
18
 
17
19
  "use strict";
18
20
  var __defProp = Object.defineProperty;
@@ -35,74 +37,91 @@ class AppRouter {
35
37
  }
36
38
  return appContext;
37
39
  }
38
- static getRouter(userRoutes) {
40
+ static getRoutes() {
39
41
  const placeholder = ibiz.env.routePlaceholder;
40
42
  const paramReg = "[^/]+=[^/]+|".concat(placeholder);
41
43
  const viewReg = "[^=/]+";
42
- if (!this.router) {
43
- this.router = vueRouter.createRouter({
44
- // 4. 内部提供了 history 模式的实现。为了简单起见,我们在这里使用 hash 模式。
45
- history: vueRouter.createWebHashHistory(),
46
- routes: [
47
- {
48
- path: "/",
49
- redirect: "/".concat(placeholder, "/index/").concat(placeholder)
50
- },
51
- {
52
- path: "/login",
53
- name: "loginView",
54
- beforeEnter: async (_to, _from, next) => {
55
- await this.authGuard(this.getAppContext(_to), false);
56
- next();
57
- },
58
- component: loginView.LoginView
59
- },
60
- {
61
- path: "/share",
62
- name: "shareView",
63
- beforeEnter: async (_to, _from, next) => {
64
- const authority = await this.authGuard(this.getAppContext(_to));
65
- if (authority) {
66
- next();
67
- } else {
68
- next(false);
69
- }
70
- },
71
- component: shareView.ShareView
72
- },
44
+ const routes = [
45
+ {
46
+ path: "/",
47
+ redirect: "/".concat(placeholder, "/index/").concat(placeholder)
48
+ },
49
+ {
50
+ path: "/login",
51
+ name: "loginView",
52
+ beforeEnter: async (_to, from, next) => {
53
+ await this.authGuard(this.getAppContext(_to), false);
54
+ next();
55
+ },
56
+ component: loginView.LoginView
57
+ },
58
+ {
59
+ path: "/share",
60
+ name: "shareView",
61
+ beforeEnter: async (_to, from, next) => {
62
+ const authority = await this.authGuard(this.getAppContext(_to));
63
+ if (authority) {
64
+ next();
65
+ } else {
66
+ next(false);
67
+ }
68
+ },
69
+ component: shareView.ShareView
70
+ },
71
+ {
72
+ path: "/error/:code",
73
+ name: "errorView1",
74
+ component: errorView.ErrorView
75
+ },
76
+ {
77
+ path: "/appredirectview",
78
+ name: "appRedirectView",
79
+ beforeEnter: async (_to, from, next) => {
80
+ const authority = await this.authGuard(this.getAppContext(_to));
81
+ if (authority) {
82
+ next();
83
+ } else {
84
+ next(false);
85
+ }
86
+ },
87
+ component: vue3Util.AppRedirectView
88
+ },
89
+ {
90
+ path: "/:appContext(".concat(paramReg, ")/:view1(").concat(viewReg, ")/:params1(").concat(paramReg, ")"),
91
+ beforeEnter: async (_to, from, next) => {
92
+ const authority = await this.authGuard(this.getAppContext(_to));
93
+ if (authority) {
94
+ next();
95
+ } else {
96
+ next(false);
97
+ }
98
+ },
99
+ component: routerShell.RouterShell,
100
+ meta: {
101
+ depth: 1
102
+ },
103
+ children: [
73
104
  {
74
- path: "/error/:code",
75
- name: "errorView1",
105
+ path: "error/:code",
106
+ name: "errorView2",
76
107
  component: errorView.ErrorView
77
108
  },
78
109
  {
79
- path: "/appredirectview",
80
- name: "appRedirectView",
81
- beforeEnter: async (_to, _from, next) => {
82
- const authority = await this.authGuard(this.getAppContext(_to));
83
- if (authority) {
84
- next();
85
- } else {
86
- next(false);
87
- }
88
- },
89
- component: vue3Util.AppRedirectView
110
+ path: "".concat(runtime.RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
111
+ components: {
112
+ [runtime.RouteConst.ROUTE_MODAL_TAG]: modalRouterShell.ModalRouterShell
113
+ }
90
114
  },
91
115
  {
92
- path: "/:appContext(".concat(paramReg, ")/:view1(").concat(viewReg, ")/:params1(").concat(paramReg, ")"),
93
- beforeEnter: async (_to, _from, next) => {
94
- const authority = await this.authGuard(this.getAppContext(_to));
95
- if (authority) {
96
- next();
97
- } else {
98
- next(false);
99
- }
100
- },
116
+ path: ":view2(".concat(viewReg, ")/:params2(").concat(paramReg, ")"),
101
117
  component: routerShell.RouterShell,
118
+ meta: {
119
+ depth: 2
120
+ },
102
121
  children: [
103
122
  {
104
123
  path: "error/:code",
105
- name: "errorView2",
124
+ name: "errorView3",
106
125
  component: errorView.ErrorView
107
126
  },
108
127
  {
@@ -112,12 +131,15 @@ class AppRouter {
112
131
  }
113
132
  },
114
133
  {
115
- path: ":view2(".concat(viewReg, ")/:params2(").concat(paramReg, ")"),
134
+ path: ":view3(".concat(viewReg, ")/:params3(").concat(paramReg, ")"),
116
135
  component: routerShell.RouterShell,
136
+ meta: {
137
+ depth: 3
138
+ },
117
139
  children: [
118
140
  {
119
141
  path: "error/:code",
120
- name: "errorView3",
142
+ name: "errorView4",
121
143
  component: errorView.ErrorView
122
144
  },
123
145
  {
@@ -127,12 +149,15 @@ class AppRouter {
127
149
  }
128
150
  },
129
151
  {
130
- path: ":view3(".concat(viewReg, ")/:params3(").concat(paramReg, ")"),
152
+ path: ":view4(".concat(viewReg, ")/:params4(").concat(paramReg, ")"),
131
153
  component: routerShell.RouterShell,
154
+ meta: {
155
+ depth: 4
156
+ },
132
157
  children: [
133
158
  {
134
159
  path: "error/:code",
135
- name: "errorView4",
160
+ name: "errorView5",
136
161
  component: errorView.ErrorView
137
162
  },
138
163
  {
@@ -142,12 +167,15 @@ class AppRouter {
142
167
  }
143
168
  },
144
169
  {
145
- path: ":view4(".concat(viewReg, ")/:params4(").concat(paramReg, ")"),
170
+ path: ":view5(".concat(viewReg, ")/:params5(").concat(paramReg, ")"),
146
171
  component: routerShell.RouterShell,
172
+ meta: {
173
+ depth: 5
174
+ },
147
175
  children: [
148
176
  {
149
177
  path: "error/:code",
150
- name: "errorView5",
178
+ name: "errorView6",
151
179
  component: errorView.ErrorView
152
180
  },
153
181
  {
@@ -157,12 +185,15 @@ class AppRouter {
157
185
  }
158
186
  },
159
187
  {
160
- path: ":view5(".concat(viewReg, ")/:params5(").concat(paramReg, ")"),
188
+ path: ":view6(".concat(viewReg, ")/:params6(").concat(paramReg, ")"),
161
189
  component: routerShell.RouterShell,
190
+ meta: {
191
+ depth: 6
192
+ },
162
193
  children: [
163
194
  {
164
195
  path: "error/:code",
165
- name: "errorView6",
196
+ name: "errorView7",
166
197
  component: errorView.ErrorView
167
198
  },
168
199
  {
@@ -172,12 +203,15 @@ class AppRouter {
172
203
  }
173
204
  },
174
205
  {
175
- path: ":view6(".concat(viewReg, ")/:params6(").concat(paramReg, ")"),
206
+ path: ":view7(".concat(viewReg, ")/:params7(").concat(paramReg, ")"),
176
207
  component: routerShell.RouterShell,
208
+ meta: {
209
+ depth: 7
210
+ },
177
211
  children: [
178
212
  {
179
213
  path: "error/:code",
180
- name: "errorView7",
214
+ name: "errorView8",
181
215
  component: errorView.ErrorView
182
216
  },
183
217
  {
@@ -187,71 +221,123 @@ class AppRouter {
187
221
  }
188
222
  },
189
223
  {
190
- path: ":view7(".concat(viewReg, ")/:params7(").concat(paramReg, ")"),
224
+ path: ":view8(".concat(viewReg, ")/:params8(").concat(paramReg, ")"),
191
225
  component: routerShell.RouterShell,
192
- children: [
193
- {
194
- path: "error/:code",
195
- name: "errorView8",
196
- component: errorView.ErrorView
197
- },
198
- {
199
- path: "".concat(runtime.RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
200
- components: {
201
- [runtime.RouteConst.ROUTE_MODAL_TAG]: modalRouterShell.ModalRouterShell
202
- }
203
- },
204
- {
205
- path: ":view8(".concat(viewReg, ")/:params8(").concat(paramReg, ")"),
206
- component: routerShell.RouterShell
207
- },
208
- {
209
- path: ":pathMatch(.*)*",
210
- redirect: { name: "errorView8" }
211
- }
212
- ]
226
+ meta: {
227
+ depth: 8
228
+ }
213
229
  },
214
230
  {
215
231
  path: ":pathMatch(.*)*",
216
- redirect: { name: "errorView7" }
232
+ redirect: { name: "errorView8" }
217
233
  }
218
234
  ]
219
235
  },
220
236
  {
221
237
  path: ":pathMatch(.*)*",
222
- redirect: { name: "errorView6" }
238
+ redirect: { name: "errorView7" }
223
239
  }
224
240
  ]
225
241
  },
226
242
  {
227
243
  path: ":pathMatch(.*)*",
228
- redirect: { name: "errorView5" }
244
+ redirect: { name: "errorView6" }
229
245
  }
230
246
  ]
231
247
  },
232
248
  {
233
249
  path: ":pathMatch(.*)*",
234
- redirect: { name: "errorView4" }
250
+ redirect: { name: "errorView5" }
235
251
  }
236
252
  ]
237
253
  },
238
254
  {
239
255
  path: ":pathMatch(.*)*",
240
- redirect: { name: "errorView3" }
256
+ redirect: { name: "errorView4" }
241
257
  }
242
258
  ]
243
259
  },
244
260
  {
245
261
  path: ":pathMatch(.*)*",
246
- redirect: { name: "errorView2" }
262
+ redirect: { name: "errorView3" }
247
263
  }
248
264
  ]
249
265
  },
250
266
  {
251
- path: "/:pathMatch(.*)*",
252
- redirect: { name: "errorView1" }
267
+ path: ":pathMatch(.*)*",
268
+ redirect: { name: "errorView2" }
253
269
  }
254
270
  ]
271
+ },
272
+ {
273
+ path: "/:pathMatch(.*)*",
274
+ redirect: { name: "errorView1" }
275
+ }
276
+ ];
277
+ return routes;
278
+ }
279
+ /**
280
+ * 添加路由
281
+ * @param parentDepth 父路由层级
282
+ * @param userRoute
283
+ * @param routes
284
+ * @returns
285
+ */
286
+ static addRoute(parentDepth, userRoute, routes) {
287
+ if (!parentDepth)
288
+ return;
289
+ const findAndAdd = (routeList) => {
290
+ for (const route of routeList) {
291
+ if (route && route.meta && route.meta.depth === parentDepth) {
292
+ if (route.children && route.children.length > 0) {
293
+ route.children.push(userRoute);
294
+ } else {
295
+ route.children = [userRoute];
296
+ }
297
+ return true;
298
+ }
299
+ if (route.children && route.children.length > 0) {
300
+ if (findAndAdd(route.children)) {
301
+ return true;
302
+ }
303
+ }
304
+ }
305
+ return false;
306
+ };
307
+ findAndAdd(routes);
308
+ }
309
+ /**
310
+ * 获取路由器
311
+ * @param userRoutes
312
+ * @returns
313
+ */
314
+ static getRouter(userRoutes = []) {
315
+ if (!this.router) {
316
+ const routes = this.getRoutes();
317
+ if (userRoutes && userRoutes.length > 0) {
318
+ for (let i = 0; i < userRoutes.length; i++) {
319
+ const route = userRoutes[i];
320
+ const paginationathSegments = userRouteUtil.splitPathToSegments(route.path);
321
+ const validateResult = userRouteUtil.validateRouteSegments(paginationathSegments);
322
+ if (!validateResult) {
323
+ ibiz.log.warn(
324
+ "\u8DEF\u7531\u914D\u7F6E\u9519\u8BEF\uFF1A\u8DEF\u7531\u8DEF\u5F84\u6709\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u8DEF\u7531\u914D\u7F6E\uFF0C\u8BE6\u60C5\u53C2\u89C1\uFF1Ahttps://open.ibizlab.cn/apphub/zh/guide/router.html"
325
+ );
326
+ continue;
327
+ }
328
+ const pathDeepth = (paginationathSegments.length - 1) / 2;
329
+ if (pathDeepth > 1) {
330
+ const segmentLength = paginationathSegments.length;
331
+ route.path = "".concat(paginationathSegments[segmentLength - 2], "/").concat(paginationathSegments[segmentLength - 1]);
332
+ this.addRoute(pathDeepth - 1, route, routes);
333
+ } else {
334
+ routes.push(route);
335
+ }
336
+ }
337
+ }
338
+ this.router = vueRouter.createRouter({
339
+ history: vueRouter.createWebHashHistory(),
340
+ routes
255
341
  });
256
342
  this.router.beforeEach((_to, _from, next) => {
257
343
  nprogress.default.configure({ showSpinner: false });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.50",
3
+ "version": "0.7.41-alpha.51",
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.41",
33
+ "@ibiz-template-plugin/ai-chat": "^0.0.42",
34
34
  "@ibiz-template-plugin/gantt": "0.1.8-alpha.378",
35
35
  "@ibiz-template-plugin/bi-report": "0.0.30",
36
36
  "@ibiz-template-plugin/data-view": "0.0.6",
37
- "@ibiz-template/core": "0.7.41-alpha.52",
37
+ "@ibiz-template/core": "0.7.41-alpha.53",
38
38
  "@ibiz-template/devtool": "0.0.13",
39
- "@ibiz-template/model-helper": "0.7.41-alpha.52",
40
- "@ibiz-template/runtime": "0.7.41-alpha.52",
39
+ "@ibiz-template/model-helper": "0.7.41-alpha.53",
40
+ "@ibiz-template/runtime": "0.7.41-alpha.53",
41
41
  "@ibiz-template/theme": "0.7.39",
42
- "@ibiz-template/vue3-util": "0.7.41-alpha.52",
42
+ "@ibiz-template/vue3-util": "0.7.41-alpha.53",
43
43
  "@ibiz-template/web-theme": "3.10.0",
44
44
  "@ibiz/model-core": "^0.1.84",
45
45
  "@imengyu/vue3-context-menu": "^1.3.5",
@@ -1 +0,0 @@
1
- System.register(["vue","@ibiz-template/vue3-util","echarts","qx-util","lodash-es","@ibiz-template/runtime"],function(e){"use strict";var t,i,a,l,n,r,o,s,d,c,h,u,m,p,v,f,g,w;return{setters:[function(e){t=e.defineComponent,i=e.createVNode,a=e.resolveComponent,l=e.ref,n=e.watch,r=e.onMounted,o=e.onBeforeUnmount,s=e.nextTick,d=e.isVNode},function(e){c=e.useControlController,h=e.useNamespace,u=e.hasEmptyPanelRenderer,m=e.IBizCustomRender},function(e){p=e.init},function(e){v=e.createUUID},function(e){f=e.isArray},function(e){g=e.ChartController,w=e.ControlVO}],execute:function(){function b(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!d(e)}e("default",t({name:"IBizChartControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},loadDefault:{type:Boolean,default:!0},isSimple:{type:Boolean,required:!1},data:{type:Array,required:!1}},emits:["drillDetail"],setup(e,{emit:t}){const d=c((...e)=>new g(...e)),D=h("control-".concat(d.model.controlType.toLowerCase())),y=l(),z=l(0),C=v(),L=l(!1),x=l({}),P=l();let R;const B=()=>{e.data&&(d.state.items=e.data.map(e=>new w(e)),d.afterLoad({},d.state.items))};d.evt.on("onCreated",async()=>{e.isSimple&&(B(),d.state.isSimple=!0,d.state.isLoaded=!0)}),n(()=>e.data,()=>{e.isSimple&&B()},{deep:!0});const N=async()=>{await s();const e=document.getElementById(C);e&&("bottom"===d.state.gridPosition||"top"===d.state.gridPosition?z.value=e.offsetHeight/2-8:z.value=e.offsetHeight-16)},S=()=>{L.value=!1},E=()=>{L.value||d.changeTooltipState(!0)};let O;r(()=>{var t,i;const a=p(y.value);d.initChart(a),window.addEventListener("resize",N),window.addEventListener("pointerdown",S),window.addEventListener("click",E),y.value&&ResizeObserver&&(O=new ResizeObserver(()=>{d.resizeChart()}),O.observe(y.value)),N();let l=(null==(i=null==(t=e.modelData.controlParam)?void 0:t.ctrlParams)?void 0:i.ENABLEDRILLDETAIL)||d.controlParams.enabledrilldetail;if(l&&!f(l))try{l=JSON.parse(l)}catch(e){ibiz.log.error(e),l=void 0}(null==l?void 0:l.length)&&a.on("click",e=>{const t=d.computedClickSerieModel(e);if(!t||ibiz.fullscreenUtil.isFullScreen)return;const i=l.find(e=>e.name===t.valueField);i&&i.isDrill&&(R=e,(e=>{if(e.event){const t=e.event.event,{offsetX:i,offsetY:a}=e.event,{clientWidth:l}=t.target;x.value=i+160>l?{top:"".concat(a-20,"px"),left:"".concat(i-160,"px")}:{top:"".concat(a,"px"),left:"".concat(i+16,"px")}}})(e),a.dispatchAction({type:"hideTip"}),d.changeTooltipState(!1),L.value=!0)})});n(()=>d.state.showGrid,()=>{N()},{immediate:!0});return o(()=>{window.removeEventListener("resize",N),window.removeEventListener("pointerdown",S),window.removeEventListener("click",E),null==O||O.disconnect()}),{c:d,ns:D,chartRef:y,uuid:C,showCheck:L,drillDetailPos:x,drillDetailRef:P,openDrillDetail:e=>{e.stopPropagation(),e.preventDefault(),L.value=!1,d.changeTooltipState(!0);const i=d.computedDrillDetailParam(R);t("drillDetail",i)},renderGrid:()=>{let e;return i(a("el-table"),{ref:"tableRef",data:d.state.gridData||[],border:!0,style:{width:"100%"},"max-height":z.value,"span-method":d.spanMethod.bind(d),"header-row-class-name":D.e("grid-header")},b(e=d.state.gridHeaders.map(e=>i(a("el-table-column"),{prop:e.id,align:"center",label:e.name},null)))?e:{default:()=>[e]})},renderNoData:()=>{if(0===d.state.items.length){const e={};return u(d)&&Object.assign(e,{customRender:()=>i(m,{controller:d},null)}),i(a("iBizNoData"),{text:d.model.emptyText,emptyTextLanguageRes:d.model.emptyTextLanguageRes,hideNoDataImage:d.state.hideNoDataImage},b(e)?e:{default:()=>[e]})}}}},render(){return i(a("iBizControlNavigation"),{controller:this.c},{default:()=>[i(a("iBizControlBase"),{controller:this.c},{default:()=>[i("div",{id:this.uuid,class:this.ns.b("chart-container")},[this.renderNoData(),i("div",{class:[this.ns.e("chart-grid"),this.ns.is("no-data",0===this.c.state.items.length),this.ns.is("show-grid",this.c.state.showGrid),{[this.ns.em("chart-grid",this.c.state.gridPosition)]:this.c.state.showGrid}]},[i("div",{class:[this.ns.e("chart-grid-container"),this.ns.is(this.c.state.gridPosition,this.c.state.showGrid),this.ns.is("no-grid",!this.c.state.showGrid)]},[i("div",{ref:"chartRef",class:[this.ns.e("chart")]},[ibiz.i18n.t("control.chart.chartPlaceholder")]),this.showCheck?i("div",{ref:"drillDetailRef",class:this.ns.e("drill-detail"),style:this.drillDetailPos,onPointerdown:this.openDrillDetail},[i("div",{class:this.ns.em("drill-detail","item")},[i("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[i("g",{id:"aspnormal/preview","stroke-width":"1","fill-rule":"evenodd"},[i("path",{d:"M11.626 0c1.057 0 1.923.818 2 1.855l.005.15v3.411a.6.6 0 0 1-1.192.097l-.008-.097.001-1.348V2.005c0-.41-.31-.749-.705-.799l-.101-.006h-9.62c-.41 0-.75.308-.8.704l-.006.101v11.989c0 .41.308.75.705.8l.101.006h5.906l.017-.004.016-.003h2.074a.598.598 0 1 1 .107 1.187l-.095.01V16H2.006a2.006 2.006 0 0 1-2-1.856L0 13.994V2.005C0 .948.818.082 1.856.005L2.006 0h9.62zm-1.595 6.328a3.669 3.669 0 0 1 3.665 3.665c0 .79-.251 1.523-.678 2.123l2.412 2.412a.6.6 0 1 1-.848.85l-2.41-2.412a3.646 3.646 0 0 1-2.14.692 3.67 3.67 0 0 1-3.667-3.665 3.67 3.67 0 0 1 3.666-3.665zm-5.106 5.29a.6.6 0 0 1 .097 1.191l-.097.008H2.85a.6.6 0 0 1-.097-1.192l.097-.008h2.074zm5.106-4.09a2.468 2.468 0 0 0-2.466 2.465 2.468 2.468 0 0 0 2.466 2.466 2.47 2.47 0 0 0 2.466-2.466 2.469 2.469 0 0 0-2.466-2.465zm-4.815-.126a.6.6 0 0 1 .097 1.193l-.097.007h-2.35A.6.6 0 0 1 2.77 7.41l.098-.008h2.349zm5.58-4a.6.6 0 0 1 .097 1.192l-.097.008H2.867A.6.6 0 0 1 2.77 3.41l.097-.008h7.929z",id:"asp合并形状"},null)])]),i("div",{class:this.ns.em("drill-detail","item-text")},[ibiz.i18n.t("control.chart.drillDetail")])])]):null]),this.c.state.showGrid?i("div",{class:this.ns.e("grid")},[this.renderGrid()]):null])])]})]})}}))}}});