@tmagic/form 1.0.0-beta.6 → 1.0.0-rc.2
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/LICENSE +5432 -0
- 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 +188 -127
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +191 -131
- package/dist/tmagic-form.umd.js.map +1 -1
- package/dist/types/src/Form.vue.d.ts +181 -120
- package/dist/types/src/FormDialog.vue.d.ts +357 -238
- 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 +1742 -544
- package/dist/types/src/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/Link.vue.d.ts +710 -472
- package/dist/types/src/schema.d.ts +2 -0
- package/package.json +29 -9
- package/src/Form.vue +7 -2
- package/src/FormDialog.vue +1 -1
- package/src/containers/Col.vue +56 -0
- package/src/containers/Container.vue +28 -11
- 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 +8 -15
- package/src/fields/Text.vue +4 -4
- package/src/fields/Textarea.vue +11 -13
- package/src/schema.ts +2 -0
- package/src/theme/form.scss +24 -17
- package/src/utils/form.ts +5 -1
- package/dist/types/src/fields/Cascader.vue.d.ts +0 -1748
- package/dist/types/src/fields/Select.vue.d.ts +0 -975
- 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
|
});
|
|
@@ -264,9 +270,14 @@ const _sfc_main$s = defineComponent({
|
|
|
264
270
|
};
|
|
265
271
|
const onChangeHandler = async function(v, key2) {
|
|
266
272
|
const { filter, onChange, trim, name: name2, dynamicKey } = props.config;
|
|
267
|
-
let value =
|
|
268
|
-
|
|
269
|
-
|
|
273
|
+
let value = v;
|
|
274
|
+
try {
|
|
275
|
+
value = filterHandler(filter, v);
|
|
276
|
+
value = await changeHandler(onChange, value) ?? value;
|
|
277
|
+
value = trimHandler(trim, value) ?? value;
|
|
278
|
+
} catch (e) {
|
|
279
|
+
console.error(e);
|
|
280
|
+
}
|
|
270
281
|
if ((name2 || name2 === 0) && props.model !== value && (v !== value || props.model[name2] !== value)) {
|
|
271
282
|
props.model[name2] = value;
|
|
272
283
|
}
|
|
@@ -283,6 +294,7 @@ const _sfc_main$s = defineComponent({
|
|
|
283
294
|
itemProp,
|
|
284
295
|
items,
|
|
285
296
|
display: display$1,
|
|
297
|
+
itemLabelWidth,
|
|
286
298
|
tagName,
|
|
287
299
|
rule,
|
|
288
300
|
tooltip,
|
|
@@ -293,24 +305,25 @@ const _sfc_main$s = defineComponent({
|
|
|
293
305
|
};
|
|
294
306
|
}
|
|
295
307
|
});
|
|
296
|
-
const _hoisted_1$
|
|
308
|
+
const _hoisted_1$f = ["innerHTML"];
|
|
297
309
|
const _hoisted_2$7 = ["innerHTML"];
|
|
298
310
|
const _hoisted_3$7 = ["innerHTML"];
|
|
299
|
-
const _hoisted_4$6 =
|
|
300
|
-
const _hoisted_5$4 =
|
|
301
|
-
const _hoisted_6$3 = {
|
|
311
|
+
const _hoisted_4$6 = ["innerHTML"];
|
|
312
|
+
const _hoisted_5$4 = {
|
|
302
313
|
key: 4,
|
|
303
314
|
style: { "text-align": "center" }
|
|
304
315
|
};
|
|
305
|
-
function _sfc_render$
|
|
316
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
306
317
|
const _component_m_fields_hidden = resolveComponent("m-fields-hidden");
|
|
307
318
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
308
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");
|
|
309
322
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
310
323
|
const _component_el_button = resolveComponent("el-button");
|
|
311
324
|
return _ctx.config ? (openBlock(), createElementBlock("div", {
|
|
312
325
|
key: 0,
|
|
313
|
-
style: normalizeStyle(_ctx.config.tip ? "display: flex" : ""),
|
|
326
|
+
style: normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
|
|
314
327
|
class: normalizeClass([_ctx.config.className, "m-form-container"])
|
|
315
328
|
}, [
|
|
316
329
|
_ctx.type === "hidden" ? (openBlock(), createBlock(_component_m_fields_hidden, {
|
|
@@ -329,19 +342,20 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
329
342
|
prop: _ctx.itemProp,
|
|
330
343
|
"step-active": _ctx.stepActive,
|
|
331
344
|
"expand-more": _ctx.expand,
|
|
332
|
-
"label-width": _ctx.
|
|
345
|
+
"label-width": _ctx.itemLabelWidth,
|
|
333
346
|
onChange: _ctx.onChangeHandler
|
|
334
347
|
}, null, 8, ["size", "model", "config", "name", "prop", "step-active", "expand-more", "label-width", "onChange"])) : _ctx.type && _ctx.display ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
335
348
|
createVNode(_component_el_form_item, {
|
|
336
349
|
style: normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
|
|
350
|
+
class: normalizeClass({ hidden: _ctx.itemLabelWidth === 0 || !_ctx.config.text }),
|
|
337
351
|
prop: _ctx.itemProp,
|
|
338
|
-
"label-width": _ctx.
|
|
352
|
+
"label-width": _ctx.itemLabelWidth,
|
|
339
353
|
rules: _ctx.rule
|
|
340
354
|
}, {
|
|
341
355
|
label: withCtx(() => [
|
|
342
356
|
createElementVNode("span", {
|
|
343
357
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
344
|
-
}, null, 8, _hoisted_1$
|
|
358
|
+
}, null, 8, _hoisted_1$f)
|
|
345
359
|
]),
|
|
346
360
|
default: withCtx(() => [
|
|
347
361
|
_ctx.tooltip ? (openBlock(), createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -378,19 +392,23 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
378
392
|
}, null, 8, _hoisted_3$7)) : createCommentVNode("", true)
|
|
379
393
|
]),
|
|
380
394
|
_: 1
|
|
381
|
-
}, 8, ["style", "prop", "label-width", "rules"]),
|
|
395
|
+
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
382
396
|
_ctx.config.tip ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
383
397
|
key: 0,
|
|
384
|
-
placement: "
|
|
385
|
-
style: { "line-height": "40px", "margin-left": "5px" }
|
|
398
|
+
placement: "left"
|
|
386
399
|
}, {
|
|
387
400
|
content: withCtx(() => [
|
|
388
401
|
createElementVNode("div", {
|
|
389
402
|
innerHTML: _ctx.config.tip
|
|
390
|
-
}, null, 8,
|
|
403
|
+
}, null, 8, _hoisted_4$6)
|
|
391
404
|
]),
|
|
392
405
|
default: withCtx(() => [
|
|
393
|
-
|
|
406
|
+
createVNode(_component_el_icon, { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
407
|
+
default: withCtx(() => [
|
|
408
|
+
createVNode(_component_warning_filled)
|
|
409
|
+
]),
|
|
410
|
+
_: 1
|
|
411
|
+
})
|
|
394
412
|
]),
|
|
395
413
|
_: 1
|
|
396
414
|
})) : createCommentVNode("", true)
|
|
@@ -403,15 +421,15 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
403
421
|
size: _ctx.size,
|
|
404
422
|
"step-active": _ctx.stepActive,
|
|
405
423
|
"expand-more": _ctx.expand,
|
|
406
|
-
"label-width": _ctx.
|
|
424
|
+
"label-width": _ctx.itemLabelWidth,
|
|
407
425
|
prop: _ctx.itemProp,
|
|
408
426
|
onChange: _ctx.onChangeHandler
|
|
409
427
|
}, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
|
|
410
428
|
}), 128)) : createCommentVNode("", true)
|
|
411
429
|
], 64)) : createCommentVNode("", true),
|
|
412
|
-
_ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div",
|
|
430
|
+
_ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
|
|
413
431
|
createVNode(_component_el_button, {
|
|
414
|
-
|
|
432
|
+
text: "",
|
|
415
433
|
onClick: _ctx.expandHandler
|
|
416
434
|
}, {
|
|
417
435
|
default: withCtx(() => [
|
|
@@ -422,9 +440,9 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
422
440
|
])) : createCommentVNode("", true)
|
|
423
441
|
], 6)) : createCommentVNode("", true);
|
|
424
442
|
}
|
|
425
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
443
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
426
444
|
|
|
427
|
-
const _sfc_main$
|
|
445
|
+
const _sfc_main$s = defineComponent({
|
|
428
446
|
name: "m-form-fieldset",
|
|
429
447
|
props: {
|
|
430
448
|
labelWidth: String,
|
|
@@ -476,7 +494,7 @@ const _sfc_main$r = defineComponent({
|
|
|
476
494
|
};
|
|
477
495
|
}
|
|
478
496
|
});
|
|
479
|
-
const _hoisted_1$
|
|
497
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
480
498
|
const _hoisted_2$6 = ["innerHTML"];
|
|
481
499
|
const _hoisted_3$6 = { key: 1 };
|
|
482
500
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -490,7 +508,7 @@ const _hoisted_9$1 = {
|
|
|
490
508
|
};
|
|
491
509
|
const _hoisted_10$1 = { style: { "flex": "1" } };
|
|
492
510
|
const _hoisted_11 = ["src"];
|
|
493
|
-
function _sfc_render$
|
|
511
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
494
512
|
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
495
513
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
496
514
|
return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (openBlock(), createElementBlock("fieldset", {
|
|
@@ -510,7 +528,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
510
528
|
default: withCtx(() => [
|
|
511
529
|
createElementVNode("span", {
|
|
512
530
|
innerHTML: _ctx.config.legend
|
|
513
|
-
}, null, 8, _hoisted_1$
|
|
531
|
+
}, null, 8, _hoisted_1$e),
|
|
514
532
|
_ctx.config.extra ? (openBlock(), createElementBlock("span", {
|
|
515
533
|
key: 0,
|
|
516
534
|
innerHTML: _ctx.config.extra,
|
|
@@ -582,9 +600,9 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
582
600
|
}), 128)) : createCommentVNode("", true)
|
|
583
601
|
], 4)) : createCommentVNode("", true);
|
|
584
602
|
}
|
|
585
|
-
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
603
|
+
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
586
604
|
|
|
587
|
-
const _sfc_main$
|
|
605
|
+
const _sfc_main$r = defineComponent({
|
|
588
606
|
name: "m-form-group-list-item",
|
|
589
607
|
components: { CaretRight, CaretBottom },
|
|
590
608
|
props: {
|
|
@@ -668,11 +686,11 @@ const _sfc_main$q = defineComponent({
|
|
|
668
686
|
};
|
|
669
687
|
}
|
|
670
688
|
});
|
|
671
|
-
const _hoisted_1$
|
|
689
|
+
const _hoisted_1$d = { class: "m-fields-group-list-item" };
|
|
672
690
|
const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("\u4E0A\u79FB");
|
|
673
691
|
const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("\u4E0B\u79FB");
|
|
674
692
|
const _hoisted_4$4 = ["innerHTML"];
|
|
675
|
-
function _sfc_render$
|
|
693
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
676
694
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
677
695
|
const _component_caret_right = resolveComponent("caret-right");
|
|
678
696
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -680,7 +698,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
680
698
|
const _component_CaretRight = resolveComponent("CaretRight");
|
|
681
699
|
const _component_CaretBottom = resolveComponent("CaretBottom");
|
|
682
700
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
683
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
701
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
684
702
|
createElementVNode("div", null, [
|
|
685
703
|
createVNode(_component_el_icon, {
|
|
686
704
|
style: { "margin-right": "7px" },
|
|
@@ -692,7 +710,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
692
710
|
_: 1
|
|
693
711
|
}, 8, ["onClick"]),
|
|
694
712
|
createVNode(_component_el_button, {
|
|
695
|
-
|
|
713
|
+
text: "",
|
|
696
714
|
onClick: _ctx.expandHandler
|
|
697
715
|
}, {
|
|
698
716
|
default: withCtx(() => [
|
|
@@ -701,7 +719,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
701
719
|
_: 1
|
|
702
720
|
}, 8, ["onClick"]),
|
|
703
721
|
withDirectives(createVNode(_component_el_button, {
|
|
704
|
-
|
|
722
|
+
text: "",
|
|
705
723
|
icon: _ctx.Delete,
|
|
706
724
|
style: { "color": "#f56c6c" },
|
|
707
725
|
onClick: _ctx.removeHandler
|
|
@@ -710,7 +728,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
710
728
|
]),
|
|
711
729
|
_ctx.movable() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
712
730
|
withDirectives(createVNode(_component_el_button, {
|
|
713
|
-
|
|
731
|
+
text: "",
|
|
714
732
|
size: "small",
|
|
715
733
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.changeOrder(-1))
|
|
716
734
|
}, {
|
|
@@ -728,7 +746,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
728
746
|
[vShow, _ctx.index !== 0]
|
|
729
747
|
]),
|
|
730
748
|
withDirectives(createVNode(_component_el_button, {
|
|
731
|
-
|
|
749
|
+
text: "",
|
|
732
750
|
size: "small",
|
|
733
751
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.changeOrder(1))
|
|
734
752
|
}, {
|
|
@@ -763,9 +781,9 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
763
781
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : createCommentVNode("", true)
|
|
764
782
|
]);
|
|
765
783
|
}
|
|
766
|
-
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
784
|
+
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
767
785
|
|
|
768
|
-
const _sfc_main$
|
|
786
|
+
const _sfc_main$q = defineComponent({
|
|
769
787
|
name: "m-form-group-list",
|
|
770
788
|
components: { MFieldsGroupListItem },
|
|
771
789
|
props: {
|
|
@@ -857,7 +875,7 @@ const _sfc_main$p = defineComponent({
|
|
|
857
875
|
};
|
|
858
876
|
}
|
|
859
877
|
});
|
|
860
|
-
const _hoisted_1$
|
|
878
|
+
const _hoisted_1$c = { class: "m-fields-group-list" };
|
|
861
879
|
const _hoisted_2$4 = ["innerHTML"];
|
|
862
880
|
const _hoisted_3$4 = {
|
|
863
881
|
key: 1,
|
|
@@ -869,10 +887,10 @@ const _hoisted_5$2 = [
|
|
|
869
887
|
];
|
|
870
888
|
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
871
889
|
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
872
|
-
function _sfc_render$
|
|
890
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
873
891
|
const _component_m_fields_group_list_item = resolveComponent("m-fields-group-list-item");
|
|
874
892
|
const _component_el_button = resolveComponent("el-button");
|
|
875
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
893
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
876
894
|
_ctx.config.extra ? (openBlock(), createElementBlock("div", {
|
|
877
895
|
key: 0,
|
|
878
896
|
innerHTML: _ctx.config.extra,
|
|
@@ -916,9 +934,9 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
916
934
|
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
917
935
|
]);
|
|
918
936
|
}
|
|
919
|
-
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
937
|
+
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
920
938
|
|
|
921
|
-
const _sfc_main$
|
|
939
|
+
const _sfc_main$p = defineComponent({
|
|
922
940
|
name: "m-form-panel",
|
|
923
941
|
components: { CaretBottom, CaretRight },
|
|
924
942
|
props: {
|
|
@@ -951,7 +969,7 @@ const _sfc_main$o = defineComponent({
|
|
|
951
969
|
};
|
|
952
970
|
}
|
|
953
971
|
});
|
|
954
|
-
const _hoisted_1$
|
|
972
|
+
const _hoisted_1$b = { class: "clearfix" };
|
|
955
973
|
const _hoisted_2$3 = ["innerHTML"];
|
|
956
974
|
const _hoisted_3$3 = {
|
|
957
975
|
key: 0,
|
|
@@ -959,7 +977,7 @@ const _hoisted_3$3 = {
|
|
|
959
977
|
};
|
|
960
978
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
961
979
|
const _hoisted_5$1 = ["src"];
|
|
962
|
-
function _sfc_render$
|
|
980
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
963
981
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
964
982
|
const _component_caret_right = resolveComponent("caret-right");
|
|
965
983
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -971,7 +989,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
971
989
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
972
990
|
}, {
|
|
973
991
|
header: withCtx(() => [
|
|
974
|
-
createElementVNode("div", _hoisted_1$
|
|
992
|
+
createElementVNode("div", _hoisted_1$b, [
|
|
975
993
|
createElementVNode("a", {
|
|
976
994
|
href: "javascript:",
|
|
977
995
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1029,10 +1047,60 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1029
1047
|
_: 3
|
|
1030
1048
|
}, 8, ["body-style"])) : createCommentVNode("", true);
|
|
1031
1049
|
}
|
|
1032
|
-
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]]);
|
|
1033
1100
|
|
|
1034
1101
|
const _sfc_main$n = defineComponent({
|
|
1035
1102
|
name: "m-form-row",
|
|
1103
|
+
components: { Col },
|
|
1036
1104
|
props: {
|
|
1037
1105
|
labelWidth: String,
|
|
1038
1106
|
expandMore: Boolean,
|
|
@@ -1054,38 +1122,27 @@ const _sfc_main$n = defineComponent({
|
|
|
1054
1122
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1055
1123
|
return {
|
|
1056
1124
|
mForm,
|
|
1057
|
-
display(config) {
|
|
1058
|
-
return display(mForm, config.display, props);
|
|
1059
|
-
},
|
|
1060
1125
|
changeHandler
|
|
1061
1126
|
};
|
|
1062
1127
|
}
|
|
1063
1128
|
});
|
|
1064
1129
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1065
|
-
const
|
|
1066
|
-
const _component_el_col = resolveComponent("el-col");
|
|
1130
|
+
const _component_Col = resolveComponent("Col");
|
|
1067
1131
|
const _component_el_row = resolveComponent("el-row");
|
|
1068
1132
|
return openBlock(), createBlock(_component_el_row, { gutter: 10 }, {
|
|
1069
1133
|
default: withCtx(() => [
|
|
1070
1134
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (col, index) => {
|
|
1071
|
-
return openBlock(), createBlock(
|
|
1072
|
-
style: normalizeStyle(!_ctx.display(col) || col.type === "hidden" ? "display: none" : ""),
|
|
1135
|
+
return openBlock(), createBlock(_component_Col, {
|
|
1073
1136
|
key: col[_ctx.mForm?.keyProp || "__key"] ?? index,
|
|
1074
|
-
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
size: _ctx.size,
|
|
1084
|
-
onChange: _ctx.changeHandler
|
|
1085
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1086
|
-
]),
|
|
1087
|
-
_: 2
|
|
1088
|
-
}, 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"]);
|
|
1089
1146
|
}), 128))
|
|
1090
1147
|
]),
|
|
1091
1148
|
_: 1
|
|
@@ -1544,7 +1601,7 @@ const _sfc_main$l = defineComponent({
|
|
|
1544
1601
|
};
|
|
1545
1602
|
}
|
|
1546
1603
|
});
|
|
1547
|
-
const _hoisted_1$
|
|
1604
|
+
const _hoisted_1$a = ["innerHTML"];
|
|
1548
1605
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1549
1606
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1550
1607
|
const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
|
|
@@ -1573,7 +1630,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1573
1630
|
key: 0,
|
|
1574
1631
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1575
1632
|
innerHTML: _ctx.config.extra
|
|
1576
|
-
}, null, 8, _hoisted_1$
|
|
1633
|
+
}, null, 8, _hoisted_1$a)) : createCommentVNode("", true),
|
|
1577
1634
|
createElementVNode("div", _hoisted_2$2, [
|
|
1578
1635
|
createVNode(_component_el_tooltip, {
|
|
1579
1636
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -1614,8 +1671,8 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1614
1671
|
}, {
|
|
1615
1672
|
default: withCtx((scope) => [
|
|
1616
1673
|
withDirectives(createVNode(_component_el_button, {
|
|
1617
|
-
|
|
1618
|
-
|
|
1674
|
+
type: "danger",
|
|
1675
|
+
text: "",
|
|
1619
1676
|
icon: _ctx.Delete,
|
|
1620
1677
|
onClick: ($event) => _ctx.removeHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1621
1678
|
}, null, 8, ["icon", "onClick"]), [
|
|
@@ -1639,8 +1696,9 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1639
1696
|
createVNode(_component_el_button, {
|
|
1640
1697
|
plain: "",
|
|
1641
1698
|
size: "small",
|
|
1699
|
+
type: "primary",
|
|
1642
1700
|
icon: _ctx.ArrowUp,
|
|
1643
|
-
|
|
1701
|
+
text: "",
|
|
1644
1702
|
onClick: ($event) => _ctx.upHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1645
1703
|
onDblclick: ($event) => _ctx.topHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1646
1704
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1656,8 +1714,9 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1656
1714
|
createVNode(_component_el_button, {
|
|
1657
1715
|
plain: "",
|
|
1658
1716
|
size: "small",
|
|
1717
|
+
type: "primary",
|
|
1659
1718
|
icon: _ctx.ArrowDown,
|
|
1660
|
-
|
|
1719
|
+
text: "",
|
|
1661
1720
|
onClick: ($event) => _ctx.downHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1662
1721
|
onDblclick: ($event) => _ctx.bottomHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1663
1722
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1734,6 +1793,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1734
1793
|
key: 1,
|
|
1735
1794
|
icon: _ctx.Grid,
|
|
1736
1795
|
size: "small",
|
|
1796
|
+
type: "primary",
|
|
1737
1797
|
onClick: _ctx.toggleMode
|
|
1738
1798
|
}, {
|
|
1739
1799
|
default: withCtx(() => [
|
|
@@ -1745,6 +1805,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1745
1805
|
key: 2,
|
|
1746
1806
|
icon: _ctx.FullScreen,
|
|
1747
1807
|
size: "small",
|
|
1808
|
+
type: "primary",
|
|
1748
1809
|
onClick: _ctx.toggleFullscreen
|
|
1749
1810
|
}, {
|
|
1750
1811
|
default: withCtx(() => [
|
|
@@ -2095,13 +2156,13 @@ const _sfc_main$j = defineComponent({
|
|
|
2095
2156
|
};
|
|
2096
2157
|
}
|
|
2097
2158
|
});
|
|
2098
|
-
const _hoisted_1$
|
|
2159
|
+
const _hoisted_1$9 = {
|
|
2099
2160
|
class: "m-cascader",
|
|
2100
2161
|
style: { "width": "100%" }
|
|
2101
2162
|
};
|
|
2102
2163
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2103
2164
|
const _component_el_cascader = resolveComponent("el-cascader");
|
|
2104
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2165
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2105
2166
|
createVNode(_component_el_cascader, {
|
|
2106
2167
|
modelValue: _ctx.model[_ctx.name],
|
|
2107
2168
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2141,7 +2202,7 @@ const _sfc_main$i = defineComponent({
|
|
|
2141
2202
|
} else {
|
|
2142
2203
|
return props.config.activeValue;
|
|
2143
2204
|
}
|
|
2144
|
-
return
|
|
2205
|
+
return void 0;
|
|
2145
2206
|
}),
|
|
2146
2207
|
inactiveValue: computed(() => {
|
|
2147
2208
|
if (typeof props.config.inactiveValue === "undefined") {
|
|
@@ -2151,7 +2212,7 @@ const _sfc_main$i = defineComponent({
|
|
|
2151
2212
|
} else {
|
|
2152
2213
|
return props.config.inactiveValue;
|
|
2153
2214
|
}
|
|
2154
|
-
return
|
|
2215
|
+
return void 0;
|
|
2155
2216
|
}),
|
|
2156
2217
|
changeHandler(value) {
|
|
2157
2218
|
emit("change", value);
|
|
@@ -2224,7 +2285,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2224
2285
|
}
|
|
2225
2286
|
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
|
|
2226
2287
|
|
|
2227
|
-
const _hoisted_1$
|
|
2288
|
+
const _hoisted_1$8 = { key: 0 };
|
|
2228
2289
|
const __default__$2 = defineComponent({
|
|
2229
2290
|
name: "m-fields-color-picker"
|
|
2230
2291
|
});
|
|
@@ -2244,7 +2305,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
2244
2305
|
const changeHandler = (value) => emit("change", value);
|
|
2245
2306
|
return (_ctx, _cache) => {
|
|
2246
2307
|
const _component_el_color_picker = resolveComponent("el-color-picker");
|
|
2247
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2308
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
2248
2309
|
createVNode(_component_el_color_picker, {
|
|
2249
2310
|
modelValue: _ctx.model[_ctx.name],
|
|
2250
2311
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2280,10 +2341,10 @@ const _sfc_main$f = defineComponent({
|
|
|
2280
2341
|
};
|
|
2281
2342
|
}
|
|
2282
2343
|
});
|
|
2283
|
-
const _hoisted_1$
|
|
2344
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2284
2345
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2285
2346
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2286
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2347
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2287
2348
|
createVNode(_component_el_date_picker, {
|
|
2288
2349
|
modelValue: _ctx.model[_ctx.modelName],
|
|
2289
2350
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
|
|
@@ -2387,10 +2448,10 @@ const _sfc_main$d = defineComponent({
|
|
|
2387
2448
|
};
|
|
2388
2449
|
}
|
|
2389
2450
|
});
|
|
2390
|
-
const _hoisted_1$
|
|
2451
|
+
const _hoisted_1$6 = { key: 0 };
|
|
2391
2452
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2392
2453
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2393
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2454
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
2394
2455
|
createVNode(_component_el_date_picker, {
|
|
2395
2456
|
modelValue: _ctx.model[_ctx.name],
|
|
2396
2457
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2407,7 +2468,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2407
2468
|
}
|
|
2408
2469
|
var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
2409
2470
|
|
|
2410
|
-
const _hoisted_1$
|
|
2471
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2411
2472
|
const __default__$1 = defineComponent({
|
|
2412
2473
|
name: "m-fields-display"
|
|
2413
2474
|
});
|
|
@@ -2428,7 +2489,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2428
2489
|
}
|
|
2429
2490
|
useAddField(props.prop);
|
|
2430
2491
|
return (_ctx, _cache) => {
|
|
2431
|
-
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);
|
|
2432
2493
|
};
|
|
2433
2494
|
}
|
|
2434
2495
|
});
|
|
@@ -2498,12 +2559,12 @@ const _sfc_main$b = defineComponent({
|
|
|
2498
2559
|
}
|
|
2499
2560
|
}
|
|
2500
2561
|
});
|
|
2501
|
-
const _hoisted_1$
|
|
2562
|
+
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2502
2563
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2503
2564
|
const _component_el_input = resolveComponent("el-input");
|
|
2504
2565
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
2505
2566
|
const _component_el_form = resolveComponent("el-form");
|
|
2506
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2567
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2507
2568
|
createVNode(_component_el_form, { size: "small" }, {
|
|
2508
2569
|
default: withCtx(() => [
|
|
2509
2570
|
(openBlock(true), createElementBlock(Fragment, null, renderList(Object.keys(_ctx.fieldMap.value), (key) => {
|
|
@@ -2625,7 +2686,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
2625
2686
|
};
|
|
2626
2687
|
}
|
|
2627
2688
|
});
|
|
2628
|
-
const _hoisted_1$
|
|
2689
|
+
const _hoisted_1$3 = ["href"];
|
|
2629
2690
|
const _hoisted_2$1 = {
|
|
2630
2691
|
key: 2,
|
|
2631
2692
|
class: "m-fields-link"
|
|
@@ -2639,12 +2700,13 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2639
2700
|
target: "_blank",
|
|
2640
2701
|
href: _ctx.href,
|
|
2641
2702
|
style: normalizeStyle(_ctx.config.css || {})
|
|
2642
|
-
}, toDisplayString(_ctx.displayText), 13, _hoisted_1$
|
|
2703
|
+
}, toDisplayString(_ctx.displayText), 13, _hoisted_1$3)) : _ctx.config.href && _ctx.disabled ? (openBlock(), createElementBlock("span", {
|
|
2643
2704
|
key: 1,
|
|
2644
2705
|
style: normalizeStyle(_ctx.config.disabledCss || {})
|
|
2645
2706
|
}, toDisplayString(_ctx.displayText), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
2646
2707
|
createVNode(_component_el_button, {
|
|
2647
|
-
|
|
2708
|
+
text: "",
|
|
2709
|
+
type: "primary",
|
|
2648
2710
|
onClick: _ctx.editHandler
|
|
2649
2711
|
}, {
|
|
2650
2712
|
default: withCtx(() => [
|
|
@@ -2937,6 +2999,7 @@ const _sfc_main$6 = defineComponent({
|
|
|
2937
2999
|
watch(() => mForm?.values, () => {
|
|
2938
3000
|
typeof props.config.options === "function" && Promise.resolve(props.config.options(mForm, {
|
|
2939
3001
|
model: props.model,
|
|
3002
|
+
prop: props.prop,
|
|
2940
3003
|
formValues: mForm?.values,
|
|
2941
3004
|
formValue: mForm?.values
|
|
2942
3005
|
})).then((data) => {
|
|
@@ -2986,11 +3049,11 @@ const _sfc_main$6 = defineComponent({
|
|
|
2986
3049
|
remote,
|
|
2987
3050
|
options,
|
|
2988
3051
|
moreLoadingVisible,
|
|
3052
|
+
popperClass: mForm?.popperClass,
|
|
3053
|
+
getOptions,
|
|
2989
3054
|
getRequestFuc() {
|
|
2990
3055
|
return getConfig("request");
|
|
2991
3056
|
},
|
|
2992
|
-
async getInitOption() {
|
|
2993
|
-
},
|
|
2994
3057
|
changeHandler(value) {
|
|
2995
3058
|
emit("change", value);
|
|
2996
3059
|
},
|
|
@@ -3007,10 +3070,6 @@ const _sfc_main$6 = defineComponent({
|
|
|
3007
3070
|
options.value = await getOptions();
|
|
3008
3071
|
}
|
|
3009
3072
|
},
|
|
3010
|
-
async editAfterAction() {
|
|
3011
|
-
pgIndex.value = 0;
|
|
3012
|
-
options.value = await getOptions();
|
|
3013
|
-
},
|
|
3014
3073
|
async remoteMethod(q) {
|
|
3015
3074
|
if (!localOptions.value.length) {
|
|
3016
3075
|
query.value = q;
|
|
@@ -3025,7 +3084,7 @@ const _sfc_main$6 = defineComponent({
|
|
|
3025
3084
|
};
|
|
3026
3085
|
}
|
|
3027
3086
|
});
|
|
3028
|
-
const _hoisted_1$
|
|
3087
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3029
3088
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3030
3089
|
const _component_el_option = resolveComponent("el-option");
|
|
3031
3090
|
const _component_el_option_group = resolveComponent("el-option-group");
|
|
@@ -3039,6 +3098,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3039
3098
|
ref: "select",
|
|
3040
3099
|
clearable: "",
|
|
3041
3100
|
filterable: "",
|
|
3101
|
+
"popper-class": `m-select-popper ${_ctx.popperClass}`,
|
|
3042
3102
|
size: _ctx.size,
|
|
3043
3103
|
remote: _ctx.remote,
|
|
3044
3104
|
placeholder: _ctx.config.placeholder,
|
|
@@ -3046,21 +3106,21 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3046
3106
|
"value-key": _ctx.config.valueKey || "value",
|
|
3047
3107
|
"allow-create": _ctx.config.allowCreate,
|
|
3048
3108
|
disabled: _ctx.disabled,
|
|
3049
|
-
"remote-method": _ctx.remoteMethod,
|
|
3109
|
+
"remote-method": _ctx.config.remote && _ctx.remoteMethod,
|
|
3050
3110
|
onChange: _ctx.changeHandler,
|
|
3051
3111
|
onVisibleChange: _ctx.visibleHandler
|
|
3052
3112
|
}, {
|
|
3053
3113
|
default: withCtx(() => [
|
|
3054
3114
|
_ctx.config.group ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (group, index) => {
|
|
3055
3115
|
return openBlock(), createBlock(_component_el_option_group, {
|
|
3056
|
-
key:
|
|
3116
|
+
key: index,
|
|
3057
3117
|
label: group.label,
|
|
3058
3118
|
disabled: group.disabled
|
|
3059
3119
|
}, {
|
|
3060
3120
|
default: withCtx(() => [
|
|
3061
3121
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (item, index2) => {
|
|
3062
3122
|
return openBlock(), createBlock(_component_el_option, {
|
|
3063
|
-
key:
|
|
3123
|
+
key: index2,
|
|
3064
3124
|
label: item.label,
|
|
3065
3125
|
value: item.value,
|
|
3066
3126
|
disabled: item.disabled
|
|
@@ -3077,12 +3137,12 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3077
3137
|
disabled: option.disabled
|
|
3078
3138
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3079
3139
|
}), 128)),
|
|
3080
|
-
_ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$
|
|
3140
|
+
_ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3081
3141
|
[_directive_loading, true]
|
|
3082
3142
|
]) : createCommentVNode("", true)
|
|
3083
3143
|
]),
|
|
3084
3144
|
_: 1
|
|
3085
|
-
}, 8, ["modelValue", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method", "onChange", "onVisibleChange"])), [
|
|
3145
|
+
}, 8, ["modelValue", "popper-class", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method", "onChange", "onVisibleChange"])), [
|
|
3086
3146
|
[_directive_loading, _ctx.loading]
|
|
3087
3147
|
]) : createCommentVNode("", true);
|
|
3088
3148
|
}
|
|
@@ -3154,6 +3214,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3154
3214
|
},
|
|
3155
3215
|
emits: ["change", "input"],
|
|
3156
3216
|
setup(props, { emit }) {
|
|
3217
|
+
const mForm = inject("mForm");
|
|
3157
3218
|
useAddField(props.prop);
|
|
3158
3219
|
const modelName = computed(() => props.name || props.config.name || "");
|
|
3159
3220
|
return {
|
|
@@ -3162,12 +3223,10 @@ const _sfc_main$4 = defineComponent({
|
|
|
3162
3223
|
emit("change", v);
|
|
3163
3224
|
},
|
|
3164
3225
|
inputHandler(v) {
|
|
3165
|
-
const mForm = inject("mForm");
|
|
3166
3226
|
emit("input", v);
|
|
3167
3227
|
mForm?.$emit("field-input", props.prop, v);
|
|
3168
3228
|
},
|
|
3169
3229
|
buttonClickHandler() {
|
|
3170
|
-
const mForm = inject("mForm");
|
|
3171
3230
|
if (typeof props.config.append === "string")
|
|
3172
3231
|
return;
|
|
3173
3232
|
if (props.config.append?.handler) {
|
|
@@ -3231,7 +3290,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3231
3290
|
};
|
|
3232
3291
|
}
|
|
3233
3292
|
});
|
|
3234
|
-
const _hoisted_1$
|
|
3293
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3235
3294
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3236
3295
|
const _component_el_button = resolveComponent("el-button");
|
|
3237
3296
|
const _component_el_input = resolveComponent("el-input");
|
|
@@ -3249,17 +3308,18 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3249
3308
|
_ctx.config.append ? {
|
|
3250
3309
|
name: "append",
|
|
3251
3310
|
fn: withCtx(() => [
|
|
3252
|
-
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),
|
|
3253
3312
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (openBlock(), createBlock(_component_el_button, {
|
|
3254
3313
|
key: 1,
|
|
3255
3314
|
style: { "color": "#409eff" },
|
|
3256
|
-
|
|
3315
|
+
size: _ctx.size,
|
|
3316
|
+
onClick: withModifiers(_ctx.buttonClickHandler, ["prevent"])
|
|
3257
3317
|
}, {
|
|
3258
3318
|
default: withCtx(() => [
|
|
3259
3319
|
createTextVNode(toDisplayString(_ctx.config.append.text), 1)
|
|
3260
3320
|
]),
|
|
3261
3321
|
_: 1
|
|
3262
|
-
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
3322
|
+
}, 8, ["size", "onClick"])) : createCommentVNode("", true)
|
|
3263
3323
|
])
|
|
3264
3324
|
} : void 0
|
|
3265
3325
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
@@ -3298,22 +3358,19 @@ const _sfc_main$3 = defineComponent({
|
|
|
3298
3358
|
};
|
|
3299
3359
|
}
|
|
3300
3360
|
});
|
|
3301
|
-
const _hoisted_1$1 = { key: 0 };
|
|
3302
3361
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3303
3362
|
const _component_el_input = resolveComponent("el-input");
|
|
3304
|
-
return
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"])
|
|
3316
|
-
])) : 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"]);
|
|
3317
3374
|
}
|
|
3318
3375
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3319
3376
|
|
|
@@ -3403,6 +3460,9 @@ const _sfc_main$1 = defineComponent({
|
|
|
3403
3460
|
keyProp: {
|
|
3404
3461
|
type: String,
|
|
3405
3462
|
default: "__key"
|
|
3463
|
+
},
|
|
3464
|
+
popperClass: {
|
|
3465
|
+
type: String
|
|
3406
3466
|
}
|
|
3407
3467
|
},
|
|
3408
3468
|
emits: ["change", "field-input", "field-change"],
|
|
@@ -3414,6 +3474,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
3414
3474
|
const requestFuc = getConfig("request");
|
|
3415
3475
|
const formState = reactive({
|
|
3416
3476
|
keyProp: props.keyProp,
|
|
3477
|
+
popperClass: props.popperClass,
|
|
3417
3478
|
config: props.config,
|
|
3418
3479
|
initValues: props.initValues,
|
|
3419
3480
|
parentValues: props.parentValues,
|
|
@@ -3457,7 +3518,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
3457
3518
|
submitForm: async (native) => {
|
|
3458
3519
|
try {
|
|
3459
3520
|
await elForm.value?.validate();
|
|
3460
|
-
return native ? values.value : cloneDeep(values.value);
|
|
3521
|
+
return native ? values.value : cloneDeep(toRaw(values.value));
|
|
3461
3522
|
} catch (invalidFields) {
|
|
3462
3523
|
const error = [];
|
|
3463
3524
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|