@funcho/ui 1.1.21 → 1.1.23
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/README.md +1 -0
- package/dist/cjs/business/DataTable/DataTable.vue.js +33 -131
- package/dist/cjs/business/QueryForm/QueryForm.vue.js +248 -0
- package/dist/cjs/business/QueryForm/QueryForm.vue3.js +10 -0
- package/dist/cjs/business/QueryForm/index.js +12 -0
- package/dist/cjs/business/index.js +2 -0
- package/dist/cjs/components/ContextMenu/ContextMenu.vue.js +4 -1
- package/dist/cjs/index.js +8 -6
- package/dist/cjs/packages/ui/package.json.js +1 -1
- package/dist/esm/business/DataTable/DataTable.vue.mjs +22 -120
- package/dist/esm/business/QueryForm/QueryForm.vue.mjs +244 -0
- package/dist/esm/business/QueryForm/QueryForm.vue3.mjs +6 -0
- package/dist/esm/business/QueryForm/index.mjs +7 -0
- package/dist/esm/business/index.mjs +1 -0
- package/dist/esm/components/ContextMenu/ContextMenu.vue.mjs +5 -2
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/packages/ui/package.json.mjs +1 -1
- package/dist/style.css +38 -29
- package/dist/types/business/DataTable/DataTable.vue.d.ts +2280 -311
- package/dist/types/business/DataTable/index.d.ts +796 -301
- package/dist/types/business/QueryForm/QueryForm.types.d.ts +1 -0
- package/dist/types/business/QueryForm/QueryForm.vue.d.ts +2164 -0
- package/dist/types/business/QueryForm/index.d.ts +1628 -0
- package/dist/types/business/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
4
4
|
|
|
5
5
|
const vue = require('vue');
|
|
6
6
|
const useNamespace = require('../../hooks/use-namespace.js');
|
|
7
|
-
const index = require('../../components/Button/index.js');
|
|
7
|
+
const index$3 = require('../../components/Button/index.js');
|
|
8
8
|
require('../../components/Dialog/index.js');
|
|
9
9
|
require('../../components/ConfigProvider/index.js');
|
|
10
10
|
require('../../components/Input/index.js');
|
|
@@ -52,16 +52,16 @@ require('../../components/DescriptionsItem/index.js');
|
|
|
52
52
|
require('../../components/Empty/index.js');
|
|
53
53
|
require('../../components/Image/index.js');
|
|
54
54
|
require('../../components/ImageViewer/index.js');
|
|
55
|
-
const index$
|
|
56
|
-
const index
|
|
57
|
-
const index$
|
|
55
|
+
const index$2 = require('../../components/Pagination/index.js');
|
|
56
|
+
const index = require('../../components/Table/index.js');
|
|
57
|
+
const index$1 = require('../../components/TableColumn/index.js');
|
|
58
58
|
require('../../components/TableV2/index.js');
|
|
59
59
|
require('../../components/Tag/index.js');
|
|
60
60
|
require('../../components/Breadcrumb/index.js');
|
|
61
61
|
require('../../components/BreadcrumbItem/index.js');
|
|
62
62
|
require('../../components/Drawer/index.js');
|
|
63
63
|
require('../../components/Popconfirm/index.js');
|
|
64
|
-
|
|
64
|
+
require('../../components/IconComponent/index.js');
|
|
65
65
|
require('../../components/Popover/index.js');
|
|
66
66
|
require('../../components/Result/index.js');
|
|
67
67
|
require('../../components/Progress/index.js');
|
|
@@ -81,10 +81,10 @@ require('../../components/CodeEditor/index.js');
|
|
|
81
81
|
require('../../components/RichEditor/index.js');
|
|
82
82
|
require('../../components/LovText/index.js');
|
|
83
83
|
require('../../components/DotStatus/index.js');
|
|
84
|
-
const ProForm_vue_vue_type_script_setup_true_lang = require('../ProForm/ProForm.vue.js');
|
|
85
|
-
;/* empty css */
|
|
86
84
|
const core = require('@vueuse/core');
|
|
87
85
|
const index_vue_vue_type_script_lang = require('../../components/VNodeRenderer/index.vue.js');
|
|
86
|
+
const QueryForm_vue_vue_type_script_setup_true_lang = require('../QueryForm/QueryForm.vue.js');
|
|
87
|
+
;/* empty css */
|
|
88
88
|
|
|
89
89
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
90
90
|
...{
|
|
@@ -105,14 +105,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
105
105
|
},
|
|
106
106
|
setup(__props, { expose: __expose }) {
|
|
107
107
|
const ns = useNamespace.useNamespace("data-table");
|
|
108
|
-
const formRef = vue.ref();
|
|
109
|
-
const { height: formHeight } = core.useElementSize(formRef);
|
|
110
|
-
const hasMoreContent = vue.computed(() => {
|
|
111
|
-
return formHeight.value > 28;
|
|
112
|
-
});
|
|
113
|
-
const isExpanded = vue.ref(false);
|
|
114
108
|
const props = __props;
|
|
115
|
-
const renderActions = (actions, row, index
|
|
109
|
+
const renderActions = (actions, row, index) => {
|
|
116
110
|
return vue.h(
|
|
117
111
|
"div",
|
|
118
112
|
{
|
|
@@ -123,12 +117,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
123
117
|
return typeof action.hidden === "function" ? !action.hidden(row) : !action.hidden;
|
|
124
118
|
}).map((action) => {
|
|
125
119
|
const vnode = vue.h(
|
|
126
|
-
action.label.includes("删除") ? index.FcDangerButton : index.FcLinkButton,
|
|
120
|
+
action.label.includes("删除") ? index$3.FcDangerButton : index$3.FcLinkButton,
|
|
127
121
|
{
|
|
128
122
|
type: action.type || "primary",
|
|
129
123
|
disabled: typeof action.disabled === "function" ? action.disabled(row) : action.disabled,
|
|
130
|
-
onClick: action.label.includes("删除") ? void 0 : () => action.onClick(row, index
|
|
131
|
-
onConfirm: action.label.includes("删除") ? () => action.onClick(row, index
|
|
124
|
+
onClick: action.label.includes("删除") ? void 0 : () => action.onClick(row, index),
|
|
125
|
+
onConfirm: action.label.includes("删除") ? () => action.onClick(row, index) : void 0
|
|
132
126
|
},
|
|
133
127
|
{ default: () => action.label }
|
|
134
128
|
);
|
|
@@ -142,31 +136,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
142
136
|
]
|
|
143
137
|
);
|
|
144
138
|
};
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
return typeof tool.hidden === "function" ? !tool.hidden() : !tool.hidden;
|
|
148
|
-
}).map((tool) => {
|
|
149
|
-
const vnode = vue.h(
|
|
150
|
-
index.FcButton,
|
|
151
|
-
{
|
|
152
|
-
type: tool.type || "primary",
|
|
153
|
-
disabled: typeof tool.disabled === "function" ? tool.disabled() : tool.disabled,
|
|
154
|
-
onClick: () => tool.onClick(null, 0)
|
|
155
|
-
},
|
|
156
|
-
{ default: () => tool.label }
|
|
157
|
-
);
|
|
158
|
-
const dirs = (tool.directives || []).map((dir) => {
|
|
159
|
-
const directiveInstance = vue.resolveDirective(dir.name);
|
|
160
|
-
if (!directiveInstance) return null;
|
|
161
|
-
return [directiveInstance, dir.value, dir.arg, dir.modifiers];
|
|
162
|
-
}).filter(Boolean);
|
|
163
|
-
return dirs.length > 0 ? vue.withDirectives(vnode, dirs) : vnode;
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
const queryBoxRef = vue.ref(null);
|
|
167
|
-
const { height: queryBoxHeight } = core.useElementSize(queryBoxRef, void 0, {
|
|
168
|
-
box: "border-box"
|
|
169
|
-
});
|
|
139
|
+
const queryBoxRef = vue.ref();
|
|
140
|
+
const queryBoxHeight = vue.ref(0);
|
|
170
141
|
const paginationBoxRef = vue.ref(null);
|
|
171
142
|
const { height: paginationBoxHeight } = core.useElementSize(paginationBoxRef, void 0, {
|
|
172
143
|
box: "border-box"
|
|
@@ -176,30 +147,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
176
147
|
const maxTableHeight = vue.computed(() => {
|
|
177
148
|
return (props.height || containerHeight.value) - ((queryBoxHeight.value > 0 ? queryBoxHeight.value + 8 : 0) + paginationBoxHeight.value);
|
|
178
149
|
});
|
|
179
|
-
const searchFormFields = vue.computed(() => {
|
|
180
|
-
return props.fields.map((field) => {
|
|
181
|
-
const { type, attrs = {} } = field;
|
|
182
|
-
if (!type || type === "" || type.includes("Input")) {
|
|
183
|
-
attrs.onClear = handleSearchClick;
|
|
184
|
-
attrs.onKeyup = (event) => {
|
|
185
|
-
if (event.key === "Enter") {
|
|
186
|
-
handleSearchClick();
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
if (type?.includes("Select") || type?.includes("Cascader") || type?.includes("DatePicker")) {
|
|
191
|
-
attrs.onClear = handleSearchClick;
|
|
192
|
-
attrs.onChange = handleSearchClick;
|
|
193
|
-
}
|
|
194
|
-
if (type?.includes("Radio") || type?.includes("Checkbox")) {
|
|
195
|
-
attrs.onChange = handleSearchClick;
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
...field,
|
|
199
|
-
attrs
|
|
200
|
-
};
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
150
|
const pagination = vue.ref({
|
|
204
151
|
currentPage: 1,
|
|
205
152
|
pageSize: 20,
|
|
@@ -215,7 +162,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
215
162
|
if (tableLoading.value) {
|
|
216
163
|
return;
|
|
217
164
|
}
|
|
218
|
-
const params =
|
|
165
|
+
const params = queryBoxRef.value?.model || {};
|
|
219
166
|
try {
|
|
220
167
|
tableLoading.value = true;
|
|
221
168
|
const { data } = await props.request(
|
|
@@ -234,7 +181,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
234
181
|
loadData();
|
|
235
182
|
});
|
|
236
183
|
const handleResetClick = () => {
|
|
237
|
-
formRef.value?.resetFields();
|
|
238
184
|
pagination.value.currentPage = 1;
|
|
239
185
|
loadData();
|
|
240
186
|
};
|
|
@@ -258,72 +204,28 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
258
204
|
ref: containerRef,
|
|
259
205
|
class: vue.normalizeClass(vue.unref(ns).b())
|
|
260
206
|
}, [
|
|
261
|
-
|
|
262
|
-
key: 0,
|
|
207
|
+
vue.createVNode(QueryForm_vue_vue_type_script_setup_true_lang.default, {
|
|
263
208
|
ref_key: "queryBoxRef",
|
|
264
209
|
ref: queryBoxRef,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
class: vue.normalizeClass(vue.unref(ns).e("tools"))
|
|
279
|
-
}, [
|
|
280
|
-
hasMoreContent.value ? (vue.openBlock(), vue.createBlock(vue.unref(index.FcButton), {
|
|
281
|
-
key: 0,
|
|
282
|
-
link: "",
|
|
283
|
-
type: "primary",
|
|
284
|
-
onClick: _cache[0] || (_cache[0] = ($event) => isExpanded.value = !isExpanded.value)
|
|
285
|
-
}, {
|
|
286
|
-
default: vue.withCtx(() => [
|
|
287
|
-
vue.createTextVNode(vue.toDisplayString(isExpanded.value ? "收起" : "展开"), 1),
|
|
288
|
-
vue.createVNode(vue.unref(index$1.FcIconComponent), {
|
|
289
|
-
name: isExpanded.value ? "ArrowUp" : "ArrowDown",
|
|
290
|
-
size: 14
|
|
291
|
-
}, null, 8, ["name"])
|
|
292
|
-
]),
|
|
293
|
-
_: 1
|
|
294
|
-
})) : vue.createCommentVNode("", true),
|
|
295
|
-
__props.fields && __props.fields.length > 2 ? (vue.openBlock(), vue.createBlock(vue.unref(index.FcButton), {
|
|
296
|
-
key: 1,
|
|
297
|
-
disabled: tableLoading.value,
|
|
298
|
-
onClick: handleResetClick
|
|
299
|
-
}, {
|
|
300
|
-
default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
301
|
-
vue.createTextVNode(" 重置 ", -1)
|
|
302
|
-
])]),
|
|
303
|
-
_: 1
|
|
304
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
305
|
-
vue.createVNode(vue.unref(index.FcButton), {
|
|
306
|
-
type: "primary",
|
|
307
|
-
disabled: tableLoading.value,
|
|
308
|
-
onClick: handleSearchClick
|
|
309
|
-
}, {
|
|
310
|
-
default: vue.withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
311
|
-
vue.createTextVNode("查询", -1)
|
|
312
|
-
])]),
|
|
313
|
-
_: 1
|
|
314
|
-
}, 8, ["disabled"]),
|
|
315
|
-
vue.createVNode(index_vue_vue_type_script_lang.default, {
|
|
316
|
-
content: () => renderTools(__props.tools)
|
|
317
|
-
}, null, 8, ["content"])
|
|
318
|
-
], 2)
|
|
319
|
-
], 6)) : vue.createCommentVNode("", true),
|
|
320
|
-
vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(index$2.FcTable), vue.mergeProps(_ctx.$attrs, {
|
|
210
|
+
fields: __props.fields,
|
|
211
|
+
tools: __props.tools,
|
|
212
|
+
"btn-disabled": tableLoading.value,
|
|
213
|
+
onSearch: handleSearchClick,
|
|
214
|
+
onReset: handleResetClick,
|
|
215
|
+
onResize: _cache[0] || (_cache[0] = (e) => queryBoxHeight.value = e.height)
|
|
216
|
+
}, {
|
|
217
|
+
default: vue.withCtx(() => [
|
|
218
|
+
!_ctx.$slots.tools ? vue.renderSlot(_ctx.$slots, "tools", { key: 0 }) : vue.createCommentVNode("", true)
|
|
219
|
+
]),
|
|
220
|
+
_: 3
|
|
221
|
+
}, 8, ["fields", "tools", "btn-disabled"]),
|
|
222
|
+
vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(index.FcTable), vue.mergeProps(_ctx.$attrs, {
|
|
321
223
|
data: tableData.value,
|
|
322
224
|
border: "",
|
|
323
225
|
"max-height": maxTableHeight.value
|
|
324
226
|
}), {
|
|
325
227
|
default: vue.withCtx(() => [
|
|
326
|
-
__props.hasIndex ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
228
|
+
__props.hasIndex ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.FcTableColumn), {
|
|
327
229
|
key: "index",
|
|
328
230
|
label: "序号",
|
|
329
231
|
align: "center",
|
|
@@ -334,7 +236,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
334
236
|
"show-overflow-tooltip": false
|
|
335
237
|
})) : vue.createCommentVNode("", true),
|
|
336
238
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.columns, (item) => {
|
|
337
|
-
return vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
239
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index$1.FcTableColumn), vue.mergeProps({
|
|
338
240
|
key: item.prop
|
|
339
241
|
}, { ref_for: true }, item, {
|
|
340
242
|
"show-overflow-tooltip": item.showOverflowTooltip || true
|
|
@@ -348,7 +250,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
348
250
|
} : void 0
|
|
349
251
|
]), 1040, ["show-overflow-tooltip"]);
|
|
350
252
|
}), 128)),
|
|
351
|
-
props.actions && props.actions.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
253
|
+
props.actions && props.actions.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.FcTableColumn), {
|
|
352
254
|
key: "actions",
|
|
353
255
|
label: "操作",
|
|
354
256
|
align: "right",
|
|
@@ -368,12 +270,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
368
270
|
[_directive_loading, tableLoading.value]
|
|
369
271
|
]),
|
|
370
272
|
__props.isPagination ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
371
|
-
key:
|
|
273
|
+
key: 0,
|
|
372
274
|
ref_key: "paginationBoxRef",
|
|
373
275
|
ref: paginationBoxRef,
|
|
374
276
|
class: vue.normalizeClass(vue.unref(ns).e("pagination-box"))
|
|
375
277
|
}, [
|
|
376
|
-
vue.createVNode(vue.unref(index$
|
|
278
|
+
vue.createVNode(vue.unref(index$2.FcPagination), {
|
|
377
279
|
"page-size": pagination.value.pageSize,
|
|
378
280
|
"onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => pagination.value.pageSize = $event),
|
|
379
281
|
"current-page": pagination.value.currentPage,
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const vue = require('vue');
|
|
6
|
+
const useNamespace = require('../../hooks/use-namespace.js');
|
|
7
|
+
const index = require('../../components/Button/index.js');
|
|
8
|
+
require('../../components/Dialog/index.js');
|
|
9
|
+
require('../../components/ConfigProvider/index.js');
|
|
10
|
+
require('../../components/Input/index.js');
|
|
11
|
+
require('../../components/Tree/index.js');
|
|
12
|
+
require('../../components/Tabs/index.js');
|
|
13
|
+
require('../../components/TabPane/index.js');
|
|
14
|
+
require('../../components/Steps/index.js');
|
|
15
|
+
require('../../components/Step/index.js');
|
|
16
|
+
require('../../components/InputNumber/index.js');
|
|
17
|
+
require('../../components/Select/index.js');
|
|
18
|
+
require('../../components/Option/index.js');
|
|
19
|
+
require('../../components/DatePicker/index.js');
|
|
20
|
+
require('../../components/DatePickerPanel/index.js');
|
|
21
|
+
require('../../components/Tooltip/index.js');
|
|
22
|
+
require('../../components/Icon/index.js');
|
|
23
|
+
require('../../components/Notification/index.js');
|
|
24
|
+
require('../../components/Link/index.js');
|
|
25
|
+
require('../../components/Text/index.js');
|
|
26
|
+
require('../../components/Scrollbar/index.js');
|
|
27
|
+
require('../../components/Splitter/index.js');
|
|
28
|
+
require('../../components/SplitterPanel/index.js');
|
|
29
|
+
require('../../components/Autocomplete/index.js');
|
|
30
|
+
require('../../components/Cascader/index.js');
|
|
31
|
+
require('../../components/CascaderPanel/index.js');
|
|
32
|
+
require('../../components/Checkbox/index.js');
|
|
33
|
+
require('../../components/CheckboxGroup/index.js');
|
|
34
|
+
require('../../components/CheckboxButton/index.js');
|
|
35
|
+
require('../../components/Form/index.js');
|
|
36
|
+
require('../../components/FormItem/index.js');
|
|
37
|
+
require('../../components/InputTag/index.js');
|
|
38
|
+
require('../../components/Radio/index.js');
|
|
39
|
+
require('../../components/RadioGroup/index.js');
|
|
40
|
+
require('../../components/SelectV2/index.js');
|
|
41
|
+
require('../../components/Switch/index.js');
|
|
42
|
+
require('../../components/TimePicker/index.js');
|
|
43
|
+
require('../../components/TimeSelect/index.js');
|
|
44
|
+
require('../../components/TreeSelect/index.js');
|
|
45
|
+
require('../../components/Upload/index.js');
|
|
46
|
+
require('../../components/Avatar/index.js');
|
|
47
|
+
require('../../components/AvatarGroup/index.js');
|
|
48
|
+
require('../../components/Badge/index.js');
|
|
49
|
+
require('../../components/Card/index.js');
|
|
50
|
+
require('../../components/Descriptions/index.js');
|
|
51
|
+
require('../../components/DescriptionsItem/index.js');
|
|
52
|
+
require('../../components/Empty/index.js');
|
|
53
|
+
require('../../components/Image/index.js');
|
|
54
|
+
require('../../components/ImageViewer/index.js');
|
|
55
|
+
require('../../components/Pagination/index.js');
|
|
56
|
+
require('../../components/Table/index.js');
|
|
57
|
+
require('../../components/TableColumn/index.js');
|
|
58
|
+
require('../../components/TableV2/index.js');
|
|
59
|
+
require('../../components/Tag/index.js');
|
|
60
|
+
require('../../components/Breadcrumb/index.js');
|
|
61
|
+
require('../../components/BreadcrumbItem/index.js');
|
|
62
|
+
require('../../components/Drawer/index.js');
|
|
63
|
+
require('../../components/Popconfirm/index.js');
|
|
64
|
+
const index$1 = require('../../components/IconComponent/index.js');
|
|
65
|
+
require('../../components/Popover/index.js');
|
|
66
|
+
require('../../components/Result/index.js');
|
|
67
|
+
require('../../components/Progress/index.js');
|
|
68
|
+
require('../../components/Divider/index.js');
|
|
69
|
+
require('../../components/Dropdown/index.js');
|
|
70
|
+
require('../../components/DropdownMenu/index.js');
|
|
71
|
+
require('../../components/DropdownItem/index.js');
|
|
72
|
+
require('../../components/Menu/index.js');
|
|
73
|
+
require('../../components/SubMenu/index.js');
|
|
74
|
+
require('../../components/MenuItem/index.js');
|
|
75
|
+
require('../../components/RadioButton/index.js');
|
|
76
|
+
require('../../components/MenuItemGroup/index.js');
|
|
77
|
+
require('../../components/Collapse/index.js');
|
|
78
|
+
require('../../components/CollapseItem/index.js');
|
|
79
|
+
require('../../components/ContextMenu/index.js');
|
|
80
|
+
require('../../components/CodeEditor/index.js');
|
|
81
|
+
require('../../components/RichEditor/index.js');
|
|
82
|
+
require('../../components/LovText/index.js');
|
|
83
|
+
require('../../components/DotStatus/index.js');
|
|
84
|
+
const ProForm_vue_vue_type_script_setup_true_lang = require('../ProForm/ProForm.vue.js');
|
|
85
|
+
;/* empty css */
|
|
86
|
+
const core = require('@vueuse/core');
|
|
87
|
+
const index_vue_vue_type_script_lang = require('../../components/VNodeRenderer/index.vue.js');
|
|
88
|
+
|
|
89
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
90
|
+
...{
|
|
91
|
+
name: "FcProQueryForm",
|
|
92
|
+
inheritAttrs: false
|
|
93
|
+
},
|
|
94
|
+
__name: "QueryForm",
|
|
95
|
+
props: {
|
|
96
|
+
fields: { default: () => [] },
|
|
97
|
+
tools: { default: () => [] },
|
|
98
|
+
btnDisabled: { type: Boolean, default: false }
|
|
99
|
+
},
|
|
100
|
+
emits: ["search", "reset", "resize"],
|
|
101
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
102
|
+
const ns = useNamespace.useNamespace("query-form");
|
|
103
|
+
const queryBoxRef = vue.ref();
|
|
104
|
+
const { height: queryBoxHeight } = core.useElementSize(queryBoxRef, void 0, {
|
|
105
|
+
box: "border-box"
|
|
106
|
+
});
|
|
107
|
+
const emits = __emit;
|
|
108
|
+
vue.watch(queryBoxHeight, (newHeight) => {
|
|
109
|
+
emits("resize", { height: newHeight });
|
|
110
|
+
});
|
|
111
|
+
const formRef = vue.ref();
|
|
112
|
+
const { height: formHeight } = core.useElementSize(formRef);
|
|
113
|
+
const hasMoreContent = vue.computed(() => {
|
|
114
|
+
return formHeight.value > 28;
|
|
115
|
+
});
|
|
116
|
+
const isExpanded = vue.ref(false);
|
|
117
|
+
const props = __props;
|
|
118
|
+
const renderTools = (tools) => {
|
|
119
|
+
return tools.filter((tool) => {
|
|
120
|
+
return typeof tool.hidden === "function" ? !tool.hidden() : !tool.hidden;
|
|
121
|
+
}).map((tool) => {
|
|
122
|
+
const vnode = vue.h(
|
|
123
|
+
index.FcButton,
|
|
124
|
+
{
|
|
125
|
+
type: tool.type || "primary",
|
|
126
|
+
disabled: typeof tool.disabled === "function" ? tool.disabled() : tool.disabled,
|
|
127
|
+
onClick: () => tool.onClick(null, 0)
|
|
128
|
+
},
|
|
129
|
+
{ default: () => tool.label }
|
|
130
|
+
);
|
|
131
|
+
const dirs = (tool.directives || []).map((dir) => {
|
|
132
|
+
const directiveInstance = vue.resolveDirective(dir.name);
|
|
133
|
+
if (!directiveInstance) return null;
|
|
134
|
+
return [directiveInstance, dir.value, dir.arg, dir.modifiers];
|
|
135
|
+
}).filter(Boolean);
|
|
136
|
+
return dirs.length > 0 ? vue.withDirectives(vnode, dirs) : vnode;
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
const searchFormFields = vue.computed(() => {
|
|
140
|
+
return props.fields.map((field) => {
|
|
141
|
+
const { type, attrs = {} } = field;
|
|
142
|
+
if (!type || type === "" || type.includes("Input")) {
|
|
143
|
+
attrs.onClear = handleSearchClick;
|
|
144
|
+
attrs.onKeyup = (event) => {
|
|
145
|
+
if (event.key === "Enter") {
|
|
146
|
+
handleSearchClick();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (type?.includes("Select") || type?.includes("Cascader") || type?.includes("DatePicker")) {
|
|
151
|
+
attrs.onClear = handleSearchClick;
|
|
152
|
+
attrs.onChange = handleSearchClick;
|
|
153
|
+
}
|
|
154
|
+
if (type?.includes("Radio") || type?.includes("Checkbox")) {
|
|
155
|
+
attrs.onChange = handleSearchClick;
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
...field,
|
|
159
|
+
attrs
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
const handleResetClick = () => {
|
|
164
|
+
formRef.value?.resetFields();
|
|
165
|
+
emits("reset", formRef.value?.model || {});
|
|
166
|
+
};
|
|
167
|
+
const handleSearchClick = () => {
|
|
168
|
+
emits("search", formRef.value?.model || {});
|
|
169
|
+
};
|
|
170
|
+
__expose(
|
|
171
|
+
new Proxy(
|
|
172
|
+
{},
|
|
173
|
+
{
|
|
174
|
+
get(_, key) {
|
|
175
|
+
return formRef.value?.[key];
|
|
176
|
+
},
|
|
177
|
+
has(_, key) {
|
|
178
|
+
return key in formRef.value;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
);
|
|
183
|
+
return (_ctx, _cache) => {
|
|
184
|
+
return __props.fields && __props.fields.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
185
|
+
key: 0,
|
|
186
|
+
ref_key: "queryBoxRef",
|
|
187
|
+
ref: queryBoxRef,
|
|
188
|
+
class: vue.normalizeClass({ [vue.unref(ns).e("query-box")]: true, [vue.unref(ns).is("expanded")]: isExpanded.value }),
|
|
189
|
+
style: vue.normalizeStyle({ "--query-box-max-height": vue.unref(formHeight) + 16 + "px" })
|
|
190
|
+
}, [
|
|
191
|
+
vue.createVNode(ProForm_vue_vue_type_script_setup_true_lang.default, {
|
|
192
|
+
ref_key: "formRef",
|
|
193
|
+
ref: formRef,
|
|
194
|
+
inline: "",
|
|
195
|
+
fields: searchFormFields.value,
|
|
196
|
+
class: vue.normalizeClass(vue.unref(ns).e("query-form")),
|
|
197
|
+
"label-position": "right",
|
|
198
|
+
"label-width": hasMoreContent.value && isExpanded.value ? "auto" : "fit-content"
|
|
199
|
+
}, null, 8, ["fields", "class", "label-width"]),
|
|
200
|
+
vue.createElementVNode("div", {
|
|
201
|
+
class: vue.normalizeClass(vue.unref(ns).e("tools"))
|
|
202
|
+
}, [
|
|
203
|
+
hasMoreContent.value ? (vue.openBlock(), vue.createBlock(vue.unref(index.FcButton), {
|
|
204
|
+
key: 0,
|
|
205
|
+
link: "",
|
|
206
|
+
type: "primary",
|
|
207
|
+
onClick: _cache[0] || (_cache[0] = ($event) => isExpanded.value = !isExpanded.value)
|
|
208
|
+
}, {
|
|
209
|
+
default: vue.withCtx(() => [
|
|
210
|
+
vue.createTextVNode(vue.toDisplayString(isExpanded.value ? "收起" : "展开"), 1),
|
|
211
|
+
vue.createVNode(vue.unref(index$1.FcIconComponent), {
|
|
212
|
+
name: isExpanded.value ? "ArrowUp" : "ArrowDown",
|
|
213
|
+
size: 14
|
|
214
|
+
}, null, 8, ["name"])
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
})) : vue.createCommentVNode("", true),
|
|
218
|
+
__props.fields && __props.fields.length > 2 ? (vue.openBlock(), vue.createBlock(vue.unref(index.FcButton), {
|
|
219
|
+
key: 1,
|
|
220
|
+
disabled: __props.btnDisabled,
|
|
221
|
+
onClick: handleResetClick
|
|
222
|
+
}, {
|
|
223
|
+
default: vue.withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
224
|
+
vue.createTextVNode(" 重置 ", -1)
|
|
225
|
+
])]),
|
|
226
|
+
_: 1
|
|
227
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
228
|
+
vue.createVNode(vue.unref(index.FcButton), {
|
|
229
|
+
type: "primary",
|
|
230
|
+
disabled: __props.btnDisabled,
|
|
231
|
+
onClick: handleSearchClick
|
|
232
|
+
}, {
|
|
233
|
+
default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
234
|
+
vue.createTextVNode("查询", -1)
|
|
235
|
+
])]),
|
|
236
|
+
_: 1
|
|
237
|
+
}, 8, ["disabled"]),
|
|
238
|
+
vue.createVNode(index_vue_vue_type_script_lang.default, {
|
|
239
|
+
content: () => renderTools(__props.tools)
|
|
240
|
+
}, null, 8, ["content"]),
|
|
241
|
+
vue.renderSlot(_ctx.$slots, "tools")
|
|
242
|
+
], 2)
|
|
243
|
+
], 6)) : vue.createCommentVNode("", true);
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const QueryForm_vue_vue_type_script_setup_true_lang = require('./QueryForm.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = QueryForm_vue_vue_type_script_setup_true_lang.default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const QueryForm_vue_vue_type_script_setup_true_lang = require('./QueryForm.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
const withInstall = require('../../_utils/with-install.js');
|
|
8
|
+
|
|
9
|
+
const FcProQueryForm = withInstall.withInstall(QueryForm_vue_vue_type_script_setup_true_lang.default);
|
|
10
|
+
|
|
11
|
+
exports.FcProQueryForm = FcProQueryForm;
|
|
12
|
+
exports.default = FcProQueryForm;
|
|
@@ -9,6 +9,7 @@ const index$3 = require('./TreeCheckFilter/index.js');
|
|
|
9
9
|
const index$4 = require('./TreeTransfer/index.js');
|
|
10
10
|
const index$5 = require('./EditFormCard/index.js');
|
|
11
11
|
const index$6 = require('./FormDialog/index.js');
|
|
12
|
+
const index$7 = require('./QueryForm/index.js');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
@@ -19,3 +20,4 @@ exports.FcProTreeCheckFilter = index$3.FcProTreeCheckFilter;
|
|
|
19
20
|
exports.FcProTreeTransfer = index$4.FcProTreeTransfer;
|
|
20
21
|
exports.FcProEditFormCard = index$5.FcProEditFormCard;
|
|
21
22
|
exports.FcProFormDialog = index$6.FcProFormDialog;
|
|
23
|
+
exports.FcProQueryForm = index$7.FcProQueryForm;
|
|
@@ -5,6 +5,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
5
5
|
const vue = require('vue');
|
|
6
6
|
const index = require('../../node_modules/.pnpm/element-plus@2.13.5_patch_hash_415fe9eaeb4c26121ef1304c7dfbfaa75441fcd0d7ca1a8beb1acd12_87ac520f28bb40f5a8b03aa48269c150/node_modules/element-plus/es/components/dropdown/index.js');
|
|
7
7
|
require('../../_virtual/dayjs.min.js');
|
|
8
|
+
const useNamespace = require('../../hooks/use-namespace.js');
|
|
8
9
|
|
|
9
10
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
10
11
|
...{
|
|
@@ -16,6 +17,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
16
17
|
},
|
|
17
18
|
emits: ["command"],
|
|
18
19
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
20
|
+
const ns = useNamespace.useNamespace("context-menu");
|
|
19
21
|
const props = __props;
|
|
20
22
|
const position = vue.ref({
|
|
21
23
|
top: 0,
|
|
@@ -62,6 +64,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
62
64
|
ref: elRef,
|
|
63
65
|
"virtual-ref": triggerRef.value,
|
|
64
66
|
"show-arrow": false,
|
|
67
|
+
class: vue.normalizeClass(vue.unref(ns).b()),
|
|
65
68
|
"popper-options": {
|
|
66
69
|
modifiers: [{ name: "offset", options: { offset: [0, 0] } }]
|
|
67
70
|
},
|
|
@@ -89,7 +92,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
89
92
|
})
|
|
90
93
|
]),
|
|
91
94
|
_: 1
|
|
92
|
-
}, 8, ["virtual-ref"]);
|
|
95
|
+
}, 8, ["virtual-ref", "class"]);
|
|
93
96
|
};
|
|
94
97
|
}
|
|
95
98
|
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -7,8 +7,8 @@ const directive = require('./node_modules/.pnpm/element-plus@2.13.5_patch_hash_4
|
|
|
7
7
|
const dayjs_min = require('./_virtual/dayjs.min.js');
|
|
8
8
|
;/* empty css */
|
|
9
9
|
const lovIdRequestProvide = require('./config/lovId-request-provide.js');
|
|
10
|
-
const index$
|
|
11
|
-
const index$
|
|
10
|
+
const index$1p = require('./components/index.js');
|
|
11
|
+
const index$1q = require('./business/index.js');
|
|
12
12
|
const version = require('./version.js');
|
|
13
13
|
const index$1 = require('./components/Button/index.js');
|
|
14
14
|
const index$2 = require('./components/Dialog/index.js');
|
|
@@ -97,13 +97,14 @@ const index$1k = require('./business/TreeCheckFilter/index.js');
|
|
|
97
97
|
const index$1l = require('./business/TreeTransfer/index.js');
|
|
98
98
|
const index$1m = require('./business/EditFormCard/index.js');
|
|
99
99
|
const index$1n = require('./business/FormDialog/index.js');
|
|
100
|
+
const index$1o = require('./business/QueryForm/index.js');
|
|
100
101
|
|
|
101
|
-
const components = Object.keys(index$
|
|
102
|
-
return index$1o[key];
|
|
103
|
-
});
|
|
104
|
-
const proComponents = Object.keys(index$1p).map((key) => {
|
|
102
|
+
const components = Object.keys(index$1p).map((key) => {
|
|
105
103
|
return index$1p[key];
|
|
106
104
|
});
|
|
105
|
+
const proComponents = Object.keys(index$1q).map((key) => {
|
|
106
|
+
return index$1q[key];
|
|
107
|
+
});
|
|
107
108
|
const installComponents = [...components, ...proComponents].filter((comp) => {
|
|
108
109
|
return typeof comp === "object" && comp.name && typeof comp.install === "function";
|
|
109
110
|
});
|
|
@@ -236,5 +237,6 @@ exports.FcProTreeCheckFilter = index$1k.FcProTreeCheckFilter;
|
|
|
236
237
|
exports.FcProTreeTransfer = index$1l.FcProTreeTransfer;
|
|
237
238
|
exports.FcProEditFormCard = index$1m.FcProEditFormCard;
|
|
238
239
|
exports.FcProFormDialog = index$1n.FcProFormDialog;
|
|
240
|
+
exports.FcProQueryForm = index$1o.FcProQueryForm;
|
|
239
241
|
exports.default = index;
|
|
240
242
|
exports.install = install;
|