@web-utils/component 4.0.0 → 4.0.2
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.
- package/awesome-button/index.mjs +25 -55
- package/base.css +1 -1
- package/card/style.css +1 -1
- package/carousel/style.css +1 -1
- package/chat/style.css +1 -1
- package/chunks/{ElementForm.8w6UkiuU.mjs → ElementForm.CQ3PN5qj.mjs} +17 -35
- package/chunks/{ElementListeners.DOy8wyD2.mjs → ElementListeners.De_PRuIm.mjs} +56 -95
- package/chunks/{ElementMultiInstance.3Z28ewuh.mjs → ElementMultiInstance.DQo2wuAQ.mjs} +16 -26
- package/chunks/{ElementProperties.B2I48muA.mjs → ElementProperties.CosfDrlW.mjs} +16 -16
- package/chunks/{ElementTaskConfig.MBbkLrth.mjs → ElementTaskConfig.Bko0kgTp.mjs} +104 -113
- package/chunks/{FlowCondition.BfU9kw6h.mjs → FlowCondition.Y6qEYi1T.mjs} +36 -66
- package/chunks/{SignalAndMessage.CH6L7cYu.mjs → SignalAndMessage.Bb5PFX0N.mjs} +11 -22
- package/chunks/{UserTaskListeners.XXe5dC5I.mjs → UserTaskListeners.Bv3BDfEI.mjs} +45 -86
- package/chunks/configComponents.BDhlZU8F.mjs +23 -0
- package/chunks/confirmable-mixin.D9aKzKZ9.mjs +85 -0
- package/chunks/core.DJEgjQW6.mjs +54 -0
- package/chunks/dictionary.DqiP9x2m.mjs +25 -0
- package/chunks/dictionary.DsN-2ukC.mjs +70 -0
- package/chunks/form-input.B8z37eqj.mjs +31 -0
- package/chunks/form-item.D-H-wCPE.mjs +233 -0
- package/chunks/form-validate.CVarNHKX.mjs +12 -0
- package/chunks/helper.BiMLcEEk.mjs +41 -0
- package/chunks/index.9OxHjTIE.mjs +16 -0
- package/chunks/{index.MAFc4eFi.mjs → index.d3MV3Wq2.mjs} +43 -47
- package/chunks/sub-table-plus-props.BVsD71hT.mjs +30 -0
- package/chunks/{tab-mixin.CVr9bZtn.mjs → tab-mixin.BNK6dxLN.mjs} +1 -1
- package/chunks/utilSelf.Csq1766E.mjs +48 -0
- package/color-picker/index.mjs +19 -37
- package/comment/style.css +1 -1
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/context-menu/style.css +1 -1
- package/count-up/index.mjs +13 -24
- package/custom-scrollbar/index.mjs +1 -2
- package/data-operatext/style.css +1 -1
- package/data-panel/style.css +1 -1
- package/data-pay/style.css +1 -1
- package/data-price/style.css +1 -1
- package/data-rotate/style.css +1 -1
- package/data-table-picker/index.mjs +1 -1
- package/data-tabs/style.css +1 -1
- package/dialog-form/index.mjs +16 -28
- package/dynamic-table/style.css +1 -1
- package/easy-popup/index.mjs +22 -40
- package/easy-popup/style.css +1 -1
- package/editable-tree/index.mjs +203 -250
- package/editable-tree/style.css +1 -1
- package/element-dialog/index.mjs +30 -52
- package/element-dialog/style.css +1 -1
- package/flex-column/index.mjs +13 -25
- package/flex-item/index.mjs +15 -27
- package/flex-row/index.mjs +13 -25
- package/flow-designer/index.mjs +343 -374
- package/flow-designer/style.css +1 -1
- package/flow-viewer/index.mjs +64 -91
- package/form-block/index.mjs +33 -26
- package/form-card/index.mjs +25 -0
- package/form-cascader/index.mjs +70 -67
- package/form-checkbox/index.mjs +71 -0
- package/form-checkbox-group/index.mjs +33 -53
- package/form-date-picker/index.mjs +44 -73
- package/form-holder/index.mjs +54 -40
- package/form-holder/style.css +1 -0
- package/form-input/index.mjs +62 -40
- package/form-input-cron-expression/index.mjs +77 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.mjs +21 -33
- package/form-input-id-card/index.mjs +25 -38
- package/form-input-number/index.mjs +39 -42
- package/form-input-number/style.css +1 -1
- package/form-input-phone-number/index.mjs +26 -37
- package/form-input-tag/index.mjs +32 -34
- package/form-input-time/index.mjs +22 -37
- package/form-item/index.mjs +109 -101
- package/form-item/style.css +1 -1
- package/form-item-config-provider/index.mjs +18 -10
- package/form-item-group/index.mjs +73 -69
- package/form-item-group/style.css +1 -1
- package/form-radio-group/index.mjs +41 -36
- package/form-radio-group/style.css +1 -1
- package/form-select/index.mjs +142 -75
- package/form-select/style.css +1 -0
- package/form-switch/index.mjs +29 -34
- package/form-table/index.mjs +85 -0
- package/form-table-plus/index.mjs +109 -0
- package/form-textarea/index.mjs +23 -35
- package/form-tree-select/index.mjs +72 -0
- package/form-tree-select/style.css +1 -0
- package/form-tree-select-multiple/index.mjs +78 -0
- package/form-view/index.mjs +37 -69
- package/form-view/style.css +1 -1
- package/fy-curd/index.mjs +131 -140
- package/fy-curd/style.css +1 -1
- package/fy-draggable/index.mjs +16 -26
- package/fy-draggable/style.css +1 -1
- package/fy-dynamic/index.mjs +48 -57
- package/fy-empty/style.css +1 -1
- package/fy-form/style.css +1 -1
- package/fy-form-design/index.mjs +314 -339
- package/fy-form-design/style.css +1 -1
- package/fy-input-map/index.mjs +40 -50
- package/fy-input-map/style.css +1 -1
- package/fy-input-table/index.mjs +31 -41
- package/fy-u-editor/index.mjs +77 -103
- package/fy-upload/style.css +1 -1
- package/highlight-j-s/style.css +1 -1
- package/image-cropper/index.mjs +14 -65
- package/image-preview/index.mjs +17 -45
- package/image-preview/style.css +1 -1
- package/image-viewer/style.css +1 -1
- package/index.mjs +666 -496
- package/input-number/index.mjs +64 -9
- package/keyboard/style.css +1 -1
- package/monaco-editor/index.mjs +43 -71
- package/name-avatar/style.css +1 -1
- package/package.json +5 -4
- package/page-index/index.mjs +30 -54
- package/page-index-top/index.mjs +25 -47
- package/pageable-table/index.mjs +385 -218
- package/pageable-table/style.css +1 -1
- package/pageable-view/index.mjs +56 -95
- package/photo-swipe/index.mjs +51 -74
- package/picker-table-view/index.mjs +117 -0
- package/present-view/index.mjs +43 -77
- package/present-view/style.css +1 -1
- package/resize-observer/index.mjs +1 -1
- package/resize-observer/style.css +1 -1
- package/search/style.css +1 -1
- package/search-popover/index.mjs +28 -48
- package/search-popover/style.css +1 -1
- package/sign/index.mjs +1 -1
- package/sign-panel/style.css +1 -1
- package/skeleton-panel/index.mjs +38 -0
- package/skeleton-panel/style.css +1 -0
- package/split-pane/index.mjs +31 -49
- package/split-pane/style.css +1 -1
- package/sub-table/index.mjs +206 -0
- package/sub-table/style.css +1 -0
- package/sub-table-plus/index.mjs +231 -0
- package/sub-table-plus/style.css +1 -0
- package/swiper/index.mjs +18 -38
- package/swiper/style.css +1 -1
- package/tab/index.mjs +1 -1
- package/tab/style.css +1 -1
- package/tab-item/index.mjs +2 -2
- package/table-column/index.mjs +166 -37
- package/table-column/style.css +1 -0
- package/table-view/index.mjs +177 -132
- package/table-view/style.css +1 -1
- package/tabs-view/index.mjs +104 -0
- package/tabs-view/style.css +1 -0
- package/tag-render/index.mjs +13 -24
- package/toolbar/index.mjs +115 -58
- package/toolbar/style.css +1 -1
- package/toolbar-button/index.mjs +92 -48
- package/vue-cron/index.mjs +47 -65
- package/vue-qr-code/index.mjs +14 -32
- package/vue-quill-editor/index.mjs +13 -24
- package/vue-tags-input/index.mjs +10 -21
- package/vue-tree-select/index.mjs +352 -393
- package/vue-tree-select/style.css +1 -1
- package/vue-video-player/index.mjs +34 -63
- package/watermark/index.mjs +21 -31
- package/web-types.json +9240 -3840
- package/x-input-tag/index.mjs +29 -61
- package/chunks/confirmable-mixin.D4LAArE5.mjs +0 -114
- package/chunks/form-input-mixin.BkKiqJhi.mjs +0 -24
- package/chunks/form-item-mixin.CG4ZwzMC.mjs +0 -140
- package/chunks/input-number-mixin.CzjtGf2n.mjs +0 -60
- package/chunks/utilSelf.CRqpl0Cz.mjs +0 -56
- package/toolbar-button/style.css +0 -1
- /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
|
|
2
|
-
import { NOOP as
|
|
3
|
-
import f from "../
|
|
4
|
-
import "../
|
|
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-
|
|
9
|
+
icon: "el-icon-arrow-left"
|
|
10
10
|
},
|
|
11
11
|
cancel: {
|
|
12
12
|
label: "取消",
|
|
13
|
-
icon: "
|
|
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: "
|
|
23
|
+
icon: "el-icon-takeaway-box",
|
|
24
|
+
loadable: !0
|
|
24
25
|
},
|
|
25
26
|
withdraw: {
|
|
26
|
-
label: "
|
|
27
|
+
label: "提取",
|
|
27
28
|
type: "primary",
|
|
28
|
-
icon: "
|
|
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: "
|
|
39
|
+
icon: "el-icon-s-promotion"
|
|
39
40
|
},
|
|
40
41
|
publish: {
|
|
41
42
|
label: "发布",
|
|
42
43
|
type: "primary",
|
|
43
|
-
icon: "
|
|
44
|
+
icon: "el-icon-s-promotion"
|
|
44
45
|
},
|
|
45
46
|
agree: {
|
|
46
47
|
label: "同意",
|
|
47
48
|
type: "primary",
|
|
48
|
-
icon: "
|
|
49
|
+
icon: "el-icon-check"
|
|
49
50
|
},
|
|
50
51
|
disagree: {
|
|
51
52
|
label: "不同意",
|
|
52
53
|
type: "primary",
|
|
53
|
-
icon: "
|
|
54
|
+
icon: "el-icon-close"
|
|
54
55
|
},
|
|
55
56
|
reject: {
|
|
56
57
|
label: "退回",
|
|
57
58
|
type: "primary",
|
|
58
|
-
icon: "
|
|
59
|
+
icon: "el-icon-s-release"
|
|
59
60
|
},
|
|
60
61
|
finish: {
|
|
61
62
|
label: "完成",
|
|
62
63
|
type: "primary",
|
|
63
|
-
icon: "
|
|
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
|
-
|
|
93
|
-
|
|
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
|
-
},
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
144
|
+
label: n,
|
|
139
145
|
icon: o,
|
|
140
|
-
type:
|
|
141
|
-
separateLine:
|
|
146
|
+
type: a,
|
|
147
|
+
separateLine: s = !0,
|
|
148
|
+
loadable: t,
|
|
149
|
+
circle: l,
|
|
150
|
+
onClick: c,
|
|
151
|
+
title: i
|
|
142
152
|
}) {
|
|
143
|
-
var
|
|
153
|
+
var b;
|
|
144
154
|
let r;
|
|
145
|
-
const
|
|
146
|
-
return ["back", "cancel"].includes(e) ? r = this.goBack : r = (
|
|
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":
|
|
158
|
+
"separate-line": s,
|
|
149
159
|
icon: o,
|
|
150
|
-
|
|
160
|
+
title: i,
|
|
161
|
+
label: p,
|
|
162
|
+
loadable: t,
|
|
163
|
+
circle: l,
|
|
151
164
|
footer: this.footer,
|
|
152
|
-
type:
|
|
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
|
|
173
|
+
var a, s;
|
|
161
174
|
const {
|
|
162
175
|
createButton: e
|
|
163
|
-
} = this
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
}))
|
|
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,
|
|
175
|
-
|
|
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 ?
|
|
233
|
+
return this.footer ? u("div", {
|
|
186
234
|
class: "footer-bar"
|
|
187
|
-
}, [this.getLeftButtons()]) :
|
|
235
|
+
}, [this.getLeftButtons()]) : u("div", {
|
|
188
236
|
class: "toolbar"
|
|
189
|
-
}, [
|
|
237
|
+
}, [u("div", {
|
|
190
238
|
class: "toolbar-left"
|
|
191
|
-
}, [this.getLeftButtons()]),
|
|
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
|
-
|
|
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
|
|
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}
|
package/toolbar-button/index.mjs
CHANGED
|
@@ -1,77 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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(
|
|
50
|
-
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
if (
|
|
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
|
-
|
|
56
|
-
|
|
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 = !
|
|
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
|
|
64
|
-
var
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
118
|
+
const g = f.exports;
|
|
75
119
|
export {
|
|
76
|
-
|
|
120
|
+
g as default
|
|
77
121
|
};
|