@ibiz-template/mob-vue3-components 0.0.11 → 0.0.13

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 (83) hide show
  1. package/dist/index.min.css +1 -1
  2. package/dist/index.system.min.js +5 -5
  3. package/dist/index.system.min.js.map +1 -1
  4. package/es/control/app-menu/app-menu.d.ts +1 -1
  5. package/es/control/app-menu/app-menu.mjs +5 -3
  6. package/es/control/app-menu/index.d.ts +1 -1
  7. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.mjs +1 -1
  8. package/es/editor/date-picker/date-picker-editor.controller.d.ts +0 -8
  9. package/es/editor/date-picker/date-picker-editor.controller.mjs +0 -11
  10. package/es/editor/date-range/date-range-editor.controller.d.ts +0 -8
  11. package/es/editor/date-range/date-range-editor.controller.mjs +0 -20
  12. package/es/editor/span/span/span.d.ts +3 -0
  13. package/es/editor/span/span/span.mjs +1 -1
  14. package/es/ibiz-vue3.d.ts +6 -0
  15. package/es/ibiz-vue3.mjs +75 -0
  16. package/es/index.d.ts +6 -10
  17. package/es/index.mjs +89 -135
  18. package/es/mob-app/App.css +1 -0
  19. package/es/mob-app/App.d.ts +11 -0
  20. package/es/mob-app/App.mjs +64 -0
  21. package/es/mob-app/attach-environment-config.d.ts +1 -0
  22. package/es/mob-app/attach-environment-config.mjs +22 -0
  23. package/es/mob-app/components/home-view/home-view.css +1 -0
  24. package/es/mob-app/components/home-view/home-view.d.ts +17 -0
  25. package/es/mob-app/components/home-view/home-view.mjs +38 -0
  26. package/es/mob-app/components/index.d.ts +3 -0
  27. package/es/mob-app/components/index.mjs +4 -0
  28. package/es/mob-app/components/router-shell/router-shell.d.ts +3867 -0
  29. package/es/mob-app/components/router-shell/router-shell.mjs +82 -0
  30. package/es/mob-app/create-vue-app.d.ts +12 -0
  31. package/es/mob-app/create-vue-app.mjs +38 -0
  32. package/es/mob-app/guard/auth-guard/auth-guard.d.ts +9 -0
  33. package/es/mob-app/guard/auth-guard/auth-guard.mjs +141 -0
  34. package/es/mob-app/guard/index.d.ts +1 -0
  35. package/es/mob-app/guard/index.mjs +3 -0
  36. package/es/mob-app/index.d.ts +1 -0
  37. package/es/mob-app/index.mjs +3 -0
  38. package/es/mob-app/main.d.ts +2 -0
  39. package/es/mob-app/main.mjs +60 -0
  40. package/es/mob-app/router/index.d.ts +21 -0
  41. package/es/mob-app/router/index.mjs +174 -0
  42. package/es/mob-app/util/index.d.ts +1 -0
  43. package/es/mob-app/util/index.mjs +3 -0
  44. package/es/mob-app/util/unauthorized-handler/unauthorized-handler.d.ts +46 -0
  45. package/es/mob-app/util/unauthorized-handler/unauthorized-handler.mjs +100 -0
  46. package/es/panel-component/index.mjs +2 -1
  47. package/es/util/open-view-util/open-view-util.d.ts +2 -1
  48. package/es/util/open-view-util/open-view-util.mjs +5 -2
  49. package/es/view-engine/mob-edit-view.engine.mjs +5 -1
  50. package/lib/control/app-menu/app-menu.cjs +5 -3
  51. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.cjs +1 -1
  52. package/lib/editor/date-picker/date-picker-editor.controller.cjs +0 -11
  53. package/lib/editor/date-range/date-range-editor.controller.cjs +0 -20
  54. package/lib/editor/span/span/span.cjs +1 -1
  55. package/lib/editor/upload/ibiz-image-select/ibiz-image-select.cjs +2 -2
  56. package/lib/editor/upload/ibiz-image-upload/ibiz-image-upload.cjs +2 -2
  57. package/lib/ibiz-vue3.cjs +79 -0
  58. package/lib/index.cjs +177 -221
  59. package/lib/mob-app/App.cjs +68 -0
  60. package/lib/mob-app/App.css +1 -0
  61. package/lib/mob-app/attach-environment-config.cjs +24 -0
  62. package/lib/mob-app/components/home-view/home-view.cjs +40 -0
  63. package/lib/mob-app/components/home-view/home-view.css +1 -0
  64. package/lib/mob-app/components/index.cjs +9 -0
  65. package/lib/mob-app/components/router-shell/router-shell.cjs +84 -0
  66. package/lib/mob-app/create-vue-app.cjs +40 -0
  67. package/lib/mob-app/guard/auth-guard/auth-guard.cjs +143 -0
  68. package/lib/mob-app/guard/index.cjs +7 -0
  69. package/lib/mob-app/index.cjs +7 -0
  70. package/lib/mob-app/main.cjs +62 -0
  71. package/lib/mob-app/router/index.cjs +176 -0
  72. package/lib/mob-app/util/index.cjs +7 -0
  73. package/lib/mob-app/util/unauthorized-handler/unauthorized-handler.cjs +102 -0
  74. package/lib/panel-component/index.cjs +1 -0
  75. package/lib/util/confirm-util/confirm-util.cjs +5 -5
  76. package/lib/util/directive/loading.cjs +2 -2
  77. package/lib/util/loading-util/loading-util.cjs +2 -2
  78. package/lib/util/message-util/message-util.cjs +5 -5
  79. package/lib/util/modal-util/modal-util.cjs +6 -6
  80. package/lib/util/notification-util/notification-util.cjs +5 -5
  81. package/lib/util/open-view-util/open-view-util.cjs +5 -2
  82. package/lib/view-engine/mob-edit-view.engine.cjs +5 -1
  83. package/package.json +8 -7
