@ibiz-template/vue3-components 0.6.17 → 0.7.0

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 (94) hide show
  1. package/dist/chart-jfPZ04eU.js +1 -0
  2. package/dist/index-Wk7Kbc7Z.js +4 -0
  3. package/dist/index.min.css +1 -1
  4. package/dist/index.system.min.js +1 -1
  5. package/dist/{xlsx-util-tKOH6BvT.js → xlsx-util-keqImqNu.js} +1 -1
  6. package/es/common/pagination/pagination.d.ts +9 -0
  7. package/es/common/pagination/pagination.mjs +12 -2
  8. package/es/common/view-message/view-message.css +1 -1
  9. package/es/common/view-message/view-message.d.ts +27 -1
  10. package/es/common/view-message/view-message.mjs +130 -17
  11. package/es/control/chart/chart.css +1 -1
  12. package/es/control/chart/chart.d.ts +3 -1
  13. package/es/control/chart/chart.mjs +70 -6
  14. package/es/control/data-view/data-view.mjs +1 -0
  15. package/es/control/drbar/drbar.controller.d.ts +9 -0
  16. package/es/control/drbar/drbar.controller.mjs +16 -1
  17. package/es/control/drtab/drtab.controller.d.ts +9 -0
  18. package/es/control/drtab/drtab.controller.mjs +16 -1
  19. package/es/control/form/form-detail/form-mdctrl/form-mdctrl.css +1 -1
  20. package/es/control/form/form-detail/form-mdctrl/form-mdctrl.d.ts +2 -1
  21. package/es/control/form/form-detail/form-mdctrl/form-mdctrl.mjs +13 -4
  22. package/es/control/form/form-detail/form-mdctrl/index.d.ts +1 -0
  23. package/es/control/form/form-detail/form-rawitem/form-rawitem.d.ts +2 -1
  24. package/es/control/form/form-detail/form-rawitem/form-rawitem.mjs +31 -1
  25. package/es/control/form/form-detail/form-rawitem/index.d.ts +1 -0
  26. package/es/control/grid/grid/grid.mjs +1 -0
  27. package/es/control/list/list.mjs +1 -0
  28. package/es/control/search-bar/filter-tree/filter-tree.d.ts +3 -3
  29. package/es/control/search-bar/filter-tree/filter-tree.mjs +98 -37
  30. package/es/control/search-bar/index.d.ts +1 -0
  31. package/es/control/search-bar/index.mjs +2 -0
  32. package/es/control/search-bar/quick-search-select/quick-search-select.css +1 -0
  33. package/es/control/search-bar/quick-search-select/quick-search-select.d.ts +16 -0
  34. package/es/control/search-bar/quick-search-select/quick-search-select.mjs +72 -0
  35. package/es/control/search-bar/search-bar.css +1 -1
  36. package/es/control/search-bar/search-bar.d.ts +1 -0
  37. package/es/control/search-bar/search-bar.mjs +14 -3
  38. package/es/control/tree-grid/tree-grid.mjs +1 -0
  39. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +11 -3
  40. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +13 -2
  41. package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +13 -5
  42. package/es/editor/raw/ibiz-raw/ibiz-raw.mjs +7 -0
  43. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.mjs +3 -3
  44. package/es/panel-component/index.mjs +2 -0
  45. package/es/panel-component/panel-index-view-search/index.d.ts +1 -0
  46. package/es/panel-component/panel-index-view-search/panel-index-view-search.d.ts +1 -0
  47. package/es/panel-component/panel-index-view-search/panel-index-view-search.mjs +22 -2
  48. package/es/panel-component/view-msg-pos/index.d.ts +25 -0
  49. package/es/panel-component/view-msg-pos/index.mjs +16 -0
  50. package/es/panel-component/view-msg-pos/view-msg-pos.controller.d.ts +21 -0
  51. package/es/panel-component/view-msg-pos/view-msg-pos.controller.mjs +48 -0
  52. package/es/panel-component/view-msg-pos/view-msg-pos.d.ts +25 -0
  53. package/es/panel-component/view-msg-pos/view-msg-pos.mjs +47 -0
  54. package/es/panel-component/view-msg-pos/view-msg-pos.provider.d.ts +16 -0
  55. package/es/panel-component/view-msg-pos/view-msg-pos.provider.mjs +21 -0
  56. package/es/view-engine/index.mjs +4 -0
  57. package/es/view-engine/panel-view-engine.d.ts +2 -2
  58. package/es/web-app/App.mjs +9 -1
  59. package/lib/common/pagination/pagination.cjs +12 -2
  60. package/lib/common/view-message/view-message.cjs +129 -16
  61. package/lib/common/view-message/view-message.css +1 -1
  62. package/lib/control/chart/chart.cjs +69 -5
  63. package/lib/control/chart/chart.css +1 -1
  64. package/lib/control/data-view/data-view.cjs +1 -0
  65. package/lib/control/drbar/drbar.controller.cjs +16 -1
  66. package/lib/control/drtab/drtab.controller.cjs +16 -1
  67. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.cjs +13 -4
  68. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.css +1 -1
  69. package/lib/control/form/form-detail/form-rawitem/form-rawitem.cjs +30 -0
  70. package/lib/control/grid/grid/grid.cjs +1 -0
  71. package/lib/control/list/list.cjs +1 -0
  72. package/lib/control/search-bar/filter-tree/filter-tree.cjs +98 -37
  73. package/lib/control/search-bar/index.cjs +2 -0
  74. package/lib/control/search-bar/quick-search-select/quick-search-select.cjs +74 -0
  75. package/lib/control/search-bar/quick-search-select/quick-search-select.css +1 -0
  76. package/lib/control/search-bar/search-bar.cjs +14 -3
  77. package/lib/control/search-bar/search-bar.css +1 -1
  78. package/lib/control/tree-grid/tree-grid.cjs +1 -0
  79. package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +11 -3
  80. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +13 -2
  81. package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +13 -5
  82. package/lib/editor/raw/ibiz-raw/ibiz-raw.cjs +7 -0
  83. package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.cjs +2 -2
  84. package/lib/panel-component/index.cjs +2 -0
  85. package/lib/panel-component/panel-index-view-search/panel-index-view-search.cjs +21 -1
  86. package/lib/panel-component/view-msg-pos/index.cjs +22 -0
  87. package/lib/panel-component/view-msg-pos/view-msg-pos.cjs +49 -0
  88. package/lib/panel-component/view-msg-pos/view-msg-pos.controller.cjs +50 -0
  89. package/lib/panel-component/view-msg-pos/view-msg-pos.provider.cjs +23 -0
  90. package/lib/view-engine/index.cjs +4 -0
  91. package/lib/web-app/App.cjs +8 -0
  92. package/package.json +12 -12
  93. package/dist/chart-IsmrW_d0.js +0 -1
  94. package/dist/index-fN8w56IX.js +0 -4
