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