@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.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.vue, global.
|
|
5
|
-
})(this, (function (exports, vue,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons'), require('lodash-es'), require('element-plus'), require('sortablejs'), require('@tmagic/utils')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons', 'lodash-es', 'element-plus', 'sortablejs', '@tmagic/utils'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.vue, global.icons, global.lodashEs, global.elementPlus, global.Sortable, global.utils));
|
|
5
|
+
})(this, (function (exports, vue, icons, lodashEs, elementPlus, Sortable, utils) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -62,7 +62,11 @@
|
|
|
62
62
|
asyncLoadConfig(value, initValue2, item);
|
|
63
63
|
if (name && !items && typeof initValue2[name] !== "undefined") {
|
|
64
64
|
if (typeof value[name] === "undefined") {
|
|
65
|
-
|
|
65
|
+
if (type === "number") {
|
|
66
|
+
value[name] = Number(initValue2[name]);
|
|
67
|
+
} else {
|
|
68
|
+
value[name] = typeof initValue2[name] === "object" ? lodashEs.cloneDeep(initValue2[name]) : initValue2[name];
|
|
69
|
+
}
|
|
66
70
|
}
|
|
67
71
|
return value;
|
|
68
72
|
}
|
|
@@ -172,8 +176,9 @@
|
|
|
172
176
|
return target;
|
|
173
177
|
};
|
|
174
178
|
|
|
175
|
-
const _sfc_main$
|
|
179
|
+
const _sfc_main$t = vue.defineComponent({
|
|
176
180
|
name: "m-form-container",
|
|
181
|
+
components: { WarningFilled: icons.WarningFilled },
|
|
177
182
|
props: {
|
|
178
183
|
labelWidth: String,
|
|
179
184
|
expandMore: Boolean,
|
|
@@ -231,6 +236,7 @@
|
|
|
231
236
|
}
|
|
232
237
|
return display(mForm, props.config.display, props);
|
|
233
238
|
});
|
|
239
|
+
const itemLabelWidth = vue.computed(() => props.config.labelWidth || props.labelWidth);
|
|
234
240
|
vue.watchEffect(() => {
|
|
235
241
|
expand.value = props.expandMore;
|
|
236
242
|
});
|
|
@@ -291,6 +297,7 @@
|
|
|
291
297
|
itemProp,
|
|
292
298
|
items,
|
|
293
299
|
display: display$1,
|
|
300
|
+
itemLabelWidth,
|
|
294
301
|
tagName,
|
|
295
302
|
rule,
|
|
296
303
|
tooltip,
|
|
@@ -301,24 +308,25 @@
|
|
|
301
308
|
};
|
|
302
309
|
}
|
|
303
310
|
});
|
|
304
|
-
const _hoisted_1$
|
|
311
|
+
const _hoisted_1$f = ["innerHTML"];
|
|
305
312
|
const _hoisted_2$7 = ["innerHTML"];
|
|
306
313
|
const _hoisted_3$7 = ["innerHTML"];
|
|
307
|
-
const _hoisted_4$6 =
|
|
308
|
-
const _hoisted_5$4 =
|
|
309
|
-
const _hoisted_6$3 = {
|
|
314
|
+
const _hoisted_4$6 = ["innerHTML"];
|
|
315
|
+
const _hoisted_5$4 = {
|
|
310
316
|
key: 4,
|
|
311
317
|
style: { "text-align": "center" }
|
|
312
318
|
};
|
|
313
|
-
function _sfc_render$
|
|
319
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
314
320
|
const _component_m_fields_hidden = vue.resolveComponent("m-fields-hidden");
|
|
315
321
|
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
316
322
|
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
323
|
+
const _component_warning_filled = vue.resolveComponent("warning-filled");
|
|
324
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
317
325
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
318
326
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
319
327
|
return _ctx.config ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
320
328
|
key: 0,
|
|
321
|
-
style: vue.normalizeStyle(_ctx.config.tip ? "display: flex" : ""),
|
|
329
|
+
style: vue.normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
|
|
322
330
|
class: vue.normalizeClass([_ctx.config.className, "m-form-container"])
|
|
323
331
|
}, [
|
|
324
332
|
_ctx.type === "hidden" ? (vue.openBlock(), vue.createBlock(_component_m_fields_hidden, {
|
|
@@ -337,19 +345,20 @@
|
|
|
337
345
|
prop: _ctx.itemProp,
|
|
338
346
|
"step-active": _ctx.stepActive,
|
|
339
347
|
"expand-more": _ctx.expand,
|
|
340
|
-
"label-width": _ctx.
|
|
348
|
+
"label-width": _ctx.itemLabelWidth,
|
|
341
349
|
onChange: _ctx.onChangeHandler
|
|
342
350
|
}, null, 8, ["size", "model", "config", "name", "prop", "step-active", "expand-more", "label-width", "onChange"])) : _ctx.type && _ctx.display ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
343
351
|
vue.createVNode(_component_el_form_item, {
|
|
344
352
|
style: vue.normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
|
|
353
|
+
class: vue.normalizeClass({ hidden: _ctx.itemLabelWidth === 0 || !_ctx.config.text }),
|
|
345
354
|
prop: _ctx.itemProp,
|
|
346
|
-
"label-width": _ctx.
|
|
355
|
+
"label-width": _ctx.itemLabelWidth,
|
|
347
356
|
rules: _ctx.rule
|
|
348
357
|
}, {
|
|
349
358
|
label: vue.withCtx(() => [
|
|
350
359
|
vue.createElementVNode("span", {
|
|
351
360
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
352
|
-
}, null, 8, _hoisted_1$
|
|
361
|
+
}, null, 8, _hoisted_1$f)
|
|
353
362
|
]),
|
|
354
363
|
default: vue.withCtx(() => [
|
|
355
364
|
_ctx.tooltip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -386,19 +395,23 @@
|
|
|
386
395
|
}, null, 8, _hoisted_3$7)) : vue.createCommentVNode("", true)
|
|
387
396
|
]),
|
|
388
397
|
_: 1
|
|
389
|
-
}, 8, ["style", "prop", "label-width", "rules"]),
|
|
398
|
+
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
390
399
|
_ctx.config.tip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
|
|
391
400
|
key: 0,
|
|
392
|
-
placement: "
|
|
393
|
-
style: { "line-height": "40px", "margin-left": "5px" }
|
|
401
|
+
placement: "left"
|
|
394
402
|
}, {
|
|
395
403
|
content: vue.withCtx(() => [
|
|
396
404
|
vue.createElementVNode("div", {
|
|
397
405
|
innerHTML: _ctx.config.tip
|
|
398
|
-
}, null, 8,
|
|
406
|
+
}, null, 8, _hoisted_4$6)
|
|
399
407
|
]),
|
|
400
408
|
default: vue.withCtx(() => [
|
|
401
|
-
|
|
409
|
+
vue.createVNode(_component_el_icon, { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
410
|
+
default: vue.withCtx(() => [
|
|
411
|
+
vue.createVNode(_component_warning_filled)
|
|
412
|
+
]),
|
|
413
|
+
_: 1
|
|
414
|
+
})
|
|
402
415
|
]),
|
|
403
416
|
_: 1
|
|
404
417
|
})) : vue.createCommentVNode("", true)
|
|
@@ -411,15 +424,15 @@
|
|
|
411
424
|
size: _ctx.size,
|
|
412
425
|
"step-active": _ctx.stepActive,
|
|
413
426
|
"expand-more": _ctx.expand,
|
|
414
|
-
"label-width": _ctx.
|
|
427
|
+
"label-width": _ctx.itemLabelWidth,
|
|
415
428
|
prop: _ctx.itemProp,
|
|
416
429
|
onChange: _ctx.onChangeHandler
|
|
417
430
|
}, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
|
|
418
431
|
}), 128)) : vue.createCommentVNode("", true)
|
|
419
432
|
], 64)) : vue.createCommentVNode("", true),
|
|
420
|
-
_ctx.config.expand && _ctx.type !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div",
|
|
433
|
+
_ctx.config.expand && _ctx.type !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
|
|
421
434
|
vue.createVNode(_component_el_button, {
|
|
422
|
-
|
|
435
|
+
text: "",
|
|
423
436
|
onClick: _ctx.expandHandler
|
|
424
437
|
}, {
|
|
425
438
|
default: vue.withCtx(() => [
|
|
@@ -430,9 +443,9 @@
|
|
|
430
443
|
])) : vue.createCommentVNode("", true)
|
|
431
444
|
], 6)) : vue.createCommentVNode("", true);
|
|
432
445
|
}
|
|
433
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
446
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
434
447
|
|
|
435
|
-
const _sfc_main$
|
|
448
|
+
const _sfc_main$s = vue.defineComponent({
|
|
436
449
|
name: "m-form-fieldset",
|
|
437
450
|
props: {
|
|
438
451
|
labelWidth: String,
|
|
@@ -484,7 +497,7 @@
|
|
|
484
497
|
};
|
|
485
498
|
}
|
|
486
499
|
});
|
|
487
|
-
const _hoisted_1$
|
|
500
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
488
501
|
const _hoisted_2$6 = ["innerHTML"];
|
|
489
502
|
const _hoisted_3$6 = { key: 1 };
|
|
490
503
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -498,7 +511,7 @@
|
|
|
498
511
|
};
|
|
499
512
|
const _hoisted_10$1 = { style: { "flex": "1" } };
|
|
500
513
|
const _hoisted_11 = ["src"];
|
|
501
|
-
function _sfc_render$
|
|
514
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
502
515
|
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
|
|
503
516
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
504
517
|
return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
@@ -518,7 +531,7 @@
|
|
|
518
531
|
default: vue.withCtx(() => [
|
|
519
532
|
vue.createElementVNode("span", {
|
|
520
533
|
innerHTML: _ctx.config.legend
|
|
521
|
-
}, null, 8, _hoisted_1$
|
|
534
|
+
}, null, 8, _hoisted_1$e),
|
|
522
535
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
523
536
|
key: 0,
|
|
524
537
|
innerHTML: _ctx.config.extra,
|
|
@@ -590,9 +603,9 @@
|
|
|
590
603
|
}), 128)) : vue.createCommentVNode("", true)
|
|
591
604
|
], 4)) : vue.createCommentVNode("", true);
|
|
592
605
|
}
|
|
593
|
-
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
606
|
+
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
594
607
|
|
|
595
|
-
const _sfc_main$
|
|
608
|
+
const _sfc_main$r = vue.defineComponent({
|
|
596
609
|
name: "m-form-group-list-item",
|
|
597
610
|
components: { CaretRight: icons.CaretRight, CaretBottom: icons.CaretBottom },
|
|
598
611
|
props: {
|
|
@@ -676,11 +689,11 @@
|
|
|
676
689
|
};
|
|
677
690
|
}
|
|
678
691
|
});
|
|
679
|
-
const _hoisted_1$
|
|
692
|
+
const _hoisted_1$d = { class: "m-fields-group-list-item" };
|
|
680
693
|
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u79FB");
|
|
681
694
|
const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u79FB");
|
|
682
695
|
const _hoisted_4$4 = ["innerHTML"];
|
|
683
|
-
function _sfc_render$
|
|
696
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
684
697
|
const _component_caret_bottom = vue.resolveComponent("caret-bottom");
|
|
685
698
|
const _component_caret_right = vue.resolveComponent("caret-right");
|
|
686
699
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -688,7 +701,7 @@
|
|
|
688
701
|
const _component_CaretRight = vue.resolveComponent("CaretRight");
|
|
689
702
|
const _component_CaretBottom = vue.resolveComponent("CaretBottom");
|
|
690
703
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
691
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
704
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
692
705
|
vue.createElementVNode("div", null, [
|
|
693
706
|
vue.createVNode(_component_el_icon, {
|
|
694
707
|
style: { "margin-right": "7px" },
|
|
@@ -700,7 +713,7 @@
|
|
|
700
713
|
_: 1
|
|
701
714
|
}, 8, ["onClick"]),
|
|
702
715
|
vue.createVNode(_component_el_button, {
|
|
703
|
-
|
|
716
|
+
text: "",
|
|
704
717
|
onClick: _ctx.expandHandler
|
|
705
718
|
}, {
|
|
706
719
|
default: vue.withCtx(() => [
|
|
@@ -709,7 +722,7 @@
|
|
|
709
722
|
_: 1
|
|
710
723
|
}, 8, ["onClick"]),
|
|
711
724
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
712
|
-
|
|
725
|
+
text: "",
|
|
713
726
|
icon: _ctx.Delete,
|
|
714
727
|
style: { "color": "#f56c6c" },
|
|
715
728
|
onClick: _ctx.removeHandler
|
|
@@ -718,7 +731,7 @@
|
|
|
718
731
|
]),
|
|
719
732
|
_ctx.movable() ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
720
733
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
721
|
-
|
|
734
|
+
text: "",
|
|
722
735
|
size: "small",
|
|
723
736
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.changeOrder(-1))
|
|
724
737
|
}, {
|
|
@@ -736,7 +749,7 @@
|
|
|
736
749
|
[vue.vShow, _ctx.index !== 0]
|
|
737
750
|
]),
|
|
738
751
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
739
|
-
|
|
752
|
+
text: "",
|
|
740
753
|
size: "small",
|
|
741
754
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.changeOrder(1))
|
|
742
755
|
}, {
|
|
@@ -771,9 +784,9 @@
|
|
|
771
784
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : vue.createCommentVNode("", true)
|
|
772
785
|
]);
|
|
773
786
|
}
|
|
774
|
-
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
787
|
+
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
775
788
|
|
|
776
|
-
const _sfc_main$
|
|
789
|
+
const _sfc_main$q = vue.defineComponent({
|
|
777
790
|
name: "m-form-group-list",
|
|
778
791
|
components: { MFieldsGroupListItem },
|
|
779
792
|
props: {
|
|
@@ -865,7 +878,7 @@
|
|
|
865
878
|
};
|
|
866
879
|
}
|
|
867
880
|
});
|
|
868
|
-
const _hoisted_1$
|
|
881
|
+
const _hoisted_1$c = { class: "m-fields-group-list" };
|
|
869
882
|
const _hoisted_2$4 = ["innerHTML"];
|
|
870
883
|
const _hoisted_3$4 = {
|
|
871
884
|
key: 1,
|
|
@@ -877,10 +890,10 @@
|
|
|
877
890
|
];
|
|
878
891
|
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
879
892
|
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
880
|
-
function _sfc_render$
|
|
893
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
881
894
|
const _component_m_fields_group_list_item = vue.resolveComponent("m-fields-group-list-item");
|
|
882
895
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
883
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
896
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
884
897
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
885
898
|
key: 0,
|
|
886
899
|
innerHTML: _ctx.config.extra,
|
|
@@ -924,9 +937,9 @@
|
|
|
924
937
|
}, 8, ["onClick"])) : vue.createCommentVNode("", true)
|
|
925
938
|
]);
|
|
926
939
|
}
|
|
927
|
-
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
940
|
+
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
928
941
|
|
|
929
|
-
const _sfc_main$
|
|
942
|
+
const _sfc_main$p = vue.defineComponent({
|
|
930
943
|
name: "m-form-panel",
|
|
931
944
|
components: { CaretBottom: icons.CaretBottom, CaretRight: icons.CaretRight },
|
|
932
945
|
props: {
|
|
@@ -959,7 +972,7 @@
|
|
|
959
972
|
};
|
|
960
973
|
}
|
|
961
974
|
});
|
|
962
|
-
const _hoisted_1$
|
|
975
|
+
const _hoisted_1$b = { class: "clearfix" };
|
|
963
976
|
const _hoisted_2$3 = ["innerHTML"];
|
|
964
977
|
const _hoisted_3$3 = {
|
|
965
978
|
key: 0,
|
|
@@ -967,7 +980,7 @@
|
|
|
967
980
|
};
|
|
968
981
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
969
982
|
const _hoisted_5$1 = ["src"];
|
|
970
|
-
function _sfc_render$
|
|
983
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
971
984
|
const _component_caret_bottom = vue.resolveComponent("caret-bottom");
|
|
972
985
|
const _component_caret_right = vue.resolveComponent("caret-right");
|
|
973
986
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -979,7 +992,7 @@
|
|
|
979
992
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
980
993
|
}, {
|
|
981
994
|
header: vue.withCtx(() => [
|
|
982
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
995
|
+
vue.createElementVNode("div", _hoisted_1$b, [
|
|
983
996
|
vue.createElementVNode("a", {
|
|
984
997
|
href: "javascript:",
|
|
985
998
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1037,10 +1050,60 @@
|
|
|
1037
1050
|
_: 3
|
|
1038
1051
|
}, 8, ["body-style"])) : vue.createCommentVNode("", true);
|
|
1039
1052
|
}
|
|
1040
|
-
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1053
|
+
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
|
|
1054
|
+
|
|
1055
|
+
const _sfc_main$o = vue.defineComponent({
|
|
1056
|
+
props: {
|
|
1057
|
+
labelWidth: String,
|
|
1058
|
+
expandMore: Boolean,
|
|
1059
|
+
span: Number,
|
|
1060
|
+
model: {
|
|
1061
|
+
type: Object,
|
|
1062
|
+
default: () => ({})
|
|
1063
|
+
},
|
|
1064
|
+
config: {
|
|
1065
|
+
type: Object,
|
|
1066
|
+
default: () => ({})
|
|
1067
|
+
},
|
|
1068
|
+
prop: String,
|
|
1069
|
+
size: String
|
|
1070
|
+
},
|
|
1071
|
+
emits: ["change"],
|
|
1072
|
+
setup(props, { emit }) {
|
|
1073
|
+
const mForm = vue.inject("mForm");
|
|
1074
|
+
const changeHandler = () => emit("change", props.model);
|
|
1075
|
+
return {
|
|
1076
|
+
mForm,
|
|
1077
|
+
display: vue.computed(() => display(mForm, props.config.display, props)),
|
|
1078
|
+
changeHandler
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1083
|
+
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
1084
|
+
const _component_el_col = vue.resolveComponent("el-col");
|
|
1085
|
+
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_col, { span: _ctx.span }, {
|
|
1086
|
+
default: vue.withCtx(() => [
|
|
1087
|
+
vue.createVNode(_component_m_form_container, {
|
|
1088
|
+
model: _ctx.model,
|
|
1089
|
+
config: _ctx.config,
|
|
1090
|
+
prop: _ctx.prop,
|
|
1091
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1092
|
+
"expand-more": _ctx.expandMore,
|
|
1093
|
+
size: _ctx.size,
|
|
1094
|
+
onChange: _ctx.changeHandler
|
|
1095
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1096
|
+
]),
|
|
1097
|
+
_: 1
|
|
1098
|
+
}, 8, ["span"])), [
|
|
1099
|
+
[vue.vShow, _ctx.display && _ctx.config.type !== "hidden"]
|
|
1100
|
+
]);
|
|
1101
|
+
}
|
|
1102
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$l]]);
|
|
1041
1103
|
|
|
1042
1104
|
const _sfc_main$n = vue.defineComponent({
|
|
1043
1105
|
name: "m-form-row",
|
|
1106
|
+
components: { Col },
|
|
1044
1107
|
props: {
|
|
1045
1108
|
labelWidth: String,
|
|
1046
1109
|
expandMore: Boolean,
|
|
@@ -1062,38 +1125,27 @@
|
|
|
1062
1125
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1063
1126
|
return {
|
|
1064
1127
|
mForm,
|
|
1065
|
-
display(config) {
|
|
1066
|
-
return display(mForm, config.display, props);
|
|
1067
|
-
},
|
|
1068
1128
|
changeHandler
|
|
1069
1129
|
};
|
|
1070
1130
|
}
|
|
1071
1131
|
});
|
|
1072
1132
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1073
|
-
const
|
|
1074
|
-
const _component_el_col = vue.resolveComponent("el-col");
|
|
1133
|
+
const _component_Col = vue.resolveComponent("Col");
|
|
1075
1134
|
const _component_el_row = vue.resolveComponent("el-row");
|
|
1076
1135
|
return vue.openBlock(), vue.createBlock(_component_el_row, { gutter: 10 }, {
|
|
1077
1136
|
default: vue.withCtx(() => [
|
|
1078
1137
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (col, index) => {
|
|
1079
|
-
return vue.openBlock(), vue.createBlock(
|
|
1080
|
-
style: vue.normalizeStyle(!_ctx.display(col) || col.type === "hidden" ? "display: none" : ""),
|
|
1138
|
+
return vue.openBlock(), vue.createBlock(_component_Col, {
|
|
1081
1139
|
key: col[_ctx.mForm?.keyProp || "__key"] ?? index,
|
|
1082
|
-
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
size: _ctx.size,
|
|
1092
|
-
onChange: _ctx.changeHandler
|
|
1093
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1094
|
-
]),
|
|
1095
|
-
_: 2
|
|
1096
|
-
}, 1032, ["style", "span"]);
|
|
1140
|
+
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
|
|
1141
|
+
config: col,
|
|
1142
|
+
labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1143
|
+
expandMore: _ctx.expandMore,
|
|
1144
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1145
|
+
prop: _ctx.prop,
|
|
1146
|
+
size: _ctx.size,
|
|
1147
|
+
onChange: _ctx.changeHandler
|
|
1148
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "onChange"]);
|
|
1097
1149
|
}), 128))
|
|
1098
1150
|
]),
|
|
1099
1151
|
_: 1
|
|
@@ -1552,7 +1604,7 @@
|
|
|
1552
1604
|
};
|
|
1553
1605
|
}
|
|
1554
1606
|
});
|
|
1555
|
-
const _hoisted_1$
|
|
1607
|
+
const _hoisted_1$a = ["innerHTML"];
|
|
1556
1608
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1557
1609
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1558
1610
|
const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0");
|
|
@@ -1581,7 +1633,7 @@
|
|
|
1581
1633
|
key: 0,
|
|
1582
1634
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1583
1635
|
innerHTML: _ctx.config.extra
|
|
1584
|
-
}, null, 8, _hoisted_1$
|
|
1636
|
+
}, null, 8, _hoisted_1$a)) : vue.createCommentVNode("", true),
|
|
1585
1637
|
vue.createElementVNode("div", _hoisted_2$2, [
|
|
1586
1638
|
vue.createVNode(_component_el_tooltip, {
|
|
1587
1639
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -1622,8 +1674,8 @@
|
|
|
1622
1674
|
}, {
|
|
1623
1675
|
default: vue.withCtx((scope) => [
|
|
1624
1676
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
1625
|
-
|
|
1626
|
-
|
|
1677
|
+
type: "danger",
|
|
1678
|
+
text: "",
|
|
1627
1679
|
icon: _ctx.Delete,
|
|
1628
1680
|
onClick: ($event) => _ctx.removeHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1629
1681
|
}, null, 8, ["icon", "onClick"]), [
|
|
@@ -1647,8 +1699,9 @@
|
|
|
1647
1699
|
vue.createVNode(_component_el_button, {
|
|
1648
1700
|
plain: "",
|
|
1649
1701
|
size: "small",
|
|
1702
|
+
type: "primary",
|
|
1650
1703
|
icon: _ctx.ArrowUp,
|
|
1651
|
-
|
|
1704
|
+
text: "",
|
|
1652
1705
|
onClick: ($event) => _ctx.upHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1653
1706
|
onDblclick: ($event) => _ctx.topHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1654
1707
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1664,8 +1717,9 @@
|
|
|
1664
1717
|
vue.createVNode(_component_el_button, {
|
|
1665
1718
|
plain: "",
|
|
1666
1719
|
size: "small",
|
|
1720
|
+
type: "primary",
|
|
1667
1721
|
icon: _ctx.ArrowDown,
|
|
1668
|
-
|
|
1722
|
+
text: "",
|
|
1669
1723
|
onClick: ($event) => _ctx.downHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1670
1724
|
onDblclick: ($event) => _ctx.bottomHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1671
1725
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1742,6 +1796,7 @@
|
|
|
1742
1796
|
key: 1,
|
|
1743
1797
|
icon: _ctx.Grid,
|
|
1744
1798
|
size: "small",
|
|
1799
|
+
type: "primary",
|
|
1745
1800
|
onClick: _ctx.toggleMode
|
|
1746
1801
|
}, {
|
|
1747
1802
|
default: vue.withCtx(() => [
|
|
@@ -1753,6 +1808,7 @@
|
|
|
1753
1808
|
key: 2,
|
|
1754
1809
|
icon: _ctx.FullScreen,
|
|
1755
1810
|
size: "small",
|
|
1811
|
+
type: "primary",
|
|
1756
1812
|
onClick: _ctx.toggleFullscreen
|
|
1757
1813
|
}, {
|
|
1758
1814
|
default: vue.withCtx(() => [
|
|
@@ -2103,13 +2159,13 @@
|
|
|
2103
2159
|
};
|
|
2104
2160
|
}
|
|
2105
2161
|
});
|
|
2106
|
-
const _hoisted_1$
|
|
2162
|
+
const _hoisted_1$9 = {
|
|
2107
2163
|
class: "m-cascader",
|
|
2108
2164
|
style: { "width": "100%" }
|
|
2109
2165
|
};
|
|
2110
2166
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2111
2167
|
const _component_el_cascader = vue.resolveComponent("el-cascader");
|
|
2112
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2168
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
2113
2169
|
vue.createVNode(_component_el_cascader, {
|
|
2114
2170
|
modelValue: _ctx.model[_ctx.name],
|
|
2115
2171
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2149,7 +2205,7 @@
|
|
|
2149
2205
|
} else {
|
|
2150
2206
|
return props.config.activeValue;
|
|
2151
2207
|
}
|
|
2152
|
-
return
|
|
2208
|
+
return void 0;
|
|
2153
2209
|
}),
|
|
2154
2210
|
inactiveValue: vue.computed(() => {
|
|
2155
2211
|
if (typeof props.config.inactiveValue === "undefined") {
|
|
@@ -2159,7 +2215,7 @@
|
|
|
2159
2215
|
} else {
|
|
2160
2216
|
return props.config.inactiveValue;
|
|
2161
2217
|
}
|
|
2162
|
-
return
|
|
2218
|
+
return void 0;
|
|
2163
2219
|
}),
|
|
2164
2220
|
changeHandler(value) {
|
|
2165
2221
|
emit("change", value);
|
|
@@ -2232,7 +2288,7 @@
|
|
|
2232
2288
|
}
|
|
2233
2289
|
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
|
|
2234
2290
|
|
|
2235
|
-
const _hoisted_1$
|
|
2291
|
+
const _hoisted_1$8 = { key: 0 };
|
|
2236
2292
|
const __default__$2 = vue.defineComponent({
|
|
2237
2293
|
name: "m-fields-color-picker"
|
|
2238
2294
|
});
|
|
@@ -2252,7 +2308,7 @@
|
|
|
2252
2308
|
const changeHandler = (value) => emit("change", value);
|
|
2253
2309
|
return (_ctx, _cache) => {
|
|
2254
2310
|
const _component_el_color_picker = vue.resolveComponent("el-color-picker");
|
|
2255
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2311
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
2256
2312
|
vue.createVNode(_component_el_color_picker, {
|
|
2257
2313
|
modelValue: _ctx.model[_ctx.name],
|
|
2258
2314
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2288,10 +2344,10 @@
|
|
|
2288
2344
|
};
|
|
2289
2345
|
}
|
|
2290
2346
|
});
|
|
2291
|
-
const _hoisted_1$
|
|
2347
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2292
2348
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2293
2349
|
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
2294
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2350
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
|
|
2295
2351
|
vue.createVNode(_component_el_date_picker, {
|
|
2296
2352
|
modelValue: _ctx.model[_ctx.modelName],
|
|
2297
2353
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
|
|
@@ -2395,10 +2451,10 @@
|
|
|
2395
2451
|
};
|
|
2396
2452
|
}
|
|
2397
2453
|
});
|
|
2398
|
-
const _hoisted_1$
|
|
2454
|
+
const _hoisted_1$6 = { key: 0 };
|
|
2399
2455
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2400
2456
|
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
2401
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2457
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
2402
2458
|
vue.createVNode(_component_el_date_picker, {
|
|
2403
2459
|
modelValue: _ctx.model[_ctx.name],
|
|
2404
2460
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2415,7 +2471,7 @@
|
|
|
2415
2471
|
}
|
|
2416
2472
|
var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
2417
2473
|
|
|
2418
|
-
const _hoisted_1$
|
|
2474
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2419
2475
|
const __default__$1 = vue.defineComponent({
|
|
2420
2476
|
name: "m-fields-display"
|
|
2421
2477
|
});
|
|
@@ -2436,7 +2492,7 @@
|
|
|
2436
2492
|
}
|
|
2437
2493
|
useAddField(props.prop);
|
|
2438
2494
|
return (_ctx, _cache) => {
|
|
2439
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
2495
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$5, vue.toDisplayString(_ctx.model[vue.unref(n)]), 1)) : vue.createCommentVNode("", true);
|
|
2440
2496
|
};
|
|
2441
2497
|
}
|
|
2442
2498
|
});
|
|
@@ -2506,12 +2562,12 @@
|
|
|
2506
2562
|
}
|
|
2507
2563
|
}
|
|
2508
2564
|
});
|
|
2509
|
-
const _hoisted_1$
|
|
2565
|
+
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2510
2566
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2511
2567
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
2512
2568
|
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
2513
2569
|
const _component_el_form = vue.resolveComponent("el-form");
|
|
2514
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2570
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
2515
2571
|
vue.createVNode(_component_el_form, { size: "small" }, {
|
|
2516
2572
|
default: vue.withCtx(() => [
|
|
2517
2573
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Object.keys(_ctx.fieldMap.value), (key) => {
|
|
@@ -2633,7 +2689,7 @@
|
|
|
2633
2689
|
};
|
|
2634
2690
|
}
|
|
2635
2691
|
});
|
|
2636
|
-
const _hoisted_1$
|
|
2692
|
+
const _hoisted_1$3 = ["href"];
|
|
2637
2693
|
const _hoisted_2$1 = {
|
|
2638
2694
|
key: 2,
|
|
2639
2695
|
class: "m-fields-link"
|
|
@@ -2647,12 +2703,13 @@
|
|
|
2647
2703
|
target: "_blank",
|
|
2648
2704
|
href: _ctx.href,
|
|
2649
2705
|
style: vue.normalizeStyle(_ctx.config.css || {})
|
|
2650
|
-
}, vue.toDisplayString(_ctx.displayText), 13, _hoisted_1$
|
|
2706
|
+
}, vue.toDisplayString(_ctx.displayText), 13, _hoisted_1$3)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
2651
2707
|
key: 1,
|
|
2652
2708
|
style: vue.normalizeStyle(_ctx.config.disabledCss || {})
|
|
2653
2709
|
}, vue.toDisplayString(_ctx.displayText), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
|
|
2654
2710
|
vue.createVNode(_component_el_button, {
|
|
2655
|
-
|
|
2711
|
+
text: "",
|
|
2712
|
+
type: "primary",
|
|
2656
2713
|
onClick: _ctx.editHandler
|
|
2657
2714
|
}, {
|
|
2658
2715
|
default: vue.withCtx(() => [
|
|
@@ -2945,6 +3002,7 @@
|
|
|
2945
3002
|
vue.watch(() => mForm?.values, () => {
|
|
2946
3003
|
typeof props.config.options === "function" && Promise.resolve(props.config.options(mForm, {
|
|
2947
3004
|
model: props.model,
|
|
3005
|
+
prop: props.prop,
|
|
2948
3006
|
formValues: mForm?.values,
|
|
2949
3007
|
formValue: mForm?.values
|
|
2950
3008
|
})).then((data) => {
|
|
@@ -2995,11 +3053,10 @@
|
|
|
2995
3053
|
options,
|
|
2996
3054
|
moreLoadingVisible,
|
|
2997
3055
|
popperClass: mForm?.popperClass,
|
|
3056
|
+
getOptions,
|
|
2998
3057
|
getRequestFuc() {
|
|
2999
3058
|
return getConfig("request");
|
|
3000
3059
|
},
|
|
3001
|
-
async getInitOption() {
|
|
3002
|
-
},
|
|
3003
3060
|
changeHandler(value) {
|
|
3004
3061
|
emit("change", value);
|
|
3005
3062
|
},
|
|
@@ -3016,10 +3073,6 @@
|
|
|
3016
3073
|
options.value = await getOptions();
|
|
3017
3074
|
}
|
|
3018
3075
|
},
|
|
3019
|
-
async editAfterAction() {
|
|
3020
|
-
pgIndex.value = 0;
|
|
3021
|
-
options.value = await getOptions();
|
|
3022
|
-
},
|
|
3023
3076
|
async remoteMethod(q) {
|
|
3024
3077
|
if (!localOptions.value.length) {
|
|
3025
3078
|
query.value = q;
|
|
@@ -3034,7 +3087,7 @@
|
|
|
3034
3087
|
};
|
|
3035
3088
|
}
|
|
3036
3089
|
});
|
|
3037
|
-
const _hoisted_1$
|
|
3090
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3038
3091
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3039
3092
|
const _component_el_option = vue.resolveComponent("el-option");
|
|
3040
3093
|
const _component_el_option_group = vue.resolveComponent("el-option-group");
|
|
@@ -3056,21 +3109,21 @@
|
|
|
3056
3109
|
"value-key": _ctx.config.valueKey || "value",
|
|
3057
3110
|
"allow-create": _ctx.config.allowCreate,
|
|
3058
3111
|
disabled: _ctx.disabled,
|
|
3059
|
-
"remote-method": _ctx.remoteMethod,
|
|
3112
|
+
"remote-method": _ctx.config.remote && _ctx.remoteMethod,
|
|
3060
3113
|
onChange: _ctx.changeHandler,
|
|
3061
3114
|
onVisibleChange: _ctx.visibleHandler
|
|
3062
3115
|
}, {
|
|
3063
3116
|
default: vue.withCtx(() => [
|
|
3064
3117
|
_ctx.config.group ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.options, (group, index) => {
|
|
3065
3118
|
return vue.openBlock(), vue.createBlock(_component_el_option_group, {
|
|
3066
|
-
key:
|
|
3119
|
+
key: index,
|
|
3067
3120
|
label: group.label,
|
|
3068
3121
|
disabled: group.disabled
|
|
3069
3122
|
}, {
|
|
3070
3123
|
default: vue.withCtx(() => [
|
|
3071
3124
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(group.options, (item, index2) => {
|
|
3072
3125
|
return vue.openBlock(), vue.createBlock(_component_el_option, {
|
|
3073
|
-
key:
|
|
3126
|
+
key: index2,
|
|
3074
3127
|
label: item.label,
|
|
3075
3128
|
value: item.value,
|
|
3076
3129
|
disabled: item.disabled
|
|
@@ -3087,7 +3140,7 @@
|
|
|
3087
3140
|
disabled: option.disabled
|
|
3088
3141
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3089
3142
|
}), 128)),
|
|
3090
|
-
_ctx.moreLoadingVisible ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3143
|
+
_ctx.moreLoadingVisible ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3091
3144
|
[_directive_loading, true]
|
|
3092
3145
|
]) : vue.createCommentVNode("", true)
|
|
3093
3146
|
]),
|
|
@@ -3164,6 +3217,7 @@
|
|
|
3164
3217
|
},
|
|
3165
3218
|
emits: ["change", "input"],
|
|
3166
3219
|
setup(props, { emit }) {
|
|
3220
|
+
const mForm = vue.inject("mForm");
|
|
3167
3221
|
useAddField(props.prop);
|
|
3168
3222
|
const modelName = vue.computed(() => props.name || props.config.name || "");
|
|
3169
3223
|
return {
|
|
@@ -3172,12 +3226,10 @@
|
|
|
3172
3226
|
emit("change", v);
|
|
3173
3227
|
},
|
|
3174
3228
|
inputHandler(v) {
|
|
3175
|
-
const mForm = vue.inject("mForm");
|
|
3176
3229
|
emit("input", v);
|
|
3177
3230
|
mForm?.$emit("field-input", props.prop, v);
|
|
3178
3231
|
},
|
|
3179
3232
|
buttonClickHandler() {
|
|
3180
|
-
const mForm = vue.inject("mForm");
|
|
3181
3233
|
if (typeof props.config.append === "string")
|
|
3182
3234
|
return;
|
|
3183
3235
|
if (props.config.append?.handler) {
|
|
@@ -3241,7 +3293,7 @@
|
|
|
3241
3293
|
};
|
|
3242
3294
|
}
|
|
3243
3295
|
});
|
|
3244
|
-
const _hoisted_1$
|
|
3296
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3245
3297
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3246
3298
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
3247
3299
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
@@ -3259,17 +3311,18 @@
|
|
|
3259
3311
|
_ctx.config.append ? {
|
|
3260
3312
|
name: "append",
|
|
3261
3313
|
fn: vue.withCtx(() => [
|
|
3262
|
-
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
3314
|
+
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString(_ctx.config.append), 1)) : vue.createCommentVNode("", true),
|
|
3263
3315
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
3264
3316
|
key: 1,
|
|
3265
3317
|
style: { "color": "#409eff" },
|
|
3266
|
-
|
|
3318
|
+
size: _ctx.size,
|
|
3319
|
+
onClick: vue.withModifiers(_ctx.buttonClickHandler, ["prevent"])
|
|
3267
3320
|
}, {
|
|
3268
3321
|
default: vue.withCtx(() => [
|
|
3269
3322
|
vue.createTextVNode(vue.toDisplayString(_ctx.config.append.text), 1)
|
|
3270
3323
|
]),
|
|
3271
3324
|
_: 1
|
|
3272
|
-
}, 8, ["onClick"])) : vue.createCommentVNode("", true)
|
|
3325
|
+
}, 8, ["size", "onClick"])) : vue.createCommentVNode("", true)
|
|
3273
3326
|
])
|
|
3274
3327
|
} : void 0
|
|
3275
3328
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
@@ -3308,22 +3361,19 @@
|
|
|
3308
3361
|
};
|
|
3309
3362
|
}
|
|
3310
3363
|
});
|
|
3311
|
-
const _hoisted_1$1 = { key: 0 };
|
|
3312
3364
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3313
3365
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
3314
|
-
return
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"])
|
|
3326
|
-
])) : vue.createCommentVNode("", true);
|
|
3366
|
+
return vue.openBlock(), vue.createBlock(_component_el_input, {
|
|
3367
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3368
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3369
|
+
type: "textarea",
|
|
3370
|
+
size: _ctx.size,
|
|
3371
|
+
clearable: "",
|
|
3372
|
+
placeholder: _ctx.config.placeholder,
|
|
3373
|
+
disabled: _ctx.disabled,
|
|
3374
|
+
onChange: _ctx.changeHandler,
|
|
3375
|
+
onInput: _ctx.inputHandler
|
|
3376
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3327
3377
|
}
|
|
3328
3378
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3329
3379
|
|
|
@@ -3471,7 +3521,7 @@
|
|
|
3471
3521
|
submitForm: async (native) => {
|
|
3472
3522
|
try {
|
|
3473
3523
|
await elForm.value?.validate();
|
|
3474
|
-
return native ? values.value : lodashEs.cloneDeep(values.value);
|
|
3524
|
+
return native ? values.value : lodashEs.cloneDeep(vue.toRaw(values.value));
|
|
3475
3525
|
} catch (invalidFields) {
|
|
3476
3526
|
const error = [];
|
|
3477
3527
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|
|
@@ -3798,8 +3848,7 @@
|
|
|
3798
3848
|
exports.initValue = initValue;
|
|
3799
3849
|
exports.useAddField = useAddField;
|
|
3800
3850
|
|
|
3801
|
-
Object.
|
|
3802
|
-
exports[Symbol.toStringTag] = 'Module';
|
|
3851
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
3803
3852
|
|
|
3804
3853
|
}));
|
|
3805
3854
|
//# sourceMappingURL=tmagic-form.umd.js.map
|