@@ -12,6 +12,10 @@ export declare const IBizPagination: import("vue").DefineComponent<{
12
12
  type: NumberConstructor;
13
13
  required: true;
14
14
  };
15
+ totalPages: {
16
+ type: NumberConstructor;
17
+ required: false;
18
+ };
15
19
  }, {
16
20
  ns: import("@ibiz-template/core").Namespace;
17
21
  start: import("vue").ComputedRef<number>;
@@ -20,6 +24,7 @@ export declare const IBizPagination: import("vue").DefineComponent<{
20
24
  onPageSizeChange: (size: number) => void;
21
25
  pageRefresh: () => void;
22
26
  inputChange: (event: MouseEvent) => void;
27
+ calcTotalPages: import("vue").ComputedRef<number>;
23
28
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "pageSizeChange" | "pageRefresh")[], "change" | "pageSizeChange" | "pageRefresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
29
  total: {
25
30
  type: NumberConstructor;
@@ -33,6 +38,10 @@ export declare const IBizPagination: import("vue").DefineComponent<{
33
38
  type: NumberConstructor;
34
39
  required: true;
35
40
  };
41
+ totalPages: {
42
+ type: NumberConstructor;
43
+ required: false;
44
+ };
36
45
  }>> & {
37
46
  onChange?: ((...args: any[]) => any) | undefined;
38
47
  onPageSizeChange?: ((...args: any[]) => any) | undefined;
@@ -1,5 +1,6 @@
1
1
  import { computed, resolveComponent, mergeProps, createVNode, createTextVNode, defineComponent } from 'vue';
2
2
  import { useNamespace } from '@ibiz-template/vue3-util';
3
+ import { isNil } from 'ramda';
3
4
  import './pagination.css';
4
5
 
5
6
  "use strict";
@@ -17,6 +18,10 @@ const IBizPagination = /* @__PURE__ */ defineComponent({
17
18
  size: {
18
19
  type: Number,
19
20
  required: true
21
+ },
22
+ totalPages: {
23
+ type: Number || void 0,
24
+ required: false
20
25
  }
21
26
  },
22
27
  emits: ["change", "pageSizeChange", "pageRefresh"],
@@ -42,6 +47,9 @@ const IBizPagination = /* @__PURE__ */ defineComponent({
42
47
  const inputChange = (event) => {
43
48
  event.stopPropagation();
44
49
  };
50
+ const calcTotalPages = computed(() => {
51
+ return Math.ceil(props.total / props.size);
52
+ });
45
53
  return {
46
54
  ns,
47
55
  start,
@@ -49,7 +57,8 @@ const IBizPagination = /* @__PURE__ */ defineComponent({
49
57
  onPageChange,
50
58
  onPageSizeChange,
51
59
  pageRefresh,
52
- inputChange
60
+ inputChange,
61
+ calcTotalPages
53
62
  };
54
63
  },
55
64
  render() {
@@ -59,6 +68,7 @@ const IBizPagination = /* @__PURE__ */ defineComponent({
59
68
  "layout": "slot, prev, pager, next, sizes, jumper",
60
69
  "background": true,
61
70
  "total": this.total,
71
+ "page-count": !isNil(this.totalPages) && this.calcTotalPages === this.totalPages ? this.calcTotalPages : this.totalPages,
62
72
  "current-page": this.curPage,
63
73
  "page-size": this.size,
64
74
  "page-sizes": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
@@ -76,7 +86,7 @@ const IBizPagination = /* @__PURE__ */ defineComponent({
76
86
  default: () => [createVNode("ion-icon", {
77
87
  "name": "refresh"
78
88
  }, null)]
79
- })]), createVNode("span", null, [ibiz.i18n.t("component.pagination.display"), createTextVNode("\xA0"), this.start, createTextVNode("\xA0-\xA0"), this.end, createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.piece"), createTextVNode("\uFF0C"), ibiz.i18n.t("component.pagination.total"), createTextVNode("\xA0"), this.total, createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.pieceData")])]
89
+ })]), isNil(this.totalPages) || this.calcTotalPages === this.totalPages ? createVNode("span", null, [ibiz.i18n.t("component.pagination.display"), createTextVNode("\xA0"), this.start, createTextVNode("\xA0-\xA0"), this.end, createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.piece"), createTextVNode("\uFF0C")]) : null, createVNode("span", null, [ibiz.i18n.t("component.pagination.total"), createTextVNode("\xA0"), this.total, createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.pieceData")])]
80
90
  })]);
