@web-utils/component 2.70.0 → 3.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.
- package/address-input/index.mjs +16 -14
- package/awesome-button/index.mjs +30 -29
- package/card/index.mjs +42 -40
- package/carousel/index.mjs +27 -25
- package/chat/index.mjs +70 -59
- package/chunk-file-uploader/index.mjs +594 -35
- package/chunk-file-uploader/style.css +1 -1
- package/chunks/CountUp.f1a19f35.mjs +124 -0
- package/chunks/CountUp.vue_vue_type_template_lang.1f68c96e.mjs +8 -0
- package/chunks/EasyPopup.vue_vue_type_style_index_0_lang.89350bda.mjs +32 -0
- package/chunks/EditableTree.vue_vue_type_style_index_0_lang.5dba9f89.mjs +356 -0
- package/chunks/ElementDialog.d8f3105c.mjs +211 -0
- package/chunks/ElementDialog.vue_vue_type_style_index_0_lang.57cb8e07.mjs +95 -0
- package/chunks/EmptyView.e2430422.mjs +51 -0
- package/chunks/EmptyView.vue_vue_type_style_index_0_lang.ffa84770.mjs +23 -0
- package/chunks/FlowNode.vue_vue_type_template_lang.662bdcfa.mjs +37 -0
- package/chunks/FormInput.vue_vue_type_template_lang.3cb79386.mjs +65 -0
- package/chunks/FormItem.2920ac0c.mjs +45 -0
- package/chunks/FormItem.vue_vue_type_style_index_0_lang.970bd712.mjs +258 -0
- package/chunks/FormItemGroup.41daddb6.mjs +64 -0
- package/chunks/FormItemGroup.vue_vue_type_style_index_0_lang.b588a8ea.mjs +155 -0
- package/chunks/FyCurd.8acd2983.mjs +548 -0
- package/chunks/FyCurd.vue_vue_type_style_index_0_lang.4fbd4b30.mjs +2945 -0
- package/chunks/FyDate.vue_vue_type_style_index_0_lang.429c03e3.mjs +47 -0
- package/chunks/FyDynamic.vue_vue_type_style_index_0_lang.304417ce.mjs +151 -0
- package/chunks/FyEmpty.vue_vue_type_style_index_0_lang.fc8bd24c.mjs +22 -0
- package/chunks/FyForm.0294e494.mjs +439 -0
- package/chunks/FyForm.vue_vue_type_style_index_0_lang.6e64daee.mjs +737 -0
- package/chunks/FyInput.vue_vue_type_template_lang.d2c56811.mjs +93 -0
- package/chunks/FyInputColor.vue_vue_type_template_lang.6eca0ddd.mjs +56 -0
- package/chunks/FyInputIcon.vue_vue_type_style_index_0_lang.11a6a221.mjs +158 -0
- package/chunks/FyRate.vue_vue_type_style_index_0_lang.82174185.mjs +39 -0
- package/chunks/FySelect.vue_vue_type_style_index_0_lang.5f0f3244.mjs +102 -0
- package/chunks/FyTabs.vue_vue_type_template_lang.66af5ac9.mjs +41 -0
- package/chunks/HighlightJS.vue_vue_type_style_index_0_lang.fefeaa3b.mjs +15 -0
- package/chunks/IconTemp.42c48e1f.mjs +32 -0
- package/chunks/IconTemp.vue_vue_type_style_index_0_lang.a0777b31.mjs +23 -0
- package/chunks/InputNumber.vue_vue_type_style_index_0_lang.18046bd3.mjs +172 -0
- package/chunks/LoadingView.vue_vue_type_style_index_0_lang.4c3fff2a.mjs +23 -0
- package/chunks/NavBar.vue_vue_type_style_index_0_lang.e21b57f3.mjs +21 -0
- package/chunks/Page.81f4b8d9.mjs +32 -0
- package/chunks/Page.vue_vue_type_style_index_0_lang.cb4f9bf2.mjs +13 -0
- package/chunks/PageHeader.vue_vue_type_style_index_0_lang.3bcca5aa.mjs +26 -0
- package/chunks/PageSkeleton.vue_vue_type_style_index_0_lang.8621381f.mjs +88 -0
- package/chunks/PageableTable.333cbdc1.mjs +335 -0
- package/chunks/PageableTable.vue_vue_type_style_index_0_lang.fd89fb43.mjs +148 -0
- package/chunks/ResizeObserver.60f728f0.mjs +54 -0
- package/chunks/ResizeObserver.vue_vue_type_style_index_0_lang.7079029c.mjs +13 -0
- package/chunks/TableColumn.8503272e.mjs +106 -0
- package/chunks/Toolbar.5c539dbb.mjs +24 -0
- package/chunks/Toolbar.vue_vue_type_style_index_0_lang.7594243c.mjs +275 -0
- package/chunks/ToolbarButton.vue_vue_type_style_index_0_lang.e2cb14ba.mjs +31 -0
- package/chunks/XInputTag.vue_vue_type_style_index_0_lang.7ad045b3.mjs +74 -0
- package/chunks/confirmable-mixin.26e1d0e0.mjs +197 -0
- package/chunks/{dataformat.f995e2f9.mjs → dataformat.816df805.mjs} +5 -5
- package/chunks/{dic.eaac0823.mjs → dic.3b4ba802.mjs} +40 -40
- package/chunks/{event.b5d855dd.mjs → event.4377230d.mjs} +2 -2
- package/chunks/{index.57f871af.mjs → index.d91bd77a.mjs} +7 -7
- package/chunks/{init.47f219b4.mjs → init.f0a03127.mjs} +2 -2
- package/chunks/{util.ae730cde.mjs → util.7844e2c2.mjs} +21 -21
- package/color-picker/index.mjs +200 -32
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/count-up/index.mjs +14 -17
- package/data-box/index.mjs +36 -33
- package/data-card/index.mjs +35 -33
- package/data-cardtext/index.mjs +29 -27
- package/data-display/index.mjs +37 -34
- package/data-icons/index.mjs +32 -29
- package/data-imgtext/index.mjs +30 -27
- package/data-operatext/index.mjs +41 -39
- package/data-panel/index.mjs +39 -36
- package/data-pay/index.mjs +26 -22
- package/data-price/index.mjs +34 -32
- package/data-progress/index.mjs +32 -28
- package/data-rotate/index.mjs +38 -35
- package/data-table-picker/index.mjs +25 -22
- package/data-tabs/index.mjs +35 -32
- package/dialog-form/index.mjs +41 -32
- package/dynamic-table/index.mjs +47 -42
- package/easy-popup/index.mjs +29 -56
- package/editable-progress/index.mjs +16 -14
- package/editable-tree/index.mjs +129 -476
- package/egd-collapse-item/index.mjs +1 -2
- package/element-dialog/index.mjs +37 -126
- package/empty-view/index.mjs +13 -31
- package/flex-column/index.mjs +1 -1
- package/flex-item/index.mjs +1 -1
- package/flex-row/index.mjs +1 -1
- package/flow/index.mjs +105 -40
- package/flow-designer/index.mjs +1190 -1114
- package/flow-node/index.mjs +15 -47
- package/flow-viewer/index.mjs +167 -78
- package/form-block/index.mjs +24 -22
- package/form-cascader/index.mjs +29 -29
- package/form-checkbox-group/index.mjs +76 -31
- package/form-date-picker/index.mjs +21 -20
- package/form-holder/index.mjs +16 -15
- package/form-input/index.mjs +30 -88
- package/form-input-email/index.mjs +28 -28
- package/form-input-id-card/index.mjs +37 -37
- package/form-input-number/index.mjs +219 -59
- package/form-input-phone-number/index.mjs +25 -25
- package/form-input-tag/index.mjs +160 -38
- package/form-input-time/index.mjs +23 -23
- package/form-item/index.mjs +15 -144
- package/form-item-group/index.mjs +15 -163
- package/form-radio-group/index.mjs +39 -38
- package/form-select/index.mjs +33 -32
- package/form-switch/index.mjs +26 -26
- package/form-textarea/index.mjs +26 -26
- package/form-view/index.mjs +46 -42
- package/fy-array/index.mjs +65 -61
- package/fy-cascader/index.mjs +14 -13
- package/fy-checkbox/index.mjs +37 -32
- package/fy-code/index.mjs +11 -14
- package/fy-curd/index.mjs +206 -2795
- package/fy-date/index.mjs +16 -57
- package/fy-draggable/index.mjs +21 -20
- package/fy-dynamic/index.mjs +64 -207
- package/fy-empty/index.mjs +12 -29
- package/fy-form/index.mjs +178 -732
- package/fy-form-design/index.mjs +1738 -1179
- package/fy-input/index.mjs +15 -101
- package/fy-input-color/index.mjs +17 -66
- package/fy-input-icon/index.mjs +21 -116
- package/fy-input-map/index.mjs +27 -24
- package/fy-input-number/index.mjs +23 -22
- package/fy-input-table/index.mjs +22 -18
- package/fy-input-tree/index.mjs +32 -28
- package/fy-progress/index.mjs +24 -23
- package/fy-radio/index.mjs +23 -18
- package/fy-rate/index.mjs +16 -49
- package/fy-select/index.mjs +29 -122
- package/fy-slider/index.mjs +18 -17
- package/fy-switch/index.mjs +21 -20
- package/fy-tabs/index.mjs +14 -48
- package/fy-time/index.mjs +20 -14
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +26 -20
- package/fy-u-editor/index.mjs +1 -1
- package/fy-upload/index.mjs +76 -74
- package/guide-steps/index.mjs +24 -22
- package/highlight-j-s/index.mjs +19 -29
- package/icon-temp/index.mjs +12 -30
- package/iframe-window/index.mjs +19 -18
- package/image-cropper/index.mjs +53 -51
- package/image-preview/index.mjs +27 -25
- package/input-number/index.mjs +63 -172
- package/input-number-range/index.mjs +24 -23
- package/license/index.mjs +1 -1
- package/loading-view/index.mjs +15 -33
- package/login/index.mjs +40 -35
- package/nav-bar/index.mjs +15 -30
- package/notice/index.mjs +19 -18
- package/package.json +1 -1
- package/page/index.mjs +12 -20
- package/page-header/index.mjs +13 -34
- package/page-index/index.mjs +34 -33
- package/page-index-top/index.mjs +100 -51
- package/page-skeleton/index.mjs +18 -35
- package/page-skeleton-new/index.mjs +16 -15
- package/pageable-table/index.mjs +85 -223
- package/pageable-view/index.mjs +34 -33
- package/present-view/index.mjs +75 -71
- package/record-video/index.mjs +1 -1
- package/resize-observer/index.mjs +21 -29
- package/search/index.mjs +29 -27
- package/search-popover/index.mjs +1 -1
- package/sign/index.mjs +1 -1
- package/split-pane/index.mjs +40 -45
- package/static-pageable-table/index.mjs +20 -18
- package/swiper/index.mjs +27 -25
- package/table-view/index.mjs +627 -89
- package/tag-render/index.mjs +21 -19
- package/text-ellipsis/index.mjs +13 -12
- package/tinymce-editor/index.mjs +73 -72
- package/toolbar/index.mjs +15 -208
- package/toolbar-button/index.mjs +32 -57
- package/verify/index.mjs +1 -1
- package/vue-cron/index.mjs +112 -104
- package/watermark/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +51 -117
- package/chunks/FormTemp.7f91629d.mjs +0 -165
- package/chunks/confirmable-mixin.817b542f.mjs +0 -116
- package/chunks/form-input-mixin.4632ad36.mjs +0 -24
- package/chunks/form-item-mixin.ad148e7b.mjs +0 -140
- package/chunks/input-number-mixin.41a066be.mjs +0 -60
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
import { p as C } from "./packages.1fc9ccba.mjs";
|
|
2
|
+
import { p as w } from "./permission.ce5d2121.mjs";
|
|
3
|
+
import { i as y } from "./init.f0a03127.mjs";
|
|
4
|
+
import { s as S, r as L, D as O, a as D, b as E, F as v, T as I, C as H, c as P, d as _, H as R, e as k, f as u } from "./FyCurd.vue_vue_type_style_index_0_lang.4fbd4b30.mjs";
|
|
5
|
+
import { a as A, t as M, f as T } from "./dataformat.816df805.mjs";
|
|
6
|
+
import { D as f, s as K, o as $, d as n } from "./util.7844e2c2.mjs";
|
|
7
|
+
import { isBlank as b } from "@web-utils/core";
|
|
8
|
+
import { n as N } from "./vueComponentNormalizer.446f5dc4.mjs";
|
|
9
|
+
const j = {
|
|
10
|
+
name: "FyCurd",
|
|
11
|
+
components: {
|
|
12
|
+
DialogFilter: O,
|
|
13
|
+
DialogExcel: D,
|
|
14
|
+
DialogColumn: E,
|
|
15
|
+
FyDialogForm: v,
|
|
16
|
+
TablePage: I,
|
|
17
|
+
ColumnMenu: H,
|
|
18
|
+
ColumnDefault: P,
|
|
19
|
+
Column: _,
|
|
20
|
+
HeaderMenu: R,
|
|
21
|
+
HeaderSearch: k
|
|
22
|
+
},
|
|
23
|
+
directives: {
|
|
24
|
+
permission: w
|
|
25
|
+
},
|
|
26
|
+
mixins: [y],
|
|
27
|
+
provide() {
|
|
28
|
+
return {
|
|
29
|
+
crud: this
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
spanMethod: Function,
|
|
34
|
+
summaryMethod: Function,
|
|
35
|
+
rowStyle: Function,
|
|
36
|
+
cellStyle: Function,
|
|
37
|
+
beforeClose: Function,
|
|
38
|
+
beforeOpen: Function,
|
|
39
|
+
rowClassName: Function,
|
|
40
|
+
cellClassName: Function,
|
|
41
|
+
headerCellClassName: Function,
|
|
42
|
+
uploadBefore: Function,
|
|
43
|
+
uploadAfter: Function,
|
|
44
|
+
uploadDelete: Function,
|
|
45
|
+
uploadPreview: Function,
|
|
46
|
+
uploadError: Function,
|
|
47
|
+
uploadExceed: Function,
|
|
48
|
+
permission: {
|
|
49
|
+
type: [Function, Object],
|
|
50
|
+
default: () => ({})
|
|
51
|
+
},
|
|
52
|
+
value: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => ({})
|
|
55
|
+
},
|
|
56
|
+
search: {
|
|
57
|
+
type: Object,
|
|
58
|
+
default() {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
page: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default() {
|
|
65
|
+
return {};
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
tableLoading: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !1
|
|
71
|
+
},
|
|
72
|
+
disabled: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
data: {
|
|
77
|
+
type: Array,
|
|
78
|
+
required: !0,
|
|
79
|
+
default: () => []
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
data() {
|
|
83
|
+
return {
|
|
84
|
+
reload: Math.random(),
|
|
85
|
+
cellForm: {
|
|
86
|
+
list: []
|
|
87
|
+
},
|
|
88
|
+
config: u,
|
|
89
|
+
list: [],
|
|
90
|
+
listError: {},
|
|
91
|
+
tableForm: {},
|
|
92
|
+
tableHeight: void 0,
|
|
93
|
+
tableIndex: -1,
|
|
94
|
+
tableSelect: [],
|
|
95
|
+
sumsList: {},
|
|
96
|
+
cascaderIndexList: [],
|
|
97
|
+
cascaderDicList: {},
|
|
98
|
+
cascaderFormList: {},
|
|
99
|
+
btnDisabledList: {},
|
|
100
|
+
btnDisabled: !1,
|
|
101
|
+
default: {}
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
computed: {
|
|
105
|
+
isHeightAuto() {
|
|
106
|
+
return this.tableOption.height === "auto";
|
|
107
|
+
},
|
|
108
|
+
isSortable() {
|
|
109
|
+
return this.tableOption.sortable;
|
|
110
|
+
},
|
|
111
|
+
isRowSort() {
|
|
112
|
+
return this.tableOption.rowSort;
|
|
113
|
+
},
|
|
114
|
+
isColumnSort() {
|
|
115
|
+
return this.tableOption.columnSort;
|
|
116
|
+
},
|
|
117
|
+
rowParentKey() {
|
|
118
|
+
return this.option.rowParentKey || f.rowParentKey;
|
|
119
|
+
},
|
|
120
|
+
childrenKey() {
|
|
121
|
+
return this.treeProps.children || f.children;
|
|
122
|
+
},
|
|
123
|
+
hasChildrenKey() {
|
|
124
|
+
return this.treeProps.hasChildren || f.hasChildren;
|
|
125
|
+
},
|
|
126
|
+
treeProps() {
|
|
127
|
+
return this.tableOption.treeProps || {};
|
|
128
|
+
},
|
|
129
|
+
isAutoHeight() {
|
|
130
|
+
return this.tableOption.height === "auto";
|
|
131
|
+
},
|
|
132
|
+
formSlot() {
|
|
133
|
+
return this.getSlotList(["Error", "Label", "Type", "Form"], this.$scopedSlots, this.propOption);
|
|
134
|
+
},
|
|
135
|
+
searchSlot() {
|
|
136
|
+
return this.getSlotList(["Search"], this.$scopedSlots, this.propOption);
|
|
137
|
+
},
|
|
138
|
+
mainSlot() {
|
|
139
|
+
const t = [];
|
|
140
|
+
return this.propOption.forEach((e) => {
|
|
141
|
+
this.$scopedSlots[e.prop] && t.push(e.prop);
|
|
142
|
+
}), this.getSlotList(["Header", "Form"], this.$scopedSlots, this.propOption).concat(t);
|
|
143
|
+
},
|
|
144
|
+
calcHeight() {
|
|
145
|
+
return (this.tableOption.calcHeight || 0) + this.$AVUE.calcHeight;
|
|
146
|
+
},
|
|
147
|
+
propOption() {
|
|
148
|
+
let t = [];
|
|
149
|
+
function e(s = []) {
|
|
150
|
+
Array.isArray(s) && s.forEach((i) => {
|
|
151
|
+
Array.isArray(i.children) ? e(i.children) : t.push(i);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return e(this.columnOption), t = A(t), t;
|
|
155
|
+
},
|
|
156
|
+
isShowSummary() {
|
|
157
|
+
return this.option.showSummary;
|
|
158
|
+
},
|
|
159
|
+
isHeader() {
|
|
160
|
+
let t = !1;
|
|
161
|
+
return this.columnOption.forEach((e) => {
|
|
162
|
+
e.children && (t = !0);
|
|
163
|
+
}), t;
|
|
164
|
+
},
|
|
165
|
+
isTree() {
|
|
166
|
+
let t = !1;
|
|
167
|
+
return this.data.forEach((e) => {
|
|
168
|
+
e.children && (t = !0);
|
|
169
|
+
}), t;
|
|
170
|
+
},
|
|
171
|
+
isCard() {
|
|
172
|
+
return this.option.card ? "always" : "never";
|
|
173
|
+
},
|
|
174
|
+
expandLevel() {
|
|
175
|
+
return this.parentOption.expandLevel || 0;
|
|
176
|
+
},
|
|
177
|
+
expandAll() {
|
|
178
|
+
return this.parentOption.expandAll || !1;
|
|
179
|
+
},
|
|
180
|
+
parentOption() {
|
|
181
|
+
return this.tableOption || {};
|
|
182
|
+
},
|
|
183
|
+
columnOption() {
|
|
184
|
+
return this.tableOption.column || [];
|
|
185
|
+
},
|
|
186
|
+
sumColumnList() {
|
|
187
|
+
return this.tableOption.sumColumnList || [];
|
|
188
|
+
},
|
|
189
|
+
selectLen() {
|
|
190
|
+
return this.tableSelect ? this.tableSelect.length : 0;
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
watch: {
|
|
194
|
+
value: {
|
|
195
|
+
handler() {
|
|
196
|
+
this.tableForm = this.value;
|
|
197
|
+
},
|
|
198
|
+
immediate: !0,
|
|
199
|
+
deep: !0
|
|
200
|
+
},
|
|
201
|
+
list: {
|
|
202
|
+
handler() {
|
|
203
|
+
this.cellForm.list = this.list;
|
|
204
|
+
},
|
|
205
|
+
deep: !0
|
|
206
|
+
},
|
|
207
|
+
data: {
|
|
208
|
+
handler() {
|
|
209
|
+
this.dataInit();
|
|
210
|
+
},
|
|
211
|
+
deep: !0
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
mounted() {
|
|
215
|
+
this.dataInit(), this.getTableHeight(), this.refreshTable();
|
|
216
|
+
},
|
|
217
|
+
methods: {
|
|
218
|
+
setPx: K,
|
|
219
|
+
optVal: $,
|
|
220
|
+
handleValidate(t, e, s) {
|
|
221
|
+
this.listError[t] || this.$set(this.listError, t, { valid: !1, msg: "" }), this.listError[t].valid = !e, this.listError[t].msg = s;
|
|
222
|
+
},
|
|
223
|
+
getPermission(t, e, s) {
|
|
224
|
+
return typeof this.permission == "function" ? this.permission(t, e, s) : b(this.permission[t]) ? !0 : this.permission[t];
|
|
225
|
+
},
|
|
226
|
+
getTableHeight() {
|
|
227
|
+
this.isAutoHeight ? this.$nextTick(() => {
|
|
228
|
+
const t = this.$refs.table, e = this.$refs.tablePage;
|
|
229
|
+
if (!t)
|
|
230
|
+
return;
|
|
231
|
+
const s = t.$el, i = e.$el.offsetHeight || 20;
|
|
232
|
+
this.tableHeight = document.documentElement.clientHeight - s.offsetTop - i - this.calcHeight;
|
|
233
|
+
}) : this.tableHeight = this.tableOption.height;
|
|
234
|
+
},
|
|
235
|
+
doLayout() {
|
|
236
|
+
this.$refs.table.doLayout();
|
|
237
|
+
},
|
|
238
|
+
refreshTable(t) {
|
|
239
|
+
this.reload = Math.random(), this.$nextTick(() => {
|
|
240
|
+
t && t();
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
// 树懒加载
|
|
244
|
+
treeLoad(t, e, s) {
|
|
245
|
+
this.$emit("tree-load", t, e, (i) => {
|
|
246
|
+
t.children = i, s(i);
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
menuIcon(t) {
|
|
250
|
+
return $(this.tableOption[`${t}Text`], M(`crud.${t}`));
|
|
251
|
+
},
|
|
252
|
+
getBtnIcon(t) {
|
|
253
|
+
const e = `${t}Icon`;
|
|
254
|
+
return this.tableOption[e] || u[e];
|
|
255
|
+
},
|
|
256
|
+
// 对部分表单字段进行校验的方法
|
|
257
|
+
validateField(t) {
|
|
258
|
+
return this.$refs.dialogForm.$refs.tableForm.validateField(t);
|
|
259
|
+
},
|
|
260
|
+
selectClear() {
|
|
261
|
+
this.$emit("selection-clear", n(this.tableSelect)), this.$refs.table.clearSelection();
|
|
262
|
+
},
|
|
263
|
+
toggleRowSelection(t, e) {
|
|
264
|
+
this.$refs.table.toggleRowSelection(t, e);
|
|
265
|
+
},
|
|
266
|
+
toggleRowExpansion(t, e) {
|
|
267
|
+
this.$refs.table.toggleRowExpansion(t, e);
|
|
268
|
+
},
|
|
269
|
+
setCurrentRow(t) {
|
|
270
|
+
this.$refs.table.setCurrentRow(t);
|
|
271
|
+
},
|
|
272
|
+
dataInit() {
|
|
273
|
+
this.list = this.data, this.list.forEach((t, e) => {
|
|
274
|
+
t.$cellEdit && !this.cascaderFormList[e] && (this.cascaderFormList[e] = n(t)), this.$set(t, "$cellEdit", t.$cellEdit || !1), this.$set(t, "$index", e);
|
|
275
|
+
});
|
|
276
|
+
},
|
|
277
|
+
// 拖动表头事件
|
|
278
|
+
headerDragend(t, e, s, i) {
|
|
279
|
+
this.objectOption[s.property] && this.$set(this.objectOption[s.property], "width", t), this.$emit("header-dragend", t, e, s, i);
|
|
280
|
+
},
|
|
281
|
+
headerSort(t, e) {
|
|
282
|
+
const s = this.columnOption, i = s.splice(t, 1)[0];
|
|
283
|
+
s.splice(e, 0, i), this.refreshTable();
|
|
284
|
+
},
|
|
285
|
+
// 清除过滤器执行函数
|
|
286
|
+
clearFilter(t) {
|
|
287
|
+
this.$refs.table.clearFilter(t);
|
|
288
|
+
},
|
|
289
|
+
// 展开或则关闭
|
|
290
|
+
expandChange(t, e) {
|
|
291
|
+
this.$emit("expand-change", t, e);
|
|
292
|
+
},
|
|
293
|
+
// 设置单选
|
|
294
|
+
currentRowChange(t, e) {
|
|
295
|
+
this.$emit("current-row-change", t, e);
|
|
296
|
+
},
|
|
297
|
+
// 刷新事件
|
|
298
|
+
refreshChange() {
|
|
299
|
+
this.$emit("refresh-change");
|
|
300
|
+
},
|
|
301
|
+
// 选中实例
|
|
302
|
+
toggleSelection(t) {
|
|
303
|
+
t ? t.forEach((e) => {
|
|
304
|
+
this.$refs.table.toggleRowSelection(e);
|
|
305
|
+
}) : this.$refs.table.clearSelection();
|
|
306
|
+
},
|
|
307
|
+
// 选择回调
|
|
308
|
+
selectionChange(t) {
|
|
309
|
+
this.tableSelect = t, this.$emit("selection-change", this.tableSelect);
|
|
310
|
+
},
|
|
311
|
+
// 单个选择回调
|
|
312
|
+
select(t, e) {
|
|
313
|
+
this.$emit("select", t, e);
|
|
314
|
+
},
|
|
315
|
+
// 点击勾选全选 Checkbox
|
|
316
|
+
selectAll(t) {
|
|
317
|
+
this.$emit("select-all", t);
|
|
318
|
+
},
|
|
319
|
+
// 筛选回调用
|
|
320
|
+
filterChange(t) {
|
|
321
|
+
this.$emit("filter-change", t);
|
|
322
|
+
},
|
|
323
|
+
// 排序回调
|
|
324
|
+
sortChange(t) {
|
|
325
|
+
this.$emit("sort-change", t);
|
|
326
|
+
},
|
|
327
|
+
// 行双击
|
|
328
|
+
rowDblclick(t, e) {
|
|
329
|
+
this.$emit("row-dblclick", t, e);
|
|
330
|
+
},
|
|
331
|
+
// 行单机
|
|
332
|
+
rowClick(t, e, s) {
|
|
333
|
+
this.$emit("row-click", t, e, s);
|
|
334
|
+
},
|
|
335
|
+
// 清空排序
|
|
336
|
+
clearSort() {
|
|
337
|
+
this.$refs.table.clearSort();
|
|
338
|
+
},
|
|
339
|
+
// 当单元格 hover 进入时会触发该事件
|
|
340
|
+
cellMouseEnter(t, e, s, i) {
|
|
341
|
+
this.$emit("cell-mouse-enter", t, e, s, i);
|
|
342
|
+
},
|
|
343
|
+
// 当单元格 hover 退出时会触发该事件
|
|
344
|
+
cellMouseLeave(t, e, s, i) {
|
|
345
|
+
this.$emit("cell-mouse-leave", t, e, s, i);
|
|
346
|
+
},
|
|
347
|
+
// 当某个单元格被点击时会触发该事件
|
|
348
|
+
cellClick(t, e, s, i) {
|
|
349
|
+
this.$emit("cell-click", t, e, s, i);
|
|
350
|
+
},
|
|
351
|
+
// 当某一列的表头被点击时会触发该事件
|
|
352
|
+
headerClick(t, e) {
|
|
353
|
+
this.$emit("header-click", t, e);
|
|
354
|
+
},
|
|
355
|
+
// 当某一行被鼠标右键点击时会触发该事件
|
|
356
|
+
rowContextmenu(t, e, s) {
|
|
357
|
+
this.$emit("row-contextmenu", t, e, s);
|
|
358
|
+
},
|
|
359
|
+
// 当某一列的表头被鼠标右键点击时触发该事件
|
|
360
|
+
headerContextmenu(t, e) {
|
|
361
|
+
this.$emit("header-contextmenu", t, e);
|
|
362
|
+
},
|
|
363
|
+
// 当某个单元格被双击击时会触发该事件
|
|
364
|
+
cellDblclick(t, e, s, i) {
|
|
365
|
+
this.$emit("cell-dblclick", t, e, s, i);
|
|
366
|
+
},
|
|
367
|
+
// 单元格新增
|
|
368
|
+
rowCellAdd(t = {}) {
|
|
369
|
+
const e = this.list.length, s = T(this.propOption).tableForm;
|
|
370
|
+
t = n(
|
|
371
|
+
Object.assign(
|
|
372
|
+
{
|
|
373
|
+
$cellEdit: !0,
|
|
374
|
+
$index: e
|
|
375
|
+
},
|
|
376
|
+
s,
|
|
377
|
+
t
|
|
378
|
+
)
|
|
379
|
+
), this.list.push(t);
|
|
380
|
+
},
|
|
381
|
+
// 行取消
|
|
382
|
+
rowCancel(t, e) {
|
|
383
|
+
b(t[this.rowKey]) ? (this.list.splice(e, 1), delete this.cascaderDIC[e]) : (this.cascaderFormList[e].$cellEdit = !1, this.$set(this.cascaderDIC, e, this.cascaderDicList[e]), this.$set(this.list, e, this.cascaderFormList[e])), delete this.cascaderDicList[e], delete this.cascaderFormList[e], this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(e), 1);
|
|
384
|
+
},
|
|
385
|
+
// 行编辑点击
|
|
386
|
+
rowCell(t, e) {
|
|
387
|
+
t.$cellEdit ? this.rowCellUpdate(t, e) : this.rowCellEdit(t, e);
|
|
388
|
+
},
|
|
389
|
+
rowCellUpdate(t, e) {
|
|
390
|
+
t = n(t);
|
|
391
|
+
const s = this.validateCellField(e), i = () => {
|
|
392
|
+
this.btnDisabledList[e] = !1, this.btnDisabled = !1, this.list[e].$cellEdit = !1, this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(e), 1), delete this.cascaderFormList[e];
|
|
393
|
+
}, r = () => {
|
|
394
|
+
this.btnDisabledList[e] = !1, this.btnDisabled = !1;
|
|
395
|
+
};
|
|
396
|
+
s && (this.btnDisabledList[e] = !0, this.btnDisabled = !0, b(t[this.rowKey]) ? this.$emit("row-save", t, i, r) : this.$emit("row-update", t, e, i, r));
|
|
397
|
+
},
|
|
398
|
+
// 单元格编辑
|
|
399
|
+
rowCellEdit(t, e) {
|
|
400
|
+
t.$cellEdit = !0, this.cascaderFormList[e] = n(t), this.cascaderDicList[e] = n(this.cascaderDIC[e]);
|
|
401
|
+
},
|
|
402
|
+
// 对部分表单字段进行校验
|
|
403
|
+
validateCellForm() {
|
|
404
|
+
return new Promise((t) => {
|
|
405
|
+
this.$refs.cellForm.validate((e, s) => {
|
|
406
|
+
t(s);
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
},
|
|
410
|
+
validateCellField(t) {
|
|
411
|
+
let e = !0;
|
|
412
|
+
for (const s of this.$refs.cellForm.fields)
|
|
413
|
+
if (s.prop.split(".")[1] === `${t}` && this.$refs.cellForm.validateField(s.prop, (i) => {
|
|
414
|
+
i && (e = !1);
|
|
415
|
+
}), !e)
|
|
416
|
+
break;
|
|
417
|
+
return e;
|
|
418
|
+
},
|
|
419
|
+
rowAdd() {
|
|
420
|
+
this.$refs.dialogForm.show("add");
|
|
421
|
+
},
|
|
422
|
+
rowSave() {
|
|
423
|
+
return this.$refs.dialogForm.$refs.tableForm.submit();
|
|
424
|
+
},
|
|
425
|
+
rowUpdate() {
|
|
426
|
+
return this.$refs.dialogForm.$refs.tableForm.submit();
|
|
427
|
+
},
|
|
428
|
+
closeDialog() {
|
|
429
|
+
return this.$refs.dialogForm.closeDialog();
|
|
430
|
+
},
|
|
431
|
+
getPropRef(t) {
|
|
432
|
+
return this.$refs.dialogForm.$refs.tableForm.getPropRef(t);
|
|
433
|
+
},
|
|
434
|
+
setVal() {
|
|
435
|
+
this.$emit("input", this.tableForm), this.$emit("change", this.tableForm);
|
|
436
|
+
},
|
|
437
|
+
// 编辑
|
|
438
|
+
rowEdit(t, e) {
|
|
439
|
+
this.tableForm = n(t), this.tableIndex = e, this.setVal(), this.$refs.dialogForm.show("edit");
|
|
440
|
+
},
|
|
441
|
+
// 复制
|
|
442
|
+
rowCopy(t) {
|
|
443
|
+
this.tableForm = n(t), delete this.tableForm[this.rowKey], this.tableIndex = -1, this.setVal(), this.$refs.dialogForm.show("add");
|
|
444
|
+
},
|
|
445
|
+
// 查看
|
|
446
|
+
rowView(t, e) {
|
|
447
|
+
this.tableForm = n(t), this.tableIndex = e, this.setVal(), this.$refs.dialogForm.show("view");
|
|
448
|
+
},
|
|
449
|
+
// 删除
|
|
450
|
+
rowDel(t, e) {
|
|
451
|
+
this.$emit("row-del", t, e, () => {
|
|
452
|
+
const { parentList: s, index: i } = this.findData(t[this.rowKey]);
|
|
453
|
+
s && s.splice(i, 1);
|
|
454
|
+
});
|
|
455
|
+
},
|
|
456
|
+
// 合并行
|
|
457
|
+
tableSpanMethod(t) {
|
|
458
|
+
if (typeof this.spanMethod == "function")
|
|
459
|
+
return this.spanMethod(t);
|
|
460
|
+
},
|
|
461
|
+
// 合集统计逻辑
|
|
462
|
+
tableSummaryMethod(t) {
|
|
463
|
+
const e = {};
|
|
464
|
+
if (typeof this.summaryMethod == "function")
|
|
465
|
+
return this.summaryMethod(t);
|
|
466
|
+
const { columns: s, data: i } = t, r = [];
|
|
467
|
+
return s.length > 0 && s.forEach((a, l) => {
|
|
468
|
+
const c = this.sumColumnList.find((d) => d.name === a.property);
|
|
469
|
+
if (c) {
|
|
470
|
+
const d = c.decimals || 2, m = c.label || "";
|
|
471
|
+
let g = 1;
|
|
472
|
+
switch (c.type) {
|
|
473
|
+
case "count":
|
|
474
|
+
r[l] = m + i.length;
|
|
475
|
+
break;
|
|
476
|
+
case "avg":
|
|
477
|
+
r[l] = i.map((o) => Number(o[a.property])).reduce((o, h) => {
|
|
478
|
+
const p = Number(h);
|
|
479
|
+
return isNaN(p) ? o : (o * (g - 1) + h) / g++;
|
|
480
|
+
}, 0), r[l] = m + r[l].toFixed(d);
|
|
481
|
+
break;
|
|
482
|
+
case "sum":
|
|
483
|
+
r[l] = i.map((o) => Number(o[a.property])).reduce((o, h) => {
|
|
484
|
+
const p = Number(h);
|
|
485
|
+
return isNaN(p) ? o : o + h;
|
|
486
|
+
}, 0), r[l] = m + r[l].toFixed(d);
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
e[a.property] = r[l];
|
|
490
|
+
} else
|
|
491
|
+
r[l] = "";
|
|
492
|
+
}), this.sumsList = e, r;
|
|
493
|
+
},
|
|
494
|
+
tableDrop(t, e, s) {
|
|
495
|
+
if (this.isSortable !== !0) {
|
|
496
|
+
if (t === "row" && !this.isRowSort)
|
|
497
|
+
return;
|
|
498
|
+
if (t === "column" && !this.isColumnSort)
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (!window.Sortable) {
|
|
502
|
+
C.logs("Sortable");
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
window.Sortable.create(e, {
|
|
506
|
+
ghostClass: u.ghostClass,
|
|
507
|
+
chosenClass: u.ghostClass,
|
|
508
|
+
animation: 500,
|
|
509
|
+
delay: 0,
|
|
510
|
+
onEnd: (i) => s(i)
|
|
511
|
+
});
|
|
512
|
+
},
|
|
513
|
+
findData(t) {
|
|
514
|
+
let e = {};
|
|
515
|
+
const s = (i, r) => {
|
|
516
|
+
i.forEach((a, l) => {
|
|
517
|
+
a[this.rowKey] === t && (e = {
|
|
518
|
+
item: a,
|
|
519
|
+
index: l,
|
|
520
|
+
parentList: i,
|
|
521
|
+
parent: r
|
|
522
|
+
}), a[this.childrenKey] && s(a[this.childrenKey], a);
|
|
523
|
+
});
|
|
524
|
+
};
|
|
525
|
+
return s(this.list), e;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}, F = {};
|
|
529
|
+
var x = /* @__PURE__ */ N(
|
|
530
|
+
j,
|
|
531
|
+
L,
|
|
532
|
+
S,
|
|
533
|
+
!1,
|
|
534
|
+
V,
|
|
535
|
+
null,
|
|
536
|
+
null,
|
|
537
|
+
null
|
|
538
|
+
);
|
|
539
|
+
function V(t) {
|
|
540
|
+
for (let e in F)
|
|
541
|
+
this[e] = F[e];
|
|
542
|
+
}
|
|
543
|
+
const Y = /* @__PURE__ */ function() {
|
|
544
|
+
return x.exports;
|
|
545
|
+
}();
|
|
546
|
+
export {
|
|
547
|
+
Y as _
|
|
548
|
+
};
|