@@ -0,0 +1,100 @@
1
+ import qs from 'qs';
2
+ import { HttpError, RuntimeError, UrlHelper, LoginMode } from '@ibiz-template/core';
3
+
4
+ "use strict";
5
+ class UnauthorizedHandler {
6
+ match(error) {
7
+ return error instanceof HttpError && (error.status === 401 || error.status === 403);
8
+ }
9
+ /**
10
+ * cas登录处理
11
+ *
12
+ * @author lxm
13
+ * @date 2022-10-11 14:10:35
14
+ * @protected
15
+ * @returns {*} {Promise<void>}
16
+ */
17
+ async casLogin() {
18
+ if (!ibiz.env.casLoginUrl) {
19
+ throw new RuntimeError("\u627E\u4E0D\u5230\u73AF\u5883\u53C2\u6570casLoginUrl");
20
+ }
21
+ const { origin } = window.location;
22
+ const baseUrl = `${origin}${ibiz.env.baseUrl}`;
23
+ const backUrl = `${baseUrl}/cas/v7/login${qs.stringify(
24
+ {
25
+ RU: UrlHelper.fullPath,
26
+ base: baseUrl
27
+ },
28
+ { addQueryPrefix: true }
29
+ )}`;
30
+ const hasQueryPrefix = ibiz.env.casLoginUrl.indexOf("?") !== -1;
31
+ const targetUrl = ibiz.env.casLoginUrl + (hasQueryPrefix ? "&" : "?") + qs.stringify(
32
+ {
33
+ service: backUrl
34
+ },
35
+ { addQueryPrefix: false }
36
+ );
37
+ window.location.href = targetUrl;
38
+ }
39
+ /**
40
+ * 普通登录处理
41
+ *
42
+ * @author lxm
43
+ * @date 2022-10-11 14:10:24
44
+ * @protected
45
+ * @returns {*} {Promise<void>}
46
+ */
47
+ async normalLogin() {
48
+ const ru = window.location.hash.replace("#", "");
49
+ const targetUrl = `${UrlHelper.routeBase}/login?ru=${encodeURIComponent(
50
+ ru
51
+ )}`;
52
+ document.body.style.display = "none";
53
+ window.location.href = targetUrl;
54
+ window.location.reload();
55
+ }
56
+ /**
57
+ * 处理403
58
+ * @author lxm
59
+ * @date 2023-12-06 10:19:12
60
+ * @protected
61
+ * @return {*} {Promise<void>}
62
+ */
63
+ async handle403() {
64
+ const result = await ibiz.modal.confirm({
65
+ title: "\u5F53\u524D\u8D26\u6237\u88AB\u7981\u6B62\u8BBF\u95EE",
66
+ desc: "\u662F\u5426\u8981\u9000\u51FA\u5F53\u524D\u8D26\u6237\uFF1F"
67
+ });
68
+ if (result) {
69
+ const bol = await ibiz.auth.logout();
70
+ if (bol) {
71
+ window.location.reload();
72
+ }
73
+ }
74
+ }
75
+ /**
76
+ * 没有权限处理
77
+ *
78
+ * @author lxm
79
+ * @date 2022-10-11 14:10:50
80
+ * @returns {*} {Promise<void>}
81
+ */
82
+ handle(error) {
83
+ if (error instanceof HttpError) {
84
+ if (error.status === 401) {
85
+ if (ibiz.env.loginMode === LoginMode.CAS) {
86
+ this.casLogin();
87
+ } else {
88
+ this.normalLogin();
89
+ }
90
+ return true;
91
+ }
92
+ if (error.status === 403) {
93
+ this.handle403();
94
+ return true;
95
+ }
96
+ }
97
+ }
98
+ }
99
+
100
+ export { UnauthorizedHandler };
@@ -1,4 +1,4 @@
1
- import { IBizPanelContainer, IBizPanelCtrlPos, IBizNavPos, IBizPanelField, IBizGridContainer, IBizPanelRawItem, IBizSingleDataContainer, IBizMultiDataContainer, IBizPanelTabPage, IBizPanelContainerGroup, IBizPanelContainerImage, IBizScrollContainer } from '@ibiz-template/vue3-util';
1
+ import { IBizPanelContainer, IBizPanelCtrlPos, IBizNavPos, IBizPanelField, IBizGridContainer, IBizPanelRawItem, IBizSingleDataContainer, IBizMultiDataContainer, IBizPanelTabPage, IBizPanelContainerGroup, IBizPanelContainerImage, IBizScrollContainer, IBizPanelItemRender } from '@ibiz-template/vue3-util';
2
2
  import { IBizViewContentPanelContainer } from './view-content-panel-container/index.mjs';
