@fecp/vue 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.5.13_typescript@5.7.3_/node_modules/@vueuse/shared/index.mjs +1 -1
- package/es/node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/form/src/hooks/use-form-common-props.mjs +1 -1
- package/es/node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/input/src/input.vue2.mjs +1 -1
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +117 -80
- package/es/packages/vue/src/components/forms/formItem/FormItem.vue.mjs +2 -2
- package/es/packages/vue/src/components/forms/text/Text.vue.mjs +2 -2
- package/es/packages/vue/src/components/forms/text/index.mjs +2 -2
- package/es/packages/vue/src/components/table/Table.vue.mjs +57 -2
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +10 -1
- package/es/packages/vue/src/components/table/TableFilter.vue.mjs +267 -0
- package/es/packages/vue/src/utils/datasource.mjs +18 -0
- package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +19 -2
- package/es/packages/vue/src/utils/parseRouteParams.mjs +3 -2
- package/es/vue.css +125 -27
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +116 -79
- package/lib/packages/vue/src/components/forms/text/Text.vue.js +2 -2
- package/lib/packages/vue/src/components/table/Table.vue.js +57 -2
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +10 -1
- package/lib/packages/vue/src/components/table/TableFilter.vue.js +267 -0
- package/lib/packages/vue/src/utils/datasource.js +18 -0
- package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +19 -2
- package/lib/packages/vue/src/utils/parseRouteParams.js +3 -2
- package/lib/vue.css +125 -27
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, unref, ref, watch, computed, onMounted, nextTick, isRef, reactive, getCurrentInstance } from "vue";
|
|
2
2
|
function computedEager(fn, options) {
|
|
3
3
|
var _a;
|
|
4
4
|
const result = shallowRef();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, computed, unref, ref } from "vue";
|
|
2
2
|
import { useGlobalSize } from "../../../../hooks/use-size/index.mjs";
|
|
3
3
|
import { useProp } from "../../../../hooks/use-prop/index.mjs";
|
|
4
4
|
import { formContextKey, formItemContextKey } from "../constants.mjs";
|
|
@@ -10,7 +10,7 @@ import { useFocusController } from "../../../hooks/use-focus-controller/index.mj
|
|
|
10
10
|
import { useFormItem, useFormItemInputId } from "../../form/src/hooks/use-form-item.mjs";
|
|
11
11
|
import { ValidateComponentsMap } from "../../../utils/vue/icon.mjs";
|
|
12
12
|
import { useComposition } from "../../../hooks/use-composition/index.mjs";
|
|
13
|
-
import { UPDATE_MODEL_EVENT, CHANGE_EVENT
|
|
13
|
+
import { INPUT_EVENT, UPDATE_MODEL_EVENT, CHANGE_EVENT } from "../../../constants/event.mjs";
|
|
14
14
|
import { useCursor } from "../../../hooks/use-cursor/index.mjs";
|
|
15
15
|
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
|
|
16
16
|
import { debugWarn } from "../../../utils/error.mjs";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { getCurrentInstance, ref, onMounted,
|
|
8
|
+
import { getCurrentInstance, ref, onMounted, createElementBlock, openBlock, Fragment, createVNode, createTextVNode, withCtx, createBlock, createCommentVNode, unref, renderList, toDisplayString } from "vue";
|
|
9
9
|
import "../../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/index.mjs";
|
|
10
10
|
import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
|
|
11
11
|
import getJsonAsyncUtil from "../../../utils/getJsonAsyncUtil.mjs";
|
|
@@ -27,6 +27,7 @@ import { ElContainer } from "../../../../../../node_modules/.pnpm/element-plus@2
|
|
|
27
27
|
import { ElForm } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/form/index.mjs";
|
|
28
28
|
import De from "../../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/components/grid-layout.vue.mjs";
|
|
29
29
|
import { ElMessage } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.mjs";
|
|
30
|
+
const _hoisted_1 = ["name", "value"];
|
|
30
31
|
const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
31
32
|
inheritAttrs: false
|
|
32
33
|
}, {
|
|
@@ -57,6 +58,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
57
58
|
const dataSourceOptions = ref({});
|
|
58
59
|
const dictionaryOptions = ref({});
|
|
59
60
|
const fieldsData = ref({});
|
|
61
|
+
const hiddenFields = ref({});
|
|
60
62
|
const pageEvents = usePageEvents(() => ({
|
|
61
63
|
pageEventConfig: localConfig.value.pageEventConfig,
|
|
62
64
|
ctx,
|
|
@@ -82,6 +84,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
82
84
|
);
|
|
83
85
|
localConfig.value = option;
|
|
84
86
|
fieldsData.value = option.fieldsData.map((item) => item.component);
|
|
87
|
+
hiddenFields.value = option.hiddenFields || [];
|
|
85
88
|
initFormData();
|
|
86
89
|
await loadFieldDataSources();
|
|
87
90
|
loadEventFlow();
|
|
@@ -118,6 +121,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
118
121
|
}
|
|
119
122
|
});
|
|
120
123
|
}
|
|
124
|
+
if (hiddenFields.value && hiddenFields.value.length > 0) {
|
|
125
|
+
hiddenFields.value.forEach((field) => {
|
|
126
|
+
if (field.fieldName) {
|
|
127
|
+
data[field.fieldName] = field.value !== void 0 ? field.value : null;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
121
131
|
formData.value = data;
|
|
122
132
|
formRules.value = rules;
|
|
123
133
|
};
|
|
@@ -226,7 +236,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
226
236
|
getEventHandlers: createEventHandlers,
|
|
227
237
|
handleEvent: createHandleEvent
|
|
228
238
|
} = useEventFlow({
|
|
229
|
-
fields: fieldsData.value,
|
|
239
|
+
fields: [...fieldsData.value, ...hiddenFields.value],
|
|
230
240
|
ctx,
|
|
231
241
|
dataSources: localConfig.value.dataSources,
|
|
232
242
|
components: {
|
|
@@ -276,36 +286,52 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
276
286
|
};
|
|
277
287
|
const getFormData = () => {
|
|
278
288
|
const result = { ...formData.value };
|
|
289
|
+
const processField = (field) => {
|
|
290
|
+
const fieldName = field.fieldName;
|
|
291
|
+
const fieldType = field.fieldType;
|
|
292
|
+
if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection")) {
|
|
293
|
+
const value = result[fieldName];
|
|
294
|
+
if (Array.isArray(value)) {
|
|
295
|
+
result[fieldName] = value.join("|");
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
};
|
|
279
299
|
if (localConfig.value.fieldsData) {
|
|
280
300
|
localConfig.value.fieldsData.forEach(({ component }) => {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
}
|
|
301
|
+
processField(component);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
if (hiddenFields.value && hiddenFields.value.length > 0) {
|
|
305
|
+
hiddenFields.value.forEach((field) => {
|
|
306
|
+
processField(field);
|
|
289
307
|
});
|
|
290
308
|
}
|
|
291
309
|
return result;
|
|
292
310
|
};
|
|
293
311
|
const setFormData = (data) => {
|
|
294
312
|
const processedData = { ...data };
|
|
313
|
+
const processField = (field) => {
|
|
314
|
+
const fieldName = field.fieldName;
|
|
315
|
+
const fieldType = field.fieldType;
|
|
316
|
+
if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection")) {
|
|
317
|
+
const value = processedData[fieldName];
|
|
318
|
+
if (typeof value === "string" && value.includes("|")) {
|
|
319
|
+
processedData[fieldName] = value.split("|");
|
|
320
|
+
} else if (typeof value === "string" && value !== "") {
|
|
321
|
+
processedData[fieldName] = [value];
|
|
322
|
+
} else if (value === "" || value === null || value === void 0) {
|
|
323
|
+
processedData[fieldName] = [];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
};
|
|
295
327
|
if (localConfig.value.fieldsData) {
|
|
296
328
|
localConfig.value.fieldsData.forEach(({ component }) => {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
} else if (typeof value === "string" && value !== "") {
|
|
304
|
-
processedData[fieldName] = [value];
|
|
305
|
-
} else if (value === "" || value === null || value === void 0) {
|
|
306
|
-
processedData[fieldName] = [];
|
|
307
|
-
}
|
|
308
|
-
}
|
|
329
|
+
processField(component);
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
if (hiddenFields.value && hiddenFields.value.length > 0) {
|
|
333
|
+
hiddenFields.value.forEach((field) => {
|
|
334
|
+
processField(field);
|
|
309
335
|
});
|
|
310
336
|
}
|
|
311
337
|
Object.assign(formData.value, processedData);
|
|
@@ -323,64 +349,75 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
323
349
|
return (_ctx, _cache) => {
|
|
324
350
|
const _component_el_form = ElForm;
|
|
325
351
|
const _component_el_container = ElContainer;
|
|
326
|
-
return openBlock(),
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
352
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
353
|
+
createVNode(_component_el_container, {
|
|
354
|
+
direction: "vertical",
|
|
355
|
+
style: { "height": "100%" }
|
|
356
|
+
}, {
|
|
357
|
+
default: withCtx(() => [
|
|
358
|
+
!configLoading.value ? (openBlock(), createBlock(unref(header), {
|
|
359
|
+
key: 0,
|
|
360
|
+
pageHeaderConfig: localConfig.value.pageHeaderConfig
|
|
361
|
+
}, null, 8, ["pageHeaderConfig"])) : createCommentVNode("", true),
|
|
362
|
+
createVNode(unref(main), null, {
|
|
363
|
+
default: withCtx(() => [
|
|
364
|
+
createVNode(_component_el_form, {
|
|
365
|
+
ref_key: "formRef",
|
|
366
|
+
ref: formRef,
|
|
367
|
+
model: formData.value,
|
|
368
|
+
rules: formRules.value,
|
|
369
|
+
"label-position": localConfig.value.labelPosition,
|
|
370
|
+
style: { "padding": "18px" },
|
|
371
|
+
"validate-on-rule-change": false
|
|
372
|
+
}, {
|
|
373
|
+
default: withCtx(() => [
|
|
374
|
+
!configLoading.value ? (openBlock(), createBlock(unref(De), {
|
|
375
|
+
key: 0,
|
|
376
|
+
ref: "gridLayout",
|
|
377
|
+
layout: localConfig.value.fieldsData,
|
|
378
|
+
"onUpdate:layout": _cache[0] || (_cache[0] = ($event) => localConfig.value.fieldsData = $event),
|
|
379
|
+
"row-height": localConfig.value.labelPosition == "top" ? 90 : 60,
|
|
380
|
+
margin: [0, 0],
|
|
381
|
+
"col-num": localConfig.value.columns,
|
|
382
|
+
"is-draggable": false,
|
|
383
|
+
"is-resizable": false
|
|
384
|
+
}, {
|
|
385
|
+
item: withCtx(({ item: { component } }) => [
|
|
386
|
+
createVNode(_FormItem, {
|
|
387
|
+
modelValue: formData.value[component.fieldName],
|
|
388
|
+
"onUpdate:modelValue": ($event) => formData.value[component.fieldName] = $event,
|
|
389
|
+
config: component,
|
|
390
|
+
localConfig: localConfig.value,
|
|
391
|
+
error: getFieldError(component.fieldName),
|
|
392
|
+
formRef: formRef.value,
|
|
393
|
+
onChange: handleFieldChange
|
|
394
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "config", "localConfig", "error", "formRef"])
|
|
395
|
+
]),
|
|
396
|
+
_: 1
|
|
397
|
+
}, 8, ["layout", "row-height", "col-num"])) : createCommentVNode("", true),
|
|
398
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(hiddenFields.value, (field) => {
|
|
399
|
+
return openBlock(), createElementBlock("input", {
|
|
400
|
+
key: field.fieldName,
|
|
401
|
+
type: "hidden",
|
|
402
|
+
name: field.fieldName,
|
|
403
|
+
value: formData.value[field.fieldName]
|
|
404
|
+
}, null, 8, _hoisted_1);
|
|
405
|
+
}), 128))
|
|
406
|
+
]),
|
|
407
|
+
_: 1
|
|
408
|
+
}, 8, ["model", "rules", "label-position"])
|
|
409
|
+
]),
|
|
410
|
+
_: 1
|
|
411
|
+
}),
|
|
412
|
+
createVNode(unref(footer), {
|
|
413
|
+
pageFooterConfig: localConfig.value.pageFooterConfig,
|
|
414
|
+
onCustomButtonClick: handleCustomButtonClick
|
|
415
|
+
}, null, 8, ["pageFooterConfig"])
|
|
416
|
+
]),
|
|
417
|
+
_: 1
|
|
418
|
+
}),
|
|
419
|
+
createTextVNode(" " + toDisplayString(formData.value), 1)
|
|
420
|
+
], 64);
|
|
384
421
|
};
|
|
385
422
|
}
|
|
386
423
|
});
|
|
@@ -5,7 +5,7 @@ import "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_type
|
|
|
5
5
|
import { computed, createBlock, openBlock, createSlots, withCtx, createCommentVNode, resolveDynamicComponent, mergeProps, createElementVNode, toDisplayString, createVNode, unref } from "vue";
|
|
6
6
|
import { QuestionFilled as question_filled_default } from "../../../../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.13_typescript@5.7.3_/node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
7
7
|
import { debounce } from "../form/debounce.mjs";
|
|
8
|
-
import
|
|
8
|
+
import TextComponent from "../text/Text.vue.mjs";
|
|
9
9
|
import _sfc_main$9 from "../textarea/Textarea.vue.mjs";
|
|
10
10
|
import _sfc_main$8 from "../number/Number.vue.mjs";
|
|
11
11
|
import _sfc_main$7 from "../date/Date.vue.mjs";
|
|
@@ -53,7 +53,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
53
53
|
const props = __props;
|
|
54
54
|
const emit = __emit;
|
|
55
55
|
const componentMap = {
|
|
56
|
-
text:
|
|
56
|
+
text: TextComponent,
|
|
57
57
|
textarea: _sfc_main$9,
|
|
58
58
|
number: _sfc_main$8,
|
|
59
59
|
date: _sfc_main$7,
|
|
@@ -129,7 +129,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
-
const
|
|
132
|
+
const TextComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4b100f9c"]]);
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
TextComponent as default
|
|
135
135
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import TextComponent from "./Text.vue.mjs";
|
|
2
2
|
import install from "../../../utils/install.mjs";
|
|
3
|
-
const Text = install.withInstall("Text",
|
|
3
|
+
const Text = install.withInstall("Text", TextComponent);
|
|
4
4
|
export {
|
|
5
5
|
Text,
|
|
6
6
|
Text as default
|
|
@@ -7,6 +7,7 @@ import { createDataSource } from "../../utils/datasource.mjs";
|
|
|
7
7
|
import Pagination from "./Pagination.vue.mjs";
|
|
8
8
|
import CustomButtons from "./CustomButtons.vue.mjs";
|
|
9
9
|
import TableColumn from "./TableColumn.vue.mjs";
|
|
10
|
+
import TableFilter from "./TableFilter.vue.mjs";
|
|
10
11
|
import { getCurrentVueInstance } from "../../utils/getInstance.mjs";
|
|
11
12
|
/* empty css */
|
|
12
13
|
/* empty css */
|
|
@@ -137,7 +138,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
137
138
|
const fieldDataSources = /* @__PURE__ */ new Set();
|
|
138
139
|
const dictionaryKeys = /* @__PURE__ */ new Set();
|
|
139
140
|
for (const field of fields) {
|
|
140
|
-
if (field.fieldType === "select" && field.optionConfig) {
|
|
141
|
+
if ((field.fieldType === "select" || field.fieldType === "multipleSelection") && field.optionConfig) {
|
|
141
142
|
const { optionSource, dataSourceValue, dictionaryValue } = field.optionConfig;
|
|
142
143
|
if (optionSource === "dataSource" && dataSourceValue) {
|
|
143
144
|
fieldDataSources.add(dataSourceValue);
|
|
@@ -192,6 +193,42 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
192
193
|
console.error("Failed to load dictionary data:", error);
|
|
193
194
|
}
|
|
194
195
|
}
|
|
196
|
+
mergeOptionsToFields();
|
|
197
|
+
};
|
|
198
|
+
const mergeOptionsToFields = () => {
|
|
199
|
+
if (localConfig.value.fieldsData) {
|
|
200
|
+
localConfig.value.fieldsData.forEach((field) => {
|
|
201
|
+
if (!field.optionConfig) return;
|
|
202
|
+
const {
|
|
203
|
+
optionSource,
|
|
204
|
+
dataSourceValue,
|
|
205
|
+
dictionaryValue,
|
|
206
|
+
displayField,
|
|
207
|
+
valueField
|
|
208
|
+
} = field.optionConfig;
|
|
209
|
+
if (optionSource === "dataSource" && dataSourceOptions.value[dataSourceValue]) {
|
|
210
|
+
const rawOptions = dataSourceOptions.value[dataSourceValue];
|
|
211
|
+
const labelField = displayField || "label";
|
|
212
|
+
const keyField = valueField || "value";
|
|
213
|
+
field.optionConfig.options = rawOptions.map((item) => ({
|
|
214
|
+
label: item[labelField],
|
|
215
|
+
value: item[keyField],
|
|
216
|
+
disabled: item.disabled || false
|
|
217
|
+
}));
|
|
218
|
+
} else if (optionSource === "dictionary" && dictionaryOptions.value[dictionaryValue]) {
|
|
219
|
+
const rawOptions = dictionaryOptions.value[dictionaryValue];
|
|
220
|
+
const labelField = "optName";
|
|
221
|
+
const keyField = "optCode";
|
|
222
|
+
field.optionConfig.options = rawOptions.map((item) => ({
|
|
223
|
+
label: item[labelField],
|
|
224
|
+
value: item[keyField],
|
|
225
|
+
disabled: item.disabled || false
|
|
226
|
+
}));
|
|
227
|
+
} else if (optionSource === "custom") {
|
|
228
|
+
field.optionConfig.options = field.optionConfig.options || [];
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
195
232
|
};
|
|
196
233
|
const { handleEvent } = useEventFlow({
|
|
197
234
|
fields: localConfig.value.fieldsData,
|
|
@@ -245,6 +282,18 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
245
282
|
const handleRadioChange = (checked) => {
|
|
246
283
|
emit("selection-change", [checked.row]);
|
|
247
284
|
};
|
|
285
|
+
const handleFilterSearch = (filters) => {
|
|
286
|
+
if (dataSourceManager.value) {
|
|
287
|
+
dataSourceManager.value.updateParams(filters);
|
|
288
|
+
dataSourceManager.value.fetch();
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
const handleFilterReset = () => {
|
|
292
|
+
if (dataSourceManager.value) {
|
|
293
|
+
dataSourceManager.value.clearParams();
|
|
294
|
+
dataSourceManager.value.fetch();
|
|
295
|
+
}
|
|
296
|
+
};
|
|
248
297
|
const refresh = (options = {}) => {
|
|
249
298
|
var _a;
|
|
250
299
|
const {
|
|
@@ -373,6 +422,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
373
422
|
ref: tableContainer,
|
|
374
423
|
class: "fec-table-container"
|
|
375
424
|
}, [
|
|
425
|
+
createVNode(TableFilter, {
|
|
426
|
+
"query-config": localConfig.value.queryConfig,
|
|
427
|
+
"fields-data": localConfig.value.fieldsData,
|
|
428
|
+
onSearch: handleFilterSearch,
|
|
429
|
+
onReset: handleFilterReset
|
|
430
|
+
}, null, 8, ["query-config", "fields-data"]),
|
|
376
431
|
createVNode(CustomButtons, {
|
|
377
432
|
"custom-btns": localConfig.value.customBtns,
|
|
378
433
|
onClick: handleCustomBtnClick
|
|
@@ -434,7 +489,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
434
489
|
};
|
|
435
490
|
}
|
|
436
491
|
});
|
|
437
|
-
const _Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
492
|
+
const _Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d11bb28c"]]);
|
|
438
493
|
export {
|
|
439
494
|
_Table as default
|
|
440
495
|
};
|
|
@@ -108,6 +108,7 @@ const _sfc_main = {
|
|
|
108
108
|
}
|
|
109
109
|
return value;
|
|
110
110
|
case "select":
|
|
111
|
+
case "multipleSelection":
|
|
111
112
|
if (field.optionConfig) {
|
|
112
113
|
let options = [];
|
|
113
114
|
let displayField = "label";
|
|
@@ -125,6 +126,14 @@ const _sfc_main = {
|
|
|
125
126
|
displayField = "optName";
|
|
126
127
|
valueField = "optCode";
|
|
127
128
|
}
|
|
129
|
+
if (typeof value === "string" && value.includes("|")) {
|
|
130
|
+
const values = value.split("|");
|
|
131
|
+
const displayValues = values.map((val) => {
|
|
132
|
+
const option2 = options.find((opt) => opt[valueField] == val);
|
|
133
|
+
return option2 ? option2[displayField] : val;
|
|
134
|
+
});
|
|
135
|
+
return displayValues.join(", ");
|
|
136
|
+
}
|
|
128
137
|
const option = options.find((opt) => opt[valueField] == value);
|
|
129
138
|
return option ? option[displayField] : value;
|
|
130
139
|
}
|
|
@@ -298,7 +307,7 @@ const _sfc_main = {
|
|
|
298
307
|
};
|
|
299
308
|
}
|
|
300
309
|
};
|
|
301
|
-
const TableColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
310
|
+
const TableColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c7ca0774"]]);
|
|
302
311
|
export {
|
|
303
312
|
TableColumn as default
|
|
304
313
|
};
|