81
91
  }
82
92
  });
@@ -1 +1 @@
1
- .ibiz-view-message__alert.is-no-title.el-alert .el-alert__description{margin:0}
1
+ .ibiz-view-message{--ibiz-view-message-border--warning:1px solid var(--ibiz-color-warning-active);--ibiz-view-message-border--error:1px solid var(--ibiz-color-danger-active);--ibiz-view-message-border--info:1px solid var(--ibiz-color-info-active);padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-none)}.ibiz-view-message--hidden{display:none}.ibiz-view-message .el-alert--warning.is-light{border:var(--ibiz-view-message-border--warning)}.ibiz-view-message .el-alert--error.is-light{border:var(--ibiz-view-message-border--error)}.ibiz-view-message .el-alert--info.is-light{border:var(--ibiz-view-message-border--info)}.ibiz-view-message-alert{margin-bottom:var(--ibiz-spacing-tight)}.ibiz-view-message-alert:last-child{margin-bottom:var(--ibiz-spacing-none)}.ibiz-view-message-alert--single .el-alert__description{margin:0}.ibiz-view-message-alert--single-message .el-alert__close-btn{top:calc(var(--ibiz-spacing-tight) + var(--ibiz-spacing-super-tight))}.ibiz-view-message-alert__title{line-height:calc(var(--ibiz-spacing-base-loose) - var(--ibiz-spacing-super-tight))}.ibiz-view-message-alert__message{line-height:var(--ibiz-spacing-base)}.ibiz-view-message-carousel-alert .el-alert__content{overflow:hidden}.ibiz-view-message-carousel-alert__title{height:calc(var(--ibiz-spacing-base-loose) - var(--ibiz-spacing-super-tight));overflow:hidden;line-height:calc(var(--ibiz-spacing-base-loose) - var(--ibiz-spacing-super-tight));text-overflow:ellipsis;white-space:nowrap}.ibiz-view-message-carousel-alert__message{height:var(--ibiz-spacing-base);overflow:hidden;line-height:var(--ibiz-spacing-base);text-overflow:ellipsis;white-space:nowrap}
@@ -17,9 +17,29 @@ export declare const ViewMessage: import("vue").DefineComponent<{
17
17
  readonly [Symbol.species]: ArrayConstructor;
18
18
  };
19
19
  };