3
3
  import { IBizViewHeaderPanelContainer } from './view-header-panel-container/index.mjs';
4
4
  import { IBizViewFooterPanelContainer } from './view-footer-panel-container/index.mjs';
@@ -37,6 +37,7 @@ const IBizPanelComponents = {
37
37
  v.use(IBizPanelCarousel);
38
38
  v.use(IBizPanelVideoPlayer);
39
39
  v.use(IBizAuthUserinfo);
40
+ v.use(IBizPanelItemRender);
40
41
  }
41
42
  };
42
43
 
@@ -13,8 +13,9 @@ import { Router } from 'vue-router';
13
13
  export declare class OpenViewUtil implements IOpenViewUtil {
14
14
  protected router: Router;
15
15
  constructor(router: Router);
16
+ rootByModal(_appViewId: string, _context: IContext, _params?: IParams | undefined): Promise<IModalData>;
16
17
  push(path: string): Promise<IModalData>;
17
- root(appViewId: string, context: IContext, params?: IParams | undefined): Promise<IModalData>;
18
+ root(appViewId: string, context: IContext, params?: IParams | undefined, opts?: IData): Promise<IModalData>;
18
19
  /**
19
20
  * 模态打开视图
20
21
  *
@@ -6,10 +6,13 @@ class OpenViewUtil {
6
6
  constructor(router) {
7
7
  this.router = router;
8
8
  }
9
+ rootByModal(_appViewId, _context, _params) {
10
+ throw new Error("Method not implemented.");
11
+ }
9
12
  push(path) {
10
13
  return routerCallback.open(this.router, path);
11
14
  }
12
- async root(appViewId, context, params) {
15
+ async root(appViewId, context, params, opts = {}) {
13
16
  const appView = await ibiz.hub.config.view.get(appViewId);
14
17
  const { path } = await generateRoutePath(
15
18
  appView,
@@ -17,7 +20,7 @@ class OpenViewUtil {
17
20
  context,
18
21
  params
19
22
  );
20
- return routerCallback.open(this.router, path);
23
+ return routerCallback.open(this.router, path, opts);
21
24
  }
22
25
  /**
23
26
  * 模态打开视图
@@ -157,13 +157,17 @@ class MobEditViewEngine extends ViewEngineBase {
157
157
  * @returns {*} {Promise<void>}
158
158
  */
159
159
  async wfStart() {
160
+ var _a, _b;
160
161
  await this.save();
161
162
  const app = ibiz.hub.getApp(this.view.context.srfappid);
162
163
  const entityService = await app.deService.getService(
163
164
  this.view.context,
164
165
  this.view.model.appDataEntityId
165
166
  );
166
- const res = await entityService.wf.getWFVersion();
167
+ const data = this.form.state.data;
168
+ const res = await entityService.wf.getWFVersion(
169
+ (_b = (_a = data.srfwftag) != null ? _a : this.view.params.srfwftag) != null ? _b : this.view.context.srfwftag
170
+ );
167
171
  if (res.data.length === 0) {
168
172
  throw new RuntimeError("\u5F53\u524D\u5DE5\u4F5C\u6D41\u7248\u672C\u4E0D\u5B58\u5728");
169
173
  }
@@ -46,9 +46,9 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
46
46
  return false;
47
47
  });
