@tmagic/form 1.0.0-beta.8 → 1.0.0-rc.11
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/style.css +9 -11
- package/dist/tmagic-form.es.js +225 -141
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +228 -145
- package/dist/tmagic-form.umd.js.map +1 -1
- package/dist/types/src/containers/Col.vue.d.ts +42 -0
- package/dist/types/src/containers/Container.vue.d.ts +1 -0
- package/dist/types/src/containers/Row.vue.d.ts +0 -1
- package/dist/types/src/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/DynamicField.vue.d.ts +2 -2
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/schema.d.ts +9 -0
- package/package.json +18 -9
- package/src/Form.vue +2 -2
- package/src/FormDialog.vue +1 -1
- package/src/containers/Col.vue +56 -0
- package/src/containers/Container.vue +33 -8
- package/src/containers/GroupListItem.vue +4 -4
- package/src/containers/Row.vue +13 -17
- package/src/containers/Table.vue +15 -7
- package/src/containers/Tabs.vue +13 -5
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/Daterange.vue +8 -0
- package/src/fields/Link.vue +1 -1
- package/src/fields/Select.vue +9 -15
- package/src/fields/Text.vue +4 -4
- package/src/fields/Textarea.vue +11 -13
- package/src/schema.ts +9 -0
- package/src/theme/form.scss +24 -17
- package/src/utils/form.ts +7 -1
- package/LICENSE +0 -5432
- package/tsconfig.json +0 -9
- package/vite.config.ts +0 -27
package/dist/tmagic-form.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, watch, unref, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, provide } from 'vue';
|
|
1
|
+
import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, watch, unref, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, withModifiers, provide } from 'vue';
|
|
2
|
+
import { WarningFilled, CaretRight, CaretBottom, Delete, ArrowDown, ArrowUp, FullScreen, Grid } from '@element-plus/icons';
|
|
2
3
|
import { cloneDeep, isEqual } from 'lodash-es';
|
|
3
|
-
import { CaretRight, CaretBottom, Delete, ArrowDown, ArrowUp, FullScreen, Grid } from '@element-plus/icons';
|
|
4
4
|
import { ElMessage } from 'element-plus';
|
|
5
5
|
import Sortable from 'sortablejs';
|
|
6
6
|
import { asyncLoadJs, sleep, datetimeFormatter } from '@tmagic/utils';
|
|
@@ -59,7 +59,11 @@ const initValueItem = function(mForm, item, initValue2, value) {
|
|
|
59
59
|
asyncLoadConfig(value, initValue2, item);
|
|
60
60
|
if (name && !items && typeof initValue2[name] !== "undefined") {
|
|
61
61
|
if (typeof value[name] === "undefined") {
|
|
62
|
-
|
|
62
|
+
if (type === "number") {
|
|
63
|
+
value[name] = Number(initValue2[name]);
|
|
64
|
+
} else {
|
|
65
|
+
value[name] = typeof initValue2[name] === "object" ? cloneDeep(initValue2[name]) : initValue2[name];
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
return value;
|
|
65
69
|
}
|
|
@@ -110,7 +114,8 @@ const filterFunction = (mForm, config, props) => {
|
|
|
110
114
|
model: props.model,
|
|
111
115
|
parent: mForm?.parentValues || {},
|
|
112
116
|
formValue: mForm?.values || props.model,
|
|
113
|
-
prop: props.prop
|
|
117
|
+
prop: props.prop,
|
|
118
|
+
config: props.config
|
|
114
119
|
});
|
|
115
120
|
};
|
|
116
121
|
const display = function(mForm, config, props) {
|
|
@@ -141,7 +146,8 @@ const getRules = function(mForm, rules = [], props) {
|
|
|
141
146
|
model: props.model,
|
|
142
147
|
parent: mForm?.parentValues || {},
|
|
143
148
|
formValue: mForm?.values || props.model,
|
|
144
|
-
prop: props.prop
|
|
149
|
+
prop: props.prop,
|
|
150
|
+
config: props.config
|
|
145
151
|
}, mForm);
|
|
146
152
|
}
|
|
147
153
|
return item;
|
|
@@ -169,8 +175,9 @@ var _export_sfc = (sfc, props) => {
|
|
|
169
175
|
return target;
|
|
170
176
|
};
|
|
171
177
|
|
|
172
|
-
const _sfc_main$
|
|
178
|
+
const _sfc_main$t = defineComponent({
|
|
173
179
|
name: "m-form-container",
|
|
180
|
+
components: { WarningFilled },
|
|
174
181
|
props: {
|
|
175
182
|
labelWidth: String,
|
|
176
183
|
expandMore: Boolean,
|
|
@@ -200,7 +207,18 @@ const _sfc_main$s = defineComponent({
|
|
|
200
207
|
const expand = ref(false);
|
|
201
208
|
const name = computed(() => props.config.name || "");
|
|
202
209
|
const items = computed(() => props.config.items);
|
|
203
|
-
const itemProp = computed(() =>
|
|
210
|
+
const itemProp = computed(() => {
|
|
211
|
+
let n = "";
|
|
212
|
+
const { names } = props.config;
|
|
213
|
+
if (names?.[0]) {
|
|
214
|
+
[n] = names;
|
|
215
|
+
} else if (name.value) {
|
|
216
|
+
n = name.value;
|
|
217
|
+
} else {
|
|
218
|
+
return props.prop;
|
|
219
|
+
}
|
|
220
|
+
return `${props.prop}${props.prop ? "." : ""}${n}`;
|
|
221
|
+
});
|
|
204
222
|
const tagName = computed(() => {
|
|
205
223
|
const component = resolveComponent(`m-${items.value ? "form" : "fields"}-${type.value}`);
|
|
206
224
|
if (typeof component !== "string")
|
|
@@ -228,6 +246,7 @@ const _sfc_main$s = defineComponent({
|
|
|
228
246
|
}
|
|
229
247
|
return display(mForm, props.config.display, props);
|
|
230
248
|
});
|
|
249
|
+
const itemLabelWidth = computed(() => props.config.labelWidth || props.labelWidth);
|
|
231
250
|
watchEffect(() => {
|
|
232
251
|
expand.value = props.expandMore;
|
|
233
252
|
});
|
|
@@ -239,7 +258,8 @@ const _sfc_main$s = defineComponent({
|
|
|
239
258
|
model: props.model,
|
|
240
259
|
values: mForm?.initValues,
|
|
241
260
|
formValue: mForm?.values,
|
|
242
|
-
prop: itemProp.value
|
|
261
|
+
prop: itemProp.value,
|
|
262
|
+
config: props.config
|
|
243
263
|
});
|
|
244
264
|
}
|
|
245
265
|
if (filter === "number") {
|
|
@@ -253,7 +273,8 @@ const _sfc_main$s = defineComponent({
|
|
|
253
273
|
model: props.model,
|
|
254
274
|
values: mForm?.initValues,
|
|
255
275
|
formValue: mForm?.values,
|
|
256
|
-
prop: itemProp.value
|
|
276
|
+
prop: itemProp.value,
|
|
277
|
+
config: props.config
|
|
257
278
|
});
|
|
258
279
|
}
|
|
259
280
|
};
|
|
@@ -288,6 +309,7 @@ const _sfc_main$s = defineComponent({
|
|
|
288
309
|
itemProp,
|
|
289
310
|
items,
|
|
290
311
|
display: display$1,
|
|
312
|
+
itemLabelWidth,
|
|
291
313
|
tagName,
|
|
292
314
|
rule,
|
|
293
315
|
tooltip,
|
|
@@ -298,24 +320,25 @@ const _sfc_main$s = defineComponent({
|
|
|
298
320
|
};
|
|
299
321
|
}
|
|
300
322
|
});
|
|
301
|
-
const _hoisted_1$
|
|
323
|
+
const _hoisted_1$f = ["innerHTML"];
|
|
302
324
|
const _hoisted_2$7 = ["innerHTML"];
|
|
303
325
|
const _hoisted_3$7 = ["innerHTML"];
|
|
304
|
-
const _hoisted_4$6 =
|
|
305
|
-
const _hoisted_5$4 =
|
|
306
|
-
const _hoisted_6$3 = {
|
|
326
|
+
const _hoisted_4$6 = ["innerHTML"];
|
|
327
|
+
const _hoisted_5$4 = {
|
|
307
328
|
key: 4,
|
|
308
329
|
style: { "text-align": "center" }
|
|
309
330
|
};
|
|
310
|
-
function _sfc_render$
|
|
331
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
311
332
|
const _component_m_fields_hidden = resolveComponent("m-fields-hidden");
|
|
312
333
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
313
334
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
335
|
+
const _component_warning_filled = resolveComponent("warning-filled");
|
|
336
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
314
337
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
315
338
|
const _component_el_button = resolveComponent("el-button");
|
|
316
339
|
return _ctx.config ? (openBlock(), createElementBlock("div", {
|
|
317
340
|
key: 0,
|
|
318
|
-
style: normalizeStyle(_ctx.config.tip ? "display: flex" : ""),
|
|
341
|
+
style: normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
|
|
319
342
|
class: normalizeClass([_ctx.config.className, "m-form-container"])
|
|
320
343
|
}, [
|
|
321
344
|
_ctx.type === "hidden" ? (openBlock(), createBlock(_component_m_fields_hidden, {
|
|
@@ -334,19 +357,20 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
334
357
|
prop: _ctx.itemProp,
|
|
335
358
|
"step-active": _ctx.stepActive,
|
|
336
359
|
"expand-more": _ctx.expand,
|
|
337
|
-
"label-width": _ctx.
|
|
360
|
+
"label-width": _ctx.itemLabelWidth,
|
|
338
361
|
onChange: _ctx.onChangeHandler
|
|
339
|
-
}, null,
|
|
362
|
+
}, null, 40, ["size", "model", "config", "name", "prop", "step-active", "expand-more", "label-width", "onChange"])) : _ctx.type && _ctx.display ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
340
363
|
createVNode(_component_el_form_item, {
|
|
341
364
|
style: normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
|
|
365
|
+
class: normalizeClass({ hidden: `${_ctx.itemLabelWidth}` === "0" || !_ctx.config.text }),
|
|
342
366
|
prop: _ctx.itemProp,
|
|
343
|
-
"label-width": _ctx.
|
|
367
|
+
"label-width": _ctx.itemLabelWidth,
|
|
344
368
|
rules: _ctx.rule
|
|
345
369
|
}, {
|
|
346
370
|
label: withCtx(() => [
|
|
347
371
|
createElementVNode("span", {
|
|
348
372
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
349
|
-
}, null, 8, _hoisted_1$
|
|
373
|
+
}, null, 8, _hoisted_1$f)
|
|
350
374
|
]),
|
|
351
375
|
default: withCtx(() => [
|
|
352
376
|
_ctx.tooltip ? (openBlock(), createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -363,7 +387,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
363
387
|
disabled: _ctx.disabled,
|
|
364
388
|
prop: _ctx.itemProp,
|
|
365
389
|
onChange: _ctx.onChangeHandler
|
|
366
|
-
}, null,
|
|
390
|
+
}, null, 40, ["size", "model", "config", "name", "disabled", "prop", "onChange"]))
|
|
367
391
|
]),
|
|
368
392
|
_: 1
|
|
369
393
|
})) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.tagName), {
|
|
@@ -375,7 +399,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
375
399
|
disabled: _ctx.disabled,
|
|
376
400
|
prop: _ctx.itemProp,
|
|
377
401
|
onChange: _ctx.onChangeHandler
|
|
378
|
-
}, null,
|
|
402
|
+
}, null, 40, ["size", "model", "config", "name", "disabled", "prop", "onChange"])),
|
|
379
403
|
_ctx.extra ? (openBlock(), createElementBlock("div", {
|
|
380
404
|
key: 2,
|
|
381
405
|
innerHTML: _ctx.extra,
|
|
@@ -383,19 +407,23 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
383
407
|
}, null, 8, _hoisted_3$7)) : createCommentVNode("", true)
|
|
384
408
|
]),
|
|
385
409
|
_: 1
|
|
386
|
-
}, 8, ["style", "prop", "label-width", "rules"]),
|
|
410
|
+
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
387
411
|
_ctx.config.tip ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
388
412
|
key: 0,
|
|
389
|
-
placement: "
|
|
390
|
-
style: { "line-height": "40px", "margin-left": "5px" }
|
|
413
|
+
placement: "left"
|
|
391
414
|
}, {
|
|
392
415
|
content: withCtx(() => [
|
|
393
416
|
createElementVNode("div", {
|
|
394
417
|
innerHTML: _ctx.config.tip
|
|
395
|
-
}, null, 8,
|
|
418
|
+
}, null, 8, _hoisted_4$6)
|
|
396
419
|
]),
|
|
397
420
|
default: withCtx(() => [
|
|
398
|
-
|
|
421
|
+
createVNode(_component_el_icon, { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
422
|
+
default: withCtx(() => [
|
|
423
|
+
createVNode(_component_warning_filled)
|
|
424
|
+
]),
|
|
425
|
+
_: 1
|
|
426
|
+
})
|
|
399
427
|
]),
|
|
400
428
|
_: 1
|
|
401
429
|
})) : createCommentVNode("", true)
|
|
@@ -408,15 +436,15 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
408
436
|
size: _ctx.size,
|
|
409
437
|
"step-active": _ctx.stepActive,
|
|
410
438
|
"expand-more": _ctx.expand,
|
|
411
|
-
"label-width": _ctx.
|
|
439
|
+
"label-width": _ctx.itemLabelWidth,
|
|
412
440
|
prop: _ctx.itemProp,
|
|
413
441
|
onChange: _ctx.onChangeHandler
|
|
414
442
|
}, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
|
|
415
443
|
}), 128)) : createCommentVNode("", true)
|
|
416
444
|
], 64)) : createCommentVNode("", true),
|
|
417
|
-
_ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div",
|
|
445
|
+
_ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
|
|
418
446
|
createVNode(_component_el_button, {
|
|
419
|
-
|
|
447
|
+
text: "",
|
|
420
448
|
onClick: _ctx.expandHandler
|
|
421
449
|
}, {
|
|
422
450
|
default: withCtx(() => [
|
|
@@ -427,9 +455,9 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
427
455
|
])) : createCommentVNode("", true)
|
|
428
456
|
], 6)) : createCommentVNode("", true);
|
|
429
457
|
}
|
|
430
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
458
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
431
459
|
|
|
432
|
-
const _sfc_main$
|
|
460
|
+
const _sfc_main$s = defineComponent({
|
|
433
461
|
name: "m-form-fieldset",
|
|
434
462
|
props: {
|
|
435
463
|
labelWidth: String,
|
|
@@ -481,7 +509,7 @@ const _sfc_main$r = defineComponent({
|
|
|
481
509
|
};
|
|
482
510
|
}
|
|
483
511
|
});
|
|
484
|
-
const _hoisted_1$
|
|
512
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
485
513
|
const _hoisted_2$6 = ["innerHTML"];
|
|
486
514
|
const _hoisted_3$6 = { key: 1 };
|
|
487
515
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -495,7 +523,7 @@ const _hoisted_9$1 = {
|
|
|
495
523
|
};
|
|
496
524
|
const _hoisted_10$1 = { style: { "flex": "1" } };
|
|
497
525
|
const _hoisted_11 = ["src"];
|
|
498
|
-
function _sfc_render$
|
|
526
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
499
527
|
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
500
528
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
501
529
|
return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (openBlock(), createElementBlock("fieldset", {
|
|
@@ -515,7 +543,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
515
543
|
default: withCtx(() => [
|
|
516
544
|
createElementVNode("span", {
|
|
517
545
|
innerHTML: _ctx.config.legend
|
|
518
|
-
}, null, 8, _hoisted_1$
|
|
546
|
+
}, null, 8, _hoisted_1$e),
|
|
519
547
|
_ctx.config.extra ? (openBlock(), createElementBlock("span", {
|
|
520
548
|
key: 0,
|
|
521
549
|
innerHTML: _ctx.config.extra,
|
|
@@ -587,9 +615,9 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
587
615
|
}), 128)) : createCommentVNode("", true)
|
|
588
616
|
], 4)) : createCommentVNode("", true);
|
|
589
617
|
}
|
|
590
|
-
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
618
|
+
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
591
619
|
|
|
592
|
-
const _sfc_main$
|
|
620
|
+
const _sfc_main$r = defineComponent({
|
|
593
621
|
name: "m-form-group-list-item",
|
|
594
622
|
components: { CaretRight, CaretBottom },
|
|
595
623
|
props: {
|
|
@@ -673,11 +701,11 @@ const _sfc_main$q = defineComponent({
|
|
|
673
701
|
};
|
|
674
702
|
}
|
|
675
703
|
});
|
|
676
|
-
const _hoisted_1$
|
|
704
|
+
const _hoisted_1$d = { class: "m-fields-group-list-item" };
|
|
677
705
|
const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("\u4E0A\u79FB");
|
|
678
706
|
const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("\u4E0B\u79FB");
|
|
679
707
|
const _hoisted_4$4 = ["innerHTML"];
|
|
680
|
-
function _sfc_render$
|
|
708
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
681
709
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
682
710
|
const _component_caret_right = resolveComponent("caret-right");
|
|
683
711
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -685,7 +713,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
685
713
|
const _component_CaretRight = resolveComponent("CaretRight");
|
|
686
714
|
const _component_CaretBottom = resolveComponent("CaretBottom");
|
|
687
715
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
688
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
716
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
689
717
|
createElementVNode("div", null, [
|
|
690
718
|
createVNode(_component_el_icon, {
|
|
691
719
|
style: { "margin-right": "7px" },
|
|
@@ -697,7 +725,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
697
725
|
_: 1
|
|
698
726
|
}, 8, ["onClick"]),
|
|
699
727
|
createVNode(_component_el_button, {
|
|
700
|
-
|
|
728
|
+
text: "",
|
|
701
729
|
onClick: _ctx.expandHandler
|
|
702
730
|
}, {
|
|
703
731
|
default: withCtx(() => [
|
|
@@ -706,7 +734,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
706
734
|
_: 1
|
|
707
735
|
}, 8, ["onClick"]),
|
|
708
736
|
withDirectives(createVNode(_component_el_button, {
|
|
709
|
-
|
|
737
|
+
text: "",
|
|
710
738
|
icon: _ctx.Delete,
|
|
711
739
|
style: { "color": "#f56c6c" },
|
|
712
740
|
onClick: _ctx.removeHandler
|
|
@@ -715,7 +743,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
715
743
|
]),
|
|
716
744
|
_ctx.movable() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
717
745
|
withDirectives(createVNode(_component_el_button, {
|
|
718
|
-
|
|
746
|
+
text: "",
|
|
719
747
|
size: "small",
|
|
720
748
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.changeOrder(-1))
|
|
721
749
|
}, {
|
|
@@ -733,7 +761,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
733
761
|
[vShow, _ctx.index !== 0]
|
|
734
762
|
]),
|
|
735
763
|
withDirectives(createVNode(_component_el_button, {
|
|
736
|
-
|
|
764
|
+
text: "",
|
|
737
765
|
size: "small",
|
|
738
766
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.changeOrder(1))
|
|
739
767
|
}, {
|
|
@@ -768,9 +796,9 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
768
796
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : createCommentVNode("", true)
|
|
769
797
|
]);
|
|
770
798
|
}
|
|
771
|
-
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
799
|
+
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
772
800
|
|
|
773
|
-
const _sfc_main$
|
|
801
|
+
const _sfc_main$q = defineComponent({
|
|
774
802
|
name: "m-form-group-list",
|
|
775
803
|
components: { MFieldsGroupListItem },
|
|
776
804
|
props: {
|
|
@@ -862,7 +890,7 @@ const _sfc_main$p = defineComponent({
|
|
|
862
890
|
};
|
|
863
891
|
}
|
|
864
892
|
});
|
|
865
|
-
const _hoisted_1$
|
|
893
|
+
const _hoisted_1$c = { class: "m-fields-group-list" };
|
|
866
894
|
const _hoisted_2$4 = ["innerHTML"];
|
|
867
895
|
const _hoisted_3$4 = {
|
|
868
896
|
key: 1,
|
|
@@ -874,10 +902,10 @@ const _hoisted_5$2 = [
|
|
|
874
902
|
];
|
|
875
903
|
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
876
904
|
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
877
|
-
function _sfc_render$
|
|
905
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
878
906
|
const _component_m_fields_group_list_item = resolveComponent("m-fields-group-list-item");
|
|
879
907
|
const _component_el_button = resolveComponent("el-button");
|
|
880
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
908
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
881
909
|
_ctx.config.extra ? (openBlock(), createElementBlock("div", {
|
|
882
910
|
key: 0,
|
|
883
911
|
innerHTML: _ctx.config.extra,
|
|
@@ -921,9 +949,9 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
921
949
|
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
922
950
|
]);
|
|
923
951
|
}
|
|
924
|
-
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
952
|
+
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
925
953
|
|
|
926
|
-
const _sfc_main$
|
|
954
|
+
const _sfc_main$p = defineComponent({
|
|
927
955
|
name: "m-form-panel",
|
|
928
956
|
components: { CaretBottom, CaretRight },
|
|
929
957
|
props: {
|
|
@@ -956,7 +984,7 @@ const _sfc_main$o = defineComponent({
|
|
|
956
984
|
};
|
|
957
985
|
}
|
|
958
986
|
});
|
|
959
|
-
const _hoisted_1$
|
|
987
|
+
const _hoisted_1$b = { class: "clearfix" };
|
|
960
988
|
const _hoisted_2$3 = ["innerHTML"];
|
|
961
989
|
const _hoisted_3$3 = {
|
|
962
990
|
key: 0,
|
|
@@ -964,7 +992,7 @@ const _hoisted_3$3 = {
|
|
|
964
992
|
};
|
|
965
993
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
966
994
|
const _hoisted_5$1 = ["src"];
|
|
967
|
-
function _sfc_render$
|
|
995
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
968
996
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
969
997
|
const _component_caret_right = resolveComponent("caret-right");
|
|
970
998
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -976,7 +1004,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
976
1004
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
977
1005
|
}, {
|
|
978
1006
|
header: withCtx(() => [
|
|
979
|
-
createElementVNode("div", _hoisted_1$
|
|
1007
|
+
createElementVNode("div", _hoisted_1$b, [
|
|
980
1008
|
createElementVNode("a", {
|
|
981
1009
|
href: "javascript:",
|
|
982
1010
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1034,10 +1062,60 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1034
1062
|
_: 3
|
|
1035
1063
|
}, 8, ["body-style"])) : createCommentVNode("", true);
|
|
1036
1064
|
}
|
|
1037
|
-
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1065
|
+
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
|
|
1066
|
+
|
|
1067
|
+
const _sfc_main$o = defineComponent({
|
|
1068
|
+
props: {
|
|
1069
|
+
labelWidth: String,
|
|
1070
|
+
expandMore: Boolean,
|
|
1071
|
+
span: Number,
|
|
1072
|
+
model: {
|
|
1073
|
+
type: Object,
|
|
1074
|
+
default: () => ({})
|
|
1075
|
+
},
|
|
1076
|
+
config: {
|
|
1077
|
+
type: Object,
|
|
1078
|
+
default: () => ({})
|
|
1079
|
+
},
|
|
1080
|
+
prop: String,
|
|
1081
|
+
size: String
|
|
1082
|
+
},
|
|
1083
|
+
emits: ["change"],
|
|
1084
|
+
setup(props, { emit }) {
|
|
1085
|
+
const mForm = inject("mForm");
|
|
1086
|
+
const changeHandler = () => emit("change", props.model);
|
|
1087
|
+
return {
|
|
1088
|
+
mForm,
|
|
1089
|
+
display: computed(() => display(mForm, props.config.display, props)),
|
|
1090
|
+
changeHandler
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
});
|
|
1094
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1095
|
+
const _component_m_form_container = resolveComponent("m-form-container");
|
|
1096
|
+
const _component_el_col = resolveComponent("el-col");
|
|
1097
|
+
return withDirectives((openBlock(), createBlock(_component_el_col, { span: _ctx.span }, {
|
|
1098
|
+
default: withCtx(() => [
|
|
1099
|
+
createVNode(_component_m_form_container, {
|
|
1100
|
+
model: _ctx.model,
|
|
1101
|
+
config: _ctx.config,
|
|
1102
|
+
prop: _ctx.prop,
|
|
1103
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1104
|
+
"expand-more": _ctx.expandMore,
|
|
1105
|
+
size: _ctx.size,
|
|
1106
|
+
onChange: _ctx.changeHandler
|
|
1107
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1108
|
+
]),
|
|
1109
|
+
_: 1
|
|
1110
|
+
}, 8, ["span"])), [
|
|
1111
|
+
[vShow, _ctx.display && _ctx.config.type !== "hidden"]
|
|
1112
|
+
]);
|
|
1113
|
+
}
|
|
1114
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$l]]);
|
|
1038
1115
|
|
|
1039
1116
|
const _sfc_main$n = defineComponent({
|
|
1040
1117
|
name: "m-form-row",
|
|
1118
|
+
components: { Col },
|
|
1041
1119
|
props: {
|
|
1042
1120
|
labelWidth: String,
|
|
1043
1121
|
expandMore: Boolean,
|
|
@@ -1059,38 +1137,27 @@ const _sfc_main$n = defineComponent({
|
|
|
1059
1137
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1060
1138
|
return {
|
|
1061
1139
|
mForm,
|
|
1062
|
-
display(config) {
|
|
1063
|
-
return display(mForm, config.display, props);
|
|
1064
|
-
},
|
|
1065
1140
|
changeHandler
|
|
1066
1141
|
};
|
|
1067
1142
|
}
|
|
1068
1143
|
});
|
|
1069
1144
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1070
|
-
const
|
|
1071
|
-
const _component_el_col = resolveComponent("el-col");
|
|
1145
|
+
const _component_Col = resolveComponent("Col");
|
|
1072
1146
|
const _component_el_row = resolveComponent("el-row");
|
|
1073
1147
|
return openBlock(), createBlock(_component_el_row, { gutter: 10 }, {
|
|
1074
1148
|
default: withCtx(() => [
|
|
1075
1149
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (col, index) => {
|
|
1076
|
-
return openBlock(), createBlock(
|
|
1077
|
-
style: normalizeStyle(!_ctx.display(col) || col.type === "hidden" ? "display: none" : ""),
|
|
1150
|
+
return openBlock(), createBlock(_component_Col, {
|
|
1078
1151
|
key: col[_ctx.mForm?.keyProp || "__key"] ?? index,
|
|
1079
|
-
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
size: _ctx.size,
|
|
1089
|
-
onChange: _ctx.changeHandler
|
|
1090
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1091
|
-
]),
|
|
1092
|
-
_: 2
|
|
1093
|
-
}, 1032, ["style", "span"]);
|
|
1152
|
+
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
|
|
1153
|
+
config: col,
|
|
1154
|
+
labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1155
|
+
expandMore: _ctx.expandMore,
|
|
1156
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1157
|
+
prop: _ctx.prop,
|
|
1158
|
+
size: _ctx.size,
|
|
1159
|
+
onChange: _ctx.changeHandler
|
|
1160
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "onChange"]);
|
|
1094
1161
|
}), 128))
|
|
1095
1162
|
]),
|
|
1096
1163
|
_: 1
|
|
@@ -1423,7 +1490,7 @@ const _sfc_main$l = defineComponent({
|
|
|
1423
1490
|
}
|
|
1424
1491
|
emit("select", selection, row);
|
|
1425
1492
|
if (typeof props.config.onSelect === "function") {
|
|
1426
|
-
props.config.onSelect(mForm, { selection, row });
|
|
1493
|
+
props.config.onSelect(mForm, { selection, row, config: props.config });
|
|
1427
1494
|
}
|
|
1428
1495
|
},
|
|
1429
1496
|
toggleRowSelection(row, selected) {
|
|
@@ -1549,7 +1616,7 @@ const _sfc_main$l = defineComponent({
|
|
|
1549
1616
|
};
|
|
1550
1617
|
}
|
|
1551
1618
|
});
|
|
1552
|
-
const _hoisted_1$
|
|
1619
|
+
const _hoisted_1$a = ["innerHTML"];
|
|
1553
1620
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1554
1621
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1555
1622
|
const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
|
|
@@ -1578,7 +1645,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1578
1645
|
key: 0,
|
|
1579
1646
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1580
1647
|
innerHTML: _ctx.config.extra
|
|
1581
|
-
}, null, 8, _hoisted_1$
|
|
1648
|
+
}, null, 8, _hoisted_1$a)) : createCommentVNode("", true),
|
|
1582
1649
|
createElementVNode("div", _hoisted_2$2, [
|
|
1583
1650
|
createVNode(_component_el_tooltip, {
|
|
1584
1651
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -1619,8 +1686,8 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1619
1686
|
}, {
|
|
1620
1687
|
default: withCtx((scope) => [
|
|
1621
1688
|
withDirectives(createVNode(_component_el_button, {
|
|
1622
|
-
|
|
1623
|
-
|
|
1689
|
+
type: "danger",
|
|
1690
|
+
text: "",
|
|
1624
1691
|
icon: _ctx.Delete,
|
|
1625
1692
|
onClick: ($event) => _ctx.removeHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1626
1693
|
}, null, 8, ["icon", "onClick"]), [
|
|
@@ -1644,8 +1711,9 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1644
1711
|
createVNode(_component_el_button, {
|
|
1645
1712
|
plain: "",
|
|
1646
1713
|
size: "small",
|
|
1714
|
+
type: "primary",
|
|
1647
1715
|
icon: _ctx.ArrowUp,
|
|
1648
|
-
|
|
1716
|
+
text: "",
|
|
1649
1717
|
onClick: ($event) => _ctx.upHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1650
1718
|
onDblclick: ($event) => _ctx.topHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1651
1719
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1661,8 +1729,9 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1661
1729
|
createVNode(_component_el_button, {
|
|
1662
1730
|
plain: "",
|
|
1663
1731
|
size: "small",
|
|
1732
|
+
type: "primary",
|
|
1664
1733
|
icon: _ctx.ArrowDown,
|
|
1665
|
-
|
|
1734
|
+
text: "",
|
|
1666
1735
|
onClick: ($event) => _ctx.downHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1667
1736
|
onDblclick: ($event) => _ctx.bottomHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1668
1737
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1739,6 +1808,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1739
1808
|
key: 1,
|
|
1740
1809
|
icon: _ctx.Grid,
|
|
1741
1810
|
size: "small",
|
|
1811
|
+
type: "primary",
|
|
1742
1812
|
onClick: _ctx.toggleMode
|
|
1743
1813
|
}, {
|
|
1744
1814
|
default: withCtx(() => [
|
|
@@ -1750,6 +1820,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1750
1820
|
key: 2,
|
|
1751
1821
|
icon: _ctx.FullScreen,
|
|
1752
1822
|
size: "small",
|
|
1823
|
+
type: "primary",
|
|
1753
1824
|
onClick: _ctx.toggleFullscreen
|
|
1754
1825
|
}, {
|
|
1755
1826
|
default: withCtx(() => [
|
|
@@ -1824,11 +1895,11 @@ const tabClickHandler = (mForm, tab, props) => {
|
|
|
1824
1895
|
const { config, model, prop } = props;
|
|
1825
1896
|
tab.name = tab.paneName;
|
|
1826
1897
|
if (typeof config.onTabClick === "function") {
|
|
1827
|
-
config.onTabClick(mForm, tab, { model, formValue: mForm?.values, prop });
|
|
1898
|
+
config.onTabClick(mForm, tab, { model, formValue: mForm?.values, prop, config });
|
|
1828
1899
|
}
|
|
1829
1900
|
const tabConfig = config.items.find((item) => tab.name === item.status);
|
|
1830
1901
|
if (tabConfig && typeof tabConfig.onTabClick === "function") {
|
|
1831
|
-
tabConfig.onTabClick(mForm, tab, { model, formValue: mForm?.values, prop });
|
|
1902
|
+
tabConfig.onTabClick(mForm, tab, { model, formValue: mForm?.values, prop, config });
|
|
1832
1903
|
}
|
|
1833
1904
|
};
|
|
1834
1905
|
const Tab = defineComponent({
|
|
@@ -1883,7 +1954,11 @@ const Tab = defineComponent({
|
|
|
1883
1954
|
if (!props.config.name)
|
|
1884
1955
|
throw new Error("dynamic tab \u5FC5\u987B\u914D\u7F6Ename");
|
|
1885
1956
|
if (typeof props.config.onTabAdd === "function") {
|
|
1886
|
-
props.config.onTabAdd(mForm, {
|
|
1957
|
+
props.config.onTabAdd(mForm, {
|
|
1958
|
+
model: props.model,
|
|
1959
|
+
prop: props.prop,
|
|
1960
|
+
config: props.config
|
|
1961
|
+
});
|
|
1887
1962
|
} else if (tabs.value.length > 0) {
|
|
1888
1963
|
const newObj = cloneDeep(tabs.value[0]);
|
|
1889
1964
|
newObj.title = `\u6807\u7B7E${tabs.value.length + 1}`;
|
|
@@ -1896,7 +1971,11 @@ const Tab = defineComponent({
|
|
|
1896
1971
|
if (!props.config.name)
|
|
1897
1972
|
throw new Error("dynamic tab \u5FC5\u987B\u914D\u7F6Ename");
|
|
1898
1973
|
if (typeof props.config.onTabRemove === "function") {
|
|
1899
|
-
props.config.onTabRemove(mForm, tabName, {
|
|
1974
|
+
props.config.onTabRemove(mForm, tabName, {
|
|
1975
|
+
model: props.model,
|
|
1976
|
+
prop: props.prop,
|
|
1977
|
+
config: props.config
|
|
1978
|
+
});
|
|
1900
1979
|
} else {
|
|
1901
1980
|
props.model[props.config.name].splice(+tabName, 1);
|
|
1902
1981
|
if (tabName < activeTabName.value || activeTabName.value >= props.model[props.config.name].length) {
|
|
@@ -1911,7 +1990,7 @@ const Tab = defineComponent({
|
|
|
1911
1990
|
changeHandler: () => {
|
|
1912
1991
|
emit("change", props.model);
|
|
1913
1992
|
if (typeof props.config.onChange === "function") {
|
|
1914
|
-
props.config.onChange(mForm, { model: props.model });
|
|
1993
|
+
props.config.onChange(mForm, { model: props.model, prop: props.prop, config: props.config });
|
|
1915
1994
|
}
|
|
1916
1995
|
}
|
|
1917
1996
|
};
|
|
@@ -2100,13 +2179,13 @@ const _sfc_main$j = defineComponent({
|
|
|
2100
2179
|
};
|
|
2101
2180
|
}
|
|
2102
2181
|
});
|
|
2103
|
-
const _hoisted_1$
|
|
2182
|
+
const _hoisted_1$9 = {
|
|
2104
2183
|
class: "m-cascader",
|
|
2105
2184
|
style: { "width": "100%" }
|
|
2106
2185
|
};
|
|
2107
2186
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2108
2187
|
const _component_el_cascader = resolveComponent("el-cascader");
|
|
2109
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2188
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2110
2189
|
createVNode(_component_el_cascader, {
|
|
2111
2190
|
modelValue: _ctx.model[_ctx.name],
|
|
2112
2191
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2146,7 +2225,7 @@ const _sfc_main$i = defineComponent({
|
|
|
2146
2225
|
} else {
|
|
2147
2226
|
return props.config.activeValue;
|
|
2148
2227
|
}
|
|
2149
|
-
return
|
|
2228
|
+
return void 0;
|
|
2150
2229
|
}),
|
|
2151
2230
|
inactiveValue: computed(() => {
|
|
2152
2231
|
if (typeof props.config.inactiveValue === "undefined") {
|
|
@@ -2156,7 +2235,7 @@ const _sfc_main$i = defineComponent({
|
|
|
2156
2235
|
} else {
|
|
2157
2236
|
return props.config.inactiveValue;
|
|
2158
2237
|
}
|
|
2159
|
-
return
|
|
2238
|
+
return void 0;
|
|
2160
2239
|
}),
|
|
2161
2240
|
changeHandler(value) {
|
|
2162
2241
|
emit("change", value);
|
|
@@ -2229,7 +2308,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2229
2308
|
}
|
|
2230
2309
|
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
|
|
2231
2310
|
|
|
2232
|
-
const _hoisted_1$
|
|
2311
|
+
const _hoisted_1$8 = { key: 0 };
|
|
2233
2312
|
const __default__$2 = defineComponent({
|
|
2234
2313
|
name: "m-fields-color-picker"
|
|
2235
2314
|
});
|
|
@@ -2249,7 +2328,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
2249
2328
|
const changeHandler = (value) => emit("change", value);
|
|
2250
2329
|
return (_ctx, _cache) => {
|
|
2251
2330
|
const _component_el_color_picker = resolveComponent("el-color-picker");
|
|
2252
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2331
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
2253
2332
|
createVNode(_component_el_color_picker, {
|
|
2254
2333
|
modelValue: _ctx.model[_ctx.name],
|
|
2255
2334
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2285,10 +2364,10 @@ const _sfc_main$f = defineComponent({
|
|
|
2285
2364
|
};
|
|
2286
2365
|
}
|
|
2287
2366
|
});
|
|
2288
|
-
const _hoisted_1$
|
|
2367
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2289
2368
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2290
2369
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2291
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2370
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2292
2371
|
createVNode(_component_el_date_picker, {
|
|
2293
2372
|
modelValue: _ctx.model[_ctx.modelName],
|
|
2294
2373
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
|
|
@@ -2334,6 +2413,14 @@ const _sfc_main$e = defineComponent({
|
|
|
2334
2413
|
});
|
|
2335
2414
|
} else if (props.model && props.name && v instanceof Date) {
|
|
2336
2415
|
props.model[props.name] = datetimeFormatter(v.toString(), "");
|
|
2416
|
+
} else if (names?.length) {
|
|
2417
|
+
names.forEach((item) => {
|
|
2418
|
+
if (props.model) {
|
|
2419
|
+
props.model[item] = void 0;
|
|
2420
|
+
}
|
|
2421
|
+
});
|
|
2422
|
+
} else if (props.name) {
|
|
2423
|
+
props.model[props.name] = void 0;
|
|
2337
2424
|
}
|
|
2338
2425
|
};
|
|
2339
2426
|
return {
|
|
@@ -2392,10 +2479,10 @@ const _sfc_main$d = defineComponent({
|
|
|
2392
2479
|
};
|
|
2393
2480
|
}
|
|
2394
2481
|
});
|
|
2395
|
-
const _hoisted_1$
|
|
2482
|
+
const _hoisted_1$6 = { key: 0 };
|
|
2396
2483
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2397
2484
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2398
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2485
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
2399
2486
|
createVNode(_component_el_date_picker, {
|
|
2400
2487
|
modelValue: _ctx.model[_ctx.name],
|
|
2401
2488
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2412,7 +2499,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2412
2499
|
}
|
|
2413
2500
|
var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
2414
2501
|
|
|
2415
|
-
const _hoisted_1$
|
|
2502
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2416
2503
|
const __default__$1 = defineComponent({
|
|
2417
2504
|
name: "m-fields-display"
|
|
2418
2505
|
});
|
|
@@ -2433,7 +2520,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2433
2520
|
}
|
|
2434
2521
|
useAddField(props.prop);
|
|
2435
2522
|
return (_ctx, _cache) => {
|
|
2436
|
-
return _ctx.model ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
2523
|
+
return _ctx.model ? (openBlock(), createElementBlock("span", _hoisted_1$5, toDisplayString(_ctx.model[unref(n)]), 1)) : createCommentVNode("", true);
|
|
2437
2524
|
};
|
|
2438
2525
|
}
|
|
2439
2526
|
});
|
|
@@ -2503,12 +2590,12 @@ const _sfc_main$b = defineComponent({
|
|
|
2503
2590
|
}
|
|
2504
2591
|
}
|
|
2505
2592
|
});
|
|
2506
|
-
const _hoisted_1$
|
|
2593
|
+
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2507
2594
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2508
2595
|
const _component_el_input = resolveComponent("el-input");
|
|
2509
2596
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
2510
2597
|
const _component_el_form = resolveComponent("el-form");
|
|
2511
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2598
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2512
2599
|
createVNode(_component_el_form, { size: "small" }, {
|
|
2513
2600
|
default: withCtx(() => [
|
|
2514
2601
|
(openBlock(true), createElementBlock(Fragment, null, renderList(Object.keys(_ctx.fieldMap.value), (key) => {
|
|
@@ -2630,7 +2717,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
2630
2717
|
};
|
|
2631
2718
|
}
|
|
2632
2719
|
});
|
|
2633
|
-
const _hoisted_1$
|
|
2720
|
+
const _hoisted_1$3 = ["href"];
|
|
2634
2721
|
const _hoisted_2$1 = {
|
|
2635
2722
|
key: 2,
|
|
2636
2723
|
class: "m-fields-link"
|
|
@@ -2644,12 +2731,13 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2644
2731
|
target: "_blank",
|
|
2645
2732
|
href: _ctx.href,
|
|
2646
2733
|
style: normalizeStyle(_ctx.config.css || {})
|
|
2647
|
-
}, toDisplayString(_ctx.displayText), 13, _hoisted_1$
|
|
2734
|
+
}, toDisplayString(_ctx.displayText), 13, _hoisted_1$3)) : _ctx.config.href && _ctx.disabled ? (openBlock(), createElementBlock("span", {
|
|
2648
2735
|
key: 1,
|
|
2649
2736
|
style: normalizeStyle(_ctx.config.disabledCss || {})
|
|
2650
2737
|
}, toDisplayString(_ctx.displayText), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
2651
2738
|
createVNode(_component_el_button, {
|
|
2652
|
-
|
|
2739
|
+
text: "",
|
|
2740
|
+
type: "primary",
|
|
2653
2741
|
onClick: _ctx.editHandler
|
|
2654
2742
|
}, {
|
|
2655
2743
|
default: withCtx(() => [
|
|
@@ -2829,7 +2917,8 @@ const _sfc_main$6 = defineComponent({
|
|
|
2829
2917
|
body = body(mForm, {
|
|
2830
2918
|
model: props.model,
|
|
2831
2919
|
formValue: mForm?.values,
|
|
2832
|
-
formValues: mForm?.values
|
|
2920
|
+
formValues: mForm?.values,
|
|
2921
|
+
config: props.config
|
|
2833
2922
|
});
|
|
2834
2923
|
}
|
|
2835
2924
|
body.query = query.value;
|
|
@@ -2852,7 +2941,8 @@ const _sfc_main$6 = defineComponent({
|
|
|
2852
2941
|
res = option.afterRequest(mForm, res, {
|
|
2853
2942
|
model: props.model,
|
|
2854
2943
|
formValue: mForm?.values,
|
|
2855
|
-
formValues: mForm?.values
|
|
2944
|
+
formValues: mForm?.values,
|
|
2945
|
+
config: props.config
|
|
2856
2946
|
});
|
|
2857
2947
|
}
|
|
2858
2948
|
const optionsData = res[option.root];
|
|
@@ -2942,8 +3032,10 @@ const _sfc_main$6 = defineComponent({
|
|
|
2942
3032
|
watch(() => mForm?.values, () => {
|
|
2943
3033
|
typeof props.config.options === "function" && Promise.resolve(props.config.options(mForm, {
|
|
2944
3034
|
model: props.model,
|
|
3035
|
+
prop: props.prop,
|
|
2945
3036
|
formValues: mForm?.values,
|
|
2946
|
-
formValue: mForm?.values
|
|
3037
|
+
formValue: mForm?.values,
|
|
3038
|
+
config: props.config
|
|
2947
3039
|
})).then((data) => {
|
|
2948
3040
|
options.value = data;
|
|
2949
3041
|
});
|
|
@@ -2992,11 +3084,10 @@ const _sfc_main$6 = defineComponent({
|
|
|
2992
3084
|
options,
|
|
2993
3085
|
moreLoadingVisible,
|
|
2994
3086
|
popperClass: mForm?.popperClass,
|
|
3087
|
+
getOptions,
|
|
2995
3088
|
getRequestFuc() {
|
|
2996
3089
|
return getConfig("request");
|
|
2997
3090
|
},
|
|
2998
|
-
async getInitOption() {
|
|
2999
|
-
},
|
|
3000
3091
|
changeHandler(value) {
|
|
3001
3092
|
emit("change", value);
|
|
3002
3093
|
},
|
|
@@ -3013,10 +3104,6 @@ const _sfc_main$6 = defineComponent({
|
|
|
3013
3104
|
options.value = await getOptions();
|
|
3014
3105
|
}
|
|
3015
3106
|
},
|
|
3016
|
-
async editAfterAction() {
|
|
3017
|
-
pgIndex.value = 0;
|
|
3018
|
-
options.value = await getOptions();
|
|
3019
|
-
},
|
|
3020
3107
|
async remoteMethod(q) {
|
|
3021
3108
|
if (!localOptions.value.length) {
|
|
3022
3109
|
query.value = q;
|
|
@@ -3031,7 +3118,7 @@ const _sfc_main$6 = defineComponent({
|
|
|
3031
3118
|
};
|
|
3032
3119
|
}
|
|
3033
3120
|
});
|
|
3034
|
-
const _hoisted_1$
|
|
3121
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3035
3122
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3036
3123
|
const _component_el_option = resolveComponent("el-option");
|
|
3037
3124
|
const _component_el_option_group = resolveComponent("el-option-group");
|
|
@@ -3053,21 +3140,21 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3053
3140
|
"value-key": _ctx.config.valueKey || "value",
|
|
3054
3141
|
"allow-create": _ctx.config.allowCreate,
|
|
3055
3142
|
disabled: _ctx.disabled,
|
|
3056
|
-
"remote-method": _ctx.remoteMethod,
|
|
3143
|
+
"remote-method": _ctx.config.remote && _ctx.remoteMethod,
|
|
3057
3144
|
onChange: _ctx.changeHandler,
|
|
3058
3145
|
onVisibleChange: _ctx.visibleHandler
|
|
3059
3146
|
}, {
|
|
3060
3147
|
default: withCtx(() => [
|
|
3061
3148
|
_ctx.config.group ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (group, index) => {
|
|
3062
3149
|
return openBlock(), createBlock(_component_el_option_group, {
|
|
3063
|
-
key:
|
|
3150
|
+
key: index,
|
|
3064
3151
|
label: group.label,
|
|
3065
3152
|
disabled: group.disabled
|
|
3066
3153
|
}, {
|
|
3067
3154
|
default: withCtx(() => [
|
|
3068
3155
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (item, index2) => {
|
|
3069
3156
|
return openBlock(), createBlock(_component_el_option, {
|
|
3070
|
-
key:
|
|
3157
|
+
key: index2,
|
|
3071
3158
|
label: item.label,
|
|
3072
3159
|
value: item.value,
|
|
3073
3160
|
disabled: item.disabled
|
|
@@ -3084,7 +3171,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3084
3171
|
disabled: option.disabled
|
|
3085
3172
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3086
3173
|
}), 128)),
|
|
3087
|
-
_ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$
|
|
3174
|
+
_ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3088
3175
|
[_directive_loading, true]
|
|
3089
3176
|
]) : createCommentVNode("", true)
|
|
3090
3177
|
]),
|
|
@@ -3161,6 +3248,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3161
3248
|
},
|
|
3162
3249
|
emits: ["change", "input"],
|
|
3163
3250
|
setup(props, { emit }) {
|
|
3251
|
+
const mForm = inject("mForm");
|
|
3164
3252
|
useAddField(props.prop);
|
|
3165
3253
|
const modelName = computed(() => props.name || props.config.name || "");
|
|
3166
3254
|
return {
|
|
@@ -3169,12 +3257,10 @@ const _sfc_main$4 = defineComponent({
|
|
|
3169
3257
|
emit("change", v);
|
|
3170
3258
|
},
|
|
3171
3259
|
inputHandler(v) {
|
|
3172
|
-
const mForm = inject("mForm");
|
|
3173
3260
|
emit("input", v);
|
|
3174
3261
|
mForm?.$emit("field-input", props.prop, v);
|
|
3175
3262
|
},
|
|
3176
3263
|
buttonClickHandler() {
|
|
3177
|
-
const mForm = inject("mForm");
|
|
3178
3264
|
if (typeof props.config.append === "string")
|
|
3179
3265
|
return;
|
|
3180
3266
|
if (props.config.append?.handler) {
|
|
@@ -3238,7 +3324,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3238
3324
|
};
|
|
3239
3325
|
}
|
|
3240
3326
|
});
|
|
3241
|
-
const _hoisted_1$
|
|
3327
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3242
3328
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3243
3329
|
const _component_el_button = resolveComponent("el-button");
|
|
3244
3330
|
const _component_el_input = resolveComponent("el-input");
|
|
@@ -3256,17 +3342,18 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3256
3342
|
_ctx.config.append ? {
|
|
3257
3343
|
name: "append",
|
|
3258
3344
|
fn: withCtx(() => [
|
|
3259
|
-
typeof _ctx.config.append === "string" ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
3345
|
+
typeof _ctx.config.append === "string" ? (openBlock(), createElementBlock("span", _hoisted_1$1, toDisplayString(_ctx.config.append), 1)) : createCommentVNode("", true),
|
|
3260
3346
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (openBlock(), createBlock(_component_el_button, {
|
|
3261
3347
|
key: 1,
|
|
3262
3348
|
style: { "color": "#409eff" },
|
|
3263
|
-
|
|
3349
|
+
size: _ctx.size,
|
|
3350
|
+
onClick: withModifiers(_ctx.buttonClickHandler, ["prevent"])
|
|
3264
3351
|
}, {
|
|
3265
3352
|
default: withCtx(() => [
|
|
3266
3353
|
createTextVNode(toDisplayString(_ctx.config.append.text), 1)
|
|
3267
3354
|
]),
|
|
3268
3355
|
_: 1
|
|
3269
|
-
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
3356
|
+
}, 8, ["size", "onClick"])) : createCommentVNode("", true)
|
|
3270
3357
|
])
|
|
3271
3358
|
} : void 0
|
|
3272
3359
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
@@ -3305,22 +3392,19 @@ const _sfc_main$3 = defineComponent({
|
|
|
3305
3392
|
};
|
|
3306
3393
|
}
|
|
3307
3394
|
});
|
|
3308
|
-
const _hoisted_1$1 = { key: 0 };
|
|
3309
3395
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3310
3396
|
const _component_el_input = resolveComponent("el-input");
|
|
3311
|
-
return
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"])
|
|
3323
|
-
])) : createCommentVNode("", true);
|
|
3397
|
+
return openBlock(), createBlock(_component_el_input, {
|
|
3398
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3399
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3400
|
+
type: "textarea",
|
|
3401
|
+
size: _ctx.size,
|
|
3402
|
+
clearable: "",
|
|
3403
|
+
placeholder: _ctx.config.placeholder,
|
|
3404
|
+
disabled: _ctx.disabled,
|
|
3405
|
+
onChange: _ctx.changeHandler,
|
|
3406
|
+
onInput: _ctx.inputHandler
|
|
3407
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3324
3408
|
}
|
|
3325
3409
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3326
3410
|
|
|
@@ -3468,7 +3552,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
3468
3552
|
submitForm: async (native) => {
|
|
3469
3553
|
try {
|
|
3470
3554
|
await elForm.value?.validate();
|
|
3471
|
-
return native ? values.value : cloneDeep(values.value);
|
|
3555
|
+
return native ? values.value : cloneDeep(toRaw(values.value));
|
|
3472
3556
|
} catch (invalidFields) {
|
|
3473
3557
|
const error = [];
|
|
3474
3558
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|
|
@@ -3720,7 +3804,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3720
3804
|
}
|
|
3721
3805
|
var FormDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
3722
3806
|
|
|
3723
|
-
var index$1 =
|
|
3807
|
+
var index$1 = /* #__PURE__ */ (() => ".m-form-dialog .el-dialog__body {\n padding: 0 !important;\n}\n.m-form-dialog .m-dialog-body {\n padding: 0 20px;\n}\n.m-form-dialog .el-table .m-form-item .el-form-item {\n margin-bottom: 0;\n}\n\n.fade-enter-active,\n.fade-leave-active {\n transition: opacity 0.5s;\n}\n\n.fade-enter, .fade-leave-to {\n opacity: 0;\n}\n\n.m-form .m-form-tip {\n color: rgba(0, 0, 0, 0.45);\n font-size: 12px;\n transition: color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);\n}\n.m-form .m-form-schematic {\n max-width: 50%;\n height: 100%;\n}\n.m-form .el-table .cell > div.m-form-container {\n display: block;\n}\n.m-form .el-tabs {\n margin-bottom: 10px;\n}\n.m-form .el-form-item.hidden .el-form-item__label {\n display: none;\n}\n\n.magic-datetime-picker-popper .el-picker-panel__footer button:first-child {\n display: none;\n}\n\ndiv.m-fields-link {\n width: fit-content;\n}\n\nfieldset.m-fieldset {\n position: relative;\n border: 1px solid rgb(229, 229, 229);\n margin-top: 10px;\n margin-bottom: 10px;\n min-inline-size: auto;\n}\nfieldset.m-fieldset legend {\n font-size: 14px;\n position: absolute;\n border: 0;\n top: -10px;\n left: 20px;\n background: rgb(255, 255, 255);\n width: auto;\n padding: 0px 3px;\n font-weight: bold;\n line-height: 20px;\n}\nfieldset.m-fieldset .m-form-tip {\n margin-left: 5px;\n}\n\n.m-fields-group-list .el-button--text {\n padding: 0;\n margin-bottom: 7px;\n}\n.m-fields-group-list .el-tree-node__expand-icon {\n padding: 0;\n margin-bottom: 7px;\n}\n.m-fields-group-list .el-tree-node__expand-icon.expand {\n transform: rotate(90deg);\n}\n.m-fields-group-list .m-fields-group-list-item {\n border-bottom: 1px solid #ebeef5;\n margin-bottom: 7px;\n}\n.m-fields-group-list .m-fields-group-list-item:last-of-type {\n border-bottom: 0;\n}\n\n.m-form-panel .el-card__header:hover {\n background: #f2f6fc;\n}\n.m-form-panel .el-card__header a {\n color: #409eff;\n}\n.m-form-panel .el-card__body {\n padding: 10px;\n}\n.m-form-panel .m-form-tip {\n margin-left: 5px;\n}\n\n.m-fields-table {\n width: 100%;\n}\n.m-fields-table.fixed {\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n z-index: 100;\n}\n.m-fields-table.fixed::before {\n content: \" \";\n display: block;\n background: rgba(0, 0, 0, 0.5);\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n z-index: 100;\n}\n.m-fields-table.fixed > .el-form-item__content {\n z-index: 101;\n position: relative;\n margin: 10vh auto;\n max-width: fit-content;\n}\n.m-fields-table.fixed table {\n width: 95vw !important;\n}\n.m-fields-table th {\n background-color: #f2f2f2 !important;\n color: #333 !important;\n}\n.m-fields-table .el-table th {\n padding: 0 !important;\n}\n.m-fields-table .el-table__column--dropable {\n cursor: move;\n}\n.m-fields-table .el-form-item__content .el-input-group {\n vertical-align: middle;\n}\n.m-fields-table.m-fields-table-item-extra tr.expanded td {\n border-bottom: 0;\n}\n.m-fields-table .el-table__expanded-cell .m-form-tip {\n margin-left: 80px;\n}\n.m-fields-table .el-form-item {\n margin-bottom: 0;\n}\n\n.m-select {\n width: 100%;\n}")();
|
|
3724
3808
|
|
|
3725
3809
|
const defaultInstallOpt = {};
|
|
3726
3810
|
const install = (app, opt) => {
|