20
+ scroll: {
21
+ type: BooleanConstructor;
22
+ default: boolean;
23
+ };
20
24
  }, {
21
25
  ns: import("@ibiz-template/core").Namespace;
22
26
  getType: (messageType?: string) => string;
27
+ items: import("vue").Ref<{
28
+ position: string | undefined;
29
+ messageType?: string | undefined;
30
+ removeMode?: number | undefined;
31
+ title?: string | undefined;
32
+ message?: string | undefined;
33
+ extraParams: IData;
34
+ hidden?: boolean | undefined;
35
+ }[]>;
36
+ container: import("vue").Ref<HTMLElement | null>;
37
+ carouselHeight: import("vue").Ref<string>;
38
+ initialIndex: import("vue").Ref<number>;
39
+ uuid: import("vue").Ref<string>;
40
+ isHiddenContainer: import("vue").Ref<boolean>;
41
+ handleAlertClose: (index: number) => void;
42
+ handleChange: (index: number) => void;
23
43
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
44
  messages: {
25
45
  type: {
@@ -37,4 +57,10 @@ export declare const ViewMessage: import("vue").DefineComponent<{
37
57
  readonly [Symbol.species]: ArrayConstructor;
38
58
  };
39
59
  };
40
- }>>, {}, {}>;
60
+ scroll: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ }>>, {
65
+ scroll: boolean;
66
+ }, {}>;
@@ -1,16 +1,24 @@
1
- import { resolveComponent, createVNode, defineComponent } from 'vue';
1
+ import { isVNode, ref, watch, nextTick, onMounted, resolveComponent, createVNode, defineComponent } from 'vue';
2
2
  import { useNamespace } from '@ibiz-template/vue3-util';
3
+ import { createUUID } from 'qx-util';
3
4
  import './view-message.css';
4
5
 
5
6
  "use strict";