48
48
  };
49
- const onTabChange = async (active, event) => {
49
+ const onTabChange = async (active, event, opts = {}) => {
50
50
  activeName.value = active;
51
- await c.onClickMenuItem(active, event);
51
+ await c.onClickMenuItem(active, event, true, opts);
52
52
  };
53
53
  vue.onMounted(async () => {
54
54
  const allItems = c.getAllItems();
@@ -56,7 +56,9 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
56
56
  return item.openDefault && !item.hidden;
57
57
  });
58
58
  if (defaultActiveMenuItem && !route.params.view2 && !route.fullPath.includes("404")) {
59
- onTabChange(defaultActiveMenuItem.id, void 0);
59
+ onTabChange(defaultActiveMenuItem.id, void 0, {
60
+ replace: true
61
+ });
60
62
  } else if (ibiz.config.appMenu.enableEcho) {
61
63
  const activeMenu = calcCurMenu();
62
64
  activeName.value = activeMenu ? activeMenu.id : "";
@@ -71,7 +71,7 @@ const IBizFormItemContainer = /* @__PURE__ */ vue.defineComponent({
71
71
  render() {
72
72
  var _a, _b;
73
73
  return vue.createVNode("div", {
74
- "class": [this.ns.b(), this.ns.m(this.labelPos.toLowerCase()), this.ns.is("required", this.required), this.ns.is("error", !!this.error)],
74
+ "class": [this.ns.b(), this.ns.m(this.labelPos.toLowerCase()), this.ns.is("required", this.required), this.ns.is("error", !!this.error), this.ns.is("show-label", this.labelPos === "NONE")],
75
75
  "style": this.cssVars
76
76
  }, [vue.createVNode("div", {
77
77
  "class": [this.ns.b("content")]
@@ -19,13 +19,6 @@ class DatePickerEditorController extends runtime.EditorController {
19
19
  * @Date: 2022-08-25 14:33:14
20
20
  */
21
21
  __publicField(this, "placeHolder", "\u8BF7\u9009\u62E9\u65E5\u671F");
22
- /**
23
- * 值格式化
24
- * @return {*}
25
- * @author: zhujiamin
26
- * @Date: 2022-08-25 14:33:14
27
- */
28
- __publicField(this, "valueFormat");
29
22
  }
30
23
  /**
31
24
  * 根据编辑器类型获取格式化
@@ -55,10 +48,6 @@ class DatePickerEditorController extends runtime.EditorController {
55
48
  return "YYYY-MM-DD hh:mm:ss";
56
49
  }
57
50
  }
58
- async onInit() {
59
- super.onInit();
60
- this.valueFormat = this.getFormatByType(this.model.editorType);
61
- }
62
51
  }
63
52
 
64
53
  exports.DatePickerEditorController = DatePickerEditorController;
@@ -3,23 +3,7 @@
3
3
  var runtime = require('@ibiz-template/runtime');
4
4
 
5
5
  "use strict";
6
- var __defProp = Object.defineProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __publicField = (obj, key, value) => {
9
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
10
- return value;
11
- };
12
6
  class DateRangeEditorController extends runtime.EditorController {
13
- constructor() {
14
- super(...arguments);
15
- /**
16
- * 值格式化
17
- * @return {*}
18
- * @author: zhujiamin
19
- * @Date: 2022-08-25 14:33:14
20
- */
21
- __publicField(this, "valueFormat");
22
- }
23
7
  /**
24
8
  * 根据编辑器类型获取格式化
25
9
  *
@@ -38,10 +22,6 @@ class DateRangeEditorController extends runtime.EditorController {
38
22
  return "YYYY-MM-DD hh:mm:ss";
39
23
  }
40
24
  }
41
- async onInit() {
42
- super.onInit();
43
- this.valueFormat = this.getFormatByType();
44
- }
45
25
  }
46
26
 
47
27
  exports.DateRangeEditorController = DateRangeEditorController;
@@ -123,7 +123,7 @@ const IBizSpan = /* @__PURE__ */ vue.defineComponent({
123
123
  content = "";
124
124
  }
125
125
  return vue.createVNode("span", {
126
- "class": [this.ns.b(), this.readonly ? this.ns.m("readonly") : "", this.readonly ? this.ns.m("disabled") : ""],
126
+ "class": [this.ns.b(), this.readonly ? this.ns.m("readonly") : "", this.disabled ? this.ns.m("disabled") : ""],
127
127
  "ref": "editorRef"
128
128
  }, [content]);
129
129
  }
@@ -3,7 +3,7 @@
3
3
  var vue = require('vue');
4
4
  var vue3Util = require('@ibiz-template/vue3-util');
5
5
  require('./ibiz-image-select.css');
6
- var vant = require('vant');
6
+ var Vant = require('vant');
7
7
  var useVanUpload = require('../use/use-van-upload.cjs');
8
8
 
9
9
  "use strict";
@@ -23,7 +23,7 @@ const IBizImageSelect = /* @__PURE__ */ vue.defineComponent({
23
23
  emit("change", value);
24
24
  }, c);
25
25
  const onPreview = (_file) => {
26
- vant.showImagePreview({
26
+ Vant.showImagePreview({
27
27
  images: files.value.map((item) => item.url)
28
28
  });
29
29
  };
@@ -3,7 +3,7 @@
3
3
  var vue = require('vue');
4
4
  var vue3Util = require('@ibiz-template/vue3-util');
5
5
  require('./ibiz-image-upload.css');
6
- var vant = require('vant');
6
+ var Vant = require('vant');
7
7
  var useVanUpload = require('../use/use-van-upload.cjs');
8
8
 
9
9
  "use strict";
@@ -30,7 +30,7 @@ const IBizImageUpload = /* @__PURE__ */ vue.defineComponent({
30
30
  }, c);
31
31
  const onPreview = (_file) => {
32
32
  const index = files.value.findIndex((item) => item.id === _file.id);
33
- vant.showImagePreview({
33
+ Vant.showImagePreview({
34
34
  images: files.value.map((item) => item.url),
35
35
  startPosition: index
36
36
  });
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var runtime = require('@ibiz-template/runtime');
6
+ var vue3Util = require('@ibiz-template/vue3-util');
7
+ var index$1 = require('./common/index.cjs');
8
+ require('./control/index.cjs');
9
+ var index = require('./locale/index.cjs');
10
+ var index$4 = require('./panel-component/index.cjs');
11
+ require('./platform/index.cjs');
12
+ var index$3 = require('./view/portal-view/index.cjs');
13
+ require('./style/index.css');
14
+ var index$2 = require('./view-engine/index.cjs');
15
+ var index$p = require('./editor/index.cjs');
16
+ var vueBrowserPlatformProvider = require('./platform/vue-browser-platform-provider.cjs');
17
+ var index$5 = require('./control/list/md-ctrl/index.cjs');
18
+ var index$6 = require('./control/app-menu/index.cjs');
19
+ var index$7 = require('./control/app-menu-icon-view/index.cjs');
20
+ var index$8 = require('./control/app-menu-list-view/index.cjs');
21
+ var index$9 = require('./control/form/form/index.cjs');
22
+ var index$a = require('./control/form/search-form/index.cjs');
23
+ var index$b = require('./control/form/edit-form/index.cjs');
24
+ var index$c = require('./control/pickup-view-panel/index.cjs');
25
+ var index$d = require('./control/list/list/index.cjs');
26
+ var index$e = require('./control/tab-exp-panel/index.cjs');
27
+ var index$f = require('./control/toolbar/index.cjs');
28
+ var index$g = require('./control/caption-bar/index.cjs');
29
+ var index$h = require('./control/search-bar/index.cjs');
30
+ var index$i = require('./control/drtab/index.cjs');
31
+ var index$j = require('./control/tree/index.cjs');
32
+ var index$k = require('./control/data-view/index.cjs');
33
+ var index$l = require('./control/dashboard/index.cjs');
34
+ var index$m = require('./control/chart/index.cjs');
35
+ var index$n = require('./control/calendar/index.cjs');
36
+ var index$o = require('./control/wizard-panel/index.cjs');
37
+
38
+ "use strict";
39
+ var IBizVue3 = {
40
+ install: (v) => {
41
+ ibiz.i18n = index.iBizI18n;
42
+ const browserPlatformProvider = new vueBrowserPlatformProvider.VueBrowserPlatformProvider();
43
+ runtime.registerPlatformProvider(
44
+ runtime.PlatformType.BROWSER,
45
+ () => browserPlatformProvider
46
+ );
47
+ v.use(index$1.IBizCommonComponents);
48
+ v.use(index$2.IBizViewEngine);
49
+ v.use(vue3Util.IBizView);
50
+ v.use(vue3Util.IBizDeRedirectView);
51
+ v.use(vue3Util.IBizViewLayoutPanelControl);
52
+ v.use(index$3.IBizPortalView);
53
+ v.use(index$4.IBizPanelComponents);
54
+ v.use(index$5.IBizMDCtrlControl);
55
+ v.use(vue3Util.IBizPanelControl);
56
+ v.use(index$6.IBizAppMenuControl);
57
+ v.use(index$7.IBizAppMenuIconViewControl);
58
+ v.use(index$8.IBizAppMenuListViewControl);
59
+ v.use(index$9.IBizFormControl);
60
+ v.use(index$a.IBizSearchFormControl);
61
+ v.use(index$b.IBizEditFormControl);
62
+ v.use(index$c.IBizPickupViewPanelControl);
63
+ v.use(index$d.IBizListControl);
64
+ v.use(index$e.IBizTabExpPanelControl);
65
+ v.use(index$f.IBizToolbarControl);
66
+ v.use(index$g.IBizCaptionBarControl);
67
+ v.use(index$h.IBizSearchBarControl);
68
+ v.use(index$i.IBizDRTabControl);
69
+ v.use(index$j.IBizTreeControl);
70
+ v.use(index$k.IBizDataViewControl);
71
+ v.use(index$l.IBizDashboardControl);
72
+ v.use(index$m.IBizChartControl);
73
+ v.use(index$n.IBizCalendarControl);
74
+ v.use(index$o.IBizWizardPanelControl);
75
+ v.use(index$p.IBizEditor);
76
+ }
77
+ };
78
+
79
+ exports.default = IBizVue3;