@web-utils/component 3.8.3 → 4.0.1

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 (211) hide show
  1. package/awesome-button/index.mjs +25 -55
  2. package/base.css +1 -1
  3. package/card/index.mjs +13 -13
  4. package/card/style.css +1 -1
  5. package/carousel/style.css +1 -1
  6. package/chat/index.mjs +2 -2
  7. package/chat/style.css +1 -1
  8. package/chunks/{ElementForm.8w6UkiuU.mjs → ElementForm.CQ3PN5qj.mjs} +17 -35
  9. package/chunks/{ElementListeners.DOy8wyD2.mjs → ElementListeners.De_PRuIm.mjs} +56 -95
  10. package/chunks/{ElementMultiInstance.3Z28ewuh.mjs → ElementMultiInstance.DQo2wuAQ.mjs} +16 -26
  11. package/chunks/{ElementProperties.B2I48muA.mjs → ElementProperties.CosfDrlW.mjs} +16 -16
  12. package/chunks/{ElementTaskConfig.MBbkLrth.mjs → ElementTaskConfig.Bko0kgTp.mjs} +104 -113
  13. package/chunks/{FlowCondition.BfU9kw6h.mjs → FlowCondition.Y6qEYi1T.mjs} +36 -66
  14. package/chunks/{FormTemp.BSpnNput.mjs → FormTemp.Bu2VCxUh.mjs} +2 -2
  15. package/chunks/{SignalAndMessage.CH6L7cYu.mjs → SignalAndMessage.Bb5PFX0N.mjs} +11 -22
  16. package/chunks/{UserTaskListeners.XXe5dC5I.mjs → UserTaskListeners.Bv3BDfEI.mjs} +45 -86
  17. package/chunks/configComponents.BDhlZU8F.mjs +23 -0
  18. package/chunks/confirmable-mixin.D9aKzKZ9.mjs +85 -0
  19. package/chunks/core.DJEgjQW6.mjs +54 -0
  20. package/chunks/{dataformat.B9UvztrQ.mjs → dataformat.CpqOeGBl.mjs} +2 -2
  21. package/chunks/{dic.CET0XdKP.mjs → dic.Dkl-leRW.mjs} +43 -43
  22. package/chunks/dictionary.DqiP9x2m.mjs +25 -0
  23. package/chunks/{event.BT1F_1vF.mjs → event.9aDS6jcw.mjs} +2 -2
  24. package/chunks/form-input.B8z37eqj.mjs +31 -0
  25. package/chunks/form-item.D-H-wCPE.mjs +233 -0
  26. package/chunks/form-validate.CVarNHKX.mjs +12 -0
  27. package/chunks/helper.BiMLcEEk.mjs +41 -0
  28. package/chunks/index.9OxHjTIE.mjs +16 -0
  29. package/chunks/{index.MAFc4eFi.mjs → index.d3MV3Wq2.mjs} +43 -47
  30. package/chunks/{init.ofpxEyAI.mjs → init.DAsXSoLW.mjs} +2 -2
  31. package/chunks/{packages.CWPkeLu9.mjs → packages.ByyangTp.mjs} +3 -3
  32. package/chunks/sub-table-plus-props.BVsD71hT.mjs +30 -0
  33. package/chunks/{tab-mixin.CVr9bZtn.mjs → tab-mixin.BNK6dxLN.mjs} +1 -1
  34. package/chunks/{util.CoahLDYn.mjs → util.DqFv_pWg.mjs} +54 -55
  35. package/chunks/utilSelf.Csq1766E.mjs +48 -0
  36. package/color-picker/index.mjs +19 -37
  37. package/comment/style.css +1 -1
  38. package/confirm-button/index.mjs +1 -1
  39. package/confirmable/index.mjs +1 -1
  40. package/context-menu/style.css +1 -1
  41. package/count-up/index.mjs +13 -24
  42. package/custom-scrollbar/index.mjs +1 -2
  43. package/data-operatext/style.css +1 -1
  44. package/data-panel/style.css +1 -1
  45. package/data-pay/style.css +1 -1
  46. package/data-price/style.css +1 -1
  47. package/data-rotate/style.css +1 -1
  48. package/data-table-picker/index.mjs +1 -1
  49. package/data-tabs/style.css +1 -1
  50. package/dialog-form/index.mjs +16 -28
  51. package/dynamic-table/style.css +1 -1
  52. package/easy-popup/index.mjs +22 -40
  53. package/easy-popup/style.css +1 -1
  54. package/editable-tree/index.mjs +203 -250
  55. package/editable-tree/style.css +1 -1
  56. package/element-dialog/index.mjs +30 -52
  57. package/element-dialog/style.css +1 -1
  58. package/flex-column/index.mjs +13 -25
  59. package/flex-item/index.mjs +15 -27
  60. package/flex-row/index.mjs +13 -25
  61. package/flow/index.mjs +30 -32
  62. package/flow-designer/index.mjs +344 -375
  63. package/flow-designer/style.css +1 -1
  64. package/flow-node/index.mjs +1 -1
  65. package/flow-viewer/index.mjs +64 -91
  66. package/form-block/index.mjs +33 -26
  67. package/form-card/index.mjs +25 -0
  68. package/form-cascader/index.mjs +70 -67
  69. package/form-checkbox/index.mjs +71 -0
  70. package/form-checkbox-group/index.mjs +33 -53
  71. package/form-date-picker/index.mjs +44 -73
  72. package/form-holder/index.mjs +60 -64
  73. package/form-holder/style.css +1 -0
  74. package/form-input/index.mjs +62 -40
  75. package/form-input-cron-expression/index.mjs +77 -0
  76. package/form-input-cron-expression/style.css +1 -0
  77. package/form-input-email/index.mjs +21 -33
  78. package/form-input-id-card/index.mjs +25 -38
  79. package/form-input-number/index.mjs +39 -42
  80. package/form-input-number/style.css +1 -1
  81. package/form-input-phone-number/index.mjs +26 -37
  82. package/form-input-tag/index.mjs +32 -34
  83. package/form-input-time/index.mjs +22 -37
  84. package/form-item/index.mjs +109 -101
  85. package/form-item/style.css +1 -1
  86. package/form-item-config-provider/index.mjs +18 -10
  87. package/form-item-group/index.mjs +73 -69
  88. package/form-item-group/style.css +1 -1
  89. package/form-radio-group/index.mjs +41 -36
  90. package/form-radio-group/style.css +1 -1
  91. package/form-select/index.mjs +142 -75
  92. package/form-select/style.css +1 -0
  93. package/form-switch/index.mjs +29 -34
  94. package/form-table/index.mjs +85 -0
  95. package/form-table-plus/index.mjs +109 -0
  96. package/form-textarea/index.mjs +23 -35
  97. package/form-tree-select/index.mjs +72 -0
  98. package/form-tree-select/style.css +1 -0
  99. package/form-tree-select-multiple/index.mjs +78 -0
  100. package/form-view/index.mjs +43 -77
  101. package/form-view/style.css +1 -1
  102. package/fy-array/index.mjs +2 -2
  103. package/fy-cascader/index.mjs +1 -1
  104. package/fy-checkbox/index.mjs +1 -1
  105. package/fy-code/index.mjs +1 -1
  106. package/fy-curd/index.mjs +12 -17
  107. package/fy-curd/style.css +1 -1
  108. package/fy-date/index.mjs +1 -1
  109. package/fy-draggable/index.mjs +5 -7
  110. package/fy-draggable/style.css +1 -1
  111. package/fy-dynamic/index.mjs +14 -16
  112. package/fy-empty/index.mjs +1 -1
  113. package/fy-empty/style.css +1 -1
  114. package/fy-form/index.mjs +117 -136
  115. package/fy-form/style.css +1 -1
  116. package/fy-form-design/index.mjs +319 -345
  117. package/fy-form-design/style.css +1 -1
  118. package/fy-input/index.mjs +2 -2
  119. package/fy-input-color/index.mjs +1 -1
  120. package/fy-input-icon/index.mjs +1 -1
  121. package/fy-input-map/index.mjs +21 -26
  122. package/fy-input-map/style.css +1 -1
  123. package/fy-input-number/index.mjs +1 -1
  124. package/fy-input-table/index.mjs +10 -12
  125. package/fy-input-tree/index.mjs +1 -1
  126. package/fy-radio/index.mjs +1 -1
  127. package/fy-rate/index.mjs +1 -1
  128. package/fy-select/index.mjs +4 -4
  129. package/fy-slider/index.mjs +2 -2
  130. package/fy-switch/index.mjs +1 -1
  131. package/fy-tabs/index.mjs +0 -1
  132. package/fy-time/index.mjs +1 -1
  133. package/fy-title/index.mjs +1 -1
  134. package/fy-tree/index.mjs +1 -1
  135. package/fy-u-editor/index.mjs +77 -103
  136. package/fy-upload/index.mjs +3 -3
  137. package/fy-upload/style.css +1 -1
  138. package/highlight-j-s/index.mjs +1 -1
  139. package/highlight-j-s/style.css +1 -1
  140. package/image-cropper/index.mjs +14 -65
  141. package/image-preview/index.mjs +17 -45
  142. package/image-preview/style.css +1 -1
  143. package/image-viewer/style.css +1 -1
  144. package/index.mjs +666 -496
  145. package/input-number/index.mjs +64 -9
  146. package/keyboard/style.css +1 -1
  147. package/license/index.mjs +1 -1
  148. package/login/index.mjs +1 -1
  149. package/monaco-editor/index.mjs +44 -74
  150. package/name-avatar/style.css +1 -1
  151. package/package.json +18 -17
  152. package/page-index/index.mjs +30 -54
  153. package/page-index-top/index.mjs +25 -47
  154. package/pageable-table/index.mjs +354 -226
  155. package/pageable-table/style.css +1 -1
  156. package/pageable-view/index.mjs +63 -106
  157. package/photo-swipe/index.mjs +51 -74
  158. package/picker-table-view/index.mjs +117 -0
  159. package/present-view/index.mjs +43 -77
  160. package/present-view/style.css +1 -1
  161. package/record-video/index.mjs +1 -1
  162. package/resize-observer/index.mjs +1 -1
  163. package/resize-observer/style.css +1 -1
  164. package/search/index.mjs +2 -2
  165. package/search/style.css +1 -1
  166. package/search-popover/index.mjs +28 -48
  167. package/search-popover/style.css +1 -1
  168. package/sign/index.mjs +2 -2
  169. package/sign-panel/style.css +1 -1
  170. package/skeleton-panel/index.mjs +38 -0
  171. package/skeleton-panel/style.css +1 -0
  172. package/split-pane/index.mjs +31 -49
  173. package/split-pane/style.css +1 -1
  174. package/sub-table/index.mjs +206 -0
  175. package/sub-table/style.css +1 -0
  176. package/sub-table-plus/index.mjs +231 -0
  177. package/sub-table-plus/style.css +1 -0
  178. package/swiper/index.mjs +18 -38
  179. package/swiper/style.css +1 -1
  180. package/tab/index.mjs +1 -1
  181. package/tab/style.css +1 -1
  182. package/tab-item/index.mjs +2 -2
  183. package/table-column/index.mjs +112 -37
  184. package/table-column/style.css +1 -0
  185. package/table-view/index.mjs +178 -135
  186. package/table-view/style.css +1 -1
  187. package/tabs-view/index.mjs +104 -0
  188. package/tabs-view/style.css +1 -0
  189. package/tag-render/index.mjs +13 -24
  190. package/text-ellipsis/index.mjs +1 -1
  191. package/toolbar/index.mjs +115 -58
  192. package/toolbar/style.css +1 -1
  193. package/toolbar-button/index.mjs +92 -48
  194. package/verify/index.mjs +1 -1
  195. package/vue-cron/index.mjs +48 -66
  196. package/vue-qr-code/index.mjs +14 -32
  197. package/vue-quill-editor/index.mjs +3 -3
  198. package/vue-tags-input/index.mjs +1 -1
  199. package/vue-tree-select/index.mjs +352 -393
  200. package/vue-tree-select/style.css +1 -1
  201. package/vue-video-player/index.mjs +36 -67
  202. package/watermark/index.mjs +21 -31
  203. package/web-types.json +9240 -3843
  204. package/x-input-tag/index.mjs +29 -61
  205. package/chunks/confirmable-mixin.D4LAArE5.mjs +0 -114
  206. package/chunks/form-input-mixin.BkKiqJhi.mjs +0 -24
  207. package/chunks/form-item-mixin.CG4ZwzMC.mjs +0 -140
  208. package/chunks/input-number-mixin.CzjtGf2n.mjs +0 -60
  209. package/chunks/utilSelf.CRqpl0Cz.mjs +0 -56
  210. package/toolbar-button/style.css +0 -1
  211. /package/chunks/{form-pick-mixin.BFTIVn_i.mjs → form-pick.BFTIVn_i.mjs} +0 -0