7
+ function _isSlot(s) {
8
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
9
+ }
6
10
  const ViewMessage = /* @__PURE__ */ defineComponent({
7
11
  name: "ViewMessage",
8
12
  props: {
9
13
  messages: {
10
14
  type: Array
15
+ },
16
+ scroll: {
17
+ type: Boolean,
18
+ default: false
11
19
  }
12
20
  },
13
- setup() {
21
+ setup(props) {
14
22
  const ns = useNamespace("view-message");
15
23
  const getType = (messageType) => {
16
24
  switch (messageType) {
@@ -22,27 +30,132 @@ const ViewMessage = /* @__PURE__ */ defineComponent({
22
30
  return "info";
23
31
  }
24
32
  };
33
+ const items = ref([]);
34
+ const initialIndex = ref(0);
35
+ const uuid = ref("");
36
+ const isHiddenContainer = ref(false);
37
+ watch(() => props.messages, () => {
38
+ initialIndex.value = 0;
39
+ uuid.value = createUUID();
40
+ if (Array.isArray(props.messages)) {
41
+ items.value = props.messages.filter((item) => item.title || item.message).map((item) => {
42
+ return {
43
+ ...item
44
+ };
45
+ });
46
+ isHiddenContainer.value = false;
47
+ } else {
48
+ items.value = [];
49
+ isHiddenContainer.value = true;
50
+ }
51
+ }, {
52
+ immediate: true
53
+ });
54
+ const container = ref(null);
55
+ const carouselHeight = ref("");
56
+ onMounted(() => {
57
+ nextTick(() => {
58
+ const el = container.value;
59
+ if (!el) {
60
+ return;
61
+ }
62
+ const alertEl = el.querySelector(".el-alert");
63
+ if (alertEl) {
64
+ carouselHeight.value = "".concat(alertEl.offsetHeight, "px");
65
+ }
66
+ });
67
+ });
68
+ const handleAlertClose = (index) => {
69
+ items.value[index].hidden = true;
70
+ const isHiddenCarouse = items.value.every((item) => item.hidden);
71
+ if (isHiddenCarouse) {
72
+ isHiddenContainer.value = true;
73
+ }
74
+ uuid.value = createUUID();
75
+ };
76
+ const handleChange = (index) => {
77
+ initialIndex.value = index;
78
+ };
25
79
  return {
26
80
  ns,
27
- getType
81
+ getType,
82
+ items,
83
+ container,
84
+ carouselHeight,
85
+ initialIndex,
86
+ uuid,
87
+ isHiddenContainer,
88
+ handleAlertClose,
89
+ handleChange
28
90
  };
29
91
  },
30
92
  render() {
31
- var _a, _b;
32
- if (!((_a = this.messages) == null ? void 0 : _a.length)) {
33
- return null;
93
+ const renderScrollMessages = () => {
94
+ let _slot;
95
+ return createVNode("div", {
96
+ "class": [this.ns.b(), this.isHiddenContainer && this.ns.m("hidden")],
97
+ "ref": "container"
98
+ }, [createVNode(resolveComponent("el-carousel"), {
99
+ "key": this.uuid,
100
+ "indicatorPosition": "none",
101
+ "arrow": "never",
102
+ "height": this.carouselHeight,
103
+ "initialIndex": this.initialIndex,
104
+ "onChange": this.handleChange
105
+ }, _isSlot(_slot = this.items.map((item, i) => {
106
+ if (item.hidden) {
107
+ return;
108
+ }
109
+ return createVNode(resolveComponent("el-carousel-item"), null, {
110
+ default: () => [createVNode(resolveComponent("el-alert"), {
111
+ "type": this.getType(item.messageType),
112
+ "class": this.ns.b("carousel-alert"),
113
+ "closable": item.removeMode !== 0,
114
+ "onClose": () => this.handleAlertClose(i)
115
+ }, {
116
+ title: () => {
117
+ return createVNode("div", {
118
+ "class": this.ns.be("carousel-alert", "title")
119
+ }, [item.title || ""]);
120
+ },
121
+ default: () => {
122
+ return createVNode("div", {
123
+ "class": this.ns.be("carousel-alert", "message")
124
+ }, [item.message || ""]);
125
+ }
126
+ })]
127
+ });
128
+ })) ? _slot : {
129
+ default: () => [_slot]
130
+ })]);
131
+ };
132
+ const renderMessages = () => {
133
+ return createVNode("div", {
134
+ "class": [this.ns.b(), this.isHiddenContainer && this.ns.m("hidden")]
135
+ }, [this.items.map((item, i) => {
136
+ return createVNode(resolveComponent("el-alert"), {
137
+ "type": this.getType(item.messageType),
138
+ "class": [this.ns.b("alert"), this.ns.bm("alert", item.title && item.message ? "" : "single"), this.ns.bm("alert", !item.title && item.message ? "single-message" : "")],
139
+ "closable": item.removeMode !== 0,
140
+ "onClose": () => this.handleAlertClose(i)
141
+ }, {
142
+ title: () => {
143
+ return createVNode("div", {
144
+ "class": this.ns.be("alert", "title")
145
+ }, [item.title || ""]);
146
+ },
147
+ default: () => {
148
+ return createVNode("div", {
149
+ "class": this.ns.be("alert", "message")
150
+ }, [item.message || ""]);
151
+ }
152
+ });
153
+ })]);
154
+ };
155
+ if (this.items.length > 1 && this.scroll) {
156
+ return renderScrollMessages();
34
157
  }
35
- return createVNode("div", {
36
- "class": [this.ns.b()]
37
- }, [(_b = this.messages) == null ? void 0 : _b.map((message) => {
38
- return createVNode(resolveComponent("el-alert"), {
39
- "type": this.getType(message.messageType),
40
- "title": message.title,
41
- "class": [this.ns.e("alert"), this.ns.is("no-title", !message.title)],
42
- "description": message.message,
43
- "closable": message.removeMode !== 0
44
- }, null);
45
- })]);
158
+ return renderMessages();
46
159
  }
47
160
  });
48
161
 
@@ -1 +1 @@
1
- .ibiz-control-chart{width:100%;height:100%}.ibiz-control-chart__chart{width:100%;height:100%}.ibiz-control-chart__chart.is-no-data{display:none}.ibiz-control-chart__empty{display:none;height:100%}.ibiz-control-chart__empty.is-no-data{display:flex}
1
+ .ibiz-control-chart{width:100%;height:100%}.ibiz-control-chart__chart-grid{width:100%;height:100%}.ibiz-control-chart__chart-grid.is-show-grid{display:flex;height:calc(100% - 16px)}.ibiz-control-chart__chart-grid--bottom{flex-direction:column}.ibiz-control-chart__chart-grid--top{flex-direction:column-reverse}.ibiz-control-chart__chart-grid--left{flex-direction:row-reverse}.ibiz-control-chart__chart-grid--right{flex-direction:row}.ibiz-control-chart__chart-grid.is-no-data{display:none}.ibiz-control-chart__chart-grid-container{flex:1;height:50%}.ibiz-control-chart__chart-grid-container.is-bottom{width:100%;height:50%;min-height:50%}.ibiz-control-chart__chart-grid-container.is-top{width:100%;height:50%;min-height:50%}.ibiz-control-chart__chart-grid-container.is-left{width:50%;min-width:50%;height:100%}.ibiz-control-chart__chart-grid-container.is-right{width:50%;min-width:50%;height:100%}.ibiz-control-chart__chart-grid-container.is-no-grid{flex:unset;width:100%;height:100%}.ibiz-control-chart__chart{width:100%;height:100%}.ibiz-control-chart__grid{flex:1;height:auto}.ibiz-control-chart__grid .cell{text-overflow:ellipsis;white-space:nowrap}.ibiz-control-chart__grid .el-table__body-wrapper{border-bottom:1px solid var(--ibiz-color-border)}.ibiz-control-chart__empty{display:none;height:100%}.ibiz-control-chart__empty.is-no-data{display:flex}.ibiz-control-chart-chart-container{width:100%;height:100%}
@@ -1,7 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  import { IDEChart } from '@ibiz/model-core';
3
- import './chart.scss';
4
3
  import { ChartController, IControlProvider } from '@ibiz-template/runtime';
4
+ import './chart.scss';
5
5
  declare const ChartControl: import("vue").DefineComponent<{
6
6
  modelData: {
7
7
  type: PropType<IDEChart>;
@@ -30,6 +30,8 @@ declare const ChartControl: import("vue").DefineComponent<{
30
30
  c: ChartController;
31
31
  ns: import("@ibiz-template/core").Namespace;
32
32
  chartRef: import("vue").Ref<any>;
33
+ uuid: string;
34
+ renderGrid: () => JSX.Element;
33
35
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
34
36
  modelData: {
35
37
  type: PropType<IDEChart>;
@@ -1,10 +1,14 @@
1
- import { ref, onMounted, resolveComponent, createVNode, defineComponent } from 'vue';
1
+ import { isVNode, ref, nextTick, onMounted, watch, resolveComponent, createVNode, onBeforeUnmount, defineComponent } from 'vue';
2
2
  import { useControlController, useNamespace } from '@ibiz-template/vue3-util';
3
3
  import { init } from 'echarts';
4
- import './chart.css';
4
+ import { createUUID } from 'qx-util';
5
5
  import { ChartController } from '@ibiz-template/runtime';
6
+ import './chart.css';
6
7
 
7
8
  "use strict";
9
+ function _isSlot(s) {
10
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
11
+ }
8
12
  const ChartControl = /* @__PURE__ */ defineComponent({
9
13
  name: "IBizChartControl",
10
14
  props: {
@@ -36,27 +40,87 @@ const ChartControl = /* @__PURE__ */ defineComponent({
36
40
  const c = useControlController((...args) => new ChartController(...args));
37
41
  const ns = useNamespace("control-".concat(c.model.controlType.toLowerCase()));
38
42
  const chartRef = ref();
43
+ const maxHeight = ref(0);
44
+ const uuid = createUUID();
45
+ const setHeight = async () => {
46
+ await nextTick();
47
+ const el = document.getElementById(uuid);
48
+ if (el) {
49
+ if (c.state.gridPosition === "bottom" || c.state.gridPosition === "top") {
50
+ maxHeight.value = el.offsetHeight / 2 - 8;
51
+ } else {
52
+ maxHeight.value = el.offsetHeight - 16;
53
+ }
54
+ }
55
+ };
56
+ const getGridData = () => {
57
+ return c.state.gridData || [];
58
+ };
39
59
  onMounted(() => {
40
60
  const chart = init(chartRef.value);
41
61
  c.initChart(chart);
62
+ window.addEventListener("resize", setHeight);
63
+ setHeight();
64
+ });
65
+ watch(() => c.state.showGrid, () => {
66
+ setHeight();
67
+ }, {
68
+ immediate: true
69
+ });
70
+ const renderGrid = () => {
71
+ let _slot;
72
+ return createVNode(resolveComponent("el-table"), {
73
+ "ref": "tableRef",
74
+ "data": getGridData(),
75
+ "border": true,
76
+ "style": {
77
+ width: "100%"
78
+ },
79
+ "max-height": maxHeight.value,
80
+ "header-row-class-name": ns.e("grid-header")
81
+ }, _isSlot(_slot = c.state.gridHeaders.map((column) => {
82
+ return createVNode(resolveComponent("el-table-column"), {
83
+ "prop": column.id,
84
+ "align": "center",
85
+ "label": column.name
86
+ }, null);
87
+ })) ? _slot : {
88
+ default: () => [_slot]
89
+ });
90
+ };
91
+ onBeforeUnmount(() => {
92
+ window.removeEventListener("resize", setHeight);
42
93
  });
43
94
  return {
44
95
  c,
45
96
  ns,
46
- chartRef
97
+ chartRef,
98
+ uuid,
99
+ renderGrid
47
100
  };
48
101
  },
49
102
  render() {
50
103
  return createVNode(resolveComponent("iBizControlBase"), {
51
104
  "controller": this.c
52
105
  }, {
53
- default: () => [createVNode(resolveComponent("el-empty"), {
106
+ default: () => [createVNode("div", {
107
+ "id": this.uuid,
108
+ "class": this.ns.b("chart-container")
109
+ }, [createVNode(resolveComponent("el-empty"), {
54
110
  "class": [this.ns.e("empty"), this.ns.is("no-data", this.c.state.items.length === 0)],
55
111
  "description": "\u6682\u65E0\u6570\u636E"
56
112
  }, null), createVNode("div", {
113
+ "class": [this.ns.e("chart-grid"), this.ns.is("no-data", this.c.state.items.length === 0), this.ns.is("show-grid", this.c.state.showGrid), {
114
+ [this.ns.em("chart-grid", this.c.state.gridPosition)]: this.c.state.showGrid
115
+ }]
116
+ }, [createVNode("div", {
117
+ "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)]
118
+ }, [createVNode("div", {
57
119
  "ref": "chartRef",
58
- "class": [this.ns.e("chart"), this.ns.is("no-data", this.c.state.items.length === 0)]
59
- }, [ibiz.i18n.t("control.chart.chartPlaceholder")])]
120
+ "class": [this.ns.e("chart")]
121
+ }, [ibiz.i18n.t("control.chart.chartPlaceholder")])]), this.c.state.showGrid ? createVNode("div", {
122
+ "class": this.ns.e("grid")
123
+ }, [this.renderGrid()]) : null])])]
60
124
  });
61
125
  }
62
126
  });
@@ -281,6 +281,7 @@ const DataViewControl = /* @__PURE__ */ defineComponent({
281
281
  "total": this.c.state.total,
282
282
  "curPage": this.c.state.curPage,
283
283
  "size": this.c.state.size,
284
+ "totalPages": this.c.state.totalPages,
284
285
  "onChange": this.onPageChange,
285
286
  "onPageSizeChange": this.onPageSizeChange,
286
287
  "onPageRefresh": this.onPageRefresh
@@ -177,4 +177,13 @@ export declare class DRBarController extends ControlController<IDEDRBar, IDRBarS
177
177
  * @return {*} {Promise<void>}
178
178
  */
179
179
  protected initCounter(): Promise<void>;
180
+ /**
181
+ * 监听组件销毁
182
+ *
183
+ * @author zhanghengfeng
184
+ * @date 2024-04-10 19:04:43
185
+ * @protected
186
+ * @return {*} {Promise<void>}
187
+ */
188
+ protected onDestroyed(): Promise<void>;
180
189
  }
@@ -52,7 +52,8 @@ class DRBarController extends ControlController {
52
52
  * @memberof DRBarController
53
53
  */
54
54
  get form() {
55
- return this.view.getController("form");
55
+ var _a;
56
+ return (_a = this.view) == null ? void 0 : _a.getController("form");
56
57
  }
57
58
  /**
58
59
  * 是否是新建
@@ -441,6 +442,20 @@ class DRBarController extends ControlController {
441
442
  );
442
443
  }
443
444
  }
445
+ /**
446
+ * 监听组件销毁
447
+ *
448
+ * @author zhanghengfeng
449
+ * @date 2024-04-10 19:04:43
450
+ * @protected
451
+ * @return {*} {Promise<void>}
452
+ */
453
+ async onDestroyed() {
454
+ await super.onDestroyed();
455
+ if (this.counter) {
456
+ this.counter.destroy();
457
+ }
458
+ }
444
459
  }
445
460
 
446
461
  export { DRBarController };
@@ -145,4 +145,13 @@ export declare class DRTabController extends ControlController<IDEDRTab, IDRTabS
145
145
  * @return {*} {Promise<void>}
146
146
  */
147
147
  protected initCounter(): Promise<void>;
148
+ /**
149
+ * 监听组件销毁
150
+ *
151
+ * @author zhanghengfeng
152
+ * @date 2024-04-10 19:04:40
153
+ * @protected
154
+ * @return {*} {Promise<void>}
155
+ */
156
+ protected onDestroyed(): Promise<void>;
148
157
  }
@@ -43,7 +43,8 @@ class DRTabController extends ControlController {
43
43
  * @memberof DRTabController
44
44
  */
45
45
  get form() {
46
- return this.view.getController("form");
46
+ var _a;
47
+ return (_a = this.view) == null ? void 0 : _a.getController("form");
47
48
  }
48
49
  /**
49
50
  * 路由层级
@@ -305,6 +306,20 @@ class DRTabController extends ControlController {
305
306
  );
306
307
  }
307
308
  }
309
+ /**
310
+ * 监听组件销毁
311
+ *
312
+ * @author zhanghengfeng
313
+ * @date 2024-04-10 19:04:40
314
+ * @protected
315
+ * @return {*} {Promise<void>}
316
+ */
317
+ async onDestroyed() {
318
+ await super.onDestroyed();
319
+ if (this.counter) {
320
+ this.counter.destroy();
321
+ }
322
+ }
308
323
  }
309
324
 
310
325
  export { DRTabController };
@@ -1 +1 @@
1
- .ibiz-form-mdctrl{--ibiz-form-mdctrl-header-height:32px}.ibiz-form-mdctrl-header{height:var(--ibiz-form-mdctrl-header-height);line-height:var(--ibiz-form-mdctrl-header-height)}
1
+ .ibiz-form-mdctrl{--ibiz-form-mdctrl-header-height:49px}.ibiz-form-mdctrl__toolbar{display:flex;justify-content:flex-end;width:50%}.ibiz-form-mdctrl__title{width:50%;font-size:var(--ibiz-font-size-header-5);font-weight:var(--ibiz-font-weight-bold)}.ibiz-form-mdctrl-header{display:flex;place-content:center space-between;align-items:center;height:var(--ibiz-form-mdctrl-header-height);padding:var(--ibiz-spacing-base-tight) 0;margin:6px var(--ibiz-spacing-base-tight);line-height:var(--ibiz-form-mdctrl-header-height);border-bottom:1px solid var(--ibiz-color-border)}
@@ -1,5 +1,5 @@
1
1
  import { PropType } from 'vue';
2
- import { IDEFormMDCtrl } from '@ibiz/model-core';
2
+ import { IDEFormMDCtrl, IUIActionGroupDetail } from '@ibiz/model-core';
3
3
  import { FormMDCtrlController } from '@ibiz-template/runtime';
4
4
  import './form-mdctrl.scss';
5
5
  export declare const FormMDCtrl: import("vue").DefineComponent<{
@@ -15,6 +15,7 @@ export declare const FormMDCtrl: import("vue").DefineComponent<{
15
15
  c: FormMDCtrlController;
16
16
  ns: import("@ibiz-template/core").Namespace;
17
17
  hasCaption: boolean | undefined;
18
+ onActionClick: (detail: IUIActionGroupDetail, event: MouseEvent) => Promise<void>;
18
19
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
19
20
  modelData: {
20
21
  type: PropType<IDEFormMDCtrl>;
@@ -21,10 +21,14 @@ const FormMDCtrl = /* @__PURE__ */ defineComponent({
21
21
  useController(props.controller);
22
22
  const c = props.controller;
23
23
  const hasCaption = c.model.showCaption && !!c.model.caption;
24
+ const onActionClick = async (detail, event) => {
25
+ await props.controller.onActionClick(detail, event);
26
+ };
24
27
  return {
25
28
  c,
26
29
  ns,
27
- hasCaption
30
+ hasCaption,
31
+ onActionClick
28
32
  };
29
33
  },
30
34
  render() {
@@ -56,11 +60,16 @@ const FormMDCtrl = /* @__PURE__ */ defineComponent({
56
60
  }
57
61
  return createVNode("div", {
58
62
  "class": [this.ns.b(), this.ns.m(this.modelData.codeName), ...this.controller.containerClass, this.hasCaption ? this.ns.m("show-caption") : ""]
59
- }, [this.hasCaption && createVNode("div", {
63
+ }, [createVNode("div", {
60
64
  "class": this.ns.b("header")
61
- }, [createVNode("span", {
65
+ }, [createVNode("div", {
62
66
  "class": this.ns.e("title")
63
- }, [this.c.model.caption])]), content]);
67
+ }, [this.hasCaption ? this.c.model.caption : ""]), model.uiactionGroup && createVNode(resolveComponent("iBizActionToolbar"), {
68
+ "class": this.ns.e("toolbar"),
69
+ "action-details": model.uiactionGroup.uiactionGroupDetails,
70
+ "actions-state": this.controller.state.actionGroupState,
71
+ "onActionClick": this.onActionClick
72
+ }, null)]), content]);
64
73
  }
65
74
  });
66
75
 
@@ -11,6 +11,7 @@ export declare const IBizFormMDCtrl: import("@ibiz-template/vue3-util").TypeWith
11
11
  c: import("@ibiz-template/runtime").FormMDCtrlController;
12
12
  ns: import("@ibiz-template/core").Namespace;
13
13
  hasCaption: boolean | undefined;
14
+ onActionClick: (detail: import("@ibiz/model-core").IUIActionGroupDetail, event: MouseEvent) => Promise<void>;
14
15
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
16
  modelData: {
16
17
  type: import("vue").PropType<import("@ibiz/model-core").IDEFormMDCtrl>;
@@ -1,5 +1,5 @@
1
1
  import { IDEFormRawItem } from '@ibiz/model-core';
2
- import { PropType } from 'vue';
2
+ import { PropType, Ref } from 'vue';
3
3
  import { FormRawItemController } from '@ibiz-template/runtime';
4
4
  import './form-rawitem.scss';
5
5
  export declare const FormRawItem: import("vue").DefineComponent<{
@@ -13,6 +13,7 @@ export declare const FormRawItem: import("vue").DefineComponent<{
13
13
  };
14
14
  }, {
15
15
  ns: import("@ibiz-template/core").Namespace;
16
+ content: Ref<string | number | undefined>;
16
17
  showFormDefaultContent: import("vue").ComputedRef<boolean>;
17
18
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
18
19
  modelData: {