@ibiz-template/vue3-components 0.7.13-alpha.0 → 0.7.14

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 (95) hide show
  1. package/dist/{index-WP6TUdg-.js → index-8Lu2Ax-_.js} +1 -1
  2. package/dist/index-8tvyarHw.js +4 -0
  3. package/dist/{index-kgWpXafW.js → index-Hg_8xCYx.js} +1 -1
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{xlsx-util-OSsMvylt.js → xlsx-util-OfvrEAre.js} +1 -1
  7. package/es/common/carousel/carousel.d.ts +8 -0
  8. package/es/common/carousel/carousel.mjs +9 -1
  9. package/es/common/carousel-card/carousel-card.css +1 -0
  10. package/es/common/carousel-card/carousel-card.d.ts +41 -0
  11. package/es/common/carousel-card/carousel-card.mjs +218 -0
  12. package/es/common/index.mjs +2 -0
  13. package/es/control/app-menu/app-menu.mjs +1 -1
  14. package/es/control/context-menu/context-menu.css +1 -1
  15. package/es/control/context-menu/context-menu.d.ts +1 -0
  16. package/es/control/context-menu/context-menu.mjs +64 -7
  17. package/es/control/context-menu/index.d.ts +1 -0
  18. package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +76 -1
  19. package/es/control/form/form/form.css +1 -1
  20. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +74 -0
  21. package/es/control/form/form-detail/form-page/form-page.css +1 -1
  22. package/es/control/form/form-detail/form-page/form-page.d.ts +1 -0
  23. package/es/control/form/form-detail/form-page/form-page.mjs +10 -4
  24. package/es/control/form/form-detail/form-page/index.d.ts +1 -0
  25. package/es/control/search-bar/filter-tree/filter-tree.mjs +19 -20
  26. package/es/control/toolbar/short-cut-button/short-cut-button.css +0 -0
  27. package/es/control/toolbar/short-cut-button/short-cut-button.d.ts +48 -0
  28. package/es/control/toolbar/short-cut-button/short-cut-button.mjs +71 -0
  29. package/es/control/toolbar/toolbar.mjs +38 -2
  30. package/es/control/tree/tree.css +1 -1
  31. package/es/control/tree/tree.mjs +2 -1
  32. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
  33. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.d.ts +1 -0
  34. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +25 -13
  35. package/es/index.mjs +1 -0
  36. package/es/locale/en/index.d.ts +1 -0
  37. package/es/locale/en/index.mjs +2 -1
  38. package/es/locale/zh-CN/index.d.ts +1 -0
  39. package/es/locale/zh-CN/index.mjs +2 -1
  40. package/es/panel-component/auth-captcha/auth-captcha.controller.d.ts +13 -0
  41. package/es/panel-component/auth-captcha/auth-captcha.controller.mjs +15 -11
  42. package/es/panel-component/auth-userinfo/auth-userinfo.d.ts +1 -1
  43. package/es/panel-component/auth-userinfo/auth-userinfo.mjs +2 -7
  44. package/es/panel-component/auth-userinfo/index.d.ts +1 -1
  45. package/es/panel-component/panel-button/panel-button.controller.d.ts +1 -1
  46. package/es/panel-component/panel-button/panel-button.controller.mjs +6 -9
  47. package/es/panel-component/panel-static-carousel/index.d.ts +1 -0
  48. package/es/panel-component/panel-static-carousel/panel-static-carousel.d.ts +1 -0
  49. package/es/panel-component/panel-static-carousel/panel-static-carousel.mjs +13 -2
  50. package/es/panel-component/short-cut/index.d.ts +21 -4
  51. package/es/panel-component/short-cut/short-cut.css +1 -1
  52. package/es/panel-component/short-cut/short-cut.d.ts +21 -4
  53. package/es/panel-component/short-cut/short-cut.mjs +62 -42
  54. package/es/util/app-util/app-util.d.ts +90 -0
  55. package/es/util/app-util/app-util.mjs +152 -0
  56. package/es/util/index.d.ts +1 -0
  57. package/es/util/index.mjs +1 -0
  58. package/es/view-engine/login-view.engine.d.ts +31 -3
  59. package/es/view-engine/login-view.engine.mjs +32 -12
  60. package/es/web-app/components/modal-router-shell/modal-router-shell.mjs +19 -5
  61. package/es/web-app/main.mjs +2 -0
  62. package/lib/common/carousel/carousel.cjs +9 -1
  63. package/lib/common/carousel-card/carousel-card.cjs +220 -0
  64. package/lib/common/carousel-card/carousel-card.css +1 -0
  65. package/lib/common/index.cjs +2 -0
  66. package/lib/control/app-menu/app-menu.cjs +1 -1
  67. package/lib/control/context-menu/context-menu.cjs +63 -6
  68. package/lib/control/context-menu/context-menu.css +1 -1
  69. package/lib/control/form/form/form.css +1 -1
  70. package/lib/control/form/form-detail/form-page/form-page.cjs +10 -4
  71. package/lib/control/form/form-detail/form-page/form-page.css +1 -1
  72. package/lib/control/search-bar/filter-tree/filter-tree.cjs +19 -20
  73. package/lib/control/toolbar/short-cut-button/short-cut-button.cjs +73 -0
  74. package/lib/control/toolbar/short-cut-button/short-cut-button.css +0 -0
  75. package/lib/control/toolbar/toolbar.cjs +37 -1
  76. package/lib/control/tree/tree.cjs +2 -1
  77. package/lib/control/tree/tree.css +1 -1
  78. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +24 -12
  79. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
  80. package/lib/index.cjs +2 -0
  81. package/lib/locale/en/index.cjs +2 -1
  82. package/lib/locale/zh-CN/index.cjs +2 -1
  83. package/lib/panel-component/auth-captcha/auth-captcha.controller.cjs +15 -11
  84. package/lib/panel-component/auth-userinfo/auth-userinfo.cjs +2 -7
  85. package/lib/panel-component/panel-button/panel-button.controller.cjs +6 -9
  86. package/lib/panel-component/panel-static-carousel/panel-static-carousel.cjs +13 -2
  87. package/lib/panel-component/short-cut/short-cut.cjs +61 -41
  88. package/lib/panel-component/short-cut/short-cut.css +1 -1
  89. package/lib/util/app-util/app-util.cjs +154 -0
  90. package/lib/util/index.cjs +2 -0
  91. package/lib/view-engine/login-view.engine.cjs +32 -12
  92. package/lib/web-app/components/modal-router-shell/modal-router-shell.cjs +17 -3
  93. package/lib/web-app/main.cjs +2 -0
  94. package/package.json +7 -7
  95. package/dist/index-Ky5xo5V5.js +0 -4
