@web-utils/component 3.0.2 → 3.0.3
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 +14 -14
- package/chat/index.mjs +39 -40
- package/chunk-file-uploader/index.mjs +35 -594
- package/chunk-file-uploader/style.css +1 -1
- package/chunks/FormTemp.d079292b.mjs +139 -0
- package/chunks/{dataformat.816df805.mjs → dataformat.e655611c.mjs} +6 -6
- package/chunks/detail.d6f8e347.mjs +29 -0
- package/chunks/{dic.3b4ba802.mjs → dic.eaac0823.mjs} +40 -40
- package/chunks/{event.4377230d.mjs → event.10295951.mjs} +2 -2
- package/chunks/form-input-mixin.78a567bc.mjs +24 -0
- package/chunks/form-item-mixin.57cb2019.mjs +140 -0
- package/chunks/{index.d91bd77a.mjs → index.57f871af.mjs} +7 -7
- package/chunks/{init.f0a03127.mjs → init.47f219b4.mjs} +2 -2
- package/chunks/input-number-mixin.41a066be.mjs +60 -0
- package/chunks/{util.7844e2c2.mjs → util.ae730cde.mjs} +21 -21
- package/count-up/index.mjs +17 -14
- package/data-box/index.mjs +18 -19
- package/data-display/index.mjs +17 -18
- package/data-icons/index.mjs +16 -17
- package/data-panel/index.mjs +20 -21
- package/data-pay/index.mjs +15 -16
- package/data-progress/index.mjs +19 -20
- package/data-rotate/index.mjs +35 -36
- package/data-table-picker/index.mjs +23 -25
- package/data-tabs/index.mjs +15 -16
- package/dialog-form/index.mjs +11 -12
- package/dynamic-table/index.mjs +34 -35
- package/easy-popup/index.mjs +56 -29
- package/editable-tree/index.mjs +485 -134
- package/element-dialog/index.mjs +127 -37
- package/empty-view/index.mjs +31 -13
- 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 +40 -105
- package/flow-designer/index.mjs +555 -615
- package/flow-node/index.mjs +47 -15
- package/flow-viewer/index.mjs +78 -167
- package/form-cascader/index.mjs +24 -24
- package/form-checkbox-group/index.mjs +35 -79
- package/form-date-picker/index.mjs +22 -22
- package/form-holder/index.mjs +1 -1
- package/form-input/index.mjs +86 -28
- package/form-input-email/index.mjs +18 -18
- package/form-input-id-card/index.mjs +27 -27
- package/form-input-number/index.mjs +59 -219
- package/form-input-phone-number/index.mjs +27 -27
- package/form-input-tag/index.mjs +38 -160
- package/form-input-time/index.mjs +16 -16
- package/form-item/index.mjs +146 -15
- package/form-item-group/index.mjs +164 -14
- package/form-radio-group/index.mjs +41 -41
- package/form-select/index.mjs +20 -20
- package/form-switch/index.mjs +19 -19
- package/form-textarea/index.mjs +29 -29
- package/form-view/index.mjs +42 -46
- package/fy-array/index.mjs +2 -2
- package/fy-cascader/index.mjs +15 -15
- package/fy-checkbox/index.mjs +1 -1
- package/fy-code/index.mjs +1 -1
- package/fy-curd/index.mjs +2824 -210
- package/fy-date/index.mjs +59 -17
- package/fy-draggable/index.mjs +1 -1
- package/fy-dynamic/index.mjs +208 -64
- package/fy-empty/index.mjs +29 -12
- package/fy-form/index.mjs +743 -178
- package/fy-form-design/index.mjs +1013 -1540
- package/fy-input/index.mjs +105 -17
- package/fy-input-color/index.mjs +67 -16
- package/fy-input-icon/index.mjs +119 -23
- package/fy-input-map/index.mjs +14 -15
- package/fy-input-number/index.mjs +1 -1
- package/fy-input-table/index.mjs +19 -21
- package/fy-input-tree/index.mjs +3 -3
- package/fy-radio/index.mjs +1 -1
- package/fy-rate/index.mjs +50 -16
- package/fy-select/index.mjs +126 -29
- package/fy-slider/index.mjs +2 -2
- package/fy-switch/index.mjs +1 -1
- package/fy-tabs/index.mjs +51 -15
- package/fy-time/index.mjs +1 -1
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +23 -25
- package/fy-u-editor/index.mjs +1 -1
- package/fy-upload/index.mjs +2 -2
- package/highlight-j-s/index.mjs +29 -19
- package/icon-temp/index.mjs +30 -12
- package/iframe-window/index.mjs +18 -19
- package/image-cropper/index.mjs +22 -23
- package/image-preview/index.mjs +1 -1
- package/input-number/index.mjs +173 -63
- package/license/index.mjs +1 -1
- package/loading-view/index.mjs +33 -15
- package/login/index.mjs +1 -1
- package/nav-bar/index.mjs +31 -15
- package/package.json +1 -1
- package/page/index.mjs +20 -12
- package/page-header/index.mjs +34 -13
- package/page-index-top/index.mjs +53 -100
- package/page-skeleton/index.mjs +35 -18
- package/page-skeleton-new/index.mjs +15 -16
- package/pageable-table/index.mjs +228 -86
- package/pageable-view/index.mjs +1 -1
- package/present-view/index.mjs +71 -75
- package/record-video/index.mjs +1 -1
- package/resize-observer/index.mjs +29 -21
- package/search/index.mjs +9 -9
- package/search-popover/index.mjs +1 -1
- package/sign/index.mjs +1 -1
- package/split-pane/index.mjs +45 -40
- package/swiper/index.mjs +13 -14
- package/table-view/index.mjs +97 -631
- package/text-ellipsis/index.mjs +1 -1
- package/tinymce-editor/index.mjs +63 -63
- package/toolbar/index.mjs +208 -15
- package/toolbar-button/index.mjs +56 -30
- package/verify/index.mjs +1 -1
- package/watermark/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +118 -49
- package/chunks/CountUp.f1a19f35.mjs +0 -124
- package/chunks/CountUp.vue_vue_type_template_lang.1f68c96e.mjs +0 -8
- package/chunks/EasyPopup.vue_vue_type_style_index_0_lang.89350bda.mjs +0 -32
- package/chunks/EditableTree.vue_vue_type_style_index_0_lang.5dba9f89.mjs +0 -356
- package/chunks/ElementDialog.d8f3105c.mjs +0 -211
- package/chunks/ElementDialog.vue_vue_type_style_index_0_lang.57cb8e07.mjs +0 -95
- package/chunks/EmptyView.e2430422.mjs +0 -51
- package/chunks/EmptyView.vue_vue_type_style_index_0_lang.ffa84770.mjs +0 -23
- package/chunks/FlowNode.vue_vue_type_template_lang.662bdcfa.mjs +0 -37
- package/chunks/FormInput.vue_vue_type_template_lang.3cb79386.mjs +0 -65
- package/chunks/FormItem.2920ac0c.mjs +0 -45
- package/chunks/FormItem.vue_vue_type_style_index_0_lang.970bd712.mjs +0 -258
- package/chunks/FormItemGroup.41daddb6.mjs +0 -64
- package/chunks/FormItemGroup.vue_vue_type_style_index_0_lang.b588a8ea.mjs +0 -155
- package/chunks/FyCurd.8acd2983.mjs +0 -548
- package/chunks/FyCurd.vue_vue_type_style_index_0_lang.4fbd4b30.mjs +0 -2945
- package/chunks/FyDate.vue_vue_type_style_index_0_lang.429c03e3.mjs +0 -47
- package/chunks/FyDynamic.vue_vue_type_style_index_0_lang.304417ce.mjs +0 -151
- package/chunks/FyEmpty.vue_vue_type_style_index_0_lang.fc8bd24c.mjs +0 -22
- package/chunks/FyForm.0294e494.mjs +0 -439
- package/chunks/FyForm.vue_vue_type_style_index_0_lang.6e64daee.mjs +0 -737
- package/chunks/FyInput.vue_vue_type_template_lang.d2c56811.mjs +0 -93
- package/chunks/FyInputColor.vue_vue_type_template_lang.6eca0ddd.mjs +0 -56
- package/chunks/FyInputIcon.vue_vue_type_style_index_0_lang.11a6a221.mjs +0 -158
- package/chunks/FyRate.vue_vue_type_style_index_0_lang.82174185.mjs +0 -39
- package/chunks/FySelect.vue_vue_type_style_index_0_lang.5f0f3244.mjs +0 -102
- package/chunks/FyTabs.vue_vue_type_template_lang.66af5ac9.mjs +0 -41
- package/chunks/HighlightJS.vue_vue_type_style_index_0_lang.fefeaa3b.mjs +0 -15
- package/chunks/IconTemp.42c48e1f.mjs +0 -32
- package/chunks/IconTemp.vue_vue_type_style_index_0_lang.a0777b31.mjs +0 -23
- package/chunks/InputNumber.vue_vue_type_style_index_0_lang.18046bd3.mjs +0 -172
- package/chunks/LoadingView.vue_vue_type_style_index_0_lang.4c3fff2a.mjs +0 -23
- package/chunks/NavBar.vue_vue_type_style_index_0_lang.e21b57f3.mjs +0 -21
- package/chunks/Page.81f4b8d9.mjs +0 -32
- package/chunks/Page.vue_vue_type_style_index_0_lang.cb4f9bf2.mjs +0 -13
- package/chunks/PageHeader.vue_vue_type_style_index_0_lang.3bcca5aa.mjs +0 -26
- package/chunks/PageSkeleton.vue_vue_type_style_index_0_lang.8621381f.mjs +0 -88
- package/chunks/PageableTable.333cbdc1.mjs +0 -335
- package/chunks/PageableTable.vue_vue_type_style_index_0_lang.fd89fb43.mjs +0 -148
- package/chunks/ResizeObserver.60f728f0.mjs +0 -54
- package/chunks/ResizeObserver.vue_vue_type_style_index_0_lang.7079029c.mjs +0 -13
- package/chunks/TableColumn.8503272e.mjs +0 -106
- package/chunks/Toolbar.5c539dbb.mjs +0 -24
- package/chunks/Toolbar.vue_vue_type_style_index_0_lang.7594243c.mjs +0 -275
- package/chunks/ToolbarButton.vue_vue_type_style_index_0_lang.e2cb14ba.mjs +0 -31
- package/chunks/XInputTag.vue_vue_type_style_index_0_lang.7ad045b3.mjs +0 -74
|
@@ -1,548 +0,0 @@
|
|
|
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
|
-
};
|