package/toolbar/index.mjs CHANGED
@@ -1,16 +1,16 @@
1
- import { h as i } from "vue";
2
- import { NOOP as u } from "@web-utils/core";
3
- import f from "../toolbar-button/index.mjs";
4
- import "../toolbar-button/style.css";
1
+ import { h as u } from "vue";
2
+ import { copy as g, NOOP as d } from "@web-utils/core";
3
+ import { g as f } from "../chunks/configComponents.BDhlZU8F.mjs";
4
+ import { n as y } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
5
  const h = {
6
6
  back: {
7
7
  label: "返回",
8
8
  type: "primary",
9
- icon: "el-icon-d-arrow-left"
9
+ icon: "el-icon-arrow-left"
10
10
  },
11
11
  cancel: {
12
12
  label: "取消",
13
- icon: "fa fa-undo"
13
+ icon: "el-icon-close"
14
14
  },
15
15
  create: {
16
16
  label: "新增",
@@ -20,12 +20,13 @@ const h = {
20
20
  save: {
21
21
  label: "保存",
22
22
  type: "primary",
23
- icon: "fa fa-save"
23
+ icon: "el-icon-takeaway-box",
24
+ loadable: !0
24
25
  },
25
26
  withdraw: {
26
- label: "撤回",
27
+ label: "提取",
27
28
  type: "primary",
28
- icon: "fa fa-undo"
29
+ icon: "el-icon-refresh-left"
29
30
  },
30
31
  edit: {
31
32
  label: "编辑",
@@ -33,34 +34,34 @@ const h = {
33
34
  icon: "el-icon-edit-outline"
34
35
  },
35
36
  submit: {
36
- label: "提交审批",
37
+ label: "审批办理",
37
38
  type: "primary",
38
- icon: "fa fa-check"
39
+ icon: "el-icon-s-promotion"
39
40
  },
40
41
  publish: {
41
42
  label: "发布",
42
43
  type: "primary",
43
- icon: "fa fa-send"
44
+ icon: "el-icon-s-promotion"
44
45
  },
45
46
  agree: {
46
47
  label: "同意",
47
48
  type: "primary",
48
- icon: "fa fa-check-square-o"
49
+ icon: "el-icon-check"
49
50
  },
50
51
  disagree: {
51
52
  label: "不同意",
52
53
  type: "primary",
53
- icon: "fa fa-mail-reply"
54
+ icon: "el-icon-close"
54
55
  },
55
56
  reject: {
56
57
  label: "退回",
57
58
  type: "primary",
58
- icon: "fa fa-reply"
59
+ icon: "el-icon-s-release"
59
60
  },
60
61
  finish: {
61
62
  label: "完成",
62
63
  type: "primary",
63
- icon: "fa fa-check-square"
64
+ icon: "el-icon-circle-check"
64
65
  },
65
66
  enable: {
66
67
  label: "启用",
@@ -82,6 +83,11 @@ const h = {
82
83
  type: "primary",
83
84
  icon: "el-icon-delete"
84
85
  },
86
+ print: {
87
+ label: "打印",
88
+ type: "primary",
89
+ icon: "el-icon-printer"
90
+ },
85
91
  disabled: {
86
92
  label: "禁用",
87
93
  type: "primary",
@@ -89,15 +95,23 @@ const h = {
89
95
  },
90
96
  reload: {
91
97
  label: "刷新",
92
- type: "primary",
93
- icon: "el-icon-refresh"
98
+ icon: "el-icon-refresh",
99
+ separateLine: !1,
100
+ circle: !0
101
+ },
102
+ settings: {
103
+ label: "设置",
104
+ icon: "el-icon-s-operation",
105
+ separateLine: !1,
106
+ circle: !0
94
107
  },
95
108
  search: {
96
109
  label: "搜索",
97
110
  icon: "el-icon-search",
98
- separateLine: !1
111
+ separateLine: !1,
112
+ circle: !0
99
113
  }
100
- }, v = {
114
+ }, B = {
101
115
  name: "Toolbar",
102
116
  provide() {
103
117
  return {
@@ -106,50 +120,49 @@ const h = {
106
120
  },
107
121
  props: {
108
122
  searchable: Boolean,
123
+ refreshable: Boolean,
109
124
  buttons: {
110
125
  type: Array,
111
126
  default: () => ["back"]
112
127
  },
113
- back: {
114
- type: Function
115
- },
116
- cancel: {
117
- type: Function
118
- },
128
+ back: Function,
129
+ cancel: Function,
119
130
  emitter: {
120
131
  type: String,
121
132
  default: "self"
122
133
  },
123
134
  footer: Boolean,
124
- label: {
125
- type: Object,
126
- default: () => ({})
127
- }
135
+ label: Object
128
136
  },
129
137
  methods: {
130
138
  goBack() {
139
+ var n, o;
131
140
  const e = this.$route.path;
132
- this.$bus("closeTab", e, this);
133
- },
134
- fire(e, t) {
135
- this.emitter === "parent" ? this.$parent && this.$parent.$emit(e, t, this) : this.$emit(e, t, this);
141
+ (o = (n = f.toolbar) == null ? void 0 : n.goBack) == null || o.call(n, e);
136
142
  },
137
143
  createButton(e, {
138
- label: t,
144
+ label: n,
139
145
  icon: o,
140
- type: s,
141
- separateLine: a = !0
146
+ type: a,
147
+ separateLine: s = !0,
148
+ loadable: t,
149
+ circle: l,
150
+ onClick: c,
151
+ title: i
142
152
  }) {
143
- var l;
153
+ var b;
144
154
  let r;
145
- const n = ((l = this.label) == null ? void 0 : l[e]) || t;
146
- return ["back", "cancel"].includes(e) ? r = this.goBack : r = (c) => (this.$listeners[e] || u)(c), i(f, {
155
+ const p = ((b = this.label) == null ? void 0 : b[e]) || n;
156
+ return c ? r = c : ["back", "cancel"].includes(e) ? r = this.goBack : r = (m) => (this.$listeners[e] || d)(m), u("ToolbarButton", {
147
157
  attrs: {
148
- "separate-line": a,
158
+ "separate-line": s,
149
159
  icon: o,
150
- label: n,
160
+ title: i,
161
+ label: p,
162
+ loadable: t,
163
+ circle: l,
151
164
  footer: this.footer,
152
- type: s
165
+ type: a
153
166
  },
154
167
  on: {
155
168
  click: r
@@ -157,42 +170,86 @@ const h = {
157
170
  });
158
171
  },
159
172
  getLeftButtons() {
160
- var o, s;
173
+ var a, s;
161
174
  const {
162
175
  createButton: e
163
- } = this;
164
- return ((s = (o = this.$scopedSlots)["toolbar-left"]) == null ? void 0 : s.call(o)) || this.buttons.map((a) => {
165
- var n, l, c, p, b;
166
- const r = h[a];
167
- return r ? ((l = (n = this.$scopedSlots)[a]) == null ? void 0 : l.call(n)) || e(a, r) : a === "slot" && (b = (p = (c = this.$scopedSlots).default) == null ? void 0 : p.call(c, {
176
+ } = this, o = ((s = (a = this.$scopedSlots)["toolbar-left"]) == null ? void 0 : s.call(a)) || this.buttons.flatMap((t) => {
177
+ var c, i, r, p;
178
+ const l = h[t];
179
+ return l ? ((i = (c = this.$scopedSlots)[t]) == null ? void 0 : i.call(c)) || e(t, l) : t === "slot" ? ((p = (r = this.$scopedSlots).default) == null ? void 0 : p.call(r, {
168
180
  buttons: this.buttons,
169
181
  footer: this.footer
170
- })) != null ? b : null;
182
+ })) ?? null : null;
183
+ });
184
+ return o == null ? void 0 : o.filter((t) => {
185
+ var l;
186
+ return (l = t == null ? void 0 : t.componentOptions) != null && l.propsData.privilege ? f.privilege.hasAuthority(t.componentOptions.propsData.privilege) : !0;
171
187
  });
172
188
  },
173
189
  getRightButtons() {
174
- var t, o;
175
- return ((o = (t = this.$scopedSlots)["toolbar-right"]) == null ? void 0 : o.call(t)) || this.getSearchButton();
190
+ var a, s, t, l;
191
+ const e = (s = (a = this.$scopedSlots)["toolbar-right"]) == null ? void 0 : s.call(a), o = [...((l = (t = this.$scopedSlots)["toolbar-right-button"]) == null ? void 0 : l.call(t)) || [], this.getRefreshButton(), this.getSettingsButton(), this.getSearchButton()];
192
+ if (process.env.NODE_ENV === "development" && this.$parent.toggleSearch) {
193
+ const {
194
+ createButton: c
195
+ } = this;
196
+ o.push(c("copyColumnWidth", {
197
+ label: "复制列宽",
198
+ title: "复制列宽",
199
+ icon: "el-icon-document-copy",
200
+ separateLine: !1,
201
+ circle: !0,
202
+ onClick: () => {
203
+ let i = Array.from(this.$el.parentNode.querySelectorAll(".el-table__header > colgroup > col"));
204
+ i = i.filter((r, p) => p > 1 && p < i.length - 1).map((r) => `width="${r.getAttribute("width")}"`).join(`
205
+ `), g(i, () => {
206
+ this.$message.success("复制成功");
207
+ });
208
+ }
209
+ }));
210
+ }
211
+ return e || o;
176
212
  },
177
213
  getSearchButton() {
178
214
  const {
179
215
  createButton: e
180
216
  } = this;
181
217
  return this.searchable ? e("search", h.search) : null;
218
+ },
219
+ getRefreshButton() {
220
+ const {
221
+ createButton: e
222
+ } = this;
223
+ return this.refreshable ? e("reload", h.reload) : null;
224
+ },
225
+ getSettingsButton() {
226
+ const {
227
+ createButton: e
228
+ } = this;
229
+ return this.refreshable ? e("settings", h.settings) : null;
182
230
  }
183
231
  },
184
232
  render() {
185
- return this.footer ? i("div", {
233
+ return this.footer ? u("div", {
186
234
  class: "footer-bar"
187
- }, [this.getLeftButtons()]) : i("div", {
235
+ }, [this.getLeftButtons()]) : u("div", {
188
236
  class: "toolbar"
189
- }, [i("div", {
237
+ }, [u("div", {
190
238
  class: "toolbar-left"
191
- }, [this.getLeftButtons()]), i("div", {
239
+ }, [this.getLeftButtons()]), u("div", {
192
240
  class: "toolbar-right"
193
241
  }, [this.getRightButtons()])]);
194
242
  }
195
- };
243
+ }, _ = null, S = null;
244
+ var v = /* @__PURE__ */ y(
245
+ B,
246
+ _,
247
+ S,
248
+ !1,
249
+ null,
250
+ null
251
+ );
252
+ const R = v.exports;
196
253
  export {
197
- v as default
254
+ R as default
198
255
  };
package/toolbar/style.css CHANGED
@@ -1 +1 @@
1
- .toolbar{background-color:#fff;border-bottom:1px solid #e5e9ec;height:40px;padding:0 10px;line-height:40px;display:flex}.toolbar .toolbar-left{flex:auto}.toolbar .toolbar-left>.form-toolbar-button:last-child .separate-line{display:none}.toolbar .toolbar-left [class*=\ el-icon-],.toolbar .toolbar-left [class^=el-icon-],.toolbar .toolbar-left i.fa{color:#1989fa;margin-top:-1px;font-size:15px}.toolbar .toolbar-right .el-button{align-items:center;display:inline-flex}.footer-bar{flex-direction:row;justify-content:center;align-items:center;padding-top:10px;display:flex}.footer-bar .el-button{padding:10px 40px}
1
+ .toolbar{background-color:#fff;border-bottom:1px solid #e5e9ec;height:40px;padding:0 10px;line-height:40px;display:flex}.toolbar .toolbar-left{flex:auto}.toolbar .toolbar-left .el-button [class*=\ el-icon-],.toolbar .toolbar-left .el-button [class^=el-icon-]{margin-top:-1px;font-size:15px}.toolbar .toolbar-right .el-button{align-items:center;display:inline-flex}.footer-bar{flex-direction:row;justify-content:center;align-items:center;padding-top:10px;display:flex}.footer-bar .el-button{padding:10px 40px}
@@ -1,77 +1,121 @@
1
- var s = (a, t, e) => new Promise((r, i) => {
2
- var c = (o) => {
3
- try {
4
- n(e.next(o));
5
- } catch (l) {
6
- i(l);
7
- }
8
- }, d = (o) => {
9
- try {
10
- n(e.throw(o));
11
- } catch (l) {
12
- i(l);
13
- }
14
- }, n = (o) => o.done ? r(o.value) : Promise.resolve(o.value).then(c, d);
15
- n((e = e.apply(a, t)).next());
16
- });
17
- import { isFunction as p } from "@web-utils/core";
18
- import { n as _ } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
19
- const f = {
1
+ import { isFunction as n, isArray as r } from "@web-utils/core";
2
+ import { g as a } from "../chunks/configComponents.BDhlZU8F.mjs";
3
+ import { n as l } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
4
+ const s = {
20
5
  name: "ToolbarButton",
21
6
  inject: {
22
7
  toolbar: {
23
8
  default: ""
24
9
  }
25
10
  },
11
+ inheritAttrs: !1,
26
12
  props: {
27
- label: {
28
- type: String
29
- },
30
- icon: {
31
- type: String
32
- },
33
- type: {
34
- type: String
13
+ label: String,
14
+ icon: String,
15
+ type: String,
16
+ size: {
17
+ type: String,
18
+ default: "mini"
35
19
  },
20
+ loadable: Boolean,
36
21
  disabled: Boolean,
37
- separateLine: {
38
- type: Boolean,
39
- default: !0
22
+ footer: Boolean,
23
+ circle: Boolean,
24
+ plain: Boolean,
25
+ round: Boolean,
26
+ primary: Boolean,
27
+ warning: Boolean,
28
+ nativeType: {
29
+ type: String,
30
+ default: "button"
40
31
  },
41
- footer: Boolean
32
+ privilege: String,
33
+ // eslint-disable-next-line vue/require-prop-types
34
+ condition: {},
35
+ conditionTips: String,
36
+ confirm: Boolean,
37
+ confirmTips: String,
38
+ beforeExecute: Function,
39
+ afterExecute: Function,
40
+ route: [String, Object],
41
+ title: String,
42
+ cancelButtonText: String,
43
+ confirmButtonText: String
42
44
  },
43
45
  data() {
44
46
  return {
45
47
  loading: !1
46
48
  };
47
49
  },
50
+ computed: {
51
+ isVisible() {
52
+ return this.privilege ? a.privilege.hasAuthority(this.privilege) : !0;
53
+ }
54
+ },
48
55
  methods: {
49
- onClick(a) {
50
- return s(this, null, function* () {
51
- this.loading = !0;
52
- const { click: t } = this.$listeners;
53
- if (p(t))
56
+ async onClick(o) {
57
+ try {
58
+ if (n(this.beforeExecute) && await this.beforeExecute() === !1)
59
+ return;
60
+ if (this.conditionTips) {
61
+ let t = !0;
62
+ if (r(this.condition) ? t = this.condition.length <= 0 : n(this.condition) ? t = !this.condition() : t = !this.condition, t) {
63
+ this.$message.warning(this.conditionTips);
64
+ return;
65
+ }
66
+ }
67
+ if (this.confirm || this.confirmTips)
54
68
  try {
55
- yield t(a);
56
- } catch (e) {
69
+ await this.$confirm(this.confirmTips || "你确定要删除该记录吗?", "系统提示", {
70
+ type: "warning",
71
+ distinguishCancelAndClose: !0,
72
+ cancelButtonText: this.cancelButtonText,
73
+ confirmButtonText: this.confirmButtonText
74
+ });
75
+ } catch (t) {
76
+ if (t === "cancel") {
77
+ const { cancel: e } = this.$listeners;
78
+ n(e) && await e(t);
79
+ } else if (t === "close") {
80
+ const { close: e } = this.$listeners;
81
+ n(e) && await e(t);
82
+ }
83
+ return;
57
84
  }
58
- this.loading = !1;
59
- });
85
+ this.loading = !0;
86
+ let i;
87
+ if (this.route)
88
+ await this.$router.push(this.route);
89
+ else {
90
+ const { click: t } = this.$listeners;
91
+ if (n(t))
92
+ try {
93
+ i = await t(o);
94
+ } catch {
95
+ }
96
+ }
97
+ this.loading = !1, n(this.afterExecute) && await this.afterExecute(i);
98
+ } catch {
99
+ }
60
100
  }
61
101
  }
62
102
  };
63
- var u = function() {
64
- var t = this, e = t._self._c;
65
- return t.footer || t.toolbar.footer ? e("ElButton", { attrs: { disabled: t.disabled || t.loading, type: t.type }, on: { click: t.onClick } }, [t._v(" " + t._s(t.label) + " ")]) : e("span", { staticClass: "form-toolbar-button" }, [e("ElButton", { attrs: { icon: t.icon, type: "text", disabled: t.disabled || t.loading, size: "mini" }, on: { click: t.onClick } }, [t._v(" " + t._s(t.label) + " ")]), t.separateLine ? e("span", { staticClass: "separate-line" }) : t._e()], 1);
66
- }, b = [], m = /* @__PURE__ */ _(
67
- f,
103
+ var c = function() {
104
+ var i = this, t = i._self._c;
105
+ return i.isVisible && (i.footer || i.toolbar.footer) ? t("ElButton", { attrs: { disabled: i.disabled || i.loading, circle: i.circle, plain: i.plain, size: i.size, loading: i.loadable ? i.loading : !1, type: i.primary ? "primary" : i.warning ? "warning" : i.type, round: i.round, "native-type": i.nativeType }, on: { click: i.onClick } }, [i.circle ? i._e() : [i._t("default", function() {
106
+ return [i._v(i._s(i.label))];
107
+ })]], 2) : i.isVisible ? t("ElButton", { attrs: { disabled: i.disabled || i.loading, plain: i.plain, size: i.size, icon: i.icon, "native-type": i.nativeType, circle: i.circle, loading: i.loadable ? i.loading : !1, type: i.primary ? "primary" : i.warning ? "warning" : i.type, round: i.round, title: i.title }, on: { click: i.onClick } }, [i.circle ? i._e() : [i._t("default", function() {
108
+ return [i._v(i._s(i.label))];
109
+ })]], 2) : i._e();
110
+ }, u = [], f = /* @__PURE__ */ l(
111
+ s,
112
+ c,
68
113
  u,
69
- b,
70
114
  !1,
71
115
  null,
72
116
  null
73
117
  );
74
- const B = m.exports;
118
+ const g = f.exports;
75
119
  export {
76
- B as default
120
+ g as default
77
121
  };
package/verify/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { s } from "../chunks/util.CoahLDYn.mjs";
1
+ import { s } from "../chunks/util.DqFv_pWg.mjs";
2
2
  import { n as i } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
3
3
  const o = {
4
4
  name: "Verify",