@ctzy-web-client/plugin-component-vue 1.0.25 → 1.0.27
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/es/_virtual/_plugin-vue_export-helper.mjs +11 -0
- package/es/advance-select/advance-operation.mjs +48 -51
- package/es/advance-select/advance-option.mjs +128 -163
- package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +11 -5
- package/es/advance-select/advance-select.mjs +323 -370
- package/es/advance-select/events-helpers.mjs +9 -0
- package/es/advance-select/index.mjs +9 -0
- package/es/advance-select/use-advance-option.mjs +9 -0
- package/es/advance-select/use-advance-select.mjs +9 -0
- package/es/application-slot/application-slot.mjs +9 -0
- package/es/application-slot/breadcrumb-item.mjs +26 -20
- package/es/application-slot/header-tools-item.mjs +26 -20
- package/es/application-slot/index.mjs +9 -0
- package/es/breadcrumb-select/breadcrumb-select.mjs +123 -137
- package/es/breadcrumb-select/index.mjs +9 -0
- package/es/components.mjs +9 -0
- package/es/contextmenu/contextmenu-item.mjs +24 -19
- package/es/contextmenu/contextmenu.mjs +68 -73
- package/es/contextmenu/index.mjs +9 -0
- package/es/contextmenu/use-contextmenu.mjs +10 -1
- package/es/data-form/data-form-item.mjs +41 -49
- package/es/data-form/data-form.mjs +176 -213
- package/es/data-form/dynamic-component.mjs +9 -0
- package/es/data-form/form-components/Blots/AtBlot.mjs +9 -0
- package/es/data-form/form-components/bwa-date-picker.mjs +50 -51
- package/es/data-form/form-components/bwa-date-time-picker.mjs +55 -56
- package/es/data-form/form-components/bwa-input-float.mjs +48 -48
- package/es/data-form/form-components/bwa-input-integer.mjs +61 -68
- package/es/data-form/form-components/bwa-input.mjs +43 -43
- package/es/data-form/form-components/bwa-multi-select.mjs +40 -40
- package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +230 -555
- package/es/data-form/form-components/bwa-rich-text.mjs +326 -404
- package/es/data-form/form-components/bwa-select.mjs +81 -84
- package/es/data-form/form-components/bwa-textarea.mjs +38 -38
- package/es/data-form/form-components/bwa-upload.mjs +160 -173
- package/es/data-form/form-components/bwa-user-multi-select.mjs +35 -35
- package/es/data-form/form-components/bwa-user-select.mjs +72 -86
- package/es/data-form/index.mjs +9 -0
- package/es/data-table/data-column-view.mjs +124 -146
- package/es/data-table/data-table-card.mjs +49 -48
- package/es/data-table/data-table-column.mjs +55 -58
- package/es/data-table/data-table.mjs +328 -404
- package/es/data-table/dynamic-component.mjs +9 -0
- package/es/data-table/index.mjs +9 -0
- package/es/data-table/use-datatable-drag.mjs +9 -0
- package/es/datatable-settings/datatable-settings.mjs +286 -328
- package/es/datatable-settings/index.mjs +9 -0
- package/es/date-range/date-picker.mjs +125 -131
- package/es/date-range/date-range.mjs +173 -216
- package/es/date-range/index.mjs +9 -0
- package/es/drag-list/constants.mjs +10 -0
- package/es/drag-list/drag-item.mjs +51 -56
- package/es/drag-list/drag-list.mjs +58 -60
- package/es/drag-list/index.mjs +9 -0
- package/es/drag-list/use-drag-list.mjs +10 -1
- package/es/dragable/constants.mjs +10 -0
- package/es/dragable/dragable-item.mjs +27 -23
- package/es/dragable/dragable-operation.mjs +33 -32
- package/es/dragable/dragable.mjs +33 -32
- package/es/dragable/index.mjs +9 -0
- package/es/dragable/use-dragable.mjs +9 -0
- package/es/filter-panel/conditions/condition.mjs +9 -0
- package/es/filter-panel/conditions/date-range-condition.mjs +51 -50
- package/es/filter-panel/conditions/department-condition/department-condition.mjs +82 -99
- package/es/filter-panel/conditions/department-condition/department-node.mjs +69 -73
- package/es/filter-panel/conditions/index.mjs +9 -0
- package/es/filter-panel/conditions/input-condition.mjs +88 -91
- package/es/filter-panel/conditions/multi-user-condition.mjs +66 -67
- package/es/filter-panel/conditions/multiple-menu-condition.mjs +44 -54
- package/es/filter-panel/conditions/single-menu-condition.mjs +71 -65
- package/es/filter-panel/conditions/single-user-condition.mjs +66 -67
- package/es/filter-panel/filter-panel-item.mjs +51 -55
- package/es/filter-panel/filter-panel.mjs +147 -156
- package/es/filter-panel/index.mjs +9 -0
- package/es/filter-panel/use-filter-panel-item.mjs +9 -0
- package/es/filter-panel/use-filter-panel.mjs +9 -0
- package/es/hooks/use-data/index.mjs +9 -0
- package/es/index.mjs +9 -0
- package/es/layout/index.mjs +9 -0
- package/es/layout/layout.mjs +87 -85
- package/es/make-installer.mjs +9 -0
- package/es/math/Rectangle.mjs +10 -0
- package/es/menu/index.mjs +9 -0
- package/es/menu/menu-item.mjs +65 -70
- package/es/menu/menu.mjs +64 -70
- package/es/node_modules/.pnpm/{@vueuse_core@9.6.0_vue@3.2.41 → @vueuse_core@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/core/index.mjs +680 -454
- package/es/node_modules/.pnpm/{@vueuse_shared@9.6.0_vue@3.2.41 → @vueuse_shared@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/shared/index.mjs +108 -46
- package/es/panel/index.mjs +9 -0
- package/es/panel/panel.mjs +49 -53
- package/es/panel-tabs/index.mjs +9 -0
- package/es/panel-tabs/panel-tabs.mjs +9 -0
- package/es/pct-filter-panel/index.mjs +9 -0
- package/es/pct-filter-panel/pct-compents/index.mjs +9 -0
- package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +73 -75
- package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +77 -77
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +345 -374
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +149 -154
- package/es/pct-filter-panel/pct-filter-panel-item.mjs +52 -56
- package/es/pct-filter-panel/pct-filter-panel.mjs +235 -248
- package/es/pct-filter-panel/use-filter-panel-item.mjs +9 -0
- package/es/pct-filter-panel/use-filter-panel.mjs +9 -0
- package/es/plugins.mjs +9 -0
- package/es/progress/index.mjs +9 -0
- package/es/progress/progress-item.mjs +71 -81
- package/es/progress/progress.mjs +74 -78
- package/es/progress/use-progress.mjs +9 -0
- package/es/utils/db.mjs +9 -0
- package/es/utils.css +1 -0
- package/es/utils.mjs +9 -0
- package/es/where-filter-panel/index.mjs +9 -1
- package/es/where-filter-panel/use-where-filter-panel.mjs +9 -0
- package/es/where-filter-panel/where-filter-panel.mjs +21 -15
- package/lib/_virtual/_plugin-vue_export-helper.js +11 -0
- package/lib/advance-select/advance-operation.js +47 -50
- package/lib/advance-select/advance-option.js +127 -162
- package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +11 -6
- package/lib/advance-select/advance-select.js +322 -369
- package/lib/advance-select/events-helpers.js +9 -0
- package/lib/advance-select/index.js +9 -0
- package/lib/advance-select/use-advance-option.js +9 -0
- package/lib/advance-select/use-advance-select.js +9 -0
- package/lib/application-slot/application-slot.js +9 -0
- package/lib/application-slot/breadcrumb-item.js +25 -19
- package/lib/application-slot/header-tools-item.js +25 -19
- package/lib/application-slot/index.js +9 -0
- package/lib/breadcrumb-select/breadcrumb-select.js +122 -136
- package/lib/breadcrumb-select/index.js +9 -0
- package/lib/components.js +9 -0
- package/lib/contextmenu/contextmenu-item.js +23 -18
- package/lib/contextmenu/contextmenu.js +67 -72
- package/lib/contextmenu/index.js +9 -0
- package/lib/contextmenu/use-contextmenu.js +10 -1
- package/lib/data-form/data-form-item.js +40 -48
- package/lib/data-form/data-form.js +175 -212
- package/lib/data-form/dynamic-component.js +9 -0
- package/lib/data-form/form-components/Blots/AtBlot.js +9 -0
- package/lib/data-form/form-components/bwa-date-picker.js +49 -50
- package/lib/data-form/form-components/bwa-date-time-picker.js +54 -55
- package/lib/data-form/form-components/bwa-input-float.js +47 -47
- package/lib/data-form/form-components/bwa-input-integer.js +60 -67
- package/lib/data-form/form-components/bwa-input.js +42 -42
- package/lib/data-form/form-components/bwa-multi-select.js +39 -39
- package/lib/data-form/form-components/bwa-rich-text-tinymce.js +229 -554
- package/lib/data-form/form-components/bwa-rich-text.js +325 -403
- package/lib/data-form/form-components/bwa-select.js +80 -83
- package/lib/data-form/form-components/bwa-textarea.js +37 -37
- package/lib/data-form/form-components/bwa-upload.js +159 -172
- package/lib/data-form/form-components/bwa-user-multi-select.js +34 -34
- package/lib/data-form/form-components/bwa-user-select.js +71 -85
- package/lib/data-form/index.js +9 -0
- package/lib/data-table/data-column-view.js +124 -146
- package/lib/data-table/data-table-card.js +49 -48
- package/lib/data-table/data-table-column.js +54 -57
- package/lib/data-table/data-table.js +327 -403
- package/lib/data-table/dynamic-component.js +9 -0
- package/lib/data-table/index.js +9 -0
- package/lib/data-table/use-datatable-drag.js +9 -0
- package/lib/datatable-settings/datatable-settings.js +285 -327
- package/lib/datatable-settings/index.js +9 -0
- package/lib/date-range/date-picker.js +124 -130
- package/lib/date-range/date-range.js +172 -215
- package/lib/date-range/index.js +9 -0
- package/lib/drag-list/constants.js +10 -0
- package/lib/drag-list/drag-item.js +50 -55
- package/lib/drag-list/drag-list.js +57 -59
- package/lib/drag-list/index.js +9 -0
- package/lib/drag-list/use-drag-list.js +10 -1
- package/lib/dragable/constants.js +10 -0
- package/lib/dragable/dragable-item.js +26 -22
- package/lib/dragable/dragable-operation.js +32 -31
- package/lib/dragable/dragable.js +32 -31
- package/lib/dragable/index.js +9 -0
- package/lib/dragable/use-dragable.js +9 -0
- package/lib/filter-panel/conditions/condition.js +9 -0
- package/lib/filter-panel/conditions/date-range-condition.js +50 -49
- package/lib/filter-panel/conditions/department-condition/department-condition.js +81 -98
- package/lib/filter-panel/conditions/department-condition/department-node.js +68 -72
- package/lib/filter-panel/conditions/index.js +9 -0
- package/lib/filter-panel/conditions/input-condition.js +87 -90
- package/lib/filter-panel/conditions/multi-user-condition.js +65 -66
- package/lib/filter-panel/conditions/multiple-menu-condition.js +43 -53
- package/lib/filter-panel/conditions/single-menu-condition.js +70 -64
- package/lib/filter-panel/conditions/single-user-condition.js +65 -66
- package/lib/filter-panel/filter-panel-item.js +50 -54
- package/lib/filter-panel/filter-panel.js +146 -155
- package/lib/filter-panel/index.js +9 -0
- package/lib/filter-panel/use-filter-panel-item.js +9 -0
- package/lib/filter-panel/use-filter-panel.js +9 -0
- package/lib/hooks/use-data/index.js +9 -0
- package/lib/index.js +9 -0
- package/lib/layout/index.js +9 -0
- package/lib/layout/layout.js +86 -84
- package/lib/make-installer.js +9 -0
- package/lib/math/Rectangle.js +10 -0
- package/lib/menu/index.js +9 -0
- package/lib/menu/menu-item.js +64 -69
- package/lib/menu/menu.js +63 -69
- package/lib/node_modules/.pnpm/{@vueuse_core@9.6.0_vue@3.2.41 → @vueuse_core@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/core/index.js +685 -451
- package/lib/node_modules/.pnpm/{@vueuse_shared@9.6.0_vue@3.2.41 → @vueuse_shared@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/shared/index.js +109 -44
- package/lib/panel/index.js +9 -0
- package/lib/panel/panel.js +48 -52
- package/lib/panel-tabs/index.js +9 -0
- package/lib/panel-tabs/panel-tabs.js +9 -0
- package/lib/pct-filter-panel/index.js +9 -0
- package/lib/pct-filter-panel/pct-compents/index.js +9 -0
- package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +72 -74
- package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +76 -76
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +344 -373
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +148 -153
- package/lib/pct-filter-panel/pct-filter-panel-item.js +51 -55
- package/lib/pct-filter-panel/pct-filter-panel.js +234 -247
- package/lib/pct-filter-panel/use-filter-panel-item.js +9 -0
- package/lib/pct-filter-panel/use-filter-panel.js +9 -0
- package/lib/plugins.js +9 -0
- package/lib/progress/index.js +9 -0
- package/lib/progress/progress-item.js +70 -80
- package/lib/progress/progress.js +73 -77
- package/lib/progress/use-progress.js +9 -0
- package/lib/utils/db.js +9 -0
- package/lib/utils.css +1 -0
- package/lib/utils.js +9 -0
- package/lib/where-filter-panel/index.js +9 -0
- package/lib/where-filter-panel/use-where-filter-panel.js +9 -0
- package/lib/where-filter-panel/where-filter-panel.js +20 -14
- package/package.json +1 -1
- package/style/index.css +1 -1
- package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +0 -28
- package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +0 -32
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent, useAttrs, ref, computed, unref, watch, provide, reactive, nextTick, onUnmounted, openBlock, createElementBlock, normalizeClass, renderSlot, createVNode, mergeProps, withCtx, createBlock, createElementVNode, createCommentVNode, Fragment, renderList, createTextVNode, toDisplayString, normalizeStyle } from 'vue';
|
|
2
2
|
import { ElMessage, ElTable, ElTableColumn, ElPagination } from 'element-plus';
|
|
3
3
|
import { useService, useGlobalConfig, dataTableKey, useNamespace, useEventDispatcher } from '@ctzy-web-client/web-base-client-vue';
|
|
4
4
|
import DynamicComponent from './dynamic-component.mjs';
|
|
@@ -8,391 +8,321 @@ import { get } from 'lodash';
|
|
|
8
8
|
import { Subject, debounceTime, Observable, filter, map, delayWhen, from, skipWhile } from 'rxjs';
|
|
9
9
|
import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
const elTable = ref(null);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const searchParamsSubscription = new Observable((observer) =>
|
|
276
|
-
useEventDispatcher(
|
|
277
|
-
props.dataTable.filterPanel,
|
|
278
|
-
'params-change',
|
|
279
|
-
observer.next.bind(observer)
|
|
280
|
-
)
|
|
281
|
-
)
|
|
282
|
-
.pipe(
|
|
283
|
-
filter(() => props.dataTable.filterPanel.ready),
|
|
284
|
-
debounceTime(unref(debounceDelay))
|
|
285
|
-
)
|
|
286
|
-
.subscribe(() => {
|
|
287
|
-
props.dataTable.load();
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
const subscription = props.dataTable
|
|
291
|
-
.getDisplayColumnsSubject()
|
|
292
|
-
.pipe(
|
|
293
|
-
map(() => unref(elTable)),
|
|
294
|
-
delayWhen(() => from(nextTick())),
|
|
295
|
-
map((elTable) => elTable?.store),
|
|
296
|
-
skipWhile((store) => !store)
|
|
297
|
-
)
|
|
298
|
-
.subscribe((store) => {
|
|
299
|
-
sortColumn(unref(store.states._columns));
|
|
300
|
-
|
|
301
|
-
store.updateColumns();
|
|
302
|
-
store.scheduleLayout();
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
onUnmounted(() => {
|
|
306
|
-
selectChangeAPIObservable.unsubscribe();
|
|
307
|
-
subscription.unsubscribe();
|
|
308
|
-
tableSelectSubscription.unsubscribe();
|
|
309
|
-
searchParamsSubscription.unsubscribe();
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
return (_ctx, _cache) => {
|
|
313
|
-
return (openBlock(), createElementBlock("div", {
|
|
314
|
-
class: normalizeClass(unref(ns).b()),
|
|
315
|
-
ref_key: "dataTableEl",
|
|
316
|
-
ref: dataTableEl
|
|
317
|
-
}, [
|
|
318
|
-
renderSlot(_ctx.$slots, "default", { dataTable: unref(dataTable) }, () => [
|
|
319
|
-
createVNode(unref(ElTable), mergeProps({
|
|
320
|
-
class: "content",
|
|
321
|
-
height: "100%",
|
|
322
|
-
ref_key: "elTable",
|
|
323
|
-
ref: elTable,
|
|
324
|
-
data: unref(data),
|
|
325
|
-
"row-key": unref(dataTable).primaryKey,
|
|
326
|
-
"show-header": "",
|
|
327
|
-
stripe: ""
|
|
328
|
-
}, unref(attrs), {
|
|
329
|
-
onSelectionChange: unref(selectionChange),
|
|
330
|
-
onSortChange: sortHandle,
|
|
331
|
-
border: __props.border
|
|
332
|
-
}), {
|
|
333
|
-
empty: withCtx(() => [
|
|
334
|
-
renderSlot(_ctx.$slots, "empty-table")
|
|
335
|
-
]),
|
|
336
|
-
default: withCtx(() => [
|
|
337
|
-
(__props.showDrag)
|
|
338
|
-
? (openBlock(), createBlock(unref(ElTableColumn), {
|
|
11
|
+
// Inject __name helper
|
|
12
|
+
if (typeof __name === 'undefined') {
|
|
13
|
+
function __name(obj, name) {
|
|
14
|
+
Object.defineProperty(obj, "name", {
|
|
15
|
+
value: name,
|
|
16
|
+
configurable: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const __default__ = defineComponent({ name: "BwaDataTable" });
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
22
|
+
props: {
|
|
23
|
+
dataTable: {
|
|
24
|
+
type: Object,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
autoLoad: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
showIndex: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
indexColumnLabel: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "\u7F16\u53F7"
|
|
38
|
+
},
|
|
39
|
+
selection: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
paginationLayout: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "sizes, prev, pager, next, jumper"
|
|
46
|
+
},
|
|
47
|
+
paginationPageSizes: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: () => [10, 20, 50, 100, 200]
|
|
50
|
+
},
|
|
51
|
+
showPagination: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
whereParamName: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ""
|
|
58
|
+
},
|
|
59
|
+
showDrag: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
border: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
emits: ["drag"],
|
|
69
|
+
setup(__props, { emit: __emit }) {
|
|
70
|
+
var _a;
|
|
71
|
+
;
|
|
72
|
+
const props = __props;
|
|
73
|
+
const attrs = useAttrs();
|
|
74
|
+
const userService = useService("UserService");
|
|
75
|
+
const elTable = ref(null);
|
|
76
|
+
const dataTable = props.dataTable;
|
|
77
|
+
dataTable._userService = (_a = userService.value) == null ? void 0 : _a.getUserList;
|
|
78
|
+
const dataTableEl = ref(null);
|
|
79
|
+
const displayColumns = computed(
|
|
80
|
+
() => unref(dataTable).getDisplayColumns() || []
|
|
81
|
+
);
|
|
82
|
+
watch(
|
|
83
|
+
computed(() => props.whereParamName),
|
|
84
|
+
(whereParamName) => {
|
|
85
|
+
dataTable.setWhereParamName(whereParamName || "");
|
|
86
|
+
},
|
|
87
|
+
{ immediate: true, flush: "sync" }
|
|
88
|
+
);
|
|
89
|
+
const searchParams = computed(() => props.searchParams);
|
|
90
|
+
const emit = __emit;
|
|
91
|
+
const debounceDelay = useGlobalConfig("debounceDelay", 500);
|
|
92
|
+
provide(
|
|
93
|
+
dataTableKey,
|
|
94
|
+
reactive({
|
|
95
|
+
dataTable,
|
|
96
|
+
displayColumns
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
const ns = useNamespace("datatable");
|
|
100
|
+
const { barRectangle } = useDataTableDrag(
|
|
101
|
+
dataTableEl,
|
|
102
|
+
".bwa-datatable__drag",
|
|
103
|
+
".el-table__row",
|
|
104
|
+
{ emit }
|
|
105
|
+
);
|
|
106
|
+
const processing = ref(false);
|
|
107
|
+
const data = computed(() => {
|
|
108
|
+
return props.dataTable.data;
|
|
109
|
+
});
|
|
110
|
+
useEventDispatcher(dataTable, "load-successfully", async (res) => {
|
|
111
|
+
if (res.code != 0) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const _userService = unref(userService);
|
|
115
|
+
if (!_userService) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
let columns = dataTable.getColumns();
|
|
119
|
+
const componentNames = ["BwaUserSelect", "BwaUserMultiSelect"];
|
|
120
|
+
columns = columns.filter((column) => componentNames.includes(column.formComponent)).filter((column) => column.visible).filter((column) => column.isExtend);
|
|
121
|
+
if (!columns.length) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
processing.value = true;
|
|
125
|
+
const data2 = res.data;
|
|
126
|
+
let ids = data2.reduce((result, item) => {
|
|
127
|
+
return result.concat(
|
|
128
|
+
columns.reduce((result2, column) => {
|
|
129
|
+
let value = get(item, column.fullAttrName);
|
|
130
|
+
value = Array.isArray(value) ? value : value ? [value] : [];
|
|
131
|
+
return result2.concat(value);
|
|
132
|
+
}, [])
|
|
133
|
+
);
|
|
134
|
+
}, []).map((id) => id + "");
|
|
135
|
+
ids = [...new Set(ids)];
|
|
136
|
+
try {
|
|
137
|
+
const userListResult = await _userService.getUserListByIds(ids);
|
|
138
|
+
if (userListResult.code != 0) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
for (const column of columns) {
|
|
142
|
+
column.componentProps = column.componentProps || {};
|
|
143
|
+
column.componentProps.options = (userListResult.data || []).map(
|
|
144
|
+
(item) => ({
|
|
145
|
+
label: item.label,
|
|
146
|
+
value: item.value
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
console.log(userListResult);
|
|
151
|
+
} finally {
|
|
152
|
+
processing.value = false;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
const sortHandle = (column, prop, order) => {
|
|
156
|
+
let sortColumn2 = "";
|
|
157
|
+
let sortType = "";
|
|
158
|
+
if (column.order) {
|
|
159
|
+
sortColumn2 = column.prop;
|
|
160
|
+
sortType = column.order == "descending" ? 0 : 1;
|
|
161
|
+
dataTable.setParam("sortColumn", sortColumn2);
|
|
162
|
+
dataTable.setParam("sortType", sortType);
|
|
163
|
+
} else {
|
|
164
|
+
dataTable.setParam("sortColumn", sortColumn2);
|
|
165
|
+
dataTable.setParam("sortType", sortType);
|
|
166
|
+
}
|
|
167
|
+
dataTable.load();
|
|
168
|
+
};
|
|
169
|
+
useEventDispatcher(dataTable, "load-successfully", (res) => {
|
|
170
|
+
if (!elTable.value) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
unref(elTable).store.updateSelectionByRowKey();
|
|
174
|
+
if (res.code != 0) {
|
|
175
|
+
ElMessage.error(res.msg);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
function sortColumn(array) {
|
|
179
|
+
array.forEach((item) => {
|
|
180
|
+
var _a2, _b;
|
|
181
|
+
item.no = (_a2 = item.getColumnIndex) == null ? void 0 : _a2.call(item);
|
|
182
|
+
if ((_b = item.children) == null ? void 0 : _b.length) {
|
|
183
|
+
sortColumn(item.children);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
array.sort((cur, pre) => cur.no - pre.no);
|
|
187
|
+
}
|
|
188
|
+
const tableSelectSubject = new Subject();
|
|
189
|
+
const selectionChange = tableSelectSubject.next.bind(tableSelectSubject);
|
|
190
|
+
const totalPage = computed(() => dataTable.getTotalPage());
|
|
191
|
+
const tableSelectSubscription = tableSelectSubject.pipe(debounceTime(debounceDelay)).subscribe(unref(dataTable).setSelection.bind(unref(dataTable)));
|
|
192
|
+
const selectChangeAPIObservable = new Observable(
|
|
193
|
+
(observer) => useEventDispatcher(
|
|
194
|
+
props.dataTable,
|
|
195
|
+
"select-change",
|
|
196
|
+
observer.next.bind(observer)
|
|
197
|
+
)
|
|
198
|
+
).pipe(
|
|
199
|
+
filter((selection) => {
|
|
200
|
+
if (!unref(elTable)) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
const selectionRows = unref(elTable).getSelectionRows();
|
|
204
|
+
if (selectionRows.length !== selection.length) {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
const primaryKey = dataTable.primaryKey;
|
|
208
|
+
return !selectionRows.every(
|
|
209
|
+
(item) => selection.find((itm) => item[primaryKey] === item[primaryKey])
|
|
210
|
+
);
|
|
211
|
+
})
|
|
212
|
+
).subscribe((selection) => {
|
|
213
|
+
unref(elTable).clearSelection();
|
|
214
|
+
for (const item of selection) {
|
|
215
|
+
unref(elTable).toggleRowSelection(item, true);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
if (props.autoLoad) {
|
|
219
|
+
dataTable.load();
|
|
220
|
+
}
|
|
221
|
+
const searchParamsSubscription = new Observable(
|
|
222
|
+
(observer) => useEventDispatcher(
|
|
223
|
+
props.dataTable.filterPanel,
|
|
224
|
+
"params-change",
|
|
225
|
+
observer.next.bind(observer)
|
|
226
|
+
)
|
|
227
|
+
).pipe(
|
|
228
|
+
filter(() => props.dataTable.filterPanel.ready),
|
|
229
|
+
debounceTime(unref(debounceDelay))
|
|
230
|
+
).subscribe(() => {
|
|
231
|
+
props.dataTable.load();
|
|
232
|
+
});
|
|
233
|
+
const subscription = props.dataTable.getDisplayColumnsSubject().pipe(
|
|
234
|
+
map(() => unref(elTable)),
|
|
235
|
+
delayWhen(() => from(nextTick())),
|
|
236
|
+
map((elTable2) => elTable2 == null ? void 0 : elTable2.store),
|
|
237
|
+
skipWhile((store) => !store)
|
|
238
|
+
).subscribe((store) => {
|
|
239
|
+
sortColumn(unref(store.states._columns));
|
|
240
|
+
store.updateColumns();
|
|
241
|
+
store.scheduleLayout();
|
|
242
|
+
});
|
|
243
|
+
onUnmounted(() => {
|
|
244
|
+
selectChangeAPIObservable.unsubscribe();
|
|
245
|
+
subscription.unsubscribe();
|
|
246
|
+
tableSelectSubscription.unsubscribe();
|
|
247
|
+
searchParamsSubscription.unsubscribe();
|
|
248
|
+
});
|
|
249
|
+
return (_ctx, _cache) => {
|
|
250
|
+
return openBlock(), createElementBlock("div", {
|
|
251
|
+
class: normalizeClass(unref(ns).b()),
|
|
252
|
+
ref_key: "dataTableEl",
|
|
253
|
+
ref: dataTableEl
|
|
254
|
+
}, [
|
|
255
|
+
renderSlot(_ctx.$slots, "default", { dataTable: unref(dataTable) }, () => [
|
|
256
|
+
createVNode(unref(ElTable), mergeProps({
|
|
257
|
+
class: "content",
|
|
258
|
+
height: "100%",
|
|
259
|
+
ref_key: "elTable",
|
|
260
|
+
ref: elTable,
|
|
261
|
+
data: data.value,
|
|
262
|
+
"row-key": unref(dataTable).primaryKey,
|
|
263
|
+
"show-header": "",
|
|
264
|
+
stripe: ""
|
|
265
|
+
}, unref(attrs), {
|
|
266
|
+
onSelectionChange: unref(selectionChange),
|
|
267
|
+
onSortChange: sortHandle,
|
|
268
|
+
border: __props.border
|
|
269
|
+
}), {
|
|
270
|
+
empty: withCtx(() => [
|
|
271
|
+
renderSlot(_ctx.$slots, "empty-table")
|
|
272
|
+
]),
|
|
273
|
+
default: withCtx(() => [
|
|
274
|
+
__props.showDrag ? (openBlock(), createBlock(unref(ElTableColumn), {
|
|
339
275
|
key: 0,
|
|
340
276
|
width: "40px"
|
|
341
277
|
}, {
|
|
342
278
|
default: withCtx(() => [
|
|
343
279
|
createElementVNode("div", {
|
|
344
|
-
class: normalizeClass(unref(ns).e(
|
|
280
|
+
class: normalizeClass(unref(ns).e("drag"))
|
|
345
281
|
}, [
|
|
346
282
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
347
|
-
|
|
283
|
+
_cache[2] || (_cache[2] = createElementVNode("i", { class: "ptp-icon ptp-buzhou-yidong" }, null, -1))
|
|
348
284
|
])
|
|
349
|
-
], 2
|
|
285
|
+
], 2)
|
|
350
286
|
]),
|
|
351
|
-
_: 3
|
|
352
|
-
}))
|
|
353
|
-
|
|
354
|
-
(__props.selection)
|
|
355
|
-
? renderSlot(_ctx.$slots, "selection", { key: 1 }, () => [
|
|
287
|
+
_: 3
|
|
288
|
+
})) : createCommentVNode("v-if", true),
|
|
289
|
+
__props.selection ? renderSlot(_ctx.$slots, "selection", { key: 1 }, () => [
|
|
356
290
|
createVNode(unref(ElTableColumn), {
|
|
357
291
|
type: "selection",
|
|
358
292
|
align: "center",
|
|
359
293
|
width: "56",
|
|
360
294
|
"reserve-selection": true
|
|
361
295
|
})
|
|
362
|
-
])
|
|
363
|
-
|
|
364
|
-
(__props.showIndex)
|
|
365
|
-
? renderSlot(_ctx.$slots, "index", { key: 2 }, () => [
|
|
296
|
+
]) : createCommentVNode("v-if", true),
|
|
297
|
+
__props.showIndex ? renderSlot(_ctx.$slots, "index", { key: 2 }, () => [
|
|
366
298
|
createVNode(unref(ElTableColumn), {
|
|
367
299
|
type: "index",
|
|
368
300
|
width: "60",
|
|
369
301
|
align: "center",
|
|
370
302
|
label: __props.indexColumnLabel
|
|
371
|
-
}, null, 8
|
|
372
|
-
])
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
(unref(data).length)
|
|
393
|
-
? renderSlot(_ctx.$slots, 'table-col-' + item.attrName, {
|
|
303
|
+
}, null, 8, ["label"])
|
|
304
|
+
]) : createCommentVNode("v-if", true),
|
|
305
|
+
renderSlot(_ctx.$slots, "table-columns", { dataTable: unref(dataTable) }, () => [
|
|
306
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayColumns.value, (item) => {
|
|
307
|
+
return openBlock(), createBlock(DataTableColumn, mergeProps({
|
|
308
|
+
"column-key": item.attrName,
|
|
309
|
+
key: item.attrName,
|
|
310
|
+
label: item.title,
|
|
311
|
+
prop: item.fullAttrName,
|
|
312
|
+
"min-width": item.width,
|
|
313
|
+
align: item.align
|
|
314
|
+
}, { ref_for: true }, item.componentProps, {
|
|
315
|
+
sortable: item.sortable == "custom"
|
|
316
|
+
}), {
|
|
317
|
+
header: withCtx(() => [
|
|
318
|
+
renderSlot(_ctx.$slots, `table-header-col-${item.attrName}`, {}, () => [
|
|
319
|
+
createTextVNode(toDisplayString(item.title), 1)
|
|
320
|
+
])
|
|
321
|
+
]),
|
|
322
|
+
default: withCtx(({ row, $index }) => [
|
|
323
|
+
data.value.length ? renderSlot(_ctx.$slots, "table-col-" + item.attrName, {
|
|
394
324
|
key: 0,
|
|
395
|
-
row
|
|
325
|
+
row,
|
|
396
326
|
index: $index,
|
|
397
327
|
column: item,
|
|
398
328
|
dataTable: unref(dataTable)
|
|
@@ -400,56 +330,50 @@ return (_ctx, _cache) => {
|
|
|
400
330
|
createVNode(unref(DynamicComponent), {
|
|
401
331
|
column: item,
|
|
402
332
|
record: row
|
|
403
|
-
}, null, 8
|
|
404
|
-
])
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
333
|
+
}, null, 8, ["column", "record"])
|
|
334
|
+
]) : createCommentVNode("v-if", true)
|
|
335
|
+
]),
|
|
336
|
+
_: 2
|
|
337
|
+
}, 1040, ["column-key", "label", "prop", "min-width", "align", "sortable"]);
|
|
338
|
+
}), 128))
|
|
339
|
+
]),
|
|
340
|
+
renderSlot(_ctx.$slots, "column-append")
|
|
341
|
+
]),
|
|
342
|
+
_: 3
|
|
343
|
+
}, 16, ["data", "row-key", "onSelectionChange", "border"])
|
|
412
344
|
]),
|
|
413
|
-
|
|
414
|
-
}, 16 /* FULL_PROPS */, ["data", "row-key", "onSelectionChange", "border"])
|
|
415
|
-
]),
|
|
416
|
-
(__props.showPagination)
|
|
417
|
-
? (openBlock(), createElementBlock("div", {
|
|
345
|
+
__props.showPagination ? (openBlock(), createElementBlock("div", {
|
|
418
346
|
key: 0,
|
|
419
|
-
class: normalizeClass(unref(ns).e(
|
|
347
|
+
class: normalizeClass(unref(ns).e("pagination"))
|
|
420
348
|
}, [
|
|
421
349
|
createElementVNode("div", {
|
|
422
|
-
class: normalizeClass(unref(ns).e(
|
|
423
|
-
}, "
|
|
350
|
+
class: normalizeClass(unref(ns).e("pagination-info"))
|
|
351
|
+
}, " \u5171" + toDisplayString(totalPage.value) + "\u9875\uFF0C" + toDisplayString(unref(dataTable).totalRecCount) + "\u6761 ", 3),
|
|
424
352
|
createVNode(unref(ElPagination), {
|
|
425
353
|
currentPage: unref(dataTable).pageNum,
|
|
426
354
|
"page-sizes": __props.paginationPageSizes,
|
|
427
355
|
"page-size": unref(dataTable).pageSize,
|
|
428
356
|
layout: __props.paginationLayout,
|
|
429
357
|
total: unref(dataTable).totalRecCount,
|
|
430
|
-
onSizeChange: _cache[0] || (_cache[0] = $event =>
|
|
431
|
-
onCurrentChange: _cache[1] || (_cache[1] = $event =>
|
|
358
|
+
onSizeChange: _cache[0] || (_cache[0] = ($event) => unref(dataTable).setPageSize($event)),
|
|
359
|
+
onCurrentChange: _cache[1] || (_cache[1] = ($event) => unref(dataTable).pageTo($event)),
|
|
432
360
|
teleported: false
|
|
433
|
-
}, null, 8
|
|
434
|
-
], 2
|
|
435
|
-
|
|
436
|
-
(unref(barRectangle))
|
|
437
|
-
? (openBlock(), createElementBlock("div", {
|
|
361
|
+
}, null, 8, ["currentPage", "page-sizes", "page-size", "layout", "total"])
|
|
362
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
363
|
+
unref(barRectangle) ? (openBlock(), createElementBlock("div", {
|
|
438
364
|
key: 1,
|
|
439
|
-
class: normalizeClass(unref(ns).e(
|
|
440
|
-
style: normalizeStyle({
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}, null, 6
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
};
|
|
453
|
-
var DataTable = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"data-table.vue"]]);
|
|
365
|
+
class: normalizeClass(unref(ns).e("dragbar")),
|
|
366
|
+
style: normalizeStyle({
|
|
367
|
+
left: unref(barRectangle).left + "px",
|
|
368
|
+
top: unref(barRectangle).top + "px",
|
|
369
|
+
width: unref(barRectangle).width + "px",
|
|
370
|
+
height: unref(barRectangle).height + "px"
|
|
371
|
+
})
|
|
372
|
+
}, null, 6)) : createCommentVNode("v-if", true)
|
|
373
|
+
], 2);
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "data-table.vue"]]);
|
|
454
378
|
|
|
455
379
|
export { DataTable as default };
|