@tmagic/form 1.0.0-beta.8 → 1.0.0-rc.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/README.md +1 -0
- package/coverage/clover.xml +1360 -0
- package/coverage/coverage-final.json +38 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +176 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/Form.vue.html +676 -0
- package/coverage/lcov-report/src/FormDialog.vue.html +583 -0
- package/coverage/lcov-report/src/containers/Col.vue.html +253 -0
- package/coverage/lcov-report/src/containers/Container.vue.html +925 -0
- package/coverage/lcov-report/src/containers/Fieldset.vue.html +499 -0
- package/coverage/lcov-report/src/containers/GroupList.vue.html +541 -0
- package/coverage/lcov-report/src/containers/GroupListItem.vue.html +562 -0
- package/coverage/lcov-report/src/containers/Panel.vue.html +403 -0
- package/coverage/lcov-report/src/containers/Row.vue.html +277 -0
- package/coverage/lcov-report/src/containers/Step.vue.html +331 -0
- package/coverage/lcov-report/src/containers/Table.vue.html +1987 -0
- package/coverage/lcov-report/src/containers/Tabs.vue.html +625 -0
- package/coverage/lcov-report/src/containers/index.html +251 -0
- package/coverage/lcov-report/src/fields/Cascader.vue.html +526 -0
- package/coverage/lcov-report/src/fields/Checkbox.vue.html +286 -0
- package/coverage/lcov-report/src/fields/CheckboxGroup.vue.html +217 -0
- package/coverage/lcov-report/src/fields/ColorPicker.vue.html +199 -0
- package/coverage/lcov-report/src/fields/Date.vue.html +238 -0
- package/coverage/lcov-report/src/fields/DateTime.vue.html +262 -0
- package/coverage/lcov-report/src/fields/Daterange.vue.html +310 -0
- package/coverage/lcov-report/src/fields/Display.vue.html +187 -0
- package/coverage/lcov-report/src/fields/DynamicField.vue.html +412 -0
- package/coverage/lcov-report/src/fields/Hidden.vue.html +172 -0
- package/coverage/lcov-report/src/fields/Link.vue.html +421 -0
- package/coverage/lcov-report/src/fields/Number.vue.html +244 -0
- package/coverage/lcov-report/src/fields/RadioGroup.vue.html +184 -0
- package/coverage/lcov-report/src/fields/Select.vue.html +1243 -0
- package/coverage/lcov-report/src/fields/Switch.vue.html +280 -0
- package/coverage/lcov-report/src/fields/Text.vue.html +487 -0
- package/coverage/lcov-report/src/fields/Textarea.vue.html +265 -0
- package/coverage/lcov-report/src/fields/Time.vue.html +229 -0
- package/coverage/lcov-report/src/fields/index.html +371 -0
- package/coverage/lcov-report/src/index.html +146 -0
- package/coverage/lcov-report/src/index.ts.html +466 -0
- package/coverage/lcov-report/src/theme/index.html +116 -0
- package/coverage/lcov-report/src/theme/index.scss.html +112 -0
- package/coverage/lcov-report/src/utils/config.ts.html +166 -0
- package/coverage/lcov-report/src/utils/createForm.ts.html +160 -0
- package/coverage/lcov-report/src/utils/fieldProps.ts.html +202 -0
- package/coverage/lcov-report/src/utils/form.ts.html +895 -0
- package/coverage/lcov-report/src/utils/index.html +176 -0
- package/coverage/lcov-report/src/utils/useAddField.ts.html +205 -0
- package/coverage/lcov.info +3061 -0
- package/dist/style.css +9 -11
- package/dist/tmagic-form.es.js +173 -123
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +176 -127
- package/dist/tmagic-form.umd.js.map +1 -1
- package/dist/types/src/Form.vue.d.ts +362 -0
- package/dist/types/src/FormDialog.vue.d.ts +757 -0
- 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/containers/Table.vue.d.ts +2601 -0
- package/dist/types/src/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/Link.vue.d.ts +1596 -0
- package/dist/types/src/schema.d.ts +1 -0
- package/package.json +28 -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 +19 -7
- package/src/containers/GroupListItem.vue +4 -4
- package/src/containers/Row.vue +13 -17
- package/src/containers/Table.vue +14 -6
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/Link.vue +1 -1
- package/src/fields/Select.vue +6 -15
- package/src/fields/Text.vue +4 -4
- package/src/fields/Textarea.vue +11 -13
- package/src/schema.ts +1 -0
- package/src/theme/form.scss +24 -17
- package/src/utils/form.ts +5 -1
- 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
|
}
|
|
@@ -169,8 +173,9 @@ var _export_sfc = (sfc, props) => {
|
|
|
169
173
|
return target;
|
|
170
174
|
};
|
|
171
175
|
|
|
172
|
-
const _sfc_main$
|
|
176
|
+
const _sfc_main$t = defineComponent({
|
|
173
177
|
name: "m-form-container",
|
|
178
|
+
components: { WarningFilled },
|
|
174
179
|
props: {
|
|
175
180
|
labelWidth: String,
|
|
176
181
|
expandMore: Boolean,
|
|
@@ -228,6 +233,7 @@ const _sfc_main$s = defineComponent({
|
|
|
228
233
|
}
|
|
229
234
|
return display(mForm, props.config.display, props);
|
|
230
235
|
});
|
|
236
|
+
const itemLabelWidth = computed(() => props.config.labelWidth || props.labelWidth);
|
|
231
237
|
watchEffect(() => {
|
|
232
238
|
expand.value = props.expandMore;
|
|
233
239
|
});
|
|
@@ -288,6 +294,7 @@ const _sfc_main$s = defineComponent({
|
|
|
288
294
|
itemProp,
|
|
289
295
|
items,
|
|
290
296
|
display: display$1,
|
|
297
|
+
itemLabelWidth,
|
|
291
298
|
tagName,
|
|
292
299
|
rule,
|
|
293
300
|
tooltip,
|
|
@@ -298,24 +305,25 @@ const _sfc_main$s = defineComponent({
|
|
|
298
305
|
};
|
|
299
306
|
}
|
|
300
307
|
});
|
|
301
|
-
const _hoisted_1$
|
|
308
|
+
const _hoisted_1$f = ["innerHTML"];
|
|
302
309
|
const _hoisted_2$7 = ["innerHTML"];
|
|
303
310
|
const _hoisted_3$7 = ["innerHTML"];
|
|
304
|
-
const _hoisted_4$6 =
|
|
305
|
-
const _hoisted_5$4 =
|
|
306
|
-
const _hoisted_6$3 = {
|
|
311
|
+
const _hoisted_4$6 = ["innerHTML"];
|
|
312
|
+
const _hoisted_5$4 = {
|
|
307
313
|
key: 4,
|
|
308
314
|
style: { "text-align": "center" }
|
|
309
315
|
};
|
|
310
|
-
function _sfc_render$
|
|
316
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
311
317
|
const _component_m_fields_hidden = resolveComponent("m-fields-hidden");
|
|
312
318
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
313
319
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
320
|
+
const _component_warning_filled = resolveComponent("warning-filled");
|
|
321
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
314
322
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
315
323
|
const _component_el_button = resolveComponent("el-button");
|
|
316
324
|
return _ctx.config ? (openBlock(), createElementBlock("div", {
|
|
317
325
|
key: 0,
|
|
318
|
-
style: normalizeStyle(_ctx.config.tip ? "display: flex" : ""),
|
|
326
|
+
style: normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
|
|
319
327
|
class: normalizeClass([_ctx.config.className, "m-form-container"])
|
|
320
328
|
}, [
|
|
321
329
|
_ctx.type === "hidden" ? (openBlock(), createBlock(_component_m_fields_hidden, {
|
|
@@ -334,19 +342,20 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
334
342
|
prop: _ctx.itemProp,
|
|
335
343
|
"step-active": _ctx.stepActive,
|
|
336
344
|
"expand-more": _ctx.expand,
|
|
337
|
-
"label-width": _ctx.
|
|
345
|
+
"label-width": _ctx.itemLabelWidth,
|
|
338
346
|
onChange: _ctx.onChangeHandler
|
|
339
347
|
}, null, 8, ["size", "model", "config", "name", "prop", "step-active", "expand-more", "label-width", "onChange"])) : _ctx.type && _ctx.display ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
340
348
|
createVNode(_component_el_form_item, {
|
|
341
349
|
style: normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
|
|
350
|
+
class: normalizeClass({ hidden: _ctx.itemLabelWidth === 0 || !_ctx.config.text }),
|
|
342
351
|
prop: _ctx.itemProp,
|
|
343
|
-
"label-width": _ctx.
|
|
352
|
+
"label-width": _ctx.itemLabelWidth,
|
|
344
353
|
rules: _ctx.rule
|
|
345
354
|
}, {
|
|
346
355
|
label: withCtx(() => [
|
|
347
356
|
createElementVNode("span", {
|
|
348
357
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
349
|
-
}, null, 8, _hoisted_1$
|
|
358
|
+
}, null, 8, _hoisted_1$f)
|
|
350
359
|
]),
|
|
351
360
|
default: withCtx(() => [
|
|
352
361
|
_ctx.tooltip ? (openBlock(), createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -383,19 +392,23 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
383
392
|
}, null, 8, _hoisted_3$7)) : createCommentVNode("", true)
|
|
384
393
|
]),
|
|
385
394
|
_: 1
|
|
386
|
-
}, 8, ["style", "prop", "label-width", "rules"]),
|
|
395
|
+
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
387
396
|
_ctx.config.tip ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
388
397
|
key: 0,
|
|
389
|
-
placement: "
|
|
390
|
-
style: { "line-height": "40px", "margin-left": "5px" }
|
|
398
|
+
placement: "left"
|
|
391
399
|
}, {
|
|
392
400
|
content: withCtx(() => [
|
|
393
401
|
createElementVNode("div", {
|
|
394
402
|
innerHTML: _ctx.config.tip
|
|
395
|
-
}, null, 8,
|
|
403
|
+
}, null, 8, _hoisted_4$6)
|
|
396
404
|
]),
|
|
397
405
|
default: withCtx(() => [
|
|
398
|
-
|
|
406
|
+
createVNode(_component_el_icon, { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
407
|
+
default: withCtx(() => [
|
|
408
|
+
createVNode(_component_warning_filled)
|
|
409
|
+
]),
|
|
410
|
+
_: 1
|
|
411
|
+
})
|
|
399
412
|
]),
|
|
400
413
|
_: 1
|
|
401
414
|
})) : createCommentVNode("", true)
|
|
@@ -408,15 +421,15 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
408
421
|
size: _ctx.size,
|
|
409
422
|
"step-active": _ctx.stepActive,
|
|
410
423
|
"expand-more": _ctx.expand,
|
|
411
|
-
"label-width": _ctx.
|
|
424
|
+
"label-width": _ctx.itemLabelWidth,
|
|
412
425
|
prop: _ctx.itemProp,
|
|
413
426
|
onChange: _ctx.onChangeHandler
|
|
414
427
|
}, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
|
|
415
428
|
}), 128)) : createCommentVNode("", true)
|
|
416
429
|
], 64)) : createCommentVNode("", true),
|
|
417
|
-
_ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div",
|
|
430
|
+
_ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
|
|
418
431
|
createVNode(_component_el_button, {
|
|
419
|
-
|
|
432
|
+
text: "",
|
|
420
433
|
onClick: _ctx.expandHandler
|
|
421
434
|
}, {
|
|
422
435
|
default: withCtx(() => [
|
|
@@ -427,9 +440,9 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
427
440
|
])) : createCommentVNode("", true)
|
|
428
441
|
], 6)) : createCommentVNode("", true);
|
|
429
442
|
}
|
|
430
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
443
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
431
444
|
|
|
432
|
-
const _sfc_main$
|
|
445
|
+
const _sfc_main$s = defineComponent({
|
|
433
446
|
name: "m-form-fieldset",
|
|
434
447
|
props: {
|
|
435
448
|
labelWidth: String,
|
|
@@ -481,7 +494,7 @@ const _sfc_main$r = defineComponent({
|
|
|
481
494
|
};
|
|
482
495
|
}
|
|
483
496
|
});
|
|
484
|
-
const _hoisted_1$
|
|
497
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
485
498
|
const _hoisted_2$6 = ["innerHTML"];
|
|
486
499
|
const _hoisted_3$6 = { key: 1 };
|
|
487
500
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -495,7 +508,7 @@ const _hoisted_9$1 = {
|
|
|
495
508
|
};
|
|
496
509
|
const _hoisted_10$1 = { style: { "flex": "1" } };
|
|
497
510
|
const _hoisted_11 = ["src"];
|
|
498
|
-
function _sfc_render$
|
|
511
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
499
512
|
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
500
513
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
501
514
|
return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (openBlock(), createElementBlock("fieldset", {
|
|
@@ -515,7 +528,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
515
528
|
default: withCtx(() => [
|
|
516
529
|
createElementVNode("span", {
|
|
517
530
|
innerHTML: _ctx.config.legend
|
|
518
|
-
}, null, 8, _hoisted_1$
|
|
531
|
+
}, null, 8, _hoisted_1$e),
|
|
519
532
|
_ctx.config.extra ? (openBlock(), createElementBlock("span", {
|
|
520
533
|
key: 0,
|
|
521
534
|
innerHTML: _ctx.config.extra,
|
|
@@ -587,9 +600,9 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
587
600
|
}), 128)) : createCommentVNode("", true)
|
|
588
601
|
], 4)) : createCommentVNode("", true);
|
|
589
602
|
}
|
|
590
|
-
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
603
|
+
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
591
604
|
|
|
592
|
-
const _sfc_main$
|
|
605
|
+
const _sfc_main$r = defineComponent({
|
|
593
606
|
name: "m-form-group-list-item",
|
|
594
607
|
components: { CaretRight, CaretBottom },
|
|
595
608
|
props: {
|
|
@@ -673,11 +686,11 @@ const _sfc_main$q = defineComponent({
|
|
|
673
686
|
};
|
|
674
687
|
}
|
|
675
688
|
});
|
|
676
|
-
const _hoisted_1$
|
|
689
|
+
const _hoisted_1$d = { class: "m-fields-group-list-item" };
|
|
677
690
|
const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("\u4E0A\u79FB");
|
|
678
691
|
const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("\u4E0B\u79FB");
|
|
679
692
|
const _hoisted_4$4 = ["innerHTML"];
|
|
680
|
-
function _sfc_render$
|
|
693
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
681
694
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
682
695
|
const _component_caret_right = resolveComponent("caret-right");
|
|
683
696
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -685,7 +698,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
685
698
|
const _component_CaretRight = resolveComponent("CaretRight");
|
|
686
699
|
const _component_CaretBottom = resolveComponent("CaretBottom");
|
|
687
700
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
688
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
701
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
689
702
|
createElementVNode("div", null, [
|
|
690
703
|
createVNode(_component_el_icon, {
|
|
691
704
|
style: { "margin-right": "7px" },
|
|
@@ -697,7 +710,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
697
710
|
_: 1
|
|
698
711
|
}, 8, ["onClick"]),
|
|
699
712
|
createVNode(_component_el_button, {
|
|
700
|
-
|
|
713
|
+
text: "",
|
|
701
714
|
onClick: _ctx.expandHandler
|
|
702
715
|
}, {
|
|
703
716
|
default: withCtx(() => [
|
|
@@ -706,7 +719,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
706
719
|
_: 1
|
|
707
720
|
}, 8, ["onClick"]),
|
|
708
721
|
withDirectives(createVNode(_component_el_button, {
|
|
709
|
-
|
|
722
|
+
text: "",
|
|
710
723
|
icon: _ctx.Delete,
|
|
711
724
|
style: { "color": "#f56c6c" },
|
|
712
725
|
onClick: _ctx.removeHandler
|
|
@@ -715,7 +728,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
715
728
|
]),
|
|
716
729
|
_ctx.movable() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
717
730
|
withDirectives(createVNode(_component_el_button, {
|
|
718
|
-
|
|
731
|
+
text: "",
|
|
719
732
|
size: "small",
|
|
720
733
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.changeOrder(-1))
|
|
721
734
|
}, {
|
|
@@ -733,7 +746,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
733
746
|
[vShow, _ctx.index !== 0]
|
|
734
747
|
]),
|
|
735
748
|
withDirectives(createVNode(_component_el_button, {
|
|
736
|
-
|
|
749
|
+
text: "",
|
|
737
750
|
size: "small",
|
|
738
751
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.changeOrder(1))
|
|
739
752
|
}, {
|
|
@@ -768,9 +781,9 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
768
781
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : createCommentVNode("", true)
|
|
769
782
|
]);
|
|
770
783
|
}
|
|
771
|
-
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
784
|
+
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
772
785
|
|
|
773
|
-
const _sfc_main$
|
|
786
|
+
const _sfc_main$q = defineComponent({
|
|
774
787
|
name: "m-form-group-list",
|
|
775
788
|
components: { MFieldsGroupListItem },
|
|
776
789
|
props: {
|
|
@@ -862,7 +875,7 @@ const _sfc_main$p = defineComponent({
|
|
|
862
875
|
};
|
|
863
876
|
}
|
|
864
877
|
});
|
|
865
|
-
const _hoisted_1$
|
|
878
|
+
const _hoisted_1$c = { class: "m-fields-group-list" };
|
|
866
879
|
const _hoisted_2$4 = ["innerHTML"];
|
|
867
880
|
const _hoisted_3$4 = {
|
|
868
881
|
key: 1,
|
|
@@ -874,10 +887,10 @@ const _hoisted_5$2 = [
|
|
|
874
887
|
];
|
|
875
888
|
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
876
889
|
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
877
|
-
function _sfc_render$
|
|
890
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
878
891
|
const _component_m_fields_group_list_item = resolveComponent("m-fields-group-list-item");
|
|
879
892
|
const _component_el_button = resolveComponent("el-button");
|
|
880
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
893
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
881
894
|
_ctx.config.extra ? (openBlock(), createElementBlock("div", {
|
|
882
895
|
key: 0,
|
|
883
896
|
innerHTML: _ctx.config.extra,
|
|
@@ -921,9 +934,9 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
921
934
|
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
922
935
|
]);
|
|
923
936
|
}
|
|
924
|
-
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
937
|
+
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
925
938
|
|
|
926
|
-
const _sfc_main$
|
|
939
|
+
const _sfc_main$p = defineComponent({
|
|
927
940
|
name: "m-form-panel",
|
|
928
941
|
components: { CaretBottom, CaretRight },
|
|
929
942
|
props: {
|
|
@@ -956,7 +969,7 @@ const _sfc_main$o = defineComponent({
|
|
|
956
969
|
};
|
|
957
970
|
}
|
|
958
971
|
});
|
|
959
|
-
const _hoisted_1$
|
|
972
|
+
const _hoisted_1$b = { class: "clearfix" };
|
|
960
973
|
const _hoisted_2$3 = ["innerHTML"];
|
|
961
974
|
const _hoisted_3$3 = {
|
|
962
975
|
key: 0,
|
|
@@ -964,7 +977,7 @@ const _hoisted_3$3 = {
|
|
|
964
977
|
};
|
|
965
978
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
966
979
|
const _hoisted_5$1 = ["src"];
|
|
967
|
-
function _sfc_render$
|
|
980
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
968
981
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
969
982
|
const _component_caret_right = resolveComponent("caret-right");
|
|
970
983
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -976,7 +989,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
976
989
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
977
990
|
}, {
|
|
978
991
|
header: withCtx(() => [
|
|
979
|
-
createElementVNode("div", _hoisted_1$
|
|
992
|
+
createElementVNode("div", _hoisted_1$b, [
|
|
980
993
|
createElementVNode("a", {
|
|
981
994
|
href: "javascript:",
|
|
982
995
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1034,10 +1047,60 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1034
1047
|
_: 3
|
|
1035
1048
|
}, 8, ["body-style"])) : createCommentVNode("", true);
|
|
1036
1049
|
}
|
|
1037
|
-
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1050
|
+
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
|
|
1051
|
+
|
|
1052
|
+
const _sfc_main$o = defineComponent({
|
|
1053
|
+
props: {
|
|
1054
|
+
labelWidth: String,
|
|
1055
|
+
expandMore: Boolean,
|
|
1056
|
+
span: Number,
|
|
1057
|
+
model: {
|
|
1058
|
+
type: Object,
|
|
1059
|
+
default: () => ({})
|
|
1060
|
+
},
|
|
1061
|
+
config: {
|
|
1062
|
+
type: Object,
|
|
1063
|
+
default: () => ({})
|
|
1064
|
+
},
|
|
1065
|
+
prop: String,
|
|
1066
|
+
size: String
|
|
1067
|
+
},
|
|
1068
|
+
emits: ["change"],
|
|
1069
|
+
setup(props, { emit }) {
|
|
1070
|
+
const mForm = inject("mForm");
|
|
1071
|
+
const changeHandler = () => emit("change", props.model);
|
|
1072
|
+
return {
|
|
1073
|
+
mForm,
|
|
1074
|
+
display: computed(() => display(mForm, props.config.display, props)),
|
|
1075
|
+
changeHandler
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1080
|
+
const _component_m_form_container = resolveComponent("m-form-container");
|
|
1081
|
+
const _component_el_col = resolveComponent("el-col");
|
|
1082
|
+
return withDirectives((openBlock(), createBlock(_component_el_col, { span: _ctx.span }, {
|
|
1083
|
+
default: withCtx(() => [
|
|
1084
|
+
createVNode(_component_m_form_container, {
|
|
1085
|
+
model: _ctx.model,
|
|
1086
|
+
config: _ctx.config,
|
|
1087
|
+
prop: _ctx.prop,
|
|
1088
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1089
|
+
"expand-more": _ctx.expandMore,
|
|
1090
|
+
size: _ctx.size,
|
|
1091
|
+
onChange: _ctx.changeHandler
|
|
1092
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1093
|
+
]),
|
|
1094
|
+
_: 1
|
|
1095
|
+
}, 8, ["span"])), [
|
|
1096
|
+
[vShow, _ctx.display && _ctx.config.type !== "hidden"]
|
|
1097
|
+
]);
|
|
1098
|
+
}
|
|
1099
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$l]]);
|
|
1038
1100
|
|
|
1039
1101
|
const _sfc_main$n = defineComponent({
|
|
1040
1102
|
name: "m-form-row",
|
|
1103
|
+
components: { Col },
|
|
1041
1104
|
props: {
|
|
1042
1105
|
labelWidth: String,
|
|
1043
1106
|
expandMore: Boolean,
|
|
@@ -1059,38 +1122,27 @@ const _sfc_main$n = defineComponent({
|
|
|
1059
1122
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1060
1123
|
return {
|
|
1061
1124
|
mForm,
|
|
1062
|
-
display(config) {
|
|
1063
|
-
return display(mForm, config.display, props);
|
|
1064
|
-
},
|
|
1065
1125
|
changeHandler
|
|
1066
1126
|
};
|
|
1067
1127
|
}
|
|
1068
1128
|
});
|
|
1069
1129
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1070
|
-
const
|
|
1071
|
-
const _component_el_col = resolveComponent("el-col");
|
|
1130
|
+
const _component_Col = resolveComponent("Col");
|
|
1072
1131
|
const _component_el_row = resolveComponent("el-row");
|
|
1073
1132
|
return openBlock(), createBlock(_component_el_row, { gutter: 10 }, {
|
|
1074
1133
|
default: withCtx(() => [
|
|
1075
1134
|
(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" : ""),
|
|
1135
|
+
return openBlock(), createBlock(_component_Col, {
|
|
1078
1136
|
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"]);
|
|
1137
|
+
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
|
|
1138
|
+
config: col,
|
|
1139
|
+
labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1140
|
+
expandMore: _ctx.expandMore,
|
|
1141
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1142
|
+
prop: _ctx.prop,
|
|
1143
|
+
size: _ctx.size,
|
|
1144
|
+
onChange: _ctx.changeHandler
|
|
1145
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "onChange"]);
|
|
1094
1146
|
}), 128))
|
|
1095
1147
|
]),
|
|
1096
1148
|
_: 1
|
|
@@ -1549,7 +1601,7 @@ const _sfc_main$l = defineComponent({
|
|
|
1549
1601
|
};
|
|
1550
1602
|
}
|
|
1551
1603
|
});
|
|
1552
|
-
const _hoisted_1$
|
|
1604
|
+
const _hoisted_1$a = ["innerHTML"];
|
|
1553
1605
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1554
1606
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1555
1607
|
const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
|
|
@@ -1578,7 +1630,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1578
1630
|
key: 0,
|
|
1579
1631
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1580
1632
|
innerHTML: _ctx.config.extra
|
|
1581
|
-
}, null, 8, _hoisted_1$
|
|
1633
|
+
}, null, 8, _hoisted_1$a)) : createCommentVNode("", true),
|
|
1582
1634
|
createElementVNode("div", _hoisted_2$2, [
|
|
1583
1635
|
createVNode(_component_el_tooltip, {
|
|
1584
1636
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -1619,8 +1671,8 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1619
1671
|
}, {
|
|
1620
1672
|
default: withCtx((scope) => [
|
|
1621
1673
|
withDirectives(createVNode(_component_el_button, {
|
|
1622
|
-
|
|
1623
|
-
|
|
1674
|
+
type: "danger",
|
|
1675
|
+
text: "",
|
|
1624
1676
|
icon: _ctx.Delete,
|
|
1625
1677
|
onClick: ($event) => _ctx.removeHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1626
1678
|
}, null, 8, ["icon", "onClick"]), [
|
|
@@ -1644,8 +1696,9 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1644
1696
|
createVNode(_component_el_button, {
|
|
1645
1697
|
plain: "",
|
|
1646
1698
|
size: "small",
|
|
1699
|
+
type: "primary",
|
|
1647
1700
|
icon: _ctx.ArrowUp,
|
|
1648
|
-
|
|
1701
|
+
text: "",
|
|
1649
1702
|
onClick: ($event) => _ctx.upHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1650
1703
|
onDblclick: ($event) => _ctx.topHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1651
1704
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1661,8 +1714,9 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1661
1714
|
createVNode(_component_el_button, {
|
|
1662
1715
|
plain: "",
|
|
1663
1716
|
size: "small",
|
|
1717
|
+
type: "primary",
|
|
1664
1718
|
icon: _ctx.ArrowDown,
|
|
1665
|
-
|
|
1719
|
+
text: "",
|
|
1666
1720
|
onClick: ($event) => _ctx.downHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1667
1721
|
onDblclick: ($event) => _ctx.bottomHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1668
1722
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1739,6 +1793,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1739
1793
|
key: 1,
|
|
1740
1794
|
icon: _ctx.Grid,
|
|
1741
1795
|
size: "small",
|
|
1796
|
+
type: "primary",
|
|
1742
1797
|
onClick: _ctx.toggleMode
|
|
1743
1798
|
}, {
|
|
1744
1799
|
default: withCtx(() => [
|
|
@@ -1750,6 +1805,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1750
1805
|
key: 2,
|
|
1751
1806
|
icon: _ctx.FullScreen,
|
|
1752
1807
|
size: "small",
|
|
1808
|
+
type: "primary",
|
|
1753
1809
|
onClick: _ctx.toggleFullscreen
|
|
1754
1810
|
}, {
|
|
1755
1811
|
default: withCtx(() => [
|
|
@@ -2100,13 +2156,13 @@ const _sfc_main$j = defineComponent({
|
|
|
2100
2156
|
};
|
|
2101
2157
|
}
|
|
2102
2158
|
});
|
|
2103
|
-
const _hoisted_1$
|
|
2159
|
+
const _hoisted_1$9 = {
|
|
2104
2160
|
class: "m-cascader",
|
|
2105
2161
|
style: { "width": "100%" }
|
|
2106
2162
|
};
|
|
2107
2163
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2108
2164
|
const _component_el_cascader = resolveComponent("el-cascader");
|
|
2109
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2165
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2110
2166
|
createVNode(_component_el_cascader, {
|
|
2111
2167
|
modelValue: _ctx.model[_ctx.name],
|
|
2112
2168
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2146,7 +2202,7 @@ const _sfc_main$i = defineComponent({
|
|
|
2146
2202
|
} else {
|
|
2147
2203
|
return props.config.activeValue;
|
|
2148
2204
|
}
|
|
2149
|
-
return
|
|
2205
|
+
return void 0;
|
|
2150
2206
|
}),
|
|
2151
2207
|
inactiveValue: computed(() => {
|
|
2152
2208
|
if (typeof props.config.inactiveValue === "undefined") {
|
|
@@ -2156,7 +2212,7 @@ const _sfc_main$i = defineComponent({
|
|
|
2156
2212
|
} else {
|
|
2157
2213
|
return props.config.inactiveValue;
|
|
2158
2214
|
}
|
|
2159
|
-
return
|
|
2215
|
+
return void 0;
|
|
2160
2216
|
}),
|
|
2161
2217
|
changeHandler(value) {
|
|
2162
2218
|
emit("change", value);
|
|
@@ -2229,7 +2285,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2229
2285
|
}
|
|
2230
2286
|
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
|
|
2231
2287
|
|
|
2232
|
-
const _hoisted_1$
|
|
2288
|
+
const _hoisted_1$8 = { key: 0 };
|
|
2233
2289
|
const __default__$2 = defineComponent({
|
|
2234
2290
|
name: "m-fields-color-picker"
|
|
2235
2291
|
});
|
|
@@ -2249,7 +2305,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
2249
2305
|
const changeHandler = (value) => emit("change", value);
|
|
2250
2306
|
return (_ctx, _cache) => {
|
|
2251
2307
|
const _component_el_color_picker = resolveComponent("el-color-picker");
|
|
2252
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2308
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
2253
2309
|
createVNode(_component_el_color_picker, {
|
|
2254
2310
|
modelValue: _ctx.model[_ctx.name],
|
|
2255
2311
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2285,10 +2341,10 @@ const _sfc_main$f = defineComponent({
|
|
|
2285
2341
|
};
|
|
2286
2342
|
}
|
|
2287
2343
|
});
|
|
2288
|
-
const _hoisted_1$
|
|
2344
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2289
2345
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2290
2346
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2291
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2347
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2292
2348
|
createVNode(_component_el_date_picker, {
|
|
2293
2349
|
modelValue: _ctx.model[_ctx.modelName],
|
|
2294
2350
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
|
|
@@ -2392,10 +2448,10 @@ const _sfc_main$d = defineComponent({
|
|
|
2392
2448
|
};
|
|
2393
2449
|
}
|
|
2394
2450
|
});
|
|
2395
|
-
const _hoisted_1$
|
|
2451
|
+
const _hoisted_1$6 = { key: 0 };
|
|
2396
2452
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2397
2453
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2398
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2454
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
2399
2455
|
createVNode(_component_el_date_picker, {
|
|
2400
2456
|
modelValue: _ctx.model[_ctx.name],
|
|
2401
2457
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2412,7 +2468,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2412
2468
|
}
|
|
2413
2469
|
var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
2414
2470
|
|
|
2415
|
-
const _hoisted_1$
|
|
2471
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2416
2472
|
const __default__$1 = defineComponent({
|
|
2417
2473
|
name: "m-fields-display"
|
|
2418
2474
|
});
|
|
@@ -2433,7 +2489,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2433
2489
|
}
|
|
2434
2490
|
useAddField(props.prop);
|
|
2435
2491
|
return (_ctx, _cache) => {
|
|
2436
|
-
return _ctx.model ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
2492
|
+
return _ctx.model ? (openBlock(), createElementBlock("span", _hoisted_1$5, toDisplayString(_ctx.model[unref(n)]), 1)) : createCommentVNode("", true);
|
|
2437
2493
|
};
|
|
2438
2494
|
}
|
|
2439
2495
|
});
|
|
@@ -2503,12 +2559,12 @@ const _sfc_main$b = defineComponent({
|
|
|
2503
2559
|
}
|
|
2504
2560
|
}
|
|
2505
2561
|
});
|
|
2506
|
-
const _hoisted_1$
|
|
2562
|
+
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2507
2563
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2508
2564
|
const _component_el_input = resolveComponent("el-input");
|
|
2509
2565
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
2510
2566
|
const _component_el_form = resolveComponent("el-form");
|
|
2511
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2567
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2512
2568
|
createVNode(_component_el_form, { size: "small" }, {
|
|
2513
2569
|
default: withCtx(() => [
|
|
2514
2570
|
(openBlock(true), createElementBlock(Fragment, null, renderList(Object.keys(_ctx.fieldMap.value), (key) => {
|
|
@@ -2630,7 +2686,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
2630
2686
|
};
|
|
2631
2687
|
}
|
|
2632
2688
|
});
|
|
2633
|
-
const _hoisted_1$
|
|
2689
|
+
const _hoisted_1$3 = ["href"];
|
|
2634
2690
|
const _hoisted_2$1 = {
|
|
2635
2691
|
key: 2,
|
|
2636
2692
|
class: "m-fields-link"
|
|
@@ -2644,12 +2700,13 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2644
2700
|
target: "_blank",
|
|
2645
2701
|
href: _ctx.href,
|
|
2646
2702
|
style: normalizeStyle(_ctx.config.css || {})
|
|
2647
|
-
}, toDisplayString(_ctx.displayText), 13, _hoisted_1$
|
|
2703
|
+
}, toDisplayString(_ctx.displayText), 13, _hoisted_1$3)) : _ctx.config.href && _ctx.disabled ? (openBlock(), createElementBlock("span", {
|
|
2648
2704
|
key: 1,
|
|
2649
2705
|
style: normalizeStyle(_ctx.config.disabledCss || {})
|
|
2650
2706
|
}, toDisplayString(_ctx.displayText), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
2651
2707
|
createVNode(_component_el_button, {
|
|
2652
|
-
|
|
2708
|
+
text: "",
|
|
2709
|
+
type: "primary",
|
|
2653
2710
|
onClick: _ctx.editHandler
|
|
2654
2711
|
}, {
|
|
2655
2712
|
default: withCtx(() => [
|
|
@@ -2942,6 +2999,7 @@ const _sfc_main$6 = defineComponent({
|
|
|
2942
2999
|
watch(() => mForm?.values, () => {
|
|
2943
3000
|
typeof props.config.options === "function" && Promise.resolve(props.config.options(mForm, {
|
|
2944
3001
|
model: props.model,
|
|
3002
|
+
prop: props.prop,
|
|
2945
3003
|
formValues: mForm?.values,
|
|
2946
3004
|
formValue: mForm?.values
|
|
2947
3005
|
})).then((data) => {
|
|
@@ -2992,11 +3050,10 @@ const _sfc_main$6 = defineComponent({
|
|
|
2992
3050
|
options,
|
|
2993
3051
|
moreLoadingVisible,
|
|
2994
3052
|
popperClass: mForm?.popperClass,
|
|
3053
|
+
getOptions,
|
|
2995
3054
|
getRequestFuc() {
|
|
2996
3055
|
return getConfig("request");
|
|
2997
3056
|
},
|
|
2998
|
-
async getInitOption() {
|
|
2999
|
-
},
|
|
3000
3057
|
changeHandler(value) {
|
|
3001
3058
|
emit("change", value);
|
|
3002
3059
|
},
|
|
@@ -3013,10 +3070,6 @@ const _sfc_main$6 = defineComponent({
|
|
|
3013
3070
|
options.value = await getOptions();
|
|
3014
3071
|
}
|
|
3015
3072
|
},
|
|
3016
|
-
async editAfterAction() {
|
|
3017
|
-
pgIndex.value = 0;
|
|
3018
|
-
options.value = await getOptions();
|
|
3019
|
-
},
|
|
3020
3073
|
async remoteMethod(q) {
|
|
3021
3074
|
if (!localOptions.value.length) {
|
|
3022
3075
|
query.value = q;
|
|
@@ -3031,7 +3084,7 @@ const _sfc_main$6 = defineComponent({
|
|
|
3031
3084
|
};
|
|
3032
3085
|
}
|
|
3033
3086
|
});
|
|
3034
|
-
const _hoisted_1$
|
|
3087
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3035
3088
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3036
3089
|
const _component_el_option = resolveComponent("el-option");
|
|
3037
3090
|
const _component_el_option_group = resolveComponent("el-option-group");
|
|
@@ -3053,21 +3106,21 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3053
3106
|
"value-key": _ctx.config.valueKey || "value",
|
|
3054
3107
|
"allow-create": _ctx.config.allowCreate,
|
|
3055
3108
|
disabled: _ctx.disabled,
|
|
3056
|
-
"remote-method": _ctx.remoteMethod,
|
|
3109
|
+
"remote-method": _ctx.config.remote && _ctx.remoteMethod,
|
|
3057
3110
|
onChange: _ctx.changeHandler,
|
|
3058
3111
|
onVisibleChange: _ctx.visibleHandler
|
|
3059
3112
|
}, {
|
|
3060
3113
|
default: withCtx(() => [
|
|
3061
3114
|
_ctx.config.group ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (group, index) => {
|
|
3062
3115
|
return openBlock(), createBlock(_component_el_option_group, {
|
|
3063
|
-
key:
|
|
3116
|
+
key: index,
|
|
3064
3117
|
label: group.label,
|
|
3065
3118
|
disabled: group.disabled
|
|
3066
3119
|
}, {
|
|
3067
3120
|
default: withCtx(() => [
|
|
3068
3121
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (item, index2) => {
|
|
3069
3122
|
return openBlock(), createBlock(_component_el_option, {
|
|
3070
|
-
key:
|
|
3123
|
+
key: index2,
|
|
3071
3124
|
label: item.label,
|
|
3072
3125
|
value: item.value,
|
|
3073
3126
|
disabled: item.disabled
|
|
@@ -3084,7 +3137,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3084
3137
|
disabled: option.disabled
|
|
3085
3138
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3086
3139
|
}), 128)),
|
|
3087
|
-
_ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$
|
|
3140
|
+
_ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3088
3141
|
[_directive_loading, true]
|
|
3089
3142
|
]) : createCommentVNode("", true)
|
|
3090
3143
|
]),
|
|
@@ -3161,6 +3214,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3161
3214
|
},
|
|
3162
3215
|
emits: ["change", "input"],
|
|
3163
3216
|
setup(props, { emit }) {
|
|
3217
|
+
const mForm = inject("mForm");
|
|
3164
3218
|
useAddField(props.prop);
|
|
3165
3219
|
const modelName = computed(() => props.name || props.config.name || "");
|
|
3166
3220
|
return {
|
|
@@ -3169,12 +3223,10 @@ const _sfc_main$4 = defineComponent({
|
|
|
3169
3223
|
emit("change", v);
|
|
3170
3224
|
},
|
|
3171
3225
|
inputHandler(v) {
|
|
3172
|
-
const mForm = inject("mForm");
|
|
3173
3226
|
emit("input", v);
|
|
3174
3227
|
mForm?.$emit("field-input", props.prop, v);
|
|
3175
3228
|
},
|
|
3176
3229
|
buttonClickHandler() {
|
|
3177
|
-
const mForm = inject("mForm");
|
|
3178
3230
|
if (typeof props.config.append === "string")
|
|
3179
3231
|
return;
|
|
3180
3232
|
if (props.config.append?.handler) {
|
|
@@ -3238,7 +3290,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3238
3290
|
};
|
|
3239
3291
|
}
|
|
3240
3292
|
});
|
|
3241
|
-
const _hoisted_1$
|
|
3293
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3242
3294
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3243
3295
|
const _component_el_button = resolveComponent("el-button");
|
|
3244
3296
|
const _component_el_input = resolveComponent("el-input");
|
|
@@ -3256,17 +3308,18 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3256
3308
|
_ctx.config.append ? {
|
|
3257
3309
|
name: "append",
|
|
3258
3310
|
fn: withCtx(() => [
|
|
3259
|
-
typeof _ctx.config.append === "string" ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
3311
|
+
typeof _ctx.config.append === "string" ? (openBlock(), createElementBlock("span", _hoisted_1$1, toDisplayString(_ctx.config.append), 1)) : createCommentVNode("", true),
|
|
3260
3312
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (openBlock(), createBlock(_component_el_button, {
|
|
3261
3313
|
key: 1,
|
|
3262
3314
|
style: { "color": "#409eff" },
|
|
3263
|
-
|
|
3315
|
+
size: _ctx.size,
|
|
3316
|
+
onClick: withModifiers(_ctx.buttonClickHandler, ["prevent"])
|
|
3264
3317
|
}, {
|
|
3265
3318
|
default: withCtx(() => [
|
|
3266
3319
|
createTextVNode(toDisplayString(_ctx.config.append.text), 1)
|
|
3267
3320
|
]),
|
|
3268
3321
|
_: 1
|
|
3269
|
-
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
3322
|
+
}, 8, ["size", "onClick"])) : createCommentVNode("", true)
|
|
3270
3323
|
])
|
|
3271
3324
|
} : void 0
|
|
3272
3325
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
@@ -3305,22 +3358,19 @@ const _sfc_main$3 = defineComponent({
|
|
|
3305
3358
|
};
|
|
3306
3359
|
}
|
|
3307
3360
|
});
|
|
3308
|
-
const _hoisted_1$1 = { key: 0 };
|
|
3309
3361
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3310
3362
|
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);
|
|
3363
|
+
return openBlock(), createBlock(_component_el_input, {
|
|
3364
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3365
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3366
|
+
type: "textarea",
|
|
3367
|
+
size: _ctx.size,
|
|
3368
|
+
clearable: "",
|
|
3369
|
+
placeholder: _ctx.config.placeholder,
|
|
3370
|
+
disabled: _ctx.disabled,
|
|
3371
|
+
onChange: _ctx.changeHandler,
|
|
3372
|
+
onInput: _ctx.inputHandler
|
|
3373
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3324
3374
|
}
|
|
3325
3375
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3326
3376
|
|
|
@@ -3468,7 +3518,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
3468
3518
|
submitForm: async (native) => {
|
|
3469
3519
|
try {
|
|
3470
3520
|
await elForm.value?.validate();
|
|
3471
|
-
return native ? values.value : cloneDeep(values.value);
|
|
3521
|
+
return native ? values.value : cloneDeep(toRaw(values.value));
|
|
3472
3522
|
} catch (invalidFields) {
|
|
3473
3523
|
const error = [];
|
|
3474
3524
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|