@@ -89,7 +89,7 @@ class PanelButtonController extends runtime.PanelItemController {
89
89
  }
90
90
  /**
91
91
  * 行为点击
92
- *
92
+ * - 在行为参数中传递panelDataParent(面板项数据父容器标识)
93
93
  * @param {MouseEvent} event
94
94
  * @return {*} {Promise<void>}
95
95
  * @memberof PanelButtonController
@@ -101,19 +101,16 @@ class PanelButtonController extends runtime.PanelItemController {
101
101
  }
102
102
  event.stopPropagation();
103
103
  event.preventDefault();
104
- const view = this.panel.view;
105
- if (actionType === "UIACTION" && uiactionId === "login" && view.model.viewType === "APPLOGINVIEW" && !await view.validate(
106
- this.dataParent.model.id
107
- )) {
108
- return;
109
- }
110
104
  await runtime.UIActionUtil.execAndResolved(
111
105
  uiactionId,
112
106
  {
113
107
  context: this.panel.context,
114
- params: this.panel.params,
108
+ params: {
109
+ panelDataParent: this.dataParent.model.id,
110
+ ...this.panel.params
111
+ },
115
112
  data: [this.data],
116
- view,
113
+ view: this.panel.view,
117
114
  event,
118
115
  noWaitRoute: true
119
116
  },
@@ -25,6 +25,7 @@ const PanelStaticCarousel = /* @__PURE__ */ vue.defineComponent({
25
25
  const carouselData = vue.ref([]);
26
26
  const isAuto = vue.ref(true);
27
27
  const timeSpan = vue.ref(3e3);
28
+ const carouselMode = vue.ref("default");
28
29
  const getSwipeConfig = (swipeData) => {
29
30
  const autoPlay = swipeData.find((item) => Object.is(item.key, "autoplay"));
30
31
  if (autoPlay) {
@@ -34,12 +35,17 @@ const PanelStaticCarousel = /* @__PURE__ */ vue.defineComponent({
34
35
  if (span) {
35
36
  timeSpan.value = Number(span.value) || 0;
36
37
  }
38
+ const carouselModeItem = swipeData.find((item) => Object.is(item.key, "carouselMode"));
39
+ if (carouselModeItem && carouselModeItem.value) {
40
+ carouselMode.value = carouselModeItem.value;
41
+ }
37
42
  };
38
43
  if ((_a = model.rawItem) == null ? void 0 : _a.rawItemParams) {
39
44
  let swipeData = [];
40
45
  const imgData = model.rawItem.rawItemParams;
41
46
  const autoplayIndex = imgData.findIndex((item) => Object.is(item.key, "autoplay"));
42
47
  const timespanIndex = imgData.findIndex((item) => Object.is(item.key, "timespan"));
48
+ const carouselModeIndex = imgData.findIndex((item) => Object.is(item.key, "carouselMode"));
43
49
  let number = 0;
44
50
  if (autoplayIndex >= 0) {
45
51
  number += 1;
@@ -47,6 +53,9 @@ const PanelStaticCarousel = /* @__PURE__ */ vue.defineComponent({
47
53
  if (timespanIndex >= 0) {
48
54
  number += 1;
49
55
  }
56
+ if (carouselModeIndex >= 0) {
57
+ number += 1;
58
+ }
50
59
  if (number > 0) {
51
60
  swipeData = imgData.slice(0, -number);
52
61
  getSwipeConfig(imgData.slice(-number));
@@ -73,7 +82,8 @@ const PanelStaticCarousel = /* @__PURE__ */ vue.defineComponent({
73
82
  ns,
74
83
  carouselData,
75
84
  isAuto,
76
- timeSpan
85
+ timeSpan,
86
+ carouselMode
77
87
  };
78
88
  },
79
89
  render() {
@@ -82,7 +92,8 @@ const PanelStaticCarousel = /* @__PURE__ */ vue.defineComponent({
82
92
  }, [vue.createVNode(vue.resolveComponent("iBizCarouselComponent"), {
83
93
  "carouselData": this.carouselData,
84
94
  "isAuto": this.isAuto,
85
- "timeSpan": this.timeSpan
95
+ "timeSpan": this.timeSpan,
96
+ "carouselMode": this.carouselMode
86
97
  }, null)]);
87
98
  }
88
99
  });
@@ -1,11 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var vue = require('vue');
4
+ var vueRouter = require('vue-router');
4
5
  var runtime = require('@ibiz-template/runtime');
5
6
  var vue3Util = require('@ibiz-template/vue3-util');
6
7
  var draggable = require('vuedraggable');
7
- require('./short-cut.css');
8
8
  var core = require('@ibiz-template/core');
9
+ require('./short-cut.css');
9
10
 
10
11
  "use strict";
11
12
  const ShortCut = /* @__PURE__ */ vue.defineComponent({
@@ -26,35 +27,52 @@ const ShortCut = /* @__PURE__ */ vue.defineComponent({
26
27
  setup(props) {
27
28
  const ns = vue3Util.useNamespace("short-cut");
28
29
  const vue$1 = vue.getCurrentInstance().proxy;
29
- const isShowToolbar = vue.ref(false);
30
+ const router = vueRouter.useRouter();
31
+ const shortCutUtil = ibiz.util.shortCut;
32
+ const isShowToolbar = vue.ref(true);
30
33
  const isShowMore = vue.ref(false);
31
- const data = vue.ref(ibiz.util.shortCut.data);
34
+ const data = vue.reactive(shortCutUtil.data);
32
35
  const dragCache = {
33
36
  newIndex: 0,
34
37
  oldIndex: 0
35
38
  };
39
+ const openModeMap = /* @__PURE__ */ new Map([["ROUTE_MODAL", "INDEXVIEWTAB_POPUPMODAL"], ["MODAL", "POPUPMODAL"], ["DRAWER", "DRAWER_RIGHT"]]);
40
+ const onShortCutChange = (items) => {
41
+ if (data.length === 0 && isShowMore.value) {
42
+ isShowMore.value = false;
43
+ }
44
+ vue$1.$forceUpdate();
45
+ };
46
+ vue.onMounted(() => {
47
+ isShowToolbar.value = shortCutUtil.mode !== "vertical";
48
+ ibiz.util.shortCut.onChange(onShortCutChange);
49
+ });
50
+ vue.onUnmounted(() => {
51
+ ibiz.util.shortCut.offChange(onShortCutChange);
52
+ });
36
53
  const onShowChange = () => {
37
54
  isShowToolbar.value = !isShowToolbar.value;
38
55
  if (isShowToolbar.value) {
39
56
  isShowMore.value = false;
40
- }
41
- };
42
- const getOpenMode = (openMode) => {
43
- switch (openMode) {
44
- case "ROUTE_MODAL":
45
- return "INDEXVIEWTAB_POPUPMODAL";
46
- case "MODAL":
47
- return "POPUPMODAL";
48
- case "DRAWER":
49
- return "DRAWER_RIGHT";
50
- default:
57
+ shortCutUtil.setShortCutMode("horizontal");
58
+ } else {
59
+ shortCutUtil.setShortCutMode("vertical");
51
60
  }
52
61
  };
53
62
  const onClick = (item) => {
54
63
  isShowMore.value = false;
55
- ibiz.commands.execute(runtime.OpenAppViewCommand.TAG, item.appViewId, core.IBizContext.create(item.context), item.params, {
56
- openMode: getOpenMode(item.openMode)
57
- });
64
+ if (item.openMode === "ROUTE") {
65
+ const fullPath = item.fullPath.substring(1);
66
+ if (router.currentRoute.value.fullPath !== fullPath) {
67
+ router.push({
68
+ path: item.fullPath.substring(1)
69
+ });
70
+ }
71
+ } else {
72
+ ibiz.commands.execute(runtime.OpenAppViewCommand.TAG, item.appViewId, core.IBizContext.create(item.context), item.params, {
73
+ openMode: openModeMap.get(item.openMode)
74
+ });
75
+ }
58
76
  };
59
77
  const onChange = (evt) => {
60
78
  if (evt.moved) {
@@ -65,18 +83,16 @@ const ShortCut = /* @__PURE__ */ vue.defineComponent({
65
83
  dragCache.oldIndex = evt.removed.oldIndex;
66
84
  ibiz.util.shortCut.changeIndex(dragCache.newIndex, dragCache.oldIndex);
67
85
  }
68
- vue$1.$forceUpdate();
69
86
  };
70
87
  const onDelete = (event, key) => {
71
88
  event.stopPropagation();
72
89
  ibiz.util.shortCut.removeShortCut(key);
73
- vue$1.$forceUpdate();
74
90
  };
75
91
  const renderDraggable = (isVertical) => {
76
92
  return vue.createVNode(draggable, {
77
93
  "itemKey": "key",
78
94
  "class": [ns.e("draggable"), ns.is("vertical", isVertical), ns.is("horizontal", !isVertical)],
79
- "modelValue": data.value,
95
+ "modelValue": data,
80
96
  "group": props.controller.model.id,
81
97
  "onChange": (evt) => onChange(evt)
82
98
  }, {
@@ -87,13 +103,14 @@ const ShortCut = /* @__PURE__ */ vue.defineComponent({
87
103
  if (isVertical && !isShowToolbar.value || isVertical && isShowToolbar.value && index > 5 || !isVertical && index < 6) {
88
104
  return vue.createVNode("div", {
89
105
  "class": ns.e("item"),
106
+ "title": element.caption,
90
107
  "onClick": () => onClick(element)
91
108
  }, [vue.createVNode("svg", {
92
109
  "viewBox": "0 0 16 16",
93
110
  "class": ["drag-icon", "icon"],
94
111
  "xmlns": "http://www.w3.org/2000/svg",
95
- "height": "14px",
96
- "width": "14px",
112
+ "height": "16px",
113
+ "width": "16px",
97
114
  "focusable": "false"
98
115
  }, [vue.createVNode("g", {
99
116
  "id": "drag-icon/drag--",
@@ -106,32 +123,34 @@ const ShortCut = /* @__PURE__ */ vue.defineComponent({
106
123
  }, [vue.createVNode("path", {
107
124
  "d": "M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z",
108
125
  "id": "drag-icon-air"
109
- }, null)])])]), vue.createVNode("ion-icon", {
110
- "class": ["icon", "caption"],
126
+ }, null)])])]), element.icon ? vue.createVNode(vue.resolveComponent("iBizIcon"), {
127
+ "class": ["caption-icon", "icon"],
128
+ "icon": element.icon
129
+ }, null) : vue.createVNode("ion-icon", {
130
+ "class": ["caption-icon", "icon"],
111
131
  "name": "ellipsis-horizontal-circle-outline"
112
132
  }, null), vue.createVNode("div", {
113
133
  "class": ns.em("item", "caption")
114
- }, [element.name]), vue.createVNode("ion-icon", {
115
- "class": ["close-icon", "icon"],
134
+ }, [element.caption]), vue.createVNode("ion-icon", {
116
135
  "name": "close-outline",
136
+ "class": ["close-icon", "icon"],
117
137
  "onClick": (event) => onDelete(event, element.key)
118
138
  }, null)]);
119
139
  }
120
- },
121
- footer: () => {
122
- if (isVertical && !isShowToolbar.value) {
123
- return vue.createVNode("div", {
124
- "class": [ns.e("item"), ns.e("action")],
125
- "onClick": onShowChange
126
- }, [vue.createVNode("ion-icon", {
127
- "name": "chevron-back-outline"
128
- }, null), vue.createVNode("div", {
129
- "class": ns.em("item", "caption")
130
- }, [ibiz.i18n.t("panelComponent.shortCut.expandToolbar")])]);
131
- }
132
140
  }
133
141
  });
134
142
  };
143
+ const renderFoolterToolbar = () => {
144
+ return vue.createVNode("div", {
145
+ "class": [ns.e("action"), ns.is("hidden", isShowToolbar.value)],
146
+ "onClick": onShowChange
147
+ }, [vue.createVNode("ion-icon", {
148
+ "class": ["expand-icon", "icon"],
149
+ "name": "chevron-back-outline"
150
+ }, null), vue.createVNode("div", {
151
+ "class": ns.em("item", "caption")
152
+ }, [ibiz.i18n.t("panelComponent.shortCut.expandToolbar")])]);
153
+ };
135
154
  const renderMoreToolbar = () => {
136
155
  return vue.createVNode(vue.resolveComponent("el-popover"), {
137
156
  "visible": isShowMore.value,
@@ -150,14 +169,14 @@ const ShortCut = /* @__PURE__ */ vue.defineComponent({
150
169
  }, {
151
170
  default: () => [vue.createVNode("div", null, [vue.createVNode("span", {
152
171
  "class": ns.em("more", "caption")
153
- }, [isShowToolbar.value ? "6/".concat(data.value.length) : data.value.length]), vue.createVNode("i", {
172
+ }, [isShowToolbar.value ? "6/".concat(data.length) : data.length]), vue.createVNode("i", {
154
173
  "class": ["fa", ns.em("more", "icon"), isShowMore.value ? "fa-angle-double-down" : "fa-angle-double-up"],
155
174
  "aria-hidden": "true"
156
175
  }, null)])]
157
176
  })]);
158
177
  },
159
178
  default: () => {
160
- return renderDraggable(true);
179
+ return [renderDraggable(true), renderFoolterToolbar()];
161
180
  }
162
181
  });
163
182
  };
@@ -173,7 +192,7 @@ const ShortCut = /* @__PURE__ */ vue.defineComponent({
173
192
  },
174
193
  render() {
175
194
  return vue.createVNode("div", {
176
- "class": [this.ns.b(), ...this.controller.containerClass, this.ns.is("hidden", this.data.length === 0)]
195
+ "class": [this.ns.b(), ...this.controller.containerClass, this.ns.is("conceal", this.data.length === 0)]
177
196
  }, [this.isShowToolbar && this.renderDraggable(false), (!this.isShowToolbar || this.data.length > 6) && this.renderMoreToolbar(), this.isShowToolbar && vue.createVNode("div", {
178
197
  "class": this.ns.e("recover"),
179
198
  "onClick": this.onShowChange
@@ -183,6 +202,7 @@ const ShortCut = /* @__PURE__ */ vue.defineComponent({
183
202
  "placement": "top"
184
203
  }, {
185
204
  default: () => [vue.createVNode("ion-icon", {
205
+ "class": ["recover-icon", "icon"],
186
206
  "name": "chevron-forward-outline"
187
207
  }, null)]
188
208
  })])]);
@@ -1 +1 @@
1
- .ibiz-short-cut{bottom:4px;right:4px;z-index:2;position:fixed;display:flex;align-items:center;border-radius:4px;box-shadow:0 0 16px rgba(0,0,0,.0784313725);border:1px solid var(--ibiz-color-border);background:var(--ibiz-color-bg-1)}.ibiz-short-cut.is-hidden{display:none}.ibiz-short-cut__more{padding:2px;cursor:pointer}.ibiz-short-cut__more .el-tooltip__trigger{padding:8px;line-height:18px}.ibiz-short-cut__more .el-tooltip__trigger:hover{border-radius:2px;color:var(--ibiz-color-primary);background-color:var(--ibiz-color-primary-light-default)}.ibiz-short-cut__more--icon{margin-left:8px}.ibiz-short-cut__recover{padding:2px;display:flex;cursor:pointer;align-items:center}.ibiz-short-cut__recover .el-tooltip__trigger{padding:8px;line-height:18px}.ibiz-short-cut__recover .el-tooltip__trigger:hover{border-radius:2px;color:var(--ibiz-color-primary);background-color:var(--ibiz-color-primary-light-default)}.ibiz-short-cut__item{display:flex;cursor:pointer;position:relative;align-items:center;flex-flow:row nowrap;place-content:center flex-start}.ibiz-short-cut__item .icon{flex-shrink:0}.ibiz-short-cut__item .icon.caption{margin-right:8px}.ibiz-short-cut__item .drag-icon{visibility:hidden}.ibiz-short-cut__item .close-icon{visibility:hidden;font-size:18px}.ibiz-short-cut__item .close-icon:hover{color:var(--ibiz-color-danger-hover)}.ibiz-short-cut__item--caption{flex-grow:1;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ibiz-short-cut__item:hover .close-icon,.ibiz-short-cut__item:hover .drag-icon{visibility:visible}.ibiz-short-cut .is-horizontal{display:flex;padding:8px}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item{max-width:165px;border-right:1px solid var(--ibiz-color-border)}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item--caption{margin:0 8px}.ibiz-short-cut__popover.el-popover.el-popper{padding:10px 0}.ibiz-short-cut__popover .is-vertical .ibiz-short-cut__item{width:225px;height:44px;padding:9px 20px}.ibiz-short-cut__popover .is-vertical .ibiz-short-cut__item .drag-icon{left:5px;position:absolute}.ibiz-short-cut__popover .is-vertical .ibiz-short-cut__item:hover{background-color:var(--ibiz-color-fill-1)}
1
+ .ibiz-short-cut{z-index:2;bottom:26px;display:flex;position:fixed;border-radius:4px;align-items:center;box-shadow:0 0 16px rgba(0,0,0,.0784313725);background:var(--ibiz-color-bg-1);right:var(--ibiz-spacing-base-loose);border:1px solid var(--ibiz-color-border)}.ibiz-short-cut.is-conceal{visibility:hidden}.ibiz-short-cut__more{padding:2px;cursor:pointer}.ibiz-short-cut__more .el-tooltip__trigger{padding:8px;line-height:16px}.ibiz-short-cut__more .el-tooltip__trigger:hover{border-radius:2px;color:var(--ibiz-color-primary);background-color:var(--ibiz-color-primary-light-default)}.ibiz-short-cut__more .recover-icon{font-size:16px;margin-left:8px}.ibiz-short-cut__recover{padding:2px;display:flex;cursor:pointer;align-items:center}.ibiz-short-cut__recover .el-tooltip__trigger{padding:8px;line-height:16px}.ibiz-short-cut__recover .el-tooltip__trigger:hover{border-radius:2px;color:var(--ibiz-color-primary);background-color:var(--ibiz-color-primary-light-default)}.ibiz-short-cut__action{display:flex;cursor:pointer;position:relative;align-items:center;flex-flow:row nowrap;place-content:center flex-start;width:225px;height:44px;padding:9px 20px}.ibiz-short-cut__action .expand-icon{font-size:16px;margin-right:8px}.ibiz-short-cut__item{display:flex;cursor:pointer;position:relative;align-items:center;flex-flow:row nowrap;place-content:center flex-start}.ibiz-short-cut__item .icon{flex-shrink:0;font-size:16px}.ibiz-short-cut__item .drag-icon{display:none;margin-right:8px}.ibiz-short-cut__item .caption-icon{margin-right:8px}.ibiz-short-cut__item .close-icon{visibility:hidden}.ibiz-short-cut__item .close-icon:hover{color:var(--ibiz-color-danger-hover)}.ibiz-short-cut__item--caption{flex-grow:1;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ibiz-short-cut__item:hover .drag-icon{display:block}.ibiz-short-cut__item:hover .caption-icon{display:none}.ibiz-short-cut__item:hover .close-icon{visibility:visible}.ibiz-short-cut .is-horizontal{display:flex;padding:8px 0}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item{max-width:168px;min-width:84px;padding:0 12px;border-right:1px solid var(--ibiz-color-border)}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item .close-icon{right:0;position:absolute;padding-right:4px;background-color:var(--ibiz-color-white);box-shadow:-10px 0 20px 8px var(--ibiz-color-white)}.ibiz-short-cut__popover .is-hidden{display:none}.ibiz-short-cut__popover.el-popover.el-popper{padding:10px 0}.ibiz-short-cut__popover .is-vertical{max-height:400px;overflow-y:auto}.ibiz-short-cut__popover .is-vertical .ibiz-short-cut__item{width:225px;height:44px;padding:9px 20px}.ibiz-short-cut__popover .is-vertical .ibiz-short-cut__item:hover{background-color:var(--ibiz-color-fill-1)}
@@ -0,0 +1,154 @@
1
+ 'use strict';
2
+
3
+ "use strict";
4
+ class AppUtil {
5
+ /**
6
+ * Creates an instance of AppUtil.
7
+ * @author tony001
8
+ * @date 2024-05-14 17:05:00
9
+ * @param {Router} router
10
+ */
11
+ constructor(router) {
12
+ this.router = router;
13
+ }
14
+ /**
15
+ * 登录
16
+ *
17
+ * @author tony001
18
+ * @date 2024-05-14 16:05:41
19
+ * @param {string} loginName
20
+ * @param {string} password
21
+ * @param {(boolean | undefined)} [remember]
22
+ * @param {(IData | undefined)} [headers]
23
+ * @param {(IData | undefined)} [opts]
24
+ * @return {*} {Promise<boolean>}
25
+ */
26
+ async login(loginName, password, remember, headers, opts) {
27
+ const bol = await ibiz.auth.login(loginName, password, remember, headers);
28
+ if (bol === true) {
29
+ window.location.hash = this.router.currentRoute.value.query.ru || "/";
30
+ window.history.pushState({}, "");
31
+ window.location.reload();
32
+ }
33
+ return bol;
34
+ }
35
+ /**
36
+ * 登出
37
+ *
38
+ * @author tony001
39
+ * @date 2024-05-14 16:05:02
40
+ * @param {(IData | undefined)} [opts]
41
+ * @return {*} {Promise<boolean>}
42
+ */
43
+ async logout(opts) {
44
+ const bol = await ibiz.auth.logout();
45
+ if (bol) {
46
+ const path = window.location;
47
+ if (path.search.indexOf("isAnonymous=true") !== -1) {
48
+ const href = "".concat(path.origin).concat(path.pathname).concat(path.hash);
49
+ window.history.replaceState({}, "", href);
50
+ }
51
+ await this.router.push(
52
+ "/login?ru=".concat(encodeURIComponent(
53
+ window.location.hash.replace("#/", "/")
54
+ ))
55
+ );
56
+ ibiz.util.showAppLoading();
57
+ window.location.reload();
58
+ }
59
+ return bol;
60
+ }
61
+ /**
62
+ * 变更密码
63
+ *
64
+ * @author tony001
65
+ * @date 2024-05-14 16:05:11
66
+ * @param {string} oldPwd
67
+ * @param {string} newPwd
68
+ * @param {(IData | undefined)} [opts]
69
+ * @return {*} {Promise<boolean>}
70
+ */
71
+ async changePwd(oldPwd, newPwd, opts) {
72
+ let bol = this.validatePwd(oldPwd, newPwd, opts);
73
+ if (bol) {
74
+ bol = await ibiz.auth.changePwd(oldPwd, newPwd);
75
+ }
76
+ return bol;
77
+ }
78
+ /**
79
+ * 切换组织
80
+ *
81
+ * @author tony001
82
+ * @date 2024-05-14 16:05:20
83
+ * @param {string} oldOrgId
84
+ * @param {string} newOrgId
85
+ * @param {(IData | undefined)} [opts]
86
+ * @return {*} {Promise<boolean>}
87
+ */
88
+ switchOrg(oldOrgId, newOrgId, opts) {
89
+ throw new Error("Method not implemented.");
90
+ }
91
+ /**
92
+ * 切换主题
93
+ *
94
+ * @author tony001
95
+ * @date 2024-05-14 16:05:30
96
+ * @param {string} oldTheme
97
+ * @param {string} newTheme
98
+ * @param {(IData | undefined)} [opts]
99
+ * @return {*} {Promise<boolean>}
100
+ */
101
+ switchTheme(oldTheme, newTheme, opts) {
102
+ throw new Error("Method not implemented.");
103
+ }
104
+ /**
105
+ * 切换语言
106
+ *
107
+ * @author tony001
108
+ * @date 2024-05-14 16:05:42
109
+ * @param {string} oldLanguage
110
+ * @param {string} newLanguage
111
+ * @param {(IData | undefined)} [opts]
112
+ * @return {*} {Promise<boolean>}
113
+ */
114
+ switchLanguage(oldLanguage, newLanguage, opts) {
115
+ throw new Error("Method not implemented.");
116
+ }
117
+ /**
118
+ * 校验密码
119
+ *
120
+ * @author tony001
121
+ * @date 2024-05-14 17:05:31
122
+ * @protected
123
+ * @param {string} oldPwd
124
+ * @param {string} newPwd
125
+ * @param {IData} [opts={}]
126
+ * @return {*} {boolean}
127
+ */
128
+ validatePwd(oldPwd, newPwd, opts = {}) {
129
+ const { surePwd } = opts;
130
+ if (!oldPwd) {
131
+ ibiz.message.error("\u539F\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A");
132
+ return false;
133
+ }
134
+ if (!newPwd) {
135
+ ibiz.message.error("\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A");
136
+ return false;
137
+ }
138
+ if (!surePwd) {
139
+ ibiz.message.error("\u786E\u8BA4\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A");
140
+ return false;
141
+ }
142
+ if (oldPwd === newPwd) {
143
+ ibiz.message.error("\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E0E\u65E7\u5BC6\u7801\u4E00\u81F4");
144
+ return false;
145
+ }
146
+ if (newPwd !== surePwd) {
147
+ ibiz.message.error("\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4");
148
+ return false;
149
+ }
150
+ return true;
151
+ }
152
+ }
153
+
154
+ exports.AppUtil = AppUtil;
@@ -10,6 +10,7 @@ var overlayController = require('./overlay-controller/overlay-controller.cjs');
10
10
  var usePagination = require('./pagination/use-pagination.cjs');
11
11
  var noticeUtil = require('./notice-util/notice-util.cjs');
12
12
  var renderUtil = require('./render-util/render-util.cjs');
13
+ var appUtil = require('./app-util/app-util.cjs');
13
14
 
14
15
  "use strict";
15
16
 
@@ -23,3 +24,4 @@ exports.OverlayController = overlayController.OverlayController;
23
24
  exports.usePagination = usePagination.usePagination;
24
25
  exports.NoticeUtil = noticeUtil.NoticeUtil;
25
26
  exports.RenderUtil = renderUtil.RenderUtil;
27
+ exports.AppUtil = appUtil.AppUtil;
@@ -14,14 +14,21 @@ var __publicField = (obj, key, value) => {
14
14
  class LoginViewEngine extends runtime.ViewEngineBase {
15
15
  constructor() {
16
16
  super(...arguments);
17
+ /**
18
+ * 路由对象
19
+ *
20
+ * @type {RouteLocationNormalizedLoaded}
21
+ * @memberof LoginViewEngine
22
+ */
17
23
  __publicField(this, "route", vueRouter.useRoute());
18
24
  __publicField(this, "enterKeyListener", async (event) => {
19
- if (event.key === "Enter" && this.AppLoginView.layoutPanel) {
25
+ if (event.key === "Enter" && this.view.layoutPanel) {
20
26
  const args = {
21
27
  data: [
22
28
  {
23
- username: this.AppLoginView.layoutPanel.data.username,
24
- password: this.AppLoginView.layoutPanel.data.password
29
+ username: this.view.layoutPanel.data.username,
30
+ password: this.view.layoutPanel.data.password,
31
+ captcha: this.view.layoutPanel.data.captcha
25
32
  }
26
33
  ]
27
34
  };
@@ -29,13 +36,22 @@ class LoginViewEngine extends runtime.ViewEngineBase {
29
36
  }
30
37
  });
31
38
  }
32
- get AppLoginView() {
33
- return this.view.getController("AppLoginView");
34
- }
39
+ /**
40
+ * 视图mounted生命周期执行逻辑
41
+ *
42
+ * @return {*} {Promise<void>}
43
+ * @memberof LoginViewEngine
44
+ */
35
45
  async onMounted() {
36
46
  super.onMounted();
37
47
  document.addEventListener("keydown", this.enterKeyListener);
38
48
  }
49
+ /**
50
+ * 视图destroyed生命周期执行逻辑
51
+ *
52
+ * @return {*} {Promise<void>}
53
+ * @memberof LoginViewEngine
54
+ */
39
55
  async onDestroyed() {
40
56
  super.onDestroyed();
41
57
  document.removeEventListener("keydown", this.enterKeyListener);
@@ -53,8 +69,12 @@ class LoginViewEngine extends runtime.ViewEngineBase {
53
69
  let rememberme;
54
70
  const headers = {};
55
71
  const data = args.data[0] || {};
56
- if (this.AppLoginView.layoutPanel) {
57
- const panelData = this.AppLoginView.layoutPanel.data;
72
+ const panelDataParent = args.params.panelDataParent;
73
+ if (this.view.layoutPanel) {
74
+ if (!await this.view.layoutPanel.validate(panelDataParent)) {
75
+ return;
76
+ }
77
+ const panelData = this.view.layoutPanel.data;
58
78
  if (typeof panelData.isRemember === "boolean") {
59
79
  rememberme = panelData.isRemember;
60
80
  }
@@ -75,16 +95,16 @@ class LoginViewEngine extends runtime.ViewEngineBase {
75
95
  rememberme,
76
96
  headers
77
97
  );
78
- this.view.hooks.afterLogin.call({ ok: bol });
98
+ this.view.evt.emit("onAfterLogin", { ok: bol, panelDataParent });
79
99
  if (bol === true) {
80
100
  window.location.hash = this.route.query.ru || "/";
81
101
  window.location.reload();
82
102
  }
83
103
  }
84
104
  async cancelChanges() {
85
- if (this.AppLoginView.layoutPanel) {
86
- Object.keys(this.AppLoginView.layoutPanel.panelItems).forEach((key) => {
87
- const controller = this.AppLoginView.layoutPanel.panelItems[key];
105
+ if (this.view.layoutPanel) {
106
+ Object.keys(this.view.layoutPanel.panelItems).forEach((key) => {
107
+ const controller = this.view.layoutPanel.panelItems[key];
88
108
  const { viewFieldName } = controller.model;
89
109
  if (viewFieldName) {
90
110
  controller.setDataValue("", viewFieldName);
@@ -20,10 +20,11 @@ const ModalRouterShell = /* @__PURE__ */ vue.defineComponent({
20
20
  }
21
21
  },
22
22
  setup(props) {
23
- const route = vueRouter.useRoute();
23
+ const routeObj = vueRouter.useRoute();
24
24
  const router = vueRouter.useRouter();
25
25
  const isDestroyed = vue.ref(false);
26
26
  const viewData = vue.ref({});
27
+ const pathHistory = [];
27
28
  const destroyContext = () => {
28
29
  if (viewData.value.context) {
29
30
  const {
@@ -43,9 +44,12 @@ const ModalRouterShell = /* @__PURE__ */ vue.defineComponent({
43
44
  }
44
45
  destroyContext();
45
46
  });
46
- const openView = async () => {
47
+ const openView = async (route) => {
47
48
  var _a;
48
49
  viewData.value = await vue3Util.parseRouteViewData(route, routeDepth, true);
50
+ if (isDestroyed.value) {
51
+ return;
52
+ }
49
53
  if (!(viewData.value.context instanceof core.IBizContext)) {
50
54
  viewData.value.context = core.IBizContext.create(viewData.value.context);
51
55
  }
@@ -99,6 +103,7 @@ const ModalRouterShell = /* @__PURE__ */ vue.defineComponent({
99
103
  };
100
104
  overlay = ibiz.overlay.createModal(component, void 0, opts);
101
105
  overlay.present();
106
+ pathHistory.push(route.fullPath);
102
107
  const result = await overlay.onWillDismiss();
103
108
  overlay = null;
104
109
  if (isDestroyed.value === false) {
@@ -114,7 +119,16 @@ const ModalRouterShell = /* @__PURE__ */ vue.defineComponent({
114
119
  });
115
120
  }
116
121
  };
117
- openView();
122
+ vueRouter.onBeforeRouteUpdate((to, from) => {
123
+ if (!isDestroyed.value && pathHistory.length > 0 && pathHistory.indexOf(from.fullPath) !== -1 && pathHistory.indexOf(to.fullPath) === -1) {
124
+ const pathNodes = vue3Util.route2routePath(to).pathNodes;
125
+ const lastNode = pathNodes[pathNodes.length - 1];
126
+ if (lastNode && lastNode.viewName === runtime.RouteConst.ROUTE_MODAL_TAG) {
127
+ openView(to);
128
+ }
129
+ }
130
+ });
131
+ openView(routeObj);
118
132
  return {};
119
133
  },
120
134
  render() {
@@ -12,6 +12,7 @@ require('../util/index.cjs');
12
12
  require('./guard/index.cjs');
13
13
  var unauthorizedHandler = require('./util/unauthorized-handler/unauthorized-handler.cjs');
14
14
  var dynaAuthGuard = require('./guard/auth-guard/dyna-auth-guard.cjs');
15
+ var appUtil = require('../util/app-util/app-util.cjs');
15
16
  var openViewUtil = require('../util/open-view-util/open-view-util.cjs');
16
17
  var renderUtil = require('../util/render-util/render-util.cjs');
17
18
  var messageUtil = require('../util/message-util/message-util.cjs');
@@ -64,6 +65,7 @@ async function runApp(plugins, opts) {
64
65
  }
65
66
  index.AppRouter.setAuthGuard((notLogin) => authGuard.verify(notLogin));
66
67
  app.use(index.AppRouter.getRouter());
68
+ ibiz.appUtil = new appUtil.AppUtil(index.AppRouter.getRouter());
67
69
  ibiz.openView = new openViewUtil.OpenViewUtil(index.AppRouter.getRouter());
68
70
  ibiz.render = new renderUtil.RenderUtil();
69
71
  ibiz.message = new messageUtil.MessageUtil();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.13-alpha.0",
3
+ "version": "0.7.14",
4
4
  "description": "使用 rollup 编译 vue 组件或者 jsx",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -32,12 +32,12 @@
32
32
  "@ibiz-template-plugin/gantt": "0.1.4",
33
33
  "@ibiz-template/core": "0.7.7-dev.0",
34
34
  "@ibiz-template/devtool": "0.0.1-dev.6",
35
- "@ibiz-template/model-helper": "0.7.13-alpha.0",
36
- "@ibiz-template/runtime": "0.7.13-alpha.0",
35
+ "@ibiz-template/model-helper": "0.7.14",
36
+ "@ibiz-template/runtime": "0.7.14",
37
37
  "@ibiz-template/theme": "^0.7.0",
38
- "@ibiz-template/vue3-util": "0.7.13-alpha.0",
39
- "@ibiz-template/web-theme": "^1.1.16",
40
- "@ibiz/model-core": "^0.1.25",
38
+ "@ibiz-template/vue3-util": "0.7.14",
39
+ "@ibiz-template/web-theme": "^1.1.17",
40
+ "@ibiz/model-core": "^0.1.26",
41
41
  "@imengyu/vue3-context-menu": "^1.3.5",
42
42
  "@monaco-editor/loader": "^1.4.0",
43
43
  "@wangeditor/editor": "^5.1.23",
@@ -101,7 +101,7 @@
101
101
  "@ibiz-template/runtime": "^0.7.0",
102
102
  "@ibiz-template/theme": "^0.7.0",
103
103
  "@ibiz-template/vue3-util": "^0.7.0",
104
- "@ibiz/model-core": "^0.1.25",
104
+ "@ibiz/model-core": "^0.1.26",
105
105
  "@imengyu/vue3-context-menu": "^1.3.3",
106
106
  "@monaco-editor/loader": "^1.3.3",
107
107
  "@wangeditor/editor": "^5.1.23",