@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 { useAttrs, ref, watch, computed, unref, getCurrentScope, onScopeDispose, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeClass, createTextVNode, createElementBlock, createVNode, createCommentVNode, toDisplayString, withModifiers, Fragment, renderList, renderSlot } from 'vue';
|
|
1
|
+
import { defineComponent, useAttrs, ref, watch, computed, unref, getCurrentScope, onScopeDispose, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeClass, createTextVNode, createElementBlock, createVNode, createCommentVNode, toDisplayString, withModifiers, Fragment, renderList, renderSlot } from 'vue';
|
|
2
2
|
import { ElTooltip, ElIcon, ElScrollbar, ElSwitch } from 'element-plus';
|
|
3
3
|
import { useNamespace, useValue, useService, useEventDispatcher } from '@ctzy-web-client/web-base-client-vue';
|
|
4
4
|
import { BwaDraglist } from '../drag-list/index.mjs';
|
|
@@ -6,255 +6,201 @@ import { map } from 'rxjs';
|
|
|
6
6
|
import { dataModelDB } from '../utils/db.mjs';
|
|
7
7
|
import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
|
|
8
8
|
|
|
9
|
-
|
|
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
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const handleClose = () => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
)
|
|
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
|
-
(column) =>
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const
|
|
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
|
-
(displayColumn) => displayColumn.attrName === column.attrName
|
|
190
|
-
)
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
return [...displayColumns, ...hiddenColumns].map((column) => ({
|
|
194
|
-
name: column.name,
|
|
195
|
-
visible: column.visible,
|
|
196
|
-
}));
|
|
197
|
-
})
|
|
198
|
-
)
|
|
199
|
-
.subscribe({
|
|
200
|
-
next: (columnInfo) => {
|
|
201
|
-
dataModelDB.tableHeaderSettings.put({
|
|
202
|
-
app: unref(appName),
|
|
203
|
-
tableName: props.dataTable.name,
|
|
204
|
-
userID: unref(userID),
|
|
205
|
-
columnInfo: columnInfo,
|
|
206
|
-
});
|
|
207
|
-
},
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
scope.run(() => {
|
|
211
|
-
onScopeDispose(() => {
|
|
212
|
-
subscription.unsubscribe();
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
if (!props.dataTable.inited) {
|
|
218
|
-
useEventDispatcher(props.dataTable, 'init-completed', handleInitCompleted);
|
|
219
|
-
} else {
|
|
220
|
-
handleInitCompleted();
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return (_ctx, _cache) => {
|
|
224
|
-
const _component_RefreshRight = resolveComponent("RefreshRight");
|
|
225
|
-
const _component_Close = resolveComponent("Close");
|
|
226
|
-
|
|
227
|
-
return (openBlock(), createBlock(unref(ElTooltip), mergeProps({
|
|
228
|
-
visible: value.value,
|
|
229
|
-
"onUpdate:visible": _cache[1] || (_cache[1] = $event => ((value).value = $event))
|
|
230
|
-
}, unref(attrs), {
|
|
231
|
-
effect: "light",
|
|
232
|
-
"show-arrow": false,
|
|
233
|
-
trigger: "click",
|
|
234
|
-
"popper-class": unref(ns).b(),
|
|
235
|
-
"gpu-acceleration": false,
|
|
236
|
-
placement: "bottom",
|
|
237
|
-
"append-to": ".bwa-application"
|
|
238
|
-
}), {
|
|
239
|
-
content: withCtx(() => [
|
|
240
|
-
createElementVNode("div", {
|
|
241
|
-
class: normalizeClass(unref(ns).e('content'))
|
|
242
|
-
}, [
|
|
243
|
-
createElementVNode("div", {
|
|
244
|
-
class: normalizeClass(unref(ns).e('header'))
|
|
245
|
-
}, [
|
|
246
|
-
createTextVNode(" 表头设置 "),
|
|
247
|
-
createElementVNode("span", {
|
|
248
|
-
class: normalizeClass(unref(ns).e('tools'))
|
|
9
|
+
// Inject __name helper
|
|
10
|
+
if (typeof __name === 'undefined') {
|
|
11
|
+
function __name(obj, name) {
|
|
12
|
+
Object.defineProperty(obj, "name", {
|
|
13
|
+
value: name,
|
|
14
|
+
configurable: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const __default__ = defineComponent({ name: "BwaDataTableSetting" });
|
|
19
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
20
|
+
props: {
|
|
21
|
+
dataTable: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: [
|
|
27
|
+
"reset-columns",
|
|
28
|
+
"sort-change",
|
|
29
|
+
"close",
|
|
30
|
+
"visible-change",
|
|
31
|
+
"column-visible-change"
|
|
32
|
+
],
|
|
33
|
+
setup(__props, { emit: __emit }) {
|
|
34
|
+
;
|
|
35
|
+
const props = __props;
|
|
36
|
+
const emit = __emit;
|
|
37
|
+
const attrs = useAttrs();
|
|
38
|
+
const ns = useNamespace("datatable-settings");
|
|
39
|
+
const value = ref(false);
|
|
40
|
+
const handleClose = () => {
|
|
41
|
+
value.value = false;
|
|
42
|
+
emit("close");
|
|
43
|
+
};
|
|
44
|
+
const handleColumnVisibleChange = (column, visible) => {
|
|
45
|
+
const tableColumns = [...displaySearchedColumns.value, ...hiddenSearchedColumns.value];
|
|
46
|
+
emit("column-visible-change", tableColumns);
|
|
47
|
+
};
|
|
48
|
+
watch(value, (newValue) => {
|
|
49
|
+
emit("visible-change", newValue);
|
|
50
|
+
});
|
|
51
|
+
const appName = useValue("AppName");
|
|
52
|
+
const userService = useService("UserService");
|
|
53
|
+
const userID = computed(() => {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
return ((_b = (_a = unref(userService)) == null ? void 0 : _a.userInfo) == null ? void 0 : _b.id) || "";
|
|
56
|
+
});
|
|
57
|
+
const isShowResetColumn = computed(
|
|
58
|
+
() => !props.dataTable.isDefaultColumnSort()
|
|
59
|
+
);
|
|
60
|
+
const key = computed(
|
|
61
|
+
() => `${unref(appName)}_${props.dataTable.name}_settings`
|
|
62
|
+
);
|
|
63
|
+
const search = ref("");
|
|
64
|
+
const columns = computed(
|
|
65
|
+
() => props.dataTable.getColumns().filter((column) => column.settings.visible).filter((column) => column.settings.visible)
|
|
66
|
+
);
|
|
67
|
+
const initColumns = async () => {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
let persistentColumnInfos = [];
|
|
70
|
+
const result = await dataModelDB.tableHeaderSettings.where("[app+tableName+userID]").equals([unref(appName), props.dataTable.name, unref(userID)]).toArray();
|
|
71
|
+
if (result.length) {
|
|
72
|
+
persistentColumnInfos = (_b = (_a = result[0]) == null ? void 0 : _a.columnInfo) != null ? _b : [];
|
|
73
|
+
}
|
|
74
|
+
if (persistentColumnInfos.some((item) => typeof item === "string")) {
|
|
75
|
+
persistentColumnInfos = persistentColumnInfos.map((columnInfo) => {
|
|
76
|
+
return typeof columnInfo === "object" ? columnInfo : { name: columnInfo, visible: true };
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const _dataTable = props.dataTable;
|
|
80
|
+
let dataTableColumns = _dataTable.getColumns().slice().filter((item) => item.settings.visible);
|
|
81
|
+
persistentColumnInfos = persistentColumnInfos.filter(
|
|
82
|
+
(item) => dataTableColumns.findIndex((column) => column.name === item.name) !== -1
|
|
83
|
+
);
|
|
84
|
+
if (!persistentColumnInfos) {
|
|
85
|
+
return dataTableColumns;
|
|
86
|
+
}
|
|
87
|
+
let sortedColumns = persistentColumnInfos.map(
|
|
88
|
+
(columnInfo) => dataTableColumns.find((column) => column.name === columnInfo.name)
|
|
89
|
+
).filter(Boolean);
|
|
90
|
+
dataTableColumns = sortedColumns.concat(
|
|
91
|
+
dataTableColumns.filter(
|
|
92
|
+
(column) => !sortedColumns.find((col) => column.name === col.name)
|
|
93
|
+
)
|
|
94
|
+
);
|
|
95
|
+
for (const column of dataTableColumns) {
|
|
96
|
+
const persistentItem = persistentColumnInfos.find(
|
|
97
|
+
(item) => item.name === column.name
|
|
98
|
+
);
|
|
99
|
+
column.visible = (_c = persistentItem == null ? void 0 : persistentItem.visible) != null ? _c : column.visible;
|
|
100
|
+
}
|
|
101
|
+
props.dataTable.setDisplayColumns(
|
|
102
|
+
dataTableColumns.filter((column) => column.visible)
|
|
103
|
+
);
|
|
104
|
+
return dataTableColumns;
|
|
105
|
+
};
|
|
106
|
+
const resetColumns = () => {
|
|
107
|
+
const _dataTable = props.dataTable;
|
|
108
|
+
_dataTable.resetColumnSort();
|
|
109
|
+
emit("reset-columns");
|
|
110
|
+
};
|
|
111
|
+
const allSearchedColumns = computed(() => {
|
|
112
|
+
const _search = unref(search);
|
|
113
|
+
return unref(columns).filter((column) => column.title.indexOf(_search) > -1);
|
|
114
|
+
});
|
|
115
|
+
const hiddenSearchedColumns = computed(
|
|
116
|
+
() => unref(allSearchedColumns).filter((item) => !item.visible)
|
|
117
|
+
);
|
|
118
|
+
const displaySearchedColumns = computed(() => {
|
|
119
|
+
const _search = unref(search);
|
|
120
|
+
return props.dataTable.getDisplayColumns().filter((column) => column.settings.visible).filter((column) => column.title.indexOf(_search) > -1);
|
|
121
|
+
});
|
|
122
|
+
const handleSortChange = (sort) => {
|
|
123
|
+
const _columns = unref(columns);
|
|
124
|
+
const displayColumns = sort.map(
|
|
125
|
+
(attrName) => {
|
|
126
|
+
var _a;
|
|
127
|
+
return (_a = _columns.find((column) => column.attrName === attrName)) != null ? _a : null;
|
|
128
|
+
}
|
|
129
|
+
).filter(Boolean);
|
|
130
|
+
props.dataTable.setDisplayColumns(displayColumns);
|
|
131
|
+
const tableColumns = [...displaySearchedColumns.value, ...hiddenSearchedColumns.value];
|
|
132
|
+
emit("column-visible-change", tableColumns);
|
|
133
|
+
emit("sort-change", sort, displayColumns);
|
|
134
|
+
};
|
|
135
|
+
const scope = getCurrentScope();
|
|
136
|
+
const handleInitCompleted = async () => {
|
|
137
|
+
const dataTableColumns = await initColumns();
|
|
138
|
+
const subscription = props.dataTable.getDisplayColumnsSubject().pipe(
|
|
139
|
+
map((displayColumns) => {
|
|
140
|
+
const hiddenColumns = dataTableColumns.filter(
|
|
141
|
+
(column) => !displayColumns.find(
|
|
142
|
+
(displayColumn) => displayColumn.attrName === column.attrName
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
return [...displayColumns, ...hiddenColumns].map((column) => ({
|
|
146
|
+
name: column.name,
|
|
147
|
+
visible: column.visible
|
|
148
|
+
}));
|
|
149
|
+
})
|
|
150
|
+
).subscribe({
|
|
151
|
+
next: (columnInfo) => {
|
|
152
|
+
dataModelDB.tableHeaderSettings.put({
|
|
153
|
+
app: unref(appName),
|
|
154
|
+
tableName: props.dataTable.name,
|
|
155
|
+
userID: unref(userID),
|
|
156
|
+
columnInfo
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
scope.run(() => {
|
|
161
|
+
onScopeDispose(() => {
|
|
162
|
+
subscription.unsubscribe();
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
if (!props.dataTable.inited) {
|
|
167
|
+
useEventDispatcher(props.dataTable, "init-completed", handleInitCompleted);
|
|
168
|
+
} else {
|
|
169
|
+
handleInitCompleted();
|
|
170
|
+
}
|
|
171
|
+
return (_ctx, _cache) => {
|
|
172
|
+
const _component_RefreshRight = resolveComponent("RefreshRight");
|
|
173
|
+
const _component_Close = resolveComponent("Close");
|
|
174
|
+
return openBlock(), createBlock(unref(ElTooltip), mergeProps({
|
|
175
|
+
visible: value.value,
|
|
176
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => value.value = $event)
|
|
177
|
+
}, unref(attrs), {
|
|
178
|
+
effect: "light",
|
|
179
|
+
"show-arrow": false,
|
|
180
|
+
trigger: "click",
|
|
181
|
+
"popper-class": unref(ns).b(),
|
|
182
|
+
"gpu-acceleration": false,
|
|
183
|
+
placement: "bottom",
|
|
184
|
+
"append-to": ".bwa-application"
|
|
185
|
+
}), {
|
|
186
|
+
content: withCtx(() => [
|
|
187
|
+
createElementVNode("div", {
|
|
188
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
249
189
|
}, [
|
|
250
|
-
(
|
|
251
|
-
|
|
190
|
+
createElementVNode("div", {
|
|
191
|
+
class: normalizeClass(unref(ns).e("header"))
|
|
192
|
+
}, [
|
|
193
|
+
_cache[2] || (_cache[2] = createTextVNode(" \u8868\u5934\u8BBE\u7F6E ", -1)),
|
|
194
|
+
createElementVNode("span", {
|
|
195
|
+
class: normalizeClass(unref(ns).e("tools"))
|
|
196
|
+
}, [
|
|
197
|
+
isShowResetColumn.value ? (openBlock(), createElementBlock("span", {
|
|
252
198
|
key: 0,
|
|
253
|
-
class: normalizeClass([unref(ns).e(
|
|
199
|
+
class: normalizeClass([unref(ns).e("tools-item"), unref(ns).e("refresh")]),
|
|
254
200
|
onClick: resetColumns
|
|
255
201
|
}, [
|
|
256
202
|
createVNode(unref(ElTooltip), {
|
|
257
|
-
content: "
|
|
203
|
+
content: "\u6062\u590D\u9ED8\u8BA4",
|
|
258
204
|
"append-to": ".bwa-application"
|
|
259
205
|
}, {
|
|
260
206
|
default: withCtx(() => [
|
|
@@ -262,123 +208,135 @@ return (_ctx, _cache) => {
|
|
|
262
208
|
default: withCtx(() => [
|
|
263
209
|
createVNode(_component_RefreshRight)
|
|
264
210
|
]),
|
|
265
|
-
_: 1
|
|
211
|
+
_: 1
|
|
266
212
|
})
|
|
267
213
|
]),
|
|
268
|
-
_: 1
|
|
214
|
+
_: 1
|
|
269
215
|
})
|
|
270
|
-
], 2
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}, {
|
|
280
|
-
default: withCtx(() => [
|
|
281
|
-
createVNode(unref(ElIcon), null, {
|
|
216
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
217
|
+
createElementVNode("span", {
|
|
218
|
+
class: normalizeClass([unref(ns).e("tools-item"), unref(ns).e("close")]),
|
|
219
|
+
onClick: handleClose
|
|
220
|
+
}, [
|
|
221
|
+
createVNode(unref(ElTooltip), {
|
|
222
|
+
content: "\u5173\u95ED",
|
|
223
|
+
"append-to": ".bwa-application"
|
|
224
|
+
}, {
|
|
282
225
|
default: withCtx(() => [
|
|
283
|
-
createVNode(
|
|
226
|
+
createVNode(unref(ElIcon), null, {
|
|
227
|
+
default: withCtx(() => [
|
|
228
|
+
createVNode(_component_Close)
|
|
229
|
+
]),
|
|
230
|
+
_: 1
|
|
231
|
+
})
|
|
284
232
|
]),
|
|
285
|
-
_: 1
|
|
233
|
+
_: 1
|
|
286
234
|
})
|
|
287
|
-
])
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
(
|
|
300
|
-
|
|
235
|
+
], 2)
|
|
236
|
+
], 2)
|
|
237
|
+
], 2),
|
|
238
|
+
createCommentVNode(` <div :class="ns.e('search')">\r
|
|
239
|
+
<ElInput\r
|
|
240
|
+
v-model="search"\r
|
|
241
|
+
:clearable="true"\r
|
|
242
|
+
prefix-icon="Search"\r
|
|
243
|
+
placeholder="\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"\r
|
|
244
|
+
/>\r
|
|
245
|
+
</div> `),
|
|
246
|
+
createVNode(unref(ElScrollbar), { "max-height": "500px" }, {
|
|
247
|
+
default: withCtx(() => [
|
|
248
|
+
createElementVNode("div", {
|
|
249
|
+
class: normalizeClass(unref(ns).e("main"))
|
|
250
|
+
}, [
|
|
251
|
+
displaySearchedColumns.value.length ? (openBlock(), createElementBlock("div", {
|
|
301
252
|
key: 0,
|
|
302
|
-
class: normalizeClass(unref(ns).b(
|
|
253
|
+
class: normalizeClass(unref(ns).b("section"))
|
|
303
254
|
}, [
|
|
304
255
|
createElementVNode("div", {
|
|
305
|
-
class: normalizeClass(unref(ns).be(
|
|
306
|
-
}, "
|
|
256
|
+
class: normalizeClass(unref(ns).be("section", "header"))
|
|
257
|
+
}, "\u663E\u793A\u5B57\u6BB5", 2),
|
|
307
258
|
createVNode(unref(BwaDraglist), {
|
|
308
|
-
data:
|
|
259
|
+
data: displaySearchedColumns.value,
|
|
309
260
|
labelAttr: "title",
|
|
310
261
|
idAttr: "attrName",
|
|
311
262
|
onSortChange: handleSortChange
|
|
312
263
|
}, {
|
|
313
264
|
default: withCtx(({ item }) => [
|
|
314
265
|
createElementVNode("div", {
|
|
315
|
-
class: normalizeClass(unref(ns).be(
|
|
266
|
+
class: normalizeClass(unref(ns).be("section", "content"))
|
|
316
267
|
}, [
|
|
317
268
|
createElementVNode("div", {
|
|
318
|
-
class: normalizeClass(unref(ns).e(
|
|
269
|
+
class: normalizeClass(unref(ns).e("field-item"))
|
|
319
270
|
}, [
|
|
320
|
-
createElementVNode("span", null, toDisplayString(item.title), 1
|
|
271
|
+
createElementVNode("span", null, toDisplayString(item.title), 1),
|
|
321
272
|
createVNode(unref(ElSwitch), {
|
|
322
273
|
modelValue: item.visible,
|
|
323
|
-
"onUpdate:modelValue": $event =>
|
|
274
|
+
"onUpdate:modelValue": ($event) => item.visible = $event,
|
|
324
275
|
disabled: item.settings.disabled,
|
|
325
|
-
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
276
|
+
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
277
|
+
}, ["stop"])),
|
|
326
278
|
onChange: (val) => handleColumnVisibleChange(item, val)
|
|
327
|
-
}, null, 8
|
|
328
|
-
], 2
|
|
329
|
-
], 2
|
|
279
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "onChange"])
|
|
280
|
+
], 2)
|
|
281
|
+
], 2)
|
|
330
282
|
]),
|
|
331
|
-
_: 1
|
|
332
|
-
}, 8
|
|
333
|
-
createCommentVNode(
|
|
334
|
-
|
|
335
|
-
:
|
|
336
|
-
|
|
337
|
-
|
|
283
|
+
_: 1
|
|
284
|
+
}, 8, ["data"]),
|
|
285
|
+
createCommentVNode(` <div\r
|
|
286
|
+
v-show="!displaySearchedColumns.length"\r
|
|
287
|
+
:class="ns.be('section', 'empty')"\r
|
|
288
|
+
>\r
|
|
289
|
+
\u6682\u65E0\u5B57\u6BB5\r
|
|
290
|
+
</div> `)
|
|
291
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
292
|
+
hiddenSearchedColumns.value.length ? (openBlock(), createElementBlock("div", {
|
|
338
293
|
key: 1,
|
|
339
|
-
class: normalizeClass(unref(ns).b(
|
|
294
|
+
class: normalizeClass(unref(ns).b("section"))
|
|
340
295
|
}, [
|
|
341
296
|
createElementVNode("div", {
|
|
342
|
-
class: normalizeClass(unref(ns).be(
|
|
343
|
-
}, "
|
|
297
|
+
class: normalizeClass(unref(ns).be("section", "header"))
|
|
298
|
+
}, "\u672A\u663E\u793A\u5B57\u6BB5", 2),
|
|
344
299
|
createElementVNode("div", {
|
|
345
|
-
class: normalizeClass(unref(ns).be(
|
|
300
|
+
class: normalizeClass(unref(ns).be("section", "content"))
|
|
346
301
|
}, [
|
|
347
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
348
|
-
return
|
|
302
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(hiddenSearchedColumns.value, (column) => {
|
|
303
|
+
return openBlock(), createElementBlock("div", {
|
|
349
304
|
key: column.attrName,
|
|
350
|
-
class: normalizeClass(unref(ns).e(
|
|
305
|
+
class: normalizeClass(unref(ns).e("field-item"))
|
|
351
306
|
}, [
|
|
352
|
-
createElementVNode("span", null, toDisplayString(column.title), 1
|
|
307
|
+
createElementVNode("span", null, toDisplayString(column.title), 1),
|
|
353
308
|
createVNode(unref(ElSwitch), {
|
|
354
309
|
modelValue: column.visible,
|
|
355
|
-
"onUpdate:modelValue": $event =>
|
|
310
|
+
"onUpdate:modelValue": ($event) => column.visible = $event,
|
|
356
311
|
disabled: column.settings.disabled,
|
|
357
312
|
onChange: (val) => handleColumnVisibleChange(column, val)
|
|
358
|
-
}, null, 8
|
|
359
|
-
], 2
|
|
360
|
-
}), 128
|
|
361
|
-
], 2
|
|
362
|
-
createCommentVNode(
|
|
363
|
-
|
|
364
|
-
:
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
};
|
|
382
|
-
|
|
313
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "onChange"])
|
|
314
|
+
], 2);
|
|
315
|
+
}), 128))
|
|
316
|
+
], 2),
|
|
317
|
+
createCommentVNode(` <div\r
|
|
318
|
+
v-show="!hiddenSearchedColumns.length"\r
|
|
319
|
+
:class="ns.be('section', 'empty')"\r
|
|
320
|
+
>\r
|
|
321
|
+
\u6682\u65E0\u5B57\u6BB5\r
|
|
322
|
+
</div> `)
|
|
323
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
324
|
+
], 2)
|
|
325
|
+
]),
|
|
326
|
+
_: 1
|
|
327
|
+
})
|
|
328
|
+
], 2)
|
|
329
|
+
]),
|
|
330
|
+
default: withCtx(() => [
|
|
331
|
+
createElementVNode("span", null, [
|
|
332
|
+
renderSlot(_ctx.$slots, "default")
|
|
333
|
+
])
|
|
334
|
+
]),
|
|
335
|
+
_: 3
|
|
336
|
+
}, 16, ["visible", "popper-class"]);
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
var DataTableSettings = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "datatable-settings.vue"]]);
|
|
383
341
|
|
|
384
342
|
export { DataTableSettings as default };
|